Commit 76c40074 by Diana Huang

Merge pull request #1522 from MITx/diana/click-tracking

Add more click tracking and logging to the open ended grading interface
parents 3580deae 9aac915c
class @Rubric class @Rubric
constructor: () -> 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).data("category")
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 # finds the scores for each rubric category
@get_score_list: () => @get_score_list: () =>
# find the number of categories: # find the number of categories:
...@@ -45,6 +60,9 @@ class @CombinedOpenEnded ...@@ -45,6 +60,9 @@ class @CombinedOpenEnded
@task_count = @el.data('task-count') @task_count = @el.data('task-count')
@task_number = @el.data('task-number') @task_number = @el.data('task-number')
@accept_file_upload = @el.data('accept-file-upload') @accept_file_upload = @el.data('accept-file-upload')
@location = @el.data('location')
# set up handlers for click tracking
Rubric.initialize(@location)
@allow_reset = @el.data('allow_reset') @allow_reset = @el.data('allow_reset')
@reset_button = @$('.reset-button') @reset_button = @$('.reset-button')
...@@ -118,6 +136,9 @@ class @CombinedOpenEnded ...@@ -118,6 +136,9 @@ class @CombinedOpenEnded
@submit_evaluation_button = $('.submit-evaluation-button') @submit_evaluation_button = $('.submit-evaluation-button')
@submit_evaluation_button.click @message_post @submit_evaluation_button.click @message_post
Collapsible.setCollapsibles(@results_container) Collapsible.setCollapsibles(@results_container)
# make sure we still have click tracking
$('.evaluation-response a').click @log_feedback_click
$('input[name="evaluation-score"]').change @log_feedback_selection
show_results: (event) => show_results: (event) =>
status_item = $(event.target).parent() status_item = $(event.target).parent()
...@@ -155,7 +176,6 @@ class @CombinedOpenEnded ...@@ -155,7 +176,6 @@ class @CombinedOpenEnded
@legend_container= $('.legend-container') @legend_container= $('.legend-container')
message_post: (event)=> message_post: (event)=>
Logger.log 'message_post', @answers
external_grader_message=$(event.target).parent().parent().parent() external_grader_message=$(event.target).parent().parent().parent()
evaluation_scoring = $(event.target).parent() evaluation_scoring = $(event.target).parent()
...@@ -184,6 +204,7 @@ class @CombinedOpenEnded ...@@ -184,6 +204,7 @@ class @CombinedOpenEnded
$('section.evaluation').slideToggle() $('section.evaluation').slideToggle()
@message_wrapper.html(response.message_html) @message_wrapper.html(response.message_html)
$.ajaxWithPrefix("#{@ajax_url}/save_post_assessment", settings) $.ajaxWithPrefix("#{@ajax_url}/save_post_assessment", settings)
...@@ -406,7 +427,7 @@ class @CombinedOpenEnded ...@@ -406,7 +427,7 @@ class @CombinedOpenEnded
$.postWithPrefix "#{@ajax_url}/check_for_score", (response) => $.postWithPrefix "#{@ajax_url}/check_for_score", (response) =>
if response.state == "done" or response.state=="post_assessment" if response.state == "done" or response.state=="post_assessment"
delete window.queuePollerID delete window.queuePollerID
location.reload() @reload()
else else
window.queuePollerID = window.setTimeout(@poll, 10000) window.queuePollerID = window.setTimeout(@poll, 10000)
...@@ -440,7 +461,9 @@ class @CombinedOpenEnded ...@@ -440,7 +461,9 @@ class @CombinedOpenEnded
@prompt_container.toggleClass('open') @prompt_container.toggleClass('open')
if @question_header.text() == "(Hide)" if @question_header.text() == "(Hide)"
new_text = "(Show)" new_text = "(Show)"
Logger.log 'oe_hide_question', {location: @location}
else else
Logger.log 'oe_show_question', {location: @location}
new_text = "(Hide)" new_text = "(Hide)"
@question_header.text(new_text) @question_header.text(new_text)
...@@ -456,4 +479,16 @@ class @CombinedOpenEnded ...@@ -456,4 +479,16 @@ class @CombinedOpenEnded
@prompt_container.toggleClass('open') @prompt_container.toggleClass('open')
@question_header.text("(Show)") @question_header.text("(Show)")
log_feedback_click: (event) ->
link_text = $(event.target).html()
if link_text == 'See full feedback'
Logger.log 'oe_show_full_feedback', {}
else if link_text == 'Respond to Feedback'
Logger.log 'oe_show_respond_to_feedback', {}
else
generated_event_type = link_text.toLowerCase().replace(" ","_")
Logger.log "oe_" + generated_event_type, {}
log_feedback_selection: (event) ->
target_selection = $(event.target).val()
Logger.log 'oe_feedback_response_selected', {value: target_selection}
...@@ -426,6 +426,7 @@ class @PeerGradingProblem ...@@ -426,6 +426,7 @@ class @PeerGradingProblem
@submit_button.hide() @submit_button.hide()
@action_button.hide() @action_button.hide()
@calibration_feedback_panel.hide() @calibration_feedback_panel.hide()
Rubric.initialize(@location)
render_calibration_feedback: (response) => render_calibration_feedback: (response) =>
...@@ -476,7 +477,9 @@ class @PeerGradingProblem ...@@ -476,7 +477,9 @@ class @PeerGradingProblem
@prompt_container.slideToggle() @prompt_container.slideToggle()
@prompt_container.toggleClass('open') @prompt_container.toggleClass('open')
if @question_header.text() == "(Hide)" if @question_header.text() == "(Hide)"
Logger.log 'peer_grading_hide_question', {location: @location}
new_text = "(Show)" new_text = "(Show)"
else else
Logger.log 'peer_grading_show_question', {location: @location}
new_text = "(Hide)" new_text = "(Hide)"
@question_header.text(new_text) @question_header.text(new_text)
...@@ -330,6 +330,7 @@ class CombinedOpenEndedV1Module(): ...@@ -330,6 +330,7 @@ class CombinedOpenEndedV1Module():
'status': self.get_status(False), 'status': self.get_status(False),
'display_name': self.display_name, 'display_name': self.display_name,
'accept_file_upload': self.accept_file_upload, 'accept_file_upload': self.accept_file_upload,
'location': self.location,
'legend_list' : LEGEND_LIST, 'legend_list' : LEGEND_LIST,
} }
......
...@@ -354,6 +354,10 @@ class OpenEndedChild(object): ...@@ -354,6 +354,10 @@ class OpenEndedChild(object):
if get_data['can_upload_files'] in ['true', '1']: if get_data['can_upload_files'] in ['true', '1']:
has_file_to_upload = True has_file_to_upload = True
file = get_data['student_file'][0] file = get_data['student_file'][0]
if self.system.track_fuction:
self.system.track_function('open_ended_image_upload', {'filename': file.name})
else:
log.info("No tracking function found when uploading image.")
uploaded_to_s3, image_ok, s3_public_url = self.upload_image_to_s3(file) uploaded_to_s3, image_ok, s3_public_url = self.upload_image_to_s3(file)
if uploaded_to_s3: if uploaded_to_s3:
image_tag = self.generate_image_tag_from_url(s3_public_url, file.name) image_tag = self.generate_image_tag_from_url(s3_public_url, file.name)
......
...@@ -148,6 +148,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t ...@@ -148,6 +148,7 @@ The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for t
class @StaffGrading class @StaffGrading
constructor: (backend) -> constructor: (backend) ->
AjaxPrefix.addAjaxPrefix(jQuery, -> "")
@backend = backend @backend = backend
# all the jquery selectors # all the jquery selectors
...@@ -219,6 +220,7 @@ class @StaffGrading ...@@ -219,6 +220,7 @@ class @StaffGrading
setup_score_selection: => setup_score_selection: =>
@score_selection_container.html(@rubric) @score_selection_container.html(@rubric)
$('.score-selection').click => @graded_callback() $('.score-selection').click => @graded_callback()
Rubric.initialize(@location)
graded_callback: () => graded_callback: () =>
...@@ -441,8 +443,10 @@ class @StaffGrading ...@@ -441,8 +443,10 @@ class @StaffGrading
@prompt_container.slideToggle() @prompt_container.slideToggle()
@prompt_container.toggleClass('open') @prompt_container.toggleClass('open')
if @question_header.text() == "(Hide)" if @question_header.text() == "(Hide)"
Logger.log 'staff_grading_hide_question', {location: @location}
new_text = "(Show)" new_text = "(Show)"
else else
Logger.log 'staff_grading_show_question', {location: @location}
new_text = "(Hide)" new_text = "(Hide)"
@question_header.text(new_text) @question_header.text(new_text)
......
<section id="combined-open-ended" class="combined-open-ended" data-ajax-url="${ajax_url}" data-allow_reset="${allow_reset}" data-state="${state}" data-task-count="${task_count}" data-task-number="${task_number}" data-accept-file-upload = "${accept_file_upload}"> <section id="combined-open-ended" class="combined-open-ended" data-location="${location}" data-ajax-url="${ajax_url}" data-allow_reset="${allow_reset}" data-state="${state}" data-task-count="${task_count}" data-task-number="${task_number}" data-accept-file-upload = "${accept_file_upload}">
<div class="status-container"> <div class="status-container">
${status|n} ${status|n}
</div> </div>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<li class="rubric-list-item"> <li class="rubric-list-item">
% endif % endif
<label class="rubric-label" for="score-${i}-${j}"> <label class="rubric-label" for="score-${i}-${j}">
<input type="radio" class="score-selection" name="score-selection-${i}" id="score-${i}-${j}" value="${option['points']}"/> <input type="radio" class="score-selection" data-category="${i}" name="score-selection-${i}" id="score-${i}-${j}" value="${option['points']}"/>
<span class="wrappable"> ${option['points']} points : ${option['text']}</span> <span class="wrappable"> ${option['points']} points : ${option['text']}</span>
</label> </label>
</li> </li>
......
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