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
fc02e7e2
Commit
fc02e7e2
authored
Jan 04, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on bugfixing
parent
a4ad7800
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
common/lib/xmodule/xmodule/open_ended_module.py
+6
-11
lms/templates/open_ended.html
+6
-2
No files found.
common/lib/xmodule/xmodule/open_ended_module.py
View file @
fc02e7e2
...
...
@@ -30,6 +30,8 @@ from .xml_module import XmlDescriptor
from
xmodule.modulestore
import
Location
from
capa.util
import
*
from
datetime
import
datetime
log
=
logging
.
getLogger
(
"mitx.courseware"
)
# Set the default number of max attempts. Should be 1 for production
...
...
@@ -261,7 +263,7 @@ class OpenEndedModule():
# Generate header
queuekey
=
xqueue_interface
.
make_hashkey
(
str
(
system
.
seed
)
+
qtime
+
anonymous_student_id
+
self
.
answer_id
)
1
)
xheader
=
xqueue_interface
.
make_xheader
(
lms_callback_url
=
system
.
xqueue
[
'callback_url'
],
lms_key
=
queuekey
,
...
...
@@ -499,10 +501,11 @@ class OpenEndedModule():
'progress' : 'none'/'in_progress'/'done',
<other request-specific values here > }
'''
log
.
debug
(
get
)
handlers
=
{
'problem_get'
:
self
.
get_problem
,
'problem_reset'
:
self
.
reset_problem
,
'
problem_save'
:
self
.
save_problem
,
'
save_answer'
:
self
.
save_answer
,
'score_update'
:
self
.
update_score
,
'message_post'
:
self
.
message_post
,
}
...
...
@@ -526,7 +529,7 @@ class OpenEndedModule():
self
.
change_state
(
self
.
INITIAL
)
return
{
'success'
:
True
}
def
save_
problem
(
self
,
get
,
system
):
def
save_
answer
(
self
,
get
,
system
):
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
...
...
@@ -654,14 +657,6 @@ class OpenEndedModule():
"""
return
self
.
_max_score
def
get_score
(
self
):
"""
Returns the last score in the list
"""
score
=
self
.
latest_score
()
return
{
'score'
:
score
if
score
is
not
None
else
0
,
'total'
:
self
.
_max_score
}
def
get_progress
(
self
):
'''
For now, just return last score / max_score
...
...
lms/templates/open_ended.html
View file @
fc02e7e2
<section
id=
"openended_${id}"
class=
"open-ended-child"
data-state=
"${state}"
>
<div
class=
"error"
></div>
<div
class=
"prompt"
>
${prompt|n}
<textarea
rows=
"${rows}"
cols=
"${cols}"
name=
"input_${id}"
class=
"short-form-response"
id=
"input_${id}"
</prompt>
<textarea
rows=
"${rows}"
cols=
"${cols}"
name=
"answer"
class=
"answer short-form-response"
id=
"input_${id}"
%
if
hidden:
style=
"display:none;"
%
endif
>
${previous_answer|h}
</textarea>
<div
class=
"
grader-status
"
>
<div
class=
"
message-wrapper
"
>
% if state == 'initial':
<span
class=
"unanswered"
style=
"display:inline-block;"
id=
"status_${id}"
>
Unanswered
</span>
% elif state == 'done':
...
...
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