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
ce744478
Commit
ce744478
authored
Nov 07, 2012
by
Vik Paruchuri
Committed by
Victor Shnayder
Nov 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in feedback, work on css to display open ended feedback
parent
e2d19d1a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
common/lib/capa/capa/responsetypes.py
+7
-3
common/lib/xmodule/xmodule/css/capa/display.scss
+15
-0
No files found.
common/lib/capa/capa/responsetypes.py
View file @
ce744478
...
...
@@ -1937,6 +1937,7 @@ class OpenEndedResponse(LoncapaResponse):
return
cmap
def
update_score
(
self
,
score_msg
,
oldcmap
,
queuekey
):
log
.
debug
(
score_msg
)
(
valid_score_msg
,
correct
,
points
,
msg
)
=
self
.
_parse_score_msg
(
score_msg
)
if
not
valid_score_msg
:
oldcmap
.
set
(
self
.
answer_id
,
...
...
@@ -1996,17 +1997,20 @@ 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
[
'correct'
,
'score'
,
'msg'
]:
for
tag
in
[
'correct'
,
'score'
,
'msg'
,
'feedback'
]:
if
tag
not
in
score_result
:
log
.
error
(
"External grader message is missing one or more required"
" tags: 'correct', 'score', 'msg'"
)
" tags: 'correct', 'score', 'msg'
, 'feedback
"
)
return
fail
#Extract feedback from score_result
feedback
=
score_result
[
'feedback'
]
# Next, we need to check that the contents of the external grader message
# is safe for the LMS.
# 1) Make sure that the message is valid XML (proper opening/closing tags)
# 2) TODO: Is the message actually HTML?
msg
=
score_result
[
'msg'
]
try
:
etree
.
fromstring
(
msg
)
except
etree
.
XMLSyntaxError
as
err
:
...
...
@@ -2014,7 +2018,7 @@ class OpenEndedResponse(LoncapaResponse):
" XML: score_msg['msg']=
%
s"
%
msg
)
return
fail
return
(
True
,
score_result
[
'correct'
],
score_result
[
'score'
],
msg
)
return
(
True
,
score_result
[
'correct'
],
score_result
[
'score'
],
feedback
)
#-----------------------------------------------------------------------------
# TEMPORARY: List of all response subclasses
...
...
common/lib/xmodule/xmodule/css/capa/display.scss
View file @
ce744478
...
...
@@ -685,6 +685,21 @@ section.problem {
color
:
#B00
;
}
}
.markup-text
{
margin
:
5px
;
padding
:
20px
0px
15px
50px
;
border-top
:
1px
solid
#DDD
;
border-left
:
20px
solid
#FAFAFA
;
.badspelling
{
color
:
#BB0000
;
}
.badgrammar
{
color
:
#BDA046
;
}
}
}
}
}
...
...
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