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
cd764d3d
Commit
cd764d3d
authored
Dec 28, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify self-assessment to not be an xmodule
parent
e975174d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
16 deletions
+15
-16
common/lib/xmodule/xmodule/combined_open_ended_module.py
+2
-2
common/lib/xmodule/xmodule/self_assessment_module.py
+13
-14
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
cd764d3d
...
...
@@ -43,7 +43,7 @@ class CombinedOpenEndedModule(XModule):
TASK_TYPES
=
[
"self"
,
"ml"
,
"instructor"
,
"peer"
]
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/selfassessment/display.coffee'
)]}
js_module_name
=
"
CombinedOpenEnded
"
js_module_name
=
"
SelfAssessment
"
def
__init__
(
self
,
system
,
location
,
definition
,
descriptor
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
...
...
@@ -111,7 +111,7 @@ class CombinedOpenEndedModule(XModule):
return
rewrite_links
(
html
,
self
.
rewrite_content_links
)
def
handle_ajax
(
self
,
dispatch
,
get
):
return
self
.
current_task
.
handle_ajax
(
dispatch
,
get
)
return
self
.
current_task
.
handle_ajax
(
dispatch
,
get
,
self
.
system
)
class
CombinedOpenEndedDescriptor
(
XmlDescriptor
,
EditingDescriptor
):
"""
...
...
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
cd764d3d
...
...
@@ -233,8 +233,8 @@ class SelfAssessmentModule():
'prompt'
:
self
.
prompt
,
'previous_answer'
:
previous_answer
,
'ajax_url'
:
system
.
ajax_url
,
'initial_rubric'
:
self
.
get_rubric_html
(),
'initial_hint'
:
self
.
get_hint_html
(),
'initial_rubric'
:
self
.
get_rubric_html
(
system
),
'initial_hint'
:
self
.
get_hint_html
(
system
),
'initial_message'
:
self
.
get_message_html
(),
'state'
:
self
.
state
,
'allow_reset'
:
self
.
_allow_reset
(),
...
...
@@ -270,7 +270,7 @@ class SelfAssessmentModule():
return
None
def
handle_ajax
(
self
,
dispatch
,
get
):
def
handle_ajax
(
self
,
dispatch
,
get
,
system
):
"""
This is called by courseware.module_render, to handle an AJAX call.
"get" is request.POST.
...
...
@@ -292,7 +292,7 @@ class SelfAssessmentModule():
return
'Error'
before
=
self
.
get_progress
()
d
=
handlers
[
dispatch
](
get
)
d
=
handlers
[
dispatch
](
get
,
system
)
after
=
self
.
get_progress
()
d
.
update
({
'progress_changed'
:
after
!=
before
,
...
...
@@ -309,7 +309,7 @@ class SelfAssessmentModule():
return
{
'success'
:
False
,
'error'
:
'The problem state got out-of-sync'
}
def
get_rubric_html
(
self
):
def
get_rubric_html
(
self
,
system
):
"""
Return the appropriate version of the rubric, based on the state.
"""
...
...
@@ -328,9 +328,9 @@ class SelfAssessmentModule():
else
:
raise
ValueError
(
"Illegal state '
%
r'"
%
self
.
state
)
return
s
elf
.
s
ystem
.
render_template
(
'self_assessment_rubric.html'
,
context
)
return
system
.
render_template
(
'self_assessment_rubric.html'
,
context
)
def
get_hint_html
(
self
):
def
get_hint_html
(
self
,
system
):
"""
Return the appropriate version of the hint view, based on state.
"""
...
...
@@ -354,7 +354,7 @@ class SelfAssessmentModule():
else
:
raise
ValueError
(
"Illegal state '
%
r'"
%
self
.
state
)
return
s
elf
.
s
ystem
.
render_template
(
'self_assessment_hint.html'
,
context
)
return
system
.
render_template
(
'self_assessment_hint.html'
,
context
)
def
get_message_html
(
self
):
"""
...
...
@@ -366,7 +366,7 @@ class SelfAssessmentModule():
return
"""<div class="save_message">{0}</div>"""
.
format
(
self
.
submit_message
)
def
save_answer
(
self
,
get
):
def
save_answer
(
self
,
get
,
system
):
"""
After the answer is submitted, show the rubric.
...
...
@@ -397,10 +397,10 @@ class SelfAssessmentModule():
return
{
'success'
:
True
,
'rubric_html'
:
self
.
get_rubric_html
()
'rubric_html'
:
self
.
get_rubric_html
(
system
)
}
def
save_assessment
(
self
,
get
):
def
save_assessment
(
self
,
get
,
system
):
"""
Save the assessment. If the student said they're right, don't ask for a
hint, and go straight to the done state. Otherwise, do ask for a hint.
...
...
@@ -433,13 +433,13 @@ class SelfAssessmentModule():
d
[
'allow_reset'
]
=
self
.
_allow_reset
()
else
:
self
.
change_state
(
self
.
REQUEST_HINT
)
d
[
'hint_html'
]
=
self
.
get_hint_html
()
d
[
'hint_html'
]
=
self
.
get_hint_html
(
system
)
d
[
'state'
]
=
self
.
state
return
d
def
save_hint
(
self
,
get
):
def
save_hint
(
self
,
get
,
system
):
'''
Save the hint.
Returns a dict { 'success': bool,
...
...
@@ -465,7 +465,6 @@ class SelfAssessmentModule():
'history'
:
self
.
history
,
}
}
self
.
system
.
track_function
(
'save_hint'
,
event_info
)
return
{
'success'
:
True
,
'message_html'
:
self
.
get_message_html
(),
...
...
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