Bonfire Analytics

This commit is contained in:
Nathan Leniz
2015-02-03 18:37:56 -05:00
parent f7e136e3d3
commit c1b995b465
3 changed files with 6 additions and 5 deletions

View File

@ -116,7 +116,6 @@ function bonfireExecute() {
if (challengeEntryPoint && challengeSeed) { if (challengeEntryPoint && challengeSeed) {
userJavaScript = challengeEntryPoint + ' ' + userJavaScript; userJavaScript = challengeEntryPoint + ' ' + userJavaScript;
} }
console.log(userJavaScript);
submit(userJavaScript, function(cls, message) { submit(userJavaScript, function(cls, message) {
if (cls) { if (cls) {
codeOutput.setValue(message.error); codeOutput.setValue(message.error);
@ -210,7 +209,6 @@ var runTests = function(err, data) {
userTests.forEach(function(test, ix, arr){ userTests.forEach(function(test, ix, arr){
try { try {
if (test) { if (test) {
console.log();
var output = eval(reassembleTest(test, data)); var output = eval(reassembleTest(test, data));
} }
} catch(error) { } catch(error) {
@ -232,7 +230,8 @@ var runTests = function(err, data) {
}; };
function showCompletion() { function showCompletion() {
var time = Math.floor(Date.now() / 1000) - started;
ga('send', 'event', 'Bonfire', 'solved', bonfireName + ', Time: ' + (Math.floor(Date.now() / 1000) - started) +', Attempts: ' + attempts); console.log(time);
ga('send', 'event', 'Bonfire', 'solved', bonfireName + ', Time: ' + time +', Attempts: ' + attempts);
$('#complete-bonfire-dialog').modal('show'); $('#complete-bonfire-dialog').modal('show');
} }

View File

@ -1,5 +1,5 @@
$(document).ready(function() { $(document).ready(function() {
if (bonfireName !== undefined) { if (bonfireName) {
ga('send', 'event', 'Bonfire', 'load', bonfireName + ':' + Math.floor(Date.now() / 1000)); ga('send', 'event', 'Bonfire', 'load', bonfireName + ':' + Math.floor(Date.now() / 1000));
} }

View File

@ -4,6 +4,8 @@ block content
.col-sm-12.col-md-12.col-xs-12 .col-sm-12.col-md-12.col-xs-12
.panel.panel-primary .panel.panel-primary
.panel-heading.text-center #{name} (takes #{time} minutes) .panel-heading.text-center #{name} (takes #{time} minutes)
script.
var bonfireName = null;
.panel.panel-body .panel.panel-body
.embed-responsive.embed-responsive-16by9 .embed-responsive.embed-responsive-16by9
iframe.embed-responsive-item(src='//player.vimeo.com/video/#{video}') iframe.embed-responsive-item(src='//player.vimeo.com/video/#{video}')