Merge pull request #6601 from SaintPeter/feature/challenge-checksum
Add Checksum to Challenges for Google Analytics
This commit is contained in:
@@ -178,7 +178,10 @@ function getRenderData$(user, challenge$, origChallengeName, solution) {
|
||||
// htmls specific
|
||||
verb: randomVerb(),
|
||||
phrase: randomPhrase(),
|
||||
compliment: randomCompliment()
|
||||
compliment: randomCompliment(),
|
||||
|
||||
// Google Analytics
|
||||
gaName: challenge.title + '~' + challenge.checksum
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import path from 'path';
|
||||
import { Observable } from 'rx';
|
||||
import adler32 from 'adler32';
|
||||
|
||||
const basePath = process.cwd() + '/seed/challenges/';
|
||||
|
||||
@@ -21,6 +22,12 @@ export default function getFromDisk$(challenge) {
|
||||
return _challenge;
|
||||
})
|
||||
.map(challenge => {
|
||||
challenge.checksum = adler32.sum(
|
||||
Buffer(challenge.title +
|
||||
JSON.stringify(challenge.description) +
|
||||
JSON.stringify(challenge.challengeSeed) +
|
||||
JSON.stringify(challenge.tests)));
|
||||
|
||||
challenge.head = challenge.head || [];
|
||||
challenge.tail = challenge.tail || [];
|
||||
challenge.challengeType = '' + challenge.challengeType;
|
||||
|
@@ -93,6 +93,7 @@ block content
|
||||
common.challengeType = !{JSON.stringify(challengeType)};
|
||||
common.dashedName = !{JSON.stringify(dashedName)};
|
||||
common.isCompleted = !{JSON.stringify(isCompleted)};
|
||||
common.gaName = !{JSON.stringify(gaName)};
|
||||
|
||||
common.username = !{JSON.stringify(user && user.username || '')};
|
||||
|
||||
|
@@ -84,6 +84,7 @@ block content
|
||||
common.challengeType = !{JSON.stringify(challengeType)};
|
||||
common.dashedName = !{JSON.stringify(dashedName)};
|
||||
common.isCompleted = !{JSON.stringify(isCompleted)};
|
||||
common.gaName = !{JSON.stringify(gaName)};
|
||||
|
||||
common.username = !{JSON.stringify(user && user.username || '')};
|
||||
|
||||
|
@@ -88,6 +88,7 @@ block content
|
||||
common.challengeType = !{JSON.stringify(challengeType)};
|
||||
common.dashedName = !{JSON.stringify(dashedName)};
|
||||
common.isCompleted = !{JSON.stringify(isCompleted)};
|
||||
common.gaName = !{JSON.stringify(gaName)};
|
||||
|
||||
common.username = !{JSON.stringify(user && user.username || '')};
|
||||
|
||||
|
@@ -49,6 +49,7 @@ block content
|
||||
common.challengeName = !{JSON.stringify(name)};
|
||||
common.challengeType = !{JSON.stringify(challengeType)};
|
||||
common.dashedName = !{JSON.stringify(dashedName || '')};
|
||||
common.gaName = !{JSON.stringify(gaName)};
|
||||
common.isHonest = !{JSON.stringify(isHonest || false)};
|
||||
common.isFrontEndCert = !{JSON.stringify(isFrontEndCert || false)};
|
||||
common.isFullStackCert = !{JSON.stringify(isFullStackCert || false)};
|
||||
|
@@ -56,6 +56,7 @@ block content
|
||||
common.challengeName = !{JSON.stringify(name)};
|
||||
common.challengeType = !{JSON.stringify(challengeType)};
|
||||
common.dashedName = !{JSON.stringify(dashedName)};
|
||||
common.gaName = !{JSON.stringify(gaName)};
|
||||
common.init.push(function($) {
|
||||
function controlEnterHandler(e) {
|
||||
if (
|
||||
|
@@ -68,6 +68,7 @@ block content
|
||||
common.challengeId = !{JSON.stringify(id)};
|
||||
common.challengeName = !{JSON.stringify(name)};
|
||||
common.dashedName = !{JSON.stringify(dashedName)};
|
||||
common.gaName = !{JSON.stringify(gaName)};
|
||||
common.challengeType = !{JSON.stringify(challengeType)};
|
||||
|
||||
common.controlEnterHandler = function (e) {
|
||||
|
Reference in New Issue
Block a user