Commit d23eb93f by Diana Huang

add new peer grading service with some rudimentary logic

parent 125945de
......@@ -6,6 +6,8 @@ import sys
from django.conf import settings
from django.http import HttpResponse, Http404
from grading_service import GradingService
from grading_service import GradingServiceError
from courseware.access import has_access
from util.json_request import expect_json
......@@ -13,3 +15,26 @@ from xmodule.course_module import CourseDescriptor
log = logging.getLogger(__name__)
class PeerGradingService(GradingService):
"""
Interface with the grading controller for peer grading
"""
def __init__(self, config):
super(PeerGradingService, self).__init__(config)
self.get_next_submission_url = self.url + '/get_next_submission/'
self.save_grade_url = self.url + '/save_grade/'
self.is_student_calibrated_url = self.url + '/is_student_calibrated/'
self.show_calibration_essay = self.url + '/show_calibration_essay/'
self.save_calibration_essay = self.url + '/save_calibration_essay/'
def get_next_submission(self, problem_location, grader_id):
return self.get(self.get_next_submission_url, False,
{'location': problem_location, 'grader_id': grader_id})
def save_grade(self, grader_id, submission_id, score, feedback, submission_key):
data = {'grader_id' : grader_id,
'submission_id' : submission_id,
'score' : score,
'feedback' : feedback,
'submission_key', submission_key}
return self.post(self.save_grade_url, False, data)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment