From db6662d76d4cfdd8c0e4c8976c37846ead59e01d Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Fri, 14 Aug 2015 12:31:58 +0530 Subject: [PATCH 001/156] Bonfire: Where art thou test case update Added further test cases to check for adhering to the instructions in bonfire properly. --- challenges/basic-bonfires.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/challenges/basic-bonfires.json b/challenges/basic-bonfires.json index 6f1cf7b9d4..d027bfa3ae 100644 --- a/challenges/basic-bonfires.json +++ b/challenges/basic-bonfires.json @@ -582,7 +582,8 @@ ], "tests": [ "assert.deepEqual(where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }), [{ first: 'Tybalt', last: 'Capulet' }], 'should return an array of objects');", - "assert.deepEqual(where([{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], { 'a': 1 }), [{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], 'should return with multiples');" + "assert.deepEqual(where([{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], { 'a': 1 }), [{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], 'should return with multiples');", + "assert.deepEqual(where([{ 'a': 5 }, { 'a': 5 }, { 'a': 5, 'b': 10 }], { 'a': 5, 'b': 10 }), [{ 'a': 5, 'b': 10 }], 'should return a single object in array');" ], "MDNlinks": [ "Global Object", From 2c692e8303ae03dd52f55a161bece50448f9a6fd Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Mon, 17 Aug 2015 02:18:27 +0530 Subject: [PATCH 002/156] Added test cases for Bonfire: Where do I belong Checks for proper positioning of element based on proper sorting order. --- challenges/basic-bonfires.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/challenges/basic-bonfires.json b/challenges/basic-bonfires.json index 6f1cf7b9d4..1712f90492 100644 --- a/challenges/basic-bonfires.json +++ b/challenges/basic-bonfires.json @@ -664,7 +664,11 @@ ], "tests": [ "expect(where([10, 20, 30, 40, 50], 35)).to.equal(3);", - "expect(where([10, 20, 30, 40, 50], 30)).to.equal(2);" + "expect(where([10, 20, 30, 40, 50], 30)).to.equal(2);", + "expect(where([40, 60], 50)).to.equal(1);", + "expect(where([5, 3, 20, 3], 3)).to.equal(0);", + "expect(where([2, 20, 10], 1)).to.equal(0);", + "expect(where([2, 5, 10], 15)).to.equal(3);" ], "type": "bonfire", "challengeType": 5, From 4338d69458310cce55113562ba185f23d016dc6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADnez?= Date: Sun, 16 Aug 2015 21:11:36 +0000 Subject: [PATCH 003/156] Fixed #1090 --- challenges/html5-and-css.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/challenges/html5-and-css.json b/challenges/html5-and-css.json index 4d4ae95cad..e25c317578 100644 --- a/challenges/html5-and-css.json +++ b/challenges/html5-and-css.json @@ -867,8 +867,8 @@ "tests": [ "assert($(\"img\").hasClass(\"smaller-image\"), 'Your img element should have the class smaller-image.')", "assert($(\"img\").hasClass(\"thick-green-border\"), 'Your img element should have the class thick-green-border.')", - "assert($(\"img\").hasClass(\"thick-green-border\") && parseInt($(\"img\").css(\"border-top-width\")), 'Give your image a border width of 10px.')", - "assert(new RegExp(\"solid\", \"gi\").test(editor), 'Give your image a border style of solid.')", + "assert($(\"img\").hasClass(\"thick-green-border\") && parseInt($(\"img\").css(\"border-top-width\"), 10) === 10, 'Give your image a border width of 10px.')", + "assert($(\"img\").css(\"border-right-style\") === \"solid\", 'Give your image a border style of solid.')", "assert($(\"img\").css(\"border-left-color\") === \"rgb(0, 128, 0)\", 'The border around your img element should be green.')" ], "challengeSeed": [ From bde8e4c5eb334774b61985666d5707a7191f55b1 Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Mon, 17 Aug 2015 18:27:33 +0530 Subject: [PATCH 004/156] Added additional test case --- challenges/basic-bonfires.json | 1 + 1 file changed, 1 insertion(+) diff --git a/challenges/basic-bonfires.json b/challenges/basic-bonfires.json index d027bfa3ae..845b55a1c8 100644 --- a/challenges/basic-bonfires.json +++ b/challenges/basic-bonfires.json @@ -583,6 +583,7 @@ "tests": [ "assert.deepEqual(where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }), [{ first: 'Tybalt', last: 'Capulet' }], 'should return an array of objects');", "assert.deepEqual(where([{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], { 'a': 1 }), [{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], 'should return with multiples');", + "assert.deepEqual(where([{ 'a': 1, 'b': 2 }, { 'a': 1 }, { 'a': 1, 'b': 2, 'c': 2 }], { 'a': 1, 'b': 2 }), [{ 'a': 1, 'b': 2 }, { 'a': 1, 'b': 2, 'c': 2 }], 'should return two objects in array');", "assert.deepEqual(where([{ 'a': 5 }, { 'a': 5 }, { 'a': 5, 'b': 10 }], { 'a': 5, 'b': 10 }), [{ 'a': 5, 'b': 10 }], 'should return a single object in array');" ], "MDNlinks": [ From 1139850b92f2a0464ab9746963cf4c02d5a241c3 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 005/156] Changed test case for Waypoint: target elements by id --- challenges/jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/jquery.json b/challenges/jquery.json index f2dfcb08e1..cd059066b1 100644 --- a/challenges/jquery.json +++ b/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 5d3582aa0a805cff8daa4dca4ba3d7f4ecb500e5 Mon Sep 17 00:00:00 2001 From: Matt Trifilo Date: Tue, 18 Aug 2015 00:43:28 -0500 Subject: [PATCH 006/156] Fixed: issue #2014 I changed "#button" to "button" in the example to target all buttons, and I changed the single quotes to double quotes in the description for consistency. --- challenges/jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/jquery.json b/challenges/jquery.json index d6a6fa0fb0..166ff7f431 100644 --- a/challenges/jquery.json +++ b/challenges/jquery.json @@ -415,7 +415,7 @@ "You can also change the non-CSS properties of HTML elements with jQuery. For example, you can disable buttons.", "When you disable a button, it will become grayed-out and can no longer be clicked.", "jQuery has a function called .prop() that allows you to adjust the properties of elements.", - "Here's how you would disable all buttons: $('#button').prop('disabled', true);", + "Here's how you would disable all buttons: $("button").prop("disabled", true);", "Disable only the target1 button." ], "tests": [ From d22deb5f762fc228f6e9cabf6128390482028b15 Mon Sep 17 00:00:00 2001 From: Ionut Costica Date: Wed, 19 Aug 2015 15:43:39 +0300 Subject: [PATCH 007/156] Fix for Issue #2179, #2141, #2077, #1999 Fixes #2179, #2141, #2077, #1999 --- challenges/basic-javascript.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/challenges/basic-javascript.json b/challenges/basic-javascript.json index 1096e02868..de249f003a 100644 --- a/challenges/basic-javascript.json +++ b/challenges/basic-javascript.json @@ -16,9 +16,9 @@ "Try creating one of each." ], "tests":[ - "assert(editor.getValue().match(/(\\/\\/)...../g), 'Create a \\/\\/ style comment that contains at least five letters');", - "assert(editor.getValue().match(/(\\/\\*)...../g), 'Create a \/\\* \\*\/ style comment that contains at least five letters.');", - "assert(editor.getValue().match(/(\\*\\/)/g), 'Make sure that you close the comment with a \\*\/');" + "assert(editor.getValue().match(/(\\/\\/)...../g), 'Create a // style comment that contains at least five letters');", + "assert(editor.getValue().match(/(\\/\\*)[\\w\\W]{5,}(?=\\*\\/)/gm), 'Create a /* */ style comment that contains at least five letters.');", + "assert(editor.getValue().match(/(\\*\\/)/g), 'Make sure that you close the comment with a */');" ], "challengeSeed":[ ], From 2c34c1016ebc959c76736f6ec7aff258fe356f67 Mon Sep 17 00:00:00 2001 From: Matt Trifilo Date: Wed, 19 Aug 2015 22:48:25 -0500 Subject: [PATCH 008/156] Edited Pull Request #2018 Escaped the double quotation marks on line 418. --- challenges/jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/jquery.json b/challenges/jquery.json index 166ff7f431..3bc98205b4 100644 --- a/challenges/jquery.json +++ b/challenges/jquery.json @@ -415,7 +415,7 @@ "You can also change the non-CSS properties of HTML elements with jQuery. For example, you can disable buttons.", "When you disable a button, it will become grayed-out and can no longer be clicked.", "jQuery has a function called .prop() that allows you to adjust the properties of elements.", - "Here's how you would disable all buttons: $("button").prop("disabled", true);", + "Here's how you would disable all buttons: $(\"button\").prop(\"disabled\", true);", "Disable only the target1 button." ], "tests": [ From 94614c7855b3e30b71909e3343fdf270b1ec56f4 Mon Sep 17 00:00:00 2001 From: Mark Surnin Date: Thu, 20 Aug 2015 12:01:38 +0500 Subject: [PATCH 009/156] Added a test for factorial(0) to be equal to 1. --- challenges/basic-bonfires.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/challenges/basic-bonfires.json b/challenges/basic-bonfires.json index 6f1cf7b9d4..84f92e15dd 100644 --- a/challenges/basic-bonfires.json +++ b/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 0769f716bde71c7ed6b9b1f8445887e7497954f7 Mon Sep 17 00:00:00 2001 From: Ionut Costica Date: Fri, 21 Aug 2015 15:18:40 +0300 Subject: [PATCH 010/156] [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 --- challenges/jquery.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/challenges/jquery.json b/challenges/jquery.json index aecaf645a6..99a8984a85 100644 --- a/challenges/jquery.json +++ b/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 c581274bf372b6ad2477ceb572053c426df947bf Mon Sep 17 00:00:00 2001 From: Arsen Melikyan Date: Fri, 21 Aug 2015 18:38:43 +0400 Subject: [PATCH 011/156] fixed missing URL scheme #1063 --- challenges/html5-and-css.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/html5-and-css.json b/challenges/html5-and-css.json index e5e376317d..10d1302ef9 100644 --- a/challenges/html5-and-css.json +++ b/challenges/html5-and-css.json @@ -750,7 +750,7 @@ "difficulty": 1.17, "description": [ "You can add images to your website by using the img element, and point to a specific image's URL using the src attribute.", - "An example of this would be <img src=\"www.your-image-source.com/your-image.jpg\">. Note that in most cases, img elements are self-closing.", + "An example of this would be <img src=\"http://www.your-image-source.com/your-image.jpg\">. Note that in most cases, img elements are self-closing.", "Try it with this image: https://bit.ly/fcc-relaxing-cat." ], "tests": [ From 10f9992a294a67cd995216a48677fd0ff4bfc3ba Mon Sep 17 00:00:00 2001 From: Jakob Dahl Date: Fri, 21 Aug 2015 17:45:30 +0200 Subject: [PATCH 012/156] 2324 for id attributes to be under relevant parents --- challenges/bootstrap.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/challenges/bootstrap.json b/challenges/bootstrap.json index da7a510236..a447d6bffa 100644 --- a/challenges/bootstrap.json +++ b/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 a4e903847f9bb422132a0752b1f28156d20a820a Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Sat, 22 Aug 2015 19:05:41 +0530 Subject: [PATCH 013/156] Correct Sift through Text with Regular Expressions - Change information text - Change regular expression - Change code in editor - Change assertion --- challenges/basic-javascript.json | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/challenges/basic-javascript.json b/challenges/basic-javascript.json index ac835890ea..82e1dfb639 100644 --- a/challenges/basic-javascript.json +++ b/challenges/basic-javascript.json @@ -999,18 +999,17 @@ "difficulty":"9.984", "description":[ "Regular expressions are used to find certain words or patterns inside of strings.", - "For example, if we wanted to find the number of times the word the occurred in the string The dog chased the cat, we could use the following regular expression: \/the+\/gi", + "For example, if we wanted to find the word the in the string The dog chased the cat, we could use the following regular expression: \/the\/gi", "Let's break this down a bit:", "the is the pattern we want to match.", - "+ means we want to find one or more occurrences of this pattern.", - "g means that we want to search the entire string for this pattern.", + "g means that we want to search the entire string for this pattern instead of just the first match.", "i means that we want to ignore the case (uppercase or lowercase) when searching for the pattern.", - "Regular expressions are usually surrounded by / symbols.", - "Let's try selecting all the occurrences of the word and in the string George Boole and Alan Turing went to the shop and got some milk. We can do this by replacing the .+ part of our regular expression with the current regular expression with the word and." + "Regular expressions are written by surrounding the pattern with a / symbol.", + "Let's try selecting all the occurrences of the word and in the string George Boole and Alan Turing went to the shop and got some milk. We can do this by replacing the ... part of our regular expression with the current regular expression with the word and." ], "tests":[ "assert(test==2, 'Your regular expression should find two occurrences of the word and');", - "assert(editor.getValue().match(/\\/and\\+\\/gi/), 'You should have used regular expressions to find the word and');" + "assert(editor.getValue().match(/\\/and\\/gi/), 'You should have used regular expressions to find the word and');" ], "challengeSeed":[ "var test = (function() {", @@ -1018,7 +1017,7 @@ " var expressionToGetMilk = /milk/gi;", " // Only change code below this line.", "", - " var expression = /.+/gi;", + " var expression = /.../gi;", "", " // Only change code above this line.", " // We use this function to show you the value of your variable in your output box.", From 6c51c018086dd832743a563361b6372ce27569ac Mon Sep 17 00:00:00 2001 From: Aryan Jabbari Date: Sun, 23 Aug 2015 03:42:42 -0400 Subject: [PATCH 014/156] Fixes #1950 using @benschenker's suggested text. --- challenges/object-oriented-and-functional-programming.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/challenges/object-oriented-and-functional-programming.json b/challenges/object-oriented-and-functional-programming.json index c49dd082d8..601ae4cc6f 100644 --- a/challenges/object-oriented-and-functional-programming.json +++ b/challenges/object-oriented-and-functional-programming.json @@ -180,7 +180,8 @@ "  return(val+1);", "});", "", - "The map method is one of the easiest ways to iterate through an array or object there is. Let's use it now." + "The map method is one of the easiest ways to iterate through an array or object there is. Let's use it now.", + "Use the map function to add 3 to every value in the variable `array`" ], "tests":[ "assert.deepEqual(array, [4,5,6,7,8], 'You should have added three to each value in the array');", From 4a149df947b658b51a0f4b883e25fc2c913ff726 Mon Sep 17 00:00:00 2001 From: Aryan Jabbari Date: Sun, 23 Aug 2015 03:47:13 -0400 Subject: [PATCH 015/156] Deleted tab --- challenges/object-oriented-and-functional-programming.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/object-oriented-and-functional-programming.json b/challenges/object-oriented-and-functional-programming.json index 601ae4cc6f..a60fc9fa91 100644 --- a/challenges/object-oriented-and-functional-programming.json +++ b/challenges/object-oriented-and-functional-programming.json @@ -181,7 +181,7 @@ "});", "", "The map method is one of the easiest ways to iterate through an array or object there is. Let's use it now.", - "Use the map function to add 3 to every value in the variable `array`" + "Use the map function to add 3 to every value in the variable `array`" ], "tests":[ "assert.deepEqual(array, [4,5,6,7,8], 'You should have added three to each value in the array');", From 2074fc41ef2af8e215e611ce1fd965399173e2e8 Mon Sep 17 00:00:00 2001 From: Aryan Jabbari Date: Sun, 23 Aug 2015 05:03:52 -0400 Subject: [PATCH 016/156] Replaced backticks with --- challenges/object-oriented-and-functional-programming.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/object-oriented-and-functional-programming.json b/challenges/object-oriented-and-functional-programming.json index a60fc9fa91..97d277c003 100644 --- a/challenges/object-oriented-and-functional-programming.json +++ b/challenges/object-oriented-and-functional-programming.json @@ -181,7 +181,7 @@ "});", "", "The map method is one of the easiest ways to iterate through an array or object there is. Let's use it now.", - "Use the map function to add 3 to every value in the variable `array`" + "Use the map function to add 3 to every value in the variable array" ], "tests":[ "assert.deepEqual(array, [4,5,6,7,8], 'You should have added three to each value in the array');", From 918f57d1c4d50941dc9a64706b9400d23da54d9c Mon Sep 17 00:00:00 2001 From: Aryan Jabbari Date: Sun, 23 Aug 2015 05:19:45 -0400 Subject: [PATCH 017/156] Fixed #1876; fixed some grammar issues; adhered to JS comment conventions --- challenges/basic-javascript.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/challenges/basic-javascript.json b/challenges/basic-javascript.json index 5aeecfdae6..5f6c188555 100644 --- a/challenges/basic-javascript.json +++ b/challenges/basic-javascript.json @@ -670,8 +670,8 @@ "function functionName (a, b) {", "  return(a + b);", "}", - "We can \"call\" our function like this: functionName();, and it will run and return it's return value to us.", - "Create and call a function called myFunction." + "We can \"call\" our function like this: functionName();, and it will run and return its return value to us.", + "Create and call a function called myFunction that returns the sum of a and b." ], "tests":[ "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');" @@ -684,9 +684,9 @@ " return a - b;", "};", "", - "//Don't modify above this line", - "//Create a function called myFunction that returns the value of a plus b.", - " // Only change code below this line.", + "// Don't modify above this line", + "// Create a function called myFunction that returns the value of a plus b.", + "// Only change code below this line.", "", "", "", From fb12e1da401d0de3e6e6e3e87520732f9ec5c688 Mon Sep 17 00:00:00 2001 From: dokkillo Date: Sun, 23 Aug 2015 12:14:03 +0200 Subject: [PATCH 018/156] issue 2308 --- challenges/bootstrap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/bootstrap.json b/challenges/bootstrap.json index 610919a282..c8fa530760 100644 --- a/challenges/bootstrap.json +++ b/challenges/bootstrap.json @@ -177,7 +177,7 @@ "difficulty": 2.03, "description": [ "Now that we're using Bootstrap, we can center our heading elements to make them look better. All we need to do is add the class text-center to our h1 and h2 elements.", - "Remember that you can add several classes to the same element by separating each of them with a space, like this: <h2 class=\"text-red text-center\">your text</h2>." + "Remember that you can add several classes to the same element by separating each of them with a space, like this: <h2 class=\"red-text text-center\">your text</h2>." ], "tests": [ "assert($(\"h2\").hasClass(\"text-center\"), 'Your h2 element should be centered by applying the class text-center')" From af43f9732d4ae812d0599705363595c811e5210c Mon Sep 17 00:00:00 2001 From: Arsen Melikyan Date: Sun, 23 Aug 2015 16:38:38 +0400 Subject: [PATCH 019/156] Fixes a typo #2311 --- challenges/html5-and-css.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/html5-and-css.json b/challenges/html5-and-css.json index e5e376317d..6067e2bb1e 100644 --- a/challenges/html5-and-css.json +++ b/challenges/html5-and-css.json @@ -3281,7 +3281,7 @@ "Let's override your pink-text and blue-text classes, and make your h1 element orange, by giving the h1 element an id and then styling that id.", "Give your h1 element the id attribute of orange-text. Remember, id styles look like this: <h1 id=\"orange-text\">", "Leave the blue-text and pink-text classes on your h1 element.", - "Create a CSS declaration for your orange-text id in your style element. Here's and example of what this looks like: #brown-text { color: brown; }" + "Create a CSS declaration for your orange-text id in your style element. Here's an example of what this looks like: #brown-text { color: brown; }" ], "tests": [ "assert($(\"h1\").hasClass(\"pink-text\"), 'Your h1 element should have the class pink-text.')", From 9bf70f2d745a194b0b6af66abd2fbceb88ad7c1c Mon Sep 17 00:00:00 2001 From: ahstro Date: Sun, 23 Aug 2015 15:18:17 +0200 Subject: [PATCH 020/156] Check all children instead of just one in 'Target Children with jQuery' --- challenges/jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/jquery.json b/challenges/jquery.json index 8576e4bc0d..75de836abf 100644 --- a/challenges/jquery.json +++ b/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 b0d2ac24ec4ff537d89f648dcc707bb0037c6313 Mon Sep 17 00:00:00 2001 From: suhussai Date: Sun, 23 Aug 2015 12:20:28 -0600 Subject: [PATCH 021/156] Typo Fix. Closes #2592 Changed "greater then" to "greater than" in Waypoint 30, http://freecodecamp.com/challenges/waypoint-generate-random-whole-numbers-with-javascript --- challenges/basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/basic-javascript.json b/challenges/basic-javascript.json index 5aeecfdae6..dd7c322d9d 100644 --- a/challenges/basic-javascript.json +++ b/challenges/basic-javascript.json @@ -903,7 +903,7 @@ "tests":[ "assert(typeof(myFunction()) === \"number\", 'The result of myFunction should be a number');", "assert(editor.getValue().match(/Math.random/g), 'You should be using Math.random to create a random number');", - "assert(!(''+myFunction()).match(/\\./g), 'You should have multiplied the result of Math.random by 10 to make it a number that\\'s greater then zero');", + "assert(!(''+myFunction()).match(/\\./g), 'You should have multiplied the result of Math.random by 10 to make it a number that\\'s greater than zero');", "assert(editor.getValue().match(/Math.floor/g), 'You should use Math.floor to remove the decimal part of the number');" ], "challengeSeed":[ From 8704aa9a8dd5a1c621f7ecf7a3b05a9e9284220f Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Mon, 24 Aug 2015 00:22:35 +0100 Subject: [PATCH 022/156] Fix #2605 --- challenges/basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/basic-javascript.json b/challenges/basic-javascript.json index 5aeecfdae6..ea4ec2a0e7 100644 --- a/challenges/basic-javascript.json +++ b/challenges/basic-javascript.json @@ -606,7 +606,7 @@ "Take the myArray array and shift() the first value off of it." ], "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[0] == 23 && d[1][0] == 'dog' && d[1][1] == 3 && d[2] == undefined){return(true);}else{return(false);}})(myArray), 'myArray should only have the last two values left([23, [\"dog\", 3]])');", "assert((function(d){if(d === 'John' && typeof(myRemoved) === 'string'){return(true);}else{return(false);}})(myRemoved), 'myRemoved should contain \"John\"');" ], "challengeSeed": [ From 2e31a9d34341839fdcea57b83a19eccd58f972ee Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Mon, 24 Aug 2015 00:29:34 +0100 Subject: [PATCH 023/156] Added some leniency to the test so that it doesn't require a new line --- challenges/jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/jquery.json b/challenges/jquery.json index 8576e4bc0d..54d1ea88a9 100644 --- a/challenges/jquery.json +++ b/challenges/jquery.json @@ -17,7 +17,7 @@ "assert(editor.match(/