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
22ce306f
Commit
22ce306f
authored
Dec 03, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
whitespace and comments
parent
63c1a8ea
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
common/lib/capa/capa/responsetypes.py
+12
-11
No files found.
common/lib/capa/capa/responsetypes.py
View file @
22ce306f
...
...
@@ -1851,7 +1851,7 @@ class OpenEndedResponse(LoncapaResponse):
oeparam
=
self
.
xml
.
find
(
'openendedparam'
)
prompt
=
self
.
xml
.
find
(
'prompt'
)
rubric
=
self
.
xml
.
find
(
'openendedrubric'
)
self
.
_parse
(
oeparam
,
prompt
,
rubric
)
self
.
_parse
(
oeparam
,
prompt
,
rubric
)
def
stringify_children
(
self
,
node
,
strip_tags
=
True
):
"""
...
...
@@ -1890,7 +1890,7 @@ class OpenEndedResponse(LoncapaResponse):
#Update grader payload with student id. If grader payload not json, error.
try
:
grader_payload
=
json
.
loads
(
grader_payload
)
grader_payload
=
json
.
loads
(
grader_payload
)
# NOTE: self.system.location is valid because the capa_module
# __init__ adds it (easiest way to get problem location into
# response types)
...
...
@@ -1900,7 +1900,7 @@ class OpenEndedResponse(LoncapaResponse):
'prompt'
:
prompt_string
,
'rubric'
:
rubric_string
,
})
grader_payload
=
json
.
dumps
(
grader_payload
)
grader_payload
=
json
.
dumps
(
grader_payload
)
except
Exception
as
err
:
log
.
error
(
"Grader payload is not a json object!"
)
...
...
@@ -1924,9 +1924,9 @@ class OpenEndedResponse(LoncapaResponse):
top_score
=
oeparam
.
find
(
'max_score'
)
if
top_score
is
not
None
:
try
:
self
.
max_score
=
int
(
top_score
.
text
)
self
.
max_score
=
int
(
top_score
.
text
)
except
:
self
.
top_score
=
1
self
.
max_score
=
1
else
:
self
.
max_score
=
1
...
...
@@ -1992,7 +1992,8 @@ class OpenEndedResponse(LoncapaResponse):
# 2) Frontend: correctness='incomplete' eventually trickles down
# through inputtypes.textbox and .filesubmission to inform the
# browser to poll the LMS
cmap
.
set
(
self
.
answer_id
,
queuestate
=
queuestate
,
correctness
=
'incomplete'
,
msg
=
msg
)
cmap
.
set
(
self
.
answer_id
,
queuestate
=
queuestate
,
correctness
=
'incomplete'
,
msg
=
msg
)
return
cmap
...
...
@@ -2001,7 +2002,7 @@ class OpenEndedResponse(LoncapaResponse):
(
valid_score_msg
,
correct
,
points
,
msg
)
=
self
.
_parse_score_msg
(
score_msg
)
if
not
valid_score_msg
:
oldcmap
.
set
(
self
.
answer_id
,
msg
=
'Invalid grader reply. Please contact the course staff.'
)
msg
=
'Invalid grader reply. Please contact the course staff.'
)
return
oldcmap
correctness
=
'correct'
if
correct
else
'incorrect'
...
...
@@ -2132,11 +2133,11 @@ class OpenEndedResponse(LoncapaResponse):
feedback
=
self
.
_format_feedback
(
score_result
)
score_ratio
=
int
(
score_result
[
'score'
])
/
self
.
max_score
correct
=
False
if
score_ratio
>=.
66
:
correct
=
True
# HACK: for now, just assume it's correct if you got more than 2/3.
# Also assumes that score_result['score'] is an integer.
score_ratio
=
int
(
score_result
[
'score'
])
/
self
.
max_score
correct
=
(
score_ratio
>=
0.66
)
log
.
debug
(
feedback
)
try
:
...
...
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