Commit c770458e by Renzo Lucioni

Reinstate problem_check event as Problem Checked event

parent f9f0d9cc
...@@ -162,8 +162,9 @@ class @Problem ...@@ -162,8 +162,9 @@ class @Problem
# maybe preferable to consolidate all dispatches to use FormData # maybe preferable to consolidate all dispatches to use FormData
### ###
check_fd: => check_fd: =>
# Calling check from check_fd will result in firing the 'problem_check' event twice, since it is also called in the check function. # Calling check from check_fd will result in firing the 'problem_check' event twice,
#Logger.log 'problem_check', @answers # since it is also called in the check function.
# Logger.log 'problem_check', @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
...@@ -239,6 +240,11 @@ class @Problem ...@@ -239,6 +240,11 @@ class @Problem
check: => check: =>
@check_waitfor() @check_waitfor()
Logger.log 'problem_check', @answers Logger.log 'problem_check', @answers
# Segment.io
analytics.track "Problem Checked",
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'
......
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