From 5eb9c060e12fbbe9e6c7c72739a669116ae38cbe Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Thu, 6 Aug 2015 14:51:26 +0100 Subject: [PATCH 1/9] Fix https://github.com/FreeCodeCamp/freecodecamp/issues/1599 --- seed/challenges/basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index 7b74868388..3f92055c6e 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -1046,7 +1046,7 @@ "dashedName": "waypoint-invert-regular-expression-matches-with-javaScript", "difficulty":"9.987", "description":[ - "Use /\\S+/gi; to match everything that isn't a space in the string", + "Use /\\S/gi; to match everything that isn't a space in the string", "You can invert any match by using the uppercase version of the selector \\s versus \\S for example" ], "tests":[ From e68bc0272d4012b7b5f8bdc4b79d55cea0048c5b Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Thu, 6 Aug 2015 14:54:44 +0100 Subject: [PATCH 2/9] Fix https://github.com/FreeCodeCamp/freecodecamp/issues/1593 --- seed/challenges/basic-javascript.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index 3f92055c6e..4932ddd044 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -573,12 +573,12 @@ "difficulty": "9.9817", "description": [ "Another common way in which we can manipulate the data in an array is through .shift() ", - ".shift()is used to \"shift\" a value from the start of an array. We can retrieve this value by preforming the shift in a variable declaration.", + ".shift()is used to \"shift\" a value from the start of an array. We can retrieve this value by performing the shift in a variable declaration.", "Let's try .shift()now" ], "tests": [ "assert((function(d){if(d[0] == 23 && d[1][0] == 'dog' && d[1][1] == 3 && d[2] == undefined){return(true);}else{return(false);}})(myArray), 'myArray should only have the first two values left([\"John\", 23])');", - "assert((function(d){if(d === 'John' && typeof(removed) === 'function'){return(true);}else{return(false);}})(removed), 'Removed should contain \"John\"');" + "assert((function(d){if(d === 'John' && typeof(removed) === 'string'){return(true);}else{return(false);}})(removed), 'Removed should contain \"John\"');" ], "challengeSeed": [ "var myArray = ['John', 23, ['dog', 3]];", From 0993261ebcbef8eddd289a1f959385d5e74d05aa Mon Sep 17 00:00:00 2001 From: Dealga McArdle Date: Thu, 6 Aug 2015 16:02:20 +0200 Subject: [PATCH 3/9] sputkin -> sputnik --- seed/challenges/advanced-bonfires.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/challenges/advanced-bonfires.json b/seed/challenges/advanced-bonfires.json index 093580e24f..360d05a52b 100644 --- a/seed/challenges/advanced-bonfires.json +++ b/seed/challenges/advanced-bonfires.json @@ -74,10 +74,10 @@ " return arr;", "}", "", - "orbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}]);" + "orbitalPeriod([{name : \"sputnik\", avgAlt : 35873.5553}]);" ], "tests": [ - "expect(orbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}])).to.eqls([{name: \"sputkin\", orbitalPeriod: 86400}]);", + "expect(orbitalPeriod([{name : \"sputnik\", avgAlt : 35873.5553}])).to.eqls([{name: \"sputnik\", 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}]);" ], "MDNlinks": [ From 4349d06d1624320ee51b109533c3cf10c00e7bba Mon Sep 17 00:00:00 2001 From: Samuel Plumppu Date: Thu, 6 Aug 2015 20:45:59 +0200 Subject: [PATCH 4/9] fixed typos --- seed/challenges/basic-javascript.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index 4932ddd044..75b91415ac 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -834,8 +834,8 @@ "dashedName": "waypoint-generate-random-fractions-with-javascript", "difficulty":"9.9827", "description":[ - "Random numbers are a very useful for creating random behaviours and games", - "Javascript has a Math.random() method that can generate a random decimal number", + "Random numbers are very useful for creating random behaviours and games", + "JavaScript has a Math.random() method that can generate a random decimal number", "Let's have a go of Math.random() now be getting myFunction to return a random number" ], "tests":[ From cf9b981564f2522e151156b80165f9883104b4aa Mon Sep 17 00:00:00 2001 From: Samuel Plumppu Date: Thu, 6 Aug 2015 21:31:24 +0200 Subject: [PATCH 5/9] fixed typos --- seed/challenges/html5-and-css.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/challenges/html5-and-css.json b/seed/challenges/html5-and-css.json index 7cbb0d11c7..f4a11581d3 100644 --- a/seed/challenges/html5-and-css.json +++ b/seed/challenges/html5-and-css.json @@ -3348,11 +3348,11 @@ "dashedName": "waypoint-override-all-other-styles-by-using-important", "difficulty": 1.53, "description": [ - "Yay! we just proved that in-line styles will override all the CSS declarations in your style element.", + "Yay! We just proved that in-line styles will override all the CSS declarations in your style element.", "But wait. There's one last way to override CSS. This is the most powerful method of all. But before we do it, let's talk about why you would ever want to override CSS.", "In many situations, you will use CSS libraries. These may accidentally override your own CSS. So when you absolutely need to be sure that an element has specific CSS, you can use !important.", "Let's go all the way back to our \"pink-text\" class declaration. Remember that our \"pink-text\" class was overridden by subsequent class declarations, id declarations, and in-line styles.", - "Let's add the keyword !important to your body' element's color declaration to make 100% sure that your h1 element will be pink.", + "Let's add the keyword !important to your pink-text element's color declaration to make 100% sure that your h1 element will be pink.", "An example of how to do this is: color: red !important;" ], "tests": [ From 3b14872cbec5c4fe40686c1712e26e0dd4b10c21 Mon Sep 17 00:00:00 2001 From: Samuel Plumppu Date: Thu, 6 Aug 2015 22:30:46 +0200 Subject: [PATCH 6/9] updated instructions for waypoint: get set for ziplines to fit with new Codepen UI --- seed/challenges/basic-ziplines.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/challenges/basic-ziplines.json b/seed/challenges/basic-ziplines.json index cb4f9bd8a5..e3cdfb7300 100644 --- a/seed/challenges/basic-ziplines.json +++ b/seed/challenges/basic-ziplines.json @@ -17,9 +17,9 @@ "Go to http://codepen.io and create an account.", "Click your user image in the top right corner, then click the \"New pen\" button that drops down.", "Drag the windows around and press the buttons in the lower-right hand corner to change the orientation to suit your preference.", - "Click the gear next to CSS. Then in the \"External CSS File or Another Pen\" text field, type \"bootstrap\" and scroll down until you see the latest version of Bootstrap. Click it.", + "Click the gear next to CSS. Click the \"Quick-add...\" select box and choose Bootstrap.", "Verify that bootstrap is active by adding the following code to your HTML: <h1 class='text-primary'>Hello CodePen!</h1>. The text's color should be Bootstrap blue.", - "Click the gear next to JavaScript. Click the \"Latest version of...\" select box and choose jQuery.", + "Click the gear next to JavaScript. Click the \"Quick-add...\" select box and choose jQuery.", "Now add the following code to your JavaScript: $(document).ready(function() { $('.text-primary').text('Hi CodePen!') });. Click the \"Save\" button at the top. Your \"Hello CodePen!\" should change to \"Hi CodePen!\". This means that jQuery is working.", "You can use this CodePen that you've just created as a starting point for your Ziplines. Just click the \"fork\" button at the top of your CodePen and it will create a duplicate CodePen.", "Now you're ready for your first Zipline. Click the \"I've completed this challenge\" button." From 783d7cf1ec123144fdd26130cdfa846ef485d9a9 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Thu, 6 Aug 2015 15:37:07 -0700 Subject: [PATCH 7/9] fix string non-alphanumeric non-whitespace chars before regex --- server/utils/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/utils/index.js b/server/utils/index.js index 72d515dd5f..784aa71366 100644 --- a/server/utils/index.js +++ b/server/utils/index.js @@ -62,7 +62,12 @@ module.exports = { }, unDasherize: function unDasherize(name) { - return ('' + name).replace(/\-/g, ' ').trim(); + return ('' + name) + // replace dash with space + .replace(/\-/g, ' ') + // strip nonalphanumarics chars except whitespace + .replace(/[^a-zA-Z\d\s]/g, '') + .trim(); }, getChallengeMapForDisplay: function() { From 8d293c9fc6c01b4c930cbb76babd4e67f00eb51c Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Thu, 6 Aug 2015 15:51:36 -0700 Subject: [PATCH 8/9] fix order of user/pairedWith in withLatestFrom operator in challenges --- server/boot/challenge.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/boot/challenge.js b/server/boot/challenge.js index 4228a3ff15..4eb361b9b2 100644 --- a/server/boot/challenge.js +++ b/server/boot/challenge.js @@ -385,7 +385,7 @@ module.exports = function(app) { ); } }) - .withLatestFrom(Rx.Observable.just(req.user), function(user, pairedWith) { + .withLatestFrom(Rx.Observable.just(req.user), function(pairedWith, user) { return { user: user, pairedWith: pairedWith From 344b729bce31528ac6a0ff00f29e3c4e501df91a Mon Sep 17 00:00:00 2001 From: Samuel Plumppu Date: Fri, 7 Aug 2015 02:13:11 +0200 Subject: [PATCH 9/9] fixed tests to check for lowercase hexadecimal colors --- seed/challenges/html5-and-css.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/html5-and-css.json b/seed/challenges/html5-and-css.json index f4a11581d3..3896334683 100644 --- a/seed/challenges/html5-and-css.json +++ b/seed/challenges/html5-and-css.json @@ -3516,7 +3516,7 @@ ], "tests": [ "assert($('body').css('background-color') === 'rgb(0, 255, 0)', 'Give your body element the background-color of green.')", - "assert(editor.match(/#00FF00/g) && editor.match(/#00FF00/g).length > 0, 'Use hex code the color green instead of the word \"green\". For example body: { color: #00FF00; }.')" + "assert(editor.match(/#00[Ff]{2}00/g) && editor.match(/#00[Ff]{2}00/g).length > 0, 'Use hex code the color green instead of the word \"green\". For example body: { color: #00FF00; }.')" ], "challengeSeed": [ "