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
a4ad7800
Commit
a4ad7800
authored
Jan 04, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add proper queue handling
parent
c04455c5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
27 deletions
+21
-27
common/lib/xmodule/xmodule/open_ended_module.py
+21
-27
lms/templates/open_ended.html
+0
-0
No files found.
common/lib/xmodule/xmodule/open_ended_module.py
View file @
a4ad7800
...
...
@@ -188,7 +188,7 @@ class OpenEndedModule():
except
ValueError
:
self
.
max_score
=
1
def
handle_
message_post
(
self
,
get
,
system
):
def
message_post
(
self
,
get
,
system
):
"""
Handles a student message post (a reaction to the grade they received from an open ended grader type)
Returns a boolean success/fail and an error message
...
...
@@ -248,14 +248,7 @@ class OpenEndedModule():
return
success
,
"Successfully submitted your feedback."
def
get_score
(
self
,
student_answers
,
system
):
try
:
submission
=
student_answers
[
self
.
answer_id
]
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
)
def
get_score
(
self
,
submission
,
system
):
# Prepare xqueue request
#------------------------------------------------------------
...
...
@@ -297,23 +290,7 @@ class OpenEndedModule():
# State associated with the queueing request
queuestate
=
{
'key'
:
queuekey
,
'time'
:
qtime
,}
cmap
=
CorrectMap
()
if
error
:
cmap
.
set
(
self
.
answer_id
,
queuestate
=
None
,
msg
=
'Unable to deliver your submission to grader. (Reason: {0}.)'
' Please try again later.'
.
format
(
msg
))
else
:
# Queueing mechanism flags:
# 1) Backend: Non-null CorrectMap['queuestate'] indicates that
# the problem has been queued
# 2) Frontend: correctness='incomplete' eventually trickles down
# through inputtypes.textbox and .filesubmission to inform the
# browser that the submission is queued (and it could e.g. poll)
cmap
.
set
(
self
.
answer_id
,
queuestate
=
queuestate
,
correctness
=
'incomplete'
,
msg
=
msg
)
return
cmap
return
True
def
_update_score
(
self
,
score_msg
,
oldcmap
,
queuekey
):
log
.
debug
(
score_msg
)
...
...
@@ -550,7 +527,24 @@ class OpenEndedModule():
return
{
'success'
:
True
}
def
save_problem
(
self
,
get
,
system
):
pass
if
self
.
attempts
>
self
.
max_attempts
:
# If too many attempts, prevent student from saving answer and
# seeing rubric. In normal use, students shouldn't see this because
# they won't see the reset button once they're out of attempts.
return
{
'success'
:
False
,
'error'
:
'Too many attempts.'
}
if
self
.
state
!=
self
.
INITIAL
:
return
self
.
out_of_sync_error
(
get
)
# add new history element with answer and empty score and hint.
self
.
new_history_entry
(
get
[
'student_answer'
])
self
.
get_score
(
get
[
'student_answer'
],
system
)
self
.
change_state
(
self
.
ASSESSING
)
return
{
'success'
:
True
,}
def
update_score
(
self
,
get
,
system
):
"""
...
...
lms/templates/open_ended.html
View file @
a4ad7800
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