From 7f96fbb3d1becf40b295c9c3465d4ef48b5af60e Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Mon, 4 Feb 2013 17:15:07 -0500 Subject: [PATCH] Address review comments --- lms/djangoapps/open_ended_grading/views.py | 7 ++++++- lms/static/coffee/src/open_ended/open_ended.coffee | 8 ++++---- .../open_ended_problems/open_ended_flagged_problems.html | 8 +------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lms/djangoapps/open_ended_grading/views.py b/lms/djangoapps/open_ended_grading/views.py index 1777f26e2e..156bdadddd 100644 --- a/lms/djangoapps/open_ended_grading/views.py +++ b/lms/djangoapps/open_ended_grading/views.py @@ -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 diff --git a/lms/static/coffee/src/open_ended/open_ended.coffee b/lms/static/coffee/src/open_ended/open_ended.coffee index aff1e5fc67..61e0c73dba 100644 --- a/lms/static/coffee/src/open_ended/open_ended.coffee +++ b/lms/static/coffee/src/open_ended/open_ended.coffee @@ -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) 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 ec892da43c..b4c6f43685 100644 --- a/lms/templates/open_ended_problems/open_ended_flagged_problems.html +++ b/lms/templates/open_ended_problems/open_ended_flagged_problems.html @@ -34,7 +34,7 @@ %for problem in problem_list: - + ${problem['problem_name']} @@ -50,12 +50,6 @@
- - ${problem['submission_id']} - - - ${problem['student_id']} - %endfor