Work on adding in ban actions
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
<table class="problem-list">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Student ID</th>
|
||||
<th>ID</th>
|
||||
<th>Response</th>
|
||||
<th>Unflag</th>
|
||||
<th>Ban</th>
|
||||
</tr>
|
||||
%for problem in problem_list:
|
||||
<tr>
|
||||
@@ -35,13 +35,19 @@
|
||||
${problem['problem_name']}
|
||||
</td>
|
||||
<td>
|
||||
${problem['student_id']}
|
||||
${problem['student_response']}
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td style="display:none;">
|
||||
${problem['submission_id']}
|
||||
</td>
|
||||
<td>
|
||||
${problem['student_response']}
|
||||
<td style="display:none;">
|
||||
${problem['student_id']}
|
||||
</td>
|
||||
</tr>
|
||||
%endfor
|
||||
|
||||
Reference in New Issue
Block a user