ga completion event modif
This commit is contained in:
@ -13,8 +13,6 @@ window.common = (function(global) {
|
|||||||
challengeTypes
|
challengeTypes
|
||||||
} = common;
|
} = common;
|
||||||
|
|
||||||
let attempts = 0;
|
|
||||||
|
|
||||||
common.executeChallenge$ = function executeChallenge$() {
|
common.executeChallenge$ = function executeChallenge$() {
|
||||||
const code = common.editor.getValue();
|
const code = common.editor.getValue();
|
||||||
const originalCode = code;
|
const originalCode = code;
|
||||||
@ -22,8 +20,6 @@ window.common = (function(global) {
|
|||||||
const tail = common.arrayToNewLineString(common.tail);
|
const tail = common.arrayToNewLineString(common.tail);
|
||||||
const combinedCode = head + code + tail;
|
const combinedCode = head + code + tail;
|
||||||
|
|
||||||
attempts++;
|
|
||||||
|
|
||||||
ga('send', 'event', 'Challenge', 'ran-code', common.challengeName);
|
ga('send', 'event', 'Challenge', 'ran-code', common.challengeName);
|
||||||
|
|
||||||
// run checks for unsafe code
|
// run checks for unsafe code
|
||||||
|
@ -6,14 +6,14 @@ window.common = (function(global) {
|
|||||||
} = global;
|
} = global;
|
||||||
|
|
||||||
common.showCompletion = function showCompletion() {
|
common.showCompletion = function showCompletion() {
|
||||||
var time = Math.floor(Date.now() - common.started);
|
|
||||||
|
|
||||||
ga(
|
ga(
|
||||||
'send',
|
'send',
|
||||||
'event',
|
'event',
|
||||||
'Challenge',
|
'Challenge',
|
||||||
'solved',
|
'solved',
|
||||||
common.challengeName + ', Time: ' + time + ', Attempts: ' + 0
|
common.challengeName,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
var solution = common.editor.getValue();
|
var solution = common.editor.getValue();
|
||||||
|
@ -92,7 +92,6 @@ block content
|
|||||||
common.challengeType = !{JSON.stringify(challengeType)};
|
common.challengeType = !{JSON.stringify(challengeType)};
|
||||||
common.dashedName = !{JSON.stringify(dashedName)};
|
common.dashedName = !{JSON.stringify(dashedName)};
|
||||||
|
|
||||||
common.started = Math.floor(Date.now());
|
|
||||||
common.username = !{JSON.stringify(user && user.username || '')};
|
common.username = !{JSON.stringify(user && user.username || '')};
|
||||||
|
|
||||||
include ../partials/challenge-footer
|
include ../partials/challenge-footer
|
||||||
|
@ -86,7 +86,6 @@ block content
|
|||||||
common.challengeType = !{JSON.stringify(challengeType)};
|
common.challengeType = !{JSON.stringify(challengeType)};
|
||||||
common.dashedName = !{JSON.stringify(dashedName)};
|
common.dashedName = !{JSON.stringify(dashedName)};
|
||||||
|
|
||||||
common.started = Math.floor(Date.now());
|
|
||||||
common.init.push(function() {
|
common.init.push(function() {
|
||||||
common.editor.setOption('lint', false);
|
common.editor.setOption('lint', false);
|
||||||
common.editor.setOption('mode', 'text/html');
|
common.editor.setOption('mode', 'text/html');
|
||||||
@ -99,4 +98,3 @@ block content
|
|||||||
window.main.chat.createHelpChat('freecodecamp/help', '#challenge-help-btn');
|
window.main.chat.createHelpChat('freecodecamp/help', '#challenge-help-btn');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -88,7 +88,6 @@ block content
|
|||||||
common.challengeType = !{JSON.stringify(challengeType)};
|
common.challengeType = !{JSON.stringify(challengeType)};
|
||||||
common.dashedName = !{JSON.stringify(dashedName)};
|
common.dashedName = !{JSON.stringify(dashedName)};
|
||||||
|
|
||||||
common.started = Math.floor(Date.now());
|
|
||||||
|
|
||||||
include ../partials/challenge-footer
|
include ../partials/challenge-footer
|
||||||
script.
|
script.
|
||||||
|
@ -72,7 +72,6 @@ block content
|
|||||||
var common = window.common || { init: [] };
|
var common = window.common || { init: [] };
|
||||||
common.challengeId = !{JSON.stringify(challengeId)};
|
common.challengeId = !{JSON.stringify(challengeId)};
|
||||||
common.challengeName = !{JSON.stringify(name)};
|
common.challengeName = !{JSON.stringify(name)};
|
||||||
common.started = Math.floor(Date.now());
|
|
||||||
common.dashedName = !{JSON.stringify(dashedName)};
|
common.dashedName = !{JSON.stringify(dashedName)};
|
||||||
common.challengeType = !{JSON.stringify(challengeType)};
|
common.challengeType = !{JSON.stringify(challengeType)};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user