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
3aa0daaa
Commit
3aa0daaa
authored
Jan 08, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in proper prompt and rubric parsing
parent
9e14e22c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
common/lib/xmodule/xmodule/open_ended_module.py
+1
-0
common/lib/xmodule/xmodule/self_assessment_module.py
+5
-5
No files found.
common/lib/xmodule/xmodule/open_ended_module.py
View file @
3aa0daaa
...
...
@@ -76,6 +76,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
prompt_string
=
stringify_children
(
prompt
)
rubric_string
=
stringify_children
(
rubric
)
self
.
prompt
=
prompt_string
self
.
rubric
=
rubric_string
grader_payload
=
oeparam
.
find
(
'grader_payload'
)
grader_payload
=
grader_payload
.
text
if
grader_payload
is
not
None
else
''
...
...
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
3aa0daaa
...
...
@@ -35,6 +35,8 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
def
setup_response
(
self
,
system
,
location
,
definition
,
descriptor
):
self
.
submit_message
=
definition
[
'submitmessage'
]
self
.
hint_prompt
=
definition
[
'hintprompt'
]
self
.
prompt
=
stringify_children
(
prompt
)
self
.
rubric
=
stringify_children
(
rubric
)
def
get_html
(
self
,
system
):
#set context variables and render template
...
...
@@ -270,7 +272,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor):
'hintprompt': 'some-html'
}
"""
expected_children
=
[
'
rubric'
,
'prompt'
,
'
submitmessage'
,
'hintprompt'
]
expected_children
=
[
'submitmessage'
,
'hintprompt'
]
for
child
in
expected_children
:
if
len
(
xml_object
.
xpath
(
child
))
!=
1
:
raise
ValueError
(
"Self assessment definition must include exactly one '{0}' tag"
.
format
(
child
))
...
...
@@ -279,9 +281,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor):
"""Assumes that xml_object has child k"""
return
stringify_children
(
xml_object
.
xpath
(
k
)[
0
])
return
{
'rubric'
:
parse
(
'rubric'
),
'prompt'
:
parse
(
'prompt'
),
'submitmessage'
:
parse
(
'submitmessage'
),
return
{
'submitmessage'
:
parse
(
'submitmessage'
),
'hintprompt'
:
parse
(
'hintprompt'
),
}
...
...
@@ -294,7 +294,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor):
child_node
=
etree
.
fromstring
(
child_str
)
elt
.
append
(
child_node
)
for
child
in
[
'
rubric'
,
'prompt'
,
'
submitmessage'
,
'hintprompt'
]:
for
child
in
[
'submitmessage'
,
'hintprompt'
]:
add_child
(
child
)
return
elt
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