From c1b995b465b413f9376fc1939ae0e609a6458d66 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Tue, 3 Feb 2015 18:37:56 -0500 Subject: [PATCH] Bonfire Analytics --- public/js/lib/bonfire/bonfireFramework.js | 7 +++---- public/js/main.js | 2 +- views/challenges/show.jade | 2 ++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/public/js/lib/bonfire/bonfireFramework.js b/public/js/lib/bonfire/bonfireFramework.js index 965dca2968..95d8bada06 100644 --- a/public/js/lib/bonfire/bonfireFramework.js +++ b/public/js/lib/bonfire/bonfireFramework.js @@ -116,7 +116,6 @@ function bonfireExecute() { if (challengeEntryPoint && challengeSeed) { userJavaScript = challengeEntryPoint + ' ' + userJavaScript; } - console.log(userJavaScript); submit(userJavaScript, function(cls, message) { if (cls) { codeOutput.setValue(message.error); @@ -210,7 +209,6 @@ var runTests = function(err, data) { userTests.forEach(function(test, ix, arr){ try { if (test) { - console.log(); var output = eval(reassembleTest(test, data)); } } catch(error) { @@ -232,7 +230,8 @@ var runTests = function(err, data) { }; function showCompletion() { - - ga('send', 'event', 'Bonfire', 'solved', bonfireName + ', Time: ' + (Math.floor(Date.now() / 1000) - started) +', Attempts: ' + attempts); + var time = Math.floor(Date.now() / 1000) - started; + console.log(time); + ga('send', 'event', 'Bonfire', 'solved', bonfireName + ', Time: ' + time +', Attempts: ' + attempts); $('#complete-bonfire-dialog').modal('show'); } \ No newline at end of file diff --git a/public/js/main.js b/public/js/main.js index e31855baf9..bcaecada67 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -1,5 +1,5 @@ $(document).ready(function() { - if (bonfireName !== undefined) { + if (bonfireName) { ga('send', 'event', 'Bonfire', 'load', bonfireName + ':' + Math.floor(Date.now() / 1000)); } diff --git a/views/challenges/show.jade b/views/challenges/show.jade index 19a4718cba..13dc136c08 100644 --- a/views/challenges/show.jade +++ b/views/challenges/show.jade @@ -4,6 +4,8 @@ block content .col-sm-12.col-md-12.col-xs-12 .panel.panel-primary .panel-heading.text-center #{name} (takes #{time} minutes) + script. + var bonfireName = null; .panel.panel-body .embed-responsive.embed-responsive-16by9 iframe.embed-responsive-item(src='//player.vimeo.com/video/#{video}')