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
b38a36d4
Commit
b38a36d4
authored
Jun 28, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test
parent
8a6c8b5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
common/lib/xmodule/xmodule/tests/test_combined_open_ended.py
+6
-2
lms/djangoapps/open_ended_grading/staff_grading_service.py
+5
-0
No files found.
common/lib/xmodule/xmodule/tests/test_combined_open_ended.py
View file @
b38a36d4
...
...
@@ -630,9 +630,9 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
module
.
handle_ajax
(
"reset"
,
{})
self
.
assertEqual
(
module
.
state
,
"initial"
)
class
OpenEndedModuleXmlTest
(
unittest
.
TestCase
,
DummyModulestore
):
class
OpenEndedModuleXml
Attempt
Test
(
unittest
.
TestCase
,
DummyModulestore
):
"""
Test
the student flow in the combined open ended xmodule
Test
if student is able to reset the problem
"""
problem_location
=
Location
([
"i4x"
,
"edX"
,
"open_ended"
,
"combinedopenended"
,
"SampleQuestion1Attempt"
])
answer
=
"blah blah"
...
...
@@ -649,6 +649,7 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
def
test_reset_fail
(
self
):
"""
Test the flow of the module if we complete the self assessment step and then reset
Since the problem only allows one attempt, should fail.
@return:
"""
assessment
=
[
0
,
1
]
...
...
@@ -675,8 +676,11 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
html
=
module
.
get_html
()
self
.
assertTrue
(
isinstance
(
html
,
basestring
))
#Module should now be done
rubric
=
module
.
handle_ajax
(
"get_combined_rubric"
,
{})
self
.
assertTrue
(
isinstance
(
rubric
,
basestring
))
self
.
assertEqual
(
module
.
state
,
"done"
)
#Try to reset, should fail because only 1 attempt is allowed
reset_data
=
json
.
loads
(
module
.
handle_ajax
(
"reset"
,
{}))
self
.
assertEqual
(
reset_data
[
'success'
],
False
)
lms/djangoapps/open_ended_grading/staff_grading_service.py
View file @
b38a36d4
...
...
@@ -270,6 +270,11 @@ def get_problem_list(request, course_id):
problem_list
=
response
[
'problem_list'
]
valid_problem_list
=
[]
for
i
in
xrange
(
0
,
len
(
problem_list
)):
#Needed to ensure that the 'location' key can be accessed
try
:
problem_list
[
i
]
=
json
.
loads
(
problem_list
[
i
])
except
Exception
:
pass
if
does_location_exist
(
course_id
,
problem_list
[
i
][
'location'
]):
valid_problem_list
.
append
(
problem_list
[
i
])
response
[
'problem_list'
]
=
valid_problem_list
...
...
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