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
1eaf424c
Commit
1eaf424c
authored
Dec 05, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change some things to use format
parent
e813dc35
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
common/lib/capa/capa/responsetypes.py
+5
-5
No files found.
common/lib/capa/capa/responsetypes.py
View file @
1eaf424c
...
...
@@ -1996,13 +1996,13 @@ class OpenEndedResponse(LoncapaResponse):
oldcmap
.
set
(
self
.
answer_id
,
npoints
=
points
,
correctness
=
correctness
,
msg
=
msg
.
replace
(
' '
,
' '
),
queuestate
=
None
)
else
:
log
.
debug
(
'OpenEndedResponse: queuekey
%
s does not match for answer_id=
%
s.'
%
(
queuekey
,
self
.
answer_id
))
log
.
debug
(
'OpenEndedResponse: queuekey
{0} does not match for answer_id={1}.'
.
format
(
queuekey
,
self
.
answer_id
))
return
oldcmap
def
get_answers
(
self
):
anshtml
=
'<span class="openended-answer"><pre><code>
%
s</code></pre></span>'
%
self
.
answer
anshtml
=
'<span class="openended-answer"><pre><code>
{0}</code></pre></span>'
.
format
(
self
.
answer
)
return
{
self
.
answer_id
:
anshtml
}
def
get_initial_display
(
self
):
...
...
@@ -2089,11 +2089,11 @@ class OpenEndedResponse(LoncapaResponse):
score_result
=
json
.
loads
(
score_msg
)
except
(
TypeError
,
ValueError
):
log
.
error
(
"External grader message should be a JSON-serialized dict."
" Received score_msg =
%
s"
%
score_msg
)
" Received score_msg =
{0}"
.
format
(
score_msg
)
)
return
fail
if
not
isinstance
(
score_result
,
dict
):
log
.
error
(
"External grader message should be a JSON-serialized dict."
" Received score_result =
%
s"
%
score_result
)
" Received score_result =
{0}"
.
format
(
score_result
)
)
return
fail
for
tag
in
[
'score'
,
'feedback'
,
'grader_type'
,
'success'
]:
if
tag
not
in
score_result
:
...
...
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