Commit 7f96fbb3 by Vik Paruchuri

Address review comments

parent 8bd7b60a
...@@ -244,6 +244,9 @@ def flagged_problem_list(request, course_id): ...@@ -244,6 +244,9 @@ def flagged_problem_list(request, course_id):
@cache_control(no_cache=True, no_store=True, must_revalidate=True) @cache_control(no_cache=True, no_store=True, must_revalidate=True)
def combined_notifications(request, course_id): 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') course = get_course_with_access(request.user, course_id, 'load')
user = request.user user = request.user
notifications = open_ended_notifications.combined_notifications(course, user) notifications = open_ended_notifications.combined_notifications(course, user)
...@@ -292,9 +295,11 @@ def combined_notifications(request, course_id): ...@@ -292,9 +295,11 @@ def combined_notifications(request, course_id):
combined_dict combined_dict
) )
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
def take_action_on_flags(request, course_id): 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': if request.method != 'POST':
raise Http404 raise Http404
......
...@@ -23,8 +23,8 @@ class OpenEnded ...@@ -23,8 +23,8 @@ class OpenEnded
parent_tr = $(event.target).parent().parent() parent_tr = $(event.target).parent().parent()
tr_children = parent_tr.children() tr_children = parent_tr.children()
action_type = "unflag" action_type = "unflag"
submission_id = tr_children[5].innerText submission_id = parent_tr.data('submission-id')
student_id = tr_children[6].innerText student_id = parent_tr.data('student-id')
callback_func = @after_action_wrapper($(event.target), action_type) 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) @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 ...@@ -33,8 +33,8 @@ class OpenEnded
parent_tr = $(event.target).parent().parent() parent_tr = $(event.target).parent().parent()
tr_children = parent_tr.children() tr_children = parent_tr.children()
action_type = "ban" action_type = "ban"
submission_id = tr_children[5].innerText submission_id = parent_tr.data('submission-id')
student_id = tr_children[6].innerText student_id = parent_tr.data('student-id')
callback_func = @after_action_wrapper($(event.target), action_type) 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) @post('take_action_on_flags', {'submission_id' : submission_id, 'student_id' : student_id, 'action_type' : action_type}, callback_func)
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<th></th> <th></th>
</tr> </tr>
%for problem in problem_list: %for problem in problem_list:
<tr> <tr data-submission-id="${problem['submission_id']}" data-student-id="${problem['student_id']}">
<td> <td>
${problem['problem_name']} ${problem['problem_name']}
</td> </td>
...@@ -50,12 +50,6 @@ ...@@ -50,12 +50,6 @@
<td> <td>
<div class="action-taken"></div> <div class="action-taken"></div>
</td> </td>
<td style="display:none;">
${problem['submission_id']}
</td>
<td style="display:none;">
${problem['student_id']}
</td>
</tr> </tr>
%endfor %endfor
</table> </table>
......
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