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
79c8efcb
Commit
79c8efcb
authored
Jan 14, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the rubric renderer
parent
bb867ba3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
8 deletions
+17
-8
common/lib/xmodule/xmodule/combined_open_ended_rubric.py
+11
-4
common/lib/xmodule/xmodule/open_ended_module.py
+2
-1
common/lib/xmodule/xmodule/self_assessment_module.py
+3
-1
lms/djangoapps/open_ended_grading/staff_grading_service.py
+1
-2
No files found.
common/lib/xmodule/xmodule/combined_open_ended_rubric.py
View file @
79c8efcb
...
...
@@ -10,6 +10,15 @@ class CombinedOpenEndedRubric:
self
.
has_score
=
False
self
.
view_only
=
view_only
'''
render_rubric: takes in an xml string and outputs the corresponding
html for that xml, given the type of rubric we're generating
Input:
rubric_xml: an string that has not been parsed into xml that
represents this particular rubric
Output:
html: the html that corresponds to the xml given
'''
def
render_rubric
(
self
,
rubric_xml
):
try
:
rubric_categories
=
self
.
extract_categories
(
rubric_xml
)
...
...
@@ -34,11 +43,9 @@ class CombinedOpenEndedRubric:
{text: "Option 3 Name", points: 2]}]
'''
if
element
.
tag
!=
'rubric'
:
raise
Exception
(
"[extract_categories] Expected a <rubric> tag: got {0} instead"
.
format
(
element
.
tag
))
categorylist
=
list
(
element
)
element
=
etree
.
fromstring
(
element
)
categories
=
[]
for
category
in
categorylis
t
:
for
category
in
elemen
t
:
if
category
.
tag
!=
'category'
:
raise
Exception
(
"[extract_categories] Expected a <category> tag: got {0} instead"
.
format
(
category
.
tag
))
else
:
...
...
common/lib/xmodule/xmodule/open_ended_module.py
View file @
79c8efcb
...
...
@@ -382,7 +382,8 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
rubric_feedback
=
""
feedback
=
self
.
_convert_longform_feedback_to_html
(
response_items
)
if
response_items
[
'rubric_scores_complete'
]
==
True
:
rubric_feedback
=
CombinedOpenEndedRubric
.
render_rubric
(
response_items
[
'rubric_xml'
])
rubric_renderer
=
CombinedOpenEndedRubric
(
True
)
rubric_feedback
=
rubric_renderer
.
render_rubric
(
response_items
[
'rubric_xml'
])
if
not
response_items
[
'success'
]:
return
system
.
render_template
(
"open_ended_error.html"
,
...
...
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
79c8efcb
...
...
@@ -122,7 +122,9 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
if
self
.
state
==
self
.
INITIAL
:
return
''
rubric_html
=
CombinedOpenEndedRubric
.
render_rubric
(
self
.
rubric
)
rubric_renderer
=
CombinedOpenEndedRubric
(
True
)
rubric_html
=
rubric_renderer
.
render_rubric
(
self
.
rubric
)
# we'll render it
context
=
{
'rubric'
:
rubric_html
,
...
...
lms/djangoapps/open_ended_grading/staff_grading_service.py
View file @
79c8efcb
...
...
@@ -264,8 +264,7 @@ def _get_next(course_id, grader_id, location):
response_json
=
json
.
loads
(
response
)
rubric
=
response_json
[
'rubric'
]
rubric_renderer
=
CombinedOpenEndedRubric
(
False
)
rubric_xml
=
etree
.
XML
(
rubric
)
rubric_html
=
rubric_renderer
.
render_rubric
(
rubric_xml
)
rubric_html
=
rubric_renderer
.
render_rubric
(
rubric
)
response_json
[
'rubric'
]
=
rubric_html
return
json
.
dumps
(
response_json
)
except
GradingServiceError
:
...
...
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