Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
9f6afcb6
Commit
9f6afcb6
authored
Jan 25, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some more tests
parent
a26006f7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
common/lib/xmodule/xmodule/tests/test_combined_open_ended.py
+17
-2
No files found.
common/lib/xmodule/xmodule/tests/test_combined_open_ended.py
View file @
9f6afcb6
...
...
@@ -263,7 +263,6 @@ class CombinedOpenEndedModuleTest(unittest.TestCase):
location
=
Location
([
"i4x"
,
"edX"
,
"open_ended"
,
"combinedopenended"
,
"SampleQuestion"
])
metadata
=
json
.
dumps
({
'attempts'
:
'10'
})
prompt
=
"<prompt>This is a question prompt</prompt>"
rubric
=
'''<rubric><rubric>
<category>
...
...
@@ -273,6 +272,8 @@ class CombinedOpenEndedModuleTest(unittest.TestCase):
</rubric></rubric>'''
max_score
=
4
metadata
=
{
'attempts'
:
'10'
,
'max_score'
:
max_score
}
static_data
=
json
.
dumps
({
'max_attempts'
:
20
,
'prompt'
:
prompt
,
...
...
@@ -303,9 +304,23 @@ class CombinedOpenEndedModuleTest(unittest.TestCase):
descriptor
=
Mock
()
def
setUp
(
self
):
self
.
combinedoe
=
CombinedOpenEndedModule
(
test_system
,
self
.
location
,
self
.
definition
,
self
.
descriptor
,
self
.
static_data
,
self
.
metadata
)
self
.
combinedoe
=
CombinedOpenEndedModule
(
test_system
,
self
.
location
,
self
.
definition
,
self
.
descriptor
,
self
.
static_data
,
metadata
=
self
.
metadata
)
def
test_get_tag_name
(
self
):
name
=
self
.
combinedoe
.
get_tag_name
(
"<t>Tag</t>"
)
self
.
assertEqual
(
name
,
"t"
)
def
test_get_last_response
(
self
):
response_dict
=
self
.
combinedoe
.
get_last_response
(
0
)
self
.
assertEqual
(
response_dict
[
'type'
],
"selfassessment"
)
self
.
assertEqual
(
response_dict
[
'max_score'
],
self
.
max_score
)
self
.
assertEqual
(
response_dict
[
'state'
],
CombinedOpenEndedModule
.
INITIAL
)
def
test_update_task_states
(
self
):
changed
=
self
.
combinedoe
.
update_task_states
()
self
.
assertFalse
(
changed
)
# do something to change the state
# check again
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment