diff --git a/client/commonFramework/update-preview.js b/client/commonFramework/update-preview.js index 14c6ef7329..db6888cadf 100644 --- a/client/commonFramework/update-preview.js +++ b/client/commonFramework/update-preview.js @@ -37,6 +37,56 @@ window.common = (function(global) { /> `; const codeDisabledError = ` diff --git a/seed/bonfireMDNlinks.js b/seed/bonfireMDNlinks.js index d3beb5908d..43e382a176 100644 --- a/seed/bonfireMDNlinks.js +++ b/seed/bonfireMDNlinks.js @@ -79,6 +79,9 @@ var links = { "Array.splice()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice", "Array.toString()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString", + // ======== STATEMENTS AND DECLARATIONS + "Switch Statement": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch", + // ======== MATH METHODS "Math.max()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max", "Math.min()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min", diff --git a/seed/challenges/01-front-end-development-certification/basic-bonfires.json b/seed/challenges/01-front-end-development-certification/basic-bonfires.json index 62f4e71028..630dcbe61e 100644 --- a/seed/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/basic-bonfires.json @@ -644,31 +644,31 @@ "title": "Where do I belong", "description": [ "Return the lowest index at which a value (second argument) should be inserted into an array (first argument) once it has been sorted.", - "For example, where([1,2,3,4], 1.5) should return 1 because it is greater than 1 (index 0), but less than 2 (index 1).", - "Likewise, where([20,3,5], 19) should return 2 because once the array has been sorted it will look like [3,5,20] and 19 is less than 20 (index 2) and greater than 5 (index 1).", + "For example, getIndexToIns([1,2,3,4], 1.5) should return 1 because it is greater than 1 (index 0), but less than 2 (index 1).", + "Likewise, getIndexToIns([20,3,5], 19) should return 2 because once the array has been sorted it will look like [3,5,20] and 19 is less than 20 (index 2) and greater than 5 (index 1).", "Remember to use Read-Search-Ask if you get stuck. Write your own code." ], "challengeSeed": [ - "function where(arr, num) {", + "function getIndexToIns(arr, num) {", " // Find my place in this sorted array.", " return num;", "}", "", - "where([40, 60], 50);" + "getIndexToIns([40, 60], 50);" ], "tests": [ - "assert(where([10, 20, 30, 40, 50], 35) === 3, 'message: where([10, 20, 30, 40, 50], 35) should return 3.');", - "assert(where([10, 20, 30, 40, 50], 30) === 2, 'message: where([10, 20, 30, 40, 50], 30) should return 2.');", - "assert(where([40, 60], 50) === 1, 'message: where([40, 60], 50) should return 1.');", - "assert(where([3, 10, 5], 3) === 0, 'message: where([3, 10, 5], 3) should return 0.');", - "assert(where([5, 3, 20, 3], 5) === 2, 'message: where([5, 3, 20, 3], 5) should return 2.');", - "assert(where([2, 20, 10], 19) === 2, 'message: where([2, 20, 10], 19) should return 2.');", - "assert(where([2, 5, 10], 15) === 3, 'message: where([2, 5, 10], 15) should return 3.');" + "assert(getIndexToIns([10, 20, 30, 40, 50], 35) === 3, 'message: getIndexToIns([10, 20, 30, 40, 50], 35) should return 3.');", + "assert(getIndexToIns([10, 20, 30, 40, 50], 30) === 2, 'message: getIndexToIns([10, 20, 30, 40, 50], 30) should return 2.');", + "assert(getIndexToIns([40, 60], 50) === 1, 'message: getIndexToIns([40, 60], 50) should return 1.');", + "assert(getIndexToIns([3, 10, 5], 3) === 0, 'message: getIndexToIns([3, 10, 5], 3) should return 0.');", + "assert(getIndexToIns([5, 3, 20, 3], 5) === 2, 'message: getIndexToIns([5, 3, 20, 3], 5) should return 2.');", + "assert(getIndexToIns([2, 20, 10], 19) === 2, 'message: getIndexToIns([2, 20, 10], 19) should return 2.');", + "assert(getIndexToIns([2, 5, 10], 15) === 3, 'message: getIndexToIns([2, 5, 10], 15) should return 3.');" ], "type": "bonfire", "isRequired": true, "solutions": [ - "function where(arr, num) {\n arr = arr.sort(function(a, b){return a-b;});\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] >= num)\n {\n return i;\n }\n }\n return arr.length;\n}" + "function getIndexToIns(arr, num) {\n arr = arr.sort(function(a, b){return a-b;});\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] >= num)\n {\n return i;\n }\n }\n return arr.length;\n}" ], "MDNlinks": [ "Array.sort()" diff --git a/seed/challenges/01-front-end-development-certification/basic-javascript.json b/seed/challenges/01-front-end-development-certification/basic-javascript.json index 7dda2fd78a..c50be7961e 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -651,7 +651,7 @@ }, { "id": "56533eb9ac21ba0edf2244af", - "title": "Compound Assignment With +=", + "title": "Compound Assignment With Augmented Addition", "description": [ "In programming, it is common to use assignments to modify the contents of a variable. Remember that everything to the right of the equals sign is evaluated first, so we can say:", "myVar = myVar + 5;", @@ -702,7 +702,7 @@ }, { "id": "56533eb9ac21ba0edf2244b0", - "title": "Compound Assignment With -=", + "title": "Compound Assignment With Augmented Subtraction", "description": [ "Like the += operator, -= subtracts a number from a variable.", "myVar = myVar - 5;", @@ -752,7 +752,7 @@ }, { "id": "56533eb9ac21ba0edf2244b1", - "title": "Compound Assignment With *=", + "title": "Compound Assignment With Augmented Multiplication", "description": [ "The *= operator multiplies a variable by a number.", "myVar = myVar * 5;", @@ -802,7 +802,7 @@ }, { "id": "56533eb9ac21ba0edf2244b2", - "title": "Compound Assignment With /=", + "title": "Compound Assignment With Augmented Division", "description": [ "The /= operator divides a variable by another number.", "myVar = myVar / 5;", @@ -3446,6 +3446,9 @@ "solutions": [ "function myTest(val) {\n var answer = \"\";\n\n switch (val) {\n case 1:\n answer = \"alpha\";\n break;\n case 2:\n answer = \"beta\";\n break;\n case 3:\n answer = \"gamma\";\n break;\n case 4:\n answer = \"delta\";\n }\n return answer; \n}" ], + "MDNlinks": [ + "Switch Statement" + ], "tests": [ "assert(myTest(1) === \"alpha\", 'message: myTest(1) should have a value of \"alpha\"');", "assert(myTest(2) === \"beta\", 'message: myTest(2) should have a value of \"beta\"');", diff --git a/seed/challenges/01-front-end-development-certification/bootstrap.json b/seed/challenges/01-front-end-development-certification/bootstrap.json index 733e1af296..3cf9d1bb58 100644 --- a/seed/challenges/01-front-end-development-certification/bootstrap.json +++ b/seed/challenges/01-front-end-development-certification/bootstrap.json @@ -17,7 +17,7 @@ "To get started, we should nest all of our HTML in a div element with the class container-fluid." ], "challengeSeed": [ - "", + "", "