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
fcfacf22
Commit
fcfacf22
authored
Jun 28, 2016
by
Jesse Zoldak
Committed by
GitHub
Jun 28, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "TNL 4141"
parent
013bf65c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
common/lib/capa/capa/responsetypes.py
+1
-4
common/lib/capa/capa/tests/test_responsetypes.py
+4
-4
No files found.
common/lib/capa/capa/responsetypes.py
View file @
fcfacf22
...
...
@@ -189,10 +189,7 @@ class LoncapaResponse(object):
raise
LoncapaProblemError
(
msg
)
for
prop
in
self
.
required_attributes
:
prop_value
=
xml
.
get
(
prop
)
if
prop_value
:
# Stripping off the empty strings
prop_value
=
prop_value
.
strip
()
if
not
prop_value
:
if
not
xml
.
get
(
prop
):
msg
=
"Error in problem specification:
%
s missing required attribute
%
s"
%
(
unicode
(
self
),
prop
)
msg
+=
"
\n
See XML source line
%
s"
%
getattr
(
...
...
common/lib/capa/capa/tests/test_responsetypes.py
View file @
fcfacf22
...
...
@@ -946,12 +946,12 @@ 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_
problem_creation_not_allowed
(
self
):
def
test_empty_answer_
graded_as_incorrect
(
self
):
"""
Tests that
empty answer string is not allowed to create a problem
Tests that
problem should be graded incorrect if blank space is chosen as answer
"""
with
self
.
assertRaises
(
LoncapaProblemError
):
self
.
build_problem
(
answer
=
" "
,
case_sensitive
=
False
,
regexp
=
True
)
problem
=
self
.
build_problem
(
answer
=
" "
,
case_sensitive
=
False
,
regexp
=
True
)
self
.
assert_grade
(
problem
,
u" "
,
"incorrect"
)
class
CodeResponseTest
(
ResponseTest
):
# pylint: disable=missing-docstring
...
...
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