Commit bcbce3ef by Renzo Lucioni

Add handful of events to the Segment.io whitelist

parent b14553d8
...@@ -138,7 +138,7 @@ class @Problem ...@@ -138,7 +138,7 @@ class @Problem
# maybe preferable to consolidate all dispatches to use FormData # maybe preferable to consolidate all dispatches to use FormData
### ###
check_fd: => check_fd: =>
Logger.log 'problem_check', @answers Logger.log 'problem_check', answers: @answers
# If there are no file inputs in the problem, we can fall back on @check # If there are no file inputs in the problem, we can fall back on @check
if $('input:file').length == 0 if $('input:file').length == 0
...@@ -212,7 +212,7 @@ class @Problem ...@@ -212,7 +212,7 @@ class @Problem
$.ajaxWithPrefix("#{@url}/problem_check", settings) $.ajaxWithPrefix("#{@url}/problem_check", settings)
check: => check: =>
Logger.log 'problem_check', @answers Logger.log 'problem_check', answers: @answers
$.postWithPrefix "#{@url}/problem_check", @answers, (response) => $.postWithPrefix "#{@url}/problem_check", @answers, (response) =>
switch response.success switch response.success
when 'incorrect', 'correct' when 'incorrect', 'correct'
...@@ -224,7 +224,7 @@ class @Problem ...@@ -224,7 +224,7 @@ class @Problem
@gentle_alert response.success @gentle_alert response.success
reset: => reset: =>
Logger.log 'problem_reset', @answers Logger.log 'problem_reset', answers: @answers
$.postWithPrefix "#{@url}/problem_reset", id: @id, (response) => $.postWithPrefix "#{@url}/problem_reset", id: @id, (response) =>
@render(response.html) @render(response.html)
@updateProgress response @updateProgress response
...@@ -284,7 +284,7 @@ class @Problem ...@@ -284,7 +284,7 @@ class @Problem
@el.find('.capa_alert').css(opacity: 0).animate(opacity: 1, 700) @el.find('.capa_alert').css(opacity: 0).animate(opacity: 1, 700)
save: => save: =>
Logger.log 'problem_save', @answers Logger.log 'problem_save', answers: @answers
$.postWithPrefix "#{@url}/problem_save", @answers, (response) => $.postWithPrefix "#{@url}/problem_save", @answers, (response) =>
saveMessage = response.msg saveMessage = response.msg
@gentle_alert saveMessage @gentle_alert saveMessage
......
class @Logger class @Logger
# events we want sent to Segment.io for tracking # events we want sent to Segment.io for tracking
SEGMENT_IO_WHITELIST = ["seq_goto", "seq_next", "seq_prev"] SEGMENT_IO_WHITELIST = ["seq_goto", "seq_next", "seq_prev", "problem_check", "problem_reset", "problem_show", "problem_save"]
@log: (event_type, data) -> @log: (event_type, data) ->
if event_type in SEGMENT_IO_WHITELIST if event_type in SEGMENT_IO_WHITELIST
......
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