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
42f8afb0
Commit
42f8afb0
authored
Dec 06, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address minor code review comments
parent
3da72712
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
common/lib/capa/capa/responsetypes.py
+16
-15
No files found.
common/lib/capa/capa/responsetypes.py
View file @
42f8afb0
...
...
@@ -1880,15 +1880,15 @@ class OpenEndedResponse(LoncapaResponse):
# NOTE: self.system.location is valid because the capa_module
# __init__ adds it (easiest way to get problem location into
# response types)
parsed_grader_payload
.
update
({
'location'
:
self
.
system
.
location
,
'course_id'
:
self
.
system
.
course_id
,
'prompt'
:
prompt_string
,
'rubric'
:
rubric_string
,
})
updated_grader_payload
=
json
.
dumps
(
parsed_grader_payload
)
except
Exception
as
err
:
except
ValueError
:
log
.
exception
(
"Grader payload
%
r is not a json object!"
,
grader_payload
)
parsed_grader_payload
.
update
({
'location'
:
self
.
system
.
location
,
'course_id'
:
self
.
system
.
course_id
,
'prompt'
:
prompt_string
,
'rubric'
:
rubric_string
,
})
updated_grader_payload
=
json
.
dumps
(
parsed_grader_payload
)
self
.
payload
=
{
'grader_payload'
:
updated_grader_payload
}
...
...
@@ -1903,9 +1903,11 @@ class OpenEndedResponse(LoncapaResponse):
try
:
submission
=
student_answers
[
self
.
answer_id
]
except
Exception
as
err
:
log
.
error
(
'Error in OpenEndedResponse {0}: cannot get student answer for {1}'
.
format
(
err
,
self
.
answer_id
))
raise
except
KeyError
:
msg
=
(
'Cannot get student answer for answer_id: {0}. student_answers {1}'
.
format
(
self
.
answer_id
,
student_answers
))
log
.
exception
(
msg
)
raise
LoncapaProblemError
(
msg
)
# Prepare xqueue request
#------------------------------------------------------------
...
...
@@ -1959,7 +1961,7 @@ class OpenEndedResponse(LoncapaResponse):
# the problem has been queued
# 2) Frontend: correctness='incomplete' eventually trickles down
# through inputtypes.textbox and .filesubmission to inform the
# browser t
o poll the LMS
# browser t
hat the submission is queued (and it could e.g. poll)
cmap
.
set
(
self
.
answer_id
,
queuestate
=
queuestate
,
correctness
=
'incomplete'
,
msg
=
msg
)
...
...
@@ -1984,9 +1986,8 @@ class OpenEndedResponse(LoncapaResponse):
# Sanity check on returned points
if
points
<
0
:
points
=
0
elif
points
>
self
.
maxpoints
[
self
.
answer_id
]:
points
=
self
.
maxpoints
[
self
.
answer_id
]
# Queuestate is consumed
# Queuestate is consumed, so reset it to None
oldcmap
.
set
(
self
.
answer_id
,
npoints
=
points
,
correctness
=
correctness
,
msg
=
msg
.
replace
(
' '
,
' '
),
queuestate
=
None
)
else
:
...
...
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