diff --git a/README.md b/README.md index 0307641300..092c5b76e9 100644 --- a/README.md +++ b/README.md @@ -60,24 +60,32 @@ touch .env ``` -Edit your .env file with the following API keys accordingly (if you only use email login, only the MONGOHQ_URL, SESSION_SECRET, MANDRILL_USER and MANDRILL_PASSWORD fields are necessary: +Edit your .env file with the following API keys accordingly (if you only use email login, only the MONGOHQ_URL, SESSION_SECRET, MANDRILL_USER and MANDRILL_PASSWORD fields are necessary. Keep in mind if you want to use more services you'll have to get your own API keys for those services. ``` MONGOHQ_URL='mongodb://localhost:27017/freecodecamp' -SESSION_SECRET='ANY ENGLISH PHRASE' -MANDRILL_USER='THE EMAIL ADDRESS FROM YOUR MANDRILL ACCOUNT' -MANDRILL_PASSWORD='YOUR MANDRILL PASSWORD' -FACEBOOK_ID='FACEBOOK APP API KEY' -FACEBOOK_SECRET='FACEBOOK SECRET' -GITHUB_ID='GITHUB APP API KEY' -GITHUB_SECRET='GITHUB APP SECRET' -TWITTER_KEY='TWITTER APP API KEY' -TWITTER_SECRET='TWITTER APP SECRET' -GOOGLE_ID='GOOGLE APP API KEY' -GOOGLE_SECRET='GOOGLE APP SECRET' -LINKEDIN_ID='LINKEDIN APP API KEY' -LINKEDIN_SECRET='LINKEDIN APP SECRET' +BLOGGER_KEY=stuff +FACEBOOK_ID=stuff +FACEBOOK_SECRET=stuff +GITHUB_ID=stuff +GITHUB_SECRET=stuff +GOOGLE_ID=stuff +GOOGLE_SECRET=stuff +LINKEDIN_ID=stuff +LINKEDIN_SECRET=stuff +MANDRILL_PASSWORD=stuff +MANDRILL_USER=stuff +SESSION_SECRET=secretstuff +TRELLO_KEY=stuff +TRELLO_SECRET=stuff +TWITTER_KEY=stuff +TWITTER_SECRET=stuff +TWITTER_TOKEN=stuff +TWITTER_TOKEN_SECRET=stuff +SLACK_WEBHOOK=stuff +PEER=stuff +DEBUG=true ``` diff --git a/models/Challenge.js b/models/Challenge.js index bb4cfcd954..35d4a2c293 100644 --- a/models/Challenge.js +++ b/models/Challenge.js @@ -16,7 +16,17 @@ var challengeSchema = new mongoose.Schema({ tests: Array, challengeSeed: Array, challengeType: Number, // 0 = html, 1 = javascript only, 2 = video, 3 = zipline, 4 = basejump - MDNlinks: Array + MDNlinks: Array, + nameCn: String, + descriptionCn: Array, + nameFr: String, + descriptionFr: Array, + nameRu: String, + descriptionRu: Array, + nameEs: String, + descriptionEs: Array, + namePt: String, + descriptionPt: Array }); module.exports = mongoose.model('Challenge', challengeSchema); diff --git a/public/css/main.less b/public/css/main.less index 2b9fa9d826..2a5cf1f433 100644 --- a/public/css/main.less +++ b/public/css/main.less @@ -1087,6 +1087,19 @@ hr { color: @gray-light; } +@media only screen and (min-width: 993px) { + .iframe-scroll { + position: fixed !important; + margin-top: 75px; + } +} +@media only screen and (max-width: 992px) { + .iframe-scroll { + height: auto; + overflow: auto; + } +} + //uncomment this to see the dimensions of all elements outlined in red //* { // border-color: red; diff --git a/public/js/lib/coursewares/coursewaresHCJQFramework_0.1.3.js b/public/js/lib/coursewares/coursewaresHCJQFramework_0.1.3.js deleted file mode 100644 index c57817eca5..0000000000 --- a/public/js/lib/coursewares/coursewaresHCJQFramework_0.1.3.js +++ /dev/null @@ -1,154 +0,0 @@ -/** - * Created by nathanleniz on 2/2/15. - */ - -var widgets = []; -var editor = CodeMirror.fromTextArea(document.getElementById("codeEditor"), { - lineNumbers: true, - mode: "text/html", - theme: 'monokai', - runnable: true, - matchBrackets: true, - autoCloseBrackets: true, - scrollbarStyle: 'null', - lineWrapping: true, - gutters: ["CodeMirror-lint-markers"], - onKeyEvent: doLinting -}); - - -// Hijack tab key to insert two spaces instead -editor.setOption("extraKeys", { - Tab: function(cm) { - if (cm.somethingSelected()){ - cm.indentSelection("add"); - } else { - var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); - cm.replaceSelection(spaces); - } - }, - "Shift-Tab": function(cm) { - if (cm.somethingSelected()){ - cm.indentSelection("subtract"); - } else { - var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); - cm.replaceSelection(spaces); - } - } -}); - -editor.setSize("100%", "auto"); - -var libraryIncludes = "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - ""; - -var allTests = ''; -(function() { - tests.forEach(function(elem) { - allTests += elem + ' '; - }); -})(); - -var otherTestsForNow = ""; - -var delay; -// Initialize CodeMirror editor with a nice html5 canvas demo. -editor.on("change", function () { - clearTimeout(delay); - delay = setTimeout(updatePreview, 300); -}); -var nodeEnv = prodOrDev === 'production' ? 'http://www.freecodecamp.com' : 'http://localhost:3001'; -function updatePreview() { - goodTests = 0; - var previewFrame = document.getElementById('preview'); - var preview = previewFrame.contentDocument || previewFrame.contentWindow.document; - preview.open(); - $('#testSuite').empty(); - preview.write(libraryIncludes + editor.getValue() + otherTestsForNow); - preview.close(); - -} -setTimeout(updatePreview, 300); - -/** - * "post" methods - */ - -var postSuccess = function(data) { - var testDoc = document.createElement("div"); - $(testDoc) - .html("
" + JSON.parse(data) + "
") - .appendTo($('#testSuite')); - testSuccess(); -}; - -var postError = function(data) { - var testDoc = document.createElement("div"); - $(testDoc) - .html("
" + JSON.parse(data) + "
") - .prependTo($('#testSuite')) -}; -var goodTests = 0; -var testSuccess = function() { - goodTests++; - if (goodTests === tests.length) { - showCompletion(); - } -}; -var challengeSeed = challengeSeed || null; -var tests = tests || []; -var allSeeds = ''; -(function() { - challengeSeed.forEach(function(elem) { - allSeeds += elem.replace(/fccss/g, '') + '\n'; - }); - editor.setValue(allSeeds); -})(); - - -function doLinting () { - editor.operation(function () { - for (var i = 0; i < widgets.length; ++i) - editor.removeLineWidget(widgets[i]); - widgets.length = 0; - JSHINT(editor.getValue()); - for (var i = 0; i < JSHINT.errors.length; ++i) { - var err = JSHINT.errors[i]; - if (!err) continue; - var msg = document.createElement("div"); - var icon = msg.appendChild(document.createElement("span")); - icon.innerHTML = "!!"; - icon.className = "lint-error-icon"; - msg.appendChild(document.createTextNode(err.reason)); - msg.className = "lint-error"; - widgets.push(editor.addLineWidget(err.line - 1, msg, { - coverGutter: false, - noHScroll: true - })); - } - }); -}; - -//$('#testSuite').empty(); -function showCompletion() { - var time = Math.floor(Date.now()) - started; - ga('send', 'event', 'Challenge', 'solved', challenge_Name + ', Time: ' + time); - $('#next-courseware-button').removeAttr('disabled'); - $('#next-courseware-button').addClass('animated tada'); - if (!userLoggedIn) { - $('#complete-courseware-dialog').modal('show'); - } - $('body').keydown(function(e) { - if (e.ctrlKey && e.keyCode == 13) { - $('#next-courseware-button').click(); - $('#next-courseware-button').unbind('click'); - } - }); -} diff --git a/public/js/lib/coursewares/coursewaresHCJQFramework_0.1.7.js b/public/js/lib/coursewares/coursewaresHCJQFramework_0.1.7.js new file mode 100644 index 0000000000..df3bced07a --- /dev/null +++ b/public/js/lib/coursewares/coursewaresHCJQFramework_0.1.7.js @@ -0,0 +1,155 @@ +/** + * Created by nathanleniz on 2/2/15. + */ + +var widgets = []; +var editor = CodeMirror.fromTextArea(document.getElementById("codeEditor"), { + lineNumbers: true, + mode: "text/html", + theme: 'monokai', + runnable: true, + matchBrackets: true, + autoCloseBrackets: true, + scrollbarStyle: 'null', + lineWrapping: true, + gutters: ["CodeMirror-lint-markers"], + onKeyEvent: doLinting +}); + + +// Hijack tab key to insert two spaces instead +editor.setOption("extraKeys", { + Tab: function(cm) { + if (cm.somethingSelected()){ + cm.indentSelection("add"); + } else { + var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); + cm.replaceSelection(spaces); + } + }, + "Shift-Tab": function(cm) { + if (cm.somethingSelected()){ + cm.indentSelection("subtract"); + } else { + var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); + cm.replaceSelection(spaces); + } + } +}); + +editor.setSize("100%", "auto"); + +var libraryIncludes = "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + ""; + + +var editorValueForIFrame; +var iFrameScript = ""; + +var delay; +// Initialize CodeMirror editor with a nice html5 canvas demo. +editor.on("keyup", function () { + clearTimeout(delay); + delay = setTimeout(updatePreview, 300); +}); + +var nodeEnv = prodOrDev === 'production' ? 'http://www.freecodecamp.com' : 'http://localhost:3001'; +function updatePreview() { + editorValueForIFrame = editor.getValue(); + goodTests = 0; + var previewFrame = document.getElementById('preview'); + var preview = previewFrame.contentDocument || previewFrame.contentWindow.document; + preview.open(); + $('#testSuite').empty(); + preview.write(libraryIncludes + editor.getValue() + iFrameScript); + preview.close(); + +} +setTimeout(updatePreview, 300); + +/** + * "post" methods + */ + +var postSuccess = function(data) { + var testDoc = document.createElement("div"); + $(testDoc) + .html("
" + JSON.parse(data) + "
") + .appendTo($('#testSuite')); + testSuccess(); +}; + +var postError = function(data) { + var testDoc = document.createElement("div"); + $(testDoc) + .html("
" + JSON.parse(data) + "
") + .prependTo($('#testSuite')) +}; +var goodTests = 0; +var testSuccess = function() { + goodTests++; + if (goodTests === tests.length) { + showCompletion(); + } +}; +var challengeSeed = challengeSeed || null; +var allSeeds = ''; +(function() { + challengeSeed.forEach(function(elem) { + allSeeds += elem.replace(/fccss/g, '') + '\n'; + }); + editor.setValue(allSeeds); + (function() { + setTimeout(function() { + editor.refresh(); + }, 200); + })(); +})(); + + +function doLinting () { + editor.operation(function () { + for (var i = 0; i < widgets.length; ++i) + editor.removeLineWidget(widgets[i]); + widgets.length = 0; + JSHINT(editor.getValue()); + for (var i = 0; i < JSHINT.errors.length; ++i) { + var err = JSHINT.errors[i]; + if (!err) continue; + var msg = document.createElement("div"); + var icon = msg.appendChild(document.createElement("span")); + icon.innerHTML = "!!"; + icon.className = "lint-error-icon"; + msg.appendChild(document.createTextNode(err.reason)); + msg.className = "lint-error"; + widgets.push(editor.addLineWidget(err.line - 1, msg, { + coverGutter: false, + noHScroll: true + })); + } + }); +}; + +//$('#testSuite').empty(); +function showCompletion() { + var time = Math.floor(Date.now()) - started; + ga('send', 'event', 'Challenge', 'solved', challenge_Name + ', Time: ' + time); + $('#next-courseware-button').removeAttr('disabled'); + $('#next-courseware-button').addClass('animated tada'); + if (!userLoggedIn) { + $('#complete-courseware-dialog').modal('show'); + } + $('body').keydown(function(e) { + if (e.ctrlKey && e.keyCode == 13) { + $('#next-courseware-button').click(); + $('#next-courseware-button').unbind('click'); + } + }); +} diff --git a/public/js/lib/coursewares/iFrameScripts_0.0.2.js b/public/js/lib/coursewares/iFrameScripts_0.0.2.js deleted file mode 100644 index 5856d50b19..0000000000 --- a/public/js/lib/coursewares/iFrameScripts_0.0.2.js +++ /dev/null @@ -1,19 +0,0 @@ -(function() { - var expect = chai.expect; - var tests = parent.tests; - - for (var i = 0; i < tests.length; i++) { - var thisTest = true; - try { - eval(parent.tests[i]); - } catch (err) { - allTestsGood = false; - thisTest = false; - parent.postError(JSON.stringify(err.message.split(':').shift())); - } finally { - if (thisTest) { - parent.postSuccess(JSON.stringify(tests[i].split(',').pop().replace(/\'/g, '').replace(/\)/, ''))); - } - } - } -})(); diff --git a/public/js/lib/coursewares/iFrameScripts_0.0.4.js b/public/js/lib/coursewares/iFrameScripts_0.0.4.js new file mode 100644 index 0000000000..7691582f4a --- /dev/null +++ b/public/js/lib/coursewares/iFrameScripts_0.0.4.js @@ -0,0 +1,20 @@ +(function() { + var expect = chai.expect; + var tests = parent.tests; + var editor = parent.editorValueForIFrame; + + for (var i = 0; i < tests.length; i++) { + var thisTest = true; + try { + eval(parent.tests[i]); + } catch (err) { + allTestsGood = false; + thisTest = false; + parent.postError(JSON.stringify(err.message.split(':').shift())); + } finally { + if (thisTest) { + parent.postSuccess(JSON.stringify(tests[i].split(',').pop().replace(/\'/g, '').replace(/\)/, ''))); + } + } + } +})(); diff --git a/seed_data/challenges/advanced-bonfires.json b/seed_data/challenges/advanced-bonfires.json index 50829b7473..eefd2d60ff 100644 --- a/seed_data/challenges/advanced-bonfires.json +++ b/seed_data/challenges/advanced-bonfires.json @@ -1,6 +1,6 @@ { "name": "Advanced Algorithm Scripting", - "order" : 0.011, + "order": 0.011, "challenges": [ { "_id": "aff0395860f5d3034dc0bfc9", @@ -47,8 +47,20 @@ "", "telephoneCheck(\"555-555-5555\");" ], - "MDNlinks" : ["RegExp"], - "challengeType": 5 + "MDNlinks": [ + "RegExp" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a3f503de51cf954ede28891d", @@ -72,15 +84,30 @@ "assert.deepEqual(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], 'should return an array of unique values');", "assert.deepEqual(sym([1, 1]), [1], 'should return an array of unique values');" ], - "MDNlinks" : ["Array.reduce()"], - "challengeType": 5 + "MDNlinks": [ + "Array.reduce()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "aa2e6f85cab2ab736c9a9b24", - "name": "Bonfire: Cash Register", + "name": "Bonfire: Exact Change", "difficulty": "4.03", "description": [ - "Design a cash register drawer function that accepts purchase price as the first argument, payment as the second argument, and cash-in-drawer (cid) as the third argument.", "cid is a 2d array listing available currency.", "Return the string \"Insufficient Funds\" if cash-in-drawer is less than the change due. Return the string \"Closed\" if cash-in-drawer is equal to the change due.", "Otherwise, return change in coin and bills, sorted in highest to lowest order.", + "Design a cash register drawer function that accepts purchase price as the first argument, payment as the second argument, and cash-in-drawer (cid) as the third argument.", + "cid is a 2d array listing available currency.", + "Return the string \"Insufficient Funds\" if cash-in-drawer is less than the change due. Return the string \"Closed\" if cash-in-drawer is equal to the change due.", + "Otherwise, return change in coin and bills, sorted in highest to lowest order.", "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." ], "challengeSeed": [ @@ -112,8 +139,20 @@ "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'Insufficient Funds', 'insufficient funds');", "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), \"Closed\", 'cash-in-drawer equals change');" ], - "MDNlinks" : ["Global Object"], - "challengeType": 5 + "MDNlinks": [ + "Global Object" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a56138aff60341a09ed6c480", @@ -154,8 +193,20 @@ "assert.deepEqual(inventory([], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[67, 'Bowling Ball'], [2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [7, 'Toothpaste']]);", "assert.deepEqual(inventory([[0, 'Bowling Ball'], [0, 'Dirty Sock'], [0, 'Hair Pin'], [0, 'Microphone']], [[1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [1, 'Bowling Ball'], [1, 'Toothpaste']]), [[1, 'Bowling Ball'], [0, 'Dirty Sock'], [1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [0, 'Microphone'], [1, 'Toothpaste']]);" ], - "MDNlinks" : ["Global Array Object"], - "challengeType": 5 + "MDNlinks": [ + "Global Array Object" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a7bf700cd123b9a54eef01d5", @@ -182,8 +233,21 @@ "expect(permAlone('abfdefa')).to.equal(2640);", "expect(permAlone('zzzzzzzz')).to.equal(0);" ], - "MDNlinks" : ["Permutations", "RegExp"], - "challengeType": 5 + "MDNlinks": [ + "Permutations", + "RegExp" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a19f0fbe1872186acd434d5a", @@ -212,8 +276,22 @@ "assert.deepEqual(friendly(['2017-01-01', '2017-01-01']), ['January 1st, 2017'], 'since we do not duplicate only return once');", "assert.deepEqual(friendly(['2022-09-05', '2023-09-04']), ['September 5th, 2022','September 4th, 2023']);" ], - "MDNlinks": ["String.split()", "String.substr()", "parseInt()"], - "challengeType": 5 + "MDNlinks": [ + "String.split()", + "String.substr()", + "parseInt()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] } ] -} +} \ No newline at end of file diff --git a/seed_data/challenges/basejumps.json b/seed_data/challenges/basejumps.json index c96b49c00a..aa8cac1acc 100644 --- a/seed_data/challenges/basejumps.json +++ b/seed_data/challenges/basejumps.json @@ -1,6 +1,6 @@ { "name": "Full Stack JavaScript Projects", - "order" : 0.014, + "order": 0.014, "challenges": [ { "_id": "bd7158d8c443eddfaeb5bcef", @@ -60,7 +60,7 @@ "You can push these new commits to GitHub by running git push origin master, and to Heroku by running grunt --force && grunt buildcontrol:heroku.", "Now you're ready to move on to your first Basejump. Click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku. If you pair programmed with a friend, enter his or her Free Code Camp username as well so that you both get credit for completing it." ], - "challengeType": 4, + "challengeType": 2, "tests": [] }, { @@ -86,7 +86,17 @@ "If you'd like immediate feedback on your project, click this button and paste in a link to your Heroku project. Otherwise, we'll review it before you start your nonprofit projects.

Click here then add your link to your tweet's text" ], "challengeType": 4, - "tests": [] + "tests": [], + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bd7158d8c443eddfaeb5bdff", @@ -107,7 +117,17 @@ "If you'd like immediate feedback on your project, click this button and paste in a link to your Heroku project. Otherwise, we'll review it before you start your nonprofit projects.

Click here then add your link to your tweet's text" ], "challengeType": 4, - "tests": [] + "tests": [], + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bd7158d8c443eddfaeb5bd0e", @@ -128,7 +148,17 @@ "If you'd like immediate feedback on your project, click this button and paste in a link to your Heroku project. Otherwise, we'll review it before you start your nonprofit projects.

Click here then add your link to your tweet's text" ], "challengeType": 4, - "tests": [] + "tests": [], + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bd7158d8c443eddfaeb5bd0f", @@ -149,7 +179,17 @@ "If you'd like immediate feedback on your project, click this button and paste in a link to your Heroku project. Otherwise, we'll review it before you start your nonprofit projects.

Click here then add your link to your tweet's text" ], "challengeType": 4, - "tests": [] + "tests": [], + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bd7158d8c443eddfaeb5bdee", @@ -173,7 +213,17 @@ "If you'd like immediate feedback on your project, click this button and paste in a link to your Heroku project. Otherwise, we'll review it before you start your nonprofit projects.

Click here then add your link to your tweet's text" ], "challengeType": 4, - "tests": [] + "tests": [], + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] } ] } diff --git a/seed_data/challenges/basic-bonfires.json b/seed_data/challenges/basic-bonfires.json index b35ce5c45b..9053cde115 100644 --- a/seed_data/challenges/basic-bonfires.json +++ b/seed_data/challenges/basic-bonfires.json @@ -1,6 +1,6 @@ { "name": "Basic Algorithm Scripting", - "order" : 0.007, + "order": 0.007, "challenges": [ { "_id": "bd7139d8c441eddfaeb5bdef", @@ -19,15 +19,24 @@ "Add them as a new contact in Screen Hero, then click the monitor-looking button to attempt to share your screen with them.", "Once the Screen Hero session starts, your screen's margins will glow orange. You are now sharing your screen.", "Your pair will have their own cursor, and will be able to type text on his or her and keyboard.", - "Now it's time to tackle our Bonfires.", - "Go to http://freecodecamp.com/bonfires and start working through our Bonfire challenges.", + "Now it's time to tackle our Bonfires. You can begin them by advancing to the next challenge.", "Once you you finish pair programming, end the session in Screen Hero session.", "Congratulations! You have completed your first pair programming session.", "Pair program as much as possible with different campers until you've completed all the Bonfire challenges. This is a big time investment, but the JavaScript practice you get will be well worth it!", "Mark this Waypoint complete and move on." ], "challengeType": 2, - "tests": [] + "tests": [], + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "ad7123c8c441eddfaeb5bdef", @@ -56,7 +65,17 @@ "", "meetBonfire(\"You can do this!\");" ], - "challengeType": 5 + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a202eed8fc186c8434cb6d61", @@ -81,8 +100,23 @@ "", "reverseString('hello');" ], - "MDNlinks": ["Global String Object", "String.split()", "Array.reverse()", "Array.join()"], - "challengeType": 5 + "MDNlinks": [ + "Global String Object", + "String.split()", + "Array.reverse()", + "Array.join()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a302f7aae1aa3152a5b413bc", @@ -108,8 +142,20 @@ "", "factorialize(5);" ], - "MDNlinks": ["Arithmetic Operators"], - "challengeType": 5 + "MDNlinks": [ + "Arithmetic Operators" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "aaa48de84e1ecc7c742e1124", @@ -141,8 +187,21 @@ "", "palindrome(\"eye\");" ], - "MDNlinks": ["String.replace()", "String.toLowerCase()"], - "challengeType": 5 + "MDNlinks": [ + "String.replace()", + "String.toLowerCase()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a26cbbe9ad8655a977e1ceb5", @@ -167,8 +226,21 @@ "expect(findLongestWord('Google do a barrel roll')).to.equal(6);", "expect(findLongestWord('What is the average airspeed velocity of an unladen swallow')).to.equal(8);" ], - "MDNlinks": ["String.split()", "String.length"], - "challengeType": 5 + "MDNlinks": [ + "String.split()", + "String.length" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "ab6137d4e35944e21037b769", @@ -192,8 +264,20 @@ "expect(titleCase(\"sHoRt AnD sToUt\")).to.equal(\"Short And Stout\");", "expect(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\")).to.equal(\"Here Is My Handle Here Is My Spout\");" ], - "MDNlinks": ["String.charAt()"], - "challengeType": 5 + "MDNlinks": [ + "String.charAt()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a789b3483989747d63b0e427", @@ -218,8 +302,20 @@ "(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])).should.eql([5,27,39,1001]);", "assert(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]).should.eql([9,35,97,1000000]));" ], - "MDNlinks": ["Comparison Operators"], - "challengeType": 5 + "MDNlinks": [ + "Comparison Operators" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "acda2fb1324d9b0fa741e6b5", @@ -229,7 +325,6 @@ "Check if a string (first argument) ends with the given target string (second argument).", "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." ], - "challengeSeed": [ "function end(str, target) {", " // \"Never give up and good luck will find you.\"", @@ -244,8 +339,20 @@ "assert.strictEqual(end('He has to give me a new name', 'name'), true, 'should equal true if target equals end of string');", "assert.strictEqual(end('If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing', 'mountain'), false, 'should equal false if target does not equal end of string');" ], - "MDNlinks": ["String.substr()"], - "challengeType": 5 + "MDNlinks": [ + "String.substr()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "afcc8d540bea9ea2669306b6", @@ -268,8 +375,20 @@ "assert.strictEqual(repeat('abc', 3), 'abcabcabc', 'should repeat a string n times');", "assert.strictEqual(repeat('abc', -2), '', 'should return an empty string for negative numbers');" ], - "MDNlinks": ["Global String Object"], - "challengeType": 5 + "MDNlinks": [ + "Global String Object" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "ac6993d51946422351508a41", @@ -293,8 +412,20 @@ "assert(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length) === 'A-tisket a-tasket A green and yellow basket', 'should not truncate if string is = length');", "assert.strictEqual(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2), 'A-tisket a-tasket A green and yellow basket', 'should not truncate if string is < length');" ], - "MDNlinks": ["String.slice()"], - "challengeType": 5 + "MDNlinks": [ + "String.slice()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a9bd25c716030ec90084d8a1", @@ -315,10 +446,23 @@ "tests": [ "assert.deepEqual(chunk(['a', 'b', 'c', 'd'], 2), [['a', 'b'], ['c', 'd']], 'should return chunked arrays');", "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'should return chunked arrays');", + "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], 'should return chunked arrays');", "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'should return the last chunk as remaining elements');" ], - "MDNlinks": ["Array.push()"], - "challengeType": 5 + "MDNlinks": [ + "Array.push()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "ab31c21b530c0dafa9e241ee", @@ -341,8 +485,21 @@ "assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], 'should return all elements when n < 1');", "assert.deepEqual(slasher([1, 2, 3], 9), [], 'should return an empty array when n >= array.length');" ], - "MDNlinks": ["Array.slice()", "Array.splice()"], - "challengeType": 5 + "MDNlinks": [ + "Array.slice()", + "Array.splice()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "af2170cad53daa0770fabdea", @@ -371,8 +528,20 @@ "expect(mutation(['Mary', 'Aarmy'])).to.be.false;", "expect(mutation(['Alien', 'line'])).to.be.true;" ], - "MDNlinks": ["Array.sort()"], - "challengeType": 5 + "MDNlinks": [ + "Array.sort()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "adf08ec01beb4f99fc7a68f2", @@ -396,14 +565,27 @@ "assert.deepEqual(bouncer(['a', 'b', 'c']), ['a', 'b', 'c'], 'should return full array if no falsey elements');", "assert.deepEqual(bouncer([false, null, 0]), [], 'should return empty array if all elements are falsey');" ], - "MDNlinks": ["Boolean Objects", "Array.filter()"], - "challengeType": 5 + "MDNlinks": [ + "Boolean Objects", + "Array.filter()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { - "_id":"a8e512fbe388ac2f9198f0fa", + "_id": "a8e512fbe388ac2f9198f0fa", "name": "Bonfire: Where art thou", - "difficulty":"1.55", - "description":[ + "difficulty": "1.55", + "description": [ "Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).", "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." ], @@ -416,18 +598,32 @@ "", "where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });" ], - "tests":[ + "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');" ], - "MDNlinks": ["Global Object", "Object.hasOwnProperty()", "Object.keys()"], - "challengeType": 5 + "MDNlinks": [ + "Global Object", + "Object.hasOwnProperty()", + "Object.keys()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { - "_id":"a39963a4c10bc8b4d4f06d7e", + "_id": "a39963a4c10bc8b4d4f06d7e", "name": "Bonfire: Seek and Destroy", - "difficulty":"1.60", - "description":[ + "difficulty": "1.60", + "description": [ "You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.", "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." ], @@ -443,8 +639,21 @@ "assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1], 'should remove correct values from an array');", "assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], 'should remove correct values from an array');" ], - "MDNlinks": ["Arguments object","Array.filter()"], - "challengeType": 5 + "MDNlinks": [ + "Arguments object", + "Array.filter()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a24c1a4622e3c05097f71d67", @@ -463,12 +672,24 @@ "", "where([40, 60], 50);" ], - "MDNlinks" : ["Array.sort()"], + "MDNlinks": [ + "Array.sort()" + ], "tests": [ "expect(where([10, 20, 30, 40, 50], 35)).to.equal(3);", "expect(where([10, 20, 30, 40, 50], 30)).to.equal(2);" ], - "challengeType": 5 + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a3566b1109230028080c9345", @@ -493,8 +714,22 @@ "expect(sumAll([5, 10])).to.equal(45);", "expect(sumAll([10, 5])).to.equal(45);" ], - "MDNlinks": ["Math.max()", "Math.min()", "Array.reduce()"], - "challengeType": 5 + "MDNlinks": [ + "Math.max()", + "Math.min()", + "Array.reduce()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a5de63ebea8dbee56860f4f2", @@ -522,9 +757,24 @@ "assert.includeMembers(diff([1, 'calf', 3, 'piglet'], [1, 'calf', 3, 4]), ['piglet', 4], 'arrays with numbers and strings');", "assert.deepEqual(diff([], ['snuffleupagus', 'cookie monster', 'elmo']), ['snuffleupagus', 'cookie monster', 'elmo'], 'empty array');" ], - "MDNlinks" : ["Comparison Operators", "String.slice()", "Array.filter()", "Array.indexOf()", "String.concat()"], - "challengeType": 5 - + "MDNlinks": [ + "Comparison Operators", + "String.slice()", + "Array.filter()", + "Array.indexOf()", + "String.concat()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a7f4d8f2483413a6ce226cac", @@ -549,8 +799,22 @@ "", "convert(36);" ], - "MDNlinks": ["Array.splice()", "Array.indexOf()", "Array.join()"], - "challengeType": 5 + "MDNlinks": [ + "Array.splice()", + "Array.indexOf()", + "Array.join()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a0b5010f579e69b815e7c5d6", @@ -578,8 +842,22 @@ "", "replace(\"A quick brown fox jumped over the lazy dog\", \"jumped\", \"leaped\");" ], - "MDNlinks": ["Array.splice()", "String.replace()", "Array.join()"], - "challengeType": 5 + "MDNlinks": [ + "Array.splice()", + "String.replace()", + "Array.join()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "aa7697ea2477d1316795783b", @@ -605,8 +883,24 @@ "", "translate(\"consonant\");" ], - "MDNlinks": ["Array.indexOf()", "Array.push()", "Array.join()", "String.substr()", "String.split()"], - "challengeType": 5 + "MDNlinks": [ + "Array.indexOf()", + "Array.push()", + "Array.join()", + "String.substr()", + "String.split()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "afd15382cdfb22c9efe8b7de", @@ -630,14 +924,27 @@ "", "pair(\"GCG\");" ], - "MDNlinks": ["Array.push()", "String.split()"], - "challengeType": 5 + "MDNlinks": [ + "Array.push()", + "String.split()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "af7588ade1100bde429baf20", - "name" : "Bonfire: Missing letters", + "name": "Bonfire: Missing letters", "difficulty": "2.05", - "description" : [ + "description": [ "Find the missing letter in the passed letter range and return it.", "If all letters are present in the range, return undefined.", "Remember to use RSAP if you get stuck. Try to pair program. Write your own code." @@ -655,8 +962,20 @@ "expect(fearNotLetter('abcdefghjklmno')).to.equal('i');", "expect(fearNotLetter('yz')).to.be.undefined;" ], - "MDNlinks": ["String.charCodeAt()"], - "challengeType": 5 + "MDNlinks": [ + "String.charCodeAt()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a77dbc43c33f39daa4429b4f", @@ -685,8 +1004,20 @@ "assert.strictEqual(boo(NaN), false);", "assert.strictEqual(boo('a'), false);" ], - "MDNlinks": ["Boolean Objects"], - "challengeType": 5 + "MDNlinks": [ + "Boolean Objects" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a105e963526e7de52b219be9", @@ -710,8 +1041,20 @@ "assert.deepEqual(unite([1, 3, 2], [5, 2, 1, 4], [2, 1]), [1, 3, 2, 5, 4], 'should return the union of the given arrays');", "assert.deepEqual(unite([1, 3, 2], [1, [5]], [2, [4]]), [1, 3, 2, [5], [4]], 'should not flatten nested arrays');" ], - "MDNlinks" : ["Array.reduce()"], - "challengeType": 5 + "MDNlinks": [ + "Array.reduce()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a6b0bb188d873cb2c8729495", @@ -733,8 +1076,20 @@ "assert.strictEqual(convert('Dolce & Gabbana'), 'Dolce & Gabbana', 'should escape characters');", "assert.strictEqual(convert('abc'), 'abc', 'should handle strings with nothing to escape');" ], - "MDNlinks": ["RegExp"], - "challengeType": 5 + "MDNlinks": [ + "RegExp" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a103376db3ba46b2d50db289", @@ -759,8 +1114,21 @@ "assert.strictEqual(spinalCase('The_Andy_Griffith_Show'), 'the-andy-griffith-show', 'should return spinal case from string with snake case');", "assert.strictEqual(spinalCase('Teletubbies say Eh-oh'), 'teletubbies-say-eh-oh', 'should return spinal case from string with spaces and hyphens');" ], - "MDNlinks": ["RegExp", "String.replace()"], - "challengeType": 5 + "MDNlinks": [ + "RegExp", + "String.replace()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a5229172f011153519423690", @@ -787,8 +1155,20 @@ "expect(sumFibs(75024)).to.equal(60696);", "expect(sumFibs(75025)).to.equal(135721);" ], - "MDNlinks": ["Remainder"], - "challengeType": 5 + "MDNlinks": [ + "Remainder" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a3bfc1673c0526e06d3ac698", @@ -812,8 +1192,21 @@ "expect(sumPrimes(10)).to.equal(17);", "expect(sumPrimes(977)).to.equal(73156);" ], - "MDNlinks" : ["For Loops", "Array.push()"], - "challengeType": 5 + "MDNlinks": [ + "For Loops", + "Array.push()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "ae9defd7acaf69703ab432ea", @@ -838,8 +1231,20 @@ "expect(smallestCommons([5,1])).to.equal(60);", "expect(smallestCommons([1,13])).to.equal(360360);" ], - "MDNlinks" : ["Smallest Common Multiple"], - "challengeType": 5 + "MDNlinks": [ + "Smallest Common Multiple" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a6e40f1041b06c996f7b2406", @@ -861,8 +1266,20 @@ "assert.strictEqual(find([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }), 8, 'should return first found value');", "assert.strictEqual(find([1, 3, 5, 9], function(num) { return num % 2 === 0; }), undefined, 'should return undefined if not found');" ], - "MDNlinks": ["Array.some()"], - "challengeType": 5 + "MDNlinks": [ + "Array.some()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a5deed1811a43193f9f1c841", @@ -885,8 +1302,21 @@ "expect(drop([1, 2, 3], function(n) {return n > 0; })).to.eqls([1, 2, 3]);", "expect(drop([1, 2, 3, 4], function(n) {return n > 5; })).to.eqls([]);" ], - "MDNlinks": ["Arguments object", "Array.shift()"], - "challengeType": 5 + "MDNlinks": [ + "Arguments object", + "Array.shift()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "ab306dbdcc907c7ddfc30830", @@ -909,8 +1339,20 @@ "assert.deepEqual(steamroller([1, [2], [3, [[4]]]]), [1, 2, 3, 4], 'should flatten nested arrays');", "assert.deepEqual(steamroller([1, [], [3, [[4]]]]), [1, 3, 4], 'should work with empty arrays');" ], - "MDNlinks": ["Array.isArray()"], - "challengeType": 5 + "MDNlinks": [ + "Array.isArray()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a8d97bd4c764e91f9d2bda01", @@ -932,9 +1374,21 @@ "expect(binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111')).to.equal(\"Aren't bonfires fun!?\");", "expect(binaryAgent('01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001')).to.equal(\"I love FreeCodeCamp!\");" ], - "MDNlinks": ["String.charCodeAt()", "String.fromCharCode()" + "MDNlinks": [ + "String.charCodeAt()", + "String.fromCharCode()" ], - "challengeType": 5 + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a10d2431ad0c6a099a4b8b52", @@ -958,8 +1412,21 @@ "assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], 'sex'), true, 'should return true if predicate returns truthy for all elements in the collection');", "assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], {'sex': 'female'}), false, 'should return false if predicate returns falsey for any element in the collection');" ], - "MDNlinks": ["Object.hasOwnProperty()", "Object.getOwnPropertyNames()"], - "challengeType": 5 + "MDNlinks": [ + "Object.hasOwnProperty()", + "Object.getOwnPropertyNames()" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "a97fd23d9b809dac9921074f", @@ -985,8 +1452,21 @@ "expect(add(2, '3')).to.be.undefined;", "expect(add(2)([3])).to.be.undefined;" ], - "MDNlinks": ["Global Function Object", "Arguments object"], - "challengeType": 5 + "MDNlinks": [ + "Global Function Object", + "Arguments object" + ], + "challengeType": 5, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] } ] -} +} \ No newline at end of file diff --git a/seed_data/challenges/basic-html5-and-css.json b/seed_data/challenges/basic-html5-and-css.json index ff676782f6..b99b57317c 100644 --- a/seed_data/challenges/basic-html5-and-css.json +++ b/seed_data/challenges/basic-html5-and-css.json @@ -1,6 +1,6 @@ { "name": "Basic HTML5 and CSS", - "order" : 0.002, + "order": 0.002, "challenges": [ { "_id": "bd7123c8c441eddfaeb5bdef", @@ -21,7 +21,17 @@ "challengeSeed": [ "

Hello

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf0887a", @@ -41,7 +51,17 @@ "challengeSeed": [ "

Hello World

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08801", @@ -60,7 +80,17 @@ "

Hello World

", "

CatPhotoApp

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aeaf08801", @@ -80,7 +110,17 @@ "

CatPhotoApp

", "

Hello Paragraph

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08802", @@ -93,9 +133,9 @@ "You can start a comment with <!-- and end a comment with -->." ], "tests": [ - "assert(($('h1').length > 0), 'The h1 element should not commented. It should be visible in the browser.')", - "assert(($('h2').length > 0), 'The h2 element should not commented. It should be visible in the browser.')", - "assert(($('p').length > 0), 'The paragraph element should not commented. It should be visible in the browser.')" + "assert($('h1').length > 0, 'The h1 element should not be commented. It should be visible in the browser.')", + "assert($('h2').length > 0, 'The h2 element should not be commented. It should be visible in the browser.')", + "assert($('p').length > 0, 'The paragraph element should not be commented. It should be visible in the browser.')" ], "challengeSeed": [ "" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08804", @@ -130,12 +180,22 @@ "", "

CatPhotoApp

", "", - "
", + "
", "", "

Hello Paragraph

", "-->" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08833", @@ -156,11 +216,21 @@ "", "

CatPhotoApp

", "", - "
", + "
", "", "

Hello Paragraph

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fed1348bd9aedf08833", @@ -182,11 +252,21 @@ "", "

CatPhotoApp

", "", - "
", + "
", "", "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08803", @@ -196,7 +276,7 @@ "Change the h2 element's style so that its text color is red.", "We can do this by changing the style of the h2 element.", "The style that is responsible for the color of an element's text is the \"color\" style.", - "Here's how you would set your h2 element's text color to blue: <h2 style=\"color: blue\">CatPhotoApp<h2>" + "Here's how you would set your h2 element's text color to blue: <h2 style=\"color: blue\">CatPhotoApp</h2>" ], "tests": [ "assert($('h2').css('color') === 'rgb(255, 0, 0)', 'Your h2 element should be red.')" @@ -206,7 +286,17 @@ "", "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08805", @@ -230,7 +320,17 @@ "", "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aecf08806", @@ -261,11 +361,21 @@ "", "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aefe08806", - "name": "Waypoint: Style Multiple Elements with a CSS Classes", + "name": "Waypoint: Style Multiple Elements with a CSS Class", "difficulty": 0.020, "description": [ "Apply the \"red-text\" class to the h2 and p elements.", @@ -288,7 +398,17 @@ "", "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08806", @@ -315,7 +435,17 @@ "", "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aede08807", @@ -324,7 +454,7 @@ "description": [ "Make all paragraph elements use the \"Monospace\" font.", "You can set an element's font by using the font-family attribute.", - "For example, if you wanted to set your h2 element's font to \"San-serif\", you would use the following CSS: h2 { font-family: 'San-serif'; }" + "For example, if you wanted to set your h2 element's font to \"Sans-serif\", you would use the following CSS: h2 { font-family: 'Sans-serif'; }" ], "tests": [ "assert($('p').css('font-family').match(/monospace/i), 'Your paragraph elements should use the font \"Monospace\".')" @@ -345,7 +475,17 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08807", @@ -378,7 +518,17 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08808", @@ -417,7 +567,17 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08809", @@ -434,6 +594,9 @@ "Now see if you can make sure the h2 element is rendered in the color red without removing the \"blue-text\" class, doing an in-line styling, or changing the sequence of CSS class declarations." ], "tests": [ + "assert(new RegExp('.blue-text', 'gi').test(editor), 'Ensure you implemented the css class \".blue-text\"')", + "assert(new RegExp('.urgently-red', 'gi').test(editor), 'Ensure you implemented the css class \".urgently-red\"')", + "assert(new RegExp('red !important', 'gi').test(editor), 'Ensure you added the \"!important\" declaration!')", "assert($('h2').hasClass('blue-text'), 'Your h2 element should have the class \"blue-text\".')", "assert($('h2').hasClass('urgently-red'), 'Your h2 element should have the class \"urgently-red\".')", "assert($('h2').css('color') === 'rgb(255, 0, 0)', 'Your h2 element should be red.')" @@ -460,9 +623,18 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, - { "_id": "bad87fee1348bd9aedf08812", "name": "Waypoint: Add Images to your Website", @@ -499,7 +671,17 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9acdf08812", @@ -538,21 +720,31 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9bedf08813", "name": "Waypoint: Add Borders Around your Elements", "difficulty": 0.028, "description": [ - "Create a class called \"thick-green-border\" that puts a 10-pixel-wide green border around an HTML element, and apply it to your cat photo.", + "Create a class called \"thick-green-border\" that puts a 10-pixel-wide green border with a style of \"solid\" around an HTML element, and apply it to your cat photo.", "CSS borders have attributes like style, color and width.", "For example, if we wanted to create a red, 5 pixel border around an HTML element, we could use this class: <style> .thin-red-border { border-color: red; border-width: 5px; border-style: solid; } </style>." ], "tests": [ "assert($('img').hasClass('smaller-image'), 'Your img element should have the class \"smaller-image\".')", - "assert($('img').hasClass('thick-green-border'), 'Your image element should have the class \"thick-green-border\".')", - "assert(parseInt($('img').css('border-left-width')) > 8, 'Your image should have a border with a width of 10 pixels.')" + "assert($('img').hasClass('thick-green-border'), 'Your img element should have the class \"thick-green-border\".')", + "assert(parseInt($('img').css('border-width')) >= 9 && new RegExp('solid').test($('img').css('border-style')), 'You need to specify a border width of 10px and a border style of \"solid\".')" ], "challengeSeed": [ "", @@ -582,7 +774,17 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08814", @@ -631,7 +833,17 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08815", @@ -679,7 +891,17 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08816", @@ -692,7 +914,7 @@ "Here's an example: <p>Here's a <a href='http://freecodecamp.com'> link to Free Code Camp</a> for you to follow.</p>" ], "tests": [ - "assert((/photo/gi).test($('a').text()), 'Your anchor element should have the anchor text of \"See my cat photos\"')", + "assert((/cat photos/gi).test($('a').text()), 'Your anchor element should have the anchor text of \"cat photos\"')", "assert($('a').filter(function(index) { return /com/gi.test($('a').attr('href')); }).length > 0, 'You need an anchor element that links to http://catphotoapp.com.')" ], "challengeSeed": [ @@ -730,7 +952,17 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aede08817", @@ -744,7 +976,7 @@ ], "tests": [ "assert((/photo/gi).test($('a').text()), 'You need an anchor element that links to \"catphotoapp.com\".')", - "assert($('a').filter(function(index) { return /photo/gi.test($('a')[index]); }).length === 1, 'Your anchor element should have the anchor text of \"See my cat photos\"')", + "assert($('a').filter(function(index) { return /photo/gi.test($('a')[index]); }).length === 1, 'Your anchor element should have the anchor text of \"cat photos\"')", "assert($('a').parent().is('p'), 'Your anchor element should be wrapped within a paragraph element.')" ], "challengeSeed": [ @@ -784,9 +1016,18 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, - { "_id": "bad87fee1348bd9aedf08817", "name": "Waypoint: Make Dead Links using the Hash Symbol", @@ -837,7 +1078,17 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08820", @@ -851,7 +1102,8 @@ "Once you've done this, hover over your image with your cursor. Your cursor's normal pointer should become the link clicking pointer. The photo is now a link." ], "tests": [ - "assert($('a').filter(function(index) { return /#/gi.test($('a')[index]); }).length > 1, 'Wrap your image element inside an anchor element that has its href attribute set to \"#\".')" + "expect($('a').children('img').length, 'Wrap your image element inside an anchor element that has its href attribute set to \"#\"').to.equal(1);", + "expect(new RegExp('#').test($('a').children('img').parent().attr('href')), 'Make sure to specify the \"src\" attribute as \"#\"').to.be.true;" ], "challengeSeed": [ "", @@ -890,7 +1142,17 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08818", @@ -943,13 +1205,22 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, - { - "_id" : "bad87fee1348bd9aedf08827", + "_id": "bad87fee1348bd9aedf08827", "name": "Waypoint: Create a Bulleted Unordered List", - "difficulty" : 0.036, + "difficulty": 0.036, "description": [ "Replace the paragraph elements with an unordered list of three things that cats love.", "HTML has a special element for creating unordered lists, or bullet point-style lists.", @@ -997,13 +1268,22 @@ "

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", "

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, - { - "_id" : "bad87fee1348bd9aedf08828", + "_id": "bad87fee1348bd9aedf08828", "name": "Waypoint: Create an Ordered List", - "difficulty" : 0.037, + "difficulty": 0.037, "description": [ "Create an ordered list of the the top 3 things cats hate the most.", "HTML has a special element for creating ordered lists, or numbered-style lists.", @@ -1013,8 +1293,8 @@ "tests": [ "assert($('ul').length > 0, 'You should have an ul element on your webpage.')", "assert($('ol').length > 0, 'You should have an ol element on your webpage.')", - "assert($('li').length > 5, 'You should have three li elements on within your ul element.')", - "assert($('li').length > 5, 'You should have three li elements on within your ol element.')" + "assert($('li').length > 5, 'You should have three li elements within your ul element.')", + "assert($('li').length > 5, 'You should have three li elements within your ol element.')" ], "challengeSeed": [ "", @@ -1057,13 +1337,22 @@ "
  • lasagna
  • ", "" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, - { - "_id" : "bad87fee1348bd9aedf08829", + "_id": "bad87fee1348bd9aedf08829", "name": "Waypoint: Create a Text Field", - "difficulty" : 0.038, + "difficulty": 0.038, "description": [ "Now we'll create a web form. Create a text field under your lists.", "Text inputs are a convenient way to get input from your user.", @@ -1119,20 +1408,30 @@ "
  • other cats
  • ", "" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, - { - "_id" : "bad87fee1348bd9aedf08830", + "_id": "bad87fee1348bd9aedf08830", "name": "Waypoint: Add Placeholder Text to a Text Field", - "difficulty" : 0.039, + "difficulty": 0.039, "description": [ - "Add the placeholder text \"type a cat photo URL here\" to your text field.", + "Add the placeholder text \"cat photo URL\" to your text field.", "Placeholder text will appear in your text field before your user has inputed anything.", "For example: <input type='text' placeholder='this is placeholder text'>" ], "tests": [ - "assert($('[placeholder]').length > 0, 'Your text field should have the placeholder text of \"cat photo URL\".')" + "assert($('[placeholder]').length > 0, 'Your text field should have a placeholder attribute.')", + "assert(/url/gi.test($('input').attr('placeholder')), 'Your placeholder field should have the value of \"cat photo URL\".')" ], "challengeSeed": [ "", @@ -1182,13 +1481,22 @@ "", "" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, - { - "_id" : "bad87fee1348bd9aede08830", + "_id": "bad87fee1348bd9aede08830", "name": "Waypoint: Create a Form Element", - "difficulty" : 0.040, + "difficulty": 0.040, "description": [ "Wrap your text field in a <form> element. Add the action=\"/submit-cat-photo\" attribute to this form element.", "You can build web forms that actually submit data to a server using nothing more than pure HTML. You can do this by specifying an action on your form element.", @@ -1246,20 +1554,29 @@ "", "" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, - { - "_id" : "bad87fee1348bd9aedd08830", + "_id": "bad87fee1348bd9aedd08830", "name": "Waypoint: Add a Submit Button to a Form", - "difficulty" : 0.041, + "difficulty": 0.041, "description": [ - "Add a submit button to your form field.", - "Let's add a submit button to your form. Clicking this button will send the date from your form to the URL you specified with your form's action attribute.", + "Add a submit button to your form field with type submit and a test value of \"Submit\".", + "Let's add a submit button to your form. Clicking this button will send the data from your form to the URL you specified with your form's action attribute.", "Here's an example submit button: <button type='submit'>this button submits the form</button>" ], "tests": [ - "assert($('button').length > 0, 'Your form should have a button inside it.')" + "assert(new RegExp('', 'gi').test(editor), 'Make sure you have completely declared your button!');" ], "challengeSeed": [ "", @@ -1311,21 +1628,30 @@ " ", "" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, - { - "_id" : "bad87fee1348bd9aedc08830", + "_id": "bad87fee1348bd9aedc08830", "name": "Waypoint: Use HTML5 to Require a Field", - "difficulty" : 0.042, + "difficulty": 0.042, "description": [ "Make it required for your user to input text into your form before being able to submit it.", "You can require your user to complete specific form fields before they will be able to submit your form.", "For example, if you wanted to make a text input field required, you can just add the word \"required\" within your input element use: <input type='text' required>" ], "tests": [ - "assert($('input').prop('required'), 'Your text field have the property of being required.')", - "assert($('[placeholder]').length > 0, 'Your text field should have the placeholder text of \"cat photo URL\".')" + "assert($('input').prop('required'), 'Your text field should have the property of being required.')", + "assert(new RegExp('cat photo URL').test($('input').prop('placeholder')), 'Your text field should have the placeholder text of \"cat photo URL\".')" ], "challengeSeed": [ "", @@ -1378,13 +1704,22 @@ " ", "" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, - { - "_id" : "bad87fee1348bd9aedf08834", + "_id": "bad87fee1348bd9aedf08834", "name": "Waypoint: Create a Set of Radio Buttons", - "difficulty" : 0.043, + "difficulty": 0.043, "description": [ "Add to your form a pair of radio buttons that are wrapped in label elements and share a name attribute, with the options of \"indoor\" and \"outdoor\".", "You can use radio buttons for questions where you want the user to only give you one answer.", @@ -1394,8 +1729,8 @@ "Here's an example of a radio button: <label><input type='radio' name='indoor-outdoor'> Indoor</label>" ], "tests": [ - "assert($('input[type=\"radio\"').length > 1, 'Your webpage should have two radio button elements.')", - "assert($('input[type=\"radio\"').attr('name'), 'Both of your radio button should have name attributes with the same value.')", + "assert($('input[type=\"radio\"]').length > 1, 'Your webpage should have two radio button elements.')", + "assert($('input[type=\"radio\"]:nth-child(1)').attr('name') === 'indoor-outdoor', 'Give your radio buttons the name attribute of \"indoor-outdoor\".')", "assert($('label').length > 1, 'Each of your two radio button elements should be wrapped in a label element.')" ], "challengeSeed": [ @@ -1449,21 +1784,30 @@ " ", "" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, - { - "_id" : "bad87fee1348bd9aedf08835", + "_id": "bad87fee1348bd9aedf08835", "name": "Waypoint: Create a Set of Checkboxes", - "difficulty" : 0.044, + "difficulty": 0.044, "description": [ "Add to your form a set of three checkbox elements that are wrapped in label elements and share the same name attribute.", "Forms commonly use checkbox elements for questions that may have more than one answer.", "For example: <label><input type='checkbox' name='personality'> Loving</label>" ], "tests": [ - "assert($('input[type=\"checkbox\"').length > 2, 'Your webpage should have three checkbox elements.')", - "assert($('label').length > 2, 'Each of your three checkbox elements should be wrapped in a label element.')" + "assert($('input[type=\"checkbox\"]').length > 2, 'Your webpage should have three checkbox elements.')", + "assert($('label').length > 4, 'Each of your three checkbox elements should be wrapped in a label element.')" ], "challengeSeed": [ "", @@ -1518,13 +1862,22 @@ " ", "" ], - "challengeType" : 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, - { - "_id" : "bad87fee1348bd9aede08835", + "_id": "bad87fee1348bd9aede08835", "name": "Waypoint: Clean up your form using Linebreaks", - "difficulty" : 0.045, + "difficulty": 0.045, "description": [ "Clean up your form by adding linebreaks between form elements.", "Remember that you can create a linebreak element by using the code: <br>" @@ -1583,26 +1936,35 @@ " ", " ", " ", - " ", + " ", " ", " ", "" ], - "challengeType" : 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, - { - "_id" : "bad87fee1348bd9aedd08835", + "_id": "bad87fee1348bd9aedd08835", "name": "Waypoint: Check Radio Buttons and Checkboxes by Default", - "difficulty" : 0.046, + "difficulty": 0.046, "description": [ "Set the first of your radio buttons and the first of your checkboxes to both be checked by default.", "You set a checkbox or radio button to be checked by default using the checked attribute.", "To do this, just add the word \"checked\" to the inside of an input element. For example, <input type='radio' name='test-name' checked>." ], "tests": [ - "assert($('input[type=\"radio\"').prop('checked'), 'Your first radio button on your form should be checked by default.')", - "assert($('input[type=\"checkbox\"').prop('checked'), 'Your first checkbox on your form should be checked by default.')" + "assert($('input[type=\"radio\"]').prop('checked'), 'Your first radio button on your form should be checked by default.');", + "assert($('input[type=\"checkbox\"]').prop('checked'), 'Your first checkbox on your form should be checked by default.')" ], "challengeSeed": [ "", @@ -1656,13 +2018,23 @@ "
    ", " ", " ", - " ", + " ", "
    ", " ", " ", "" ], - "challengeType" : 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad88fee1348bd9aedf08825", @@ -1713,7 +2085,17 @@ "
    padding
    ", "
    " ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08822", @@ -1766,7 +2148,17 @@ "
    padding
    ", "
    " ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08823", @@ -1818,7 +2210,17 @@ "
    padding
    ", "
    " ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08824", @@ -1830,7 +2232,9 @@ "CSS allows you to control the padding of an element on all four sides with padding-top, padding-right, padding-bottom, and padding-left attributes." ], "tests": [ + "assert($('.green-box').css('padding-top') === '40px', 'Your green-box class should give the top of elements 40px of padding.')", "assert($('.green-box').css('padding-left') === '40px', 'Your green-box class should give the left of elements 40px of padding.')", + "assert($('.green-box').css('padding-right') === '20px', 'Your green-box class should give the right of elements 20px of padding.')", "assert($('.green-box').css('padding-bottom') === '20px', 'Your green-box class should give the bottom of elements 20px of padding.')" ], "challengeSeed": [ @@ -1871,7 +2275,17 @@ "
    padding
    ", "
    " ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1248bd9aedf08824", @@ -1924,21 +2338,33 @@ "
    padding
    ", "" ], - "challengeType": 0 + "challengeType": 0, + "nameCn": "", + "descriptionCn": [], + "nameFr": "", + "descriptionFr": [], + "nameRu": "", + "descriptionRu": [], + "nameEs": "", + "descriptionEs": [], + "namePt": "", + "descriptionPt": [] }, { "_id": "bad87fee1348bd9aedf08826", "name": "Waypoint: Use Clockwise Notation to Specify the Padding of an Element", "difficulty": 0.069, "description": [ - "Use Clockwise Notation to give an element padding of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.", + "Use Clockwise Notation to give the \".green-box\" class a padding of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.", "Instead of specifying an element's padding-top, padding-right, padding-bottom, and padding-left attributes, you can specify them all in one line, like this: padding: 10px 20px 10px 20px;.", "These four values work like a clock: top, right, bottom, left, and will produce the exact same result as using the side-specific padding instructions.", "You can also use this notation for margins!" ], "tests": [ - "assert($('.green-box').css('padding-left') === '40px', 'Your green-box class should give the left of elements 40px of padding.')", - "assert($('.green-box').css('padding-bottom') === '20px', 'Your green-box class should give the bottom of elements 20px of padding.')" + "assert($('.green-box').css('padding-top') === '40px', 'Your green-box class should give the top of elements 40px of padding.')", + "assert($('.green-box').css('padding-right') === '20px', 'Your green-box class should give the right of elements 20px of padding.')", + "assert($('.green-box').css('padding-bottom') === '20px', 'Your green-box class should give the bottom of elements 20px of padding.')", + "assert($('.green-box').css('padding-left') === '40px', 'Your green-box class should give the left of elements 40px of padding.')" ], "challengeSeed": [ "