feat(seed): reformat seed/challenges JSON via repack script
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
14c9ed8974
commit
52ca2b9ad6
@ -968,4 +968,4 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -36,9 +36,7 @@
|
||||
"<hr>",
|
||||
"Try creating one of each type of comment."
|
||||
],
|
||||
"challengeSeed": [
|
||||
""
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"solutions": [
|
||||
"// Fake Comment\n/* Another Comment */"
|
||||
],
|
||||
@ -1054,7 +1052,9 @@
|
||||
" }",
|
||||
"})();"
|
||||
],
|
||||
"solutions": ["var myStr = \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\";"],
|
||||
"solutions": [
|
||||
"var myStr = \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\";"
|
||||
],
|
||||
"tests": [
|
||||
"assert(code.match(/\\\\\"/g).length === 4 && code.match(/[^\\\\]\"/g).length === 2, 'message: You should use two double quotes (<code>"</code>) and four escaped double quotes (<code>\"</code>).');",
|
||||
"assert(myStr === \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\", 'message: Variable myStr should contain the string: <code>I am a \"double quoted\" string inside \"double quotes\".</code>');"
|
||||
@ -1102,7 +1102,9 @@
|
||||
"tail": [
|
||||
"(function() { return \"myStr = \" + myStr; })();"
|
||||
],
|
||||
"solutions": ["var myStr = '<a href=\"http://www.example.com\" target=\"_blank\">Link</a>';"],
|
||||
"solutions": [
|
||||
"var myStr = '<a href=\"http://www.example.com\" target=\"_blank\">Link</a>';"
|
||||
],
|
||||
"tests": [
|
||||
"assert(!/\\\\/g.test(code) && myStr.match('\\\\s*<a href\\\\s*=\\\\s*\"http://www.example.com\"\\\\s*target\\\\s*=\\\\s*\"_blank\">\\\\s*Link\\\\s*</a>\\\\s*'), 'message: Remove all the <code>backslashes</code> (<code>\\</code>)');",
|
||||
"assert(code.match(/\"/g).length === 4 && code.match(/'/g).length === 2, 'message: You should have two single quotes <code>'</code> and four double quotes <code>"</code>');"
|
||||
@ -1393,7 +1395,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"guideUrl":"https://guide.freecodecamp.org/certificates/appending-variables-to-strings"
|
||||
"guideUrl": "https://guide.freecodecamp.org/certificates/appending-variables-to-strings"
|
||||
},
|
||||
{
|
||||
"id": "bd7123c9c448eddfaeb5bdef",
|
||||
@ -2759,7 +2761,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"guideUrl":"https://guide.freecodecamp.org/certificates/assignment-with-a-returned-value"
|
||||
"guideUrl": "https://guide.freecodecamp.org/certificates/assignment-with-a-returned-value"
|
||||
},
|
||||
{
|
||||
"id": "56533eb9ac21ba0edf2244c6",
|
||||
@ -3931,7 +3933,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"guideUrl":"https://guide.freecodecamp.org/certificates/adding-a-default-option-in-switch-statements"
|
||||
"guideUrl": "https://guide.freecodecamp.org/certificates/adding-a-default-option-in-switch-statements"
|
||||
},
|
||||
{
|
||||
"id": "56533eb9ac21ba0edf2244df",
|
||||
@ -4086,9 +4088,7 @@
|
||||
"// Change these values to test",
|
||||
"isLess(10, 15);"
|
||||
],
|
||||
"tail": [
|
||||
""
|
||||
],
|
||||
"tail": [],
|
||||
"solutions": [
|
||||
"function isLess(a, b) {\n return a < b;\n}"
|
||||
],
|
||||
@ -4142,9 +4142,7 @@
|
||||
"// Change values below to test your code",
|
||||
"abTest(2,2);"
|
||||
],
|
||||
"tail": [
|
||||
""
|
||||
],
|
||||
"tail": [],
|
||||
"solutions": [
|
||||
"function abTest(a, b) {\n if(a < 0 || b < 0) {\n return undefined;\n } \n return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));\n}"
|
||||
],
|
||||
@ -4464,7 +4462,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"guideUrl":"https://guide.freecodecamp.org/certificates/accessing-objects-properties-with-variables"
|
||||
"guideUrl": "https://guide.freecodecamp.org/certificates/accessing-objects-properties-with-variables"
|
||||
},
|
||||
{
|
||||
"id": "56bbb991ad1ed5201cd392d1",
|
||||
@ -4756,9 +4754,7 @@
|
||||
"// Test your code by modifying these values",
|
||||
"checkObj(\"gift\");"
|
||||
],
|
||||
"tail": [
|
||||
""
|
||||
],
|
||||
"tail": [],
|
||||
"solutions": [
|
||||
"var myObj = {\n gift: \"pony\",\n pet: \"kitten\",\n bed: \"sleigh\"\n};\nfunction checkObj(checkProp) {\n if(myObj.hasOwnProperty(checkProp)) {\n return myObj[checkProp];\n } else {\n return \"Not Found\";\n }\n}"
|
||||
],
|
||||
@ -4906,7 +4902,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"guideUrl":"https://guide.freecodecamp.org/certificates/accessing-nested-objects-in-json"
|
||||
"guideUrl": "https://guide.freecodecamp.org/certificates/accessing-nested-objects-in-json"
|
||||
},
|
||||
{
|
||||
"id": "56533eb9ac21ba0edf2244cd",
|
||||
@ -4974,7 +4970,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"guideUrl":"https://guide.freecodecamp.org/certificates/access-array-data-with-indexes"
|
||||
"guideUrl": "https://guide.freecodecamp.org/certificates/access-array-data-with-indexes"
|
||||
},
|
||||
{
|
||||
"id": "56533eb9ac21ba0edf2244cf",
|
||||
@ -5379,9 +5375,7 @@
|
||||
"multiplyAll([[1,2],[3,4],[5,6,7]]);",
|
||||
""
|
||||
],
|
||||
"tail": [
|
||||
""
|
||||
],
|
||||
"tail": [],
|
||||
"solutions": [
|
||||
"function multiplyAll(arr) {\n var product = 1;\n for (var i = 0; i < arr.length; i++) {\n for (var j = 0; j < arr[i].length; j++) {\n product *= arr[i][j];\n }\n }\n return product;\n}\n\nmultiplyAll([[1,2],[3,4],[5,6,7]]);"
|
||||
],
|
||||
@ -5450,8 +5444,7 @@
|
||||
],
|
||||
"type": "waypoint",
|
||||
"challengeType": 1,
|
||||
"translations": {
|
||||
}
|
||||
"translations": {}
|
||||
},
|
||||
{
|
||||
"id": "5688e62ea601b2482ff8422b",
|
||||
@ -5839,4 +5832,4 @@
|
||||
"translations": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -423,4 +423,4 @@
|
||||
"translations": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -84,7 +84,6 @@
|
||||
"This exercise is designed to illustrate the difference between how <code>var</code> and <code>let</code> keywords assign scope to the declared variable. When programming a function similar to the one used in this exercise, it is often better to use different variable names to avoid confusion."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"",
|
||||
"function checkScope() {",
|
||||
"\"use strict\";",
|
||||
" var i = \"function scope\";",
|
||||
|
@ -6,20 +6,21 @@
|
||||
"challenges": [
|
||||
{
|
||||
"id": "587d7b8d367417b2b2512b5a",
|
||||
"title": "Introduction to the Functional Programming Challenges",
|
||||
"description": [
|
||||
[
|
||||
"",
|
||||
"",
|
||||
"Functional programming is an approach to software development based around the evaluation of functions. Like mathematics, functions in programming map input to output to produce a result. You can combine basic functions in many ways to build more and more complex programs.<br><br>Functional programming follows a few core principles:<br><br><ul><li>Functions are independent from the state of the program or global variables. They only depend on the arguments passed into them to make a calculation</li><br><li>Functions try to limit any changes to the state of the program and avoid changes to the global objects holding data</li><br><li>Functions have minimal side effects in the program</li></ul><br><br>The functional programming software development approach breaks a program into small, testable parts. This section covers basic functional programming principles in JavaScript.",
|
||||
""
|
||||
] ],
|
||||
"releasedOn": "",
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "Waypoint",
|
||||
"challengeType": 7,
|
||||
"isRequired": false
|
||||
"title": "Introduction to the Functional Programming Challenges",
|
||||
"description": [
|
||||
[
|
||||
"",
|
||||
"",
|
||||
"Functional programming is an approach to software development based around the evaluation of functions. Like mathematics, functions in programming map input to output to produce a result. You can combine basic functions in many ways to build more and more complex programs.<br><br>Functional programming follows a few core principles:<br><br><ul><li>Functions are independent from the state of the program or global variables. They only depend on the arguments passed into them to make a calculation</li><br><li>Functions try to limit any changes to the state of the program and avoid changes to the global objects holding data</li><br><li>Functions have minimal side effects in the program</li></ul><br><br>The functional programming software development approach breaks a program into small, testable parts. This section covers basic functional programming principles in JavaScript.",
|
||||
""
|
||||
]
|
||||
],
|
||||
"releasedOn": "",
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "Waypoint",
|
||||
"challengeType": 7,
|
||||
"isRequired": false
|
||||
},
|
||||
{
|
||||
"id": "587d7b8d367417b2b2512b5b",
|
||||
@ -276,9 +277,9 @@
|
||||
"console.log(fixedValue); // Should print 4"
|
||||
],
|
||||
"tests": [
|
||||
"assert(fixedValue === 4, 'message: Your function <code>incrementer</code> should not change the value of <code>fixedValue</code>.');",
|
||||
"assert(code.match(/function\\s+?incrementer\\s*?\\(.+?\\)/g), 'message: Your <code>incrementer</code> function should take a parameter.');",
|
||||
"assert(newValue === 5, 'message: Your <code>incrementer</code> function should return a value that is one larger than the <code>fixedValue</code> value.');"
|
||||
"assert(fixedValue === 4, 'message: Your function <code>incrementer</code> should not change the value of <code>fixedValue</code>.');",
|
||||
"assert(code.match(/function\\s+?incrementer\\s*?\\(.+?\\)/g), 'message: Your <code>incrementer</code> function should take a parameter.');",
|
||||
"assert(newValue === 5, 'message: Your <code>incrementer</code> function should return a value that is one larger than the <code>fixedValue</code> value.');"
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [],
|
||||
@ -339,9 +340,9 @@
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [
|
||||
"Look at how the functions are called to see the correct order of the parameters.",
|
||||
"Consider using the concat method instead of push.",
|
||||
"The slice method returns a new array without modifying the original."
|
||||
"Look at how the functions are called to see the correct order of the parameters.",
|
||||
"Consider using the concat method instead of push.",
|
||||
"The slice method returns a new array without modifying the original."
|
||||
],
|
||||
"type": "waypoint",
|
||||
"challengeType": 1,
|
||||
@ -990,9 +991,9 @@
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [
|
||||
"Try using .filter() to filter the watchList by Director.",
|
||||
"Try using .map() to return an array of ratings.",
|
||||
"You can use Number() to convert a string into a number."
|
||||
"Try using .filter() to filter the watchList by Director.",
|
||||
"Try using .map() to return an array of ratings.",
|
||||
"You can use Number() to convert a string into a number."
|
||||
],
|
||||
"type": "waypoint",
|
||||
"challengeType": 1,
|
||||
@ -1088,7 +1089,7 @@
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [
|
||||
"The regex pre-defined character class for non-alphanumerics is \\W."
|
||||
"The regex pre-defined character class for non-alphanumerics is \\W."
|
||||
],
|
||||
"type": "waypoint",
|
||||
"challengeType": 1,
|
||||
@ -1123,7 +1124,7 @@
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [
|
||||
"First try to split the given string before applying the join method."
|
||||
"First try to split the given string before applying the join method."
|
||||
],
|
||||
"type": "waypoint",
|
||||
"challengeType": 1,
|
||||
@ -1166,8 +1167,8 @@
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [
|
||||
"When several spaces in a row are split by space, it puts an empty string in the array.",
|
||||
"You can use the .toLowerCase() method to make the title all lower case."
|
||||
"When several spaces in a row are split by space, it puts an empty string in the array.",
|
||||
"You can use the .toLowerCase() method to make the title all lower case."
|
||||
],
|
||||
"type": "waypoint",
|
||||
"challengeType": 1,
|
||||
@ -1273,4 +1274,4 @@
|
||||
"translations": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -1056,7 +1056,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"guideUrl":"https://guide.freecodecamp.org/certificates/arguments-optional"
|
||||
"guideUrl": "https://guide.freecodecamp.org/certificates/arguments-optional"
|
||||
},
|
||||
{
|
||||
"id": "a2f1d72d9b908d0bd72bb9f6",
|
||||
@ -1209,4 +1209,4 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -168,9 +168,7 @@
|
||||
"// Change the inputs below to test",
|
||||
"rot13(\"SERR PBQR PNZC\");"
|
||||
],
|
||||
"tail": [
|
||||
""
|
||||
],
|
||||
"tail": [],
|
||||
"solutions": [
|
||||
"var lookup = {\n 'A': 'N','B': 'O','C': 'P','D': 'Q',\n 'E': 'R','F': 'S','G': 'T','H': 'U',\n 'I': 'V','J': 'W','K': 'X','L': 'Y',\n 'M': 'Z','N': 'A','O': 'B','P': 'C',\n 'Q': 'D','R': 'E','S': 'F','T': 'G',\n 'U': 'H','V': 'I','W': 'J','X': 'K',\n 'Y': 'L','Z': 'M' \n};\n\nfunction rot13(encodedStr) {\n var codeArr = encodedStr.split(\"\"); // String to Array\n var decodedArr = []; // Your Result goes here\n // Only change code below this line\n \n decodedArr = codeArr.map(function(letter) {\n if(lookup.hasOwnProperty(letter)) {\n letter = lookup[letter];\n }\n return letter;\n });\n\n // Only change code above this line\n return decodedArr.join(\"\"); // Array to String\n}"
|
||||
],
|
||||
@ -386,4 +384,4 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -136,7 +136,6 @@
|
||||
"Modify the <code>dog.sayLegs</code> method to remove any references to <code>dog</code>. Use the <code>duck</code> example for guidance."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"",
|
||||
"let dog = {",
|
||||
" name: \"Spot\",",
|
||||
" numLegs: 4,",
|
||||
@ -171,11 +170,7 @@
|
||||
"<hr>",
|
||||
"Create a <code>constructor</code>, <code>Dog</code>, with properties <code>name</code>, <code>color</code>, and <code>numLegs</code> that are set to a string, a string, and a number, respectively."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"tests": [
|
||||
"assert(typeof (new Dog()).name === 'string', 'message: <code>Dog</code> should have a <code>name</code> property set to a string.');",
|
||||
"assert(typeof (new Dog()).color === 'string', 'message: <code>Dog</code> should have a <code>color</code> property set to a string.');",
|
||||
@ -1060,4 +1055,4 @@
|
||||
"translations": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -992,4 +992,4 @@
|
||||
"translations": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user