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
b462e632
Commit
b462e632
authored
Mar 02, 2016
by
Ayub khan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11119 from Ayub-Khan/ayubkhan/TNL-767
Fix behaviour on empty response to problems
parents
2ab54f31
dce5bbc0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
common/lib/capa/capa/responsetypes.py
+4
-0
common/lib/capa/capa/tests/test_responsetypes.py
+7
-0
No files found.
common/lib/capa/capa/responsetypes.py
View file @
b462e632
...
...
@@ -2134,6 +2134,10 @@ class StringResponse(LoncapaResponse):
Note: for old code, which supports _or_ separator, we add some backward compatibility handling.
Should be removed soon. When to remove it, is up to Lyla Fisher.
"""
# if given answer is empty.
if
not
given
:
return
False
_
=
self
.
capa_system
.
i18n
.
ugettext
# backward compatibility, should be removed in future.
if
self
.
backward
:
...
...
common/lib/capa/capa/tests/test_responsetypes.py
View file @
b462e632
...
...
@@ -946,6 +946,13 @@ class StringResponseTest(ResponseTest): # pylint: disable=missing-docstring
hint
=
correct_map
.
get_hint
(
'1_2_1'
)
self
.
assertEqual
(
hint
,
self
.
_get_random_number_result
(
problem
.
seed
))
def
test_empty_answer_graded_as_incorrect
(
self
):
"""
Tests that problem should be graded incorrect if blank space is chosen as answer
"""
problem
=
self
.
build_problem
(
answer
=
" "
,
case_sensitive
=
False
,
regexp
=
True
)
self
.
assert_grade
(
problem
,
u" "
,
"incorrect"
)
class
CodeResponseTest
(
ResponseTest
):
# pylint: disable=missing-docstring
xml_factory_class
=
CodeResponseXMLFactory
...
...
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