diff --git a/lms/djangoapps/open_ended_grading/controller_query_service.py b/lms/djangoapps/open_ended_grading/controller_query_service.py index 7c75d44287..d40c9b4428 100644 --- a/lms/djangoapps/open_ended_grading/controller_query_service.py +++ b/lms/djangoapps/open_ended_grading/controller_query_service.py @@ -68,12 +68,14 @@ class ControllerQueryService(GradingService): response = self.get(self.flagged_problem_list_url, params) return response - def take_action_on_flags(self, course_id, student_id, submission_id): + def take_action_on_flags(self, course_id, student_id, submission_id, action_type): params = { 'course_id' : course_id, 'student_id' : student_id, 'submission_id' : submission_id, + 'action_type' : action_type } response = self.post(self.take_action_on_flags_url, params) return response + diff --git a/lms/djangoapps/open_ended_grading/peer_grading_service.py b/lms/djangoapps/open_ended_grading/peer_grading_service.py index 76f54bb12c..994ba0b2be 100644 --- a/lms/djangoapps/open_ended_grading/peer_grading_service.py +++ b/lms/djangoapps/open_ended_grading/peer_grading_service.py @@ -377,4 +377,4 @@ def save_calibration_essay(request, course_id): return HttpResponse(response, mimetype="application/json") except GradingServiceError: log.exception("Error saving calibration grade, location: {0}, submission_id: {1}, submission_key: {2}, grader_id: {3}".format(location, submission_id, submission_key, grader_id)) - return _err_response('Could not connect to grading service') + return _err_response('Could not connect to grading service') \ No newline at end of file diff --git a/lms/djangoapps/open_ended_grading/views.py b/lms/djangoapps/open_ended_grading/views.py index f1a9d41974..717a33ec61 100644 --- a/lms/djangoapps/open_ended_grading/views.py +++ b/lms/djangoapps/open_ended_grading/views.py @@ -287,5 +287,32 @@ def combined_notifications(request, course_id): return render_to_response('open_ended_problems/combined_notifications.html', combined_dict ) + +def take_action_on_flags(request, course_id): + """ + + """ + if request.method != 'POST': + raise Http404 + + + required = ['submission_id', 'action_type', 'student_id'] + for key in required: + if key not in request.POST: + return HttpResponse(json.dumps({'success': False, 'error': 'Missing key {0}'.format(key)}), + mimetype="application/json") + + p = request.POST + submission_id = p['submission_id'] + action_type = p['action_type'] + student_id = p['student_id'] + + try: + controller_qs = ControllerQueryService() + response = controller_qs.save_calibration_essay(course_id, student_id, course_id, action_type) + return HttpResponse(response, mimetype="application/json") + except GradingServiceError: + log.exception("Error saving calibration grade, location: {0}, submission_id: {1}, submission_key: {2}, grader_id: {3}".format(location, submission_id, submission_key, grader_id)) + return _err_response('Could not connect to grading service') diff --git a/lms/templates/open_ended_problems/open_ended_flagged_problems.html b/lms/templates/open_ended_problems/open_ended_flagged_problems.html index eb7b34d8e6..97f1e03c18 100644 --- a/lms/templates/open_ended_problems/open_ended_flagged_problems.html +++ b/lms/templates/open_ended_problems/open_ended_flagged_problems.html @@ -25,9 +25,9 @@ - - + + %for problem in problem_list: @@ -35,13 +35,19 @@ ${problem['problem_name']} + + - %endfor
NameStudent IDID ResponseUnflagBan
- ${problem['student_id']} + ${problem['student_response']} + + + + ${problem['submission_id']} - ${problem['student_response']} + + ${problem['student_id']}