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
e62f8d75
Commit
e62f8d75
authored
Aug 29, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More info in StudentInputError
parent
1fd2f0c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
common/lib/capa/capa/responsetypes.py
+6
-3
No files found.
common/lib/capa/capa/responsetypes.py
View file @
e62f8d75
...
...
@@ -8,6 +8,7 @@ Used by capa_problem.py
'''
# standard library imports
import
cgi
import
inspect
import
json
import
logging
...
...
@@ -725,7 +726,8 @@ class NumericalResponse(LoncapaResponse):
# I think this is just pyparsing.ParseException, calc.UndefinedVariable:
# But we'd need to confirm
except
:
raise
StudentInputError
(
'Invalid input -- please use a number only'
)
raise
StudentInputError
(
"Invalid input: could not parse '
%
s' as a number"
%
\
cgi
.
escape
(
student_answer
))
if
correct
:
return
CorrectMap
(
self
.
answer_id
,
'correct'
)
...
...
@@ -1517,11 +1519,12 @@ class FormulaResponse(LoncapaResponse):
cs
=
self
.
case_sensitive
)
except
UndefinedVariable
as
uv
:
log
.
debug
(
'formularesponse: undefined variable in given=
%
s'
%
given
)
raise
StudentInputError
(
uv
.
message
+
" not permitted in answer"
)
raise
StudentInputError
(
"Invalid input: "
+
uv
.
message
+
" not permitted in answer"
)
except
Exception
as
err
:
#traceback.print_exc()
log
.
debug
(
'formularesponse: error
%
s in formula'
%
err
)
raise
StudentInputError
(
"Error in formula"
)
raise
StudentInputError
(
"Invalid input: Could not parse '
%
s' as a formula"
%
\
cgi
.
escape
(
given
))
if
numpy
.
isnan
(
student_result
)
or
numpy
.
isinf
(
student_result
):
return
"incorrect"
if
not
compare_with_tolerance
(
student_result
,
instructor_result
,
self
.
tolerance
):
...
...
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