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
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
@get_score_list: () =>
# find the number of categories:
......@@ -45,6 +60,9 @@ 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')
# set up handlers for click tracking
Rubric.initialize(@location)
@allow_reset = @el.data('allow_reset')
@reset_button = @$('.reset-button')
......@@ -118,6 +136,9 @@ class @CombinedOpenEnded
@submit_evaluation_button = $('.submit-evaluation-button')
@submit_evaluation_button.click @message_post
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) =>
status_item = $(event.target).parent()
......@@ -155,7 +176,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()
......@@ -184,6 +204,7 @@ class @CombinedOpenEnded
$('section.evaluation').slideToggle()
@message_wrapper.html(response.message_html)
$.ajaxWithPrefix("#{@ajax_url}/save_post_assessment", settings)
......@@ -406,7 +427,7 @@ class @CombinedOpenEnded
$.postWithPrefix "#{@ajax_url}/check_for_score", (response) =>
if response.state == "done" or response.state=="post_assessment"
delete window.queuePollerID
location.reload()
@reload()
else
window.queuePollerID = window.setTimeout(@poll, 10000)
......@@ -440,7 +461,9 @@ class @CombinedOpenEnded
@prompt_container.toggleClass('open')
if @question_header.text() == "(Hide)"
new_text = "(Show)"
Logger.log 'oe_hide_question', {location: @location}
else
Logger.log 'oe_show_question', {location: @location}
new_text = "(Hide)"
@question_header.text(new_text)
......@@ -456,4 +479,16 @@ class @CombinedOpenEnded
@prompt_container.toggleClass('open')
@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
@submit_button.hide()
@action_button.hide()
@calibration_feedback_panel.hide()
Rubric.initialize(@location)
render_calibration_feedback: (response) =>
......@@ -476,7 +477,9 @@ class @PeerGradingProblem
@prompt_container.slideToggle()
@prompt_container.toggleClass('open')
if @question_header.text() == "(Hide)"
Logger.log 'peer_grading_hide_question', {location: @location}
new_text = "(Show)"
else
Logger.log 'peer_grading_show_question', {location: @location}
new_text = "(Hide)"
@question_header.text(new_text)
......@@ -330,6 +330,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,
}
......@@ -814,4 +815,4 @@ class CombinedOpenEndedV1Descriptor(XmlDescriptor, EditingDescriptor):
for child in ['task']:
add_child(child)
return elt
\ No newline at end of file
return elt
......@@ -354,6 +354,10 @@ class OpenEndedChild(object):
if get_data['can_upload_files'] in ['true', '1']:
has_file_to_upload = True
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)
if uploaded_to_s3:
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
class @StaffGrading
constructor: (backend) ->
AjaxPrefix.addAjaxPrefix(jQuery, -> "")
@backend = backend
# all the jquery selectors
......@@ -219,6 +220,7 @@ class @StaffGrading
setup_score_selection: =>
@score_selection_container.html(@rubric)
$('.score-selection').click => @graded_callback()
Rubric.initialize(@location)
graded_callback: () =>
......@@ -441,8 +443,10 @@ class @StaffGrading
@prompt_container.slideToggle()
@prompt_container.toggleClass('open')
if @question_header.text() == "(Hide)"
Logger.log 'staff_grading_hide_question', {location: @location}
new_text = "(Show)"
else
Logger.log 'staff_grading_show_question', {location: @location}
new_text = "(Hide)"
@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">
${status|n}
</div>
......
......@@ -14,7 +14,7 @@
<li class="rubric-list-item">
% endif
<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>
</label>
</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