Commit a0c0005e by Diana Huang

Updates to the javascript and the grading controller

to handle rubric input
parent f3e8d01e
...@@ -115,7 +115,7 @@ class StaffGradingService(GradingService): ...@@ -115,7 +115,7 @@ class StaffGradingService(GradingService):
'grader_id': grader_id}) 'grader_id': grader_id})
def save_grade(self, course_id, grader_id, submission_id, score, feedback, skipped): def save_grade(self, course_id, grader_id, submission_id, score, feedback, skipped, rubric_scores):
""" """
Save a score and feedback for a submission. Save a score and feedback for a submission.
...@@ -132,7 +132,8 @@ class StaffGradingService(GradingService): ...@@ -132,7 +132,8 @@ class StaffGradingService(GradingService):
'score': score, 'score': score,
'feedback': feedback, 'feedback': feedback,
'grader_id': grader_id, 'grader_id': grader_id,
'skipped': skipped} 'skipped': skipped,
'rubric_scores': rubric_scores}
return self.post(self.save_grade_url, data=data) return self.post(self.save_grade_url, data=data)
...@@ -297,7 +298,7 @@ def save_grade(request, course_id): ...@@ -297,7 +298,7 @@ def save_grade(request, course_id):
if request.method != 'POST': if request.method != 'POST':
raise Http404 raise Http404
required = set(['score', 'feedback', 'submission_id', 'location']) required = set(['score', 'feedback', 'submission_id', 'location', 'rubric_scores'])
actual = set(request.POST.keys()) actual = set(request.POST.keys())
missing = required - actual missing = required - actual
if len(missing) > 0: if len(missing) > 0:
...@@ -316,7 +317,8 @@ def save_grade(request, course_id): ...@@ -316,7 +317,8 @@ def save_grade(request, course_id):
p['submission_id'], p['submission_id'],
p['score'], p['score'],
p['feedback'], p['feedback'],
skipped) skipped,
p['rubric_scores'])
except GradingServiceError: except GradingServiceError:
log.exception("Error saving grade") log.exception("Error saving grade")
return _err_response('Could not connect to grading service') return _err_response('Could not connect to grading service')
......
...@@ -227,6 +227,7 @@ class StaffGrading ...@@ -227,6 +227,7 @@ class StaffGrading
if score == undefined if score == undefined
return return
# show button if we have scores for all categories # show button if we have scores for all categories
@state = state_graded
@submit_button.show() @submit_button.show()
...@@ -243,7 +244,7 @@ class StaffGrading ...@@ -243,7 +244,7 @@ class StaffGrading
# get the score for each one # get the score for each one
for i in [0..(num_categories-1)] for i in [0..(num_categories-1)]
score = $("input[name='score-selection-#{i}']:checked").val() score = $("input[name='score-selection-#{i}']:checked").val()
score_lst.append(score) score_lst.push(score)
return score_lst return score_lst
...@@ -431,7 +432,7 @@ class StaffGrading ...@@ -431,7 +432,7 @@ class StaffGrading
# for now, just create an instance and load it... # for now, just create an instance and load it...
mock_backend = true mock_backend = false
ajax_url = $('.staff-grading').data('ajax_url') ajax_url = $('.staff-grading').data('ajax_url')
backend = new StaffGradingBackend(ajax_url, mock_backend) backend = new StaffGradingBackend(ajax_url, mock_backend)
......
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