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
862beafd
Commit
862beafd
authored
Nov 13, 2013
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Persist student answers on input error
LMS-469
parent
32bc26c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
+10
-1
common/lib/capa/capa/responsetypes.py
+4
-1
common/lib/xmodule/xmodule/capa_module.py
+6
-0
No files found.
common/lib/capa/capa/responsetypes.py
View file @
862beafd
...
@@ -1805,7 +1805,10 @@ class FormulaResponse(LoncapaResponse):
...
@@ -1805,7 +1805,10 @@ class FormulaResponse(LoncapaResponse):
def
get_score
(
self
,
student_answers
):
def
get_score
(
self
,
student_answers
):
given
=
student_answers
[
self
.
answer_id
]
given
=
student_answers
[
self
.
answer_id
]
correctness
=
self
.
check_formula
(
correctness
=
self
.
check_formula
(
self
.
correct_answer
,
given
,
self
.
samples
)
self
.
correct_answer
,
given
,
self
.
samples
)
return
CorrectMap
(
self
.
answer_id
,
correctness
)
return
CorrectMap
(
self
.
answer_id
,
correctness
)
def
tupleize_answers
(
self
,
answer
,
var_dict_list
):
def
tupleize_answers
(
self
,
answer
,
var_dict_list
):
...
...
common/lib/xmodule/xmodule/capa_module.py
View file @
862beafd
...
@@ -941,6 +941,9 @@ class CapaModule(CapaFields, XModule):
...
@@ -941,6 +941,9 @@ class CapaModule(CapaFields, XModule):
log
.
warning
(
"StudentInputError in capa_module:problem_check"
,
log
.
warning
(
"StudentInputError in capa_module:problem_check"
,
exc_info
=
True
)
exc_info
=
True
)
# Save the user's state before failing
self
.
set_state_from_lcp
()
# If the user is a staff member, include
# If the user is a staff member, include
# the full exception, including traceback,
# the full exception, including traceback,
# in the response
# in the response
...
@@ -955,6 +958,9 @@ class CapaModule(CapaFields, XModule):
...
@@ -955,6 +958,9 @@ class CapaModule(CapaFields, XModule):
return
{
'success'
:
msg
}
return
{
'success'
:
msg
}
except
Exception
as
err
:
except
Exception
as
err
:
# Save the user's state before failing
self
.
set_state_from_lcp
()
if
self
.
system
.
DEBUG
:
if
self
.
system
.
DEBUG
:
msg
=
u"Error checking problem: {}"
.
format
(
err
.
message
)
msg
=
u"Error checking problem: {}"
.
format
(
err
.
message
)
msg
+=
u'
\n
Traceback:
\n
{}'
.
format
(
traceback
.
format_exc
())
msg
+=
u'
\n
Traceback:
\n
{}'
.
format
(
traceback
.
format_exc
())
...
...
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