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
efaa0eea
Commit
efaa0eea
authored
Mar 06, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More fixes to the merge, now all tests pass.
parent
be79810f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
common/lib/capa/capa/responsetypes.py
+9
-1
common/lib/capa/capa/tests/test_responsetypes.py
+2
-2
No files found.
common/lib/capa/capa/responsetypes.py
View file @
efaa0eea
...
...
@@ -1086,7 +1086,15 @@ class CustomResponse(LoncapaResponse):
# to the same correct/incorrect value
if
'ok'
in
ret
:
correct
=
[
'correct'
if
ret
[
'ok'
]
else
'incorrect'
]
*
len
(
idset
)
self
.
context
[
'messages'
][
0
]
=
self
.
clean_message_html
(
ret
[
'msg'
])
msg
=
ret
.
get
(
'msg'
,
None
)
msg
=
self
.
clean_message_html
(
msg
)
# If there is only one input, apply the message to that input
# Otherwise, apply the message to the whole problem
if
len
(
idset
)
>
1
:
self
.
context
[
'overall_message'
]
=
msg
else
:
self
.
context
[
'messages'
][
0
]
=
msg
# Another kind of dictionary the check function can return has
# the form:
...
...
common/lib/capa/capa/tests/test_responsetypes.py
View file @
efaa0eea
...
...
@@ -977,7 +977,7 @@ class CustomResponseTest(ResponseTest):
msg
=
correct_map
.
get_msg
(
'1_2_1'
)
self
.
assertEqual
(
correctness
,
'correct'
)
self
.
assertEqual
(
msg
,
"Message text
\n
"
)
self
.
assertEqual
(
msg
,
"Message text"
)
# Incorrect answer
input_dict
=
{
'1_2_1'
:
'0'
}
...
...
@@ -987,7 +987,7 @@ class CustomResponseTest(ResponseTest):
msg
=
correct_map
.
get_msg
(
'1_2_1'
)
self
.
assertEqual
(
correctness
,
'incorrect'
)
self
.
assertEqual
(
msg
,
"Message text
\n
"
)
self
.
assertEqual
(
msg
,
"Message text"
)
def
test_multiple_inputs_return_one_status
(
self
):
# When given multiple inputs, the 'answer_given' argument
...
...
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