From 2fade59319e08b26941261ecbbbd7206b0fe23e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADnez?= Date: Mon, 17 Aug 2015 16:01:51 +0000 Subject: [PATCH 01/21] Changed test case for Waypoint: target elements by id --- seed/challenges/jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index f2dfcb08e1..cd059066b1 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -161,7 +161,7 @@ ], "tests": [ "assert($(\"#target3\").hasClass(\"animated\"), 'Select the buttonelement with the id of target3 and use the jQuery addClass() function to give it the class of animated.');", - "assert($(\"#target3\").hasClass(\"fadeOut\") || $(\"#target3\").hasClass(\"fadeout\"), 'Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.')", + "assert(($(\"#target3\").hasClass(\"fadeOut\") || $(\"#target3\").hasClass(\"fadeout\")) && editor.match(/\\$\\(.#target3.\\)/g), 'Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.');", "assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')" ], "challengeSeed": [ From 23139ff45fbe0a936fff2d8d9e927b1fb3bce5c4 Mon Sep 17 00:00:00 2001 From: Mark Surnin Date: Thu, 20 Aug 2015 12:01:38 +0500 Subject: [PATCH 02/21] Added a test for factorial(0) to be equal to 1. --- seed/challenges/basic-bonfires.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index 6f1cf7b9d4..84f92e15dd 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -90,7 +90,8 @@ "expect(factorialize(5)).to.be.a(\"Number\");", "expect(factorialize(5)).to.equal(120);", "expect(factorialize(10)).to.equal(3628800);", - "expect(factorialize(20)).to.equal(2432902008176640000);" + "expect(factorialize(20)).to.equal(2432902008176640000);", + "expect(factorialize(0)).to.equal(1);" ], "difficulty": "1.02", "description": [ From 636e16d5221fb59414875a89dffcdd4417a47cd3 Mon Sep 17 00:00:00 2001 From: Ionut Costica Date: Fri, 21 Aug 2015 15:18:40 +0300 Subject: [PATCH 03/21] [Waypoint: Remove Classes from an element with jQuery] usually expected to not validate if using removeClass() without parameters Added extra test to the waypoint to check if `.removeClass` was used with the `"btn-default"` parameter as most people expect to have to do (and are confused when the code validates before they've finished writing their function, as seen by the myriad of issues opened about it). Closes #2302 Closes #2402 Closes #2301 Closes #2197 Closes #2160 Closes #1923 Closes #1898 --- seed/challenges/jquery.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index aecaf645a6..99a8984a85 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -314,7 +314,8 @@ ], "tests": [ "assert($(\".btn-default\").length === 0, 'Remove the btn-default class from all of your button elements.')", - "assert(editor.match(/btn btn-default/g), 'Only use jQuery to remove this class from the element.')" + "assert(editor.match(/btn btn-default/g), 'Only use jQuery to remove this class from the element.')", + "assert(editor.match(/\\.[\\v\\s]*removeClass[\\s\\v]*\\([\\s\\v]*('|\")\\s*btn-default\\s*('|\")[\\s\\v]*\\)/gm), 'Only remove the btn-default class.'" ], "challengeSeed": [ "fccss", From 0132a1afcae227ea80934ae61e64e0c7d2c81bc5 Mon Sep 17 00:00:00 2001 From: Jakob Dahl Date: Fri, 21 Aug 2015 17:45:30 +0200 Subject: [PATCH 04/21] 2324 for id attributes to be under relevant parents --- seed/challenges/bootstrap.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/seed/challenges/bootstrap.json b/seed/challenges/bootstrap.json index da7a510236..a447d6bffa 100644 --- a/seed/challenges/bootstrap.json +++ b/seed/challenges/bootstrap.json @@ -1949,8 +1949,8 @@ "Give the well on the left the id of left-well. Give the well on the right the id of right-well." ], "tests": [ - "assert($(\"#left-well\") && $(\"#left-well\").length > 0, 'Give your left well the id of left-well.')", - "assert($(\"#right-well\") && $(\"#right-well\").length > 0, 'Give your right well the id of right-well.')" + "assert($(\".col-xs-6\").children(\"#left-well\") && $(\".col-xs-6\").children(\"#left-well\").length > 0, 'Give your left well the id of left-well.')", + "assert($(\".col-xs-6\").children(\"#right-well\") && $(\".col-xs-6\").children(\"#right-well\").length > 0, 'Give your right well the id of right-well.')" ], "challengeSeed": [ "
", @@ -2046,12 +2046,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($(\"#left-well\").children(\"#target1\") && $(\"#left-well\").children(\"#target1\").length > 0, 'One button element should have the id target1.')", + "assert($(\"#left-well\").children(\"#target2\") && $(\"#left-well\").children(\"#target2\").length > 0, 'One button element should have the id target2.')", + "assert($(\"#left-well\").children(\"#target3\") && $(\"#left-well\").children(\"#target3\").length > 0, 'One button element should have the id target3.')", + "assert($(\"#right-well\").children(\"#target4\") && $(\"#right-well\").children(\"#target4\").length > 0, 'One button element should have the id target4.')", + "assert($(\"#right-well\").children(\"#target5\") && $(\"#right-well\").children(\"#target5\").length > 0, 'One button element should have the id target5.')", + "assert($(\"#right-well\").children(\"#target6\") && $(\"#right-well\").children(\"#target6\").length > 0, 'One button element should have the id target6.')" ], "challengeSeed": [ "
", From 67158e876db1da0ed05dddd9e5557ee840b676b1 Mon Sep 17 00:00:00 2001 From: ahstro Date: Sun, 23 Aug 2015 15:18:17 +0200 Subject: [PATCH 05/21] Check all children instead of just one in 'Target Children with jQuery' --- seed/challenges/jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index 8576e4bc0d..75de836abf 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -679,7 +679,7 @@ "Here's an example of how you would use the children() function: $(\"#left-well\").children().css(\"color\", \"blue\")" ], "tests": [ - "assert($(\"#target6\").css(\"color\") === 'rgb(0, 128, 0)', 'Your target6 element should have green text.')", + "assert($(\"#right-well\").children().css(\"color\") === 'rgb(0, 128, 0)', 'All children of #right-well should have green text.')", "assert(editor.match(/\\.children\\(\\)\\.css/g), 'You should use the children() function to modify these elements.')", "assert(editor.match(/
/g), 'Only use jQuery to add these classes to the element.')" ], From 172543e670e92be6b6b1f5b80360c7ac074fc71b Mon Sep 17 00:00:00 2001 From: Ionut Costica Date: Wed, 26 Aug 2015 13:52:40 +0300 Subject: [PATCH 06/21] Fixed ")" error Somehow the assert's closing paren got deleted :") --- seed/challenges/jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index 99a8984a85..f863a77bf9 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -315,7 +315,7 @@ "tests": [ "assert($(\".btn-default\").length === 0, 'Remove the btn-default class from all of your button elements.')", "assert(editor.match(/btn btn-default/g), 'Only use jQuery to remove this class from the element.')", - "assert(editor.match(/\\.[\\v\\s]*removeClass[\\s\\v]*\\([\\s\\v]*('|\")\\s*btn-default\\s*('|\")[\\s\\v]*\\)/gm), 'Only remove the btn-default class.'" + "assert(editor.match(/\\.[\\v\\s]*removeClass[\\s\\v]*\\([\\s\\v]*('|\")\\s*btn-default\\s*('|\")[\\s\\v]*\\)/gm), 'Only remove the btn-default class.')" ], "challengeSeed": [ "fccss", From dd5feb4a2c00bc4b4249722ed696e7b8ecc6601b Mon Sep 17 00:00:00 2001 From: Dmytro Yarmak Date: Wed, 2 Sep 2015 23:17:33 +0300 Subject: [PATCH 07/21] Improve test cases for Generate Random Whole Numbers within a Range --- seed/challenges/basic-javascript.json | 1 + 1 file changed, 1 insertion(+) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index a4c3cabdb9..a26a417c87 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -936,6 +936,7 @@ "tests":[ "assert(myFunction() >= min, 'The random number that\\'s generated by myFunction should be greater than or equal to the minimum number');", "assert(myFunction() <= max, 'The random number that\\'s generated by myFunction should be less than or equal to the maximum number');", + "assert(myFunction() % 1 === 0 , 'The random number that\\'s generated by myFunction should be an integer');", "assert((function(){if(editor.getValue().match(/max/g).length >= 2 && editor.getValue().match(/min/g).length >= 2 && editor.getValue().match(/Math.floor/g) && editor.getValue().match(/Math.random/g)){return true;}else{return false;}})(), 'You should be using the function given in the description to calculate the random in number in a range');" ], "challengeSeed":[ From 9496152e00e2d8c28287528dcd830f25e73696ae Mon Sep 17 00:00:00 2001 From: Natac13 Date: Thu, 3 Sep 2015 14:02:44 -0400 Subject: [PATCH 08/21] fixes filter function return conditional closes #3031 --- seed/challenges/object-oriented-and-functional-programming.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/object-oriented-and-functional-programming.json b/seed/challenges/object-oriented-and-functional-programming.json index 6d6b1e15e4..b7701304f1 100644 --- a/seed/challenges/object-oriented-and-functional-programming.json +++ b/seed/challenges/object-oriented-and-functional-programming.json @@ -236,7 +236,7 @@ "filter is a useful method that can filter out values that don't match a certain criteria", "Let's remove all the values greater than five", "array = array.filter(function(val) {", - "  return val<4;", + "  return val <= 5;", "});" ], "tests":[ From 6d39433aea2c5de9f9f9bae8907e1f9a4c45dd4b Mon Sep 17 00:00:00 2001 From: Natac13 Date: Thu, 3 Sep 2015 18:21:36 -0400 Subject: [PATCH 09/21] Attempt to fix unclear description Where Art Thou closes #3038 --- seed/challenges/basic-bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index 32964b0378..9d860d3d12 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -569,7 +569,7 @@ "title": "Where art thou", "difficulty": "1.55", "description": [ - "Make a function that looks through an array (first argument) and returns an array of all objects that have equivalent property and value pair (second argument).", + "Make a function that looks through an array of objects (first argument) and returns an array of all objects that have matching property and value pairs (second argument). Each property and value pair of the source object has to be present in the object from the collection if it is to be included in the returned array.", "For example, if the first argument is [{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], and the second argument is { last: 'Capulet' }, then you must return the the third object from the array (the first argument), because it contains the property and it's value, that was passed on as the second argument.", "Remember to use Read-Search-Ask if you get stuck. Write your own code." ], From 113a3f5456a8103d4a22e0291e410b01a68affde Mon Sep 17 00:00:00 2001 From: ahstro Date: Fri, 4 Sep 2015 09:55:07 +0200 Subject: [PATCH 10/21] Updated ExpressWorks exercises in waypoint --- seed/challenges/nodejs-and-expressjs.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/seed/challenges/nodejs-and-expressjs.json b/seed/challenges/nodejs-and-expressjs.json index c8364e4e36..a1dccae476 100644 --- a/seed/challenges/nodejs-and-expressjs.json +++ b/seed/challenges/nodejs-and-expressjs.json @@ -177,11 +177,13 @@ "Note that you can resize the c9.io's windows by dragging their borders.", "Make sure that you are always in your project's \"workspace\" directory. You can always navigate back to this directory by running this command: cd ~/workspace.", "You can view this Node School module's source code on GitHub at https://github.com/azat-co/expressworks.", - "Complete \"Hello World\"", + "Complete \"Hello World!\"", + "Complete \"Static\"", "Complete \"Jade\"", "Complete \"Good Old Form\"", "Complete \"Stylish CSS\"", - "Complete \"Session and Cookie\"", + "Complete \"Param Pam Pam\"", + "Complete \"What's In Query\"", "Complete \"JSON Me\"", "Once you've completed these steps, move on to our next challenge." ], From 1c85bdf8bd325dd9e7b37ad95f0d06c8521b5346 Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Fri, 4 Sep 2015 21:51:34 +0100 Subject: [PATCH 11/21] Tweaked how the modal is focused --- client/commonFramework.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/commonFramework.js b/client/commonFramework.js index 45589df873..3a6c8d911e 100644 --- a/client/commonFramework.js +++ b/client/commonFramework.js @@ -421,7 +421,8 @@ function showCompletion() { ); var bonfireSolution = myCodeMirror.getValue(); var didCompleteWith = $('#completed-with').val() || null; - $('#complete-courseware-dialog').modal('show').focus(); + $('#complete-courseware-dialog').modal('show'); + $('#complete-courseware-dialog .modal-header').click(); $('#submit-challenge').click(function(e) { e.preventDefault(); From 04c30473610132c0dc908501418d53983aad1557 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Fri, 4 Sep 2015 15:00:58 -0700 Subject: [PATCH 12/21] improve jquery challenge wording --- seed/challenges/jquery.json | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index 4df308b372..0ad2a48005 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -310,8 +310,8 @@ "difficulty": 3.07, "description": [ "In the same way you can add classes to an element with jQuery's addClass() function, you can remove them with jQuery's removeClass() function.", - "Let's remove the btn-default class from all of our button elements.", - "Here's how you would do this for a specific button, add $(\"#target2\").removeClass(\"btn-default\");" + "Here's how you would do this for a specific button, add $(\"#target2\").removeClass(\"btn-default\");", + "Let's remove the btn-default class from all of our button elements." ], "tests": [ "assert($(\".btn-default\").length === 0, 'Remove the btn-default class from all of your button elements.')", @@ -360,11 +360,11 @@ "difficulty": 3.08, "description": [ "We can also change the CSS of an HTML element directly with jQuery.", - "Delete your jQuery selectors, leaving an empty document ready function.", - "Select target1 and change its color to red.", "jQuery has a function called .css() that allows you to change the CSS of an element.", "Here's how we would change its color to blue: $(\"#target1\").css(\"color\", \"blue\");", - "This is slightly different from a normal CSS declaration, because the CSS property and its value are in quotes, and separated with a comma instead of a colon." + "This is slightly different from a normal CSS declaration, because the CSS property and its value are in quotes, and separated with a comma instead of a colon.", + "Delete your jQuery selectors, leaving an empty document ready function.", + "Select target1 and change its color to red." ], "tests": [ "assert($(\"#target1\").css(\"color\") === 'rgb(255, 0, 0)', 'Your target1 element should have red text.')", @@ -622,9 +622,8 @@ "Every HTML element has a parent element from which it inherits properties.", "For example, your jQuery Playground h3 element has the parent element of <div class=\"container-fluid\">, which itself has the parent body.", "jQuery has a function called parent() that allows you to access the parent of whichever element you've selected.", - "Give the parent of the #target1 element background-color of red.", - "Here's an example of how you would use the parent() function: $(\"#left-well\").parent().css(\"background-color\", \"blue\")", - "Note: Please do not use this example in the challenge; it will target the incorrect element." + "Here's an example of how you would use the parent() function if you wanted to give the parent element of the left-well element a background color of blue: $(\"#left-well\").parent().css(\"background-color\", \"blue\")", + "Give the parent of the #target1 element a background-color of red." ], "tests": [ "assert($(\"#left-well\").css(\"background-color\") === 'red' || $(\"#left-well\").css(\"background-color\") === 'rgb(255, 0, 0)' || $(\"#left-well\").css(\"background-color\").toLowerCase() === '#ff0000' || $(\"#left-well\").css(\"background-color\").toLowerCase() === '#f00', 'Your left-well element should have a red background.')", @@ -678,8 +677,8 @@ "Many HTML elements have children elements from which they inherit their properties.", "For example, every HTML element is a child of your body element, and your \"jQuery Playground\" h3 element is a child of your <div class=\"container-fluid\"> element.", "jQuery has a function called children() that allows you to access the children of whichever element you've selected.", - "Give all the children of your #right-well element a color of green.", - "Here's an example of how you would use the children() function: $(\"#left-well\").children().css(\"color\", \"blue\")" + "Here's an example of how you would use the children() function to give the children of your left-well element the background color of blue: $(\"#left-well\").children().css(\"color\", \"blue\")", + "Give all the children of your #right-well element a color of green." ], "tests": [ "assert($(\"#target6\").css(\"color\") === 'rgb(0, 128, 0)', 'Your target6 element should have green text.')", @@ -734,8 +733,8 @@ "You've seen why id attributes are so convenient for targeting with jQuery selectors. But you won't always have such neat ids to work with.", "Fortunately, jQuery has some other tricks for targeting the right elements.", "jQuery uses CSS Selectors to target elements. target:nth-child(n) css selector allows you to select all the nth element with the target class or element type.", - "Make the second child in each of your well elements bounce.", - "Here's how you would give the third element in each well bounce: $(\".target:nth-child(3)\").addClass(\"animated bounce\");" + "Here's how you would give the third element in each well bounce: $(\".target:nth-child(3)\").addClass(\"animated bounce\");", + "Make the second child in each of your well elements bounce." ], "tests": [ "assert($(\".target:nth-child(2)\").hasClass(\"animated\") && $(\".target:nth-child(2)\").hasClass(\"bounce\"), 'The second element in each of your well elements should bounce.')", From c34a64b4545c8dba06cfd6b7dfd34e3d8abb492c Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Fri, 4 Sep 2015 15:22:45 -0700 Subject: [PATCH 13/21] fix typeof wording --- seed/challenges/automated-testing-and-debugging.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seed/challenges/automated-testing-and-debugging.json b/seed/challenges/automated-testing-and-debugging.json index 9cf677a024..2fbb5352d7 100644 --- a/seed/challenges/automated-testing-and-debugging.json +++ b/seed/challenges/automated-testing-and-debugging.json @@ -28,9 +28,9 @@ "title":"Using typeof", "difficulty":0, "description":[ - "typeof is a useful method that we can use to check the type of a variable.", - "One thing to be careful of is that an array has the type objects.", - "Try using each of these to see the types they have.", + "You can use typeof to check the data structure, or type, of a variable.", + "Note that in JavaScript, arrays are technically a type of object.", + "Try using typeof on each of the following to see which types they have.", "console.log(typeof(\"\"));", "console.log(typeof(0));", "console.log(typeof([]));", From 0075bab84e69b9b86d49840d6a7abeca8115fa0c Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Sat, 5 Sep 2015 01:04:25 +0100 Subject: [PATCH 14/21] Merge #2887 --- .../json-apis-and-ajax.json | 104 ++++++++++-------- 1 file changed, 56 insertions(+), 48 deletions(-) diff --git a/seed/under-construction/json-apis-and-ajax.json b/seed/under-construction/json-apis-and-ajax.json index 5a74cb3a61..ab12090b02 100644 --- a/seed/under-construction/json-apis-and-ajax.json +++ b/seed/under-construction/json-apis-and-ajax.json @@ -7,6 +7,10 @@ "title": "Trigger on click Events with jQuery", "difficulty": 3.19, "description": [ + "With jQuery we are able to get data from APIs via Ajax", + "This data normally comes in the form of JSON", + "Let's get the Get Message button to set the text of a div", + "We will later use this to display the result of out API request", "$(\"#getMessage\").on(\"click\", function(){", "  $(\".message\").html(\"Here is the message\");", "});" @@ -48,10 +52,60 @@ "challengeType": 0, "type": "waypoint" }, - + { + "id": "bad87fee1348bd9aebc08726", + "title": "Learn JSON Syntax", + "description": [ + "JSON stands for \"JavaScript Object Notation\". It\"s how you create objects in JavaScript.", + "JSON is a series of \"key-value pairs\". Everything on the left of the colon (:) is the \"key\" you use to unlock the \"value\" on the right of the colon." + ], + "tests": [ + "assert(typeof data != \"undefined\", \"Whoops! It looks like you deleted the data variable!\");", + "assert(typeof getAnId != \"undefined\", \"Whoops! It looks like you deleted the getAnId function!\");", + "assert(data[0]['id'] === getAnId(), \"The duntion getFirstId should return the id of the first element in the array\");" + ], + "challengeSeed": [ + "fccss", + "var data = [", + " {", + " \"id\": 0,", + " \"imageLink\": \"http://rs611.pbsrc.com/albums/tt194/allypopper423/Funny-Cat-Green-Avacado.jpg~c200\",", + " \"codeNames\": [", + " \"Juggernaut\",", + " \"Mrs. Wallace\",", + " \"Buttercup\"", + " ]", + " },", + " {", + " \"id\": 1,", + " \"imageLink\": \"http://cdn.grumpycats.com/wp-content/uploads/2012/09/GC-Gravatar-copy.png\",", + " \"codeNames\": [", + " \"Oscar\",", + " \"Scrooge\",", + " \"Tyrion\"", + " ]", + " },", + " {", + " \"id\": 2,", + " \"imageLink\": \"http://www.kittenspet.com/wp-content/uploads/2012/08/cat_with_funny_face_3-200x200.jpg\",", + " \"codeNames\": [", + " \"The Doctor\",", + " \"Loki\",", + " \"Joker\"", + " ]", + " }", + "]", + "function getAnId(){", + " return();", + "}", + "fcces" + ], + "challengeType": 0, + "type": "waypoint" + }, { "id": "bad87fee1348bd9aeca08826", - "title": "Learn how JSON works", + "title": "Displaying JSON data in HTML", "difficulty": 3.19, "description": [ "JSON stands for \"JavaScript Object Notation\". It\"s how you create objects in JavaScript.", @@ -272,52 +326,6 @@ "type": "waypoint" }, - - { - "id": "bad87fee1348bd9aebc08726", - "title": "Learn how JSON Works", - "description": [ - "JSON stands for \"JavaScript Object Notation\". It\"s how you create objects in JavaScript.", - "JSON is a series of \"key-value pairs\". Everything on the left of the colon (:) is the \"key\" you use to unlock the \"value\" on the right of the colon." - ], - "tests": [ - - ], - "challengeSeed": [ - "[", - " {", - " \"id\": 0,", - " \"imageLink\": \"http://rs611.pbsrc.com/albums/tt194/allypopper423/Funny-Cat-Green-Avacado.jpg~c200\",", - " \"codeNames\": [", - " \"Juggernaut\",", - " \"Mrs. Wallace\",", - " \"Buttercup\"", - " ]", - " },", - " {", - " \"id\": 1,", - " \"imageLink\": \"http://cdn.grumpycats.com/wp-content/uploads/2012/09/GC-Gravatar-copy.png\",", - " \"codeNames\": [", - " \"Oscar\",", - " \"Scrooge\",", - " \"Tyrion\"", - " ]", - " },", - " {", - " \"id\": 2,", - " \"imageLink\": \"http://www.kittenspet.com/wp-content/uploads/2012/08/cat_with_funny_face_3-200x200.jpg\",", - " \"codeNames\": [", - " \"The Doctor\",", - " \"Loki\",", - " \"Joker\"", - " ]", - " }", - "]" - ], - "challengeType": 0, - "type": "waypoint" - }, - { "id": "bad87fee1348bd9aebc08826", "title": "Get Data from an URL Using jQuery", From a4650adda0fc584c7553620bafc5811ba3834445 Mon Sep 17 00:00:00 2001 From: elitepc Date: Sat, 5 Sep 2015 20:59:46 +0100 Subject: [PATCH 15/21] added missing verb in the get set for basejumps --- seed/challenges/basejumps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/basejumps.json b/seed/challenges/basejumps.json index c5d3e871c5..bf872054bf 100644 --- a/seed/challenges/basejumps.json +++ b/seed/challenges/basejumps.json @@ -54,7 +54,7 @@ "Run the following command in a Cloud9 terminal prompt tab: npm install grunt-contrib-imagemin --save-dev && npm install --save-dev && heroku login. At this point, the terminal will prompt you to log in to Heroku from the command line.", "Now run yo angular-fullstack:heroku. You can choose a name for your Heroku project, or Heroku will create a random one for you. You can choose whether you want to deploy to servers the US or the EU.", "Set the config flag for your Heroku environment and add MongoLab for your MongoDB instance by running the following command: cd ~/workspace/dist && heroku config:set NODE_ENV=production && heroku addons:create mongolab.", - "As you build your app, you should frequently commit changes to your codebase. Make sure you're in the ~/workspace directory by running cd ~/workspace. Then you can this code to stage the changes to your changes and commit them: git commit -am \"your commit message\". Note that you should replace \"your commit message\" with a short summary of the changes you made to your code, such as \"added a records controller and corresponding routes\".", + "As you build your app, you should frequently commit changes to your codebase. Make sure you're in the ~/workspace directory by running cd ~/workspace. Then you can use this code to stage the changes to your changes and commit them: git commit -am \"your commit message\". Note that you should replace \"your commit message\" with a short summary of the changes you made to your code, such as \"added a records controller and corresponding routes\".", "You can push these new commits to GitHub by running git push origin master, and to Heroku by running grunt --force && grunt buildcontrol:heroku.", "If you need further guidance on using Yeoman Angular-Fullstack Generator, check out: https://github.com/clnhll/guidetobasejumps.", "Now you're ready to move on to your first Basejump. Click the \"I've completed this challenge\" and move on." From aa34bf1a41d77ea00e967336a42b39757105fe0f Mon Sep 17 00:00:00 2001 From: Aryan Jabbari Date: Sat, 5 Sep 2015 20:53:54 -0400 Subject: [PATCH 16/21] Added details to instructions of JS arrays waypoint; closes #2136 --- 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 7c5df36b40..69f2f02254 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -422,7 +422,7 @@ "description": [ "With JavaScript array variables, we can store several pieces of data in one place.", "You start an array declaration with an opening bracket, end it with a closing bracket, and put a comma between each entry, like this: var sandwich = [\"peanut butter\", \"jelly\", \"bread\"].", - "Now let's create a new array called myArray that contains both a string and a number.", + "Now let's create a new array called myArray that contains both a string and a number (in that order).", "Refer to the comments if you get stuck." ], "tests": [ From 1151929f25c0c7e8d27bdfda18e00fc9224e9182 Mon Sep 17 00:00:00 2001 From: natac13 Date: Sat, 5 Sep 2015 21:39:27 -0400 Subject: [PATCH 17/21] General improvements to jquery file added a few tests to account for single and double quotes fixed a typo added test to add clarity closes #3107 --- seed/challenges/jquery.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index 0ad2a48005..358ad754d8 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -263,9 +263,9 @@ "Use the addClass() jQuery function to give the element one new class for each selector: animated, shake, and btn-primary." ], "tests": [ - "assert(editor.match(/\\$\\(.*button/g), 'Use the $(\"button\") selector.')", - "assert(editor.match(/\\$\\(.*\\.btn/g), 'Use the $(\".btn\") selector.')", - "assert(editor.match(/\\$\\(.*#target1/g), 'Use the $(\"#target1\") selector.')", + "assert((editor.match(/\\$\\(\\'button\\'/g) || editor.match(/\\$\\(\"button\"/g)), 'Use the $(\"button\") selector.')", + "assert((editor.match(/\\$\\(\\'\\.btn\\'/g) || editor.match(/\\$\\(\"\\.btn\"/g)), 'Use the $(\".btn\") selector.')", + "assert((editor.match(/\\$\\(\\'#target1\\'/g) || editor.match(/\\$\\(\"#target1\"/g)), 'Use the $(\"#target1\") selector.')", "assert(editor.match(/addClass/g) && editor.match(/addClass/g).length > 2, 'Only add one class with each of your three selectors.')", "assert($(\"#target1\").hasClass(\"animated\") && $(\"#target1\").hasClass(\"shake\") && $(\"#target1\").hasClass(\"btn-primary\"), 'Your #target1 element should have the classes animatedshake and btn-primary.')", "assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')" @@ -627,7 +627,8 @@ ], "tests": [ "assert($(\"#left-well\").css(\"background-color\") === 'red' || $(\"#left-well\").css(\"background-color\") === 'rgb(255, 0, 0)' || $(\"#left-well\").css(\"background-color\").toLowerCase() === '#ff0000' || $(\"#left-well\").css(\"background-color\").toLowerCase() === '#f00', 'Your left-well element should have a red background.')", - "assert(editor.match(/\\.parent\\(\\)\\.css/g), 'You should use the parent() function to modify this element.')", + "assert(editor.match(/\\.parent\\(\\)\\.css/g), 'You should use the .parent() function to modify this element.')", + "assert((editor.match(/\\$\\(\\'#target1\\'\\)\\.parent/g) || editor.match(/\\$\\(\"#target1\"\\)\\.parent/g)), 'The .parent() method should be called on the #target1 element.')", "assert(editor.match(/
/g), 'Only use jQuery to add these classes to the element.')" ], "challengeSeed": [ From 2817ec49a9ff912486491de434c61e4e18b2718b Mon Sep 17 00:00:00 2001 From: Aryan Jabbari Date: Sun, 6 Sep 2015 00:37:12 -0400 Subject: [PATCH 18/21] Checks that length is used twice for JS bracket notation challenges; closes #3105 --- 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 7c5df36b40..5a667337fb 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -221,7 +221,7 @@ ], "tests": [ "assert(lastLetterOfLastName === \"e\", 'lastLetterOfLastName should be \"e\"');", - "assert(editor.getValue().match(/\\.length/g), 'You have to use .length to get the last letter');" + "assert(editor.getValue().match(/\\.length/g).length === 2, 'You have to use .length to get the last letter');" ], "challengeSeed": [ "var firstName = \"Ada\";", @@ -253,7 +253,7 @@ ], "tests": [ "assert(secondToLastLetterOfLastName === 'c', 'secondToLastLetterOfLastName should be \"c\".');", - "assert(editor.getValue().match(/\\.length/g), 'You have to use .length to get the third last letter.');" + "assert(editor.getValue().match(/\\.length/g).length == 2, 'You have to use .length to get the third last letter.');" ], "challengeSeed": [ "var firstName = \"Ada\";", From 0f46ed8c9d3c7e0dbbacea810a6d4eef2ee420ad Mon Sep 17 00:00:00 2001 From: Aryan Jabbari Date: Sun, 6 Sep 2015 00:39:07 -0400 Subject: [PATCH 19/21] Used strict equality for second assert --- 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 5a667337fb..d06a1038a9 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -253,7 +253,7 @@ ], "tests": [ "assert(secondToLastLetterOfLastName === 'c', 'secondToLastLetterOfLastName should be \"c\".');", - "assert(editor.getValue().match(/\\.length/g).length == 2, 'You have to use .length to get the third last letter.');" + "assert(editor.getValue().match(/\\.length/g).length === 2, 'You have to use .length to get the third last letter.');" ], "challengeSeed": [ "var firstName = \"Ada\";", From 73ef8b9d2bfed5fa340bbc53385dbab626abdd7c Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Sun, 6 Sep 2015 03:12:59 -0700 Subject: [PATCH 20/21] fix a view bug --- server/views/coursewares/showZiplineOrBasejump.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/views/coursewares/showZiplineOrBasejump.jade b/server/views/coursewares/showZiplineOrBasejump.jade index 6bd38d9737..df46b026e0 100644 --- a/server/views/coursewares/showZiplineOrBasejump.jade +++ b/server/views/coursewares/showZiplineOrBasejump.jade @@ -74,7 +74,7 @@ block content .col-xs-10.col-xs-offset-1.col-sm-8.col-sm-offset-2.col-md-8.col-md-offset-2.animated.fadeIn // extra field to distract password tools like lastpass from injecting css into our username field input.form-control(ng-show="false") - if (challengeType === 3) + if (challengeType === "3") input.form-control#public-url(type='url', name="solutionUrl", placeholder="http://codepen.io/your-pen-here", autofocus, required, ng-minlength="10", ng-model="deploymentUrl") else input.form-control#public-url(type='url', name="solutionUrl", placeholder="http://yourapp.com", autofocus, required, ng-minlength="10", ng-model="deploymentUrl") From 227b57492713e3a07ec2b38f34b5de86e8d843bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADnez?= Date: Sun, 6 Sep 2015 15:08:14 +0000 Subject: [PATCH 21/21] removed semicolons at the end of asserts --- seed/challenges/jquery.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index cd059066b1..515a12ea28 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -160,8 +160,8 @@ "Here's how you'd make the button element with the id target6 fade out: $(\"#target6\").addClass(\"animated fadeOut\")." ], "tests": [ - "assert($(\"#target3\").hasClass(\"animated\"), 'Select the buttonelement with the id of target3 and use the jQuery addClass() function to give it the class of animated.');", - "assert(($(\"#target3\").hasClass(\"fadeOut\") || $(\"#target3\").hasClass(\"fadeout\")) && editor.match(/\\$\\(.#target3.\\)/g), 'Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.');", + "assert($(\"#target3\").hasClass(\"animated\"), 'Select the buttonelement with the id of target3 and use the jQuery addClass() function to give it the class of animated.')", + "assert(($(\"#target3\").hasClass(\"fadeOut\") || $(\"#target3\").hasClass(\"fadeout\")) && editor.match(/\\$\\(.#target3.\\)/g), 'Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.')", "assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')" ], "challengeSeed": [