Address review comments
This commit is contained in:
@@ -244,6 +244,9 @@ def flagged_problem_list(request, course_id):
|
||||
|
||||
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
|
||||
def combined_notifications(request, course_id):
|
||||
"""
|
||||
Gets combined notifications from the grading controller and displays them
|
||||
"""
|
||||
course = get_course_with_access(request.user, course_id, 'load')
|
||||
user = request.user
|
||||
notifications = open_ended_notifications.combined_notifications(course, user)
|
||||
@@ -292,9 +295,11 @@ def combined_notifications(request, course_id):
|
||||
combined_dict
|
||||
)
|
||||
|
||||
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
|
||||
def take_action_on_flags(request, course_id):
|
||||
"""
|
||||
|
||||
Takes action on student flagged submissions.
|
||||
Currently, only support unflag and ban actions.
|
||||
"""
|
||||
if request.method != 'POST':
|
||||
raise Http404
|
||||
|
||||
@@ -23,8 +23,8 @@ class OpenEnded
|
||||
parent_tr = $(event.target).parent().parent()
|
||||
tr_children = parent_tr.children()
|
||||
action_type = "unflag"
|
||||
submission_id = tr_children[5].innerText
|
||||
student_id = tr_children[6].innerText
|
||||
submission_id = parent_tr.data('submission-id')
|
||||
student_id = parent_tr.data('student-id')
|
||||
callback_func = @after_action_wrapper($(event.target), action_type)
|
||||
@post('take_action_on_flags', {'submission_id' : submission_id, 'student_id' : student_id, 'action_type' : action_type}, callback_func)
|
||||
|
||||
@@ -33,8 +33,8 @@ class OpenEnded
|
||||
parent_tr = $(event.target).parent().parent()
|
||||
tr_children = parent_tr.children()
|
||||
action_type = "ban"
|
||||
submission_id = tr_children[5].innerText
|
||||
student_id = tr_children[6].innerText
|
||||
submission_id = parent_tr.data('submission-id')
|
||||
student_id = parent_tr.data('student-id')
|
||||
callback_func = @after_action_wrapper($(event.target), action_type)
|
||||
@post('take_action_on_flags', {'submission_id' : submission_id, 'student_id' : student_id, 'action_type' : action_type}, callback_func)
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<th></th>
|
||||
</tr>
|
||||
%for problem in problem_list:
|
||||
<tr>
|
||||
<tr data-submission-id="${problem['submission_id']}" data-student-id="${problem['student_id']}">
|
||||
<td>
|
||||
${problem['problem_name']}
|
||||
</td>
|
||||
@@ -50,12 +50,6 @@
|
||||
<td>
|
||||
<div class="action-taken"></div>
|
||||
</td>
|
||||
<td style="display:none;">
|
||||
${problem['submission_id']}
|
||||
</td>
|
||||
<td style="display:none;">
|
||||
${problem['student_id']}
|
||||
</td>
|
||||
</tr>
|
||||
%endfor
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user