diff --git a/client/src/pages/learn/javascript-algorithms-and-data-structures/intermediate-javascript-calorie-counter/index.md b/client/src/pages/learn/javascript-algorithms-and-data-structures/intermediate-javascript-calorie-counter/index.md new file mode 100644 index 0000000000..a7652c5181 --- /dev/null +++ b/client/src/pages/learn/javascript-algorithms-and-data-structures/intermediate-javascript-calorie-counter/index.md @@ -0,0 +1,9 @@ +--- +title: Introduction to the Intermediate JavaScript Calorie Counter +block: Intermediate JavaScript Calorie Counter +superBlock: JavaScript Algorithms and Data Structures +isBeta: true +--- +## Introduction to the Intermediate JavaScript Calorie Counter + +This is a stub for the new project-based curriculum. \ No newline at end of file diff --git a/client/utils/challengeTypes.js b/client/utils/challengeTypes.js index ec90df90e1..ad915c4069 100644 --- a/client/utils/challengeTypes.js +++ b/client/utils/challengeTypes.js @@ -134,5 +134,7 @@ exports.helpCategory = { 'python-for-penetration-testing': 'Python', 'css-variables-skyline': 'HTML-CSS', 'basic-javascript-rpg-game': 'JavaScript', - 'functional-programming-spreadsheet': 'JavaScript' + 'functional-programming-spreadsheet': 'JavaScript', + 'intermediate-javascript-calorie-counter': + 'Intermediate JavaScript Calorie Counter' }; diff --git a/curriculum/challenges/_meta/functional-programming-spreadsheet/meta.json b/curriculum/challenges/_meta/functional-programming-spreadsheet/meta.json index 23c482d338..64d24c2afb 100644 --- a/curriculum/challenges/_meta/functional-programming-spreadsheet/meta.json +++ b/curriculum/challenges/_meta/functional-programming-spreadsheet/meta.json @@ -1,7 +1,7 @@ { "name": "Functional Programming Spreadsheet", "dashedName": "functional-programming-spreadsheet", - "order": 12, + "order": 13, "time": "2 hours", "template": "", "required": [], diff --git a/curriculum/challenges/_meta/intermediate-javascript-calorie-counter/meta.json b/curriculum/challenges/_meta/intermediate-javascript-calorie-counter/meta.json new file mode 100644 index 0000000000..aad403e0de --- /dev/null +++ b/curriculum/challenges/_meta/intermediate-javascript-calorie-counter/meta.json @@ -0,0 +1,310 @@ +{ + "name": "Intermediate JavaScript Calorie Counter", + "dashedName": "intermediate-javascript-calorie-counter", + "order": 12, + "time": "2 hours", + "template": "", + "required": [], + "superBlock": "javascript-algorithms-and-data-structures", + "superOrder": 2, + "challengeOrder": [ + [ + "5ddb965c65d27e1512d44d9a", + "Part 01" + ], + [ + "5ddb965c65d27e1512d44d9b", + "Part 02" + ], + [ + "5ddb965c65d27e1512d44d9c", + "Part 03" + ], + [ + "5ddb965c65d27e1512d44d9d", + "Part 04" + ], + [ + "5ddb965c65d27e1512d44d9e", + "Part 05" + ], + [ + "5ddb965c65d27e1512d44d9f", + "Part 06" + ], + [ + "5ddb965c65d27e1512d44da0", + "Part 07" + ], + [ + "5ddb965c65d27e1512d44da1", + "Part 08" + ], + [ + "5ddb965c65d27e1512d44da2", + "Part 09" + ], + [ + "5ddb965c65d27e1512d44da3", + "Part 10" + ], + [ + "5ddb965c65d27e1512d44da4", + "Part 11" + ], + [ + "5ddb965c65d27e1512d44da5", + "Part 12" + ], + [ + "5ddb965c65d27e1512d44da6", + "Part 13" + ], + [ + "5ddb965c65d27e1512d44da7", + "Part 14" + ], + [ + "5ddb965c65d27e1512d44da8", + "Part 15" + ], + [ + "5ddb965c65d27e1512d44da9", + "Part 16" + ], + [ + "5ddb965c65d27e1512d44daa", + "Part 17" + ], + [ + "5ddb965c65d27e1512d44dab", + "Part 18" + ], + [ + "5ddb965c65d27e1512d44dac", + "Part 19" + ], + [ + "5ddb965c65d27e1512d44dad", + "Part 20" + ], + [ + "5ddb965c65d27e1512d44dae", + "Part 21" + ], + [ + "5ddb965c65d27e1512d44daf", + "Part 22" + ], + [ + "5ddb965c65d27e1512d44db0", + "Part 23" + ], + [ + "5ddb965c65d27e1512d44db1", + "Part 24" + ], + [ + "5ddb965c65d27e1512d44db2", + "Part 25" + ], + [ + "5ddb965c65d27e1512d44db3", + "Part 26" + ], + [ + "5ddb965c65d27e1512d44db4", + "Part 27" + ], + [ + "5ddb965c65d27e1512d44db5", + "Part 28" + ], + [ + "5ddb965c65d27e1512d44db6", + "Part 29" + ], + [ + "5ddb965c65d27e1512d44db7", + "Part 30" + ], + [ + "5ddb965c65d27e1512d44db8", + "Part 31" + ], + [ + "5ddb965c65d27e1512d44db9", + "Part 32" + ], + [ + "5ddb965c65d27e1512d44dba", + "Part 33" + ], + [ + "5ddb965c65d27e1512d44dbb", + "Part 34" + ], + [ + "5ddb965c65d27e1512d44dbc", + "Part 35" + ], + [ + "5ddb965c65d27e1512d44dbd", + "Part 36" + ], + [ + "5ddb965c65d27e1512d44dbe", + "Part 37" + ], + [ + "5ddb965c65d27e1512d44dbf", + "Part 38" + ], + [ + "5ddb965c65d27e1512d44dc0", + "Part 39" + ], + [ + "5ddb965c65d27e1512d44dc1", + "Part 40" + ], + [ + "5ddb965c65d27e1512d44dc2", + "Part 41" + ], + [ + "5ddb965c65d27e1512d44dc3", + "Part 42" + ], + [ + "5ddb965c65d27e1512d44dc4", + "Part 43" + ], + [ + "5ddb965c65d27e1512d44dc5", + "Part 44" + ], + [ + "5ddb965c65d27e1512d44dc6", + "Part 45" + ], + [ + "5ddb965c65d27e1512d44dc7", + "Part 46" + ], + [ + "5ddb965c65d27e1512d44dc8", + "Part 47" + ], + [ + "5ddb965c65d27e1512d44dc9", + "Part 48" + ], + [ + "5ddb965c65d27e1512d44dca", + "Part 49" + ], + [ + "5ddb965c65d27e1512d44dcb", + "Part 50" + ], + [ + "5ddb965c65d27e1512d44dcc", + "Part 51" + ], + [ + "5ddb965c65d27e1512d44dcd", + "Part 52" + ], + [ + "5ddb965c65d27e1512d44dce", + "Part 53" + ], + [ + "5ddb965c65d27e1512d44dcf", + "Part 54" + ], + [ + "5ddb965c65d27e1512d44dd0", + "Part 55" + ], + [ + "5ddb965c65d27e1512d44dd1", + "Part 56" + ], + [ + "5ddb965c65d27e1512d44dd2", + "Part 57" + ], + [ + "5ddb965c65d27e1512d44dd3", + "Part 58" + ], + [ + "5ddb965c65d27e1512d44dd4", + "Part 59" + ], + [ + "5ddb965c65d27e1512d44dd5", + "Part 60" + ], + [ + "5ddb965c65d27e1512d44dd6", + "Part 61" + ], + [ + "5ddb965c65d27e1512d44dd7", + "Part 62" + ], + [ + "5ddb965c65d27e1512d44dd8", + "Part 63" + ], + [ + "5ddb965c65d27e1512d44dd9", + "Part 64" + ], + [ + "5ddb965c65d27e1512d44dda", + "Part 65" + ], + [ + "5ddb965c65d27e1512d44ddb", + "Part 66" + ], + [ + "5ddb965c65d27e1512d44ddc", + "Part 67" + ], + [ + "5ddb965c65d27e1512d44ddd", + "Part 68" + ], + [ + "5ddb965c65d27e1512d44dde", + "Part 69" + ], + [ + "5ddb965c65d27e1512d44ddf", + "Part 70" + ], + [ + "5ddb965c65d27e1512d44de0", + "Part 71" + ], + [ + "5ddb965c65d27e1512d44de1", + "Part 72" + ], + [ + "5ddb965c65d27e1512d44de2", + "Part 73" + ], + [ + "5ddb965c65d27e1512d44de3", + "Part 74" + ] + ], + "helpRoom": "Help", + "fileName": "02-javascript-algorithms-and-data-structures/intermediate-javascript-calorie-counter.json" +} \ No newline at end of file diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-javascript-calorie-counter/part-01.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-javascript-calorie-counter/part-01.md new file mode 100644 index 0000000000..8fb9ceef38 --- /dev/null +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-javascript-calorie-counter/part-01.md @@ -0,0 +1,131 @@ +--- +id: 5ddb965c65d27e1512d44d9a +title: Part 01 +challengeType: 0 +isBeta: true +--- + +## Description + + + +When a browser loads a page, it creates a Document Object Model (DOM) representation of the page which includes all of the HTML elements in a tree structure. + +In JavaScript, you can access the DOM by referencing the global `document` object. + +To view the DOM, log it to the console with `console.log(document)`. + + + + + +## Instructions + + + + +## Tests + + +```yml +tests: + - text: See description above for instructions. + testString: assert(code.replace(/\s/g, '').match(/console\.log\(document\)/)); + +``` + + + + +## Challenge Seed + + + + +```html + +``` + + + + +### Before Test + + +```html + + + + + + + + + + + + + Calorie Counter + + Sex + + + + Female (2,000 calories) + + + + + + Male (2,500 calories) + + + + + + Breakfast + Lunch + Dinner + + + Add Entry + + + Calculate + + + Clear + + + + +``` + + + + +### After Test + + +```html + + +``` + + + + + + +## Solution + + +```html + +``` + + diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-javascript-calorie-counter/part-02.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-javascript-calorie-counter/part-02.md new file mode 100644 index 0000000000..884d355d81 --- /dev/null +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-javascript-calorie-counter/part-02.md @@ -0,0 +1,139 @@ +--- +id: 5ddb965c65d27e1512d44d9b +title: Part 02 +challengeType: 0 +isBeta: true +--- + +## Description + + + +In our HTML document, we have a form element with an `id` attribute: `` + +To reference and access this particular form in JavaScript, we can use the getElementById() method on the document and provide the ID. + +The code `document.getElementById('my-form')` gets a reference to an HTML element with an `id` of `my-form`. Get a reference to the HTML element with the `id` of `calorie-form`. + + + +## Instructions + + + + +## Tests + + + +```yml +tests: + - text: See description above for instructions. + testString: assert( code.replace(/\s/g, '').match(/document\.getElementById\([\'\"\`]calorie\-form[\'\"\`]\)/) ); +``` + + + +## Challenge Seed + + + + + +```html + +``` + + + +### Before Test + + + +```html + + + + + + + + + + + + + Calorie Counter + + Sex + + + + Female (2,000 calories) + + + + + + Male (2,500 calories) + + + + + + Breakfast + + Lunch + + Dinner + + + Add Entry + + + Calculate + + + Clear + + + + + + +``` + + + +### After Test + + + +```html +