From 943a5657178ba89d00b093a0f8d1a57585d95e27 Mon Sep 17 00:00:00 2001 From: Diana Huang Date: Wed, 13 Feb 2013 16:37:26 -0500 Subject: [PATCH] Log rubric selection clicks --- .../js/src/combinedopenended/display.coffee | 19 ++++++++++++++++++- .../peergrading/peer_grading_problem.coffee | 1 + .../combined_open_ended_modulev1.py | 3 ++- .../src/staff_grading/staff_grading.coffee | 2 ++ lms/templates/combined_open_ended.html | 2 +- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee index c871b6de75..6651a719c7 100644 --- a/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee @@ -1,6 +1,21 @@ class @Rubric constructor: () -> + @initialize: (location) -> + $('.rubric').data("location", location) + $('input[class="score-selection"]').change @tracking_callback + + @tracking_callback: (event) -> + target_selection = $(event.target).val() + # chop off the beginning of the name so that we can get the number of the category + category = $(event.target).prop("name").substring(16) + location = $('.rubric').data('location') + # probably want the original problem location as well + + data = {location: location, selection: target_selection, category: category} + Logger.log 'rubric_select', data + + # finds the scores for each rubric category @get_score_list: () => # find the number of categories: @@ -45,6 +60,8 @@ class @CombinedOpenEnded @task_count = @el.data('task-count') @task_number = @el.data('task-number') @accept_file_upload = @el.data('accept-file-upload') + @location = @el.data('location') + Rubric.initialize(@location) @allow_reset = @el.data('allow_reset') @reset_button = @$('.reset-button') @@ -153,7 +170,6 @@ class @CombinedOpenEnded @legend_container= $('.legend-container') message_post: (event)=> - Logger.log 'message_post', @answers external_grader_message=$(event.target).parent().parent().parent() evaluation_scoring = $(event.target).parent() @@ -182,6 +198,7 @@ class @CombinedOpenEnded $('section.evaluation').slideToggle() @message_wrapper.html(response.message_html) + $.ajaxWithPrefix("#{@ajax_url}/save_post_assessment", settings) diff --git a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee index 5770238649..0d83c0a6b6 100644 --- a/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee +++ b/common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee @@ -420,6 +420,7 @@ class @PeerGradingProblem @submit_button.hide() @action_button.hide() @calibration_feedback_panel.hide() + Rubric.initialize(@location) render_calibration_feedback: (response) => diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py index d1355c1130..62f173e3d3 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py @@ -340,6 +340,7 @@ class CombinedOpenEndedV1Module(): 'status': self.get_status(False), 'display_name': self.display_name, 'accept_file_upload': self.accept_file_upload, + 'location': self.location, 'legend_list' : LEGEND_LIST, } @@ -823,4 +824,4 @@ class CombinedOpenEndedV1Descriptor(XmlDescriptor, EditingDescriptor): for child in ['task']: add_child(child) - return elt \ No newline at end of file + return elt diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index e26a96ebed..491f04c9c8 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -148,6 +148,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t class @StaffGrading constructor: (backend) -> + AjaxPrefix.addAjaxPrefix(jQuery, -> "") @backend = backend # all the jquery selectors @@ -218,6 +219,7 @@ class @StaffGrading setup_score_selection: => @score_selection_container.html(@rubric) $('.score-selection').click => @graded_callback() + Rubric.initialize(@location) graded_callback: () => diff --git a/lms/templates/combined_open_ended.html b/lms/templates/combined_open_ended.html index 700e171ace..5d8ef859aa 100644 --- a/lms/templates/combined_open_ended.html +++ b/lms/templates/combined_open_ended.html @@ -1,4 +1,4 @@ -
+
${status|n}