Merge branch 'master' into nonprofit-show
Conflicts: controllers/challenges.js controllers/courseware.js
This commit is contained in:
75
controllers/challenges.js
Normal file
75
controllers/challenges.js
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
/**
|
||||||
|
* GET /
|
||||||
|
* Challenges.
|
||||||
|
*/
|
||||||
|
var _ = require('lodash'),
|
||||||
|
debug = require('debug')('freecc:cntr:challenges'),
|
||||||
|
Challenge = require('./../models/Challenge'),
|
||||||
|
resources = require('./resources');
|
||||||
|
|
||||||
|
var highestChallengeNumber = 53;
|
||||||
|
|
||||||
|
|
||||||
|
exports.returnNextChallenge = function(req, res) {
|
||||||
|
if (req.user) {
|
||||||
|
ch = req.user.challengesHash;
|
||||||
|
if (req.user.challengesHash[0] > 0) {
|
||||||
|
var max = Object.keys(ch).reduce(function(max, key) {
|
||||||
|
return (max === undefined || ch[key] > ch[max]) ? +key : max;
|
||||||
|
});
|
||||||
|
nextChallenge = max + 1;
|
||||||
|
res.redirect('challenges/' + nextChallenge);
|
||||||
|
} else {
|
||||||
|
res.redirect('challenges/0');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return res.redirect('../challenges/0');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.returnChallenge = function(req, res) {
|
||||||
|
var challengeNumber = parseInt(req.params.challengeNumber) || 0;
|
||||||
|
if (challengeNumber === 2) {
|
||||||
|
req.user.challengesHash[challengeNumber] = Math.round(+new Date() / 1000);
|
||||||
|
var timestamp = req.user.challengesHash;
|
||||||
|
var points = 0;
|
||||||
|
for (var key in timestamp) {
|
||||||
|
if (timestamp[key] > 0 && req.body.challengeNumber < 54) {
|
||||||
|
points += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
req.user.points = points;
|
||||||
|
req.user.save(function(err) {
|
||||||
|
if (err) { return done(err); }
|
||||||
|
});
|
||||||
|
|
||||||
|
return res.redirect('../challenges/3');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (challengeNumber > highestChallengeNumber) {
|
||||||
|
req.flash('errors', {
|
||||||
|
msg: "It looks like you've either completed all the challenges we have available or requested a challenge we don't have."
|
||||||
|
});
|
||||||
|
return res.redirect('../challenges/0');
|
||||||
|
}
|
||||||
|
Challenge.find({}, null, { sort: { challengeNumber: 1 } }, function(err, c) {
|
||||||
|
if (err) {
|
||||||
|
debug('Challenge err: ', err);
|
||||||
|
next(err);
|
||||||
|
}
|
||||||
|
res.render('challenges/show', {
|
||||||
|
title: 'Challenge: ' + c[challengeNumber].name,
|
||||||
|
name: c[challengeNumber].name,
|
||||||
|
video: c[challengeNumber].video,
|
||||||
|
time: c[challengeNumber].time,
|
||||||
|
steps: c[challengeNumber].steps,
|
||||||
|
number: challengeNumber,
|
||||||
|
cc: req.user ? req.user.challengesHash : undefined,
|
||||||
|
points: req.user ? req.user.points : undefined,
|
||||||
|
verb: resources.randomVerb(),
|
||||||
|
phrase: resources.randomPhrase(),
|
||||||
|
compliment: resources.randomCompliment(),
|
||||||
|
challenges: c
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
@ -280,10 +280,6 @@ var userSchema = new mongoose.Schema({
|
|||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
coderbyteProfile: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
codepenProfile: {
|
codepenProfile: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
|
@ -13,10 +13,12 @@ var links =
|
|||||||
"Global Object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
|
"Global Object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
|
||||||
"Global String Object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
|
"Global String Object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
|
||||||
"Boolean Objects" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
|
"Boolean Objects" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
|
||||||
|
"RegExp" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
|
||||||
|
"Arguments object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments",
|
||||||
|
|
||||||
// ========= PROPERTIES/MISC
|
// ========= PROPERTIES/MISC
|
||||||
"String.length" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length",
|
"String.length" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length",
|
||||||
"Arguments object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments",
|
|
||||||
|
|
||||||
// ========== OBJECT METHODS
|
// ========== OBJECT METHODS
|
||||||
"Object.getOwnPropertyNames()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames",
|
"Object.getOwnPropertyNames()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames",
|
||||||
@ -29,6 +31,7 @@ var links =
|
|||||||
"String.charCodeAt()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt",
|
"String.charCodeAt()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt",
|
||||||
"String.concat()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat",
|
"String.concat()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat",
|
||||||
"String.indexOf()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf",
|
"String.indexOf()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf",
|
||||||
|
"String.fromCharCode()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode",
|
||||||
"String.lastIndexOf()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf",
|
"String.lastIndexOf()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf",
|
||||||
"String.match()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match",
|
"String.match()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match",
|
||||||
"String.replace()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace",
|
"String.replace()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace",
|
||||||
@ -45,6 +48,7 @@ var links =
|
|||||||
"Array.filter()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter",
|
"Array.filter()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter",
|
||||||
"Array.forEach()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach",
|
"Array.forEach()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach",
|
||||||
"Array.indexOf()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf",
|
"Array.indexOf()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf",
|
||||||
|
"Array.isArray()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray",
|
||||||
"Array.join()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join",
|
"Array.join()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join",
|
||||||
"Array.lastIndexOf()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf",
|
"Array.lastIndexOf()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf",
|
||||||
"Array.map()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map",
|
"Array.map()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map",
|
||||||
@ -52,15 +56,24 @@ var links =
|
|||||||
"Array.push()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push",
|
"Array.push()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push",
|
||||||
"Array.reduce()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce",
|
"Array.reduce()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce",
|
||||||
"Array.reverse()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse",
|
"Array.reverse()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse",
|
||||||
|
"Array.shift()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift",
|
||||||
"Array.slice()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice",
|
"Array.slice()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice",
|
||||||
"Array.some()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some",
|
"Array.some()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some",
|
||||||
"Array.sort()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort",
|
"Array.sort()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort",
|
||||||
"Array.splice()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice",
|
"Array.splice()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice",
|
||||||
"Array.toString()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString",
|
"Array.toString()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString",
|
||||||
|
|
||||||
|
// ======== MATH METHODS
|
||||||
|
"Math.max()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max",
|
||||||
|
"Math.min()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min",
|
||||||
|
"Math.pow()" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow",
|
||||||
|
"Remainder" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Remainder_(.25)",
|
||||||
|
|
||||||
// ======== GENERAL JAVASCRIPT REFERENCES
|
// ======== GENERAL JAVASCRIPT REFERENCES
|
||||||
"Arithmetic Operators" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators",
|
"Arithmetic Operators" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators",
|
||||||
"Comparison Operators" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators"
|
"Comparison Operators" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators",
|
||||||
|
"Details of the Object Model" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model",
|
||||||
|
"Closures" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures"
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = links;
|
module.exports = links;
|
||||||
|
@ -297,7 +297,8 @@
|
|||||||
"expect(sumAll([4, 1])).to.equal(10);",
|
"expect(sumAll([4, 1])).to.equal(10);",
|
||||||
"expect(sumAll([5, 10])).to.equal(45);",
|
"expect(sumAll([5, 10])).to.equal(45);",
|
||||||
"expect(sumAll([10, 5])).to.equal(45);"
|
"expect(sumAll([10, 5])).to.equal(45);"
|
||||||
]
|
],
|
||||||
|
"MDNlinks" : ["Math.max()", "Math.min()", "Array.reduce()"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "a5de63ebea8dbee56860f4f2",
|
"_id": "a5de63ebea8dbee56860f4f2",
|
||||||
@ -331,7 +332,8 @@
|
|||||||
"expect(fearNotLetter('bcd')).to.be.undefined;",
|
"expect(fearNotLetter('bcd')).to.be.undefined;",
|
||||||
"expect(fearNotLetter('abcdefghjklmno')).to.equal('i');",
|
"expect(fearNotLetter('abcdefghjklmno')).to.equal('i');",
|
||||||
"expect(fearNotLetter('yz')).to.be.undefined;"
|
"expect(fearNotLetter('yz')).to.be.undefined;"
|
||||||
]
|
],
|
||||||
|
"MDNlinks" : ["String.charCodeAt()"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "a77dbc43c33f39daa4429b4f",
|
"_id": "a77dbc43c33f39daa4429b4f",
|
||||||
@ -351,7 +353,8 @@
|
|||||||
"assert.strictEqual(boo(1), false);",
|
"assert.strictEqual(boo(1), false);",
|
||||||
"assert.strictEqual(boo(NaN), false);",
|
"assert.strictEqual(boo(NaN), false);",
|
||||||
"assert.strictEqual(boo('a'), false);"
|
"assert.strictEqual(boo('a'), false);"
|
||||||
]
|
],
|
||||||
|
"MDNlinks" : ["Boolean Objects"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "a105e963526e7de52b219be9",
|
"_id": "a105e963526e7de52b219be9",
|
||||||
@ -380,7 +383,8 @@
|
|||||||
"tests": [
|
"tests": [
|
||||||
"assert.strictEqual(convert('Dolce & Gabbana'), 'Dolce & Gabbana', 'should escape characters');",
|
"assert.strictEqual(convert('Dolce & Gabbana'), 'Dolce & Gabbana', 'should escape characters');",
|
||||||
"assert.strictEqual(convert('abc'), 'abc', 'should handle strings with nothing to escape');"
|
"assert.strictEqual(convert('abc'), 'abc', 'should handle strings with nothing to escape');"
|
||||||
]
|
],
|
||||||
|
"MDNlinks" : ["RegExp"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "a103376db3ba46b2d50db289",
|
"_id": "a103376db3ba46b2d50db289",
|
||||||
@ -395,7 +399,8 @@
|
|||||||
"assert.strictEqual(spinalCase('thisIsSpinalTap'), 'this-is-spinal-tap', 'should return spinal case from string with camel case');",
|
"assert.strictEqual(spinalCase('thisIsSpinalTap'), 'this-is-spinal-tap', 'should return spinal case from string with camel case');",
|
||||||
"assert.strictEqual(spinalCase('The_Andy_Griffith_Show'), 'the-andy-griffith-show', 'should return spinal case from string with snake case');",
|
"assert.strictEqual(spinalCase('The_Andy_Griffith_Show'), 'the-andy-griffith-show', 'should return spinal case from string with snake case');",
|
||||||
"assert.strictEqual(spinalCase('Teletubbies say Eh-oh'), 'teletubbies-say-eh-oh', 'should return spinal case from string with spaces and hyphens');"
|
"assert.strictEqual(spinalCase('Teletubbies say Eh-oh'), 'teletubbies-say-eh-oh', 'should return spinal case from string with spaces and hyphens');"
|
||||||
]
|
],
|
||||||
|
"MDNlinks" : ["RegExp", "String.replace()"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "a5229172f011153519423690",
|
"_id": "a5229172f011153519423690",
|
||||||
@ -414,7 +419,8 @@
|
|||||||
"expect(sumFibs(4)).to.equal(5);",
|
"expect(sumFibs(4)).to.equal(5);",
|
||||||
"expect(sumFibs(75024)).to.equal(60696);",
|
"expect(sumFibs(75024)).to.equal(60696);",
|
||||||
"expect(sumFibs(75025)).to.equal(135721);"
|
"expect(sumFibs(75025)).to.equal(135721);"
|
||||||
]
|
],
|
||||||
|
"MDNlinks" : ["Remainder"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "a3bfc1673c0526e06d3ac698",
|
"_id": "a3bfc1673c0526e06d3ac698",
|
||||||
@ -459,7 +465,8 @@
|
|||||||
"tests": [
|
"tests": [
|
||||||
"assert.strictEqual(find([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }), 8, 'should return first found value');",
|
"assert.strictEqual(find([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }), 8, 'should return first found value');",
|
||||||
"assert.strictEqual(find([1, 3, 5, 9], function(num) { return num % 2 === 0; }), undefined, 'should return undefined if not found');"
|
"assert.strictEqual(find([1, 3, 5, 9], function(num) { return num % 2 === 0; }), undefined, 'should return undefined if not found');"
|
||||||
]
|
],
|
||||||
|
"MDNlinks" : ["Array.some()"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "a5deed1811a43193f9f1c841",
|
"_id": "a5deed1811a43193f9f1c841",
|
||||||
@ -473,7 +480,8 @@
|
|||||||
"expect(drop([1, 2, 3, 4], function(n) {return n >= 3; })).to.eqls([3, 4]);",
|
"expect(drop([1, 2, 3, 4], function(n) {return n >= 3; })).to.eqls([3, 4]);",
|
||||||
"expect(drop([1, 2, 3], function(n) {return n > 0; })).to.eqls([1, 2, 3]);",
|
"expect(drop([1, 2, 3], function(n) {return n > 0; })).to.eqls([1, 2, 3]);",
|
||||||
"expect(drop([1, 2, 3, 4], function(n) {return n > 5; })).to.eqls([]);"
|
"expect(drop([1, 2, 3, 4], function(n) {return n > 5; })).to.eqls([]);"
|
||||||
]
|
],
|
||||||
|
"MDNlinks" : ["Arguments object", "Array.shift()"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "ab306dbdcc907c7ddfc30830",
|
"_id": "ab306dbdcc907c7ddfc30830",
|
||||||
@ -487,7 +495,8 @@
|
|||||||
"assert.deepEqual(steamroller([[['a']], [['b']]]), ['a', 'b'], 'should flatten nested arrays');",
|
"assert.deepEqual(steamroller([[['a']], [['b']]]), ['a', 'b'], 'should flatten nested arrays');",
|
||||||
"assert.deepEqual(steamroller([1, [2], [3, [[4]]]]), [1, 2, 3, 4], 'should flatten nested arrays');",
|
"assert.deepEqual(steamroller([1, [2], [3, [[4]]]]), [1, 2, 3, 4], 'should flatten nested arrays');",
|
||||||
"assert.deepEqual(steamroller([1, [], [3, [[4]]]]), [1, 3, 4], 'should work with empty arrays');"
|
"assert.deepEqual(steamroller([1, [], [3, [[4]]]]), [1, 3, 4], 'should work with empty arrays');"
|
||||||
]
|
],
|
||||||
|
"MDNlinks" : ["Array.isArray()"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "a8d97bd4c764e91f9d2bda01",
|
"_id": "a8d97bd4c764e91f9d2bda01",
|
||||||
@ -501,7 +510,8 @@
|
|||||||
"tests": [
|
"tests": [
|
||||||
"expect(binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111')).to.equal(\"Aren't bonfires fun!?\");",
|
"expect(binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111')).to.equal(\"Aren't bonfires fun!?\");",
|
||||||
"expect(binaryAgent('01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001')).to.equal(\"I love FreeCodeCamp!\");"
|
"expect(binaryAgent('01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001')).to.equal(\"I love FreeCodeCamp!\");"
|
||||||
]
|
],
|
||||||
|
"MDNlinks" : ["String.charCodeAt()", "String.fromCharCode()"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id" : "a3f503de51cfab748ff001aa",
|
"_id" : "a3f503de51cfab748ff001aa",
|
||||||
@ -549,7 +559,8 @@
|
|||||||
"tests": [
|
"tests": [
|
||||||
"assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], 'sex'), true, 'should return true if predicate returns truthy for all elements in the collection');",
|
"assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], 'sex'), true, 'should return true if predicate returns truthy for all elements in the collection');",
|
||||||
"assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], {'sex': 'female'}), false, 'should return false if predicate returns falsey for any element in the collection');"
|
"assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], {'sex': 'female'}), false, 'should return false if predicate returns falsey for any element in the collection');"
|
||||||
]
|
],
|
||||||
|
"MDNlinks" : ["Object.hasOwnProperty()", "Object.getOwnPropertyNames()"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "a2f1d72d9b908d0bd72bb9f6",
|
"_id": "a2f1d72d9b908d0bd72bb9f6",
|
||||||
@ -576,7 +587,8 @@
|
|||||||
"bob.setFullName('George Carlin');",
|
"bob.setFullName('George Carlin');",
|
||||||
"expect(bob.getFullName()).to.eql('George Carlin');",
|
"expect(bob.getFullName()).to.eql('George Carlin');",
|
||||||
"bob.setFullName('Bob Ross');"
|
"bob.setFullName('Bob Ross');"
|
||||||
]
|
],
|
||||||
|
"MDNlinks" : ["Closures", "Details of the Object Model"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "af4afb223120f7348cdfc9fd",
|
"_id": "af4afb223120f7348cdfc9fd",
|
||||||
@ -593,7 +605,8 @@
|
|||||||
"tests": [
|
"tests": [
|
||||||
"expect(orbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}])).to.eqls([{name: \"sputkin\", orbitalPeriod: 86400}]);",
|
"expect(orbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}])).to.eqls([{name: \"sputkin\", orbitalPeriod: 86400}]);",
|
||||||
"expect(orbitalPeriod([{name: \"iss\", avgAlt: 413.6}, {name: \"hubble\", avgAlt: 556.7}, {name: \"moon\", avgAlt: 378632.553}])).to.eqls([{name : \"iss\", orbitalPeriod: 5557}, {name: \"hubble\", orbitalPeriod: 5734}, {name: \"moon\", orbitalPeriod: 2377399}]);"
|
"expect(orbitalPeriod([{name: \"iss\", avgAlt: 413.6}, {name: \"hubble\", avgAlt: 556.7}, {name: \"moon\", avgAlt: 378632.553}])).to.eqls([{name : \"iss\", orbitalPeriod: 5557}, {name: \"hubble\", orbitalPeriod: 5734}, {name: \"moon\", orbitalPeriod: 2377399}]);"
|
||||||
]
|
],
|
||||||
|
"MDNlinks" : ["Math.pow()"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "aff0395860f5d3034dc0bfc9",
|
"_id": "aff0395860f5d3034dc0bfc9",
|
||||||
|
@ -134,15 +134,6 @@ block content
|
|||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
| Please enter a valid URL format (http://www.example.com).
|
| Please enter a valid URL format (http://www.example.com).
|
||||||
|
|
||||||
.form-group
|
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') CoderByte
|
|
||||||
.col-sm-4
|
|
||||||
input.form-control(type='url', name='coderbyteProfile', id='coderbyteProfile', autocomplete="off", ng-model='user.profile.coderbyteProfile', placeholder='http://')
|
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.coderbyteProfile.$error.url && !profileForm.coderbyteProfile.$pristine")
|
|
||||||
alert(type='danger')
|
|
||||||
span.ion-close-circled
|
|
||||||
| Please enter a valid URL format (http://www.example.com).
|
|
||||||
|
|
||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') LinkedIn
|
label.col-sm-3.col-sm-offset-2.control-label(for='email') LinkedIn
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
|
Reference in New Issue
Block a user