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
f2b554db
Commit
f2b554db
authored
Mar 27, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Record metrics about the peer grading service
parent
6430e7e9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
8 deletions
+47
-8
common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py
+47
-8
No files found.
common/lib/xmodule/xmodule/open_ended_grading_classes/peer_grading_service.py
View file @
f2b554db
import
json
import
logging
from
dogapi
import
dog_stats_api
from
.grading_service_module
import
GradingService
,
GradingServiceError
...
...
@@ -11,6 +12,8 @@ class PeerGradingService(GradingService):
Interface with the grading controller for peer grading
"""
METRIC_NAME
=
'edxapp.open_ended_grading.peer_grading_service'
def
__init__
(
self
,
config
,
system
):
config
[
'system'
]
=
system
super
(
PeerGradingService
,
self
)
.
__init__
(
config
)
...
...
@@ -29,7 +32,17 @@ class PeerGradingService(GradingService):
def
get_data_for_location
(
self
,
problem_location
,
student_id
):
params
=
{
'location'
:
problem_location
,
'student_id'
:
student_id
}
response
=
self
.
get
(
self
.
get_data_for_location_url
,
params
)
return
response
.
json
()
result
=
response
.
json
()
self
.
_record_result
(
'get_data_for_location'
,
result
)
for
key
in
result
.
keys
():
if
key
in
(
'success'
,
'error'
,
'version'
):
continue
dog_stats_api
.
histogram
(
self
.
_metric_name
(
'get_data_for_location.{}'
.
format
(
key
)),
result
[
key
],
)
return
result
def
get_next_submission
(
self
,
problem_location
,
grader_id
):
response
=
self
.
get
(
...
...
@@ -39,36 +52,62 @@ class PeerGradingService(GradingService):
'grader_id'
:
grader_id
}
)
return
self
.
_render_rubric
(
response
.
json
())
result
=
self
.
_render_rubric
(
response
.
json
())
self
.
_record_result
(
'get_next_submission'
,
result
)
return
result
def
save_grade
(
self
,
**
kwargs
):
data
=
kwargs
data
.
update
({
'rubric_scores_complete'
:
True
})
return
self
.
post
(
self
.
save_grade_url
,
data
)
.
json
()
result
=
self
.
post
(
self
.
save_grade_url
,
data
)
.
json
()
self
.
_record_result
(
'save_grade'
,
result
)
return
result
def
is_student_calibrated
(
self
,
problem_location
,
grader_id
):
params
=
{
'problem_id'
:
problem_location
,
'student_id'
:
grader_id
}
return
self
.
get
(
self
.
is_student_calibrated_url
,
params
)
.
json
()
result
=
self
.
get
(
self
.
is_student_calibrated_url
,
params
)
.
json
()
self
.
_record_result
(
'is_student_calibrated'
,
result
,
tags
=
[
'calibrated:{}'
.
format
(
result
.
get
(
'calibrated'
))]
)
return
result
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
.
json
())
result
=
self
.
_render_rubric
(
response
.
json
())
self
.
_record_result
(
'show_calibration_essay'
,
result
)
return
result
def
save_calibration_essay
(
self
,
**
kwargs
):
data
=
kwargs
data
.
update
({
'rubric_scores_complete'
:
True
})
return
self
.
post
(
self
.
save_calibration_essay_url
,
data
)
.
json
()
result
=
self
.
post
(
self
.
save_calibration_essay_url
,
data
)
.
json
()
self
.
_record_result
(
'show_calibration_essay'
,
result
)
return
result
def
get_problem_list
(
self
,
course_id
,
grader_id
):
params
=
{
'course_id'
:
course_id
,
'student_id'
:
grader_id
}
response
=
self
.
get
(
self
.
get_problem_list_url
,
params
)
return
response
.
json
()
result
=
response
.
json
()
self
.
_record_result
(
'get_problem_list'
,
result
)
dog_stats_api
.
histogram
(
self
.
_metric_name
(
'get_problem_list.result.length'
),
len
(
result
.
get
(
'problem_list'
,[]))
)
return
result
def
get_notifications
(
self
,
course_id
,
grader_id
):
params
=
{
'course_id'
:
course_id
,
'student_id'
:
grader_id
}
response
=
self
.
get
(
self
.
get_notifications_url
,
params
)
return
response
.
json
()
result
=
response
.
json
()
self
.
_record_result
(
'get_notifications'
,
result
,
tags
=
[
'needs_to_peer_grade:{}'
.
format
(
result
.
get
(
'student_needs_to_peer_grade'
))]
)
return
result
"""
...
...
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