From 3842c0b9c868ec206d257d0249ef111a778abe56 Mon Sep 17 00:00:00 2001 From: Stephen Wanhella Date: Sat, 4 Jul 2015 16:04:12 -0700 Subject: [PATCH 01/16] Fixed typos in Bonfire: Friendly Date Ranges #1156 --- seed/challenges/advanced-bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/advanced-bonfires.json b/seed/challenges/advanced-bonfires.json index f729bde4e2..3816d28ded 100644 --- a/seed/challenges/advanced-bonfires.json +++ b/seed/challenges/advanced-bonfires.json @@ -277,7 +277,7 @@ ], "tests": [ "assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'ending month should be omitted since it is already mentioned');", - "assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'one month apart can be inferred it is the next year');", + "assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'two months apart can be inferred if it is the next year');", "assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017']);", "assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th, 2016']);", "assert.deepEqual(friendly(['2017-01-01', '2017-01-01']), ['January 1st, 2017'], 'since we do not duplicate only return once');", From d6b9093be9cf207d6d325661143115454262ed0c Mon Sep 17 00:00:00 2001 From: LumenTeun Date: Wed, 8 Jul 2015 21:19:34 +0200 Subject: [PATCH 02/16] Improved consitency in 'Friendly Date Ranges' test cases. #410 --- seed/challenges/advanced-bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/advanced-bonfires.json b/seed/challenges/advanced-bonfires.json index f729bde4e2..8d13526b7f 100644 --- a/seed/challenges/advanced-bonfires.json +++ b/seed/challenges/advanced-bonfires.json @@ -279,7 +279,7 @@ "assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'ending month should be omitted since it is already mentioned');", "assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'one month apart can be inferred it is the next year');", "assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017']);", - "assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th, 2016']);", + "assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th'], 'one month apart can be inferred it is the same year');", "assert.deepEqual(friendly(['2017-01-01', '2017-01-01']), ['January 1st, 2017'], 'since we do not duplicate only return once');", "assert.deepEqual(friendly(['2022-09-05', '2023-09-04']), ['September 5th, 2022','September 4th, 2023']);" ], From 1654d535ac0d2550e713dfbc9f09ebd74903ea01 Mon Sep 17 00:00:00 2001 From: cahlan Date: Mon, 3 Aug 2015 05:32:27 +0000 Subject: [PATCH 03/16] adding new location --- public/json/bootcamps.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/json/bootcamps.json b/public/json/bootcamps.json index 18f2a5f046..41b906c20b 100644 --- a/public/json/bootcamps.json +++ b/public/json/bootcamps.json @@ -104,7 +104,8 @@ "weeks": "12", "cities": [ "provo", - "salt-lake-city" + "salt-lake-city", + "dallas" ] }, { "name": "Epicodus", From c5af46b33f4dca67f880c653773c604e9089eda0 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Mon, 3 Aug 2015 08:30:16 -0700 Subject: [PATCH 04/16] remove beta flash --- server/server.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/server/server.js b/server/server.js index c8967df128..fe0e924a55 100755 --- a/server/server.js +++ b/server/server.js @@ -186,11 +186,6 @@ passportConfigurator.init(); app.use(rxMiddleware()); app.use(function(req, res, next) { - // add beta warning - req.flash('info', { - msg: `warning: you are on experimental branch of Free Code Camp: - Your progress here may or may not be saved to the main site` - }); // Make user object available in templates. res.locals.user = req.user; From 43bba0744a37615dc6e6d85b1be1298637cc5a77 Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Mon, 3 Aug 2015 16:42:26 +0100 Subject: [PATCH 05/16] Fixed route on waypoint-label-bootstrap-wells and the tests. Fixed the test messages on waypoint-give-each-element-a-unique-id --- seed/challenges/bootstrap.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/seed/challenges/bootstrap.json b/seed/challenges/bootstrap.json index ea01b15573..bb4d81430e 100644 --- a/seed/challenges/bootstrap.json +++ b/seed/challenges/bootstrap.json @@ -1874,7 +1874,7 @@ }, { "id": "bad87fee1348bd9aec908854", - "name": "Waypoint: Label Boostrap Wells", + "name": "Waypoint: Label Bootstrap Wells", "dashedName": "waypoint-label-bootstrap-wells", "difficulty": 2.26, "description": [ @@ -1883,9 +1883,9 @@ "Above your right-well, inside its \"col-xs-6\" div element, add a h4 element with the text \"#right-well\"." ], "tests": [ - "assert($('.col-xs-12').children('h4') && $('.col-xs-12').children('h4').length > 1, 'Add an h4 element to each of your <div class='col-xs-6'> elements.')", - "assert(new RegExp('#left-well','gi').test($('h4').text()), 'One h4 element should have the text \"#left-well\".')", - "assert(new RegExp('#right-well','gi').test($('h4').text()), 'One h4 element should have the text \"#right-well\".')" + "assert($('.col-xs-12').children('h4') && $('.col-xs-12').children('h4').length > 1, 'Add an h4 element to each of your <div class=\\'col-xs-6\\'> elements.');", + "assert(new RegExp('#left-well','gi').test($('h4').text()), 'One h4 element should have the text \"#left-well\".');", + "assert(new RegExp('#right-well','gi').test($('h4').text()), 'One h4 element should have the text \"#right-well\".');" ], "challengeSeed": [ "
", @@ -1930,12 +1930,12 @@ "Give each of your buttons a unique id like, starting with \"target1\" and ending with \"target6\"." ], "tests": [ - "assert($('#target1') && $('#target1').length > 0, 'One button element should have the id \"#target1\".')", - "assert($('#target2') && $('#target2').length > 0, 'One button element should have the id \"#target2\".')", - "assert($('#target3') && $('#target3').length > 0, 'One button element should have the id \"#target3\".')", - "assert($('#target4') && $('#target4').length > 0, 'One button element should have the id \"#target4\".')", - "assert($('#target5') && $('#target5').length > 0, 'One button element should have the id \"#target5\".')", - "assert($('#target6') && $('#target6').length > 0, 'One button element should have the id \"#target6\".')" + "assert($('#target1') && $('#target1').length > 0, 'One button element should have the id \"target1\".')", + "assert($('#target2') && $('#target2').length > 0, 'One button element should have the id \"target2\".')", + "assert($('#target3') && $('#target3').length > 0, 'One button element should have the id \"target3\".')", + "assert($('#target4') && $('#target4').length > 0, 'One button element should have the id \"target4\".')", + "assert($('#target5') && $('#target5').length > 0, 'One button element should have the id \"target5\".')", + "assert($('#target6') && $('#target6').length > 0, 'One button element should have the id \"target6\".')" ], "challengeSeed": [ "
", From c9c2a744614501e1f5c1220969cdba77a1c2a38e Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Mon, 3 Aug 2015 17:01:27 +0100 Subject: [PATCH 06/16] Hardened The check-the-length-property-of-a-string-variable challenge to make it hard to get no tests run --- seed/challenges/basic-javascript.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index 2e9e21ffe2..d444d15902 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -121,23 +121,26 @@ "For example, if we created a variable var firstName = \"Julie\", we could find out how long the string \"Julie\" is by using the firstName.length property." ], "tests": [ - "assert((function(){if(typeof(lastNameLength) != 'undefined' && typeof(lastNameLength) == 'number' && lastNameLength == 4){return(true);}else{return(false);}})(), 'lastNameLength should be equal to four')" + "assert((function(){if(typeof(lastNameLength) != 'undefined' && typeof(lastNameLength) == 'number' && lastNameLength == 4){return(true);}else{return(false);}})(), 'lastNameLength should be equal to four')", + "assert((function(){if(editor.getValue().match(/\\.length/gi).length >= 2 && editor.getValue().match(/var lastNameLength \\= 0;/gi).length >= 1){return(true);}else{return(false);}})(), 'You should be getting the length of lastName by using .length like this lastName.length');" ], "challengeSeed": [ + "var firstNameLength = 0;", + "var lastNameLength = 0;", "var firstName = \"Madeline\";", "", - "var firstNameLength = firstName.length;", + "firstNameLength = firstName.length;", "", "var lastName = \"Chen\";", "", - "var lastNameLength = lastName;", + "lastNameLength = lastName;", "", "", "", "// You can ignore this.", "// We use this to show you the value of your variable in your output box.", "// We'll learn about functions soon.", - "if(typeof(lastNameLength) != 'undefined')(function(v){return(v);})(lastNameLength);}" + "if(typeof(lastNameLength) != 'undefined'){(function(v){return(v);})(lastNameLength);}" ], "challengeType": 1 }, From 2f5b7a7db20fb2a7db1086c9fb68d65f1e2b934c Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Mon, 3 Aug 2015 17:12:48 +0100 Subject: [PATCH 07/16] Fix https://github.com/FreeCodeCamp/freecodecamp/issues/1433 blocked tests passing when exploit used --- .../lib/coursewares/coursewaresJSFramework_0.0.6.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js b/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js index f88bca61aa..0710e4ee6e 100644 --- a/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js +++ b/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js @@ -210,7 +210,16 @@ var runTests = function(err, data) { err: "No user tests were run." }]; createTestDisplay(); - } else if (userTests) { + } + else if(editorValue.match(/if\s\(null\)\sconsole\.log\(1\);/gi)){ + allTestsPassed = false; + userTests = [{ + text: "Program Execution Failure", + err: "Invalid if (null) console.log(1); detected" + }]; + createTestDisplay(); + } + else if (userTests) { userTests.push(false); pushed = true; userTests.forEach(function(chaiTestFromJSON, indexOfTestArray, From 4be714aa97086628707614e02d26123f65292755 Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Mon, 3 Aug 2015 18:02:26 +0100 Subject: [PATCH 08/16] Generalised RegEx for waypoint-make-it-functional fix https://github.com/FreeCodeCamp/freecodecamp/issues/1476 added comment to show where to block exploits in jsframework --- public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js | 1 + seed/challenges/basic-javascript.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js b/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js index 0710e4ee6e..564b9decae 100644 --- a/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js +++ b/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js @@ -211,6 +211,7 @@ var runTests = function(err, data) { }]; createTestDisplay(); } + //Add blocks to test exploits here! else if(editorValue.match(/if\s\(null\)\sconsole\.log\(1\);/gi)){ allTestsPassed = false; userTests = [{ diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index d444d15902..92cb7d80e1 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -647,7 +647,7 @@ "Let's try creating and calling a function now called myFunction" ], "tests":[ - "assert((function(){if(typeof(f) !== 'undefined' && typeof(f) === 'number' && f === a + b && editor.getValue().match(RegExp('return\\\\(a\\\\+b\\\\)', 'g')).length >= 1){return(true);}else{return(false);}})(), 'Your function should return the value of a + b');" + "assert((function(){if(typeof(f) !== 'undefined' && typeof(f) === 'number' && f === a + b && editor.getValue().match(/return/gi).length >= 1 && editor.getValue().match(/a/gi).length >= 1 && editor.getValue().match(/b/gi).length >= 1 && editor.getValue().match(/\\+/gi).length >= 1){return(true);}else{return(false);}})(), 'Your function should return the value of a + b');" ], "challengeSeed":[ "var a = 4;", From bf1c2ace007943b4c92d2dcfbba6499e60919c20 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Mon, 3 Aug 2015 12:38:20 -0700 Subject: [PATCH 09/16] disable facebook/google/linked auth for testing --- server/views/account/signin.jade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/views/account/signin.jade b/server/views/account/signin.jade index 878b278ba4..0e2e22a9ab 100644 --- a/server/views/account/signin.jade +++ b/server/views/account/signin.jade @@ -8,13 +8,13 @@ block content a.btn.btn-lg.btn-block.btn-twitter.btn-social(href='/auth/twitter') i.fa.fa-twitter | Sign in with Twitter - a.btn.btn-lg.btn-block.btn-facebook.btn-social(href='/auth/facebook') + a.btn.btn-lg.btn-block.btn-facebook.btn-social.disabled(href='#') i.fa.fa-facebook | Sign in with Facebook - a.btn.btn-lg.btn-block.btn-google-plus.btn-social(href='/auth/google') + a.btn.btn-lg.btn-block.btn-google-plus.btn-social.disabled(href='#') i.fa.fa-google-plus | Sign in with Google - a.btn.btn-lg.btn-block.btn-linkedin.btn-social(href='/auth/linkedin') + a.btn.btn-lg.btn-block.btn-linkedin.btn-social.disabled(href='#') i.fa.fa-linkedin | Sign in with LinkedIn br From 6c0049803d9972b1d85acce57303da4c0c652182 Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Mon, 3 Aug 2015 20:43:23 +0100 Subject: [PATCH 10/16] Fixed two typos and fixed a no tests tun error --- seed/challenges/basic-javascript.json | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index 92cb7d80e1..319ae35809 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -157,16 +157,19 @@ "Try looking at the firstLetterOfFirstName variable declaration if you get stuck." ], "tests": [ - "assert((function(){if(typeof(firstLetterOfLastName) != 'undefined' && typeof(firstLetterOfLastName) == 'string' && firstLetterOfLastName == 'C'){return(true);}else{return(false);}})(), 'The first letter of firstLetterOfLastName should be a C');" + "assert((function(){if(typeof(firstLetterOfLastName) != 'undefined' && editor.getValue().match(/\\[0\\]/gi) && typeof(firstLetterOfLastName) == 'string' && firstLetterOfLastName == 'C'){return(true);}else{return(false);}})(), 'The first letter of firstLetterOfLastName should be a C');" ], "challengeSeed": [ + "var firstLetterOfLastName = \"\"", + "var firstLetterOfLastName = \"\"", + "", "var firstName = \"Madeline\";", "", - "var firstLetterOfFirstName = firstName[0];", + "firstLetterOfFirstName = firstName[0];", "", "var lastName = \"Chen\";", "", - "var firstLetterOfLastName = lastName;", + "firstLetterOfLastName = lastName;", "", "", "// You can ignore this.", @@ -565,7 +568,7 @@ "difficulty": "9.9818", "description": [ "", - "Now that we've learn how to pop things from the end of the array, we need to learn how to push stuff back to the end", + "Now that we've learned how to pop things from the end of the array, we need to learn how to push stuff back to the end", "Let's take the code we had last time and push this value to the end: ['dog', 3] " ], "tests": [ @@ -797,7 +800,7 @@ "description":[ "", "Loops are a critical part of any program! The next few challenges", - "first we will be taking a look at the for loop", + "first we will be taking a look at the while loop", "", "var ourArray = [];", "var i = 0;", From 7ca1d7cfde6d5699eda1c53a4be642f215f965de Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Mon, 3 Aug 2015 12:52:57 -0700 Subject: [PATCH 11/16] remove facebook/google/linkedin auth from linking --- server/views/account/account.jade | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/server/views/account/account.jade b/server/views/account/account.jade index dd9d3d9c47..0dc4e5cb2c 100644 --- a/server/views/account/account.jade +++ b/server/views/account/account.jade @@ -261,31 +261,31 @@ block content .panel-heading.text-center Manage your account here: .panel-body if (!user.google || !user.facebook || !user.linkedin || !user.twitter) - if (!user.google) + if (!user.github) .col-xs-12 - a.btn.btn-lg.btn-block.btn-google-plus.btn-link-social(href='/auth/google') - i.fa.fa-google-plus - | Link Google with my account - if (!user.facebook) - .col-xs-12 - a.btn.btn-lg.btn-block.btn-facebook.btn-link-social(href='/auth/facebook') - i.fa.fa-facebook - | Link Facebook with my account - //if (!user.github) - // .col-xs-12 - // a.btn.btn-lg.btn-block.btn-github.btn-link-social(href='/auth/github') - // i.fa.fa-github - // | Link GitHub with my account - if (!user.linkedin) - .col-xs-12 - a.btn.btn-lg.btn-block.btn-linkedin.btn-link-social(href='/auth/linkedin') - i.fa.fa-linkedin - | Link LinkedIn with my account + a.btn.btn-lg.btn-block.btn-github.btn-link-social(href='/auth/github') + i.fa.fa-github + | Link GitHub with my account if (!user.twitter) .col-xs-12 a.btn.btn-lg.btn-block.btn-twitter.btn-link-social(href='/auth/twitter') i.fa.fa-twitter | Link Twitter with my account + if (!user.google) + .col-xs-12 + a.btn.btn-lg.btn-block.btn-google-plus.btn-link-social.disabled(href='#') + i.fa.fa-google-plus + | Link Google with my account + if (!user.facebook) + .col-xs-12 + a.btn.btn-lg.btn-block.btn-facebook.btn-link-social.disabled(href='#') + i.fa.fa-facebook + | Link Facebook with my account + if (!user.linkedin) + .col-xs-12 + a.btn.btn-lg.btn-block.btn-linkedin.btn-link-social.disabled(href='#') + i.fa.fa-linkedin + | Link LinkedIn with my account .col-xs-12 a.btn.btn-lg.btn-block.btn-warning.btn-link-social(href='/logout') span.ion-android-exit From 041779de7609c92c97f13b2cfe40429953c07226 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Mon, 3 Aug 2015 13:47:07 -0700 Subject: [PATCH 12/16] Update README.md --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 692946ee8b..ab883ae64b 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,6 @@ Welcome to Free Code Camp's open source codebase! ======================= -#Note -We're currently very close to moving from Express to Loopback. As such, please keep in mind that the instructions here for setting up and running the project do not directly translate to the staging branch. Additionally, the file structure is quite a bit different. As always, the staging branch is the appropriate place to branch off of to fix/add something! - Free Code Camp is an open-source community of busy people who learn to code, then build projects for nonprofits. Our campers (students) start by working through our free, self-paced, browser-based curriculum. Next, they build several practice projects. Finally, we pair two campers together with a stakeholder from a nonprofit organization, and help them build the solution the nonprofit has requested. @@ -20,7 +17,14 @@ Our campers (students) start by working through our free, self-paced, browser-ba This code is running live at [FreeCodeCamp.com](http://www.FreeCodeCamp.com). We also have [Gitter](https://gitter.im/FreeCodeCamp/FreeCodeCamp), a [blog](http://blog.freecodecamp.com), and even a [Twitch.tv channel](http://twitch.tv/freecodecamp). -[Join our community](http://www.freecodecamp.com/signin)! +[Join our community here](http://www.freecodecamp.com/signin). + +*Note: We're currently very close to moving from Express to Loopback. As such, please keep in mind that the instructions here for setting up and running the project do not directly translate to the staging branch. Additionally, the file structure is quite a bit different. As always, the staging branch is the appropriate place to branch off of to fix/add something.* + +Wiki +------------ + +We would love your help expanding our [wiki](https://gitter.im/freecodecamp/freecodecamp/wiki) with more information about learning to code and getting a coding job. Contributing ------------ From 44f52b5f066fa467df65c446c1e52708adc0596c Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Mon, 3 Aug 2015 13:49:16 -0700 Subject: [PATCH 13/16] Update and add wiki link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab883ae64b..8765f0044e 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ This code is running live at [FreeCodeCamp.com](http://www.FreeCodeCamp.com). We Wiki ------------ -We would love your help expanding our [wiki](https://gitter.im/freecodecamp/freecodecamp/wiki) with more information about learning to code and getting a coding job. +We would love your help expanding our [wiki](https://github.com/freecodecamp/freecodecamp/wiki) with more information about learning to code and getting a coding job. Contributing ------------ From c9db4191c29bd12ddc59188cf0f46345beb48aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Djordje=20Lacmanovi=C4=87?= Date: Tue, 4 Aug 2015 00:39:11 +0200 Subject: [PATCH 14/16] fixed a typo as per issue 1473 --- seed/challenges/bootstrap.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/challenges/bootstrap.json b/seed/challenges/bootstrap.json index bb4d81430e..c0b4014f93 100644 --- a/seed/challenges/bootstrap.json +++ b/seed/challenges/bootstrap.json @@ -797,8 +797,8 @@ "Delete the \".red-text\", \"p\", and \".smaller-image\" CSS declarations from your style element so that the only declarations left in your style element are \"h2\" and \"thick-green-border\". Then Delete the p element that contains a dead link. Then remove the \"red-text\" class from your h2 element and replace it with the \"text-primary\" Bootstrap class. Finally, remove the \"smaller-image\" class from your first img element and replace it with the img-responsive class." ], "tests": [ - "assert(!$('h2').hasClass('red-text'), 'You h2 element should no longer have the class \"red-text\".')", - "assert($('h2').hasClass('text-primary'), 'You h2 element should now have the class \"text-primary\".')", + "assert(!$('h2').hasClass('red-text'), 'Your h2 element should no longer have the class \"red-text\".')", + "assert($('h2').hasClass('text-primary'), 'Your h2 element should now have the class \"text-primary\".')", "assert(!$('p').css('font-family').match(/monospace/i), 'Your paragraph elements should no longer use the font \"Monospace\".')", "assert(!$('img').hasClass('smaller-image'), 'Remove the \"smaller-image\" class from your top image.')", "assert($('.img-responsive').length > 1, 'Add the \"img-responsive\" class to your top image.')" From a920e16cb9d02d7a741c9b57cbb2480e42afda78 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Mon, 3 Aug 2015 16:35:22 -0700 Subject: [PATCH 15/16] fix completedWith.toLowerCase bug --- server/boot/challenge.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/boot/challenge.js b/server/boot/challenge.js index 8a74822b34..5e0cc37f0d 100644 --- a/server/boot/challenge.js +++ b/server/boot/challenge.js @@ -372,7 +372,7 @@ module.exports = function(app) { function completedZiplineOrBasejump(req, res, next) { - var completedWith = req.body.challengeInfo.completedWith || false; + var completedWith = req.body.challengeInfo.completedWith || ''; var completedDate = Math.round(+new Date()); var challengeId = req.body.challengeInfo.challengeId; var solutionLink = req.body.challengeInfo.publicURL; @@ -423,17 +423,17 @@ module.exports = function(app) { pairedWith: pairedWith }; }) - .doOnNext(function(dats) { + .doOnNext(function({ user, pairedWith }) { updateUserProgress( - dats.user, + user, challengeId, - dats.pairedWith ? - assign({ completedWith: dats.pairedWith.id }, challengeData) : + pairedWith ? + assign({ completedWith: pairedWith.id }, challengeData) : challengeData ); }) - .flatMap(function(dats) { - return Rx.Observable.from([dats.user, dats.pairedWith]); + .flatMap(function({ user, pairedWith }) { + return Rx.Observable.from([user, pairedWith]); }) // save users .flatMap(function(user) { From aa906f81c3b47dbda060e71ce5d0a80d40ff5e14 Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Tue, 4 Aug 2015 00:53:20 +0100 Subject: [PATCH 16/16] fix https://github.com/FreeCodeCamp/freecodecamp/issues/1450 missing semi-colon and assert( --- seed/challenges/jquery-ajax-and-json.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/challenges/jquery-ajax-and-json.json b/seed/challenges/jquery-ajax-and-json.json index 92509ffade..d482a60f3f 100644 --- a/seed/challenges/jquery-ajax-and-json.json +++ b/seed/challenges/jquery-ajax-and-json.json @@ -160,8 +160,8 @@ "Make all the button element with the id \"target3\" fadeOut. $('#target3').addClass('animated fadeOut')." ], "tests": [ - "$('#target3').hasClass('animated') && $('#target3').hasClass('fadeOut'), 'Select the buttonelement with the id of \"target3\" and use the jQuery addClass() function to give it the classes of \"animated\" and \"fadeOut\".')", - "assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')" + "assert($('#target3').hasClass('animated') && $('#target3').hasClass('fadeOut'), 'Select the buttonelement with the id of \"target3\" and use the jQuery addClass() function to give it the classes of \"animated\" and \"fadeOut\".');", + "assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.');" ], "challengeSeed": [ "fccss",