ga completion event modif

This commit is contained in:
evaristoc
2015-12-23 23:31:48 +01:00
parent 235d55fbbf
commit c681c2e858
6 changed files with 2 additions and 11 deletions

View File

@ -13,8 +13,6 @@ window.common = (function(global) {
challengeTypes
} = common;
let attempts = 0;
common.executeChallenge$ = function executeChallenge$() {
const code = common.editor.getValue();
const originalCode = code;
@ -22,8 +20,6 @@ window.common = (function(global) {
const tail = common.arrayToNewLineString(common.tail);
const combinedCode = head + code + tail;
attempts++;
ga('send', 'event', 'Challenge', 'ran-code', common.challengeName);
// run checks for unsafe code

View File

@ -6,14 +6,14 @@ window.common = (function(global) {
} = global;
common.showCompletion = function showCompletion() {
var time = Math.floor(Date.now() - common.started);
ga(
'send',
'event',
'Challenge',
'solved',
common.challengeName + ', Time: ' + time + ', Attempts: ' + 0
common.challengeName,
true
);
var solution = common.editor.getValue();

View File

@ -92,7 +92,6 @@ block content
common.challengeType = !{JSON.stringify(challengeType)};
common.dashedName = !{JSON.stringify(dashedName)};
common.started = Math.floor(Date.now());
common.username = !{JSON.stringify(user && user.username || '')};
include ../partials/challenge-footer

View File

@ -86,7 +86,6 @@ block content
common.challengeType = !{JSON.stringify(challengeType)};
common.dashedName = !{JSON.stringify(dashedName)};
common.started = Math.floor(Date.now());
common.init.push(function() {
common.editor.setOption('lint', false);
common.editor.setOption('mode', 'text/html');
@ -99,4 +98,3 @@ block content
window.main.chat.createHelpChat('freecodecamp/help', '#challenge-help-btn');
}
});

View File

@ -88,7 +88,6 @@ block content
common.challengeType = !{JSON.stringify(challengeType)};
common.dashedName = !{JSON.stringify(dashedName)};
common.started = Math.floor(Date.now());
include ../partials/challenge-footer
script.

View File

@ -72,7 +72,6 @@ block content
var common = window.common || { init: [] };
common.challengeId = !{JSON.stringify(challengeId)};
common.challengeName = !{JSON.stringify(name)};
common.started = Math.floor(Date.now());
common.dashedName = !{JSON.stringify(dashedName)};
common.challengeType = !{JSON.stringify(challengeType)};