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
ce0b3146
Commit
ce0b3146
authored
Feb 05, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in methods to interact with xmodule, change descriptor
parent
8ab76f72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
common/lib/xmodule/xmodule/combined_open_ended_module.py
+15
-15
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
ce0b3146
...
@@ -143,7 +143,20 @@ class CombinedOpenEndedModule(XModule):
...
@@ -143,7 +143,20 @@ class CombinedOpenEndedModule(XModule):
def
get_html
(
self
):
def
get_html
(
self
):
return
self
.
child_module
.
get_html
()
return
self
.
child_module
.
get_html
()
def
handle_ajax
(
self
,
dispatch
,
get
):
return
self
.
child_module
.
handle_ajax
(
dispatch
,
get
)
def
get_instance_state
(
self
):
return
self
.
child_module
.
get_instance_state
()
def
get_score
(
self
):
return
self
.
child_module
.
get_score
()
def
max_score
(
self
):
return
self
.
child_module
.
max_score
()
def
get_progress
(
self
):
return
self
.
child_module
.
get_progress
()
class
CombinedOpenEndedDescriptor
(
XmlDescriptor
,
EditingDescriptor
):
class
CombinedOpenEndedDescriptor
(
XmlDescriptor
,
EditingDescriptor
):
...
@@ -173,20 +186,7 @@ class CombinedOpenEndedDescriptor(XmlDescriptor, EditingDescriptor):
...
@@ -173,20 +186,7 @@ class CombinedOpenEndedDescriptor(XmlDescriptor, EditingDescriptor):
'task_xml': dictionary of xml strings,
'task_xml': dictionary of xml strings,
}
}
"""
"""
expected_children
=
[
'task'
,
'rubric'
,
'prompt'
]
return
etree
.
tostring
(
xml_object
)
for
child
in
expected_children
:
if
len
(
xml_object
.
xpath
(
child
))
==
0
:
raise
ValueError
(
"Combined Open Ended definition must include at least one '{0}' tag"
.
format
(
child
))
def
parse_task
(
k
):
"""Assumes that xml_object has child k"""
return
[
stringify_children
(
xml_object
.
xpath
(
k
)[
i
])
for
i
in
xrange
(
0
,
len
(
xml_object
.
xpath
(
k
)))]
def
parse
(
k
):
"""Assumes that xml_object has child k"""
return
xml_object
.
xpath
(
k
)[
0
]
return
{
'task_xml'
:
parse_task
(
'task'
),
'prompt'
:
parse
(
'prompt'
),
'rubric'
:
parse
(
'rubric'
)}
def
definition_to_xml
(
self
,
resource_fs
):
def
definition_to_xml
(
self
,
resource_fs
):
...
...
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