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
1d4b674c
Commit
1d4b674c
authored
Jan 28, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address code review feedback
parent
5e34f38c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
12 deletions
+14
-12
common/lib/xmodule/xmodule/combined_open_ended_module.py
+1
-1
lms/djangoapps/open_ended_grading/grading_service.py
+10
-7
lms/djangoapps/open_ended_grading/peer_grading_service.py
+2
-2
lms/djangoapps/open_ended_grading/staff_grading_service.py
+1
-2
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
1d4b674c
...
...
@@ -145,7 +145,7 @@ class CombinedOpenEndedModule(XModule):
rubric_feedback
=
rubric_renderer
.
render_rubric
(
stringify_children
(
definition
[
'rubric'
]))
except
RubricParsingError
:
log
.
error
(
"Failed to parse rubric in location: {1}"
.
format
(
location
))
raise
Exception
(
"CombinedOpenEnded: could not render given rubric"
)
raise
#Static data is passed to the child modules to render
self
.
static_data
=
{
'max_score'
:
self
.
_max_score
,
...
...
lms/djangoapps/open_ended_grading/grading_service.py
View file @
1d4b674c
...
...
@@ -106,26 +106,29 @@ class GradingService(object):
def
_render_rubric
(
self
,
response
,
view_only
=
False
):
"""
Given an HTTP Response with the key 'rubric', render out the html
required to display the rubric
required to display the rubric and put it back into the response
returns the updated response as a dictionary that can be serialized later
"""
try
:
response_json
=
json
.
loads
(
response
)
if
response_json
.
has_key
(
'rubric'
)
:
if
'rubric'
in
response_json
:
rubric
=
response_json
[
'rubric'
]
rubric_renderer
=
CombinedOpenEndedRubric
(
self
.
system
,
False
)
rubric_html
=
rubric_renderer
.
render_rubric
(
rubric
)
response_json
[
'rubric'
]
=
rubric_html
return
json
.
dumps
(
response_json
)
return
response_json
# if we can't parse the rubric into HTML,
except
etree
.
XMLSyntaxError
,
RubricParsingError
:
log
.
exception
(
"Cannot parse rubric string. Raw string: {0}"
.
format
(
rubric
))
return
json
.
dumps
(
{
'success'
:
False
,
'error'
:
'Error displaying submission'
}
)
return
{
'success'
:
False
,
'error'
:
'Error displaying submission'
}
except
ValueError
:
log
.
exception
(
"Error parsing response: {0}"
.
format
(
response
))
return
json
.
dumps
(
{
'success'
:
False
,
'error'
:
"Error displaying submission"
}
)
return
{
'success'
:
False
,
'error'
:
"Error displaying submission"
}
...
...
lms/djangoapps/open_ended_grading/peer_grading_service.py
View file @
1d4b674c
...
...
@@ -86,7 +86,7 @@ class PeerGradingService(GradingService):
def
get_next_submission
(
self
,
problem_location
,
grader_id
):
response
=
self
.
get
(
self
.
get_next_submission_url
,
{
'location'
:
problem_location
,
'grader_id'
:
grader_id
})
return
self
.
_render_rubric
(
response
)
return
json
.
dumps
(
self
.
_render_rubric
(
response
)
)
def
save_grade
(
self
,
location
,
grader_id
,
submission_id
,
score
,
feedback
,
submission_key
,
rubric_scores
):
data
=
{
'grader_id'
:
grader_id
,
...
...
@@ -106,7 +106,7 @@ class PeerGradingService(GradingService):
def
show_calibration_essay
(
self
,
problem_location
,
grader_id
):
params
=
{
'problem_id'
:
problem_location
,
'student_id'
:
grader_id
}
response
=
self
.
get
(
self
.
show_calibration_essay_url
,
params
)
return
self
.
_render_rubric
(
response
)
return
json
.
dumps
(
self
.
_render_rubric
(
response
)
)
def
save_calibration_essay
(
self
,
problem_location
,
grader_id
,
calibration_essay_id
,
submission_key
,
score
,
feedback
,
rubric_scores
):
...
...
lms/djangoapps/open_ended_grading/staff_grading_service.py
View file @
1d4b674c
...
...
@@ -112,7 +112,7 @@ class StaffGradingService(GradingService):
response
=
self
.
get
(
self
.
get_next_url
,
params
=
{
'location'
:
location
,
'grader_id'
:
grader_id
})
return
self
.
_render_rubric
(
response
)
return
json
.
dumps
(
self
.
_render_rubric
(
response
)
)
def
save_grade
(
self
,
course_id
,
grader_id
,
submission_id
,
score
,
feedback
,
skipped
,
rubric_scores
):
...
...
@@ -148,7 +148,6 @@ class StaffGradingService(GradingService):
# importing this file doesn't create objects that may not have the right config
_service
=
None
module_system
=
ModuleSystem
(
""
,
None
,
None
,
render_to_string
,
None
)
def
staff_grading_service
():
"""
...
...
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