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
4234daeb
Commit
4234daeb
authored
Jan 29, 2014
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2353 from edx/alex/no_error_on_empty_answer_to_master
Alex/no error on empty answer to master
parents
8424f610
9876c993
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
common/lib/capa/capa/responsetypes.py
+0
-2
common/lib/capa/capa/tests/test_responsetypes.py
+6
-4
No files found.
common/lib/capa/capa/responsetypes.py
View file @
4234daeb
...
...
@@ -949,8 +949,6 @@ class NumericalResponse(LoncapaResponse):
if
self
.
range_tolerance
:
if
isinstance
(
student_float
,
complex
):
raise
StudentInputError
(
_
(
u"You may not use complex numbers in range tolerance problems"
))
if
isnan
(
student_float
):
raise
general_exception
boundaries
=
[]
for
inclusion
,
answer
in
zip
(
self
.
inclusion
,
self
.
answer_range
):
boundary
=
self
.
get_staff_ans
(
answer
)
...
...
common/lib/capa/capa/tests/test_responsetypes.py
View file @
4234daeb
...
...
@@ -649,7 +649,7 @@ class StringResponseTest(ResponseTest):
def
test_case_sensitive
(
self
):
# Test single answer
problem_specified
=
self
.
build_problem
(
answer
=
"Second"
,
case_sensitive
=
True
)
# should also be case_sensitive if case sensitivity is not specified
problem_not_specified
=
self
.
build_problem
(
answer
=
"Second"
)
problems
=
[
problem_specified
,
problem_not_specified
]
...
...
@@ -1105,11 +1105,13 @@ class NumericalResponseTest(ResponseTest):
with
self
.
assertRaises
(
StudentInputError
):
problem
.
grade_answers
(
input_dict
)
# test isnan variable
# test isnan student input: no exception,
# but problem should be graded as incorrect
problem
=
self
.
build_problem
(
answer
=
'(1, 5)'
)
input_dict
=
{
'1_2_1'
:
''
}
with
self
.
assertRaises
(
StudentInputError
):
problem
.
grade_answers
(
input_dict
)
correct_map
=
problem
.
grade_answers
(
input_dict
)
correctness
=
correct_map
.
get_correctness
(
'1_2_1'
)
self
.
assertEqual
(
correctness
,
'incorrect'
)
# test invalid range tolerance answer
with
self
.
assertRaises
(
StudentInputError
):
...
...
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