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
14403103
Commit
14403103
authored
Nov 15, 2012
by
Vik Paruchuri
Committed by
Victor Shnayder
Nov 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove msg key from xqueue passback dict
parent
9abd8020
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
common/lib/capa/capa/responsetypes.py
+3
-7
No files found.
common/lib/capa/capa/responsetypes.py
View file @
14403103
...
@@ -2001,7 +2001,6 @@ class OpenEndedResponse(LoncapaResponse):
...
@@ -2001,7 +2001,6 @@ class OpenEndedResponse(LoncapaResponse):
valid_score_msg: Flag indicating valid score_msg format (Boolean)
valid_score_msg: Flag indicating valid score_msg format (Boolean)
correct: Correctness of submission (Boolean)
correct: Correctness of submission (Boolean)
score: Points to be assigned (numeric, can be float)
score: Points to be assigned (numeric, can be float)
msg: Message from grader to display to student (string)
"""
"""
fail
=
(
False
,
False
,
0
,
''
)
fail
=
(
False
,
False
,
0
,
''
)
try
:
try
:
...
@@ -2014,26 +2013,23 @@ class OpenEndedResponse(LoncapaResponse):
...
@@ -2014,26 +2013,23 @@ class OpenEndedResponse(LoncapaResponse):
log
.
error
(
"External grader message should be a JSON-serialized dict."
log
.
error
(
"External grader message should be a JSON-serialized dict."
" Received score_result =
%
s"
%
score_result
)
" Received score_result =
%
s"
%
score_result
)
return
fail
return
fail
for
tag
in
[
'correct'
,
'score'
,
'msg'
,
'feedback'
]:
for
tag
in
[
'correct'
,
'score'
,
'feedback'
]:
if
tag
not
in
score_result
:
if
tag
not
in
score_result
:
log
.
error
(
"External grader message is missing one or more required"
log
.
error
(
"External grader message is missing one or more required"
" tags: 'correct', 'score', '
msg', '
feedback"
)
" tags: 'correct', 'score', 'feedback"
)
return
fail
return
fail
# Next, we need to check that the contents of the external grader message
# Next, we need to check that the contents of the external grader message
# is safe for the LMS.
# is safe for the LMS.
# 1) Make sure that the message is valid XML (proper opening/closing tags)
# 1) Make sure that the message is valid XML (proper opening/closing tags)
# 2) TODO: Is the message actually HTML?
# 2) TODO: Is the message actually HTML?
msg
=
score_result
[
'msg'
]
feedback
=
score_result
[
'feedback'
]
feedback
=
score_result
[
'feedback'
]
try
:
try
:
etree
.
fromstring
(
msg
)
etree
.
fromstring
(
feedback
)
etree
.
fromstring
(
feedback
)
except
etree
.
XMLSyntaxError
as
err
:
except
etree
.
XMLSyntaxError
as
err
:
log
.
error
(
"Unable to parse external grader message as valid"
log
.
error
(
"Unable to parse external grader message as valid"
" Msg: score_msg['msg']=
%
r "
"
\n
Feedback : score_result['feedback'] =
%
r"
,
feedback
)
"
\n
Feedback : score_result['feedback'] =
%
r"
,
msg
,
feedback
)
return
fail
return
fail
#Currently ignore msg and only return feedback (which takes the place of msg)
#Currently ignore msg and only return feedback (which takes the place of msg)
...
...
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