Commit 7518f32f by Renzo Lucioni

Instrument sequentials with segment-io so we know when people switch tabs…

Instrument sequentials with segment-io so we know when people switch tabs manually or using the arrows to navigate
parent d1ebfbc9
......@@ -111,6 +111,11 @@ class @Sequence
if (1 <= new_position) and (new_position <= @num_contents)
Logger.log "seq_goto", old: @position, new: new_position, id: @id
analytics.track "Sequential Goto",
old: @position
new: new_position
id: @id
# On Sequence chage, destroy any existing polling thread
# for queued submissions, see ../capa/display.coffee
if window.queuePollerID
......@@ -127,12 +132,22 @@ class @Sequence
Logger.log "seq_next", old: @position, new: new_position, id: @id
@render new_position
analytics.track "Sequential Next",
old: @position
new: new_position
id: @id
previous: (event) =>
event.preventDefault()
new_position = @position - 1
Logger.log "seq_prev", old: @position, new: new_position, id: @id
@render new_position
analytics.track "Sequential Previous",
old: @position
new: new_position
id: @id
link_for: (position) ->
@$("#sequence-list a[data-element=#{position}]")
......
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