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
6d61bd46
Commit
6d61bd46
authored
Jan 04, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial setup for open ended xmodule
parent
e3a311d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
11 deletions
+54
-11
common/lib/xmodule/open_ended_module.py
+54
-6
common/lib/xmodule/xmodule/self_assessment_module.py
+0
-5
No files found.
common/lib/xmodule/open_ended_module.py
View file @
6d61bd46
...
...
@@ -64,7 +64,7 @@ class OpenEndedModule():
# states
INITIAL
=
'initial'
ASSESSING
=
'assessing'
REQUEST_HI
NT
=
'post_assessment'
POST_ASSESSME
NT
=
'post_assessment'
DONE
=
'done'
def
__init__
(
self
,
system
,
location
,
definition
,
descriptor
,
...
...
@@ -122,7 +122,56 @@ class OpenEndedModule():
# completion (doesn't matter if you self-assessed correct/incorrect).
self
.
_max_score
=
int
(
instance_state
.
get
(
'max_score'
,
MAX_SCORE
))
self
.
rubric
=
definition
[
'rubric'
]
self
.
prompt
=
definition
[
'prompt'
]
self
.
submit_message
=
definition
[
'submitmessage'
]
self
.
hint_prompt
=
definition
[
'hintprompt'
]
\ No newline at end of file
oeparam
=
definition
[
'openendedparam'
]
prompt
=
definition
[
'prompt'
]
rubric
=
definition
[
'rubric'
]
self
.
url
=
definition
.
get
(
'url'
,
None
)
self
.
queue_name
=
definition
.
get
(
'queuename'
,
self
.
DEFAULT_QUEUE
)
self
.
message_queue_name
=
definition
.
get
(
'message-queuename'
,
self
.
DEFAULT_MESSAGE_QUEUE
)
#This is needed to attach feedback to specific responses later
self
.
submission_id
=
None
self
.
grader_id
=
None
if
oeparam
is
None
:
raise
ValueError
(
"No oeparam found in problem xml."
)
if
prompt
is
None
:
raise
ValueError
(
"No prompt found in problem xml."
)
if
rubric
is
None
:
raise
ValueError
(
"No rubric found in problem xml."
)
self
.
_parse
(
oeparam
,
prompt
,
rubric
)
def
handle_ajax
(
self
,
dispatch
,
get
):
'''
This is called by courseware.module_render, to handle an AJAX call.
"get" is request.POST.
Returns a json dictionary:
{ 'progress_changed' : True/False,
'progress' : 'none'/'in_progress'/'done',
<other request-specific values here > }
'''
handlers
=
{
'problem_get'
:
self
.
get_problem
,
'problem_check'
:
self
.
check_problem
,
'problem_reset'
:
self
.
reset_problem
,
'problem_save'
:
self
.
save_problem
,
'problem_show'
:
self
.
get_answer
,
'score_update'
:
self
.
update_score
,
'message_post'
:
self
.
message_post
,
}
if
dispatch
not
in
handlers
:
return
'Error'
before
=
self
.
get_progress
()
d
=
handlers
[
dispatch
](
get
)
after
=
self
.
get_progress
()
d
.
update
({
'progress_changed'
:
after
!=
before
,
'progress_status'
:
Progress
.
to_js_status_str
(
after
),
})
return
json
.
dumps
(
d
,
cls
=
ComplexEncoder
)
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
6d61bd46
...
...
@@ -93,11 +93,6 @@ class SelfAssessmentModule():
</selfassessment>
"""
self
.
xml
=
xml
self
.
inputfields
=
inputfields
self
.
context
=
context
self
.
system
=
system
# Load instance state
if
instance_state
is
not
None
:
instance_state
=
json
.
loads
(
instance_state
)
...
...
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