From e5c6414d39daef349bc16c136cb3c2b41e06a64b Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Mon, 14 Jan 2013 17:35:41 -0500 Subject: [PATCH] Adding score selection back into staff grading view --- .../src/staff_grading/staff_grading.coffee | 27 +++++++++++++++---- lms/templates/instructor/staff_grading.html | 2 ++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index d8fcb087a6..8e1fe738bf 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -174,7 +174,8 @@ class StaffGrading @grading_wrapper = $('.grading-wrapper') @feedback_area = $('.feedback-area') - @score_selection_container = $('.score-selection-container') + @score_selection_container = $('.score-selection-container') + @grade_selection_container = $('.grade-selection-container') @submit_button = $('.submit-button') @action_button = $('.action-button') @@ -202,6 +203,7 @@ class StaffGrading @num_graded = 0 @num_pending = 0 @score_lst = [] + @score = null @problems = null @@ -216,10 +218,23 @@ class StaffGrading setup_score_selection: => + # first, get rid of all the old inputs, if any. + @grade_selection_container.html('Choose score: ') + # Now create new labels and inputs for each possible score. + for score in [0..@max_score] + id = 'score-' + score + label = """""" + input = """ + + """ # " fix broken parsing in emacs + @grade_selection_container.append(input + label) + @score_selection_container.html(@rubric) $('.score-selection').click => @graded_callback() graded_callback: () => + @grade = $("input[name='grade-selection']:selected").val() + # check to see whether or not any categories have not been scored num_categories = $('table.rubric tr').length for i in [0..(num_categories-1)] @@ -229,8 +244,6 @@ class StaffGrading # show button if we have scores for all categories @state = state_graded @submit_button.show() - - set_button_text: (text) => @action_button.attr('value', text) @@ -272,6 +285,7 @@ class StaffGrading skip_and_get_next: () => data = + score: @grade rubric_scores: @get_score_list() feedback: @feedback_area.val() submission_id: @submission_id @@ -285,8 +299,8 @@ class StaffGrading submit_and_get_next: () -> data = + score: @grade rubric_scores: @get_score_list() - score: 0 feedback: @feedback_area.val() submission_id: @submission_id location: @location @@ -303,6 +317,8 @@ class StaffGrading @rubric = response.rubric @submission_id = response.submission_id @feedback_area.val('') + @grade = null + @max_score = response.max_score @ml_error_info=response.ml_error_info @prompt_name = response.problem_name @num_graded = response.num_graded @@ -322,9 +338,10 @@ class StaffGrading @ml_error_info = null @submission_id = null @message = message + @grade = null + @max_score = 0 @state = state_no_data - render_view: () -> # clear the problem list and breadcrumbs @problem_list.html('') diff --git a/lms/templates/instructor/staff_grading.html b/lms/templates/instructor/staff_grading.html index 3749a63e73..7364e3beb8 100644 --- a/lms/templates/instructor/staff_grading.html +++ b/lms/templates/instructor/staff_grading.html @@ -71,6 +71,8 @@
+

+