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
01860177
Commit
01860177
authored
Jul 12, 2013
by
Vik Paruchuri
Committed by
Vik Paruchuri
Aug 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify peer grading service calibration
parent
dadb128b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
25 deletions
+9
-25
common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py
+4
-13
common/lib/xmodule/xmodule/peer_grading_module.py
+5
-12
No files found.
common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py
View file @
01860177
...
@@ -54,16 +54,9 @@ class PeerGradingService(GradingService):
...
@@ -54,16 +54,9 @@ class PeerGradingService(GradingService):
response
=
self
.
get
(
self
.
show_calibration_essay_url
,
params
)
response
=
self
.
get
(
self
.
show_calibration_essay_url
,
params
)
return
self
.
try_to_decode
(
self
.
_render_rubric
(
response
))
return
self
.
try_to_decode
(
self
.
_render_rubric
(
response
))
def
save_calibration_essay
(
self
,
problem_location
,
grader_id
,
calibration_essay_id
,
submission_key
,
def
save_calibration_essay
(
self
,
**
kwargs
):
score
,
feedback
,
rubric_scores
):
data
=
kwargs
data
=
{
'location'
:
problem_location
,
data
.
update
({
'rubric_scores_complete'
:
True
})
'student_id'
:
grader_id
,
'calibration_essay_id'
:
calibration_essay_id
,
'submission_key'
:
submission_key
,
'score'
:
score
,
'feedback'
:
feedback
,
'rubric_scores[]'
:
rubric_scores
,
'rubric_scores_complete'
:
True
}
return
self
.
try_to_decode
(
self
.
post
(
self
.
save_calibration_essay_url
,
data
))
return
self
.
try_to_decode
(
self
.
post
(
self
.
save_calibration_essay_url
,
data
))
def
get_problem_list
(
self
,
course_id
,
grader_id
):
def
get_problem_list
(
self
,
course_id
,
grader_id
):
...
@@ -115,9 +108,7 @@ class MockPeerGradingService(object):
...
@@ -115,9 +108,7 @@ class MockPeerGradingService(object):
'rubric'
:
'fake rubric'
,
'rubric'
:
'fake rubric'
,
'max_score'
:
4
}
'max_score'
:
4
}
def
save_calibration_essay
(
self
,
problem_location
,
grader_id
,
def
save_calibration_essay
(
self
,
**
kwargs
):
calibration_essay_id
,
submission_key
,
score
,
feedback
,
rubric_scores
):
return
{
'success'
:
True
,
'actual_score'
:
2
}
return
{
'success'
:
True
,
'actual_score'
:
2
}
def
get_problem_list
(
self
,
course_id
,
grader_id
):
def
get_problem_list
(
self
,
course_id
,
grader_id
):
...
...
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
01860177
...
@@ -442,27 +442,20 @@ class PeerGradingModule(PeerGradingFields, XModule):
...
@@ -442,27 +442,20 @@ class PeerGradingModule(PeerGradingFields, XModule):
success
,
message
=
self
.
_check_required
(
data
,
required
)
success
,
message
=
self
.
_check_required
(
data
,
required
)
if
not
success
:
if
not
success
:
return
self
.
_err_response
(
message
)
return
self
.
_err_response
(
message
)
grader_id
=
self
.
system
.
anonymous_student_id
location
=
data
.
get
(
'location'
)
data_dict
=
{
k
:
data
.
get
(
k
)
for
k
in
required
}
calibration_essay_id
=
data
.
get
(
'submission_id'
)
data_dict
[
'rubric_scores'
]
=
data_dict
[
'rubric_scores[]'
]
submission_key
=
data
.
get
(
'submission_key'
)
data_dict
[
'grader_id'
]
=
self
.
system
.
anonymous_student_id
score
=
data
.
get
(
'score'
)
feedback
=
data
.
get
(
'feedback'
)
rubric_scores
=
data
.
getlist
(
'rubric_scores[]'
)
try
:
try
:
response
=
self
.
peer_gs
.
save_calibration_essay
(
location
,
grader_id
,
calibration_essay_id
,
response
=
self
.
peer_gs
.
save_calibration_essay
(
**
data_dict
)
submission_key
,
score
,
feedback
,
rubric_scores
)
if
'actual_rubric'
in
response
:
if
'actual_rubric'
in
response
:
rubric_renderer
=
combined_open_ended_rubric
.
CombinedOpenEndedRubric
(
self
.
system
,
True
)
rubric_renderer
=
combined_open_ended_rubric
.
CombinedOpenEndedRubric
(
self
.
system
,
True
)
response
[
'actual_rubric'
]
=
rubric_renderer
.
render_rubric
(
response
[
'actual_rubric'
])[
'html'
]
response
[
'actual_rubric'
]
=
rubric_renderer
.
render_rubric
(
response
[
'actual_rubric'
])[
'html'
]
return
response
return
response
except
GradingServiceError
:
except
GradingServiceError
:
# This is a dev_facing_error
# This is a dev_facing_error
log
.
exception
(
log
.
exception
(
"Error saving calibration grade"
)
"Error saving calibration grade, location: {0}, submission_key: {1}, grader_id: {2}"
.
format
(
location
,
submission_key
,
grader_id
))
# This is a student_facing_error
# This is a student_facing_error
return
self
.
_err_response
(
'There was an error saving your score. Please notify course staff.'
)
return
self
.
_err_response
(
'There was an error saving your score. Please notify course staff.'
)
...
...
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