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
7330bef8
Commit
7330bef8
authored
Nov 30, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes to fix compatibility with controller feedback
parent
15c50729
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
common/lib/capa/capa/responsetypes.py
+7
-12
lms/templates/open_ended_feedback.html
+2
-1
No files found.
common/lib/capa/capa/responsetypes.py
View file @
7330bef8
...
...
@@ -2039,21 +2039,17 @@ class OpenEndedResponse(LoncapaResponse):
"""
if
not
response_items
[
'success'
]:
return
True
,
render_to_string
(
"open_ended_error.html"
,
{
'errors'
:
response_items
[
'feedback'
]
[
'errors'
]
})
return
True
,
render_to_string
(
"open_ended_error.html"
,
{
'errors'
:
response_items
[
'feedback'
]})
problem_areas
=
response_items
[
'feedback'
]
.
count
(
"</div>"
)
feedback_item_start
=
'<div class="{feedback_key}">'
feedback_item_end
=
'</div>'
feedback_long
=
""
for
k
,
v
in
response_items
[
'feedback'
]:
feedback_long
+=
feedback_item_start
.
format
(
feedback_key
=
k
)
feedback_long
+=
v
feedback_long
+=
feedback_item_end
feedback
=
response_items
[
'feedback'
]
feedback_template
=
render_to_string
(
"open_ended_feedback.html"
,{
'grader_type'
:
response_items
[
'grader_type'
],
'score'
:
response_items
[
'score'
],
'feedback_long'
:
feedback_long
,
'feedback'
:
feedback
,
'problem_areas'
:
problem_areas
,
})
return
True
,
feedback_template
...
...
@@ -2084,10 +2080,9 @@ class OpenEndedResponse(LoncapaResponse):
log
.
error
(
"External grader message should be a JSON-serialized dict."
" Received score_result =
%
s"
%
score_result
)
return
fail
for
tag
in
[
'score'
,
'feedback'
,
'grader_type'
,
'success'
,
'errors'
]:
for
tag
in
[
'score'
,
'feedback'
,
'grader_type'
,
'success'
,
'errors'
]:
if
tag
not
in
score_result
:
log
.
error
(
"External grader message is missing one or more required"
" tags: 'score', 'feedback"
)
log
.
error
(
"External grader message is missing required tag: {0}"
.
format
(
tag
))
return
fail
# Next, we need to check that the contents of the external grader message
...
...
lms/templates/open_ended_feedback.html
View file @
7330bef8
...
...
@@ -10,7 +10,7 @@
</div>
<div
class=
"longform"
>
<div
class=
"result-output"
>
${feedback
_long
}
${feedback}
</div>
</div>
</section>
\ No newline at end of file
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