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
0c3eb67d
Commit
0c3eb67d
authored
Jan 03, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More descriptive error message
parent
cce6b701
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
common/lib/capa/capa/responsetypes.py
+8
-5
No files found.
common/lib/capa/capa/responsetypes.py
View file @
0c3eb67d
...
@@ -1932,13 +1932,13 @@ class OpenEndedResponse(LoncapaResponse):
...
@@ -1932,13 +1932,13 @@ class OpenEndedResponse(LoncapaResponse):
if
tag
not
in
survey_responses
:
if
tag
not
in
survey_responses
:
return
False
,
"Could not find needed tag {0}"
.
format
(
tag
)
return
False
,
"Could not find needed tag {0}"
.
format
(
tag
)
try
:
try
:
log
.
debug
(
survey_responses
[
'submission_id'
])
submission_id
=
int
(
survey_responses
[
'submission_id'
])
submission_id
=
int
(
survey_responses
[
'submission_id'
])
grader_id
=
int
(
survey_responses
[
'grader_id'
])
grader_id
=
int
(
survey_responses
[
'grader_id'
])
feedback
=
str
(
survey_responses
[
'feedback'
])
feedback
=
str
(
survey_responses
[
'feedback'
])
score
=
int
(
survey_responses
[
'score'
])
score
=
int
(
survey_responses
[
'score'
])
except
:
except
:
error_message
=
"Could not parse submission id, grader id, or feedback from message_post ajax call."
error_message
=
(
"Could not parse submission id, grader id, "
"or feedback from message_post ajax call. Here is the message data: {0}"
.
format
(
survey_responses
))
log
.
exception
(
error_message
)
log
.
exception
(
error_message
)
return
False
,
error_message
return
False
,
error_message
...
@@ -2130,7 +2130,7 @@ class OpenEndedResponse(LoncapaResponse):
...
@@ -2130,7 +2130,7 @@ class OpenEndedResponse(LoncapaResponse):
{value}
{value}
</div>
</div>
"""
.
format
(
feedback_type
=
feedback_type
,
value
=
value
)
"""
.
format
(
feedback_type
=
feedback_type
,
value
=
value
)
return
cgi
.
escape
(
feedback
)
return
feedback
def
format_feedback_hidden
(
feedback_type
,
value
):
def
format_feedback_hidden
(
feedback_type
,
value
):
feedback_type
,
value
=
encode_values
(
feedback_type
,
value
)
feedback_type
,
value
=
encode_values
(
feedback_type
,
value
)
...
@@ -2139,7 +2139,7 @@ class OpenEndedResponse(LoncapaResponse):
...
@@ -2139,7 +2139,7 @@ class OpenEndedResponse(LoncapaResponse):
{value}
{value}
</div>
</div>
"""
.
format
(
feedback_type
=
feedback_type
,
value
=
value
)
"""
.
format
(
feedback_type
=
feedback_type
,
value
=
value
)
return
cgi
.
escape
(
feedback
)
return
feedback
# TODO (vshnayder): design and document the details of this format so
# TODO (vshnayder): design and document the details of this format so
# that we can do proper escaping here (e.g. are the graders allowed to
# that we can do proper escaping here (e.g. are the graders allowed to
...
@@ -2165,7 +2165,10 @@ class OpenEndedResponse(LoncapaResponse):
...
@@ -2165,7 +2165,10 @@ class OpenEndedResponse(LoncapaResponse):
else
:
else
:
feedback_list_part1
=
format_feedback
(
'errors'
,
response_items
[
'feedback'
])
feedback_list_part1
=
format_feedback
(
'errors'
,
response_items
[
'feedback'
])
feedback_list_part2
=
u"
\n
"
.
join
([
format_feedback_hidden
(
k
,
response_items
[
k
])
for
k
in
response_items
.
keys
()
if
k
in
[
'submission_id'
,
'grader_id'
]])
feedback_list_part2
=
(
u"
\n
"
.
join
([
format_feedback_hidden
(
feedback_type
,
value
)
for
feedback_type
,
value
in
response_items
.
items
()
if
feedback_type
in
[
'submission_id'
,
'grader_id'
]]))
return
u"
\n
"
.
join
([
feedback_list_part1
,
feedback_list_part2
])
return
u"
\n
"
.
join
([
feedback_list_part1
,
feedback_list_part2
])
def
_format_feedback
(
self
,
response_items
):
def
_format_feedback
(
self
,
response_items
):
...
...
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