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
8e87d492
Commit
8e87d492
authored
Nov 05, 2012
by
Vik Paruchuri
Committed by
Victor Shnayder
Nov 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup grader type parameter to be paarsed from xml
parent
de6e913d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
common/lib/capa/capa/responsetypes.py
+9
-7
No files found.
common/lib/capa/capa/responsetypes.py
View file @
8e87d492
...
...
@@ -1852,26 +1852,27 @@ class OpenEndedResponse(LoncapaResponse):
'''
Parse OpenEndedResponse XML:
self.initial_display
self.answer (an answer to display to the student in the LMS)
self.payload
self.grader_type - type of grader to use. One of 'peer','ml','turk'
'''
# Note that OpenEndedResponse is agnostic to the specific contents of grader_payload
grader_payload
=
oeparam
.
find
(
'grader_payload'
)
grader_payload
=
grader_payload
.
text
if
grader_payload
is
not
None
else
''
self
.
payload
=
{
'grader_payload'
:
grader_payload
}
answer_display
=
oeparam
.
find
(
'answer_display'
)
if
answer_display
is
not
None
:
self
.
answer
=
answer_display
.
text
else
:
self
.
answer
=
'No answer provided.'
initial_display
=
oeparam
.
find
(
'initial_display'
)
if
initial_display
is
not
None
:
self
.
initial_display
=
initial_display
.
text
else
:
self
.
initial_display
=
''
grader_type
=
oeparam
.
find
(
'initial_display'
)
if
grader_type
is
not
None
:
self
.
grader_type
=
grader_type
.
text
else
:
self
.
grader_type
=
'ml'
def
get_score
(
self
,
student_answers
):
try
:
# Note that submission can be a file
...
...
@@ -1910,6 +1911,7 @@ class OpenEndedResponse(LoncapaResponse):
# Submit request. When successful, 'msg' is the prior length of the queue
contents
.
update
({
'student_response'
:
submission
})
contents
.
update
({
'grader_type'
}
:
self
.
grader_type
)
(
error
,
msg
)
=
qinterface
.
send_to_queue
(
header
=
xheader
,
body
=
json
.
dumps
(
contents
))
...
...
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