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
0e2355c2
Commit
0e2355c2
authored
Jan 07, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work on templating for status display
parent
a06680a2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
+17
-5
common/lib/xmodule/xmodule/combined_open_ended_module.py
+14
-4
common/lib/xmodule/xmodule/openendedchild.py
+3
-0
common/lib/xmodule/xmodule/self_assessment_module.py
+0
-1
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
0e2355c2
...
...
@@ -98,7 +98,9 @@ class CombinedOpenEndedModule(XModule):
return
tag
def
overwrite_state
(
self
,
current_task_state
):
last_response
,
last_score
=
self
.
get_last_response
(
self
.
current_task_number
-
1
)
last_response_data
=
self
.
get_last_response
(
self
.
current_task_number
-
1
)
last_response
=
last_response_data
[
'response'
]
loaded_task_state
=
json
.
loads
(
current_task_state
)
if
loaded_task_state
[
'state'
]
==
self
.
INITIAL
:
loaded_task_state
[
'state'
]
=
self
.
ASSESSING
...
...
@@ -139,7 +141,8 @@ class CombinedOpenEndedModule(XModule):
self
.
task_states
.
append
(
self
.
current_task
.
get_instance_state
())
self
.
state
=
self
.
ASSESSING
elif
current_task_state
is
None
and
self
.
current_task_number
>
0
:
last_response
,
last_score
=
self
.
get_last_response
(
self
.
current_task_number
-
1
)
last_response_data
=
self
.
get_last_response
(
self
.
current_task_number
-
1
)
last_response
=
last_response_data
[
'response'
]
current_task_state
=
(
'{"state": "assessing", "version": 1, "max_score": '
+
str
(
self
.
_max_score
)
+
', '
+
'"attempts": 0, "created": "True", "history": [{"answer": "'
+
str
(
last_response
)
+
'"}]}'
)
self
.
current_task
=
children
[
'modules'
][
current_task_type
](
self
.
system
,
self
.
location
,
self
.
current_task_parsed_xml
,
self
.
current_task_descriptor
,
instance_state
=
current_task_state
)
...
...
@@ -191,8 +194,10 @@ class CombinedOpenEndedModule(XModule):
task
=
children
[
'modules'
][
task_type
](
self
.
system
,
self
.
location
,
task_parsed_xml
,
task_descriptor
,
instance_state
=
task_state
)
last_response
=
task
.
latest_answer
()
last_score
=
task
.
latest_score
()
last_post_response
=
task
.
latest_post_response
()
last_response_dict
=
{
'response'
:
last_response
,
'score'
:
last_score
,
'post_response'
:
post_response
,
'type'
:
task_type
}
return
last_response
,
last_score
return
last_response
_dict
def
update_task_states
(
self
):
changed
=
False
...
...
@@ -285,7 +290,12 @@ class CombinedOpenEndedModule(XModule):
return
json
.
dumps
(
state
)
def
get_status
(
self
):
pass
status
=
[]
for
i
in
xrange
(
0
,
self
.
current_task_number
):
task_data
=
self
.
get_last_response
(
i
)
status
.
append
(
task_data
)
context
=
{
'status_list'
:
status
}
status_html
=
self
.
system
.
render_template
(
"combined_open_ended_status.html"
,
context
)
class
CombinedOpenEndedDescriptor
(
XmlDescriptor
,
EditingDescriptor
):
"""
...
...
common/lib/xmodule/xmodule/openendedchild.py
View file @
0e2355c2
...
...
@@ -243,6 +243,9 @@ class OpenEndedChild():
def
handle_ajax
(
self
):
pass
def
type
(
self
):
pass
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
0e2355c2
...
...
@@ -296,7 +296,6 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor):
'hintprompt'
:
parse
(
'hintprompt'
),
}
def
definition_to_xml
(
self
,
resource_fs
):
'''Return an xml element representing this definition.'''
elt
=
etree
.
Element
(
'selfassessment'
)
...
...
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