From 4e645a5ff676b9604de320411cb35234e4d471b2 Mon Sep 17 00:00:00 2001 From: Stuart Taylor Date: Tue, 22 May 2018 13:43:14 +0100 Subject: [PATCH] Package: Validate challenges on test (#17216) This PR allows us to validate the schema during test. It also removes some cruft from the seed files and ensures only the required data is packaged and consumable, reducing the package weight somewhat. --- .../applied-accessibility.json | 22 - .../applied-visual-design.json | 52 -- .../01-responsive-web-design/basic-css.json | 43 -- .../basic-html-and-html5.json | 27 - .../01-responsive-web-design/css-flexbox.json | 17 - .../01-responsive-web-design/css-grid.json | 22 - .../responsive-web-design-projects.json | 10 - .../responsive-web-design.json | 4 - .../basic-algorithm-scripting.json | 16 - .../basic-data-structures.json | 20 - .../basic-javascript.json | 107 ---- .../debugging.json | 12 - .../es6.json | 26 - .../functional-programming.json | 23 - .../intermediate-algorithm-scripting.json | 21 - ...gorithms-and-data-structures-projects.json | 5 - .../object-oriented-programming.json | 26 - .../regular-expressions.json | 32 -- .../03-front-end-libraries/bootstrap.json | 31 -- .../front-end-libraries-projects.json | 5 - challenges/03-front-end-libraries/jquery.json | 18 - challenges/03-front-end-libraries/sass.json | 9 - .../data-visualization-projects.json | 10 - .../data-visualization-with-d3.json | 29 -- .../json-apis-and-ajax.json | 9 - .../apis-and-microservices-projects.json | 5 - .../basic-node-and-express.json | 12 - .../managing-packages-with-npm.json | 10 - .../mongodb-and-mongoose.json | 12 - .../advanced-express-tools.json | 22 - .../helmetjs.json | 14 - ...nce-and-information-security-projects.json | 5 - .../testing-with-chai.json | 24 - .../08-coding-interview-prep/algorithms.json | 9 - .../data-structures.json | 47 -- .../project-euler.json | 480 ------------------ .../rosetta-code.json | 71 --- .../take-home-projects.json | 49 +- .../apis-and-microservices-certificate.json | 1 - .../data-visualization-certificate.json | 1 - .../front-end-libraries-certificate.json | 1 - ...ity-and-quality-assurance-certificate.json | 1 - ...ithms-and-data-structures-certificate.json | 1 - .../legacy-back-end-certificate.json | 1 - ...legacy-data-visualization-certificate.json | 1 - .../legacy-front-end-certificate.json | 1 - .../responsive-web-design-certificate.json | 1 - getChallenges.js | 19 + package.json | 2 +- schema/challengeSchema.js | 30 +- test-challenges.js | 10 + 51 files changed, 49 insertions(+), 1377 deletions(-) diff --git a/challenges/01-responsive-web-design/applied-accessibility.json b/challenges/01-responsive-web-design/applied-accessibility.json index ad12e3bbf5..0725d44ea6 100644 --- a/challenges/01-responsive-web-design/applied-accessibility.json +++ b/challenges/01-responsive-web-design/applied-accessibility.json @@ -23,7 +23,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -65,7 +64,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -120,7 +118,6 @@ "hints": [ "All the h5 tags are siblings, and should be changed to the same new heading level." ], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -173,7 +170,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -220,7 +216,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -287,7 +282,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -357,7 +351,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -432,7 +425,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -527,7 +519,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -593,7 +584,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -674,7 +664,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -758,7 +747,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -849,7 +837,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -918,7 +905,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1001,7 +987,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1122,7 +1107,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1179,7 +1163,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1231,7 +1214,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1284,7 +1266,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1340,7 +1321,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1401,7 +1381,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1497,7 +1476,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, diff --git a/challenges/01-responsive-web-design/applied-visual-design.json b/challenges/01-responsive-web-design/applied-visual-design.json index 333b6e3e8e..4938b0df24 100644 --- a/challenges/01-responsive-web-design/applied-visual-design.json +++ b/challenges/01-responsive-web-design/applied-visual-design.json @@ -29,7 +29,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -95,7 +94,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -162,7 +160,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -237,7 +234,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -316,7 +312,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -390,7 +385,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -468,7 +462,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -543,7 +536,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -626,7 +618,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -699,7 +690,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -779,7 +769,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -857,7 +846,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -940,7 +928,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1038,7 +1025,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1105,7 +1091,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1169,7 +1154,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1209,7 +1193,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1256,7 +1239,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1305,7 +1287,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1353,7 +1334,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1408,7 +1388,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1469,7 +1448,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1537,7 +1515,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1598,7 +1575,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1654,7 +1630,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1704,7 +1679,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1766,7 +1740,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1837,7 +1810,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1932,7 +1904,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -1991,7 +1962,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2069,7 +2039,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2139,7 +2108,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2192,7 +2160,6 @@ "hints": [ "Remember to wrap the address in quotes within the url() function." ], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2230,7 +2197,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2292,7 +2258,6 @@ "hints": [ "Make sure to apply the CSS rule to the hover state of the div, using div:hover" ], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2345,7 +2310,6 @@ "hints": [ "Notice that there is no space between the number and \"deg\" (-32deg) when declaring the degrees value." ], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2394,7 +2358,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2455,7 +2418,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2523,7 +2485,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2617,7 +2578,6 @@ "hints": [ "Make sure the @keyframes rule links to the animation-name." ], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2675,7 +2635,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2726,7 +2685,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "challengeType": 0, "translations": {}, "files": { @@ -2788,7 +2746,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2856,7 +2813,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2918,7 +2874,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2988,7 +2943,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -3092,7 +3046,6 @@ "hints": [ "Check the animation-name declared in the star-1 class to find the right @keyframes rule to change." ], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -3185,7 +3138,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -3275,7 +3227,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -3354,7 +3305,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -3436,7 +3386,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -3504,7 +3453,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, diff --git a/challenges/01-responsive-web-design/basic-css.json b/challenges/01-responsive-web-design/basic-css.json index 6ee6664b1d..c0111d6c94 100644 --- a/challenges/01-responsive-web-design/basic-css.json +++ b/challenges/01-responsive-web-design/basic-css.json @@ -27,7 +27,6 @@ "testString": "assert(code.match(/\\s*CatPhotoApp\\s*<\\/h2>/),' Your style declaration should end with a ; .');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -158,7 +157,6 @@ "testString": "assert(code.match(/<\\/style>/g) && code.match(/<\\/style>/g).length === (code.match(//g) || []).length, 'Make sure all your style elements are valid and have a closing tag.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -298,7 +296,6 @@ "testString": "assert($(\"h2\").attr(\"style\") === undefined, 'Do not use inline style declarations like style=\"color: red\" in your h2 element.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -442,7 +439,6 @@ "testString": "assert($(\"p:eq(0)\").hasClass(\"red-text\"), 'Your first p element should have the class red-text.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -559,7 +555,6 @@ "testString": "assert(code.match(/p\\s*{\\s*font-size\\s*:\\s*16\\s*px\\s*;\\s*}/i), 'Between the style tags, give the p elements font-size of 16px. Browser and Text zoom should be at 100%.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -665,7 +660,6 @@ "testString": "assert($(\"p\").not(\".red-text\").css(\"font-family\").match(/monospace/i), 'Your p elements should use the font monospace.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -796,7 +790,6 @@ "testString": "assert($(\"p\").css(\"font-family\").match(/monospace/i), 'Your p element should still use the font monospace.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -931,7 +924,6 @@ "testString": "assert(new RegExp(\"[^fc]-->\", \"gi\").test(code), 'Be sure to close your comment by adding -->.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -1060,7 +1052,6 @@ "testString": "assert($(\"img\").width() === 100, 'Your image should be 100 pixels wide. Browser zoom should be at 100%.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -1203,7 +1194,6 @@ "testString": "assert($(\"img\").css(\"border-left-color\") === \"rgb(0, 128, 0)\", 'The border around your img element should be green.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -1343,7 +1333,6 @@ "testString": "assert(parseInt($(\"img\").css(\"border-top-left-radius\")) > 8, 'Your image should have a border radius of 10px');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -1471,7 +1460,6 @@ "testString": "assert(code.match(/50%/g), 'Be sure to use a percentage value of 50%.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -1597,7 +1585,6 @@ "testString": "assert($(\"div\").css(\"background-color\") === \"rgb(192, 192, 192)\", 'Your div element should have a silver background.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -1731,7 +1718,6 @@ "testString": "assert($(\"form\").attr(\"id\") === \"cat-photo-form\", 'Give your form element the id of cat-photo-form.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -1887,7 +1873,6 @@ "testString": "assert(!code.match(//gi) && !code.match(//gi), 'Do not give your form any class or style attributes.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -2030,7 +2015,6 @@ "testString": "assert($(\".blue-box\").css(\"padding-top\") === \"20px\", 'Your blue-box class should give elements 20px of padding.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -2150,7 +2134,6 @@ "testString": "assert($(\".blue-box\").css(\"margin-top\") === \"20px\", 'Your blue-box class should give elements 20px of margin.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -2261,7 +2244,6 @@ "testString": "assert($(\".blue-box\").css(\"margin-top\") === \"-15px\", 'Your blue-box class should give elements -15px of margin.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -2382,7 +2364,6 @@ "testString": "assert($(\".blue-box\").css(\"padding-left\") === \"40px\", 'Your blue-box class should give the left of the elements 40px of padding.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -2500,7 +2481,6 @@ "testString": "assert($(\".blue-box\").css(\"margin-left\") === \"40px\", 'Your blue-box class should give the left of elements 40px of margin.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -2622,7 +2602,6 @@ "testString": "assert(!/padding-top|padding-right|padding-bottom|padding-left/.test(code), 'You should use the clockwise notation to set the padding of blue-box class.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -2742,7 +2721,6 @@ "testString": "assert($(\".blue-box\").css(\"margin-left\") === \"40px\", 'Your blue-box class should give the left of elements 40px of margin.');" } ], - "type": "waypoint", "challengeType": 0, "translations": { "de": { @@ -2864,7 +2842,6 @@ ], "solutions": [], "hints": [], - "type": "waypoint", "releasedOn": "Feb 17, 2017", "challengeType": 0, "translations": {}, @@ -2963,7 +2940,6 @@ "testString": "assert(code.match(/\\.red-box\\s*?{\\s*?.*?\\s*?.*?\\s*?padding:\\s*?1\\.5em/gi), 'Your red-box class should give elements 1.5em of padding.');" } ], - "type": "waypoint", "challengeType": 0, "translations": {}, "files": { @@ -3038,7 +3014,6 @@ "testString": "assert(code.match(/