diff --git a/.eslintrc b/.eslintrc index a167df14d6..418fe63976 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,6 +7,10 @@ "mocha": true, "node": true }, + "parser": "babel-eslint", + "plugins": [ + "react" + ], "globals": { "window": true, "$": true, @@ -41,7 +45,7 @@ "valid-jsdoc": 2, "valid-typeof": 2, - "block-scoped-var": 2, + "block-scoped-var": 0, "complexity": 0, "consistent-return": 2, "curly": 2, @@ -215,6 +219,21 @@ "max-params": 0, "max-statements": 0, "no-bitwise": 1, - "no-plusplus": 0 + "no-plusplus": 0, + + "react/display-name": 1, + "react/jsx-boolean-value": 1, + "react/jsx-quotes": [1, "single", "avoid-escape"], + "react/jsx-no-undef": 1, + "react/jsx-sort-props": 1, + "react/jsx-uses-react": 1, + "react/jsx-uses-vars": 1, + "react/no-did-mount-set-state": 2, + "react/no-did-update-set-state": 2, + "react/no-multi-comp": 2, + "react/prop-types": 2, + "react/react-in-jsx-scope": 1, + "react/self-closing-comp": 1, + "react/wrap-multilines": 1 } -} \ No newline at end of file +} diff --git a/app.js b/app.js index 10e269fda9..9e4a7686ba 100755 --- a/app.js +++ b/app.js @@ -33,28 +33,27 @@ var express = require('express'), forceDomain = require('forcedomain'), lessMiddleware = require('less-middleware'), - /** - * Controllers (route handlers). - */ - homeController = require('./controllers/home'), - resourcesController = require('./controllers/resources'), - userController = require('./controllers/user'), - nonprofitController = require('./controllers/nonprofits'), - bonfireController = require('./controllers/bonfire'), - coursewareController = require('./controllers/courseware'), - fieldGuideController = require('./controllers/fieldGuide'), - challengeMapController = require('./controllers/challengeMap'), + /** + * Controllers (route handlers). + */ + homeController = require('./controllers/home'), + resourcesController = require('./controllers/resources'), + userController = require('./controllers/user'), + nonprofitController = require('./controllers/nonprofits'), + fieldGuideController = require('./controllers/fieldGuide'), + challengeMapController = require('./controllers/challengeMap'), + challengeController = require('./controllers/challenge'), - /** - * Stories - */ - storyController = require('./controllers/story'), + /** + * Stories + */ + storyController = require('./controllers/story'), - /** - * API keys and Passport configuration. - */ - secrets = require('./config/secrets'), - passportConf = require('./config/passport'); + /** + * API keys and Passport configuration. + */ + secrets = require('./config/secrets'), + passportConf = require('./config/passport'); /** * Create Express server. @@ -66,9 +65,9 @@ var app = express(); */ mongoose.connect(secrets.db); mongoose.connection.on('error', function () { - console.error( - 'MongoDB Connection Error. Please make sure that MongoDB is running.' - ); + console.error( + 'MongoDB Connection Error. Please make sure that MongoDB is running.' + ); }); /** @@ -92,11 +91,11 @@ app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({extended: true})); app.use(expressValidator({ - customValidators: { - matchRegex: function (param, regex) { - return regex.test(param); - } + customValidators: { + matchRegex: function (param, regex) { + return regex.test(param); } + } })); app.use(methodOverride()); app.use(cookieParser()); @@ -118,11 +117,11 @@ app.use(helmet.xssFilter()); app.use(helmet.noSniff()); app.use(helmet.frameguard()); app.use(function(req, res, next) { - res.header('Access-Control-Allow-Origin', '*'); - res.header('Access-Control-Allow-Headers', - 'Origin, X-Requested-With, Content-Type, Accept' - ); - next(); + res.header('Access-Control-Allow-Origin', '*'); + res.header('Access-Control-Allow-Headers', + 'Origin, X-Requested-With, Content-Type, Accept' + ); + next(); }); var trusted = [ @@ -160,39 +159,41 @@ var trusted = [ '*.ytimg.com', '*.bitly.com', 'http://cdn.inspectlet.com/', - 'http://hn.inspectlet.com/' + 'http://hn.inspectlet.com/', + '*.simplyhired.com', + '*.simply-partner.com' ]; app.use(helmet.csp({ - defaultSrc: trusted, - scriptSrc: [ - '*.optimizely.com', - '*.aspnetcdn.com', - '*.d3js.org' - ].concat(trusted), - 'connect-src': [ - ].concat(trusted), - styleSrc: trusted, - imgSrc: [ - /* allow all input since we have user submitted images for public profile*/ - '*' - ].concat(trusted), - fontSrc: ['*.googleapis.com'].concat(trusted), - mediaSrc: [ - '*.amazonaws.com', - '*.twitter.com' - ].concat(trusted), - frameSrc: [ + defaultSrc: trusted, + scriptSrc: [ + '*.optimizely.com', + '*.aspnetcdn.com', + '*.d3js.org' + ].concat(trusted), + 'connect-src': [ + ].concat(trusted), + styleSrc: trusted, + imgSrc: [ + /* allow all input since we have user submitted images for public profile*/ + '*' + ].concat(trusted), + fontSrc: ['*.googleapis.com'].concat(trusted), + mediaSrc: [ + '*.amazonaws.com', + '*.twitter.com' + ].concat(trusted), + frameSrc: [ - '*.gitter.im', - '*.gitter.im https:', - '*.vimeo.com', - '*.twitter.com', - '*.ghbtns.com' - ].concat(trusted), - reportOnly: false, // set to true if you only want to report errors - setAllHeaders: false, // set to true if you want to set all headers - safari5: false // set to true if you want to force buggy CSP in Safari 5 + '*.gitter.im', + '*.gitter.im https:', + '*.vimeo.com', + '*.twitter.com', + '*.ghbtns.com' + ].concat(trusted), + reportOnly: false, // set to true if you only want to report errors + setAllHeaders: false, // set to true if you want to set all headers + safari5: false // set to true if you want to force buggy CSP in Safari 5 })); app.use(function (req, res, next) { @@ -204,15 +205,15 @@ app.use(function (req, res, next) { app.use(express.static(__dirname + '/public', {maxAge: 86400000 })); app.use(function (req, res, next) { - // Remember original destination before login. - var path = req.path.split('/')[1]; - if (/auth|login|logout|signin|signup|fonts|favicon/i.test(path)) { - return next(); - } else if (/\/stories\/comments\/\w+/i.test(req.path)) { - return next(); - } - req.session.returnTo = req.path; - next(); + // Remember original destination before login. + var path = req.path.split('/')[1]; + if (/auth|login|logout|signin|signup|fonts|favicon/i.test(path)) { + return next(); + } else if (/\/stories\/comments\/\w+/i.test(req.path)) { + return next(); + } + req.session.returnTo = req.path; + next(); }); /** @@ -222,24 +223,47 @@ app.use(function (req, res, next) { app.get('/', homeController.index); app.get('/nonprofit-project-instructions', function(req, res) { - res.redirect(301, '/field-guide/how-do-free-code-camp\'s-nonprofit-projects-work'); + res.redirect(301, '/field-guide/how-do-free-code-camp\'s-nonprofit-projects-work'); }); +app.post('/get-help', resourcesController.getHelp); + +app.post('/get-pair', resourcesController.getPair); + app.get('/chat', resourcesController.chat); app.get('/twitch', resourcesController.twitch); +app.get('/cats.json', function(req, res) { + res.send( + [ + { + "name": "cute", + "imageLink": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRaP1ecF2jerISkdhjr4R9yM9-8ClUy-TA36MnDiFBukd5IvEME0g" + }, + { + "name": "grumpy", + "imageLink": "http://cdn.grumpycats.com/wp-content/uploads/2012/09/GC-Gravatar-copy.png" + }, + { + "name": "mischievous", + "imageLink": "http://www.kittenspet.com/wp-content/uploads/2012/08/cat_with_funny_face_3-200x200.jpg" + } + ] + ) +}); + // Agile Project Manager Onboarding app.get('/pmi-acp-agile-project-managers', - resourcesController.agileProjectManagers); + resourcesController.agileProjectManagers); app.get('/agile', function(req, res) { res.redirect(301, '/pmi-acp-agile-project-managers'); }); app.get('/pmi-acp-agile-project-managers-form', - resourcesController.agileProjectManagersForm); + resourcesController.agileProjectManagersForm); // Nonprofit Onboarding @@ -252,31 +276,31 @@ app.get('/nonprofits-form', resourcesController.nonprofitsForm); app.get('/map', challengeMapController.challengeMap); app.get('/live-pair-programming', function(req, res) { - res.redirect(301, '/field-guide/live-stream-pair-programming-on-twitch.tv'); + res.redirect(301, '/field-guide/live-stream-pair-programming-on-twitch.tv'); }); app.get('/install-screenhero', function(req, res) { - res.redirect(301, '/field-guide/install-screenhero'); + res.redirect(301, '/field-guide/install-screenhero'); }); app.get('/guide-to-our-nonprofit-projects', function(req, res) { - res.redirect(301, '/field-guide/a-guide-to-our-nonprofit-projects'); + res.redirect(301, '/field-guide/a-guide-to-our-nonprofit-projects'); }); app.get('/chromebook', function(req, res) { - res.redirect(301, '/field-guide/chromebook'); + res.redirect(301, '/field-guide/chromebook'); }); app.get('/deploy-a-website', function(req, res) { - res.redirect(301, '/field-guide/deploy-a-website'); + res.redirect(301, '/field-guide/deploy-a-website'); }); app.get('/gmail-shortcuts', function(req, res) { - res.redirect(301, '/field-guide/gmail-shortcuts'); + res.redirect(301, '/field-guide/gmail-shortcuts'); }); app.get('/nodeschool-challenges', function(req, res) { - res.redirect(301, '/field-guide/nodeschool-challenges'); + res.redirect(301, '/field-guide/nodeschool-challenges'); }); @@ -321,20 +345,26 @@ app.post('/email-signin', userController.postSignin); app.get('/nonprofits/directory', nonprofitController.nonprofitsDirectory); app.get( - '/nonprofits/:nonprofitName', - nonprofitController.returnIndividualNonprofit + '/nonprofits/:nonprofitName', + nonprofitController.returnIndividualNonprofit ); -app.post( - '/update-progress', - passportConf.isAuthenticated, - userController.updateProgress +app.get( + '/jobs', + resourcesController.jobs +); + +app.get( + '/jobs-form', + resourcesController.jobsForm ); app.get('/privacy', function(req, res) { res.redirect(301, '/field-guide/what-is-the-free-code-camp-privacy-policy?'); }); +app.get('/submit-cat-photo', resourcesController.catPhotoSubmit); + app.get('/api/slack', function(req, res) { if (req.user) { if (req.user.email) { @@ -488,43 +518,14 @@ app.get('/api/trello', resourcesController.trelloCalls); app.get('/api/codepen/twitter/:screenName', resourcesController.codepenResources.twitter); -/** - * Bonfire related routes - */ - -app.get('/field-guide/getFieldGuideList', fieldGuideController.showAllFieldGuides); - -app.get('/playground', bonfireController.index); - -app.get('/bonfires', bonfireController.returnNextBonfire); - -app.get('/bonfire-json-generator', bonfireController.returnGenerator); - -app.post('/bonfire-json-generator', bonfireController.generateChallenge); - -app.get('/bonfire-challenge-generator', bonfireController.publicGenerator); - -app.post('/bonfire-challenge-generator', bonfireController.testBonfire); - -app.get( - '/bonfires/:bonfireName', - bonfireController.returnIndividualBonfire -); - -app.get('/bonfire', function(req, res) { - res.redirect(301, '/playground'); -}); - -app.post('/completed-bonfire/', bonfireController.completedBonfire); - /** * Field Guide related routes */ - +app.get('/field-guide/all-articles', fieldGuideController.showAllFieldGuides); app.get('/field-guide/:fieldGuideName', - fieldGuideController.returnIndividualFieldGuide - ); + fieldGuideController.returnIndividualFieldGuide +); app.get('/field-guide/', fieldGuideController.returnNextFieldGuide); @@ -532,29 +533,39 @@ app.post('/completed-field-guide/', fieldGuideController.completedFieldGuide); /** - * Courseware related routes + * Challenge related routes */ -app.get('/challenges/', coursewareController.returnNextCourseware); - -app.get( - '/challenges/:coursewareName', - coursewareController.returnIndividualCourseware +app.get('/challenges/next-challenge', + userController.userMigration, + challengeController.returnNextChallenge ); -app.post('/completed-courseware/', coursewareController.completedCourseware); +app.get( + '/challenges/:challengeName', + userController.userMigration, + challengeController.returnIndividualChallenge +); + +app.get('/challenges/', + userController.userMigration, + challengeController.returnCurrentChallenge); +// todo refactor these routes +app.post('/completed-challenge/', challengeController.completedChallenge); app.post('/completed-zipline-or-basejump', - coursewareController.completedZiplineOrBasejump); + challengeController.completedZiplineOrBasejump); + +app.post('/completed-bonfire', challengeController.completedBonfire); // Unique Check API route app.get('/api/checkUniqueUsername/:username', - userController.checkUniqueUsername - ); + userController.checkUniqueUsername +); app.get('/api/checkExistingUsername/:username', - userController.checkExistingUsername - ); + userController.checkExistingUsername +); app.get('/api/checkUniqueEmail/:email', userController.checkUniqueEmail); diff --git a/bower.json b/bower.json index 0d92dd37c2..cd8cfd5cf3 100644 --- a/bower.json +++ b/bower.json @@ -25,6 +25,7 @@ "font-awesome": "~4.3.0", "moment": "~2.10.2", "angular-bootstrap": "~0.13.0", - "ramda": "~0.13.0" + "ramda": "~0.13.0", + "jshint": "~2.7.0" } } diff --git a/config/bootstrap.js b/config/bootstrap.js deleted file mode 100644 index c38ffac08e..0000000000 --- a/config/bootstrap.js +++ /dev/null @@ -1,29 +0,0 @@ -var mongoose = require('mongoose'), - debug = require('debug')('freecc:config:boot'), - secrets = require('./secrets'), - courses = require('../seed_data/courses.json'), - Course = require('./../models/Course'), - challenges = require('../seed_data/challenges.json'), - Challenge = require('./../models/Challenge'); - -mongoose.connect(secrets.db); -mongoose.connection.on('error', function() { - console.error('MongoDB Connection Error. Make sure MongoDB is running.'); -}); - - -Course.create(courses, function(err, data) { - if (err) { - debug(err); - } else { - debug('Saved ', data); - } -}); - -Challenge.create(challenges, function(err, data) { - if (err) { - console.log(err); - } else { - console.log('Saved ', data); - } -}); diff --git a/config/secrets.js b/config/secrets.js index 10cca4c96a..a3bd62dc81 100644 --- a/config/secrets.js +++ b/config/secrets.js @@ -58,5 +58,6 @@ module.exports = { callbackURL: '/auth/linkedin/callback', scope: ['r_basicprofile', 'r_emailaddress'], passReqToCallback: true - } + }, + slackHook: process.env.SLACK_WEBHOOK, }; diff --git a/controllers/bonfire.js b/controllers/bonfire.js deleted file mode 100644 index 68f22d9532..0000000000 --- a/controllers/bonfire.js +++ /dev/null @@ -1,333 +0,0 @@ -var _ = require('lodash'), - debug = require('debug')('freecc:cntr:bonfires'), - Bonfire = require('./../models/Bonfire'), - User = require('./../models/User'), - resources = require('./resources'), - R = require('ramda'); - MDNlinks = require('./../seed_data/bonfireMDNlinks'); - -/** - * Bonfire controller - */ - -exports.showAllBonfires = function(req, res) { - var completedBonfires = []; - if(req.user) { - completedBonfires = req.user.completedBonfires.map(function (elem) { - return elem._id; - }); - } - var noDuplicateBonfires = R.uniq(completedBonfires); - var data = {}; - data.bonfireList = resources.allBonfireNames(); - data.completedList = noDuplicateBonfires; - res.send(data); -}; - -exports.index = function(req, res) { - res.render('bonfire/show.jade', { - completedWith: null, - title: 'Bonfire Playground', - name: 'Bonfire Playground', - difficulty: 0, - brief: 'Feel free to play around!', - details: '', - tests: [], - challengeSeed: '', - cc: req.user ? req.user.bonfiresHash : undefined, - progressTimestamps: req.user ? req.user.progressTimestamps : undefined, - verb: resources.randomVerb(), - phrase: resources.randomPhrase(), - compliments: resources.randomCompliment(), - bonfires: [], - bonfireHash: 'test' - - }); -}; - -exports.returnNextBonfire = function(req, res, next) { - if (!req.user) { - return res.redirect('../bonfires/meet-bonfire'); - } - var completed = req.user.completedBonfires.map(function (elem) { - return elem._id; - }); - - req.user.uncompletedBonfires = resources.allBonfireIds().filter(function (elem) { - if (completed.indexOf(elem) === -1) { - return elem; - } - }); - req.user.save(); - - var uncompletedBonfires = req.user.uncompletedBonfires; - - var displayedBonfires = Bonfire.find({'_id': uncompletedBonfires[0]}); - displayedBonfires.exec(function(err, bonfireFromMongo) { - if (err) { - return next(err); - } - var bonfire = bonfireFromMongo.pop(); - if (typeof bonfire === 'undefined') { - req.flash('errors', { - msg: "It looks like you've completed all the bonfires we have available. Good job!" - }); - return res.redirect('../bonfires/meet-bonfire'); - } - var nameString = bonfire.name.toLowerCase().replace(/\s/g, '-'); - return res.redirect('../bonfires/' + nameString); - }); -}; - -exports.returnIndividualBonfire = function(req, res, next) { - var dashedName = req.params.bonfireName; - - var bonfireName = dashedName.replace(/\-/g, ' '); - - Bonfire.find({'name': new RegExp(bonfireName, 'i')}, function(err, bonfireFromMongo) { - if (err) { - next(err); - } - - - if (bonfireFromMongo.length < 1) { - req.flash('errors', { - msg: "404: We couldn't find a bonfire with that name. Please double check the name." - }); - - return res.redirect('/bonfires'); - } - - var bonfire = bonfireFromMongo.pop(); - var dashedNameFull = bonfire.name.toLowerCase().replace(/\s/g, '-'); - if (dashedNameFull !== dashedName) { - return res.redirect('../bonfires/' + dashedNameFull); - } - res.render('bonfire/show', { - completedWith: null, - title: bonfire.name, - dashedName: dashedName, - name: bonfire.name, - difficulty: Math.floor(+bonfire.difficulty), - brief: bonfire.description.shift(), - details: bonfire.description, - tests: bonfire.tests, - challengeSeed: bonfire.challengeSeed, - points: req.user ? req.user.points : undefined, - verb: resources.randomVerb(), - phrase: resources.randomPhrase(), - compliment: resources.randomCompliment(), - bonfires: bonfire, - bonfireHash: bonfire._id, - MDNkeys: bonfire.MDNlinks, - MDNlinks: getMDNlinks(bonfire.MDNlinks) - }); - }); -}; - -/** - * Bonfire Generator - * @param req Request Object - * @param res Response Object - * @returns void - */ - -exports.returnGenerator = function(req, res) { - res.render('bonfire/generator', { - title: null, - name: null, - difficulty: null, - brief: null, - details: null, - tests: null, - challengeSeed: null, - bonfireHash: randomString() - }); -}; - -/** - * Post for bonfire generation - */ - -function randomString() { - var chars = '0123456789abcdef'; - var string_length = 23; - var randomstring = 'a'; - for (var i = 0; i < string_length; i++) { - var rnum = Math.floor(Math.random() * chars.length); - randomstring += chars.substring(rnum, rnum + 1); - } - return randomstring; -} - -/** - * Helper function to populate the MDN links array. - */ - -function getMDNlinks(links) { - // takes in an array of links, which are strings - var populatedLinks = []; - - // for each key value, push the corresponding link from the MDNlinks object into a new array - links.forEach(function(value, index) { - populatedLinks.push(MDNlinks[value]); - }); - - return populatedLinks; - -} - -/** - * - */ - -exports.testBonfire = function(req, res) { - var bonfireName = req.body.name, - bonfireTests = req.body.tests, - bonfireDifficulty = req.body.difficulty, - bonfireDescription = req.body.description, - bonfireChallengeSeed = req.body.challengeSeed; - bonfireTests = bonfireTests.split('\r\n'); - bonfireDescription = bonfireDescription.split('\r\n'); - bonfireTests.filter(getRidOfEmpties); - bonfireDescription.filter(getRidOfEmpties); - bonfireChallengeSeed = bonfireChallengeSeed.replace('\r', ''); - - res.render('bonfire/show', { - completedWith: null, - title: bonfireName, - name: bonfireName, - difficulty: +bonfireDifficulty, - brief: bonfireDescription[0], - details: bonfireDescription.slice(1), - tests: bonfireTests, - challengeSeed: bonfireChallengeSeed, - cc: req.user ? req.user.bonfiresHash : undefined, - progressTimestamps: req.user ? req.user.progressTimestamps : undefined, - verb: resources.randomVerb(), - phrase: resources.randomPhrase(), - compliment: resources.randomCompliment(), - bonfires: [], - bonfireHash: 'test' - }); -}; - -function getRidOfEmpties(elem) { - if (elem.length > 0) { - return elem; - } -} - -exports.publicGenerator = function(req, res) { - res.render('bonfire/public-generator'); -}; - -exports.generateChallenge = function(req, res) { - var bonfireName = req.body.name, - bonfireTests = req.body.tests, - bonfireDifficulty = req.body.difficulty, - bonfireDescription = req.body.description, - bonfireChallengeSeed = req.body.challengeSeed; - bonfireTests = bonfireTests.split('\r\n'); - bonfireDescription = bonfireDescription.split('\r\n'); - bonfireTests.filter(getRidOfEmpties); - bonfireDescription.filter(getRidOfEmpties); - bonfireChallengeSeed = bonfireChallengeSeed.replace('\r', ''); - - - var response = { - _id: randomString(), - name: bonfireName, - difficulty: bonfireDifficulty, - description: bonfireDescription, - challengeSeed: bonfireChallengeSeed, - tests: bonfireTests - }; - res.send(response); -}; - -exports.completedBonfire = function (req, res, next) { - var isCompletedWith = req.body.bonfireInfo.completedWith || ''; - var isCompletedDate = Math.round(+new Date()); - var bonfireHash = req.body.bonfireInfo.bonfireHash; - var isSolution = req.body.bonfireInfo.solution; - var bonfireName = req.body.bonfireInfo.bonfireName; - - if (isCompletedWith) { - var paired = User.find({'profile.username': isCompletedWith - .toLowerCase()}).limit(1); - paired.exec(function (err, pairedWith) { - if (err) { - return next(err); - } else { - var index = req.user.uncompletedBonfires.indexOf(bonfireHash); - if (index > -1) { - req.user.progressTimestamps.push(Date.now() || 0); - req.user.uncompletedBonfires.splice(index, 1); - } - pairedWith = pairedWith.pop(); - - index = pairedWith.uncompletedBonfires.indexOf(bonfireHash); - if (index > -1) { - pairedWith.progressTimestamps.push(Date.now() || 0); - pairedWith.uncompletedBonfires.splice(index, 1); - - } - - pairedWith.completedBonfires.push({ - _id: bonfireHash, - name: bonfireName, - completedWith: req.user._id, - completedDate: isCompletedDate, - solution: isSolution - }); - - req.user.completedBonfires.push({ - _id: bonfireHash, - name: bonfireName, - completedWith: pairedWith._id, - completedDate: isCompletedDate, - solution: isSolution - }); - - req.user.save(function (err, user) { - if (err) { - return next(err); - } - pairedWith.save(function (err, paired) { - if (err) { - return next(err); - } - if (user && paired) { - res.send(true); - } - }); - }); - } - }); - } else { - req.user.completedBonfires.push({ - _id: bonfireHash, - name: bonfireName, - completedWith: null, - completedDate: isCompletedDate, - solution: isSolution - }); - - var index = req.user.uncompletedBonfires.indexOf(bonfireHash); - if (index > -1) { - - req.user.progressTimestamps.push(Date.now() || 0); - req.user.uncompletedBonfires.splice(index, 1); - } - - req.user.save(function (err, user) { - if (err) { - return next(err); - } - if (user) { - res.send(true); - } - }); - } -}; diff --git a/controllers/challenge.js b/controllers/challenge.js new file mode 100644 index 0000000000..d3af11c5be --- /dev/null +++ b/controllers/challenge.js @@ -0,0 +1,555 @@ +/** + * Created by nathanleniz on 5/15/15. + * Copyright (c) 2015, Free Code Camp + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +var R = require('ramda'), + Challenge = require('./../models/Challenge'), + User = require('./../models/User'), + resources = require('./resources'), + MDNlinks = require('./../seed_data/bonfireMDNlinks'); + +var challengeMapWithNames = resources.getChallengeMapWithNames(); +var challengeMapWithIds = resources.getChallengeMapWithIds(); + +function getMDNlinks(links) { + // takes in an array of links, which are strings + var populatedLinks = []; + + // for each key value, push the corresponding link + // from the MDNlinks object into a new array + if (links) { + links.forEach(function (value) { + populatedLinks.push(MDNlinks[value]); + }); + } + return populatedLinks; +} + +exports.returnNextChallenge = function(req, res, next) { + if (!req.user) { + return res.redirect('../challenges/learn-how-free-code-camp-works'); + } + var completed = req.user.completedChallenges.map(function (elem) { + return elem._id; + }); + + req.user.uncompletedChallenges = resources.allChallengeIds() + .filter(function (elem) { + if (completed.indexOf(elem) === -1) { + return elem; + } + }); + + // find the user's current challenge and block + // look in that block and find the index of their current challenge + // if index + 1 < block.challenges.length + // serve index + 1 challenge + // otherwise increment block key and serve the first challenge in that block + // unless the next block is undefined, which means no next block + var nextChallengeName; + + var challengeId = String(req.user.currentChallenge.challengeId); + var challengeBlock = req.user.currentChallenge.challengeBlock; + var indexOfChallenge = challengeMapWithIds[challengeBlock] + .indexOf(challengeId); + + if (indexOfChallenge + 1 + < challengeMapWithIds[challengeBlock].length) { + nextChallengeName = + challengeMapWithNames[challengeBlock][++indexOfChallenge]; + } else if (typeof challengeMapWithIds[++challengeBlock] !== 'undefined') { + nextChallengeName = R.head(challengeMapWithNames[challengeBlock]); + } else { + req.flash('errors', { + msg: 'It looks like you have finished all of our challenges.' + + ' Great job! Now on to helping nonprofits!' + }); + nextChallengeName = R.head(challengeMapWithNames[0].challenges); + } + + var nameString = nextChallengeName.trim() + .toLowerCase() + .replace(/\s/g, '-'); + + req.user.save(function(err) { + if (err) { + return next(err); + } + return res.redirect('../challenges/' + nameString); + }); +}; + +exports.returnCurrentChallenge = function(req, res, next) { + if (!req.user) { + return res.redirect('../challenges/learn-how-free-code-camp-works'); + } + var completed = req.user.completedChallenges.map(function (elem) { + return elem._id; + }); + + req.user.uncompletedChallenges = resources.allChallengeIds() + .filter(function (elem) { + if (completed.indexOf(elem) === -1) { + return elem; + } + }); + if (!req.user.currentChallenge) { + req.user.currentChallenge = {}; + req.user.currentChallenge.challengeId = challengeMapWithIds['0'][0]; + req.user.currentChallenge.challengeName = challengeMapWithNames['0'][0]; + req.user.currentChallenge.challengeBlock = '0'; + req.user.save(function(err) { + if (err) { + return next(err); + } + return res.redirect('../challenges/learn-how-free-code-camp-works'); + }); + } + var nameString = req.user.currentChallenge.challengeName.trim() + .toLowerCase() + .replace(/\s/g, '-') + .replace(/[^a-z0-9\-\/.]/gi, ''); + req.user.save(function(err) { + if (err) { + return next(err); + } + return res.redirect('../challenges/' + nameString); + }); +}; + +exports.returnIndividualChallenge = function(req, res, next) { + var dashedName = req.params.challengeName; + + var challengeName = dashedName.replace(/\-/g, ' ') + .split(' ') + .slice(1) + .join(' '); + + Challenge.find({'name': new RegExp(challengeName, 'i')}, + function(err, challengeFromMongo) { + if (err) { + return next(err); + } + // Handle not found + if (challengeFromMongo.length < 1) { + req.flash('errors', { + msg: '404: We couldn\'t find a challenge with that name. ' + + 'Please double check the name.' + }); + return res.redirect('/challenges'); + } + var challenge = challengeFromMongo.pop(); + // Redirect to full name if the user only entered a partial + var dashedNameFull = challenge.name + .toLowerCase() + .replace(/\s/g, '-') + .replace(/[^a-z0-9\-\.]/gi, ''); + if (dashedNameFull !== dashedName) { + return res.redirect('../challenges/' + dashedNameFull); + } else { + if (req.user) { + req.user.currentChallenge = { + challengeId: challenge._id, + challengeName: challenge.name, + challengeBlock: R.head(R.flatten(Object.keys(challengeMapWithIds). + map(function (key) { + return challengeMapWithIds[key] + .filter(function (elem) { + return String(elem) === String(challenge._id); + }).map(function () { + return key; + }); + }) + )) + }; + } + } + + var challengeType = { + 0: function() { + res.render('coursewares/showHTML', { + title: challenge.name, + dashedName: dashedName, + name: challenge.name, + brief: challenge.description[0], + details: challenge.description.slice(1), + tests: challenge.tests, + challengeSeed: challenge.challengeSeed, + verb: resources.randomVerb(), + phrase: resources.randomPhrase(), + compliment: resources.randomCompliment(), + challengeId: challenge._id, + environment: resources.whichEnvironment(), + challengeType: challenge.challengeType + }); + }, + + 1: function() { + res.render('coursewares/showJS', { + title: challenge.name, + dashedName: dashedName, + name: challenge.name, + brief: challenge.description[0], + details: challenge.description.slice(1), + tests: challenge.tests, + challengeSeed: challenge.challengeSeed, + verb: resources.randomVerb(), + phrase: resources.randomPhrase(), + compliment: resources.randomCompliment(), + challengeId: challenge._id, + challengeType: challenge.challengeType + }); + }, + + 2: function() { + res.render('coursewares/showVideo', { + title: challenge.name, + dashedName: dashedName, + name: challenge.name, + details: challenge.description, + tests: challenge.tests, + video: challenge.challengeSeed[0], + verb: resources.randomVerb(), + phrase: resources.randomPhrase(), + compliment: resources.randomCompliment(), + challengeId: challenge._id, + challengeType: challenge.challengeType + }); + }, + + 3: function() { + res.render('coursewares/showZiplineOrBasejump', { + title: challenge.name, + dashedName: dashedName, + name: challenge.name, + details: challenge.description, + video: challenge.challengeSeed[0], + verb: resources.randomVerb(), + phrase: resources.randomPhrase(), + compliment: resources.randomCompliment(), + challengeId: challenge._id, + challengeType: challenge.challengeType + }); + }, + + 4: function() { + res.render('coursewares/showZiplineOrBasejump', { + title: challenge.name, + dashedName: dashedName, + name: challenge.name, + details: challenge.description, + video: challenge.challengeSeed[0], + verb: resources.randomVerb(), + phrase: resources.randomPhrase(), + compliment: resources.randomCompliment(), + challengeId: challenge._id, + challengeType: challenge.challengeType + }); + }, + + 5: function() { + res.render('coursewares/showBonfire', { + completedWith: null, + title: challenge.name, + dashedName: dashedName, + name: challenge.name, + difficulty: Math.floor(+challenge.difficulty), + brief: challenge.description.shift(), + details: challenge.description, + tests: challenge.tests, + challengeSeed: challenge.challengeSeed, + verb: resources.randomVerb(), + phrase: resources.randomPhrase(), + compliment: resources.randomCompliment(), + bonfires: challenge, + challengeId: challenge._id, + MDNkeys: challenge.MDNlinks, + MDNlinks: getMDNlinks(challenge.MDNlinks), + challengeType: challenge.challengeType + }); + } + }; + if (req.user) { + req.user.save(function (err) { + if (err) { + return next(err); + } + return challengeType[challenge.challengeType](); + }); + } else { + return challengeType[challenge.challengeType](); + } + }); +}; + +exports.completedBonfire = function (req, res, next) { + var isCompletedWith = req.body.challengeInfo.completedWith || ''; + var isCompletedDate = Math.round(+new Date()); + var challengeId = req.body.challengeInfo.challengeId; + var isSolution = req.body.challengeInfo.solution; + var challengeName = req.body.challengeInfo.challengeName; + + if (isCompletedWith) { + var paired = User.find({'profile.username': isCompletedWith.toLowerCase()}) + .limit(1); + paired.exec(function (err, pairedWith) { + if (err) { + return next(err); + } else { + var index = req.user.uncompletedChallenges.indexOf(challengeId); + if (index > -1) { + req.user.progressTimestamps.push(Date.now() || 0); + req.user.uncompletedChallenges.splice(index, 1); + } + pairedWith = pairedWith.pop(); + if (pairedWith) { + + index = pairedWith.uncompletedChallenges.indexOf(challengeId); + if (index > -1) { + pairedWith.progressTimestamps.push(Date.now() || 0); + pairedWith.uncompletedChallenges.splice(index, 1); + + } + + pairedWith.completedChallenges.push({ + _id: challengeId, + name: challengeName, + completedWith: req.user._id, + completedDate: isCompletedDate, + solution: isSolution, + challengeType: 5 + }); + + req.user.completedChallenges.push({ + _id: challengeId, + name: challengeName, + completedWith: pairedWith._id, + completedDate: isCompletedDate, + solution: isSolution, + challengeType: 5 + }); + } + // User said they paired, but pair wasn't found + req.user.completedChallenges.push({ + _id: challengeId, + name: challengeName, + completedWith: null, + completedDate: isCompletedDate, + solution: isSolution, + challengeType: 5 + }); + + + req.user.save(function (err, user) { + if (err) { + return next(err); + } + if (pairedWith) { + pairedWith.save(function (err, paired) { + if (err) { + return next(err); + } + if (user && paired) { + res.send(true); + } + }); + } else { + if (user) { + res.send(true); + } + } + }); + } + }); + } else { + req.user.completedChallenges.push({ + _id: challengeId, + name: challengeName, + completedWith: null, + completedDate: isCompletedDate, + solution: isSolution, + challengeType: 5 + }); + + var index = req.user.uncompletedChallenges.indexOf(challengeId); + if (index > -1) { + + req.user.progressTimestamps.push(Date.now() || 0); + req.user.uncompletedChallenges.splice(index, 1); + } + + req.user.save(function (err, user) { + if (err) { + return next(err); + } + // NOTE(berks): Under certain conditions the res is never ended + if (user) { + res.send(true); + } + }); + } +}; + +exports.completedChallenge = function (req, res, next) { + + var isCompletedDate = Math.round(+new Date()); + var challengeId = req.body.challengeInfo.challengeId; + + req.user.completedChallenges.push({ + _id: challengeId, + completedDate: isCompletedDate, + name: req.body.challengeInfo.challengeName, + solution: null, + githubLink: null, + verified: true + }); + var index = req.user.uncompletedChallenges.indexOf(challengeId); + + if (index > -1) { + req.user.progressTimestamps.push(Date.now() || 0); + req.user.uncompletedChallenges.splice(index, 1); + } + + req.user.save(function (err, user) { + if (err) { + return next(err); + } + if (user) { + res.sendStatus(200); + } + }); +}; + +exports.completedZiplineOrBasejump = function (req, res, next) { + + var isCompletedWith = req.body.challengeInfo.completedWith || false; + var isCompletedDate = Math.round(+new Date()); + var challengeId = req.body.challengeInfo.challengeId; + var solutionLink = req.body.challengeInfo.publicURL; + var githubLink = req.body.challengeInfo.challengeType === '4' + ? req.body.challengeInfo.githubURL : true; + if (!solutionLink || !githubLink) { + req.flash('errors', { + msg: 'You haven\'t supplied the necessary URLs for us to inspect ' + + 'your work.' + }); + return res.sendStatus(403); + } + + if (isCompletedWith) { + var paired = User.find({'profile.username': isCompletedWith.toLowerCase()}) + .limit(1); + + paired.exec(function (err, pairedWithFromMongo) { + if (err) { + return next(err); + } else { + var index = req.user.uncompletedChallenges.indexOf(challengeId); + if (index > -1) { + req.user.progressTimestamps.push(Date.now() || 0); + req.user.uncompletedChallenges.splice(index, 1); + } + var pairedWith = pairedWithFromMongo.pop(); + + req.user.completedChallenges.push({ + _id: challengeId, + name: req.body.challengeInfo.challengeName, + completedWith: pairedWith._id, + completedDate: isCompletedDate, + solution: solutionLink, + githubLink: githubLink, + verified: false + }); + + req.user.save(function (err, user) { + if (err) { + return next(err); + } + + if (req.user._id.toString() === pairedWith._id.toString()) { + return res.sendStatus(200); + } + index = pairedWith.uncompletedChallenges.indexOf(challengeId); + if (index > -1) { + pairedWith.progressTimestamps.push(Date.now() || 0); + pairedWith.uncompletedChallenges.splice(index, 1); + + } + + pairedWith.completedChallenges.push({ + _id: challengeId, + name: req.body.challengeInfo.coursewareName, + completedWith: req.user._id, + completedDate: isCompletedDate, + solution: solutionLink, + githubLink: githubLink, + verified: false + }); + pairedWith.save(function (err, paired) { + if (err) { + return next(err); + } + if (user && paired) { + return res.sendStatus(200); + } + }); + }); + } + }); + } else { + + req.user.completedChallenges.push({ + _id: challengeId, + name: req.body.challengeInfo.challengeName, + completedWith: null, + completedDate: isCompletedDate, + solution: solutionLink, + githubLink: githubLink, + verified: false + }); + + var index = req.user.uncompletedChallenges.indexOf(challengeId); + if (index > -1) { + req.user.progressTimestamps.push(Date.now() || 0); + req.user.uncompletedChallenges.splice(index, 1); + } + + req.user.save(function (err, user) { + if (err) { + return next(err); + } + // NOTE(berks): under certain conditions this will not close the response. + if (user) { + return res.sendStatus(200); + } + }); + } +}; diff --git a/controllers/challengeMap.js b/controllers/challengeMap.js index e10c7ab409..9c9eb36bac 100644 --- a/controllers/challengeMap.js +++ b/controllers/challengeMap.js @@ -1,81 +1,53 @@ -var async = require('async'), - User = require('../models/User'), - Bonfire = require('./../models/Bonfire'), - Story = require('./../models/Story'), - Nonprofit = require('./../models/Nonprofit'), - Comment = require('./../models/Comment'), - Courseware = require('./../models/Courseware'), - resources = require('./resources'), - steps = resources.steps, - secrets = require('./../config/secrets'), - bonfires = require('../seed_data/bonfires.json'), - nonprofits = require('../seed_data/nonprofits.json'), - coursewares = require('../seed_data/coursewares.json'), - moment = require('moment'), - https = require('https'), - debug = require('debug')('freecc:cntr:resources'), - cheerio = require('cheerio'), - request = require('request'), - R = require('ramda'); +var R = require('ramda'), + debug = require('debug')('freecc:cntr:challengeMap'), + User = require('../models/User'), + resources = require('./resources'); + +var challengeTypes = { + 'HTML_CSS_JQ': 0, + 'JAVASCRIPT': 1, + 'VIDEO': 2, + 'ZIPLINE': 3, + 'BASEJUMP': 4, + 'BONFIRE': 5 +}; module.exports = { - challengeMap: function challengeMap(req, res) { - var completedBonfires = []; + challengeMap: function challengeMap(req, res, next) { var completedList = []; if (req.user) { - completedBonfires = req.user.completedBonfires.map(function (elem) { - return elem._id; - }); + completedList = req.user.completedChallenges; } - if (req.user) { - completedList = req.user.completedCoursewares.map(function (elem) { - return elem._id; + var noDuplicatedChallenges = R.uniq(completedList); + + + var challengeList = resources.getChallengeMapForDisplay(); + var completedChallengeList = noDuplicatedChallenges + .map(function(challenge) { + return challenge._id; }); - } - - var noDuplicateBonfires = R.uniq(completedBonfires); - var noDuplicatedCoursewares = R.uniq(completedList); - - bonfireList = resources.allBonfireNames(); - completedBonfireList = noDuplicateBonfires; - coursewareList = resources.allCoursewareNames(); - completedCoursewareList = noDuplicatedCoursewares; - waypoints = coursewareList.filter(function(challenge) { - if (challenge.challengeType === 2) { return challenge } - }); - ziplines = coursewareList.filter(function(challenge) { - if (challenge.challengeType === 3) { return challenge } - }); - basejumps = coursewareList.filter(function(challenge) { - if (challenge.challengeType === 4) { return challenge } - }); function numberWithCommas(x) { - return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); + return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); } - var date1 = new Date("10/15/2014"); + var date1 = new Date('10/15/2014'); var date2 = new Date(); var timeDiff = Math.abs(date2.getTime() - date1.getTime()); var daysRunning = Math.ceil(timeDiff / (1000 * 3600 * 24)); User.count({}, function (err, camperCount) { if (err) { - debug('User err: ', err); return next(err); } res.render('challengeMap/show', { daysRunning: daysRunning, camperCount: numberWithCommas(camperCount), title: "A map of all Free Code Camp's Challenges", - bonfires: bonfireList, - waypoints: waypoints, - ziplines: ziplines, - basejumps: basejumps, - completedBonfireList: completedBonfireList, - completedCoursewareList: completedCoursewareList + challengeList: challengeList, + completedChallengeList: completedChallengeList }); }); } diff --git a/controllers/constantStrings.json b/controllers/constantStrings.json new file mode 100644 index 0000000000..70f5d9766c --- /dev/null +++ b/controllers/constantStrings.json @@ -0,0 +1,3 @@ +{ + "gitHubUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1521.3 Safari/537.36" +} diff --git a/controllers/courseware.js b/controllers/courseware.js deleted file mode 100644 index 267f09d6e5..0000000000 --- a/controllers/courseware.js +++ /dev/null @@ -1,388 +0,0 @@ -var _ = require('lodash'), - debug = require('debug')('freecc:cntr:courseware'), - Courseware = require('./../models/Courseware'), - User = require('./../models/User'), - resources = require('./resources'), - R = require('ramda'), - moment = require('moment'); - -/** - * Courseware controller - */ - -exports.showAllCoursewares = function(req, res) { - var completedList = []; - if(req.user) { - completedList = req.user.completedCoursewares.map(function (elem) { - return elem._id; - }); - } - var noDuplicatedCoursewares = R.uniq(completedList); - var data = {}; - data.coursewareList = resources.allCoursewareNames(); - data.completedList = noDuplicatedCoursewares; - res.send(data); -}; - -exports.returnNextCourseware = function(req, res, next) { - if (!req.user) { - return res.redirect('../challenges/learn-how-free-code-camp-works'); - } - if (req.user.finishedWaypoints && req.user.uncompletedBonfires.length > 0) { - return res.redirect('../bonfires') - } - - var completed = req.user.completedCoursewares.map(function (elem) { - return elem._id; - }); - - req.user.uncompletedCoursewares = resources.allCoursewareIds() - .filter(function (elem) { - if (completed.indexOf(elem) === -1) { - return elem; - } - }); - req.user.save(); - - var uncompletedCoursewares = req.user.uncompletedCoursewares[0]; - - - var displayedCoursewares = Courseware.find({'_id': uncompletedCoursewares}); - displayedCoursewares.exec(function(err, courseware) { - if (err) { - return next(err); - } - - courseware = courseware.pop(); - if (typeof courseware === 'undefined') { - req.flash('errors', { - msg: "It looks like you've completed all the courses we have " + - "available. Good job!" - }); - return res.redirect('../challenges/learn-how-free-code-camp-works'); - } - var nameString = courseware.name.toLowerCase().replace(/\s/g, '-'); - return res.redirect('../challenges/' + nameString); - }); -}; - -exports.returnIndividualCourseware = function(req, res, next) { - var dashedName = req.params.coursewareName; - - var coursewareName = dashedName.replace(/\-/g, ' '); - - Courseware.find({'name': new RegExp(coursewareName, 'i')}, - function(err, coursewareFromMongo) { - if (err) { - next(err); - } - // Handle not found - if (coursewareFromMongo.length < 1) { - req.flash('errors', { - msg: "404: We couldn't find a challenge with that name. " + - "Please double check the name." - }); - return res.redirect('/challenges'); - } - var courseware = coursewareFromMongo.pop(); - - // Redirect to full name if the user only entered a partial - var dashedNameFull = courseware.name.toLowerCase().replace(/\s/g, '-'); - if (dashedNameFull !== dashedName) { - return res.redirect('../challenges/' + dashedNameFull); - } - - var challengeType = { - 0: function() { - res.render('coursewares/showHTML', { - title: courseware.name, - dashedName: dashedName, - name: courseware.name, - brief: courseware.description[0], - details: courseware.description.slice(1), - tests: courseware.tests, - challengeSeed: courseware.challengeSeed, - verb: resources.randomVerb(), - phrase: resources.randomPhrase(), - compliment: resources.randomCompliment(), - coursewareHash: courseware._id, - environment: resources.whichEnvironment(), - challengeType: courseware.challengeType - }); - }, - - 1: function() { - res.render('coursewares/showJS', { - title: courseware.name, - dashedName: dashedName, - name: courseware.name, - brief: courseware.description[0], - details: courseware.description.slice(1), - tests: courseware.tests, - challengeSeed: courseware.challengeSeed, - verb: resources.randomVerb(), - phrase: resources.randomPhrase(), - compliment: resources.randomCompliment(), - coursewareHash: courseware._id, - challengeType: courseware.challengeType - }); - }, - - 2: function() { - res.render('coursewares/showVideo', { - title: courseware.name, - dashedName: dashedName, - name: courseware.name, - details: courseware.description, - tests: courseware.tests, - video: courseware.challengeSeed[0], - verb: resources.randomVerb(), - phrase: resources.randomPhrase(), - compliment: resources.randomCompliment(), - coursewareHash: courseware._id, - challengeType: courseware.challengeType - }); - }, - - 3: function() { - res.render('coursewares/showZiplineOrBasejump', { - title: courseware.name, - dashedName: dashedName, - name: courseware.name, - details: courseware.description, - video: courseware.challengeSeed[0], - verb: resources.randomVerb(), - phrase: resources.randomPhrase(), - compliment: resources.randomCompliment(), - coursewareHash: courseware._id, - challengeType: courseware.challengeType - }); - }, - - 4: function() { - res.render('coursewares/showZiplineOrBasejump', { - title: courseware.name, - dashedName: dashedName, - name: courseware.name, - details: courseware.description, - video: courseware.challengeSeed[0], - verb: resources.randomVerb(), - phrase: resources.randomPhrase(), - compliment: resources.randomCompliment(), - coursewareHash: courseware._id, - challengeType: courseware.challengeType - }); - } - }; - - return challengeType[courseware.challengeType](); - - }); -}; - -exports.testCourseware = function(req, res) { - var coursewareName = req.body.name, - coursewareTests = req.body.tests, - coursewareDifficulty = req.body.difficulty, - coursewareDescription = req.body.description, - coursewareEntryPoint = req.body.challengeEntryPoint, - coursewareChallengeSeed = req.body.challengeSeed; - coursewareTests = coursewareTests.split('\r\n'); - coursewareDescription = coursewareDescription.split('\r\n'); - coursewareTests.filter(getRidOfEmpties); - coursewareDescription.filter(getRidOfEmpties); - coursewareChallengeSeed = coursewareChallengeSeed.replace('\r', ''); - res.render('courseware/show', { - completedWith: null, - title: coursewareName, - name: coursewareName, - difficulty: +coursewareDifficulty, - brief: coursewareDescription[0], - details: coursewareDescription.slice(1), - tests: coursewareTests, - challengeSeed: coursewareChallengeSeed, - challengeEntryPoint: coursewareEntryPoint, - cc: req.user ? req.user.coursewaresHash : undefined, - progressTimestamps: req.user ? req.user.progressTimestamps : undefined, - verb: resources.randomVerb(), - phrase: resources.randomPhrase(), - compliment: resources.randomCompliment(), - coursewares: [], - coursewareHash: 'test' - }); -}; - -function getRidOfEmpties(elem) { - if (elem.length > 0) { - return elem; - } -} - -exports.publicGenerator = function(req, res) { - res.render('courseware/public-generator'); -}; - -exports.generateChallenge = function(req, res) { - var coursewareName = req.body.name, - coursewareTests = req.body.tests, - coursewareDifficulty = req.body.difficulty, - coursewareDescription = req.body.description, - coursewareEntryPoint = req.body.challengeEntryPoint, - coursewareChallengeSeed = req.body.challengeSeed; - coursewareTests = coursewareTests.split('\r\n'); - coursewareDescription = coursewareDescription.split('\r\n'); - coursewareTests.filter(getRidOfEmpties); - coursewareDescription.filter(getRidOfEmpties); - coursewareChallengeSeed = coursewareChallengeSeed.replace('\r', ''); - - var response = { - _id: randomString(), - name: coursewareName, - difficulty: coursewareDifficulty, - description: coursewareDescription, - challengeEntryPoint: coursewareEntryPoint, - challengeSeed: coursewareChallengeSeed, - tests: coursewareTests - }; - res.send(response); -}; - -exports.completedCourseware = function (req, res, next) { - - var isCompletedDate = Math.round(+new Date()); - var coursewareHash = req.body.coursewareInfo.coursewareHash; - if (coursewareHash === "bd7139d8c441eddfaeb5bdef") { - req.user.finishedWaypoints = true; - } - - req.user.completedCoursewares.push({ - _id: coursewareHash, - completedDate: isCompletedDate, - name: req.body.coursewareInfo.coursewareName, - solution: null, - githubLink: null, - verified: true - }); - var index = req.user.uncompletedCoursewares.indexOf(coursewareHash); - - if (index > -1) { - req.user.progressTimestamps.push(Date.now() || 0); - req.user.uncompletedCoursewares.splice(index, 1); - } - - req.user.save(function (err, user) { - if (err) { - return next(err); - } - if (user) { - res.sendStatus(200); - } - }); -}; - -exports.completedZiplineOrBasejump = function (req, res, next) { - debug('Inside controller for completed zipline or basejump with data %s', - req.body.coursewareInfo); - var isCompletedWith = req.body.coursewareInfo.completedWith || false; - var isCompletedDate = Math.round(+new Date()); - var coursewareHash = req.body.coursewareInfo.coursewareHash; - var solutionLink = req.body.coursewareInfo.publicURL; - var githubLink = req.body.coursewareInfo.challengeType === '4' - ? req.body.coursewareInfo.githubURL : true; - if (!solutionLink || !githubLink) { - req.flash('errors', { - msg: 'You haven\'t supplied the necessary URLs for us to inspect ' + - 'your work.' - }); - return res.sendStatus(403); - } - - if (isCompletedWith) { - var paired = User.find({'profile.username': isCompletedWith.toLowerCase()}).limit(1); - paired.exec(function (err, pairedWithFromMongo) { - if (err) { - return next(err); - } else { - var index = req.user.uncompletedCoursewares.indexOf(coursewareHash); - if (index > -1) { - req.user.progressTimestamps.push(Date.now() || 0); - req.user.uncompletedCoursewares.splice(index, 1); - } - var pairedWith = pairedWithFromMongo.pop(); - - req.user.completedCoursewares.push({ - _id: coursewareHash, - name: req.body.coursewareInfo.coursewareName, - completedWith: pairedWith._id, - completedDate: isCompletedDate, - solution: solutionLink, - githubLink: githubLink, - verified: false - }); - - req.user.save(function (err, user) { - if (err) { - return next(err); - } - debug('this is the user object returned %s,' + - ' this is the req.user._id %s, ' + - 'this is the pairedWith._id %s', user, req.user._id, pairedWith._id); - debug(req.user._id.toString() === pairedWith._id.toString()); - if (req.user._id.toString() === pairedWith._id.toString()) { - return res.sendStatus(200); - } - index = pairedWith.uncompletedCoursewares.indexOf(coursewareHash); - if (index > -1) { - pairedWith.progressTimestamps.push(Date.now() || 0); - pairedWith.uncompletedCoursewares.splice(index, 1); - - } - - pairedWith.completedCoursewares.push({ - _id: coursewareHash, - name: req.body.coursewareInfo.coursewareName, - completedWith: req.user._id, - completedDate: isCompletedDate, - solution: solutionLink, - githubLink: githubLink, - verified: false - }); - pairedWith.save(function (err, paired) { - if (err) { - return next(err); - } - if (user && paired) { - return res.sendStatus(200); - } - }); - }); - } - }); - } else { - - req.user.completedCoursewares.push({ - _id: coursewareHash, - name: req.body.coursewareInfo.coursewareName, - completedWith: null, - completedDate: isCompletedDate, - solution: solutionLink, - githubLink: githubLink, - verified: false - }); - - var index = req.user.uncompletedCoursewares.indexOf(coursewareHash); - if (index > -1) { - req.user.progressTimestamps.push(Date.now() || 0); - req.user.uncompletedCoursewares.splice(index, 1); - } - - req.user.save(function (err, user) { - if (err) { - return next(err); - } - if (user) { - return res.sendStatus(200); - } - }); - } -}; diff --git a/controllers/fieldGuide.js b/controllers/fieldGuide.js index f8e35a47de..49e4d80dab 100644 --- a/controllers/fieldGuide.js +++ b/controllers/fieldGuide.js @@ -1,84 +1,102 @@ -var _ = require('lodash'), - debug = require('debug')('freecc:cntr:fieldGuide'), +var R = require('ramda'), FieldGuide = require('./../models/FieldGuide'), - resources = require('./resources'), - R = require('ramda'); + resources = require('./resources'); exports.returnIndividualFieldGuide = function(req, res, next) { - var dashedName = req.params.fieldGuideName; + var dashedName = req.params.fieldGuideName; - var fieldGuideName = dashedName.replace(/\-/g, ' '); + var fieldGuideName = dashedName.replace(/\-/g, ' ') + .replace(/[^a-z0-9\s]/gi, ''); - if (req.user) { - var completed = req.user.completedFieldGuides; + if (req.user) { + var completed = req.user.completedFieldGuides; - var uncompletedFieldGuides = resources.allFieldGuideIds().filter(function (elem) { + var uncompletedFieldGuides = resources.allFieldGuideIds() + .filter(function (elem) { if (completed.indexOf(elem) === -1) { return elem; } }); - req.user.uncompletedFieldGuides = uncompletedFieldGuides; - req.user.save(); - } + req.user.uncompletedFieldGuides = uncompletedFieldGuides; + // TODO(berks): handle callback properly + req.user.save(); + } - FieldGuide.find({'name': new RegExp(fieldGuideName, 'i')}, function(err, fieldGuideFromMongo) { - if (err) { - next(err); - } + FieldGuide.find( + { name: new RegExp(fieldGuideName, 'i') }, + function(err, fieldGuideFromMongo) { + if (err) { + return next(err); + } - if (fieldGuideFromMongo.length < 1) { - req.flash('errors', { - msg: "404: We couldn't find a field guide entry with that name. Please double check the name." - }); - - return res.redirect('/field-guide'); - } - - var fieldGuide = R.head(fieldGuideFromMongo); - var dashedNameFull = fieldGuide.name.toLowerCase().replace(/\s/g, '-').replace(/\?/g, ''); - if (dashedNameFull !== dashedName) { - return res.redirect('../field-guide/' + dashedNameFull); - } - res.render('field-guide/show', { - title: fieldGuide.name, - fieldGuideId: fieldGuide._id, - description: fieldGuide.description.join('') + if (fieldGuideFromMongo.length < 1) { + req.flash('errors', { + msg: "404: We couldn't find a field guide entry with that name. " + + 'Please double check the name.' }); - }); + + return res.redirect('/field-guide'); + } + + var fieldGuide = R.head(fieldGuideFromMongo); + var dashedNameFull = + fieldGuide.name.toLowerCase() + .replace(/\s/g, '-') + .replace(/[^a-z0-9\-]/gi, ''); + + if (dashedNameFull !== dashedName) { + return res.redirect('../field-guide/' + dashedNameFull); + } + res.render('field-guide/show', { + title: fieldGuide.name, + fieldGuideId: fieldGuide._id, + description: fieldGuide.description.join('') + }); + } + ); }; exports.showAllFieldGuides = function(req, res) { - var data = {}; - data.fieldGuideList = resources.allFieldGuideNames(); - data.fieldGuideIds = resources.allFieldGuideIds(); - if (req.user && req.user.completedFieldGuides) { - data.completedFieldGuides = req.user.completedFieldGuides; - } else { - data.completedFieldGuides = []; - } - res.send(data); + var allFieldGuideNamesAndIds = resources.allFieldGuideNamesAndIds(); + + var completedFieldGuides = []; + if (req.user && req.user.completedFieldGuides) { + completedFieldGuides = req.user.completedFieldGuides; + } + res.render('field-guide/all-articles', { + allFieldGuideNamesAndIds: allFieldGuideNamesAndIds, + completedFieldGuides: completedFieldGuides + }); }; exports.returnNextFieldGuide = function(req, res, next) { if (!req.user) { - return res.redirect('/field-guide/how-do-i-use-this-guide?'); + return res.redirect('/field-guide/how-do-i-use-this-guide'); } - var displayedFieldGuides = FieldGuide.find({'_id': req.user.uncompletedFieldGuides[0]}); + var displayedFieldGuides = + FieldGuide.find({'_id': req.user.uncompletedFieldGuides[0]}); + displayedFieldGuides.exec(function(err, fieldGuide) { - if (err) { - return next(err); - } + if (err) { return next(err); } fieldGuide = fieldGuide.pop(); + if (typeof fieldGuide === 'undefined') { if (req.user.completedFieldGuides.length > 0) { req.flash('success', { - msg: "You've read all our current Field Guide entries. You can contribute to our Field Guide here." + msg: [ + "You've read all our current Field Guide entries. You can ", + 'contribute to our Field Guide ', + "here." + ].join('') }); } - return res.redirect('../field-guide/how-do-i-use-this-guide?'); + return res.redirect('../field-guide/how-do-i-use-this-guide'); } - var nameString = fieldGuide.name.toLowerCase().replace(/\s/g, '-'); + var nameString = fieldGuide.name.toLowerCase() + .replace(/\s/g, '-') + .replace(/[^a-z0-9\-]/gi, ''); return res.redirect('../field-guide/' + nameString); }); }; @@ -94,12 +112,10 @@ exports.completedFieldGuide = function (req, res, next) { req.user.uncompletedFieldGuides.splice(index, 1); } - req.user.save(function (err, user) { + req.user.save(function (err) { if (err) { return next(err); } - if (user) { - res.send(true); - } + res.send(true); }); }; diff --git a/controllers/home.js b/controllers/home.js index 4c276db8f5..86b4a784c3 100644 --- a/controllers/home.js +++ b/controllers/home.js @@ -1,16 +1,16 @@ -/** - * GET / - * Home page. - */ +var message = + 'Learn to Code JavaScript and get a Coding Job by Helping Nonprofits'; exports.index = function(req, res, next) { if (req.user && !req.user.profile.picture) { - req.user.profile.picture = 'https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png'; + req.user.profile.picture = + 'https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png'; + req.user.save(function(err) { if (err) { return next(err); } + res.render('home', { title: message }); }); + } else { + res.render('home', { title: message }); } - res.render('home', { - title: 'Learn to Code JavaScript and get a Coding Job by Helping Nonprofits' - }); }; diff --git a/controllers/nonprofits.js b/controllers/nonprofits.js index 70a8c75366..77a2f04a8f 100644 --- a/controllers/nonprofits.js +++ b/controllers/nonprofits.js @@ -1,16 +1,11 @@ -var async = require('async'), +var moment = require('moment'), Nonprofit = require('./../models/Nonprofit'), - resources = require('./resources'), - secrets = require('./../config/secrets'), - moment = require('moment'), - debug = require('debug')('freecc:cntr:nonprofits'), - R = require('ramda'); + resources = require('./resources'); -exports.nonprofitsDirectory = function(req, res) { +exports.nonprofitsDirectory = function(req, res, next) { Nonprofit.find({estimatedHours: { $gt: 0 } }, function(err, nonprofits) { - if (err) { - next(err); - } + if (err) { return next(err); } + res.render('nonprofits/directory', { title: 'Nonprofits we help', nonprofits: nonprofits @@ -19,163 +14,197 @@ exports.nonprofitsDirectory = function(req, res) { }; exports.areYouWithARegisteredNonprofit = function(req, res) { - res.render('nonprofits/are-you-with-a-registered-nonprofit', { - title: 'Are you with a with a registered nonprofit', - step: 1 - }); + res.render('nonprofits/are-you-with-a-registered-nonprofit', { + title: 'Are you with a with a registered nonprofit', + step: 1 + }); }; -exports.areTherePeopleThatAreAlreadyBenefitingFromYourServices = function(req, res) { - res.render('nonprofits/are-there-people-that-are-already-benefiting-from-your-services', { +exports.areTherePeopleThatAreAlreadyBenefitingFromYourServices = + function(req, res) { + res.render( + 'nonprofits/' + + 'are-there-people-that-are-already-benefiting-from-your-services', + { title: 'Are there people already benefiting from your services', step: 2 - }); -}; + } + ); + }; exports.okWithJavaScript = function(req, res) { - res.render('nonprofits/ok-with-javascript', { - title: 'Are you OK with us using JavaScript', - step: 3 - }); + res.render('nonprofits/ok-with-javascript', { + title: 'Are you OK with us using JavaScript', + step: 3 + }); }; exports.inExchangeWeAsk = function(req, res) { - res.render('nonprofits/in-exchange-we-ask', { - title: 'In exchange we ask that you ...', - step: 4 - }); + res.render('nonprofits/in-exchange-we-ask', { + title: 'In exchange we ask that you ...', + step: 4 + }); }; exports.howCanFreeCodeCampHelpYou = function(req, res) { - res.render('nonprofits/how-can-free-code-camp-help-you', { - title: 'Are you with a with a registered nonprofit', - step: 5 - }); + res.render('nonprofits/how-can-free-code-camp-help-you', { + title: 'Are you with a with a registered nonprofit', + step: 5 + }); }; exports.whatDoesYourNonprofitDo = function(req, res) { - res.render('nonprofits/what-does-your-nonprofit-do', { - existingParams: req.params, - title: 'What does your nonprofit do?', - step: 6 - }); + res.render('nonprofits/what-does-your-nonprofit-do', { + existingParams: req.params, + title: 'What does your nonprofit do?', + step: 6 + }); }; exports.linkUsToYourWebsite = function(req, res) { - res.render('nonprofits/link-us-to-your-website', { - title: 'Link us to your website', - step: 7 - }); + res.render('nonprofits/link-us-to-your-website', { + title: 'Link us to your website', + step: 7 + }); }; exports.tellUsYourEmail = function(req, res) { - res.render('nonprofits/tell-us-your-email', { - title: 'Tell us your email', - step: 8 - }); + res.render('nonprofits/tell-us-your-email', { + title: 'Tell us your email', + step: 8 + }); }; exports.tellUsYourName = function(req, res) { - res.render('nonprofits/tell-us-your-name', { - title: 'Tell us your name', - step: 9 - }); + res.render('nonprofits/tell-us-your-name', { + title: 'Tell us your name', + step: 9 + }); }; exports.yourNonprofitProjectApplicationHasBeenSubmitted = function(req, res) { - res.render('nonprofits/your-nonprofit-project-application-has-been-submitted', { - title: 'Your Nonprofit Project application has been submitted!', - step: 10, - getBackDay: moment().weekday(5).format('dddd') - }); + res.render( + 'nonprofits/your-nonprofit-project-application-has-been-submitted', + { + title: 'Your Nonprofit Project application has been submitted!', + step: 10, + getBackDay: moment().weekday(5).format('dddd') + } + ); }; exports.otherSolutions = function(req, res) { - res.render('nonprofits/other-solutions', { - title: 'Here are some other possible solutions for you' - }); + res.render('nonprofits/other-solutions', { + title: 'Here are some other possible solutions for you' + }); }; exports.returnIndividualNonprofit = function(req, res, next) { - var dashedName = req.params.nonprofitName; + var dashedName = req.params.nonprofitName; + var nonprofitName = dashedName.replace(/\-/g, ' '); - var nonprofitName = dashedName.replace(/\-/g, ' '); + Nonprofit.find( + { name: new RegExp(nonprofitName, 'i') }, + function(err, nonprofit) { + if (err) { + return next(err); + } - Nonprofit.find({'name': new RegExp(nonprofitName, 'i')}, function(err, nonprofit) { - if (err) { - next(err); - } + if (nonprofit.length < 1) { + req.flash('errors', { + msg: "404: We couldn't find a nonprofit with that name. " + + 'Please double check the name.' + }); - if (nonprofit.length < 1) { - req.flash('errors', { - msg: "404: We couldn't find a nonprofit with that name. Please double check the name." - }); + return res.redirect('/nonprofits'); + } - return res.redirect('/nonprofits'); - } - - nonprofit = nonprofit.pop(); - var dashedNameFull = nonprofit.name.toLowerCase().replace(/\s/g, '-'); - if (dashedNameFull != dashedName) { - return res.redirect('../nonprofit/' + dashedNameFull); - } - var buttonActive = false; - if (req.user) { - if (req.user.uncompletedBonfires.length === 0) { - if (req.user.completedCoursewares.length > 63) { - var hasShownInterest = nonprofit.interestedCampers.filter(function ( obj ) { + nonprofit = nonprofit.pop(); + var dashedNameFull = nonprofit.name.toLowerCase().replace(/\s/g, '-'); + if (dashedNameFull !== dashedName) { + return res.redirect('../nonprofit/' + dashedNameFull); + } + var buttonActive = false; + if (req.user) { + if (req.user.uncompletedBonfires.length === 0) { + if (req.user.completedCoursewares.length > 63) { + var hasShownInterest = + nonprofit.interestedCampers.filter(function ( obj ) { return obj.username === req.user.profile.username; }); - if (hasShownInterest.length === 0) { - buttonActive = true; - } + + if (hasShownInterest.length === 0) { + buttonActive = true; } } } - res.render('nonprofits/show', { - dashedName: dashedNameFull, - title: nonprofit.name, - logoUrl: nonprofit.logoUrl, - estimatedHours: nonprofit.estimatedHours, - projectDescription: nonprofit.projectDescription, - approvedOther: nonprofit.approvedDeliverables.indexOf('other') > -1, - approvedWebsite: nonprofit.approvedDeliverables.indexOf('website') > -1, - approvedDonor: nonprofit.approvedDeliverables.indexOf('donor') > -1, - approvedInventory: nonprofit.approvedDeliverables.indexOf('inventory') > -1, - approvedVolunteer: nonprofit.approvedDeliverables.indexOf('volunteer') > -1, - approvedForm: nonprofit.approvedDeliverables.indexOf('form') > -1, - approvedCommunity: nonprofit.approvedDeliverables.indexOf('community') > -1, - approvedELearning: nonprofit.approvedDeliverables.indexOf('eLearning') > -1, - websiteLink: nonprofit.websiteLink, - imageUrl: nonprofit.imageUrl, - whatDoesNonprofitDo: nonprofit.whatDoesNonprofitDo, - interestedCampers: nonprofit.interestedCampers, - assignedCampers: nonprofit.assignedCampers, - buttonActive: buttonActive, - currentStatus: nonprofit.currentStatus - }); - }); + } + + res.render('nonprofits/show', { + dashedName: dashedNameFull, + title: nonprofit.name, + logoUrl: nonprofit.logoUrl, + estimatedHours: nonprofit.estimatedHours, + projectDescription: nonprofit.projectDescription, + + approvedOther: + nonprofit.approvedDeliverables.indexOf('other') > -1, + approvedWebsite: + nonprofit.approvedDeliverables.indexOf('website') > -1, + + approvedDonor: + nonprofit.approvedDeliverables.indexOf('donor') > -1, + approvedInventory: + nonprofit.approvedDeliverables.indexOf('inventory') > -1, + + approvedVolunteer: + nonprofit.approvedDeliverables.indexOf('volunteer') > -1, + approvedForm: + nonprofit.approvedDeliverables.indexOf('form') > -1, + + approvedCommunity: + nonprofit.approvedDeliverables.indexOf('community') > -1, + approvedELearning: + nonprofit.approvedDeliverables.indexOf('eLearning') > -1, + + websiteLink: nonprofit.websiteLink, + imageUrl: nonprofit.imageUrl, + whatDoesNonprofitDo: nonprofit.whatDoesNonprofitDo, + interestedCampers: nonprofit.interestedCampers, + assignedCampers: nonprofit.assignedCampers, + buttonActive: buttonActive, + currentStatus: nonprofit.currentStatus + }); + } + ); }; exports.showAllNonprofits = function(req, res) { - var data = {}; - data.nonprofitsList = resources.allNonprofitNames(); - res.send(data); + var data = {}; + data.nonprofitsList = resources.allNonprofitNames(); + res.send(data); }; -exports.interestedInNonprofit = function(req, res) { +exports.interestedInNonprofit = function(req, res, next) { if (req.user) { - Nonprofit.findOne({name: new RegExp(req.params.nonprofitName.replace(/-/, ' '), 'i')}, function(err, nonprofit) { - if (err) { return next(err); } - nonprofit.interestedCampers.push({"username": req.user.profile.username, - "picture": req.user.profile.picture, - "timeOfInterest": Date.now() - }); - nonprofit.save(function(err) { - if (err) { return done(err); } - req.flash('success', { msg: "Thanks for expressing interest in this nonprofit project! We've added you to this project as an interested camper!" }); - res.redirect('back'); - }); - }); + Nonprofit.findOne( + { name: new RegExp(req.params.nonprofitName.replace(/-/, ' '), 'i') }, + function(err, nonprofit) { + if (err) { return next(err); } + nonprofit.interestedCampers.push({ + username: req.user.profile.username, + picture: req.user.profile.picture, + timeOfInterest: Date.now() + }); + nonprofit.save(function(err) { + if (err) { return next(err); } + req.flash('success', { + msg: 'Thanks for expressing interest in this nonprofit project! ' + + "We've added you to this project as an interested camper!" + }); + res.redirect('back'); + }); + } + ); } }; diff --git a/controllers/resources.js b/controllers/resources.js index 1b9e2570e4..0fcef198ab 100644 --- a/controllers/resources.js +++ b/controllers/resources.js @@ -1,32 +1,35 @@ var async = require('async'), + path = require('path'), + moment = require('moment'), + Twit = require('twit'), + debug = require('debug')('freecc:cntr:resources'), + cheerio = require('cheerio'), + request = require('request'), + R = require('ramda'), + _ = require('lodash'), + fs = require('fs'), + + + constantStrings = require('./constantStrings.json'), User = require('../models/User'), Challenge = require('./../models/Challenge'), - Courseware = require('./../models/Courseware'), - Bonfire = require('./../models/Bonfire'), Story = require('./../models/Story'), FieldGuide = require('./../models/FieldGuide'), Nonprofit = require('./../models/Nonprofit'), Comment = require('./../models/Comment'), resources = require('./resources.json'), secrets = require('./../config/secrets'), - bonfires = require('../seed_data/bonfires.json'), nonprofits = require('../seed_data/nonprofits.json'), - coursewares = require('../seed_data/coursewares.json'), fieldGuides = require('../seed_data/field-guides.json'), - moment = require('moment'), - Twit = require('twit'), - https = require('https'), - debug = require('debug')('freecc:cntr:resources'), - cheerio = require('cheerio'), - request = require('request'), - R = require('ramda'); + Slack = require('node-slack'), + slack = new Slack(secrets.slackHook); /** * Cached values */ -var allBonfireIds, allBonfireNames, allCoursewareIds, allCoursewareNames, - allFieldGuideIds, allFieldGuideNames, allNonprofitNames, - allBonfireIndexesAndNames; +var allFieldGuideIds, allFieldGuideNames, allNonprofitNames, + challengeMap, challengeMapForDisplay, challengeMapWithIds, + challengeMapWithNames, allChallengeIds, allChallenges; /** * GET / @@ -44,7 +47,94 @@ Array.zip = function(left, right, combinerFunction) { return results; }; +(function() { + if (!challengeMap) { + var localChallengeMap = {}; + var files = fs.readdirSync( + path.join(__dirname, '/../seed_data/challenges') + ); + var keyCounter = 0; + files = files.map(function (file) { + return require( + path.join(__dirname, '/../seed_data/challenges/' + file) + ); + }); + files = files.sort(function (a, b) { + return a.order - b.order; + }); + files.forEach(function (file) { + localChallengeMap[keyCounter++] = file; + }); + challengeMap = _.cloneDeep(localChallengeMap); + } +})(); + + module.exports = { + + getChallengeMapForDisplay: function() { + if (!challengeMapForDisplay) { + challengeMapForDisplay = {}; + Object.keys(challengeMap).forEach(function(key) { + challengeMapForDisplay[key] = { + name: challengeMap[key].name, + challenges: challengeMap[key].challenges + } + }); + } + return challengeMapForDisplay; + }, + + getChallengeMapWithIds: function() { + if (!challengeMapWithIds) { + challengeMapWithIds = {}; + Object.keys(challengeMap).forEach(function (key) { + var onlyIds = challengeMap[key].challenges.map(function (elem) { + return elem._id; + }); + challengeMapWithIds[key] = onlyIds; + }); + } + return challengeMapWithIds; + }, + + allChallengeIds: function() { + + if (!allChallengeIds) { + allChallengeIds = []; + Object.keys(this.getChallengeMapWithIds()).forEach(function(key) { + allChallengeIds.push(challengeMapWithIds[key]); + }); + allChallengeIds = R.flatten(allChallengeIds); + } + return allChallengeIds; + }, + + allChallenges: function() { + if (!allChallenges) { + allChallenges = []; + Object.keys(this.getChallengeMapWithNames()).forEach(function(key) { + allChallenges.push(challengeMap[key].challenges); + }); + allChallenges = R.flatten(allChallenges); + } + return allChallenges; + }, + + getChallengeMapWithNames: function() { + if (!challengeMapWithNames) { + challengeMapWithNames = {}; + Object.keys(challengeMap). + forEach(function (key) { + var onlyNames = challengeMap[key].challenges.map(function (elem) { + return elem.name; + }); + challengeMapWithNames[key] = onlyNames; + }); + } + return challengeMapWithNames; + }, + sitemap: function sitemap(req, res, next) { var appUrl = 'http://www.freecodecamp.com'; var now = moment(new Date()).format('YYYY-MM-DD'); @@ -66,29 +156,17 @@ module.exports = { }, challenges: function (callback) { - Courseware.aggregate() + Challenge.aggregate() .group({_id: 1, names: { $addToSet: '$name'}}) .exec(function (err, challenges) { if (err) { - debug('Courseware err: ', err); + debug('Challenge err: ', err); callback(err); } else { callback(null, challenges[0].names); } }); }, - bonfires: function (callback) { - Bonfire.aggregate() - .group({_id: 1, names: { $addToSet: '$name'}}) - .exec(function (err, bonfires) { - if (err) { - debug('Bonfire err: ', err); - callback(err); - } else { - callback(null, bonfires[0].names); - } - }); - }, stories: function (callback) { Story.aggregate() .group({_id: 1, links: {$addToSet: '$link'}}) @@ -136,7 +214,6 @@ module.exports = { now: now, users: results.users, challenges: results.challenges, - bonfires: results.bonfires, stories: results.stories, nonprofits: results.nonprofits, fieldGuides: results.fieldGuides @@ -152,11 +229,30 @@ module.exports = { res.redirect('http://freecode.slack.com'); } else { res.render('resources/chat', { - title: "Watch us code live on Twitch.tv" + title: 'Watch us code live on Twitch.tv' }); } }, + jobs: function jobs(req, res) { + res.render('resources/jobs', { + title: 'Job Board for Front End Developer and Full Stack JavaScript Developer Jobs' + }); + }, + + jobsForm: function jobsForm(req, res) { + res.render('resources/jobs-form', { + title: 'Employer Partnership Form for Job Postings, Recruitment and Corporate Sponsorships' + }); + }, + + catPhotoSubmit: function catPhotoSubmit(req, res) { + res.send( + 'Success! You have submitted your cat photo. Return to your website ' + + 'by typing any letter into your code editor.' + ); + }, + nonprofits: function nonprofits(req, res) { res.render('resources/nonprofits', { title: 'A guide to our Nonprofit Projects' @@ -165,7 +261,7 @@ module.exports = { nonprofitsForm: function nonprofitsForm(req, res) { res.render('resources/nonprofits-form', { - title: 'A guide to our Nonprofit Projects' + title: 'Nonprofit Projects Proposal Form' }); }, @@ -177,7 +273,7 @@ module.exports = { agileProjectManagersForm: function agileProjectManagersForm(req, res) { res.render('resources/pmi-acp-agile-project-managers-form', { - title: 'Get Agile Project Management Experience for the PMI-ACP' + title: 'Agile Project Management Program Application Form' }); }, @@ -187,8 +283,8 @@ module.exports = { }); }, - unsubscribe: function unsubscribe(req, res) { - User.findOne({email: req.params.email}, function(err, user) { + unsubscribe: function unsubscribe(req, res, next) { + User.findOne({ email: req.params.email }, function(err, user) { if (user) { if (err) { return next(err); @@ -208,52 +304,106 @@ module.exports = { unsubscribed: function unsubscribed(req, res) { res.render('resources/unsubscribed', { - title: "You have been unsubscribed" + title: 'You have been unsubscribed' }); }, - githubCalls: function(req, res) { - var githubHeaders = {headers: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1521.3 Safari/537.36'}, port:80 }; - request('https://api.github.com/repos/freecodecamp/freecodecamp/pulls?client_id=' + secrets.github.clientID + '&client_secret=' + secrets.github.clientSecret, githubHeaders, function(err, status1, pulls) { - pulls = pulls ? Object.keys(JSON.parse(pulls)).length : "Can't connect to github"; - request('https://api.github.com/repos/freecodecamp/freecodecamp/issues?client_id=' + secrets.github.clientID + '&client_secret=' + secrets.github.clientSecret, githubHeaders, function (err, status2, issues) { - issues = ((pulls === parseInt(pulls)) && issues) ? Object.keys(JSON.parse(issues)).length - pulls : "Can't connect to GitHub"; - res.send({"issues": issues, "pulls" : pulls}); - }); - }); + githubCalls: function(req, res, next) { + var githubHeaders = { + headers: { + 'User-Agent': constantStrings.gitHubUserAgent + }, + port: 80 + }; + request( + [ + 'https://api.github.com/repos/freecodecamp/', + 'freecodecamp/pulls?client_id=', + secrets.github.clientID, + '&client_secret=', + secrets.github.clientSecret + ].join(''), + githubHeaders, + function(err, status1, pulls) { + if (err) { return next(err); } + pulls = pulls ? + Object.keys(JSON.parse(pulls)).length : + "Can't connect to github"; + + request( + [ + 'https://api.github.com/repos/freecodecamp/', + 'freecodecamp/issues?client_id=', + secrets.github.clientID, + '&client_secret=', + secrets.github.clientSecret + ].join(''), + githubHeaders, + function (err, status2, issues) { + if (err) { return next(err); } + issues = ((pulls === parseInt(pulls, 10)) && issues) ? + Object.keys(JSON.parse(issues)).length - pulls : + "Can't connect to GitHub"; + res.send({ + issues: issues, + pulls: pulls + }); + } + ); + } + ); }, trelloCalls: function(req, res, next) { - request('https://trello.com/1/boards/BA3xVpz9/cards?key=' + secrets.trello.key, function(err, status, trello) { - if (err) { return next(err); } - trello = (status && status.statusCode === 200) ? (JSON.parse(trello)) : "Can't connect to to Trello"; - res.end(JSON.stringify(trello)); - }); + request( + 'https://trello.com/1/boards/BA3xVpz9/cards?key=' + + secrets.trello.key, + function(err, status, trello) { + if (err) { return next(err); } + trello = (status && status.statusCode === 200) ? + (JSON.parse(trello)) : + "Can't connect to to Trello"; + + res.end(JSON.stringify(trello)); + }); }, bloggerCalls: function(req, res, next) { - request('https://www.googleapis.com/blogger/v3/blogs/2421288658305323950/posts?key=' + secrets.blogger.key, function (err, status, blog) { - if (err) { return next(err); } - blog = (status && status.statusCode === 200) ? JSON.parse(blog) : "Can't connect to Blogger"; - res.end(JSON.stringify(blog)); - }); + request( + 'https://www.googleapis.com/blogger/v3/blogs/2421288658305323950/' + + 'posts?key=' + + secrets.blogger.key, + function (err, status, blog) { + if (err) { return next(err); } + + blog = (status && status.statusCode === 200) ? + JSON.parse(blog) : + "Can't connect to Blogger"; + res.end(JSON.stringify(blog)); + } + ); }, about: function(req, res, next) { if (req.user) { - if (!req.user.profile.picture || req.user.profile.picture === "https://s3.amazonaws.com/freecodecamp/favicons/apple-touch-icon-180x180.png") { - req.user.profile.picture = "https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png"; + if ( + !req.user.profile.picture || + req.user.profile.picture.indexOf('apple-touch-icon-180x180.png') !== -1 + ) { + req.user.profile.picture = + 'https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png'; + // TODO(berks): unhandled callback req.user.save(); } } - var date1 = new Date("10/15/2014"); + var date1 = new Date('10/15/2014'); var date2 = new Date(); var timeDiff = Math.abs(date2.getTime() - date1.getTime()); var daysRunning = Math.ceil(timeDiff / (1000 * 3600 * 24)); var announcements = resources.announcements; function numberWithCommas(x) { - return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); + return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); } User.count({}, function (err, c3) { if (err) { @@ -271,113 +421,41 @@ module.exports = { }, randomPhrase: function() { - return resources.phrases[Math.floor( - Math.random() * resources.phrases.length)]; + return resources.phrases[ + Math.floor(Math.random() * resources.phrases.length) + ]; }, randomVerb: function() { - return resources.verbs[Math.floor( - Math.random() * resources.verbs.length)]; + return resources.verbs[ + Math.floor(Math.random() * resources.verbs.length) + ]; }, randomCompliment: function() { - return resources.compliments[Math.floor( - Math.random() * resources.compliments.length)]; - }, - - allBonfireIds: function() { - if (allBonfireIds) { - return allBonfireIds; - } else { - allBonfireIds = bonfires. - map(function (elem) { - return { - _id: elem._id, - difficulty: elem.difficulty - }; - }). - sort(function (a, b) { - return a.difficulty - b.difficulty; - }). - map(function (elem) { - return elem._id; - }); - return allBonfireIds; - } - }, - - bonfiresIndexesAndNames: function() { - if (allBonfireIndexesAndNames) { - return allBonfireIndexesAndNames - } else { - var obj = {}; - bonfires.forEach(function(elem) { - obj[elem._id] = elem.name; - }); - allBonfireIndexesAndNames = obj; - return allBonfireIndexesAndNames; - } - }, - - ensureBonfireNames: function(completedBonfires) { - return completedBonfires.map(function(elem) { - return ({ - name: this.bonfiresIndexesAndNames()[elem._id], - _id: elem.id, - completedDate: elem.completedDate, - completedWith: elem.completedWith, - solution: elem.solution - }); - }.bind(this)); + return resources.compliments[ + Math.floor(Math.random() * resources.compliments.length) + ]; }, allFieldGuideIds: function() { if (allFieldGuideIds) { return allFieldGuideIds; } else { - allFieldGuideIds = fieldGuides. - map(function (elem) { - return elem._id; - }); + allFieldGuideIds = fieldGuides.map(function (elem) { + return elem._id; + }); return allFieldGuideIds; } }, - allBonfireNames: function() { - if (allBonfireNames) { - return allBonfireNames; - } else { - allBonfireNames = bonfires. - map(function (elem) { - return { - name: elem.name, - difficulty: elem.difficulty, - _id: elem._id - }; - }). - sort(function (a, b) { - return a.difficulty - b.difficulty; - }). - map(function (elem) { - return { - name: elem.name, - _id: elem._id - }; - }); - return allBonfireNames; - } - }, - - allFieldGuideNames: function() { + allFieldGuideNamesAndIds: function() { if (allFieldGuideNames) { return allFieldGuideNames; } else { - allFieldGuideNames = fieldGuides. - map(function (elem) { - return { - name: elem.name - }; - }); + allFieldGuideNames = fieldGuides.map(function (elem) { + return { name: elem.name, id: elem._id }; + }); return allFieldGuideNames; } }, @@ -386,61 +464,10 @@ module.exports = { if (allNonprofitNames) { return allNonprofitNames; } else { - allNonprofitNames = nonprofits. - map(function (elem) { - return { - name: elem.name - }; - }); - return allNonprofitNames; - } - }, - - allCoursewareIds: function() { - if (allCoursewareIds) { - return allCoursewareIds; - } else { - allCoursewareIds = coursewares. - map(function (elem) { - return { - _id: elem._id, - difficulty: elem.difficulty - }; - }). - sort(function (a, b) { - return a.difficulty - b.difficulty; - }). - map(function (elem) { - return elem._id; - }); - return allCoursewareIds; - } - }, - - allCoursewareNames: function() { - if (allCoursewareNames) { - return allCoursewareNames; - } else { - allCoursewareNames = coursewares. - map(function (elem) { - return { - name: elem.name, - difficulty: elem.difficulty, - challengeType: elem.challengeType, - _id: elem._id - }; - }). - sort(function (a, b) { - return a.difficulty - b.difficulty; - }). - map(function (elem) { - return { - name: elem.name, - challengeType: elem.challengeType, - _id: elem._id - }; + allNonprofitNames = nonprofits.map(function (elem) { + return { name: elem.name }; }); - return allCoursewareNames; + return allNonprofitNames; } }, @@ -455,16 +482,25 @@ module.exports = { if (!error && response.statusCode === 200) { var $ = cheerio.load(body); var metaDescription = $("meta[name='description']"); - var metaImage = $("meta[property='og:image']"); - var urlImage = metaImage.attr('content') ? metaImage.attr('content') : ''; + var metaImage = $("meta[property='og:image']"); + var urlImage = metaImage.attr('content') ? + metaImage.attr('content') : + ''; + var metaTitle = $('title'); - var description = metaDescription.attr('content') ? metaDescription.attr('content') : ''; - result.title = metaTitle.text().length < 90 ? metaTitle.text() : metaTitle.text().slice(0, 87) + "..."; + var description = metaDescription.attr('content') ? + metaDescription.attr('content') : + ''; + + result.title = metaTitle.text().length < 90 ? + metaTitle.text() : + metaTitle.text().slice(0, 87) + '...'; + result.image = urlImage; result.description = description; callback(null, result); } else { - callback('failed'); + callback(new Error('failed')); } }); })(); @@ -524,24 +560,33 @@ module.exports = { } }, codepenResources: { - twitter: function(req, res) { + twitter: function(req, res, next) { // sends out random tweets about javascript var T = new Twit({ - consumer_key: secrets.twitter.consumerKey, - consumer_secret: secrets.twitter.consumerSecret, - access_token: secrets.twitter.token, - access_token_secret: secrets.twitter.tokenSecret + 'consumer_key': secrets.twitter.consumerKey, + 'consumer_secret': secrets.twitter.consumerSecret, + 'access_token': secrets.twitter.token, + 'access_token_secret': secrets.twitter.tokenSecret }); + var screenName; if (req.params.screenName) { screenName = req.params.screenName; } else { screenName = 'freecodecamp'; } - T.get('statuses/user_timeline', {screen_name: screenName, count:10}, function(err, data, response) { - return res.json(data); - }); + T.get( + 'statuses/user_timeline', + { + 'screen_name': screenName, + count: 10 + }, + function(err, data) { + if (err) { return next(err); } + return res.json(data); + } + ); }, twitterFCCStream: function() { // sends out a tweet stream from FCC's account @@ -552,5 +597,42 @@ module.exports = { slack: function() { } + }, + + getHelp: function(req, res, next) { + var userName = req.user.profile.username; + var code = req.body.payload.code ? '\n```\n' + + req.body.payload.code + '\n```\n' + : ''; + var challenge = req.body.payload.challenge; + + slack.send({ + text: "*" + userName + "* wants help with " + challenge + ". " + + code + "Hey, *" + userName + "*, if no one helps you right " + + "away, try typing out your problem in detail to me. Like this: " + + "http://en.wikipedia.org/wiki/Rubber_duck_debugging", + channel: '#help', + username: "Debuggy the Rubber Duck", + icon_url: "https://pbs.twimg.com/profile_images/3609875545/569237541c920fa78d78902069615caf.jpeg" + }); + return res.sendStatus(200); + }, + + getPair: function(req, res, next) { + var userName = req.user.profile.username; + var challenge = req.body.payload.challenge; + slack.send({ + text: "Anyone want to pair with *" + userName + "* on " + challenge + + "?\nMake sure you install Screen Hero here:" + + "http://freecodecamp.com/field-guide/how-do-i-install-screenhero\n" + + "Then start your pair program session with *" + userName + + "* by typing \"/hero @" + userName + "\" into Slack.\n* And"+ userName + + "*, be sure to launch Screen Hero, then keep coding." + + "Another camper may pair with you soon.", + channel: '#letspair', + username: "Companion Cube", + icon_url: "https://lh3.googleusercontent.com/-f6xDPDV2rPE/AAAAAAAAAAI/AAAAAAAAAAA/mdlESXQu11Q/photo.jpg" + }); + return res.sendStatus(200); } }; diff --git a/controllers/story.js b/controllers/story.js index cfde5345ef..3a34c7b883 100755 --- a/controllers/story.js +++ b/controllers/story.js @@ -19,9 +19,10 @@ function hotRank(timeValue, rank) { * Ranking... * f(ts, 1, rank) = log(10)z + (ts)/45000; */ + var time48Hours = 172800000; var hotness; var z = Math.log(rank) / Math.log(10); - hotness = z + (timeValue / 115200000); + hotness = z + (timeValue / time48Hours); return hotness; } @@ -128,14 +129,17 @@ exports.returnIndividualStory = function(req, res, next) { if (story.length < 1) { req.flash('errors', { - msg: "404: We couldn't find a story with that name. Please double check the name." + msg: "404: We couldn't find a story with that name. " + + 'Please double check the name.' }); return res.redirect('/news/'); } story = story.pop(); - var dashedNameFull = story.storyLink.toLowerCase().replace(/\s/g, '-'); + var dashedNameFull = story.storyLink.toLowerCase() + .replace(/\s+/g, ' ') + .replace(/\s/g, '-'); if (dashedNameFull !== dashedName) { return res.redirect('../news/' + dashedNameFull); } @@ -148,7 +152,7 @@ exports.returnIndividualStory = function(req, res, next) { if (votedObj.length > 0) { userVoted = true; } - } catch(err) { + } catch(e) { userVoted = false; } res.render('stories/index', { @@ -229,12 +233,10 @@ exports.upvote = function(req, res, next) { ); story.markModified('rank'); story.save(); - User.find({'_id': story.author.userId}, function(err, user) { - 'use strict'; + User.findOne({'_id': story.author.userId}, function(err, user) { if (err) { return next(err); } - user = user.pop(); user.progressTimestamps.push(Date.now() || 0); user.save(function (err, user) { req.user.save(function (err, user) { @@ -328,9 +330,6 @@ exports.storySubmission = function(req, res, next) { return next(new Error('Not authorized')); } var storyLink = data.headline - .replace(/\'/g, '') - .replace(/\"/g, '') - .replace(/,/g, '') .replace(/\s+/g, ' ') .replace(/[^a-z0-9\s]/gi, '') .toLowerCase() @@ -339,7 +338,7 @@ exports.storySubmission = function(req, res, next) { if (link.search(/^https?:\/\//g) === -1) { link = 'http://' + link; } - Story.count({'storyLink': new RegExp('^' + storyLink + '(?: [0-9]+)?$', 'i')}, function (err, storyCount) { + Story.count({ storyLink: new RegExp('^' + storyLink + '(?: [0-9]+)?$', 'i')}, function (err, storyCount) { if (err) { return res.status(500); } @@ -513,7 +512,8 @@ exports.storySubmission = function(req, res, next) { return next(err); } try { - // Based on the context retrieve the parent object of the comment (Story/Comment) + // Based on the context retrieve the parent + // object of the comment (Story/Comment) Context.find({'_id': data.associatedPost}, function (err, associatedContext) { if (err) { return next(err); @@ -533,8 +533,15 @@ exports.storySubmission = function(req, res, next) { if (err) { return next(err); } - // If the emails of both authors differ, only then proceed with email notification - if (typeof data.author !== 'undefined' && data.author.email && typeof recipient !== 'undefined' && recipient.email && (data.author.email !== recipient.email)) { + // If the emails of both authors differ, + // only then proceed with email notification + if ( + typeof data.author !== 'undefined' && + data.author.email && + typeof recipient !== 'undefined' && + recipient.email && + (data.author.email !== recipient.email) + ) { var transporter = nodemailer.createTransport({ service: 'Mandrill', auth: { @@ -546,11 +553,14 @@ exports.storySubmission = function(req, res, next) { var mailOptions = { to: recipient.email, from: 'Team@freecodecamp.com', - subject: data.author.username + ' replied to your post on Camper News', + subject: data.author.username + + ' replied to your post on Camper News', text: [ - 'Just a quick heads-up: ' + data.author.username + ' replied to you on Camper News.', + 'Just a quick heads-up: ', + data.author.username + ' replied to you on Camper News.', 'You can keep this conversation going.', - 'Just head back to the discussion here: http://freecodecamp.com/news/' + data.originalStoryLink, + 'Just head back to the discussion here: ', + 'http://freecodecamp.com/news/' + data.originalStoryLink, '- the Free Code Camp Volunteer Team' ].join('\n') }; diff --git a/controllers/user.js b/controllers/user.js index 3b8fdb3cbd..ab000593ce 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -6,10 +6,45 @@ var _ = require('lodash'), User = require('../models/User'), secrets = require('../config/secrets'), moment = require('moment'), - debug = require('debug')('freecc:cntr:challenges'), + debug = require('debug')('freecc:cntr:userController'), resources = require('./resources'), R = require('ramda'); + + +/** + * + * @param req + * @param res + * @returns null + * Middleware to migrate users from fragmented challenge structure to unified + * challenge structure + */ +exports.userMigration = function(req, res, next) { + if (req.user && req.user.completedChallenges.length === 0) { + req.user.completedChallenges = R.filter(function (elem) { + return elem; // getting rid of undefined + }, R.concat( + req.user.completedCoursewares, + req.user.completedBonfires.map(function (bonfire) { + return ({ + completedDate: bonfire.completedDate, + _id: bonfire._id, + name: bonfire.name, + completedWith: bonfire.completedWith, + solution: bonfire.solution, + githubLink: '', + verified: false, + challengeType: 5 + }); + }) + )); + next(); + } else { + next(); + } +}; + /** * GET /signin * Siginin page. @@ -53,6 +88,12 @@ exports.postSignin = function(req, res, next) { return next(err); } req.flash('success', { msg: 'Success! You are logged in.' }); + if (/hotStories/.test(req.session.returnTo)) { + return res.redirect('../news'); + } + if (/field-guide/.test(req.session.returnTo)) { + return res.redirect('../field-guide'); + } return res.redirect(req.session.returnTo || '/'); }); })(req, res, next); @@ -73,7 +114,8 @@ exports.signout = function(req, res) { * Signup page. */ -exports.getEmailSignin = function(req, res) { +exports.getEmailSignin = function(req, res) //noinspection Eslint +{ if (req.user) { return res.redirect('/'); } @@ -102,15 +144,13 @@ exports.getEmailSignup = function(req, res) { */ exports.postEmailSignup = function(req, res, next) { + req.assert('email', 'valid email required').isEmail(); + var errors = req.validationErrors(); - - req.assert('email', 'valid email required').isEmail(); - var errors = req.validationErrors(); - - if (errors) { - req.flash('errors', errors); - return res.redirect('/email-signup'); - } + if (errors) { + req.flash('errors', errors); + return res.redirect('/email-signup'); + } var possibleUserData = req.body; @@ -134,7 +174,8 @@ exports.postEmailSignup = function(req, res, next) { password: req.body.password, profile: { username: req.body.username.trim(), - picture: 'https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png' + picture: + 'https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png' } }); @@ -149,7 +190,9 @@ exports.postEmailSignup = function(req, res, next) { }); return res.redirect('/email-signup'); } - User.findOne({'profile.username': req.body.username }, function(err, existingUsername) { + User.findOne( + { 'profile.username': req.body.username }, + function(err, existingUsername) { if (err) { return next(err); } @@ -181,8 +224,10 @@ exports.postEmailSignup = function(req, res, next) { text: [ 'Greetings from San Francisco!\n\n', 'Thank you for joining our community.\n', - 'Feel free to email us at this address if you have any questions about Free Code Camp.\n', - 'And if you have a moment, check out our blog: blog.freecodecamp.com.\n', + 'Feel free to email us at this address if you have ', + 'any questions about Free Code Camp.\n', + 'And if you have a moment, check out our blog: ', + 'blog.freecodecamp.com.\n', 'Good luck with the challenges!\n\n', '- the Volunteer Camp Counselor Team' ].join('') @@ -220,28 +265,33 @@ exports.getAccountAngular = function(req, res) { */ exports.checkUniqueUsername = function(req, res, next) { - User.count({'profile.username': req.params.username.toLowerCase()}, function (err, data) { - if (err) { return next(err); } - if (data == 1) { - return res.send(true); - } else { - return res.send(false); - } - }); + User.count( + { 'profile.username': req.params.username.toLowerCase() }, + function (err, data) { + if (err) { return next(err); } + if (data === 1) { + return res.send(true); + } else { + return res.send(false); + } + }); }; /** * Existing username check */ exports.checkExistingUsername = function(req, res, next) { - User.count({'profile.username': req.params.username.toLowerCase()}, function (err, data) { - if (err) { return next(err); } - if (data === 1) { - return res.send(true); - } else { - return res.send(false); - } - }); + User.count( + { 'profile.username': req.params.username.toLowerCase() }, + function (err, data) { + if (err) { return next(err); } + if (data === 1) { + return res.send(true); + } else { + return res.send(false); + } + } + ); }; /** @@ -249,14 +299,17 @@ exports.checkExistingUsername = function(req, res, next) { */ exports.checkUniqueEmail = function(req, res, next) { - User.count({'email': decodeURIComponent(req.params.email).toLowerCase()}, function (err, data) { - if (err) { return next(err); } - if (data === 1) { - return res.send(true); - } else { - return res.send(false); - } - }); + User.count( + { email: decodeURIComponent(req.params.email).toLowerCase() }, + function (err, data) { + if (err) { return next(err); } + if (data === 1) { + return res.send(true); + } else { + return res.send(false); + } + } + ); }; @@ -266,127 +319,132 @@ exports.checkUniqueEmail = function(req, res, next) { */ exports.returnUser = function(req, res, next) { - User.find({'profile.username': req.params.username.toLowerCase()}, function(err, user) { - if (err) { debug('Username err: ', err); next(err); } - if (user[0]) { - user = user[0]; - - user.progressTimestamps = user.progressTimestamps.sort(function(a, b) { - return a - b; - }); - - var timeObject = Object.create(null); - R.forEach(function(time) { - timeObject[moment(time).format('YYYY-MM-DD')] = time; - }, user.progressTimestamps); - - var tmpLongest = 1; - var timeKeys = R.keys(timeObject); - - user.longestStreak = 0; - for (var i = 1; i <= timeKeys.length; i++) { - if (moment(timeKeys[i - 1]).add(1, 'd').toString() - === moment(timeKeys[i]).toString()) { - tmpLongest++; - if (tmpLongest > user.longestStreak) { - user.longestStreak = tmpLongest; - } - } else { - tmpLongest = 1; - } + User.find( + { 'profile.username': req.params.username.toLowerCase() }, + function(err, user) { + if (err) { + debug('Username err: ', err); + return next(err); } + if (user[0]) { + user = user[0]; - timeKeys = timeKeys.reverse(); - tmpLongest = 1; + user.progressTimestamps = user.progressTimestamps.sort(function(a, b) { + return a - b; + }); - user.currentStreak = 1; - var today = moment(Date.now()).format('YYYY-MM-DD'); + var timeObject = Object.create(null); + R.forEach(function(time) { + timeObject[moment(time).format('YYYY-MM-DD')] = time; + }, user.progressTimestamps); - if (moment(today).toString() === moment(timeKeys[0]).toString() || - moment(today).subtract(1, 'd').toString() === - moment(timeKeys[0]).toString()) { + var tmpLongest = 1; + var timeKeys = R.keys(timeObject); + + user.longestStreak = 0; for (var i = 1; i <= timeKeys.length; i++) { - if (moment(timeKeys[i - 1]).subtract(1, 'd').toString() + if (moment(timeKeys[i - 1]).add(1, 'd').toString() === moment(timeKeys[i]).toString()) { - debug(timeKeys[i - 1], timeKeys[i]); tmpLongest++; - if (tmpLongest > user.currentStreak) { - user.currentStreak = tmpLongest; + if (tmpLongest > user.longestStreak) { + user.longestStreak = tmpLongest; } } else { - break; + tmpLongest = 1; } } - } else { + + timeKeys = timeKeys.reverse(); + tmpLongest = 1; + user.currentStreak = 1; - } + var today = moment(Date.now()).format('YYYY-MM-DD'); - user.save(function(err) { - if (err) { - return next(err); + if ( + moment(today).toString() === moment(timeKeys[0]).toString() || + moment(today).subtract(1, 'd').toString() === + moment(timeKeys[0]).toString() + ) { + for (var _i = 1; _i <= timeKeys.length; _i++) { + + if ( + moment(timeKeys[_i - 1]).subtract(1, 'd').toString() === + moment(timeKeys[_i]).toString() + ) { + + tmpLongest++; + + if (tmpLongest > user.currentStreak) { + user.currentStreak = tmpLongest; + } + } else { + break; + } + } + } else { + user.currentStreak = 1; } - }); - var data = {}; - var progressTimestamps = user.progressTimestamps; - progressTimestamps.forEach(function(timeStamp) { - data[(timeStamp / 1000)] = 1; - }); - - if (!user.needsMigration) { - var currentlySolvedBonfires = user.completedBonfires; - user.completedBonfires = - resources.ensureBonfireNames(currentlySolvedBonfires); - user.needsMigration = true; user.save(function(err) { if (err) { return next(err); } + + var data = {}; + var progressTimestamps = user.progressTimestamps; + progressTimestamps.forEach(function(timeStamp) { + data[(timeStamp / 1000)] = 1; + }); + + user.currentStreak = user.currentStreak || 1; + user.longestStreak = user.longestStreak || 1; + var challenges = user.completedCoursewares.filter(function ( obj ) { + return !!obj.solution; + }); + + res.render('account/show', { + title: 'Camper ' + user.profile.username + '\'s portfolio', + username: user.profile.username, + name: user.profile.name, + location: user.profile.location, + githubProfile: user.profile.githubProfile, + linkedinProfile: user.profile.linkedinProfile, + codepenProfile: user.profile.codepenProfile, + facebookProfile: user.profile.facebookProfile, + twitterHandle: user.profile.twitterHandle, + bio: user.profile.bio, + picture: user.profile.picture, + progressTimestamps: user.progressTimestamps, + website1Link: user.portfolio.website1Link, + website1Title: user.portfolio.website1Title, + website1Image: user.portfolio.website1Image, + website2Link: user.portfolio.website2Link, + website2Title: user.portfolio.website2Title, + website2Image: user.portfolio.website2Image, + website3Link: user.portfolio.website3Link, + website3Title: user.portfolio.website3Title, + website3Image: user.portfolio.website3Image, + challenges: challenges, + bonfires: user.completedChallenges.filter(function(challenge) { + return challenge.challengeType === 5; + }), + calender: data, + moment: moment, + longestStreak: user.longestStreak + + (user.longestStreak === 1 ? ' day' : ' days'), + currentStreak: user.currentStreak + + (user.currentStreak === 1 ? ' day' : ' days') + }); }); + } else { + req.flash('errors', { + msg: "404: We couldn't find a page with that url. " + + 'Please double check the link.' + }); + return res.redirect('/'); } - - user.currentStreak = user.currentStreak || 1; - user.longestStreak = user.longestStreak || 1; - var challenges = user.completedCoursewares.filter(function ( obj ) { - return !!obj.solution; - }); - res.render('account/show', { - title: 'Camper ' + user.profile.username + '\'s portfolio', - username: user.profile.username, - name: user.profile.name, - location: user.profile.location, - githubProfile: user.profile.githubProfile, - linkedinProfile: user.profile.linkedinProfile, - codepenProfile: user.profile.codepenProfile, - facebookProfile: user.profile.facebookProfile, - twitterHandle: user.profile.twitterHandle, - bio: user.profile.bio, - picture: user.profile.picture, - progressTimestamps: user.progressTimestamps, - website1Link: user.portfolio.website1Link, - website1Title: user.portfolio.website1Title, - website1Image: user.portfolio.website1Image, - website2Link: user.portfolio.website2Link, - website2Title: user.portfolio.website2Title, - website2Image: user.portfolio.website2Image, - website3Link: user.portfolio.website3Link, - website3Title: user.portfolio.website3Title, - website3Image: user.portfolio.website3Image, - challenges: challenges, - bonfires: user.completedBonfires, - calender: data, - moment: moment, - longestStreak: user.longestStreak + (user.longestStreak === 1 ? " day" : " days"), - currentStreak: user.currentStreak + (user.currentStreak === 1 ? " day" : " days") - }); - - } else { - req.flash('errors', { - msg: "404: We couldn't find a page with that url. Please double check the link." - }); - return res.redirect('/'); } - }); + ); }; @@ -395,9 +453,9 @@ exports.returnUser = function(req, res, next) { * Update profile information. */ -exports.updateProgress = function(req, res) { +exports.updateProgress = function(req, res, next) { User.findById(req.user.id, function(err, user) { - if (err) return next(err); + if (err) { return next(err); } user.email = req.body.email || ''; user.profile.name = req.body.name || ''; user.profile.gender = req.body.gender || ''; @@ -405,7 +463,7 @@ exports.updateProgress = function(req, res) { user.profile.website = req.body.website || ''; user.save(function(err) { - if (err) return next(err); + if (err) { return next(err); } req.flash('success', { msg: 'Profile information updated.' }); res.redirect('/account'); }); @@ -419,8 +477,8 @@ exports.updateProgress = function(req, res) { exports.postUpdateProfile = function(req, res, next) { - User.findById(req.user.id, function(err, user) { - if (err) return next(err); + User.findById(req.user.id, function(err) { + if (err) { return next(err); } var errors = req.validationErrors(); if (errors) { req.flash('errors', errors); @@ -432,63 +490,72 @@ exports.postUpdateProfile = function(req, res, next) { return next(err); } var user = req.user; - if (existingEmail && existingEmail.email != user.email) { + if (existingEmail && existingEmail.email !== user.email) { req.flash('errors', { - msg: "An account with that email address already exists." + msg: 'An account with that email address already exists.' }); return res.redirect('/account'); } - User.findOne({ 'profile.username': req.body.username }, function(err, existingUsername) { - if (err) { - return next(err); - } - var user = req.user; - if (existingUsername && existingUsername.profile.username !== user.profile.username) { - req.flash('errors', { - msg: 'An account with that username already exists.' - }); - return res.redirect('/account'); - } - user.email = req.body.email.trim() || ''; - user.profile.name = req.body.name.trim() || ''; - user.profile.username = req.body.username.trim() || ''; - user.profile.location = req.body.location.trim() || ''; - user.profile.githubProfile = req.body.githubProfile.trim() || ''; - user.profile.facebookProfile = req.body.facebookProfile.trim() || ''; - user.profile.linkedinProfile = req.body.linkedinProfile.trim() || ''; - user.profile.codepenProfile = req.body.codepenProfile.trim() || ''; - user.profile.twitterHandle = req.body.twitterHandle.trim() || ''; - user.profile.bio = req.body.bio.trim() || ''; - user.profile.picture = req.body.picture.trim() || 'https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png'; - user.portfolio.website1Title = req.body.website1Title.trim() || ''; - user.portfolio.website1Link = req.body.website1Link.trim() || ''; - user.portfolio.website1Image = req.body.website1Image.trim() || ''; - user.portfolio.website2Title = req.body.website2Title.trim() || ''; - user.portfolio.website2Link = req.body.website2Link.trim() || ''; - user.portfolio.website2Image = req.body.website2Image.trim() || ''; - user.portfolio.website3Title = req.body.website3Title.trim() || ''; - user.portfolio.website3Link = req.body.website3Link.trim() || ''; - user.portfolio.website3Image = req.body.website3Image.trim() || ''; - - - user.save(function (err) { + User.findOne( + { 'profile.username': req.body.username }, + function(err, existingUsername) { if (err) { return next(err); } - resources.updateUserStoryPictures( - user._id.toString(), - user.profile.picture, - user.profile.username, - function(err) { - if (err) { return next(err); } - req.flash('success', { - msg: 'Profile information updated.' - }); - res.redirect('/account'); + var user = req.user; + if ( + existingUsername && + existingUsername.profile.username !== user.profile.username + ) { + req.flash('errors', { + msg: 'An account with that username already exists.' + }); + return res.redirect('/account'); + } + user.email = req.body.email.trim() || ''; + user.profile.name = req.body.name.trim() || ''; + user.profile.username = req.body.username.trim() || ''; + user.profile.location = req.body.location.trim() || ''; + user.profile.githubProfile = req.body.githubProfile.trim() || ''; + user.profile.facebookProfile = req.body.facebookProfile.trim() || ''; + user.profile.linkedinProfile = req.body.linkedinProfile.trim() || ''; + user.profile.codepenProfile = req.body.codepenProfile.trim() || ''; + user.profile.twitterHandle = req.body.twitterHandle.trim() || ''; + user.profile.bio = req.body.bio.trim() || ''; + + user.profile.picture = req.body.picture.trim() || + 'https://s3.amazonaws.com/freecodecamp/' + + 'camper-image-placeholder.png'; + user.portfolio.website1Title = req.body.website1Title.trim() || ''; + user.portfolio.website1Link = req.body.website1Link.trim() || ''; + user.portfolio.website1Image = req.body.website1Image.trim() || ''; + user.portfolio.website2Title = req.body.website2Title.trim() || ''; + user.portfolio.website2Link = req.body.website2Link.trim() || ''; + user.portfolio.website2Image = req.body.website2Image.trim() || ''; + user.portfolio.website3Title = req.body.website3Title.trim() || ''; + user.portfolio.website3Link = req.body.website3Link.trim() || ''; + user.portfolio.website3Image = req.body.website3Image.trim() || ''; + + + user.save(function (err) { + if (err) { + return next(err); } - ); - }); - }); + resources.updateUserStoryPictures( + user._id.toString(), + user.profile.picture, + user.profile.username, + function(err) { + if (err) { return next(err); } + req.flash('success', { + msg: 'Profile information updated.' + }); + res.redirect('/account'); + } + ); + }); + } + ); }); }); }; @@ -548,7 +615,7 @@ exports.getOauthUnlink = function(req, res, next) { User.findById(req.user.id, function(err, user) { if (err) { return next(err); } - user[provider] = undefined; + user[provider] = null; user.tokens = _.reject(user.tokens, function(token) { return token.kind === provider; @@ -567,7 +634,7 @@ exports.getOauthUnlink = function(req, res, next) { * Reset Password page. */ -exports.getReset = function(req, res) { +exports.getReset = function(req, res, next) { if (req.isAuthenticated()) { return res.redirect('/'); } @@ -617,8 +684,8 @@ exports.postReset = function(req, res, next) { } user.password = req.body.password; - user.resetPasswordToken = undefined; - user.resetPasswordExpires = undefined; + user.resetPasswordToken = null; + user.resetPasswordExpires = null; user.save(function(err) { if (err) { return done(err); } diff --git a/models/Bonfire.js b/models/Bonfire.js index 8c0c4599ed..fdfebb3291 100644 --- a/models/Bonfire.js +++ b/models/Bonfire.js @@ -15,7 +15,7 @@ var bonfireSchema = new mongoose.Schema({ difficulty: String, description: Array, tests: Array, - challengeSeed: String, + challengeSeed: Array, MDNlinks: [String] }); diff --git a/models/Challenge.js b/models/Challenge.js index 63e2f85ef5..bb4cfcd954 100644 --- a/models/Challenge.js +++ b/models/Challenge.js @@ -1,16 +1,22 @@ var mongoose = require('mongoose'); var secrets = require('../config/secrets'); +/** + * + * @type {exports.Schema} + */ + var challengeSchema = new mongoose.Schema({ name: { type: String, unique: true }, - link: String, - time: String, - challengeNumber: Number, - video: String, - steps: Array + difficulty: String, + description: Array, + tests: Array, + challengeSeed: Array, + challengeType: Number, // 0 = html, 1 = javascript only, 2 = video, 3 = zipline, 4 = basejump + MDNlinks: Array }); module.exports = mongoose.model('Challenge', challengeSchema); diff --git a/models/Courseware.js b/models/Courseware.js index 64309a6540..d760acdfd3 100644 --- a/models/Courseware.js +++ b/models/Courseware.js @@ -15,7 +15,6 @@ var coursewareSchema = new mongoose.Schema({ description: Array, tests: Array, challengeSeed: Array, - completionMessage: String, // Congratulations! You've finished our HTML and CSS track! challengeType: Number // 0 = html, 1 = javascript only, 2 = video, 3 = zipline, 4 = basejump }); diff --git a/models/User.js b/models/User.js index 38c073a2ba..a9ffe11ffb 100644 --- a/models/User.js +++ b/models/User.js @@ -124,7 +124,10 @@ var userSchema = new mongoose.Schema({ uncompletedCoursewares: Array, completedCoursewares: [ { - completedDate: Long, + completedDate: { + type: Long, + default: Date.now() + }, _id: String, name: String, completedWith: String, @@ -147,9 +150,25 @@ var userSchema = new mongoose.Schema({ // needsMigration has been deprecated, use needsSomeDataModeled needsMigration: { type: Boolean, default: true }, - finishedWaypoints: { type: Boolean, default: false }, sendMonthlyEmail: { type: Boolean, default: true }, - challengesHash: {} + challengesHash: {}, + currentChallenge: {}, + completedChallenges: [ + { + completedDate: Long, + _id: String, + name: String, + completedWith: String, + solution: String, + githubLink: String, + verified: Boolean, + challengeType: { + type: Number, + default: 0 + } + } + ], + uncompletedChallenges: Array, }); /** diff --git a/package.json b/package.json index a73ad3fc48..1b5f3b319c 100644 --- a/package.json +++ b/package.json @@ -11,13 +11,14 @@ }, "scripts": { "start": "node app.js", + "lint": "eslint --ext=.js,.jsx .", "test": "mocha" }, "license": "BSD-3-Clause", - "contributors" : [ + "contributors": [ { "name": "Quincy Larson", - "url" : "https://github.com/QuincyLarson" + "url": "https://github.com/QuincyLarson" }, { "name": "Nathan Leniz", @@ -63,6 +64,7 @@ "mongoose": "~4.0.1", "mongoose-long": "0.0.2", "morgan": "~1.5.0", + "node-slack": "0.0.7", "nodemailer": "~1.3.0", "passport": "~0.2.1", "passport-facebook": "~1.0.3", @@ -82,10 +84,13 @@ "yui": "~3.18.1" }, "devDependencies": { + "babel-eslint": "^3.1.7", "blessed": "~0.0.37", "bower-main-files": "~0.0.4", "browser-sync": "~1.8.1", "chai": "~1.10.0", + "eslint": "^0.21.2", + "eslint-plugin-react": "^2.3.0", "gulp": "~3.8.8", "gulp-eslint": "~0.9.0", "gulp-inject": "~1.0.2", diff --git a/public/css/main.less b/public/css/main.less index 8d8986d47f..932e87bc73 100644 --- a/public/css/main.less +++ b/public/css/main.less @@ -20,6 +20,16 @@ li, .wrappable { word-wrap: break-word; /* IE 5+ */ } +pre.wrappable { + white-space: pre; /* CSS 2.0 */ + white-space: pre-wrap; /* CSS 2.1 */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: -moz-pre-wrap; /* Mozilla */ + white-space: -hp-pre-wrap; /* HP Printers */ + word-wrap: break-word; /* IE 5+ */ +} + html { position: relative; min-height: 100%; @@ -236,8 +246,8 @@ ul { margin-top: -20px; } -.landing-p { - font-size: 18px !important; +.large-p { + font-size: 18px; } .text-success { diff --git a/public/js/lib/bonfire/bonfireFramework_v0.1.3.js b/public/js/lib/bonfire/bonfireFramework_v0.1.3.js deleted file mode 100644 index fb56ced9d0..0000000000 --- a/public/js/lib/bonfire/bonfireFramework_v0.1.3.js +++ /dev/null @@ -1,262 +0,0 @@ -var widgets = []; -var myCodeMirror = CodeMirror.fromTextArea(document.getElementById("codeEditor"), { - lineNumbers: true, - mode: "javascript", - theme: 'monokai', - runnable: true, - lint: true, - matchBrackets: true, - autoCloseBrackets: true, - scrollbarStyle: 'null', - lineWrapping: true, - gutters: ["CodeMirror-lint-markers"], - onKeyEvent: doLinting -}); -var editor = myCodeMirror; -editor.setSize("100%", "auto"); - -// Hijack tab key to enter two spaces intead -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); - } - }, - - - - "Ctrl-Enter": function() { - bonfireExecute(); - return false; - } -}); - - - -var attempts = 0; -if (attempts) { - attempts = 0; -} - -// Default value for editor if one isn't provided in (i.e. a challenge) -var nonChallengeValue = '/*Welcome to Bonfire, Free Code Camp\'s future CoderByte replacement.\n' + - 'Please feel free to use Bonfire as an in-browser playground and linting tool.\n' + - 'Note that you can also write tests using Chai.js by using the keywords assert and expect */\n\n' + - 'function test() {\n' + - ' assert(2 !== 3, "2 is not equal to 3");\n' + - ' return [1,2,3].map(function(elem) {\n' + - ' return elem * elem;\n' + - ' });\n' + - '}\n' + - 'expect(test()).to.be.a("array");\n\n' + - 'assert.deepEqual(test(), [1,4,9]);\n\n' + - 'var foo = test();\n' + - 'foo.should.be.a("array");\n\n' + - 'test();\n'; - -var codeOutput = CodeMirror.fromTextArea(document.getElementById("codeOutput"), { - lineNumbers: false, - mode: "text", - theme: 'monokai', - readOnly: 'nocursor', - lineWrapping: true -}); - -codeOutput.setValue('/**\n' + -' * Your output will go here.\n' + ' * Console.log() -type statements\n' + -' * will appear in your browser\'s\n' + ' * DevTools JavaScript console.\n' + -' */'); -codeOutput.setSize("100%", "100%"); -var info = editor.getScrollInfo(); -var after = editor.charCoords({line: editor.getCursor().line + 1, ch: 0}, "local").top; -if (info.top + info.clientHeight < after) - editor.scrollTo(null, after - info.clientHeight + 3); - -var editorValue; - - -var challengeSeed = challengeSeed || null; -var tests = tests || []; - - -if (challengeSeed !== null) { - editorValue = challengeSeed; -} else { - editorValue = nonChallengeValue; -} - - -myCodeMirror.setValue(editorValue); - -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 - })); - } - }); -}; - -$('#submitButton').on('click', function () { - bonfireExecute(); -}); - -function bonfireExecute() { - attempts++; - ga('send', 'event', 'Bonfire', 'ran-code', challengeName); - userTests= null; - $('#codeOutput').empty(); - var userJavaScript = myCodeMirror.getValue(); - userJavaScript = removeComments(userJavaScript); - userJavaScript = scrapeTests(userJavaScript); - // simple fix in case the user forgets to invoke their function - - submit(userJavaScript, function(cls, message) { - if (cls) { - codeOutput.setValue(message.error); - runTests('Error', null); - } else { - codeOutput.setValue(message.output); - message.input = removeLogs(message.input); - runTests(null, message); - } - }); -} - - -var userTests; -var testSalt = Math.random(); - - -var scrapeTests = function(userJavaScript) { - - // insert tests from mongo - for (var i = 0; i < tests.length; i++) { - userJavaScript += '\n' + tests[i]; - } - - var counter = 0; - var regex = new RegExp(/(expect(\s+)?\(.*\;)|(assert(\s+)?\(.*\;)|(assert\.\w.*\;)|(.*\.should\..*\;)/); - var match = regex.exec(userJavaScript); - while (match != null) { - var replacement = '//' + counter + testSalt; - userJavaScript = userJavaScript.substring(0, match.index) + replacement + userJavaScript.substring(match.index + match[0].length); - - if (!userTests) { - userTests= []; - } - userTests.push({"text": match[0], "line": counter, "err": null}); - counter++; - match = regex.exec(userJavaScript); - } - - return userJavaScript; -}; - -function removeComments(userJavaScript) { - var regex = new RegExp(/(\/\*[^(\*\/)]*\*\/)|\/\/[^\n]*/g); - return userJavaScript.replace(regex, ''); -} - -function removeLogs(userJavaScript) { - return userJavaScript.replace(/(console\.[\w]+\s*\(.*\;)/g, ''); -} - -var pushed = false; -var createTestDisplay = function() { - if (pushed) { - userTests.pop(); - } - for (var i = 0; i < userTests.length;i++) { - var test = userTests[i]; - var testDoc = document.createElement("div"); - if (test.err != null) { - $(testDoc) - .html("
setBookmark
method.var sum2And = add(2); return sum2And(3); // 5
",
- "If either argument isn't a valid number, return undefined."
- ],
- "challengeSeed": "function add() {\n return false;\n}\n\nadd(2,3);",
- "tests": [
- "expect(add(2, 3)).to.equal(5);",
- "expect(add(2)(3)).to.equal(5);",
- "expect(add('http://bit.ly/IqT6zt')).to.be.undefined;",
- "expect(add(2, '3')).to.be.undefined;",
- "expect(add(2)([3])).to.be.undefined;"
- ],
- "MDNlinks": ["Global Function Object", "Arguments object", "Closures", "Currying"]
- },
- {
- "_id": "a2f1d72d9b908d0bd72bb9f6",
- "name": "Make a Person",
- "difficulty": "3.12",
- "description": [
- "Fill in the object constructor with the methods specified in the tests.",
- "Those methods are getFirstName(), getLastName(), getFullName(), setFirstName(first), setLastName(last), and setFullName(firstAndLast).",
- "All functions that take an argument have an arity of 1, and the argument will be a string.",
- "These methods must be the only available means for interacting with the object."
- ],
- "challengeSeed": "var Person = function(firstAndLast) {\n return firstAndLast;\r\n};\n\nvar bob = new Person('Bob Ross');\nbob.getFullName();",
- "tests": [
- "expect(Object.keys(bob).length).to.eql(6);",
- "expect(bob instanceof Person).to.be.true;",
- "expect(bob.firstName).to.be.undefined();",
- "expect(bob.lastName).to.be.undefined();",
- "expect(bob.getFirstName()).to.eql('Bob');",
- "expect(bob.getLastName()).to.eql('Ross');",
- "expect(bob.getFullName()).to.eql('Bob Ross');",
- "bob.setFirstName('Happy');",
- "expect(bob.getFirstName()).to.eql('Happy');",
- "bob.setLastName('Trees');",
- "expect(bob.getLastName()).to.eql('Trees');",
- "bob.setFullName('George Carlin');",
- "expect(bob.getFullName()).to.eql('George Carlin');",
- "bob.setFullName('Bob Ross');"
- ],
- "MDNlinks" : ["Closures", "Details of the Object Model"]
- },
- {
- "_id": "af4afb223120f7348cdfc9fd",
- "name": "Map the Debris",
- "difficulty": "3.50",
- "description": [
- "Return a new array that transforms the element's average altitude into their orbital periods.",
- "The array will contain objects in the format {name: 'name', avgAlt: avgAlt}
.",
- "You can read about orbital periods on wikipedia.",
- "The values should be rounded to the nearest whole number. The body being orbited is Earth.",
- "The radius of the earth is 6367.4447 kilometers, and the GM value of earth is 398600.4418"
- ],
- "challengeSeed": "function orbitalPeriod(arr) {\n var GM = 398600.4418;\n var earthRadius = 6367.4447;\n return arr;\r\n}\r\n\r\norbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}]);",
- "tests": [
- "expect(orbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}])).to.eqls([{name: \"sputkin\", orbitalPeriod: 86400}]);",
- "expect(orbitalPeriod([{name: \"iss\", avgAlt: 413.6}, {name: \"hubble\", avgAlt: 556.7}, {name: \"moon\", avgAlt: 378632.553}])).to.eqls([{name : \"iss\", orbitalPeriod: 5557}, {name: \"hubble\", orbitalPeriod: 5734}, {name: \"moon\", orbitalPeriod: 2377399}]);"
- ],
- "MDNlinks" : ["Math.pow()"]
- },
- {
- "_id" : "a3f503de51cfab748ff001aa",
- "name": "Pairwise",
- "difficulty": "3.51",
- "description": [
- "Return the sum of all indices of elements of 'arr' that can be paired with one other element to form a sum that equals the value in the second argument 'arg'. If multiple sums are possible, return the smallest sum. Once an element has been used, it cannot be reused to pair with another.",
- "For example, pairwise([1, 4, 2, 3, 0, 5], 7) should return 11 because 4, 2, 3 and 5 can be paired with each other to equal 7.",
- "pairwise([1, 3, 2, 4], 4) would only equal 1, because only the first two elements can be paired to equal 4, and the first element has an index of 0!"
- ],
- "challengeSeed": "function pairwise(arr, arg) {\n return arg;\n}\n\npairwise([1,4,2,3,0,5], 7);",
- "tests": [
- "expect(pairwise([1, 4, 2, 3, 0, 5], 7)).to.equal(11);",
- "expect(pairwise([1, 3, 2, 4], 4)).to.equal(1);",
- "expect(pairwise([1,1,1], 2)).to.equal(1);",
- "expect(pairwise([0, 0, 0, 0, 1, 1], 1)).to.equal(10);",
- "expect(pairwise([], 100)).to.equal(0);"
- ],
- "MDNlinks" : ["Array.reduce()"]
- },
- {
- "_id": "aff0395860f5d3034dc0bfc9",
- "name": "Validate US Telephone Numbers",
- "difficulty": "4.01",
- "description": [
- "Return true if the passed string is a valid US phone number",
- "The user may fill out the form field any way they choose as long as it is a valid US number. The following are all valid formats for US numbers:",
- "555-555-5555, (555)555-5555, (555) 555-5555, 555 555 5555, 5555555555, 1 555 555 5555",
- "For this challenge you will be presented with a string such as \"800-692-7753\" or \"8oo-six427676;laskdjf\". Your job is to validate or reject the US phone number based on any combination of the formats provided above. The area code is required. If the country code is provided, you must confirm that the country code is \"1\". Return true if the string is a valid US phone number; otherwise false."
- ],
- "tests": [
- "expect(telephoneCheck(\"555-555-5555\")).to.be.a(\"boolean\");",
- "assert.deepEqual(telephoneCheck(\"1 555-555-5555\"), true);",
- "assert.deepEqual(telephoneCheck(\"1 (555) 555-5555\"), true);",
- "assert.deepEqual(telephoneCheck(\"5555555555\"), true);",
- "assert.deepEqual(telephoneCheck(\"555-555-5555\"), true);",
- "assert.deepEqual(telephoneCheck(\"(555)555-5555\"), true);",
- "assert.deepEqual(telephoneCheck(\"1(555)555-5555\"), true);",
- "assert.deepEqual(telephoneCheck(\"1 555 555 5555\"), true);",
- "assert.deepEqual(telephoneCheck(\"555-555-5555\"), true);",
- "assert.deepEqual(telephoneCheck(\"1 456 789 4444\"), true);",
- "assert.deepEqual(telephoneCheck(\"123**&!!asdf#\"), false);",
- "assert.deepEqual(telephoneCheck(\"55555555\"), false);",
- "assert.deepEqual(telephoneCheck(\"(6505552368)\"), false);",
- "assert.deepEqual(telephoneCheck(\"2 (757) 622-7382\"), false);",
- "assert.deepEqual(telephoneCheck(\"0 (757) 622-7382\"), false);",
- "assert.deepEqual(telephoneCheck(\"-1 (757) 622-7382\"), false);",
- "assert.deepEqual(telephoneCheck(\"2 757 622-7382\"), false);",
- "assert.deepEqual(telephoneCheck(\"10 (757) 622-7382\"), false);",
- "assert.deepEqual(telephoneCheck(\"27576227382\"), false);",
- "assert.deepEqual(telephoneCheck(\"(275)76227382\"), false);",
- "assert.deepEqual(telephoneCheck(\"2(757)6227382\"), false);",
- "assert.deepEqual(telephoneCheck(\"2(757)622-7382\"), false);"
- ],
- "challengeSeed": "function telephoneCheck(str) {\n // Good luck!\n return true;\n}\n\n\n\ntelephoneCheck(\"555-555-5555\");",
- "MDNlinks" : ["RegExp"]
- },
- {
- "_id": "a3f503de51cf954ede28891d",
- "name": "Symmetric Difference",
- "difficulty": "4.02",
- "description": [
- "Create a function that takes two or more arrays and returns an array of the symmetric difference of the provided arrays.",
- "The mathematical term symmetric difference refers to the elements in two sets that are in either the first or second set, but not in both."
- ],
- "challengeSeed": "function sym(args) {\n return arguments;\r\n}\n\nsym([1, 2, 3], [5, 2, 1, 4]);",
- "tests": [
- "expect(sym([1, 2, 3], [5, 2, 1, 4])).to.eqls([3, 5, 4])",
- "assert.deepEqual(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'should return the symmetric difference of the given arrays');",
- "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()"]
- },
- {
- "_id": "aa2e6f85cab2ab736c9a9b24",
- "name": "Cash Register",
- "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."
- ],
- "challengeSeed": "function drawer(price, cash, cid) {\n var change;\r\n // Here is your change, ma'am.\r\n return change;\r\n}\r\n\r\n// Example cash-in-drawer array:\r\n// [['PENNY', 1.01],\r\n// ['NICKEL', 2.05],\r\n// ['DIME', 3.10],\r\n// ['QUARTER', 4.25],\r\n// ['ONE', 90.00],\r\n// ['FIVE', 55.00],\r\n// ['TEN', 20.00],\r\n// ['TWENTY', 60.00],\r\n// ['ONE HUNDRED', 100.00]]\n\ndrawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);",
- "tests": [
- "expect(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]])).to.be.a('array');",
- "expect(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]])).to.be.a('string');",
- "expect(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]])).to.be.a('string');",
- "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['QUARTER', 0.50]], 'return correct change');",
- "assert.deepEqual(drawer(3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['TWENTY', 60.00], ['TEN', 20.00], ['FIVE', 15], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04] ], 'return correct change with multiple coins and bills');",
- "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"]
- },
- {
- "_id": "a56138aff60341a09ed6c480",
- "name": "Inventory Update",
- "difficulty": "4.04",
- "description": [
- "Compare and update inventory stored in a 2d array against a second 2d array of a fresh delivery. Update current inventory item quantity, and if an item cannot be found, add the new item and quantity into the inventory array in alphabetical order."
- ],
- "challengeSeed": "function inventory(arr1, arr2) {\n // All inventory must be accounted for or you're fired!\r\n return arr1;\r\n}\n\n// Example inventory lists\r\nvar curInv = [\r\n [21, 'Bowling Ball'],\r\n [2, 'Dirty Sock'],\r\n [1, 'Hair Pin'],\r\n [5, 'Microphone']\r\n];\r\n\r\nvar newInv = [\r\n [2, 'Hair Pin'],\r\n [3, 'Half-Eaten Apple'],\r\n [67, 'Bowling Ball'],\r\n [7, 'Toothpaste']\r\n];\r\n\r\ninventory(curInv, newInv);",
- "tests": [
- "expect(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']])).to.be.a('array');",
- "assert.equal(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]).length, 6);",
- "assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']]);",
- "assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], []), [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']]);",
- "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"]
- },
- {
- "_id": "a7bf700cd123b9a54eef01d5",
- "name": "No repeats please",
- "difficulty": "4.05",
- "description": [
- "Return the number of total permutations of the provided string that don't have repeated consecutive letters.",
- "For example, 'aab' should return 2 because it has 6 total permutations, but only 2 of them don't have the same letter (in this case 'a') repeating."
- ],
- "challengeSeed": "function permAlone(str) {\n return str;\n}\n\npermAlone('aab');",
- "tests": [
- "expect(permAlone('aab')).to.be.a.number;",
- "expect(permAlone('aab')).to.equal(2);",
- "expect(permAlone('aaa')).to.equal(0);",
- "expect(permAlone('aabb')).to.equal(8);",
- "expect(permAlone('abcdefa')).to.equal(3600);",
- "expect(permAlone('abfdefa')).to.equal(2640);",
- "expect(permAlone('zzzzzzzz')).to.equal(0);"
- ],
- "MDNlinks" : ["Permutations", "RegExp"]
- },
- {
- "_id": "a19f0fbe1872186acd434d5a",
- "name": "Friendly Date Ranges",
- "difficulty": "4.06",
- "description": [
- "Implement a way of converting two dates into a more friendly date range that could be presented to a user.",
- "It must not show any redundant information in the date range.",
- "For example, if the year and month are the same then only the day range should be displayed.",
- "Secondly, if the starting year is the current year, and the ending year can be inferred by the reader, the year should be omitted.",
- "Input date is formatted as YYYY-MM-DD"
- ],
- "challengeSeed": "function friendly(str) {\n return str;\n}\n\nfriendly(['2015-07-01', '2015-07-04']);",
- "tests": [
- "assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'ending month should be omitted since it is already mentioned');",
- "assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'one month apart can be inferred it is the next year');",
- "assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017']);",
- "assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th, 2016']);",
- "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()"]
- }
-]
diff --git a/seed_data/challenges/advanced-bonfires.json b/seed_data/challenges/advanced-bonfires.json
new file mode 100644
index 0000000000..50829b7473
--- /dev/null
+++ b/seed_data/challenges/advanced-bonfires.json
@@ -0,0 +1,219 @@
+{
+ "name": "Advanced Algorithm Scripting",
+ "order" : 0.011,
+ "challenges": [
+ {
+ "_id": "aff0395860f5d3034dc0bfc9",
+ "name": "Bonfire: Validate US Telephone Numbers",
+ "difficulty": "4.01",
+ "description": [
+ "Return true if the passed string is a valid US phone number",
+ "The user may fill out the form field any way they choose as long as it is a valid US number. The following are all valid formats for US numbers:",
+ "555-555-5555, (555)555-5555, (555) 555-5555, 555 555 5555, 5555555555, 1 555 555 5555",
+ "For this challenge you will be presented with a string such as \"800-692-7753\" or \"8oo-six427676;laskdjf\". Your job is to validate or reject the US phone number based on any combination of the formats provided above. The area code is required. If the country code is provided, you must confirm that the country code is \"1\". Return true if the string is a valid US phone number; otherwise false.",
+ "Remember to use RSAP if you get stuck. Try to pair program. Write your own code."
+ ],
+ "tests": [
+ "expect(telephoneCheck(\"555-555-5555\")).to.be.a(\"boolean\");",
+ "assert.deepEqual(telephoneCheck(\"1 555-555-5555\"), true);",
+ "assert.deepEqual(telephoneCheck(\"1 (555) 555-5555\"), true);",
+ "assert.deepEqual(telephoneCheck(\"5555555555\"), true);",
+ "assert.deepEqual(telephoneCheck(\"555-555-5555\"), true);",
+ "assert.deepEqual(telephoneCheck(\"(555)555-5555\"), true);",
+ "assert.deepEqual(telephoneCheck(\"1(555)555-5555\"), true);",
+ "assert.deepEqual(telephoneCheck(\"1 555 555 5555\"), true);",
+ "assert.deepEqual(telephoneCheck(\"555-555-5555\"), true);",
+ "assert.deepEqual(telephoneCheck(\"1 456 789 4444\"), true);",
+ "assert.deepEqual(telephoneCheck(\"123**&!!asdf#\"), false);",
+ "assert.deepEqual(telephoneCheck(\"55555555\"), false);",
+ "assert.deepEqual(telephoneCheck(\"(6505552368)\"), false);",
+ "assert.deepEqual(telephoneCheck(\"2 (757) 622-7382\"), false);",
+ "assert.deepEqual(telephoneCheck(\"0 (757) 622-7382\"), false);",
+ "assert.deepEqual(telephoneCheck(\"-1 (757) 622-7382\"), false);",
+ "assert.deepEqual(telephoneCheck(\"2 757 622-7382\"), false);",
+ "assert.deepEqual(telephoneCheck(\"10 (757) 622-7382\"), false);",
+ "assert.deepEqual(telephoneCheck(\"27576227382\"), false);",
+ "assert.deepEqual(telephoneCheck(\"(275)76227382\"), false);",
+ "assert.deepEqual(telephoneCheck(\"2(757)6227382\"), false);",
+ "assert.deepEqual(telephoneCheck(\"2(757)622-7382\"), false);"
+ ],
+ "challengeSeed": [
+ "function telephoneCheck(str) {",
+ " // Good luck!",
+ " return true;",
+ "}",
+ "",
+ "",
+ "",
+ "telephoneCheck(\"555-555-5555\");"
+ ],
+ "MDNlinks" : ["RegExp"],
+ "challengeType": 5
+ },
+ {
+ "_id": "a3f503de51cf954ede28891d",
+ "name": "Bonfire: Symmetric Difference",
+ "difficulty": "4.02",
+ "description": [
+ "Create a function that takes two or more arrays and returns an array of the symmetric difference of the provided arrays.",
+ "The mathematical term symmetric difference refers to the elements in two sets that are in either the first or second set, but not in both.",
+ "Remember to use RSAP if you get stuck. Try to pair program. Write your own code."
+ ],
+ "challengeSeed": [
+ "function sym(args) {",
+ " return arguments;",
+ "}",
+ "",
+ "sym([1, 2, 3], [5, 2, 1, 4]);"
+ ],
+ "tests": [
+ "expect(sym([1, 2, 3], [5, 2, 1, 4])).to.eqls([3, 5, 4])",
+ "assert.deepEqual(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'should return the symmetric difference of the given arrays');",
+ "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
+ },
+ {
+ "_id": "aa2e6f85cab2ab736c9a9b24",
+ "name": "Bonfire: Cash Register",
+ "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.",
+ "Remember to use RSAP if you get stuck. Try to pair program. Write your own code."
+ ],
+ "challengeSeed": [
+ "function drawer(price, cash, cid) {",
+ " var change;",
+ " // Here is your change, ma'am.",
+ " return change;",
+ "}",
+ "",
+ "// Example cash-in-drawer array:",
+ "// [['PENNY', 1.01],",
+ "// ['NICKEL', 2.05],",
+ "// ['DIME', 3.10],",
+ "// ['QUARTER', 4.25],",
+ "// ['ONE', 90.00],",
+ "// ['FIVE', 55.00],",
+ "// ['TEN', 20.00],",
+ "// ['TWENTY', 60.00],",
+ "// ['ONE HUNDRED', 100.00]]",
+ "",
+ "drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);"
+ ],
+ "tests": [
+ "expect(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]])).to.be.a('array');",
+ "expect(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]])).to.be.a('string');",
+ "expect(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]])).to.be.a('string');",
+ "assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['QUARTER', 0.50]], 'return correct change');",
+ "assert.deepEqual(drawer(3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['TWENTY', 60.00], ['TEN', 20.00], ['FIVE', 15], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04] ], 'return correct change with multiple coins and bills');",
+ "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
+ },
+ {
+ "_id": "a56138aff60341a09ed6c480",
+ "name": "Bonfire: Inventory Update",
+ "difficulty": "4.04",
+ "description": [
+ "Compare and update inventory stored in a 2d array against a second 2d array of a fresh delivery. Update current inventory item quantity, and if an item cannot be found, add the new item and quantity into the inventory array in alphabetical order.",
+ "Remember to use RSAP if you get stuck. Try to pair program. Write your own code."
+ ],
+ "challengeSeed": [
+ "function inventory(arr1, arr2) {",
+ " // All inventory must be accounted for or you're fired!",
+ " return arr1;",
+ "}",
+ "",
+ "// Example inventory lists",
+ "var curInv = [",
+ " [21, 'Bowling Ball'],",
+ " [2, 'Dirty Sock'],",
+ " [1, 'Hair Pin'],",
+ " [5, 'Microphone']",
+ "];",
+ "",
+ "var newInv = [",
+ " [2, 'Hair Pin'],",
+ " [3, 'Half-Eaten Apple'],",
+ " [67, 'Bowling Ball'],",
+ " [7, 'Toothpaste']",
+ "];",
+ "",
+ "inventory(curInv, newInv);"
+ ],
+ "tests": [
+ "expect(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']])).to.be.a('array');",
+ "assert.equal(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]).length, 6);",
+ "assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']]);",
+ "assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], []), [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']]);",
+ "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
+ },
+ {
+ "_id": "a7bf700cd123b9a54eef01d5",
+ "name": "Bonfire: No repeats please",
+ "difficulty": "4.05",
+ "description": [
+ "Return the number of total permutations of the provided string that don't have repeated consecutive letters.",
+ "For example, 'aab' should return 2 because it has 6 total permutations, but only 2 of them don't have the same letter (in this case 'a') repeating.",
+ "Remember to use RSAP if you get stuck. Try to pair program. Write your own code."
+ ],
+ "challengeSeed": [
+ "function permAlone(str) {",
+ " return str;",
+ "}",
+ "",
+ "permAlone('aab');"
+ ],
+ "tests": [
+ "expect(permAlone('aab')).to.be.a.number;",
+ "expect(permAlone('aab')).to.equal(2);",
+ "expect(permAlone('aaa')).to.equal(0);",
+ "expect(permAlone('aabb')).to.equal(8);",
+ "expect(permAlone('abcdefa')).to.equal(3600);",
+ "expect(permAlone('abfdefa')).to.equal(2640);",
+ "expect(permAlone('zzzzzzzz')).to.equal(0);"
+ ],
+ "MDNlinks" : ["Permutations", "RegExp"],
+ "challengeType": 5
+ },
+ {
+ "_id": "a19f0fbe1872186acd434d5a",
+ "name": "Bonfire: Friendly Date Ranges",
+ "difficulty": "4.06",
+ "description": [
+ "Implement a way of converting two dates into a more friendly date range that could be presented to a user.",
+ "It must not show any redundant information in the date range.",
+ "For example, if the year and month are the same then only the day range should be displayed.",
+ "Secondly, if the starting year is the current year, and the ending year can be inferred by the reader, the year should be omitted.",
+ "Input date is formatted as YYYY-MM-DD",
+ "Remember to use RSAP if you get stuck. Try to pair program. Write your own code."
+ ],
+ "challengeSeed": [
+ "function friendly(str) {",
+ " return str;",
+ "}",
+ "",
+ "friendly(['2015-07-01', '2015-07-04']);"
+ ],
+ "tests": [
+ "assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'ending month should be omitted since it is already mentioned');",
+ "assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'one month apart can be inferred it is the next year');",
+ "assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017']);",
+ "assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th, 2016']);",
+ "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
+ }
+ ]
+}
diff --git a/seed_data/challenges/basejumps.json b/seed_data/challenges/basejumps.json
new file mode 100644
index 0000000000..c96b49c00a
--- /dev/null
+++ b/seed_data/challenges/basejumps.json
@@ -0,0 +1,179 @@
+{
+ "name": "Full Stack JavaScript Projects",
+ "order" : 0.014,
+ "challenges": [
+ {
+ "_id": "bd7158d8c443eddfaeb5bcef",
+ "name": "Waypoint: Get Set for Basejumps",
+ "difficulty": 2.00,
+ "challengeSeed": "128451852",
+ "description": [
+ "Objective: Get the MEAN stack running on Cloud 9, push your code to GitHub, and deploy it to Heroku.",
+ "We'll build our Basejumps on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
+ "If you don't already have Cloud 9 account, create one now at http://c9.io.",
+ "Now let's get your development environment ready for a new Angular-Fullstack application provided by Yeoman.",
+ "Open up http://c9.io and sign in to your account.",
+ "Click on Create New Workspace at the top right of the c9.io page, then click on the \"Create a new workspace\" popup that appears below it the button after you click on it.",
+ "Give your workspace a name.",
+ "Choose Node.js in the selection area below the name field.",
+ "Click the Create button.",
+ "Wait for the workspace to finish processing and select it on the left sidebar, below the Create New Workspace button.",
+ "Click the \"Start Editing\" button.",
+ "In the lower right hand corner you should see a terminal window. In this window use the following commands. You don't need to know what these mean at this point.",
+ "Never run this command on your local machine. But in your Cloud 9 terminal window, run: rm -rf * && echo \"export NODE_PATH=$NODE_PATH:/home/ubuntu/.nvm/v0.10.35/lib/node_modules\" >> ~/.bashrc && source ~/.bashrc && npm install -g yo grunt grunt-cli generator-angular-fullstack && yo angular-fullstack
",
+ "Yeoman will prompt you to answer some questions. Answer them like this:",
+ "What would you like to write scripts with? JavaScript",
+ "What would you like to write markup with? HTML",
+ "What would you like to write stylesheets with? CSS",
+ "What Angular router would you like to use? ngRoute",
+ "Would you like to include Bootstrap? Yes",
+ "Would you like to include UI Bootstrap? Yes",
+ "Would you like to use MongoDB with Mongoose for data modeling? Yes",
+ "Would you scaffold out an authentication boilerplate? Yes",
+ "Would you like to include additional oAuth strategies? Twitter",
+ "Would you like to use socket.io? No",
+ "May bower anonymously report usage statistics to improve the tool over time? (Y/n) Y",
+ "You may get an error similar to ERR! EEXIST, open ‘/home/ubuntu/.npm
. This is caused when Cloud9 runs out of memory and kills an install. If you get this, simply re-run this process with the command yo angular-fullstack
. You will then be asked a few questions regarding the re-install. Answer them as follows:",
+ "Existing .yo-rc configuration found, would you like to use it? (Y/n) Y",
+ "Overwrite client/favicon.ico? (Ynaxdh) Y",
+ "To finish the installation run the commands: bower install && npm install
",
+ "To start MongoDB, run the following commands in your terminal: mkdir data && echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest \"$@\"' > mongod && chmod a+x mongod && ./mongod
",
+ "You will want to open up a new terminal to work from by clicking on the + icon and select New Terminal",
+ "Start the application by running the following command in your new terminal window: grunt serve
",
+ "Wait for the following message to appear: xdg-open: no method available for opening 'http://localhost:8080'
. Now you can open the internal Cloud9 browser. To launch the browser select Preview in the toolbar then select the dropdown option Preview Running Application.",
+ "Turn the folder in which your application is running into a Git repository by running the following commands: git init && git add . && git commit -am 'initial commit'
.",
+ "Now we need to add your GitHub SSH key to c9.io. Click the \"Add-on Services\" button in the lower left of your C9 dashboard. Click \"activate\" next to the GitHub icon.",
+ "A pop up will appear. Allow access to your account.",
+ "While still on the dashboard, under “Account Settings”, click the link for \"Show your SSH key\". Copy the key to you clipboard.",
+ "Sign in to http://github.com and navigate to the GitHub SSH settings page. Click the \"Add SSH Key\". Give your key the title \"cloud 9\". Paste your SSH Key into the \"Key\" box, then click \"Add Key\".",
+ "Create a new GitHub repository by and clicking on the + button next to your username in the upper-right hand side of your screen, then selecting \"New Repository\".",
+ "Enter a project name, then click the \"Create Repository\" button.",
+ "Find the \"...or push an existing repository from the command line\" section and click the Copy to Clipboard button beside it.",
+ "Paste the commands from your clipboard into the Cloud9 terminal prompt. This will push your changes to your repository on Cloud 9 up to GitHub.",
+ "Check back on your GitHub profile to verify the changes were successfully pushed up to GitHub.",
+ "Now let's push your code to Heroku. If you don't already have a Heroku account, create one at http://heroku.com. You shouldn't be charged for anything, but you will need to add your credit card information to your Heroku before you will be able to use Heroku's free MongoLab add on.",
+ "Before you publish to Heroku, you should free up as much memory as possible on Cloud9. In each of the Cloud9 terminal prompt tabs where MongoDB and Grunt are running, press the control + c
hotkey to shut down these processes.",
+ "Run the following command in a Cloud9 terminal prompt tab: npm install grunt-contrib-imagemin --save-dev && npm install --save-dev && heroku login
. At this point, the terminal will prompt you to log in to Heroku from the command line.",
+ "Now run yo angular-fullstack:heroku
. You can choose a name for your Heroku project, or Heroku will create a random one for you. You can choose whether you want to deploy to servers the US or the EU.",
+ "Set the config flag for your Heroku environment and add MongoLab for your MongoDB instance by running the following command: cd ~/workspace/dist && heroku config:set NODE_ENV=production && heroku addons:add mongolab
.",
+ "As you build your app, you should frequently commit changes to your codebase. Make sure you're in the ~/workspace
directory by running cd ~/workspace
. Then you can this code to stage the changes to your changes and commit them: git commit -am \"your commit message\"
. Note that you should replace \"your commit message\" with a short summary of the changes you made to your code, such as \"added a records controller and corresponding routes\".",
+ "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,
+ "tests": []
+ },
+ {
+ "_id": "bd7158d8c443eddfaeb5bdef",
+ "name": "Basejump: Build a Voting App",
+ "difficulty": 2.01,
+ "challengeSeed": "128451852",
+ "description": [
+ "Objective: Build a full stack JavaScript app that successfully reverse-engineers this: http://voteplex.herokuapp.com/ and deploy it to Heroku.",
+ "Note that for each Basejump, you should create a new GitHub repository and a new Heroku project. If you can't remember how to do this, revisit http://freecodecamp.com/challenges/get-set-for-basejumps.",
+ "As you build your app, you should frequently commit changes to your codebase. You can do this by running git commit -am \"your commit message\"
. Note that you should replace \"your commit message\" with a brief summary of the changes you made to your code.",
+ "You can push these new commits to GitHub by running git push origin master
, and to Heroku by running grunt --force && grunt buildcontrol:heroku
.",
+ "Here are the specific User Stories you should implement for this Basejump:",
+ "User Story: As an authenticated user, I can keep my polls and come back later to access them.",
+ "User Story: As an authenticated user, I can share my polls with my friends.",
+ "User Story: As an authenticated user, I can see the aggregate results of my polls.",
+ "User Story: As an authenticated user, I can delete polls that I decide I don't want anymore.",
+ "User Story: As an authenticated user, I can create a poll with any number of possible items.",
+ "Bonus User Story: As an unauthenticated user, I can see everyone's polls, but I can't vote on anything.",
+ "Bonus User Story: As an unauthenticated or authenticated user, I can see the results of polls in chart form. (This could be implemented using Chart.js or Google Charts.)",
+ "Bonus User Story: As an authenticated user, if I don't like the options on a poll, I can create a new option.",
+ "Once you've finished implementing these user stories, 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.",
+ "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.git commit -am \"your commit message\"
. Note that you should replace \"your commit message\" with a brief summary of the changes you made to your code.",
+ "You can push these new commits to GitHub by running git push origin master
, and to Heroku by running grunt --force && grunt buildcontrol:heroku
.",
+ "Here are the specific User Stories you should implement for this Basejump:",
+ "User Story: As an unauthenticated user, I can view all bars in my area.",
+ "User Story: As an authenticated user, I can add myself to a bar to indicate I am going there tonight.",
+ "User Story: As an authenticated user, I can remove myself from a bar if I no longer want to go there.",
+ "Bonus User Story: As an unauthenticated user, when I login I should not have to search again.",
+ "Once you've finished implementing these user stories, 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.",
+ "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.git commit -am \"your commit message\"
. Note that you should replace \"your commit message\" with a brief summary of the changes you made to your code.",
+ "You can push these new commits to GitHub by running git push origin master
, and to Heroku by running grunt --force && grunt buildcontrol:heroku
.",
+ "Here are the specific User Stories you should implement for this Basejump:",
+ "User Story: As a user, I can view a graph displaying the recent trend lines for each added stock.",
+ "User Story: As a user, I can add new stocks by their symbol name.",
+ "User Story: As a user, I can remove stocks.",
+ "Bonus User Story: As a user, I can see changes in real-time when any other user adds or removes a stock.",
+ "Once you've finished implementing these user stories, 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.",
+ "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.git commit -am \"your commit message\"
. Note that you should replace \"your commit message\" with a brief summary of the changes you made to your code.",
+ "You can push these new commits to GitHub by running git push origin master
, and to Heroku by running grunt --force && grunt buildcontrol:heroku
.",
+ "Here are the specific User Stories you should implement for this Basejump:",
+ "User Story: As an authenticated user, I can view all books posted by every user.",
+ "User Story: As an authenticated user, I can add a new book.",
+ "User Story: As an authenticated user, I can update my settings to store my full name, city, and state.",
+ "Bonus User Story: As an authenticated user, I can propose a trade and wait for the other user to accept the trade.",
+ "Once you've finished implementing these user stories, 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.",
+ "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.git commit -am \"your commit message\"
. Note that you should replace \"your commit message\" with a brief summary of the changes you made to your code.",
+ "You can push these new commits to GitHub by running git push origin master
, and to Heroku by running grunt --force && grunt buildcontrol:heroku
.",
+ "Here are the specific User Stories you should implement for this Basejump:",
+ "User Story: As an unauthenticated user, I can login with Twitter.",
+ "User Story: As an authenticated user, I can link to images.",
+ "User Story: As an authenticated user, I can delete images that I've linked to.",
+ "User Story: As an authenticated user, I can see a Pinterest-style wall of all the images I've linked to.",
+ "User Story: As an unauthenticated user, I can browse other users' walls of images.",
+ "Bonus User Story: As an authenticated user, if I upload an image that is broken, it will be replaced by a placeholder image. (can use jQuery broken image detection)",
+ "Hint: Masonry.js is a library that allows for Pinterest-style image grids.",
+ "Once you've finished implementing these user stories, 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.",
+ "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.var sum2And = add(2); return sum2And(3); // 5
",
+ "If either argument isn't a valid number, return undefined.",
+ "Remember to use RSAP if you get stuck. Try to pair program. Write your own code."
+ ],
+ "challengeSeed": [
+ "function add() {",
+ " return false;",
+ "}",
+ "",
+ "add(2,3);"
+ ],
+ "tests": [
+ "expect(add(2, 3)).to.equal(5);",
+ "expect(add(2)(3)).to.equal(5);",
+ "expect(add('http://bit.ly/IqT6zt')).to.be.undefined;",
+ "expect(add(2, '3')).to.be.undefined;",
+ "expect(add(2)([3])).to.be.undefined;"
+ ],
+ "MDNlinks": ["Global Function Object", "Arguments object"],
+ "challengeType": 5
+ }
+ ]
+}
diff --git a/seed_data/challenges/basic-html5-and-css.json b/seed_data/challenges/basic-html5-and-css.json
new file mode 100644
index 0000000000..8b773fb39c
--- /dev/null
+++ b/seed_data/challenges/basic-html5-and-css.json
@@ -0,0 +1,2028 @@
+{
+ "name": "Basic HTML5 and CSS",
+ "order" : 0.002,
+ "challenges": [
+ {
+ "_id": "bd7123c8c441eddfaeb5bdef",
+ "name": "Waypoint: Say Hello to HTML Elements",
+ "difficulty": 0.0085,
+ "description": [
+ "Welcome to Free Code Camp's first coding challenge! Click on the button below for further instructions.",
+ "Awesome. Now you can read the rest of this challenge's instructions.",
+ "You can edit code
in your text editor
, which we've embedded into this web page.",
+ "Do you see the code in your text editor that says <h1>Hello</h1>
? That's an HTML element
.",
+ "Most HTML elements have an opening tag
and a closing tag
. Opening tags look like this: <h1>
. Closing tags look like this: </h1>
. Note that the only difference between opening and closing tags is that closing tags have a slash after their opening angle bracket.",
+ "Once you've completed each challenge, and all its tests are passing, the \"Go to my next challenge\" button will become enabled. Click it - or press control and enter at the same time - to advance to the next challenge.",
+ "To enable the \"Go to my next challenge\" button on this exercise, change your h1
tag's text to say \"Hello World\" instead of \"Hello\"."
+ ],
+ "tests": [
+ "assert.isTrue((/hello(\\s)+world/gi).test($('h1').text()), 'Your h1 element should have the text \"Hello World\"')"
+ ],
+ "challengeSeed": [
+ "h2
tag that says \"CatPhotoApp\" to create a second HTML element
below your \"Hello World\" h1
element.",
+ "The h2 element you enter will create an h2 element on the website.",
+ "This element tells the browser how to render the text that it contains.",
+ "h2
elements are slightly smaller than h1
elements. There are also h3
, h4
, h5
and h6
elements."
+ ],
+ "tests": [
+ "assert.isTrue((/cat(\\s)?photo(\\s)?app/gi).test($('h2').text()), 'Your h2 element should have the text \"CatPhotoApp\"')",
+ "assert.isTrue((/hello(\\s)+world/gi).test($('h1').text()), 'Your h1 element should have the text \"Hello World\"')"
+ ],
+ "challengeSeed": [
+ "<p>I'm a p tag!</p>
"
+ ],
+ "tests": [
+ "assert.isTrue((/hello(\\s)+paragraph/gi).test($('p').text()), 'Your paragraph element should have the text \"Hello Paragraph\"')"
+ ],
+ "challengeSeed": [
+ "line break
between the <h2>
and <p>
elements.",
+ "You can create an line break element with <br/>
.",
+ "Note that <br/>
has no closing tag. It is a self-closing
element. See how a forward-slash precedes the closing bracket?",
+ "You'll encounter other self-closing
element tags soon."
+ ],
+ "tests": [
+ "assert(($('br').length > 0), 'You should have a br element between your h2 and paragraph elements.')"
+ ],
+ "challengeSeed": [
+ "Hello Paragraph
" + ], + "challengeType": 0 + }, + { + "_id": "bad87fee1348bd9aedf08802", + "name": "Waypoint: Uncomment HTML", + "difficulty": 0.013, + "description": [ + "Uncomment theh1
, h2
and p
elements.",
+ "Commenting is a way that you can leave comments within your code without affecting the code itself.",
+ "Commenting is also a convenient way to make code inactive without having to delete it entirely.",
+ "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.')"
+ ],
+ "challengeSeed": [
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1348bd9aedf08804",
+ "name": "Waypoint: Comment out HTML",
+ "difficulty": 0.014,
+ "description": [
+ "Comment out the h1
element and the p
element, but leave the h2
element uncommented.",
+ "Remember that in order to start a comment, you need to use <!--
and to end a comment, you need to use -->
.",
+ "Here you'll need to end the comment before the h2 element begins."
+ ],
+ "tests": [
+ "assert(($('h1').length == 0), 'The h1 element should be commented. It should not 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 be commented. It should not be visible in the browser.')"
+ ],
+ "challengeSeed": [
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1348bd9aedf08833",
+ "name": "Waypoint: Fill in the Blank with Placeholder Text",
+ "difficulty": 0.015,
+ "description": [
+ "Change the text in the p
element to use the first few words of Kitty Ipsum
text.",
+ "Web developers traditionally use Lorem Ipsum
as placeholder text. It's called Lorem Ipsum text because those are the first two words of a famous passage by Cicero of Ancient Rome.",
+ "Lorem Ipsum text has been used as placeholder text by typesetters since the 16th century, and this tradition continues on the web.",
+ "Well, 5 centuries is long enough. Since we're building a CatPhotoApp, let's use something called Kitty Ipsum!",
+ "Here are the first few words of Kitty Ipsum text, which you can copy and paste into the right position: Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.
"
+ ],
+ "tests": [
+ "assert.isTrue((/Kitty(\\s)+ipsum(\\s)+dolor/gi).test($('p').text()), 'Your paragraph element should contain the first few words of the famous Kitty Ipsum text.')"
+ ],
+ "challengeSeed": [
+ "Hello Paragraph
" + ], + "challengeType": 0 + }, + { + "_id": "bad87fed1348bd9aedf08833", + "name": "Waypoint: Delete HTML Elements", + "difficulty": 0.016, + "description": [ + "Delete the h1 and br elements so we can simplify our view.", + "Our phone doesn't have much space, for HTML elements.", + "Let's remove the unnecessary elements so we can start building our CatPhotoApp." + ], + "tests": [ + "assert(($('h1').length == 0), 'Delete the h1 element.')", + "assert(($('h2').length > 0), 'Leave the h2 element on the page.')", + "assert(($('br').length == 0), 'Delete the br element.')", + "assert(($('p').length > 0), 'Leave the paragraph element on the page.')" + ], + "challengeSeed": [ + "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 + }, + { + "_id": "bad87fee1348bd9aedf08803", + "name": "Waypoint: Change the Color of Text", + "difficulty": 0.017, + "description": [ + "Change theh2
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>
"
+ ],
+ "tests": [
+ "assert($('h2').css('color') === 'rgb(255, 0, 0)', 'Your h2 element should be red.')"
+ ],
+ "challengeSeed": [
+ "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 + }, + { + "_id": "bad87fee1348bd9aedf08805", + "name": "Waypoint: Use CSS Selectors to Style Elements", + "difficulty": 0.018, + "description": [ + "Delete yourh2
element's style
tag and write the CSS to make all h2
elements blue.",
+ "With CSS, there are hundreds of CSS attributes
that you can use to change the way an element looks on a web page.",
+ "When you entered <h2 style=\"color: red\">CatPhotoApp<h2>
, you were giving that individual h2 element an inline style
",
+ "That's one way to add style to an element, but a better way is by using Cascading Style Sheets (CSS)
.",
+ "At the top of your code, create a style tag
like this: <style></style>
",
+ "Inside that style element, you can create a css selector
for all h2
elements. For example, if you wanted all h2
elements to be red, your style element would look like this: <style>h2 {color: red;}</style>
",
+ "Note that it's important to have opening and closing curly braces
({
and }
) around each element's style. You also need to make sure your element's style is between the opening and closing style tags. Finally, be sure to add the semicolon to the end of each of your element's styles."
+ ],
+ "tests": [
+ "assert($('h2').css('color') === 'rgb(0, 0, 255)', 'Your h2 element should be blue.')",
+ "assert(!$('h2').attr('style'), 'You should remove the style attribute from your h2 element.')"
+ ],
+ "challengeSeed": [
+ "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 + }, + { + "_id": "bad87fee1348bd9aecf08806", + "name": "Waypoint: Use a CSS Class to Style an Element", + "difficulty": 0.019, + "description": [ + "Create a CSS class called \"red-text\" and apply it to yourh2
element.",
+ "Classes are reusable styles that can be added to HTML elements.",
+ "Here's the anatomy of a CSS class:",
+ "<style>
tag.",
+ "You can apply a class to an HTML element like this: <h2 class=\"blue-text\">CatPhotoApp<h2>
",
+ "Note that in your CSS style
element, classes should start with a period. In your HTML elements' class declarations, classes shouldn't start with a period.",
+ "Instead of creating a new Style tag, try removing the h2 style declaration from the existing style element, and replace it with the class declaration for \".red-text\"."
+ ],
+ "tests": [
+ "assert($('h2').css('color') === 'rgb(255, 0, 0)', 'Your h2 element should be red.')",
+ "assert($('h2').hasClass('red-text'), 'You h2 element should have the class \"red-text\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "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 + }, + { + "_id": "bad87fee1348bd9aefe08806", + "name": "Waypoint: Style Multiple Elements with a CSS Classes", + "difficulty": 0.020, + "description": [ + "Apply the \"red-text\" class to theh2
and p
elements.",
+ "Remember that you can attach classes to HTML elements by using the class=\"class\"
within the relevant element's opening tag."
+ ],
+ "tests": [
+ "assert($('h2').css('color') === 'rgb(255, 0, 0)', 'Your h2 element should be red.')",
+ "assert($('h2').hasClass('red-text'), 'You h2 element should have the class \"red-text\".')",
+ "assert($('p').css('color') === 'rgb(255, 0, 0)', 'Your paragraph element should be red.')",
+ "assert($('p').hasClass('red-text'), 'You paragraph element should have the class \"red-text\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "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 + }, + { + "_id": "bad87fee1348bd9aedf08806", + "name": "Waypoint: Change the Font Size of an Element", + "difficulty": 0.021, + "description": [ + "Create a secondp
element. Then set the font size of all p
elements to 16 pixels.",
+ "Font size is controlled by the font-size
CSS attribute, like this: h1 { font-size: 30px; }
.",
+ "First, create a second paragraph element with the following Kitty Ipsum text: Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.
",
+ "See if you can figure out how to give both of your paragraph elements the font-size of 16 pixels (16px
). You can do this inside the same <style>
tag that we created for your \"red-text\" class."
+ ],
+ "tests": [
+ "assert($('p').length > 1, 'You need 2 paragraph elements with Kitty Ipsum text.')",
+ "assert($('p').css('font-size') === '16px', 'Your paragraph elements should have the font-size of 16px.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "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 + }, + { + "_id": "bad87fee1348bd9aede08807", + "name": "Waypoint: Set the Font Family of an Element", + "difficulty": 0.022, + "description": [ + "Make all paragraph elements use the \"Monospace\" font.", + "You can set an element's font by using thefont-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'; }
"
+ ],
+ "tests": [
+ "assert($('p').css('font-family').match(/monospace/i), 'Your paragraph elements should use the font \"Monospace\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "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 + }, + { + "_id": "bad87fee1348bd9aedf08807", + "name": "Waypoint: Import a Google Font", + "difficulty": 0.023, + "description": [ + "Apply thefont-family
of \"Lobster\" to your h2
element.",
+ "First, you'll need to make a call
to Google to grab the \"Lobster\" font and load it into your HTML.",
+ "Copy the following code snippet and paste it into your code editor above your style
element:",
+ "<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
",
+ "Now you can set \"Lobster\" as a font-family attribute on your h2
element."
+ ],
+ "tests": [
+ "assert($('h2').css('font-family').match(/lobster/i), 'Your h2 element should use the font \"Lobster\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "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 + }, + { + "_id": "bad87fee1348bd9aedf08808", + "name": "Waypoint: Specify How Fonts Should Degrade", + "difficulty": 0.024, + "description": [ + "Make all yourh2
elements use \"Lobster\" as their font family, but degrade to the \"Monospace\" font when the \"Lobster\" font isn't available.",
+ "You can leave \"Lobster\" your h2
element's font-family, and have it \"degrade\" to a different font when \"Lobster\" isn't available.",
+ "For example, if you wanted an element to use the \"Helvetica\" font, but also degrade to the \"Sans-Serif\" font when \"Helvetica\" wasn't available, you could do use this CSS style: p { font-family: \"Helvetica\", \"Sans-Serif\"; }
.",
+ "There are several default fonts that are available in all browsers. These include \"Monospace\", \"Serif\" and \"Sans-Serif\". See if you can set your h2 elements to use \"Lobster\" and degrade to \"Monospace\".",
+ "Now try commenting out your call to Google Fonts, so that the \"Lobster\" font isn't available. Notice how it degrades to the \"Monospace\" font."
+ ],
+ "tests": [
+ "assert($('h2').css('font-family').match(/lobster/i), 'Your h2 element should use the font \"Lobster\".')",
+ "assert($('h2').css('font-family').match(/monospace/i), 'Your h2 element should degrade to the font \"Monospace\" when \"Lobster\" is not available.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "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 + }, + { + "_id": "bad87fee1348bd9aedf08809", + "name": "Waypoint: Override Styles with Important", + "difficulty": 0.025, + "description": [ + "Create a \"blue-text\" class that gives an element the font-color of blue. Also create a \"urgently-red\" class that give an element the font-color of red, but use!important
to ensure the element is rendered as being red. Apply both classes to your h2
element.",
+ "Sometimes HTML elements will receive conflicting information from CSS classes as to how they should be styled.",
+ "If there's a conflict in the CSS, the browser will use whichever style declaration is closest to the bottom of the CSS document (whichever declaration comes last). Note that in-line style declarations are the final authority in how an HTML element will be rendered.",
+ "There's one way to ensure that an element is rendered with a certain style, regardless of where that declaration is located. That one way is to use !important
.",
+ "In case you're curious, this is the priority hierarchy for element styles: !important > inline style > css class selector > css selector. That is, !important trumps all other styles, and inline styles trump style tag declarations.",
+ "Here's an example of a CSS style that uses !important
: <style> .urgently-blue { color: blue !important; } </style>
.",
+ "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($('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.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "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 + }, + + { + "_id": "bad87fee1348bd9aedf08812", + "name": "Waypoint: Add Images to your Website", + "difficulty": 0.026, + "description": [ + "Use animg
element to add the image http://bit.ly/fcc-kittens
to your website.",
+ "You can add images to your website by using the img
element, and point to an specific image's URL using the src
attribute.",
+ "An example of this would be <img src=\"www.your-image-source.com/your-image.jpg\"/>
. Note that in most cases, img
elements are self-closing.",
+ "Try it with this image: http://bit.ly/fcc-kittens
."
+ ],
+ "tests": [
+ "assert($('img').length > 0, 'Your webpage should have an image element.')",
+ "assert(!!$('img').attr('src'), 'Your image should have have a src
attribute that points to the kitten image.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "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 + }, + { + "_id": "bad87fee1348bd9acdf08812", + "name": "Waypoint: Size your Images", + "difficulty": 0.027, + "description": [ + "Create a class calledsmaller-image
and use it to resize the image so that it's only 100 pixels wide.",
+ "CSS has an attribute called width
that controls an element's width. Just like with fonts, we'll use pixels(px) to specify the images width.",
+ "For example, if we wanted to create a CSS class called \"larger-image\" that gave HTML elements a width of 500 pixels, we'd use: <style> .larger-image { width: 500px; } </style>
."
+ ],
+ "tests": [
+ "assert($('img').hasClass('smaller-image'), 'Your img
element should have the class \"smaller-image\".')",
+ "assert($('img').width() === 100, 'Your image should be 100 pixels wide.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "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 + }, + { + "_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.", + "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.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "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 + }, + { + "_id": "bad87fee1348bd9aedf08814", + "name": "Waypoint: Add Rounded Corners with a Border Radius", + "difficulty": 0.029, + "description": [ + "Give your cat photo a border radius of 10 pixels.", + "Your cat photo currently has sharp corners. We can round out those corners with a CSS attribute calledborder-radius
.",
+ "You can specify a border-radius
with pixels. This will affect how rounded the corners are. Add this attribute to your thick-green-border
class and set it to 10 pixels."
+ ],
+ "tests": [
+ "assert($('img').hasClass('thick-green-border'), 'Your image element should have the class \"thick-green-border\".')",
+ "assert(parseInt($('img').css('border-top-left-radius')) > 8, 'Your image should have a border radius of 10 pixels')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "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 + }, + { + "_id": "bad87fee1348bd9aedf08815", + "name": "Waypoint: Make Circular Images with a Border Radius", + "difficulty": 0.030, + "description": [ + "Give your cat photo aborder-radius
of 50%.",
+ "In addition to pixels, you can also specify a border-radius
using a percentage."
+ ],
+ "tests": [
+ "assert(parseInt($('img').css('border-top-left-radius')) > 48, 'Your image should have a border radius of 50 percent, making it perfectly circular.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "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 + }, + { + "_id": "bad87fee1348bd9aedf08816", + "name": "Waypoint: Link to External Pages with Anchor Elements", + "difficulty": 0.031, + "description": [ + "Create ananchor
element that links to http://catphotoapp.com and has \"cat photos\" as its anchor text (link text).",
+ "Here's a diagram of an anchor tag
. In this case, it's used in the middle of a paragraph element, which means your link will appear in the middle of your sentence.",
+ "<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()), '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\"')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "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 + }, + { + "_id": "bad87fee1348bd9aede08817", + "name": "Waypoint: Wrap an Anchor Element within a Paragraph", + "difficulty": 0.032, + "description": [ + "Now wrap your anchor element within aparagraph
element so that the surrounding paragraph says \"click here for cat photos\", but where only \"cat photos\" is a link - the rest is plain text.",
+ "Again, here's a diagram of an anchor tag
for your reference:",
+ "<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()), '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').parent().is('p'), 'Your anchor element should be wrapped within a paragraph element.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "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 + }, + + { + "_id": "bad87fee1348bd9aedf08817", + "name": "Waypoint: Make Dead Links using the Hash Symbol", + "difficulty": 0.033, + "description": [ + "Use the hash symbol(#) to turn youranchor
element's link into a dead link.",
+ "Sometimes you want to add anchor
elements to your website before you know where they will link.",
+ "This is also handy when you're changing the behavior of a link using jQuery
, which we'll learn about later.",
+ "Replace your anchor
element's href
attribute with a hash symbol to turn it into a dead link."
+ ],
+ "tests": [
+ "assert($('a').attr('href') === '#', 'Your anchor
element should be a dead link with a href
attribute set to \"#\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "Click here for cat photos.
", + "", + "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 + }, + { + "_id": "bad87fee1348bd9aedf08820", + "name": "Waypoint: Turn an Image into a Link", + "difficulty": 0.034, + "description": [ + "Wrap yourimg
element inside an anchor element with a dead link.",
+ "You can make elements into links by wrapping them in an anchor tag
.",
+ "Wrap your image in an anchor tag
. Here's an example: <a href='#'><img src='http://bit.ly/fcc-kittens2'></a>
",
+ "Remember to use the hash symbol as your anchor tag
's href
property in order to turn it into a dead link.",
+ "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 \"#\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "Click here for cat photos.
", + "", + "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 + }, + { + "_id": "bad87fee1348bd9aedf08818", + "name": "Waypoint: Add Alt Text to an Image for Accessibility", + "difficulty": 0.035, + "description": [ + "Add thealt text
\"A cute orange cat lying on its back\" to our cat photo",
+ "alt text
is what browsers will display if they fail to load the image. alt text
is also important for blind or visually impaired users to understand what an image portrays. Search engines also look at alt text
.",
+ "In short, every image should have alt text
!",
+ "Alt text
is a useful way to tell people (and web crawlers like Google) what is pictured in a photo. It's extremely important for helping blind or visually impaired people understand the content of your website.",
+ "You can add alt text right in the img element like this: <img src=\"www.your-image-source.com/your-image.jpg\" alt=\"your alt text\"/>
."
+ ],
+ "tests": [
+ "assert($('img').filter(function(){ return /cat/gi.test(this.alt) }).length > 0, 'Your image element should have an alt
attribute set to \"A cute orange cat lying on its back\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "Click here for cat photos.
", + "", + "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 + }, + + { + "_id" : "bad87fee1348bd9aedf08827", + "name": "Waypoint: Create a Bulleted Unordered List", + "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.", + "Unordered lists start with a<ul>
element. Then they contain some number of <li>
elements.",
+ "For example: <ul><li>milk</li><li>cheese</li><ul>
would create a bulleted list of \"milk\" and \"cheese\"."
+ ],
+ "tests": [
+ "assert($('ul').length > 0, 'Create a ul
element.')",
+ "assert($('li').length > 2, 'Add three li
elements to your ul
element.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "Click here for cat photos.
", + "", + "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 + }, + + { + "_id" : "bad87fee1348bd9aedf08828", + "name": "Waypoint: Create an Ordered List", + "difficulty" : 0.037, + "description": [ + "Create anordered list
of the the top 3 things cats hate the most.",
+ "HTML has a special element for creating ordered lists, or numbered-style lists.",
+ "Ordered lists start with a <ol>
element. Then they contain some number of <li>
elements.",
+ "For example: <ol><li>hydrogen</li><li>helium</li><ol>
would create a numbered list of \"hydrogen\" and \"helium\"."
+ ],
+ "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.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "Click here for cat photos.
", + "", + "Things cats love:
", + "<input type='text'>
"
+ ],
+ "tests": [
+ "assert($('input[type=\"text\"').length > 0, 'Your webpage should have an text field input element.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "Click here for cat photos.
", + "", + "Things cats love:
", + "Top 3 things cats hate:
", + "<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\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "Click here for cat photos.
", + "", + "Things cats love:
", + "Top 3 things cats hate:
", + "<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.",
+ "For example: <form action=\"/url-where-you-want-to-submit-form-data\"></form>
"
+ ],
+ "tests": [
+ "assert($('form').length > 0, 'Wrap your text input element within a form
element.')",
+ "assert($('form').attr('action'), 'Your form
element should have an action
attribute.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "Click here for cat photos.
", + "", + "Things cats love:
", + "Top 3 things cats hate:
", + "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.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id" : "bad87fee1348bd9aedc08830",
+ "name": "Waypoint: Use HTML5 to Require a Field",
+ "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\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ]
+ },
+
+ {
+ "_id" : "bad87fee1348bd9aedf08834",
+ "name": "Waypoint: Create a Set of Radio Buttons",
+ "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.",
+ "Radio buttons are a type of input
.",
+ "Radio buttons should be wrapped within label
elements.",
+ "All related radio buttons should have the same name
attribute.",
+ "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($('label').length > 1, 'Each of your two radio button elements should be wrapped in a label element.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id" : "bad87fee1348bd9aedf08835",
+ "name": "Waypoint: Create a Set of Checkboxes",
+ "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.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType" : 0
+ },
+
+ {
+ "_id" : "bad87fee1348bd9aede08835",
+ "name": "Waypoint: Clean up your form using Linebreaks",
+ "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>
"
+ ],
+ "tests": [
+ "assert($('br').length > 1, 'Add at least 2 line breaks to visually separate your form elements.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType" : 0
+ },
+
+ {
+ "_id" : "bad87fee1348bd9aedd08835",
+ "name": "Waypoint: Check Radio Buttons and Checkboxes by Default",
+ "difficulty" : 0.046,
+ "description": [
+ "Set one of your radio buttons and one of your checkboxes to be checked by default.",
+ "You set a checkbox or radio button to be checked by default using the checked
attribute.",
+ "Just add the word \"checked\" to the inside of your input element. For example, <input type='radio' name='test-name' checked>
."
+ ],
+ "tests": [
+ "assert($('input[type=\"radio\"').prop('checked'), 'One of the radio buttons on your form should be checked by default.')",
+ "assert($('input[type=\"checkbox\"').prop('checked'), 'One of the checkboxes on your form should be checked by default.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType" : 0
+ },
+ {
+ "_id": "bad88fee1348bd9aedf08825",
+ "name": "Waypoint: Adjusting the Padding of an Element",
+ "difficulty": 0.064,
+ "description": [
+ "These next few Waypoints will give you a brief tour of three important aspects of the space surrounding HTML elements: padding
, margin
, and border
. Change the padding
of your green box to match that of your red box.",
+ "An element's padding
controls the amount of space between the element and its border
.",
+ "Here, we can see that the green box and the red box are nested within the yellow box. Note that the red box has more padding
than the green box.",
+ "When you increase the green box's padding, it will increase the distance between the text \"padding\" and the border around it."
+ ],
+ "tests": [
+ "assert($('.green-box').css('padding-top') === '20px', 'Your green-box
class should give elements 20px of padding.')"
+ ],
+ "challengeSeed": [
+ "",
+ "margin
",
+ "",
+ "",
+ " padding
",
+ " padding
",
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1348bd9aedf08822",
+ "name": "Waypoint: Adjust the Margin of an Element",
+ "difficulty": 0.065,
+ "description": [
+ "Change the margin
of the green box to match that of the red box.",
+ "An element's margin
controls the amount of space between an element's border
and surrounding elements.",
+ "Here, we can see that the green box and the red box and the green box are nested within the yellow box. Note that the red box has more margin
than the green box, making it appear smaller.",
+ "When you increase the green box's padding, it will increase the distance between its border and surrounding elements."
+ ],
+ "tests": [
+ "assert($('.green-box').css('margin-top') === '20px', 'Your green-box
class should give elements 20px of margin.')"
+ ],
+ "challengeSeed": [
+ "",
+ "margin
",
+ "",
+ "",
+ " padding
",
+ " padding
",
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1348bd9aedf08823",
+ "name": "Waypoint: Add a Negative Margin to an Element",
+ "difficulty": 0.066,
+ "description": [
+ "Change the margin
of the green box to a negative value, so it fills the entire horizontal width of the yellow box around it.",
+ "An element's margin
controls the amount of space between an element's border
and surrounding elements.",
+ "If you set an element's margin to a negative value, the element will grow larger.",
+ "Try to set the margin to a negative value like the one for the red box."
+ ],
+ "tests": [
+ "assert($('.green-box').css('margin-top') === '-15px', 'Your green-box
class should give elements -15px of margin.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ " padding
",
+ " padding
",
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1348bd9aedf08824",
+ "name": "Waypoint: Add Different Padding to Each Side of an Element",
+ "difficulty": 0.067,
+ "description": [
+ "Give the green box a padding of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.",
+ "Sometimes you will want to customize an element so that it has different padding on each of its sides.",
+ "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-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.')"
+ ],
+ "challengeSeed": [
+ "",
+ "margin
",
+ "",
+ "",
+ " padding
",
+ " padding
",
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1248bd9aedf08824",
+ "name": "Waypoint: Add Different a Margin to Each Side of an Element",
+ "difficulty": 0.068,
+ "description": [
+ "Give the green box a margin of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.",
+ "Sometimes you will want to customize an element so that it has a different margin on each of its sides.",
+ "CSS allows you to control the margin of an element on all four sides with margin-top
, margin-right
, margin-bottom
, and margin-left
attributes."
+ ],
+ "tests": [
+ "assert($('.green-box').css('margin-left') === '40px', 'Your green-box
class should give the left of elements 40px of margin.')",
+ "assert($('.green-box').css('margin-bottom') === '20px', 'Your green-box
class should give the bottom of elements 20px of margin.')"
+ ],
+ "challengeSeed": [
+ "",
+ "margin
",
+ "",
+ "",
+ " padding
",
+ " padding
",
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_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.",
+ "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.')"
+ ],
+ "challengeSeed": [
+ "",
+ "margin
",
+ "",
+ "",
+ " padding
",
+ " padding
",
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1348bd9aedf08726",
+ "name": "Waypoint: Use Clockwise Notation to Specify the Margin of an Element",
+ "difficulty": 0.070,
+ "description": [
+ "Let's try this again, but with margin
this time. Use Clockwise Notation
to give an element a margin 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 margin-top
, margin-right
, margin-bottom
, and margin-left
attributes, you can specify them all in one line, like this: margin: 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('margin-left') === '40px', 'Your green-box
class should give the left of elements 40px of margin.')",
+ "assert($('.green-box').css('margin-bottom') === '20px', 'Your green-box
class should give the bottom of elements 20px of margin.')"
+ ],
+ "challengeSeed": [
+ "",
+ "margin
",
+ "",
+ "",
+ " padding
",
+ " padding
",
+ ""
+ ],
+ "challengeType": 0
+ }
+ ]
+}
diff --git a/seed_data/challenges/basic-javascript.json b/seed_data/challenges/basic-javascript.json
new file mode 100644
index 0000000000..6cd9fc39c2
--- /dev/null
+++ b/seed_data/challenges/basic-javascript.json
@@ -0,0 +1,155 @@
+{
+ "name": "Basic JavaScript",
+ "order" : 0.006,
+ "challenges": [
+ {
+ "_id": "bd7129d8c441eddfaeb5bdef",
+ "name": "Waypoint: Build an Adventure Game",
+ "difficulty": 0.24,
+ "challengeSeed": "114604814",
+ "description": [
+ "Now that you understand some Computer Science fundamentals, let's focus on programming JavaScript!",
+ "We're going to work through Codecademy's famous interactive JavaScript course.",
+ "This course will teach us some JavaScript fundamentals while guiding us through the process of building interesting web apps, all within Codecademy's learner-friendly environment!",
+ "Go to http://www.codecademy.com/courses/getting-started-v2/0/1 and complete the section.",
+ "Be sure to also complete this section: http://www.codecademy.com/courses/javascript-beginner-en-x9DnD/0/1."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7130d8c441eddfaeb5bdef",
+ "name": "Waypoint: Build Rock Paper Scissors",
+ "difficulty": 0.25,
+ "challengeSeed": "114604815",
+ "description": [
+ "Now we'll learn how JavaScript functions work, and use them to build a simple Rock Paper Scissors game.",
+ "Go to http://www.codecademy.com/courses/javascript-beginner-en-6LzGd/0/1 and complete the section.",
+ "Be sure to also complete this section: http://www.codecademy.com/courses/javascript-beginner-en-Bthev-mskY8/0/1."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7131d8c441eddfaeb5bdef",
+ "name": "Waypoint: Learn JavaScript For Loops",
+ "difficulty": 0.26,
+ "challengeSeed": "114614220",
+ "description": [
+ "Let's learn more about the loops that make virtually all programs possible - the \"For Loop\" and \"While Loop\". First, we'll learn the For Loop.",
+ "Go to http://www.codecademy.com/courses/javascript-beginner-en-NhsaT/0/1web and complete both the both For and While loop section.",
+ "Be sure to also complete this section: http://www.codecademy.com/courses/javascript-beginner-en-XEDZA/0/1."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7132d8c441eddfaeb5bdef",
+ "name": "Waypoint: Learn JavaScript While Loops",
+ "difficulty": 0.27,
+ "challengeSeed": "114612889",
+ "description": [
+ "Go to http://www.codecademy.com/courses/javascript-beginner-en-ASGIv/0/1 and complete the section.",
+ "Be sure to also complete this section: http://www.codecademy.com/courses/javascript-beginner-en-mrTNH-6VIZ9/0/1."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7133d8c441eddfaeb5bdef",
+ "name": "Waypoint: Learn Control Flow",
+ "difficulty": 0.28,
+ "challengeSeed": "114612888",
+ "description": [
+ "Much of human reasoning can be broken down into what we call Boolean Logic. Lucky for us, computers can think the same way! Let's learn how to instruct our computers by writing \"If Statements\" and \"Else Statements\".",
+ "We'll also learn some advanced \"Control Flow\" principals, such as ways we can exit loops early.",
+ "Go to http://www.codecademy.com/courses/javascript-beginner-en-qDwp0/0/1 and complete the section.",
+ "Be sure to also complete this section: http://www.codecademy.com/courses/javascript-beginner-en-ZA2rb/0/1."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7134d8c441eddfaeb5bdef",
+ "name": "Waypoint: Build a Contact List",
+ "difficulty": 0.29,
+ "challengeSeed": "114612887",
+ "description": [
+ "Up to this point, you've been working mostly with strings and numbers. Now we're going to learn more complicated data structures, like \"Arrays\" and \"Objects\".",
+ "Go to http://www.codecademy.com/courses/javascript-beginner-en-9Sgpi/0/1 and complete the section.",
+ "Be sure to also complete this section: http://www.codecademy.com/courses/javascript-beginner-en-3bmfN/0/1."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7135d8c441eddfaeb5bdef",
+ "name": "Waypoint: Build an Address Book",
+ "difficulty": 0.30,
+ "challengeSeed": "114612885",
+ "description": [
+ "Let's learn more about objects.",
+ "Go to http://www.codecademy.com/courses/spencer-sandbox/0/1 and complete the section.",
+ "Be sure to also complete this section: http://www.codecademy.com/courses/building-an-address-book/0/1?curriculum_id=506324b3a7dffd00020bf661."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7136d8c441eddfaeb5bdef",
+ "name": "Waypoint: Build a Cash Register",
+ "difficulty": 0.31,
+ "challengeSeed": "114612882",
+ "description": [
+ "In this final Codecademy section, we'll learn even more about JavaScript objects.",
+ "Go to http://www.codecademy.com/courses/objects-ii/0/1 and complete this section.",
+ "Be sure to also complete the final section: http://www.codecademy.com/courses/close-the-super-makert/0/1."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7118d8c441eddfaeb5bdef",
+ "name": "Waypoint: Discover Chrome DevTools",
+ "difficulty": 0.32,
+ "challengeSeed": "110752743",
+ "description": [
+ "It's time to learn the most powerful tool your browser has - the Development Tools!",
+ "If you aren't already using Chrome, you'll want to download it here: http://www.google.com/chrome/. While it's true that Firefox has a tool called Firebug that is very similar to Chrome's DevTools, we will use Chrome for this challenge.",
+ "Note that this course, jointly produced by Google and Code School, is technologically impressive, but occasionally buggy. If you encounter a bug, just ignore it and keep going.",
+ "Go to http://discover-devtools.codeschool.com.",
+ "Complete \"Chapter 1: Getting Started & Basic DOM and Styles\".",
+ "Complete \"Chapter 2: Advanced DOM and Styles\".",
+ "Complete \"Chapter 3: Working with the Console\".",
+ "Complete \"Chapter 4: Debugging JavaScript\".",
+ "Complete \"Chapter 5: Improving Network Performance\".",
+ "Complete \"Chapter 6: Improving Performance\".",
+ "Complete \"Chapter 7: Memory Profiling\"."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7138d8c441eddfaeb5bdef",
+ "name": "Waypoint: Learn Regular Expressions",
+ "difficulty": 0.33,
+ "challengeSeed": "112547802",
+ "description": [
+ "You can use a Regular Expression, or \"Regex\", to select specific types of characters in text.",
+ "Check out http://www.regexr.com. It's a Regular Expression Sandbox for experimenting with Regular Expressions.",
+ "Now go to http://www.regexone.com.",
+ "Note that you can click \"continue\" to move on to the next step as soon as all the tasks have green check marks beside them. You can often do this just by using the wildcard \"dot\" operator, but try to use the techniques that each lesson recommends.",
+ "Complete \"Complete the 15-lesson tutorial\"",
+ "Complete \"Complete Practical Example 1: Matching a scientific or decimal number\"",
+ "Complete \"Complete Practical Example 2: Matching phone numbers\"",
+ "Complete \"Complete Practical Example 3: Matching emails\"",
+ "Complete \"Complete Practical Example 4: Matching HTML\"",
+ "Complete \"Complete Practical Example 5: Matching specific filenames\"",
+ "Complete \"Complete Practical Example 6: Trimming whitespace from start and end of line\"",
+ "Once you've completed these challenges, move on to our next Waypoint."
+ ],
+ "challengeType": 2,
+ "tests": []
+ }
+ ]
+}
diff --git a/seed_data/challenges/bootstrap.json b/seed_data/challenges/bootstrap.json
new file mode 100644
index 0000000000..480117ee2c
--- /dev/null
+++ b/seed_data/challenges/bootstrap.json
@@ -0,0 +1,1273 @@
+{
+ "name": "Responsive Design with Bootstrap",
+ "order" : 0.003,
+ "challenges": [
+ {
+ "_id": "bad87fee1348bd9acde08812",
+ "name": "Waypoint: Mobile Responsive Images",
+ "difficulty": 0.047,
+ "description": [
+ "Now let's go back to our Cat Photo App. This time, we'll style it using the popular Twitter Bootstrap responsive CSS framework. First, add a new image with the src
attribute of \"http://bit.ly/fcc-kittens2\", and add the img-responsive
Bootstrap class to that image.",
+ "It would be great if the image could be exactly the width of our phone's screen.",
+ "Fortunately, we have access to a Responsive CSS Framework
called Bootstrap. You can add Bootstrap to any app just by including it with <link rel='stylesheet' href='//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css'/>
at the top of your HTML. But we've gone ahead and automatically added it to your Cat Photo App for you.",
+ "Bootstrap will figure out how wide your screen is and respond by resizing your HTML elements - hence the name Responsive Design
.",
+ "With responsive design, there is no need to design a mobile version of your website. It will look good on devices with screens of any width.",
+ "Now all you need to do is add the img-responsive
class to your image."
+ ],
+ "tests": [
+ "assert($('img').hasClass('img-responsive'), 'Your new image should have the class \"img-responsive\".')",
+ "assert($('img').length > 1, 'You should add a second image with the src
of http://bit.ly/fcc-kittens2
.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1348bd8acde08812",
+ "name": "Waypoint: Center Text with Bootstrap",
+ "difficulty": 0.048,
+ "description": [
+ "Add Bootstrap's text-center
class to your h2 element.",
+ "Now that we're using Bootstrap, we can center our heading elements to make them look better. All we need to do is add the class text-center
to our h1 and h2 elements.",
+ "Remember that you can add several classes to the same element by separating each of them with a space, like this: <h2 class=\"text-red text-center\">your text</h2>
."
+ ],
+ "tests": [
+ "assert($('h2').hasClass('text-center'), 'Your h2 element should be centered by applying the class \"text-center\"')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "
",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1348cd8acdf08812",
+ "name": "Waypoint: Create a Bootstrap Button",
+ "difficulty": 0.049,
+ "description": [
+ "Create a new button below your large kitten photo with the class \"btn\" and the text of \"like this photo\".",
+ "Bootstrap has its own button styles, which look much better than the plain HTML ones."
+ ],
+ "tests": [
+ "assert($('.btn').length > 0, 'your new button should have the class \"btn\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "
",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1348cd8acef08812",
+ "name": "Waypoint: Create a Block Element Bootstrap Button",
+ "difficulty": 0.050,
+ "description": [
+ "Add Bootstrap's btn-block
class to your Bootstrap button.",
+ "Normally, your buttons are only as wide as the text they contain. By making them block elements
, your button will stretch to fill your page's entire horizontal space.",
+ "Note that these buttons still need the btn
class."
+ ],
+ "tests": [
+ "assert($('.btn-block').length > 0, 'your new button should have the class \"btn-block\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "
",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1348cd8acef08811",
+ "name": "Waypoint: Taste the Bootstrap Button Color Rainbow",
+ "difficulty": 0.051,
+ "description": [
+ "Add Bootstrap's btn-block
class to both of your buttons.",
+ "Normally, your buttons are only as wide as the text they contain. By making them block elements
, your button will stretch to fill your page's entire horizontal space.",
+ "Note that these buttons still need the btn
class."
+ ],
+ "tests": [
+ "assert($('.btn-primary').length > 0, 'your new button should have the class \"btn-primary\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "
",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1348cd8acef08813",
+ "name": "Waypoint: Call out Optional Actions with Button Info",
+ "difficulty": 0.052,
+ "description": [
+ "Create a new block-level Bootstrap button below your \"like\" button with the text \"Info\", and add Bootstrap's btn-info
class to it.",
+ "Bootstrap comes with several pre-defined colors for buttons. The btn-info
class is used to call attention to optional actions that the user can take.",
+ "Note that these buttons still need the btn
and btn-block
classes."
+ ],
+ "tests": [
+ "assert($('.btn-info').length > 0, 'your new button should have the class \"btn-info\".')",
+ "assert($('.btn-block').length > 1, 'Both of your Bootstrap buttons should have the class \"btn-block\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "
",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1348ce8acef08814",
+ "name": "Waypoint: Warn your Users of a Dangerous Action",
+ "difficulty": 0.053,
+ "description": [
+ "Create a button with the text \"delete\" and give it the class btn-danger
.",
+ "Bootstrap comes with several pre-defined colors for buttons. The btn-danger
class is the button color you'll use to notify users that the button performs a destructive action, such as deleting a cat photo.",
+ "Note that these buttons still need the btn
and btn-block
classes."
+ ],
+ "tests": [
+ "assert($('.btn-danger').length > 0, 'Your new button should have the class \"btn-danger\".')",
+ "assert($('.btn-block').length > 1, 'Both of your Bootstrap buttons should have the class \"btn-block\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "
",
+ "",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad88fee1348ce8acef08815",
+ "name": "Waypoint: Use the Bootstrap Grid to Put Elements Side By Side",
+ "difficulty": 0.054,
+ "description": [
+ "Put the \"like\", \"Info\" and \"Delete\" buttons side-by-side by wrapping all three of them within one <div class=\"row\">
element, then each of them within a <div class=\"col-xs-4\">
element.",
+ "Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a div
element.",
+ "Here's a diagram of how Bootstrap's 12-column grid layout works:",
+ "
",
+ "Note that in this illustration, we use the col-md-*
class. Here, \"md\" means \"medium\", and \"*\" is a number specifying how many columns wide the element should be. In this case, we're specifying how many columns wide an element should be on a medium-sized screen, such as a laptop.",
+ "In the Cat Photo App that we're building, we'll use col-xs-*
, where \"*\" is the number of columns wide the element should be, and \"xs\" means \"extra small\", like an extra-small mobile phone screen.",
+ "The row
class is applied to a div
, and the buttons themselves can be wrapped within it."
+ ],
+ "tests": [
+ "assert($('.row').length > 0, 'Your new button should be wrapped within a div with the class \"row\".')",
+ "assert($('.col-xs-4').length > 2, 'Each of your bootstrap buttons should be wrapped in a div with the class \"col-xs-4\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "
",
+ "",
+ "",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id" : "bad87fee1348bd9aedf08845",
+ "name": "Waypoint: Ditch Custom CSS for Bootstrap",
+ "difficulty" : 0.055,
+ "description": [
+ "Delete the following from your style tag: .red-text
, p
, .smaller-image
. Delete the p
element with the dead link. Remove your red-text
class from your h2
element and instead apply the text-primary
Bootstrap class. Replace the smaller-image
class on your top image with the img-responsive
class.",
+ "We can clean up our code and make our Cat Photo App look more conventional by using Bootstrap's built-in styles instead of the custom styles we created earlier.",
+ "Don't worry - there will be plenty of time to customize our CSS later."
+ ],
+ "tests": [
+ "assert(!$('h2').hasClass('red-text'), 'You h2 element should no longer have the class \"red-text\".')",
+ "assert($('h2').hasClass('text-primary'), 'You h2 element should now have the class \"text-primary\".')",
+ "assert(!$('p').css('font-family').match(/monospace/i), 'Your paragraph elements should no longer use the font \"Monospace\".')",
+ "assert($('.img-responsive').length > 1, 'Remove the \"smaller-image\" class from your top image and replace it with the \"img-responsive\" class.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "Click here for cat photos.
",
+ "",
+ "
",
+ "",
+ "
",
+ "
",
+ "",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id" : "bad87fee1348bd9aede08845",
+ "name": "Waypoint: Create a Custom Heading",
+ "difficulty" : 0.056,
+ "description": [
+ "Wrap your first image and your h2 element within a single <div class='row'>
element. Wrap your h2 text within a <div class='col-xs-8'>
and your image in a <div class='col-xs-4'>
so that they are on the same line.",
+ "We will make a simple heading for our Cat Photo App by putting them in the same row.",
+ "Remember, Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a div
element.",
+ "Here's a diagram of how Bootstrap's 12-column grid layout works:",
+ "
",
+ "Note that in this illustration, we use the col-md-*
class. Here, \"md\" means \"medium\", and \"*\" is a number specifying how many columns wide the element should be. In this case, we're specifying how many columns wide an element should be on a medium-sized screen, such as a laptop.",
+ "In the Cat Photo App that we're building, we'll use col-xs-*
, where \"*\" is the number of columns wide the element should be, and \"xs\" means \"extra small\", like an extra-small mobile phone screen.",
+ "Notice how the image is now just the right size to fit along the text?"
+ ],
+ "tests": [
+ "assert($('.row').length > 1, 'Your h2 and top image elements should both be wrapped together within a div with the class \"row\".')",
+ "assert($('.col-xs-4').length > 3, 'Wrap your top image inside a div with the class \"col-xs-4\".')",
+ "assert($('.col-xs-8').length > 0, 'Wrap your h2 element inside a div with the class \"col-xs-8\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "",
+ "CatPhotoApp
",
+ "",
+ "
",
+ "",
+ "
",
+ "
",
+ "",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id" : "bad87fee1348bd9aedd08845",
+ "name": "Waypoint: Add Font Awesome Icons to our Buttons",
+ "difficulty" : 0.057,
+ "description": [
+ "Use Font Awesome to add a \"like\" icon to your like button.",
+ "Font Awesome is a convenient library of icons. These icons are vector graphics, stored in the .svg
file format. These icons are treated just like fonts. You can specify their size using pixels, and they will assume the font size of their parent HTML elements.",
+ "Go ahead and add a <i class=\"fa fa-thumbs-up\"></i>
within your like button's element."
+ ],
+ "tests": [
+ "assert($('.fa-thumbs-up').length > 0, 'You should add a <i class=\"fa fa-thumbs-up\"></i>
within your like button element.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "",
+ "
",
+ "
",
+ "
",
+ "",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id" : "bad87fee1348bd9aedc08845",
+ "name": "Waypoint: Add Font Awesome Icons all of our Buttons",
+ "difficulty" : 0.058,
+ "description": [
+ "Use Font Awesome to add a \"info-circle\" icon to your info button and a \"trash\" icon to your delete button.",
+ "Font Awesome is a convenient library of icons. These icons are vector graphics, stored in the .svg
file format. These icons are treated just like fonts. You can specify their size using pixels, and they will assume the font size of their parent HTML elements.",
+ "Add <i class=\"fa fa-info-circle\"></i>
within your info button's element, and a <i class=\"fa fa-trash\"></i>
within your delete button."
+ ],
+ "tests": [
+ "assert($('.fa-trash').length > 0, 'You should add a <i class=\"fa fa-trash\"></i>
within your like button element.')",
+ "assert($('.fa-info-circle').length > 0, 'You should add a <i class=\"fa fa-info-circle\"></i>
within your like button element.')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "",
+ "
",
+ "
",
+ "
",
+ "",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id" : "bad87fee1348bd9aedb08845",
+ "name": "Waypoint: Responsively Style a Radio Buttons",
+ "difficulty" : 0.059,
+ "description": [
+ "Wrap all of your radio buttons within a <div class='row'>
element. Then wrap each of them within a <div class='col-xs-6'>
element.",
+ "You can use Bootstrap's col-xs-*
classes on form elements, too! This way, our radio buttons will be evenly spread out across the page, regardless of how wide the screen resolution is."
+ ],
+ "tests": [
+ "assert($('.row').length > 2, 'Wrap your all of your radio buttons inside one div with the class \"row\".')",
+ "assert($('.col-xs-6').length > 1, 'Wrap each of your radio buttons inside its own div with the class \"col-xs-6\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "",
+ "
",
+ "
",
+ "
",
+ "",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id" : "bad87fee1348bd9aeda08845",
+ "name": "Waypoint: Responsively Style Checkboxes",
+ "difficulty" : 0.060,
+ "description": [
+ "Wrap all your checkboxes in a <div class='row'>
element. Then wrap each of them in a <div class='col-xs-4'>
element.",
+ "You can use Bootstrap's col-xs-*
classes on form elements, too! This way, our checkboxes will be evenly spread out across the page, regardless of how wide the screen resolution is."
+ ],
+ "tests": [
+ "assert($('.row').length > 3, 'Wrap your all of your checkboxes inside one div with the class \"row\".')",
+ "assert($('.col-xs-4').length > 6, 'Wrap each of your checkboxes inside its own div with the class \"col-xs-4\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "",
+ "
",
+ "
",
+ "
",
+ "",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id" : "bad87fee1348bd9aed908845",
+ "name": "Waypoint: Style Text Inputs as Form Controls",
+ "difficulty" : 0.061,
+ "description": [
+ "Give your form's text input field in a class of \"form-control\". Give your form's submit button the classes \"btn btn-primary\" and give it the Font Awesome icon of \"fa-paper-plane\"."
+ ],
+ "tests": [
+ "assert($('.btn-primary').length > 1, 'Give the submit button in your form the classes \"btn btn-primary\".')",
+ "assert($('.fa-paper-plane').length > 0, 'Add a <i class=\"fa fa-paper-plane\"></i>
within your submit button element.')",
+ "assert($('.form-control').length > 0, 'Give the the text input field in your form the class \"form-control\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "",
+ "
",
+ "
",
+ "
",
+ "",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id" : "bad87fee1348bd9aec908845",
+ "name": "Waypoint: Line up Form Elements Responsively with Bootstrap",
+ "difficulty" : 0.062,
+ "description": [
+ "Wrap both your form's text input field and submit button within a div with the class \"row\". Wrap your form's text input field within a div with the class of \"col-xs-7\". Wrap your form's submit button the in a div with the class \"col-xs-5\".",
+ "Now let's get your form input and your submission button on the same line. We'll do this the same way we have previously: by using a \"row\" element with \"col-xs-*\" elements withing it.",
+ "This is the last challenge we'll do for our Cat Photo App for now. We hope you've enjoyed learning Font Awesome, Bootstrap, and responsive design!"
+ ],
+ "tests": [
+ "assert($('.row').length > 4, 'Wrap your all of your checkboxes inside one div with the class \"row\".')",
+ "assert($('.col-xs-5').length > 0, 'Wrap each of your checkboxes inside its own div with the class \"col-xs-4\".')",
+ "assert($('.col-xs-7').length > 0, 'Wrap each of your checkboxes inside its own div with the class \"col-xs-4\".')"
+ ],
+ "challengeSeed": [
+ "",
+ "",
+ "",
+ "",
+ "
",
+ "
",
+ "
",
+ "",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "",
+ "Things cats love:
",
+ "",
+ " - cat nip
",
+ " - laser pointers
",
+ " - lasagna
",
+ "
",
+ "Top 3 things cats hate:
",
+ "",
+ " - flea treatment
",
+ " - thunder
",
+ " - other cats
",
+ "
",
+ ""
+ ],
+ "challengeType": 0
+ }
+ ]
+}
diff --git a/seed_data/challenges/computer-science.json b/seed_data/challenges/computer-science.json
new file mode 100644
index 0000000000..13f3d624b4
--- /dev/null
+++ b/seed_data/challenges/computer-science.json
@@ -0,0 +1,86 @@
+{
+ "name": "Computer Science",
+ "order" : 0.005,
+ "challenges": [
+ {
+ "_id": "bd7123d8c441eddfaeb5bdef",
+ "name": "Waypoint: Learn Basic Computer Science",
+ "difficulty": 0.90,
+ "challengeSeed": "114628241",
+ "description": [
+ "Stanford has an excellent free online Computer Science curriculum. This interactive course uses a modified version of JavaScript. It will cover a lot of concepts quickly.",
+ "Note that Harvard also has an excellent introduction to computer science course called CS50, but it takes more than 100 hours to complete, and doesn't use JavaScript.",
+ "Despite being completely self-paced, Stanford's CS101 course is broken up into weeks. Each of the following challenges will address one of those weeks.",
+ "Go to https://class.stanford.edu/courses/Engineering/CS101/Summer2014/courseware/z54/z1/ and complete the first week's course work."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd8124d8c441eddfaeb5bdef",
+ "name": "Waypoint: Learn Loops",
+ "difficulty": 0.19,
+ "challengeSeed": "114597348",
+ "description": [
+ "Now let's tackle week 2 of Stanford's Intro to Computer Science course.",
+ "This will introduce us to loops, a fundamental feature of every programming language.",
+ "Go to https://class.stanford.edu/courses/Engineering/CS101/Summer2014/courseware/z100/a7a70ce6e4724c58862ee6007284face/ and complete Week 2."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd8125d8c441eddfaeb5bdef",
+ "name": "Waypoint: Learn Computer Hardware",
+ "difficulty": 0.20,
+ "challengeSeed": "114597347",
+ "description": [
+ "Week 3 of Stanford's Intro to Computer Science covers computer hardware and explains Moore's law of exponential growth in the price-performance of processors.",
+ "This challenge will also give you an understanding of how bits and bytes work.",
+ "Go to https://class.stanford.edu/courses/Engineering/CS101/Summer2014/courseware/z143/z101/ and complete Week 3."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd8126d8c441eddfaeb5bdef",
+ "name": "Waypoint: Learn Computer Networking",
+ "difficulty": 0.21,
+ "challengeSeed": "114604811",
+ "description": [
+ "Now that you've learned about computer hardware, it's time to learn about the software that runs on top of it.",
+ "Particularly important, you will learn about networks and TCP/IP - the protocol that powers the internet.",
+ "Go to https://class.stanford.edu/courses/Engineering/CS101/Summer2014/courseware/z187/z144/ and complete Week 4."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd8127d8c441eddfaeb5bdef",
+ "name": "Waypoint: Learn Boolean Logic",
+ "difficulty": 0.22,
+ "challengeSeed": "114604812",
+ "description": [
+ "Now we'll do some more table exercises and learn boolean logic.",
+ "We'll also learn the difference between digital data and analog data.",
+ "Go to https://class.stanford.edu/courses/Engineering/CS101/Summer2014/courseware/z208/z188/ and complete Week 5."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd8128d8c441eddfaeb5bdef",
+ "name": "Waypoint: Learn Computer Security",
+ "difficulty": 0.23,
+ "challengeSeed": "114604813",
+ "description": [
+ "We're almost done with Stanford's Introduction to Computer Science course!",
+ "We'll learn about one of the most important inventions of the 20th century - spreadsheets.",
+ "We'll also learn about Computer Security and some of the more common vulnerabilities software systems have.",
+ "Go to https://class.stanford.edu/courses/Engineering/CS101/Summer2014/courseware/z229/z213/ and complete Week 6, the final week of the course."
+ ],
+ "challengeType": 2,
+ "tests": []
+ }
+ ]
+}
diff --git a/seed_data/challenges/full-stack-javascript.json b/seed_data/challenges/full-stack-javascript.json
new file mode 100644
index 0000000000..feeb71ba1b
--- /dev/null
+++ b/seed_data/challenges/full-stack-javascript.json
@@ -0,0 +1,222 @@
+{
+ "name": "Full Stack JavaScript",
+ "order" : 0.013,
+ "challenges": [
+ {
+ "_id": "bd7154d8c441eddfaeb5bdef",
+ "name": "Waypoint: Get Started with Angular.js",
+ "difficulty": 0.34,
+ "challengeSeed": "114684726",
+ "description": [
+ "Code School has a short, free Angular.js course. This will give us a quick tour of Angular.js's mechanics and features.",
+ "In this course, we'll build a virtual shop entirely in Angular.js.",
+ "Go to http://campus.codeschool.com/courses/shaping-up-with-angular-js/level/1/section/1/video/1 and complete the section."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7155d8c441eddfaeb5bdef",
+ "name": "Waypoint: Apply Angular.js Directives",
+ "difficulty": 0.35,
+ "challengeSeed": "114684727",
+ "description": [
+ "Directives serve as markers in your HTML. When Angular.js compiles your HTML, it will can alter the behavior of DOM elements based on the directives you've used.",
+ "Let's learn how these powerful directives work, and how to use them to make your web apps more dynamic",
+ "Go to http://campus.codeschool.com/courses/shaping-up-with-angular-js/level/2/section/1/video/1 and complete the section."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7156d8c441eddfaeb5bdef",
+ "name": "Waypoint: Power Forms with Angular.js",
+ "difficulty": 0.36,
+ "challengeSeed": "114684729",
+ "description": [
+ "One area where Angular.js really shines is its powerful web forms.",
+ "Learn how to create reactive Angular.js forms, including real-time form validation.",
+ "Go to http://campus.codeschool.com/courses/shaping-up-with-angular-js/level/3/section/1/video/1 and complete the section."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7157d8c441eddfaeb5bdef",
+ "name": "Waypoint: Customize Angular.js Directives",
+ "difficulty": 0.37,
+ "challengeSeed": "114685062",
+ "description": [
+ "Now we'll learn how to modify existing Angular.js directives, and even build directives of your own.",
+ "Go to http://campus.codeschool.com/courses/shaping-up-with-angular-js/level/4/section/1/video/1 and complete the section."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7158d8c441eddfaeb5bdef",
+ "name": "Waypoint: Create Angular.js Services",
+ "difficulty": 0.38,
+ "challengeSeed": "114685060",
+ "description": [
+ "Services are functions that you can use and reuse throughout your Angular.js app to get things done.",
+ "We'll learn how to use services in this final Code School Angular.js challenge.",
+ "Go to http://campus.codeschool.com/courses/shaping-up-with-angular-js/level/5/section/1/video/1 and complete the section."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7153d8c441eddfaeb5bd0f",
+ "name": "Waypoint: Manage Packages with NPM",
+ "difficulty": 0.39,
+ "challengeSeed": "126433450",
+ "description": [
+ "We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
+ "If you don't already have Cloud 9 account, create one now at http://c9.io.",
+ "Open up http://c9.io and sign in to your account.",
+ "Click on Create New Workspace at the top right of the c9.io page, then click on the \"Create a new workspace\" popup that appears below it the button after you click on it.",
+ "Give your workspace a name.",
+ "Choose Node.js in the selection area below the name field.",
+ "Click the Create button.",
+ "Wait for the workspace to finish processing and select it on the left sidebar, below the Create New Workspace button.",
+ "Click the \"Start Editing\" button.",
+ "In the lower right hand corner you should see a terminal window. In this window use the following commands. You don't need to know what these mean at this point.",
+ "Run this command: sudo npm install how-to-npm -g
",
+ "Now start this tutorial by running how-to-npm
",
+ "Note that you can resize the c9.io's windows by dragging their borders.",
+ "Make sure that you are always in your project's \"workspace\" directory. You can always navigate back to this directory by running this command: cd ~/workspace
.",
+ "Complete \"Install NPM\"",
+ "Complete \"Dev Environment\"",
+ "Complete \"Login\"",
+ "Complete \"Start a Project\"",
+ "Complete \"Install a Module\"",
+ "Complete \"Listing Dependencies\"",
+ "Complete \"NPM Test\"",
+ "Complete \"Package Niceties\"",
+ "Complete \"Publish\"",
+ "Complete \"Version\"",
+ "Complete \"Publish Again\"",
+ "Complete \"Dist Tag\"",
+ "Complete \"Dist Tag Removal\"",
+ "Complete \"Outdated\"",
+ "Complete \"Update\"",
+ "Complete \"RM\"",
+ "Complete \"Finale\"",
+ "Once you've completed these first 7 challenges, move on to our next waypoint."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7153d8c441eddfaeb5bdff",
+ "name": "Waypoint: Start a Node.js Server",
+ "difficulty": 0.40,
+ "challengeSeed": "126411561",
+ "description": [
+ "We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud. We'll do the first 7 steps of Node School's LearnYouNode challenges.",
+ "If you don't already have Cloud 9 account, create one now at http://c9.io.",
+ "Open up http://c9.io and sign in to your account.",
+ "Click on Create New Workspace at the top right of the c9.io page, then click on the \"Create a new workspace\" popup that appears below it the button after you click on it.",
+ "Give your workspace a name.",
+ "Choose Node.js in the selection area below the name field.",
+ "Click the Create button.",
+ "Wait for the workspace to finish processing and select it on the left sidebar, below the Create New Workspace button.",
+ "Click the \"Start Editing\" button.",
+ "In the lower right hand corner you should see a terminal window. In this window use the following commands. You don't need to know what these mean at this point.",
+ "Run this command: sudo npm install learnyounode -g
",
+ "Now start this tutorial by running learnyounode
",
+ "Note that you can resize the c9.io's windows by dragging their borders.",
+ "Make sure that you are always in your project's \"workspace\" directory. You can always navigate back to this directory by running this command: cd ~/workspace
.",
+ "Complete \"Hello World\"",
+ "Complete \"Baby Steps\"",
+ "Complete \"My First I/O\"",
+ "Complete \"My First Async I/O\"",
+ "Complete \"Filtered LS\"",
+ "Complete \"Make it Modular\"",
+ "Complete \"HTTP Client\"",
+ "Once you've completed these first 7 challenges, move on to our next waypoint."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7153d8c441eddfaeb5bdfe",
+ "name": "Waypoint: Continue working with Node.js Servers",
+ "difficulty": 0.41,
+ "challengeSeed": "128836506",
+ "description": [
+ "Let's continue the LearnYouNode Node School challenge. For this Waypoint, we'll do challenges 8 through 10.",
+ "Make sure that you are always in your project's \"workspace\" directory. You can always navigate back to this directory by running this command: cd ~/workspace
.",
+ "Return to the c9.io workspace you created Now start this tutorial by running learnyounode
",
+ "Complete \"HTTP Collect\"",
+ "Complete \"Juggling Async\"",
+ "Complete \"Time Server\"",
+ "Once you've completed these 3 challenges, move on to our next waypoint."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7153d8c441eddfaeb5bdfd",
+ "name": "Waypoint: Finish working with Node.js Servers",
+ "difficulty": 0.42,
+ "challengeSeed": "128836507",
+ "description": [
+ "Let's continue the LearnYouNode Node School challenge. For this Waypoint, we'll do challenges 11 through 13.",
+ "Make sure that you are always in your project's \"workspace\" directory. You can always navigate back to this directory by running this command: cd ~/workspace
.",
+ "Return to the c9.io workspace you created for the previous LearnYouNode challenges and start the tutorial by running learnyounode
",
+ "Complete \"HTTP File Server\"",
+ "Complete \"HTTP Uppercaserer\"",
+ "Complete \"HTTP JSON API Server\"",
+ "Once you've completed these final 3 challenges, move on to our next waypoint."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7153d8c441eddfaeb5bd1f",
+ "name": "Waypoint: Build Web Apps with Express.js",
+ "difficulty": 0.43,
+ "challengeSeed": "126411559",
+ "description": [
+ "We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
+ "If you don't already have Cloud 9 account, create one now at http://c9.io.",
+ "Open up http://c9.io and sign in to your account.",
+ "Click on Create New Workspace at the top right of the c9.io page, then click on the \"Create a new workspace\" popup that appears below it the button after you click on it.",
+ "Give your workspace a name.",
+ "Choose Node.js in the selection area below the name field.",
+ "Click the Create button.",
+ "Wait for the workspace to finish processing and select it on the left sidebar, below the Create New Workspace button.",
+ "Click the \"Start Editing\" button.",
+ "In the lower right hand corner you should see a terminal window. In this window use the following commands. You don't need to know what these mean at this point.",
+ "Run this command: git clone http://github.com/reddock/fcc_express && chmod 744 fcc_express/setup.sh && fcc_express/setup.sh && source ~/.profile
",
+ "Now start this tutorial by running expressworks
",
+ "Note that you can resize the c9.io's windows by dragging their borders.",
+ "Make sure that you are always in your project's \"workspace\" directory. You can always navigate back to this directory by running this command: cd ~/workspace
.",
+ "Complete \"Hello World\"",
+ "Complete \"Juggling Async\"",
+ "Complete \"Time Server\"",
+ "Complete \"HTTP Collect\"",
+ "Complete \"Juggling Async\"",
+ "Complete \"Time Server\"",
+ "Once you've completed these challenges, move on to our next waypoint."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7140d8c441eddfaeb5bdef",
+ "name": "Waypoint: Manage Source Code with Git",
+ "difficulty": 0.44,
+ "challengeSeed": "114635309",
+ "description": [
+ "Version Control Systems like Git ensure that, no matter how you experiment with your code, you can always roll back your app to a stable previous state.",
+ "Git is also a great way to share and contribute to open source software.",
+ "Go to https://www.codeschool.com/courses/try-git and complete this short interactive course."
+ ],
+ "challengeType": 2,
+ "tests": []
+ }
+ ]
+}
diff --git a/seed_data/challenges/functional-programming.json b/seed_data/challenges/functional-programming.json
new file mode 100644
index 0000000000..67f6a3b3f0
--- /dev/null
+++ b/seed_data/challenges/functional-programming.json
@@ -0,0 +1,22 @@
+{
+ "name": "Functional Programming",
+ "order" : 0.010,
+ "challenges": [
+ {
+ "_id": "bd7129d8c441eddfbeb5bddf",
+ "name": "Waypoint: Practice Functional Programming",
+ "difficulty": 0.01,
+ "challengeSeed": "114604814",
+ "description": [
+ "Functional programming holds the key to unlocking JavaScript's powerful asynchronous features.",
+ "Jafar Husain's 42-step interactive Functional Programming course will familiarize you with the various ways you can recombine these functions.",
+ "Functional programming in JavaScript involves using five key functions: \"map\", \"reduce\", \"filter\", \"concatAll\", and \"zip\".",
+ "Click here to go to the challenge: http://jhusain.github.io/learnrx/.",
+ "This challenge will take several hours, but don't worry. Jafar's website will save your progress (using your browser's local storage) so you don't need to finish it in one sitting.",
+ "If you've spent several minutes on one of these challenges, and still can't figure out its correct answer, you can click \"show answer\", then click \"run\" to advance to the next challenge. Be sure to read the correct answer and make sure you understand it before moving on."
+ ],
+ "challengeType": 2,
+ "tests": []
+ }
+ ]
+}
diff --git a/seed_data/challenges/get-set-for-free-code-camp.json b/seed_data/challenges/get-set-for-free-code-camp.json
new file mode 100644
index 0000000000..b1cfc7e22f
--- /dev/null
+++ b/seed_data/challenges/get-set-for-free-code-camp.json
@@ -0,0 +1,147 @@
+{
+ "name": "Get Set for Free Code Camp",
+ "order" : 0.001,
+ "challenges": [
+ {
+ "_id": "bd7124d8c441eddfaeb5bdef",
+ "name": "Waypoint: Learn how Free Code Camp Works",
+ "difficulty": 0.001,
+ "challengeSeed": "125407438",
+ "description": [
+ "Watch this 1-minute video, or simply read this summary:",
+ "Welcome to Free Code Camp. We're a community of busy people learning to code by building projects for nonprofits.",
+ "We built this community because learning to code is hard. But anyone who can stay motivated can learn to code. And to stay motivated, you just need to: - make friends with people who code
- code a little every day
",
+ "All our challenges are - free
- self-paced
- browser-based
",
+ "We'll spend - 200 hours learning tools like HTML, CSS, JavaScript, Node.js and databases
- 600 hours building practice projects
- 800 hours building full stack solutions for nonprofits
",
+ "By the end, we'll - be good at coding
- have the portfolio of apps with happy users to prove it
",
+ "Once you make it through Free Code Camp, you will be able to get a coding job. There are far more job openings out there than there are qualified coders to fill them.",
+ "Now it's time to join our chat room. Click the \"I've completed this challenge\" button to move on to your next challenge."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7125d8c441eddfaeb5bd0f",
+ "name": "Waypoint: Join Our Chat Room",
+ "difficulty": 0.002,
+ "challengeSeed": "124555254",
+ "description": [
+ "Now we're going to join the Free Code Camp chat room. You can come here any time of day to hang out, ask questions, or find another camper to pair program with.",
+ "Make sure your Free Code Camp account includes your email address. Please note that the email address you use will be invisible to the public, but Slack will make it visible to other campers in our slack chat rooms. You can do this here: http://freecodecamp.com/account.",
+ "Click this link, which will email you an invite to Free Code Camp's Slack chat rooms: http://freecodecamp.com/api/slack.",
+ "Now check your email and click the link in the email from Slack.",
+ "Complete the sign up process, then update your biographical information and upload an image. A picture of your face works best. This is how people will see you in our chat rooms, so put your best foot forward.",
+ "Now enter the General chat room and introduce yourself to our chat room by typing: \"Hello world!\".",
+ "Tell your fellow campers how you found Free Code Camp. Also tell us why you want to learn to code.",
+ "Keep the chat room open while you work through the other challenges. That way you ask for help if you get stuck on a challenge. You can also socialize when you feel like taking a break.",
+ "You can also access this chat room by clicking the \"Chat\" button in the upper right hand corner.",
+ "In order to keep our community a friendly and positive place to learn to code, please read and follow our Code of Conduct: http://freecodecamp.com/field-guide/what-is-the-free-code-camp-code-of-conduct?"
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7125d8c441eddfaeb5bdff",
+ "name": "Waypoint: Preview our Challenge Map",
+ "difficulty": 0.003,
+ "challengeSeed": "125407437",
+ "description": [
+ "Before you start learning how to code, we'd like to introduce you to a few things.",
+ "Let's look at our Challenge Map. Click on the \"Map\" button in the upper right hand corner. This map shows all the challenges that will teach you how to code.",
+ "You should complete all these challenges in order.",
+ "Once you finish these Waypoint challenges, you'll move on to Bonfires (algorithm practice), then Ziplines (front end development practice) and finally Basejumps (full stack development practice). After that, you'll start building projects for nonprofits.",
+ "This challenge map is just for your reference. You can always just press the \"Learn\" button, and it will take you to your next challenge.",
+ "Finally, please note that our open-source curriculum is a work in progress. Our volunteer community is constantly improving it. If you think you've encountered a bug, typo, or something that seems confusing, please open a GitHub issue: https://github.com/FreeCodeCamp/freecodecamp/issues."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7125d8c441eddfaeb5bd1f",
+ "name": "Waypoint: Browse our Field Guide",
+ "difficulty": 0.004,
+ "challengeSeed": "125407435",
+ "description": [
+ "Free Code Camp has an up-to-date field guide that will answer your many questions.",
+ "Click the \"Field Guide\" button in the upper right hand corner.",
+ "You can browse the field guide at your convenience. Most of its articles take less than 1 minute to read.",
+ "When you click the Field Guide button, it will always take you back to whichever article you were last reading.",
+ "Read a few field guide articles, then move on to your next challenge."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7125d8c441eddfaeb5bd2f",
+ "name": "Waypoint: Customize your Portfolio Page",
+ "difficulty": 0.005,
+ "challengeSeed": "125407433",
+ "description": [
+ "You and all your fellow campers have portfolio pages.",
+ "To see your portfolio page, click your picture in the upper right hand corner.",
+ "Your portfolio page will automatically show off your progress through Free Code Camp.",
+ "Click the \"Update my portfolio page or manage my account\" button",
+ "You can link to your GitHub, Twitter and LinkedIn accounts. If you've already built some websites, you can link to them here as well.",
+ "Be sure to click the \"Update my Bio\" or \"Update my Social Links\" button to save this new information to your portfolio page.",
+ "Once you're happy with your portfolio page, you can move on to your next challenge."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7126d8c441eddfaeb5bd3f",
+ "name": "Waypoint: Try Camper News",
+ "difficulty": 0.006,
+ "challengeSeed": "124553410",
+ "description": [
+ "Camper News is the best place for our campers to share and discuss helpful links.",
+ "Click \"News\" in the upper right hand corner.",
+ "You'll see a variety of links that have been submitted. Click on the \"Discuss\" button under one of them.",
+ "You can upvote links. This will push the link up the rankings of hot links.",
+ "You an also comment on a link. If someone responds to your comment, you'll get an email notification so you can come back and respond to them.",
+ "You can also submit links. You can modify the link's headline and also leave an initial comment about the link.",
+ "You can view the portfolio pages of any camper who has posted links or comments on Camper News. Just click on their photo.",
+ "When you submit a link, you'll get a point. You will also get a point each time someone upvotes your link.",
+ "Now that you've learned how to use Camper News, let's move on to your next challenge."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7126d8c441eddfaeb5bd3e",
+ "name": "Waypoint: Meet Other Campers in your City",
+ "difficulty": 0.007,
+ "challengeSeed": "127358841",
+ "description": [
+ "One of the best ways to stay motivated when learning to code is to hang out with other campers.",
+ "Slack and Camper News are great ways to communicate with other campers, but there's no substitute for meeting people in-person.",
+ "The easiest way to meet other campers in your city is to join your city's Facebook Group. Click here to view our growing list of local groups.",
+ "Click the link to your city, then, once Facebook loads, click \"Join group\".",
+ "Our local groups are new, so if you don't see your city on this list, you should follow the directions to create a Facebook group for your city.",
+ "If you don't have a Facebook account, we strongly recommend you create one, even if it's just for the purpose of coordinating with campers in your city through this group.",
+ "Our groups allow you to create events, coordinate those events, and share photos from the events afterward.",
+ "Whether you're hosting a study group, pair programming at your local library, or going to a weekend hackathon, your city's group will help you make it happen."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7137d8c441eddfaeb5bdef",
+ "name": "Waypoint: Get Help the Hacker Way with RSAP",
+ "difficulty": 0.008,
+ "challengeSeed": "125407432",
+ "description": [
+ "Let's cover one last thing before you start working through our lessons: how to get help.",
+ "Any time you get stuck or don't know what to do next, follow this simple algorithm (procedure): RSAP (Read, Search, Ask, Post).",
+ "First, R - Read the documentation or error message. A key skill that good coders have is the ability to interpret and then follow instructions.",
+ "Next, S - Search Google. Good Google queries take a lot of practice. When you search Google, you usually want to include the language or framework you're using. You also want to limit the results to a recent period.",
+ "Then, if you still haven't found an answer to your question, A - Ask your friends. If you have trouble, you can ask your fellow campers. We have a special chat room specifically for getting help with tools you learn through these Free Code Camp Challenges. Go to https://freecode.slack.com/messages/help/. Keep this chat open while you work on the remaining challenges.",
+ "Finally, P - Post on Stack Overflow. Before you attempt to do this, read Stack Overflow's guide to asking good questions: http://stackoverflow.com/help/how-to-ask.",
+ "Here's our detailed field guide on getting help: http://freecodecamp.com/field-guide/how-do-i-get-help-when-i-get-stuck.",
+ "Now you have a clear algorithm to follow when you need help! Let's start coding! Move on to your next challenge."
+ ],
+ "challengeType": 2,
+ "tests": []
+ }
+ ]
+}
diff --git a/seed_data/challenges/intermediate-bonfires.json b/seed_data/challenges/intermediate-bonfires.json
new file mode 100644
index 0000000000..1645449670
--- /dev/null
+++ b/seed_data/challenges/intermediate-bonfires.json
@@ -0,0 +1,99 @@
+{
+ "name": "Intermediate Algorithm Scripting",
+ "order" : 0.009,
+ "challenges": [
+ {
+ "_id": "a2f1d72d9b908d0bd72bb9f6",
+ "name": "Bonfire: Make a Person",
+ "difficulty": "3.01",
+ "description": [
+ "Fill in the object constructor with the methods specified in the tests.",
+ "Those methods are getFirstName(), getLastName(), getFullName(), setFirstName(first), setLastName(last), and setFullName(firstAndLast).",
+ "All functions that take an argument have an arity of 1, and the argument will be a string.",
+ "These methods must be the only available means for interacting with the object.",
+ "Remember to use RSAP if you get stuck. Try to pair program. Write your own code."
+ ],
+ "challengeSeed": [
+ "var Person = function(firstAndLast) {",
+ " return firstAndLast;",
+ "};",
+ "",
+ "var bob = new Person('Bob Ross');",
+ "bob.getFullName();"
+ ],
+ "tests": [
+ "expect(Object.keys(bob).length).to.eql(6);",
+ "expect(bob instanceof Person).to.be.true;",
+ "expect(bob.firstName).to.be.undefined();",
+ "expect(bob.lastName).to.be.undefined();",
+ "expect(bob.getFirstName()).to.eql('Bob');",
+ "expect(bob.getLastName()).to.eql('Ross');",
+ "expect(bob.getFullName()).to.eql('Bob Ross');",
+ "bob.setFirstName('Happy');",
+ "expect(bob.getFirstName()).to.eql('Happy');",
+ "bob.setLastName('Trees');",
+ "expect(bob.getLastName()).to.eql('Trees');",
+ "bob.setFullName('George Carlin');",
+ "expect(bob.getFullName()).to.eql('George Carlin');",
+ "bob.setFullName('Bob Ross');"
+ ],
+ "MDNlinks": ["Closures", "Details of the Object Model"],
+ "challengeType": 5
+ },
+ {
+ "_id": "af4afb223120f7348cdfc9fd",
+ "name": "Bonfire: Map the Debris",
+ "difficulty": "3.02",
+ "description": [
+ "Return a new array that transforms the element's average altitude into their orbital periods.",
+ "The array will contain objects in the format {name: 'name', avgAlt: avgAlt}
.",
+ "You can read about orbital periods on wikipedia.",
+ "The values should be rounded to the nearest whole number. The body being orbited is Earth.",
+ "The radius of the earth is 6367.4447 kilometers, and the GM value of earth is 398600.4418",
+ "Remember to use RSAP if you get stuck. Try to pair program. Write your own code."
+ ],
+ "challengeSeed": [
+ "function orbitalPeriod(arr) {",
+ " var GM = 398600.4418;",
+ " var earthRadius = 6367.4447;",
+ " return arr;",
+ "}",
+ "",
+ "orbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}]);"
+ ],
+ "tests": [
+ "expect(orbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}])).to.eqls([{name: \"sputkin\", orbitalPeriod: 86400}]);",
+ "expect(orbitalPeriod([{name: \"iss\", avgAlt: 413.6}, {name: \"hubble\", avgAlt: 556.7}, {name: \"moon\", avgAlt: 378632.553}])).to.eqls([{name : \"iss\", orbitalPeriod: 5557}, {name: \"hubble\", orbitalPeriod: 5734}, {name: \"moon\", orbitalPeriod: 2377399}]);"
+ ],
+ "MDNlinks": ["Math.pow()"],
+ "challengeType": 5
+ },
+ {
+ "_id" : "a3f503de51cfab748ff001aa",
+ "name": "Bonfire: Pairwise",
+ "difficulty": "3.03",
+ "description": [
+ "Return the sum of all indices of elements of 'arr' that can be paired with one other element to form a sum that equals the value in the second argument 'arg'. If multiple sums are possible, return the smallest sum. Once an element has been used, it cannot be reused to pair with another.",
+ "For example, pairwise([1, 4, 2, 3, 0, 5], 7) should return 11 because 4, 2, 3 and 5 can be paired with each other to equal 7.",
+ "pairwise([1, 3, 2, 4], 4) would only equal 1, because only the first two elements can be paired to equal 4, and the first element has an index of 0!",
+ "Remember to use RSAP if you get stuck. Try to pair program. Write your own code."
+ ],
+ "challengeSeed": [
+ "function pairwise(arr, arg) {",
+ " return arg;",
+ "}",
+ "",
+ "pairwise([1,4,2,3,0,5], 7);"
+ ],
+ "tests": [
+ "expect(pairwise([1, 4, 2, 3, 0, 5], 7)).to.equal(11);",
+ "expect(pairwise([1, 3, 2, 4], 4)).to.equal(1);",
+ "expect(pairwise([1,1,1], 2)).to.equal(1);",
+ "expect(pairwise([0, 0, 0, 0, 1, 1], 1)).to.equal(10);",
+ "expect(pairwise([], 100)).to.equal(0);"
+ ],
+ "MDNlinks" : ["Array.reduce()"],
+ "challengeType": 5
+ }
+ ]
+}
diff --git a/seed_data/challenges/jquery-ajax-and-json.json b/seed_data/challenges/jquery-ajax-and-json.json
new file mode 100644
index 0000000000..d54806400e
--- /dev/null
+++ b/seed_data/challenges/jquery-ajax-and-json.json
@@ -0,0 +1,74 @@
+{
+ "name": "jQuery",
+ "order" : 0.004,
+ "challenges": [
+ {
+ "_id": "bd7112d8c441eddfaeb5bded",
+ "name": "Waypoint: Get Started with jQuery",
+ "difficulty": 0.13,
+ "challengeSeed": "125671865",
+ "description": [
+ "jQuery is a powerful library built in Javascript for manipulating HTML elements.",
+ "It's a lot easier to use than Javascript itself, so we'll learn it first.",
+ "It's also extremely popular with employers, so we're going to learn it well.",
+ "Codecademy has an excellent free course that will walk us through the basics of jQuery.",
+ "Go to http://www.codecademy.com/courses/web-beginner-en-bay3D/0/1 and complete the first section."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7113d8c441eddfaeb5bdef",
+ "name": "Waypoint: Write Functions with jQuery",
+ "difficulty": 0.14,
+ "challengeSeed": "125658029",
+ "description": [
+ "Now we're ready to write your first jQuery functions.",
+ "Functions are little sub-programs. You can call a function and ask it to do something. Then it will return an answer.",
+ "First, you'll learn about one of the most important jQuery functions of all: $(document).ready()
.",
+ "Go to http://www.codecademy.com/courses/web-beginner-en-GfjC6/0/1 and complete the second section."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7114d8c441eddfaeb5bdef",
+ "name": "Waypoint: Harness Dynamic HTML",
+ "difficulty": 0.15,
+ "challengeSeed": "125658028",
+ "description": [
+ "Did you know that you can create HTML elements using jQuery?",
+ "Let's learn some more advanced ways to use jQuery to manipulate the DOM.",
+ "Go to http://www.codecademy.com/courses/web-beginner-en-v6phg/0/1 and complete the third section."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7115d8c441eddfaeb5bdef",
+ "name": "Waypoint: Listen for jQuery Events",
+ "difficulty": 0.16,
+ "challengeSeed": "125658027",
+ "description": [
+ "jQuery can listen for events, such as clicking a button, and respond to them.",
+ "Here we'll learn how to use the jQuery click()
function to respond to events in the browser.",
+ "Go to http://www.codecademy.com/courses/web-beginner-en-JwhI1/0/1 and complete the fourth section."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7116d8c441eddfaeb5bdef",
+ "name": "Waypoint: Trigger jQuery Effects",
+ "difficulty": 0.17,
+ "challengeSeed": "125658025",
+ "description": [
+ "We can use jQuery to do all kinds of visual effects and transitions.",
+ "Let's explore some of the fun ways we can manipulate DOM elements with jQuery.",
+ "Go to http://www.codecademy.com/courses/web-beginner-en-jtFIC/0/1 and complete the fifth section."
+ ],
+ "challengeType": 2,
+ "tests": []
+ }
+ ]
+}
diff --git a/seed_data/challenges/object-oriented-javascript.json b/seed_data/challenges/object-oriented-javascript.json
new file mode 100644
index 0000000000..feee80d16c
--- /dev/null
+++ b/seed_data/challenges/object-oriented-javascript.json
@@ -0,0 +1,146 @@
+{
+ "name": "Object Oriented JavaScript",
+ "order" : 0.008,
+ "challenges": [
+ {
+ "_id": "bd7129d8c441eddfaeb5bddf",
+ "name": "Waypoint: Scope Your Variables",
+ "difficulty": 0.01,
+ "challengeSeed": "128836683",
+ "description": [
+ "Objects will allow you to build applications more efficiently by using small, reusable blocks of code.",
+ "This course on Udacity will help you learn Object-Oriented Programming in JavaScript.",
+ "First, we'll learn how JavaScript works in terms of scopes. You'll learn the difference between a \"Lexical Scope\" and an \"Execution Context\".",
+ "This theoretical foundation is useful for understanding when a variable can be accessed and when it can't.",
+ "You can save your progress by creating a free Udacity account, but note that it's also possible to complete this entire course without an account by following the links we provide.",
+ "Go to https://www.udacity.com/course/viewer#!/c-ud015/l-2593668697/m-2541189051 and start the course.",
+ "Once you've completed this first section of scopes, mark this Waypoint complete and move on to the next one."
+ ],
+ "challengeType": 2
+ },
+ {
+ "_id": "bd7131d8c441eddfaeb5bdbf",
+ "name": "Waypoint: Reference your Current Object with This",
+ "difficulty": 0.03,
+ "challengeSeed": "128836508",
+ "description": [
+ "In this section, you'll learn how you can use the keyword this
to dynamically point to your current object.",
+ "For example, if we were inside the function camper.completeCourse()
, this
would refer to the specific camper upon which we were running the function.",
+ "Note that this section poses several trick questions that were designed to make you think. Don't get hung up on them, just keep moving forward.",
+ "You can save your progress by creating a free Udacity account, but note that it's also possible to complete this entire course without an account by following the links we provide.",
+ "Go to https://www.udacity.com/course/viewer#!/c-ud015/l-2593668699/m-2780408563 and start the course.",
+ "Once you've completed this section of using the keyword this
, mark this Waypoint complete and move on to the next one."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7132d8c441eddfaeb5bdaf",
+ "name": "Waypoint: Traverse the Prototype Chain",
+ "difficulty": 0.04,
+ "challengeSeed": "128836684",
+ "description": [
+ "Next we'll learn about the multiple ways you can create a copy of an object.",
+ "We'll also learn how an object's missing attributes can traverse the \"prototype chain\".",
+ "You can save your progress by creating a free Udacity account, but note that it's also possible to complete this entire course without an account by following the links we provide.",
+ "Go to https://www.udacity.com/course/viewer#!/c-ud015/l-2593668700/m-2616738615 and start the course.",
+ "Once you've completed this section on prototype chain traversal, mark this Waypoint complete and move on to the next one."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7133d8c441eddfaeb5bd0f",
+ "name": "Waypoint: Reuse Code with Decorators",
+ "difficulty": 0.05,
+ "challengeSeed": "128836681",
+ "description": [
+ "In this section, we'll learn about the \"Decorator Pattern\".",
+ "The Decorator Pattern will help you \"decorate\" an existing object with additional attributes. This pattern helps you reuse code, reducing the total amount of code you'll need to write and maintain.",
+ "It's a convenient way to add functionality to objects without changing their underlying structure.",
+ "You can save your progress by creating a free Udacity account, but note that it's also possible to complete this entire course without an account by following the links we provide.",
+ "Go to https://www.udacity.com/course/viewer#!/c-ud015/l-2794468536/m-2697628561 and start the course.",
+ "Once you've completed this section of decorators, mark this Waypoint complete and move on to the next one."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7134d8c441eddfaeb5bd1f",
+ "name": "Waypoint: Build Objects with Functional Classes",
+ "difficulty": 0.06,
+ "challengeSeed": "128836503",
+ "description": [
+ "Now we'll go over the simplest way to implement a JavaScript class.",
+ "A class is a set of functions that you can use to easily produce similar objects.",
+ "You may have heard JavaScript doesn't have classes. While this is technically true, don't let this fact prevent you from learning the important concepts in this section.",
+ "You can save your progress by creating a free Udacity account, but note that it's also possible to complete this entire course without an account by following the links we provide.",
+ "Go to https://www.udacity.com/course/viewer#!/c-ud015/l-2794468537/m-2961989110 and start the course.",
+ "Once you've completed this section of functional classes, mark this Waypoint complete and move on to the next one."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7135d8c441eddfaeb5bd2f",
+ "name": "Waypoint: Build Objects with Prototypal Classes",
+ "difficulty": 0.07,
+ "challengeSeed": "128836505",
+ "description": [
+ "Now we'll learn how one object can be prototyped off of another object.",
+ "Objects will delegate their \"failed lookups\" on up through the \"prototype chain\".",
+ "This means that when you create a second object based off another object, then try to access an attribute that the second object doesn't have, JavaScript will \"fall through\" to the original object to see whether it has that attribute.",
+ "You can save your progress by creating a free Udacity account, but note that it's also possible to complete this entire course without an account by following the links we provide.",
+ "Go to https://www.udacity.com/course/viewer#!/c-ud015/l-2794468538/m-3034538557 and start the course.",
+ "Once you've completed this section of prototypal classes, mark this Waypoint complete and move on to the next one."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7136d8c441eddfaeb5bd3f",
+ "name": "Waypoint: Understand Pseudoclassical Patterns",
+ "difficulty": 0.08,
+ "challengeSeed": "128836689",
+ "description": [
+ "JavaScript doesn't have the traditional \"classes\" that lower-level languages like C++ and Java have.",
+ "Instead, JavaScript does some tricks to allow you to write code as though it had these traditional classes. We call these \"pseudo-classes\".",
+ "In this section, we'll learn how to build these pseudo-classes. We'll also learn some tricks for figuring out where these objects originally came from.",
+ "You can save your progress by creating a free Udacity account, but note that it's also possible to complete this entire course without an account by following the links we provide.",
+ "Go to https://www.udacity.com/course/viewer#!/c-ud015/l-2794468539/e-2783098540/m-2695768694 and start the course.",
+ "Once you've completed this section pseudoclasses, mark this Waypoint complete and move on to the next one."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7136d8c441eddfaeb5bd4f",
+ "name": "Waypoint: Subclass one Object to Another",
+ "difficulty": 0.09,
+ "challengeSeed": "128836686",
+ "description": [
+ "Now we know the three ways that we can create objects. Through: - functions
- prototyping
- pseudo classing
",
+ "Let's learn how to \"subclass\" one object to another. This will give our new object the attributes of the original object. It will allow us to make further modifications to the new object without affecting the original object.",
+ "You can save your progress by creating a free Udacity account, but note that it's also possible to complete this entire course without an account by following the links we provide.",
+ "Go to https://www.udacity.com/course/viewer#!/c-ud015/l-2794468540/m-2785128536 and start the course.",
+ "Once you've completed this section on subclassing, mark this Waypoint complete and move on to the next one."
+ ],
+ "challengeType": 2,
+ "tests": []
+ },
+ {
+ "_id": "bd7136d8c441eddfaeb5bd5f",
+ "name": "Waypoint: Use Pseudoclassical Subclasses",
+ "difficulty": 0.10,
+ "challengeSeed": "128836937",
+ "description": [
+ "This final section will teach us how to create subclasses from pseudo classes.",
+ "You can save your progress by creating a free Udacity account, but note that it's also possible to complete this entire course without an account by following the links we provide.",
+ "Go to https://www.udacity.com/course/viewer#!/c-ud015/l-2794468541/e-2693158566/m-2688408703 and start the course.",
+ "Once you've completed this final section on pseudoclassical subclassing, mark this Waypoint complete and move on."
+ ],
+ "challengeType": 2,
+ "tests": []
+ }
+ ]
+}
diff --git a/seed_data/challenges/ziplines.json b/seed_data/challenges/ziplines.json
new file mode 100644
index 0000000000..98d7605096
--- /dev/null
+++ b/seed_data/challenges/ziplines.json
@@ -0,0 +1,205 @@
+{
+ "name": "Front End Development Projects",
+ "order" : 0.012,
+ "challenges": [
+ {
+ "_id": "bd7158d8c442eddfbeb5bd1f",
+ "name": "Waypoint: Get Set for Ziplines",
+ "difficulty": 1.00,
+ "challengeSeed": "125658022",
+ "description": [
+ "Now you're ready to start our Zipline challenges. These front-end development challenges will give you many opportunities to apply the HTML, CSS, jQuery and JavaScript you've learned to build static (database-less) applications.",
+ "For many of these challenges, you will be using JSON data from external API endpoints, such as Twitch.tv and Twitter. Note that you don't need to have a database to use these data.",
+ "The easiest way to manipulate these data is with jQuery $.getJSON().",
+ "Whatever you do, don't get discouraged! Remember to use RSAP if you get stuck.",
+ "We'll build these challenges using CodePen, a popular tool for creating, sharing, and discovering static web applications.",
+ "Go to http://codepen.io and create an account.",
+ "Click your user image in the top right corner, then click the \"New pen\" button that drops down.",
+ "Drag the windows around and press the buttons in the lower-right hand corner to change the orientation to suit your preference.",
+ "Click the gear next to CSS. Then in the \"External CSS File or Another Pen\" text field, type \"bootstrap\" and scroll down until you see the latest version of Bootstrap. Click it.",
+ "Verify that bootstrap is active by adding the following code to your HTML: <h1 class='text-primary'>Hello CodePen!</h1>
. The text's color should be Bootstrap blue.",
+ "Click the gear next the JavaScript. Click the \"Latest version of...\" select box and choose jQuery.",
+ "Now add the following code to your JavaScript: $(document).ready(function() { $('.text-primary').text('Hi CodePen!') });
. Click the \"Save\" button at the top. Your \"Hello CodePen!\" should change to \"Hi CodePen!\". This means that jQuery is working.",
+ "Now you're ready for your first Zipline. Click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair."
+ ],
+ "challengeType": 3,
+ "tests": []
+ },
+ {
+ "_id": "bd7158d8c442eddfaeb5bd1f",
+ "name": "Zipline: Use the Twitch.tv JSON API",
+ "difficulty": 1.01,
+ "challengeSeed": "126411564",
+ "description": [
+ "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/GeoffStorbeck/full/GJKRxZ.",
+ "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
+ "Rule #2: You may use whichever libraries or APIs you need.",
+ "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
+ "Here are the user stories you must enable, and optional bonus user stories:",
+ "User Story: As a user, I can see whether Free Code Camp is currently streaming on Twitch.tv.",
+ "User Story: As a user, I can click the status output and be sent directly to the Free Code Camp's Twitch.tv channel.",
+ "User Story: As a user, if Free Code Camp is streaming, I can see additional details about what they are streaming.",
+ "Bonus User Story: As a user, I can search through the streams listed.",
+ "Hint: Here's an example call to Twitch.tv's JSON API: https://api.twitch.tv/kraken/streams/freecodecamp
.",
+ "Hint: The relevant documentation about this API call is here: https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel.",
+ "Hint: Here's an array of the Twitch.tv usernames of people who regularly stream coding: [\"freecodecamp\", \"storbeck\", \"terakilobyte\", \"habathcx\",\"RobotCaleb\",\"comster404\",\"brunofin\",\"thomasballinger\",\"noobs2ninjas\",\"beohoff\"]
",
+ "Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.",
+ "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
+ "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
+ ],
+ "challengeType": 3,
+ "tests": []
+ },
+ {
+ "_id": "bd7158d8c442eddfaeb5bd13",
+ "name": "Zipline: Build a Random Quote Machine",
+ "difficulty": 1.02,
+ "challengeSeed": "126415122",
+ "description": [
+ "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/AdventureBear/full/vEoVMw.",
+ "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
+ "Rule #2: You may use whichever libraries or APIs you need.",
+ "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
+ "Here are the user stories you must enable, and optional bonus user stories:",
+ "User Story: As a user, I can click a button to show me a new random quote.",
+ "Bonus User Story: As a user, I can press a button to tweet out a quote.",
+ "Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.",
+ "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
+ "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
+ ],
+ "challengeType": 3,
+ "tests": []
+ },
+ {
+ "_id": "bd7158d8c442eddfaeb5bd10",
+ "name": "Zipline: Show the Local Weather",
+ "difficulty": 1.03,
+ "challengeSeed": "126415127",
+ "description": [
+ "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/AdventureBear/full/yNBJRj.",
+ "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
+ "Rule #2: You may use whichever libraries or APIs you need.",
+ "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
+ "Here are the user stories you must enable, and optional bonus user stories:",
+ "User Story: As a user, I can see the weather in my current location.",
+ "Bonus User Story: As a user, I can see an icon depending on the temperature..",
+ "Bonus User Story: As a user, I see a different background image depending on the temperature (e.g. snowy mountain, hot desert).",
+ "Bonus User Story: As a user, I can push a button to toggle between Fahrenheit and Celsius.",
+ "Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.",
+ "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
+ "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
+ ],
+ "challengeType": 3,
+ "tests": []
+ },
+ {
+ "_id": "bd7158d8c442eddfaeb5bd18",
+ "name": "Zipline: Stylize Stories on Camper News",
+ "difficulty": 1.04,
+ "challengeSeed": "126415129",
+ "description": [
+ "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/GeoffStorbeck/full/Wveezv.",
+ "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
+ "Rule #2: You may use whichever libraries or APIs you need.",
+ "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
+ "Here are the user stories you must enable, and optional bonus user stories:",
+ "User Story: As a user, I can browse recent posts from Camper News.",
+ "User Story: As a user, I can click on a post to be taken to the story's original URL.",
+ "User Story: As a user, I can click a link to go directly to the post's discussion page.",
+ "Bonus User Story: As a user, I can see how many upvotes each story has.",
+ "Hint: Here's the Camper News Hot Stories API endpoint: http://www.freecodecamp.com/stories/hotStories
.",
+ "Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.",
+ "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
+ "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
+ ],
+ "challengeType": 3,
+ "tests": []
+ },
+ {
+ "_id": "bd7158d8c442eddfaeb5bd19",
+ "name": "Zipline: Wikipedia Viewer",
+ "difficulty": 1.05,
+ "challengeSeed": "126415131",
+ "description": [
+ "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/GeoffStorbeck/full/MwgQea.",
+ "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
+ "Rule #2: You may use whichever libraries or APIs you need.",
+ "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
+ "Here are the user stories you must enable, and optional bonus user stories:",
+ "User Story: As a user, I can search Wikipedia entries in a search box and see the resulting Wikipedia entries.",
+ "Bonus User Story:As a user, I can click a button to see a random Wikipedia entry.",
+ "Bonus User Story:As a user, when I type in the search box, I can see a dropdown menu with autocomplete options for matching Wikipedia entries.",
+ "Hint: Here's an entry on using Wikipedia's API: http://www.mediawiki.org/wiki/API:Main_page
.",
+ "Remember to use RSAP if you get stuck. Try using jQuery's $.getJSON() to consume APIs.",
+ "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
+ "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
+ ],
+ "challengeType": 3,
+ "tests": []
+ },
+ {
+ "_id": "bd7158d8c442eddfaeb5bd0f",
+ "name": "Zipline: Build a Pomodoro Clock",
+ "difficulty": 1.06,
+ "challengeSeed": "126411567",
+ "description": [
+ "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/GeoffStorbeck/full/RPbGxZ/.",
+ "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
+ "Rule #2: You may use whichever libraries or APIs you need.",
+ "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
+ "Here are the user stories you must enable, and optional bonus user stories:",
+ "User Story: As a user, I can start a 25 minute pomodoro, and the timer will go off once 25 minutes has elapsed.",
+ "Bonus User Story: As a user, I can reset the clock for my next pomodoro.",
+ "Bonus User Story: As a user, I can customize the length of each pomodoro.",
+ "Remember to use RSAP if you get stuck.",
+ "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
+ "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
+ ],
+ "challengeType": 3,
+ "tests": []
+ },
+ {
+ "_id": "bd7158d8c442eddfaeb5bd17",
+ "name": "Zipline: Build a JavaScript Calculator",
+ "difficulty": 1.07,
+ "challengeSeed": "126411565",
+ "description": [
+ "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/GeoffStorbeck/full/zxgaqw.",
+ "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
+ "Rule #2: You may use whichever libraries or APIs you need.",
+ "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
+ "Here are the user stories you must enable, and optional bonus user stories:",
+ "User Story: As a user, I can add, subtract, multiply and divide two numbers.",
+ "Bonus User Story: I can clear the input field with a clear button.",
+ "Bonus User Story: I can keep chaining mathematical operations together until I hit the clear button, and the calculator will tell me the correct output.",
+ "Remember to use RSAP if you get stuck.",
+ "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
+ "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
+ ],
+ "challengeType": 3,
+ "tests": []
+ },
+ {
+ "_id": "bd7158d8c442eddfaeb5bd1c",
+ "name": "Zipline: Build a Tic Tac Toe Game",
+ "difficulty": 1.08,
+ "challengeSeed": "126415123",
+ "description": [
+ "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/alex-dixon/full/JogOpQ/.",
+ "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
+ "Rule #2: You may use whichever libraries or APIs you need.",
+ "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
+ "Here are the user stories you must enable, and optional bonus user stories:",
+ "User Story: As a user, I can play a game of Tic Tac Toe with the computer.",
+ "Bonus User Story: As a user, I can never actually win against the computer - at best I can tie.",
+ "Bonus User Story: As a user, my game will reset as soon as it's over so I can play again.",
+ "Bonus User Story: As a user, I can choose whether I want to play as X or O.",
+ "Remember to use RSAP if you get stuck.",
+ "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
+ "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
+ ],
+ "challengeType": 3,
+ "tests": []
+ }
+ ]
+}
diff --git a/seed_data/coursewares.json b/seed_data/coursewares.json
deleted file mode 100644
index dd4a653eb0..0000000000
--- a/seed_data/coursewares.json
+++ /dev/null
@@ -1,1025 +0,0 @@
-[
- {
- "_id": "bd7124d8c441eddfaeb5bdef",
- "name": "Learn how Free Code Camp Works",
- "difficulty": 0.01,
- "challengeSeed": "125407438",
- "description": [
- "Watch this 1-minute video, or simply read this summary:",
- "Welcome to Free Code Camp. We're a community of busy people who learn to code, then practice by building projects for nonprofits.",
- "We built this community because learning to code is hard. But anyone who can stay motivated can learn to code. And to stay motivated, you just need to: - make friends with people who code
- code a little every day
",
- "All our challenges are - free
- self-paced
- browser-based
",
- "We'll spend - 200 hours learning tools like HTML, CSS, JavaScript, Node.js and databases
- 600 hours building practice projects
- 800 hours building full stack solutions for nonprofits
",
- "By the end, we'll - be good at coding
- have the portfolio of apps with happy users to prove it
",
- "Once you make it through Free Code Camp, you will be able to get a coding job. There are far more job openings out there than there are qualified coders to fill them.",
- "Now it's time to join our chat room. Click the \"I've completed this challenge\" button to move on to your next challenge."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7125d8c441eddfaeb5bd0f",
- "name": "Join Our Chat Room",
- "difficulty": 0.02,
- "challengeSeed": "124555254",
- "description": [
- "Now we're going to join the Free Code Camp chat room. You can come here any time of day to hang out, ask questions, or find another camper to pair program with.",
- "Make sure your Free Code Camp account includes your email address. You can do this here: http://freecodecamp.com/account. Please note that the email address you use will be invisible to the public, but Slack will make it visible to other campers in our slack chat rooms.",
- "Click this link, which will email you an invite to Free Code Camp's Slack chat rooms: http://freecodecamp.com/api/slack.",
- "Now check your email and click the link in the email from Slack.",
- "Complete the sign up process, then update your biographical information and upload an image. A picture of your face works best. This is how people will see you in our chat rooms, so put your best foot forward.",
- "Now enter the General chat room and introduce yourself to our chat room by typing: \"Hello world!\".",
- "Tell your fellow campers how you found Free Code Camp. Also tell us why you want to learn to code.",
- "Keep the chat room open while you work through the other challenges. That way you ask for help if you get stuck on a challenge. You can also socialize when you feel like taking a break.",
- "You can also access this chat room by clicking the \"Chat\" button in the upper right hand corner.",
- "In order to keep our community a friendly and positive place to learn to code, please read and follow our Code of Conduct: http://freecodecamp.com/field-guide/what-is-the-free-code-camp-code-of-conduct?"
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7125d8c441eddfaeb5bdff",
- "name": "Preview our Challenge Map",
- "difficulty": 0.03,
- "challengeSeed": "125407437",
- "description": [
- "Before you start learning how to code, we'd like to introduce you to a few things.",
- "Let's look at our Challenge Map. Click on the \"Map\" button in the upper right hand corner. This map shows all the challenges that will teach you how to code.",
- "You should complete all these challenges in order.",
- "Once you finish these Waypoint challenges, you'll move on to Bonfires (algorithm practice), then Ziplines (front end development practice) and finally Basejumps (full stack development practice). After that, you'll start building projects for nonprofits.",
- "This challenge map is just for your reference. When you return to FreeCodeCamp.com, we'll automatically redirect you to the next challenge that you should be doing."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7125d8c441eddfaeb5bd1f",
- "name": "Browse our Field Guide",
- "difficulty": 0.04,
- "challengeSeed": "125407435",
- "description": [
- "Free Code Camp has an up-to-date field guide that will answer your many questions.",
- "Click the \"Field Guide\" button in the upper right hand corner.",
- "You can browse the field guide at your convenience. Most of its articles take less than 1 minute to read.",
- "When you click the Field Guide button, it will always take you back to whichever article you were last reading.",
- "Read a few field guide articles, then move on to your next challenge."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7125d8c441eddfaeb5bd2f",
- "name": "Customize your Portfolio Page",
- "difficulty": 0.05,
- "challengeSeed": "125407433",
- "description": [
- "You and all your fellow campers have portfolio pages.",
- "To see your portfolio page, click your picture in the upper right hand corner.",
- "Your portfolio page will automatically show off your progress through Free Code Camp.",
- "Click the \"Update my portfolio page or manage my account\" button",
- "You can link to your Github, Twitter and LinkedIn accounts. If you've already built some websites, you can link to them here as well.",
- "Be sure to click the \"Update my Bio\" or \"Update my Social Links\" button to save this new information to your portfolio page.",
- "Once you're happy with your portfolio page, you can move on to your next challenge."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7126d8c441eddfaeb5bd3f",
- "name": "Try Camper News",
- "difficulty": 0.06,
- "challengeSeed": "124553410",
- "description": [
- "Camper News is the best place for our campers to share and discuss helpful links.",
- "Click \"News\" in the upper right hand corner.",
- "You'll see a variety of links that have been submitted. Click on the \"Discuss\" button under one of them.",
- "You can upvote links. This will push the link up the rankings of hot links.",
- "You can also comment on a link. If someone responds to your comment, you'll get an email notification so you can come back and respond to them.",
- "You can also submit links. You can modify the link's headline and also leave an initial comment about the link.",
- "You can view the portfolio pages of any camper who has posted links or comments on Camper News. Just click on their photo.",
- "When you submit a link, you'll get a point. You will also get a point each time someone upvotes your link.",
- "Now that you've learned how to use Camper News, let's move on to your next challenge."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7126d8c441eddfaeb5bd3e",
- "name": "Meet Other Campers in your City",
- "difficulty": 0.065,
- "challengeSeed": "127358841",
- "description": [
- "One of the best ways to stay motivated when learning to code is to hang out with other campers.",
- "Slack and Camper News are great ways to communicate with other campers, but there's no substitute for meeting people in-person.",
- "The easiest way to meet other campers in your city is to join your city's Facebook Group. Click here to view our growing list of local groups.",
- "Click the link to your city, then, once Facebook loads, click \"Join group\".",
- "Our local groups are new, so if you don't see your city on this list, you should follow the directions to create a Facebook group for your city.",
- "If you don't have a Facebook account, we strongly recommend you create one, even if it's just for the purpose of coordinating with campers in your city through this group.",
- "Our groups allow you to create events, coordinate those events, and share photos from the events afterward.",
- "Whether you're hosting a study group, pair programming at your local library, or going to a weekend hackathon, your city's group will help you make it happen."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7137d8c441eddfaeb5bdef",
- "name": "Get Help the Hacker Way with RSAP",
- "difficulty": 0.07,
- "challengeSeed": "125407432",
- "description": [
- "Let's cover one last thing before you start working through our lessons: how to get help.",
- "Any time you get stuck or don't know what to do next, follow this simple algorithm (procedure): RSAP (Read, Search, Ask, Post).",
- "First, R - Read the documentation or error message. A key skill that good coders have is the ability to interpret and then follow instructions.",
- "Next, S - Search Google. Good Google queries take a lot of practice. When you search Google, you usually want to include the language or framework you're using. You also want to limit the results to a recent period.",
- "Then, if you still haven't found an answer to your question, A - Ask your friends. If you have trouble, you can ask your fellow campers. We have a special chat room specifically for getting help with tools you learn through these Free Code Camp Challenges. Go to https://freecode.slack.com/messages/help/. Keep this chat open while you work on the remaining challenges.",
- "Finally, P - Post on Stack Overflow. Before you attempt to do this, read Stack Overflow's guide to asking good questions: http://stackoverflow.com/help/how-to-ask.",
- "Here's our detailed field guide on getting help: http://freecodecamp.com/field-guide/how-do-i-get-help-when-i-get-stuck.",
- "Now you have a clear algorithm to follow when you need help! Let's start coding! Move on to your next challenge."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7127d8c441eddfaeb5bdef",
- "name": "Build a Landing Page with HTML",
- "difficulty": 0.08,
- "challengeSeed": "125671867",
- "description": [
- "Now it's time for us to start our actual coding lessons. We've curated a series of free, self-paced, browser-based lessons from providers like Codecademy and Stanford University.",
- "These lessons will cover a lot of ground quickly, and will hold your hand throughout the process. Don't try to memorize everything - you'll spend more than a thousand hours practicing these later, and you can always look things up. Just keep moving.",
- "If you've learned HTML and CSS before, these next few Waypoints will be a valuable review. If you haven't learned HTML or CSS before, you're in for a treat!",
- "This Codecademy will quickly cover HTML, CSS and even Responsive Design with Bootstrap.",
- "If you don't already have a Codecademy account, create one here: http://www.codecademy.com.",
- "Go to http://www.codecademy.com/en/skills/make-a-website/topics/html-elements and complete the section.",
- "Once you're done, mark this Waypoint complete and move on the next Waypoint."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7128d8c441eddfaeb5bdef",
- "name": "Style Text with CSS",
- "difficulty": 0.09,
- "challengeSeed": "125671735",
- "description": [
- "Cascading Style Sheets (CSS) is what gives HTML it's style.",
- "Now let's learn how to style HTML elements, such as headlines and body text, using CSS.",
- "Go to http://www.codecademy.com/skills/make-a-website/topics/css-properties-text and complete the section."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd8129d8c441ecdfaeb5bdef",
- "name": "Space Out with CSS",
- "difficulty": 0.10,
- "challengeSeed": "125671732",
- "description": [
- "There are several ways to control spacing between elements using CSS. Let's learn about padding, margins, and more.",
- "Go to http://www.codecademy.com/skills/make-a-website/topics/css-properties-box and complete the section."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd8129d8c441eddfaeb5bdef",
- "name": "Design a Layout with HTML",
- "difficulty": 0.11,
- "challengeSeed": "125671731",
- "description": [
- "Now let's apply the HTML and CSS we've learned toward making a proper layout.",
- "We'll learn the difference between block elements and inline elements. We'll also learn the difference between absolute position and relative positioning.",
- "Go to http://www.codecademy.com/skills/make-a-website/topics/css-properties-layout and complete the section."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd8129d8c441eddfaeb5bdee",
- "name": "Design Responsively with Bootstrap",
- "difficulty": 0.12,
- "challengeSeed": "125671730",
- "description": [
- "Responsive Design is the practice of building web applications that look good on any screen size - whether it's a phone or a big screen TV.",
- "Bootstrap is a CSS library that was created by Twitter. It's by far the most popular responsive design framework. It's websites like Newsweek, Free Code Camp, and, of course, Twitter.",
- "Go to http://www.codecademy.com/skills/make-a-website/topics/bootstrap-components and complete the section."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7112d8c441eddfaeb5bded",
- "name": "Get Started with jQuery",
- "difficulty": 0.13,
- "challengeSeed": "125671865",
- "description": [
- "jQuery is a powerful library built in JavaScript for manipulating HTML elements.",
- "It's a lot easier to use than JavaScript itself, so we'll learn it first.",
- "It's also extremely popular with employers, so we're going to learn it well.",
- "Codecademy has an excellent free course that will walk us through the basics of jQuery.",
- "Go to http://www.codecademy.com/courses/web-beginner-en-bay3D/0/1 and complete the first section."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7113d8c441eddfaeb5bdef",
- "name": "Write Functions with jQuery",
- "difficulty": 0.14,
- "challengeSeed": "125658029",
- "description": [
- "Now we're ready to write your first jQuery functions.",
- "Functions are little sub-programs. You can call a function and ask it to do something. Then it will return an answer.",
- "First, you'll learn about one of the most important jQuery functions of all: $(document).ready()
.",
- "Go to http://www.codecademy.com/courses/web-beginner-en-GfjC6/0/1 and complete the second section."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7114d8c441eddfaeb5bdef",
- "name": "Harness Dynamic HTML",
- "difficulty": 0.15,
- "challengeSeed": "125658028",
- "description": [
- "Did you know that you can create HTML elements using jQuery?",
- "Let's learn some more advanced ways to use jQuery to manipulate the DOM.",
- "Go to http://www.codecademy.com/courses/web-beginner-en-v6phg/0/1 and complete the third section."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7115d8c441eddfaeb5bdef",
- "name": "Listen for jQuery Events",
- "difficulty": 0.16,
- "challengeSeed": "125658027",
- "description": [
- "jQuery can listen for events, such as clicking a button, and respond to them.",
- "Here we'll learn how to use the jQuery click()
function to respond to events in the browser.",
- "Go to http://www.codecademy.com/courses/web-beginner-en-JwhI1/0/1 and complete the fourth section."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7116d8c441eddfaeb5bdef",
- "name": "Trigger jQuery Effects",
- "difficulty": 0.17,
- "challengeSeed": "125658025",
- "description": [
- "We can use jQuery to do all kinds of visual effects and transitions.",
- "Let's explore some of the fun ways we can manipulate DOM elements with jQuery.",
- "Go to http://www.codecademy.com/courses/web-beginner-en-jtFIC/0/1 and complete the fifth section."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7123d8c441eddfaeb5bdef",
- "name": "Learn Basic Computer Science",
- "difficulty": 0.18,
- "challengeSeed": "114628241",
- "description": [
- "Stanford has an excellent free online Computer Science curriculum. This interactive course uses a modified version of JavaScript. It will cover a lot of concepts quickly.",
- "Note that Harvard also has an excellent introduction to computer science course called CS50, but it takes more than 100 hours to complete, and doesn't use JavaScript.",
- "Despite being completely self-paced, Stanford's CS101 course is broken up into weeks. Each of the following challenges will address one of those weeks.",
- "Go to https://class.stanford.edu/courses/Engineering/CS101/Summer2014/courseware/z54/z1/ and complete the first week's course work."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd8124d8c441eddfaeb5bdef",
- "name": "Learn Loops",
- "difficulty": 0.19,
- "challengeSeed": "114597348",
- "description": [
- "Now let's tackle week 2 of Stanford's Intro to Computer Science course.",
- "This will introduce us to loops, a fundamental feature of every programming language.",
- "Go to https://class.stanford.edu/courses/Engineering/CS101/Summer2014/courseware/z100/a7a70ce6e4724c58862ee6007284face/ and complete Week 2."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd8125d8c441eddfaeb5bdef",
- "name": "Learn Computer Hardware",
- "difficulty": 0.20,
- "challengeSeed": "114597347",
- "description": [
- "Week 3 of Stanford's Intro to Computer Science covers computer hardware and explains Moore's law of exponential growth in the price-performance of processors.",
- "This challenge will also give you an understanding of how bits and bytes work.",
- "Go to https://class.stanford.edu/courses/Engineering/CS101/Summer2014/courseware/z143/z101/ and complete Week 3."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd8126d8c441eddfaeb5bdef",
- "name": "Learn Computer Networking",
- "difficulty": 0.21,
- "challengeSeed": "114604811",
- "description": [
- "Now that you've learned about computer hardware, it's time to learn about the software that runs on top of it.",
- "Particularly important, you will learn about networks and TCP/IP - the protocol that powers the internet.",
- "Go to https://class.stanford.edu/courses/Engineering/CS101/Summer2014/courseware/z187/z144/ and complete Week 4."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd8127d8c441eddfaeb5bdef",
- "name": "Learn Boolean Logic",
- "difficulty": 0.22,
- "challengeSeed": "114604812",
- "description": [
- "Now we'll do some more table exercises and learn boolean logic.",
- "We'll also learn the difference between digital data and analog data.",
- "Go to https://class.stanford.edu/courses/Engineering/CS101/Summer2014/courseware/z208/z188/ and complete Week 5."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd8128d8c441eddfaeb5bdef",
- "name": "Learn Computer Security",
- "difficulty": 0.23,
- "challengeSeed": "114604813",
- "description": [
- "We're almost done with Stanford's Introduction to Computer Science course!",
- "We'll learn about one of the most important inventions of the 20th century - spreadsheets.",
- "We'll also learn about Computer Security and some of the more common vulnerabilities software systems have.",
- "Go to https://class.stanford.edu/courses/Engineering/CS101/Summer2014/courseware/z229/z213/ and complete Week 6, the final week of the course."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7129d8c441eddfaeb5bdef",
- "name": "Build an Adventure Game",
- "difficulty": 0.24,
- "challengeSeed": "114604814",
- "description": [
- "Now that you understand some Computer Science fundamentals, let's focus on programming JavaScript!",
- "We're going to work through Codecademy's famous interactive JavaScript course.",
- "This course will teach us some JavaScript fundamentals while guiding us through the process of building interesting web apps, all within Codecademy's learner-friendly environment!",
- "Go to http://www.codecademy.com/courses/getting-started-v2/0/1 and complete the section.",
- "Be sure to also complete this section: http://www.codecademy.com/courses/javascript-beginner-en-x9DnD/0/1."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7130d8c441eddfaeb5bdef",
- "name": "Build Rock Paper Scissors",
- "difficulty": 0.25,
- "challengeSeed": "114604815",
- "description": [
- "Now we'll learn how JavaScript functions work, and use them to build a simple Rock Paper Scissors game.",
- "Go to http://www.codecademy.com/courses/javascript-beginner-en-6LzGd/0/1 and complete the section.",
- "Be sure to also complete this section: http://www.codecademy.com/courses/javascript-beginner-en-Bthev-mskY8/0/1."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7131d8c441eddfaeb5bdef",
- "name": "Learn JavaScript For Loops",
- "difficulty": 0.26,
- "challengeSeed": "114614220",
- "description": [
- "Let's learn more about the loops that make virtually all programs possible - the \"For Loop\" and \"While Loop\". First, we'll learn the For Loop.",
- "Go to http://www.codecademy.com/courses/javascript-beginner-en-NhsaT/0/1web and complete both the both For and While loop section.",
- "Be sure to also complete this section: http://www.codecademy.com/courses/javascript-beginner-en-XEDZA/0/1."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7132d8c441eddfaeb5bdef",
- "name": "Learn JavaScript While Loops",
- "difficulty": 0.27,
- "challengeSeed": "114612889",
- "description": [
- "Go to http://www.codecademy.com/courses/javascript-beginner-en-ASGIv/0/1 and complete the section.",
- "Be sure to also complete this section: http://www.codecademy.com/courses/javascript-beginner-en-mrTNH-6VIZ9/0/1."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7133d8c441eddfaeb5bdef",
- "name": "Learn Control Flow",
- "difficulty": 0.28,
- "challengeSeed": "114612888",
- "description": [
- "Much of human reasoning can be broken down into what we call Boolean Logic. Lucky for us, computers can think the same way! Let's learn how to instruct our computers by writing \"If Statements\" and \"Else Statements\".",
- "We'll also learn some advanced \"Control Flow\" principals, such as ways we can exit loops early.",
- "Go to http://www.codecademy.com/courses/javascript-beginner-en-qDwp0/0/1 and complete the section.",
- "Be sure to also complete this section: http://www.codecademy.com/courses/javascript-beginner-en-ZA2rb/0/1."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7134d8c441eddfaeb5bdef",
- "name": "Build a Contact List",
- "difficulty": 0.29,
- "challengeSeed": "114612887",
- "description": [
- "Up to this point, you've been working mostly with strings and numbers. Now we're going to learn more complicated data structures, like \"Arrays\" and \"Objects\".",
- "Go to http://www.codecademy.com/courses/javascript-beginner-en-9Sgpi/0/1 and complete the section.",
- "Be sure to also complete this section: http://www.codecademy.com/courses/javascript-beginner-en-3bmfN/0/1."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7135d8c441eddfaeb5bdef",
- "name": "Build an Address Book",
- "difficulty": 0.30,
- "challengeSeed": "114612885",
- "description": [
- "Let's learn more about objects.",
- "Go to http://www.codecademy.com/courses/spencer-sandbox/0/1 and complete the section.",
- "Be sure to also complete this section: http://www.codecademy.com/courses/building-an-address-book/0/1?curriculum_id=506324b3a7dffd00020bf661."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7136d8c441eddfaeb5bdef",
- "name": "Build a Cash Register",
- "difficulty": 0.31,
- "challengeSeed": "114612882",
- "description": [
- "In this final Codecademy section, we'll learn even more about JavaScript objects.",
- "Go to http://www.codecademy.com/courses/objects-ii/0/1 and complete this section.",
- "Be sure to also complete the final section: http://www.codecademy.com/courses/close-the-super-makert/0/1."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7118d8c441eddfaeb5bdef",
- "name": "Discover Chrome's DevTools",
- "difficulty": 0.32,
- "challengeSeed": "110752743",
- "description": [
- "It's time to learn the most powerful tool your browser has - the Development Tools!",
- "If you aren't already using Chrome, you'll want to download it here: http://www.google.com/chrome/. While it's true that Firefox has a tool called Firebug that is very similar to Chrome's DevTools, we will use Chrome for this challenge.",
- "Note that this course, jointly produced by Google and Code School, is technologically impressive, but occasionally buggy. If you encounter a bug, just ignore it and keep going.",
- "Go to http://discover-devtools.codeschool.com and complete this short course."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7138d8c441eddfaeb5bdef",
- "name": "Learn Regular Expressions",
- "difficulty": 0.33,
- "challengeSeed": "112547802",
- "description": [
- "You can use a Regular Expression, or \"Regex\", to select specific types of characters in text.",
- "Check out http://www.regexr.com. It's a Regular Expression Sandbox.",
- "Now go to http://www.regexone.com and complete the tutorial and exercises 1 - 6.",
- "Note that you can click \"continue\" to move on to the next step as soon as all the tasks have green check marks beside them. You can often do this just by using the wildcard \"dot\" operator, but try to use the techniques that each lesson recommends."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7154d8c441eddfaeb5bdef",
- "name": "Get Started with Angular.js",
- "difficulty": 0.34,
- "challengeSeed": "114684726",
- "description": [
- "Code School has a short, free Angular.js course. This will give us a quick tour of Angular.js's mechanics and features.",
- "In this course, we'll build a virtual shop entirely in Angular.js.",
- "Go to http://campus.codeschool.com/courses/shaping-up-with-angular-js/level/1/section/1/video/1 and complete the section."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7155d8c441eddfaeb5bdef",
- "name": "Apply Angular.js Directives",
- "difficulty": 0.35,
- "challengeSeed": "114684727",
- "description": [
- "Directives serve as markers in your HTML. When Angular.js compiles your HTML, it will can alter the behavior of DOM elements based on the directives you've used.",
- "Let's learn how these powerful directives work, and how to use them to make your web apps more dynamic",
- "Go to http://campus.codeschool.com/courses/shaping-up-with-angular-js/level/2/section/1/video/1 and complete the section."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7156d8c441eddfaeb5bdef",
- "name": "Power Forms with Angular.js",
- "difficulty": 0.36,
- "challengeSeed": "114684729",
- "description": [
- "One area where Angular.js really shines is its powerful web forms.",
- "Learn how to create reactive Angular.js forms, including real-time form validation.",
- "Go to http://campus.codeschool.com/courses/shaping-up-with-angular-js/level/3/section/1/video/1 and complete the section."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7157d8c441eddfaeb5bdef",
- "name": "Customize Angular.js Directives",
- "difficulty": 0.37,
- "challengeSeed": "114685062",
- "description": [
- "Now we'll learn how to modify existing Angular.js directives, and even build directives of your own.",
- "Go to http://campus.codeschool.com/courses/shaping-up-with-angular-js/level/4/section/1/video/1 and complete the section."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7158d8c441eddfaeb5bdef",
- "name": "Create Angular.js Services",
- "difficulty": 0.38,
- "challengeSeed": "114685060",
- "description": [
- "Services are functions that you can use and reuse throughout your Angular.js app to get things done.",
- "We'll learn how to use services in this final Code School Angular.js challenge.",
- "Go to http://campus.codeschool.com/courses/shaping-up-with-angular-js/level/5/section/1/video/1 and complete the section."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7153d8c441eddfaeb5bd0f",
- "name": "Manage Packages with NPM",
- "difficulty": 0.39,
- "challengeSeed": "126433450",
- "description": [
- "We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
- "If you don't already have Cloud 9 account, create one now at http://c9.io.",
- "Open up http://c9.io and sign in to your account.",
- "Click on Create New Workspace at the top right of the c9.io page, then click on the \"Create a new workspace\" popup that appears below it the button after you click on it.",
- "Give your workspace a name.",
- "Choose Node.js in the selection area below the name field",
- "Click the Create button",
- "Wait for the workspace to finish processing and select it on the left sidebar, below the Create New Workspace button",
- "Click the \"Start Editing\" button.",
- "In the lower right hand corner you should see a terminal window. In this window use the following commands. You don't need to know what these mean at this point.",
- "Run this command: sudo npm install how-to-npm -g
",
- "Now start this tutorial by running how-to-npm
",
- "Note that you can resize the c9.io's windows by dragging their borders.",
- "Follow the directions and work through all of the the tutorial's steps before moving on."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7153d8c441eddfaeb5bdff",
- "name": "Start a Node.js Server",
- "difficulty": 0.40,
- "challengeSeed": "126411561",
- "description": [
- "We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
- "If you don't already have Cloud 9 account, create one now at http://c9.io.",
- "Open up http://c9.io and sign in to your account.",
- "Click on Create New Workspace at the top right of the c9.io page, then click on the \"Create a new workspace\" popup that appears below it the button after you click on it.",
- "Give your workspace a name.",
- "Choose Node.js in the selection area below the name field",
- "Click the Create button",
- "Wait for the workspace to finish processing and select it on the left sidebar, below the Create New Workspace button",
- "Click the \"Start Editing\" button.",
- "In the lower right hand corner you should see a terminal window. In this window use the following commands. You don't need to know what these mean at this point.",
- "Run this command: sudo npm install learnyounode -g
",
- "Now start this tutorial by running learnyounode
",
- "Note that you can resize the c9.io's windows by dragging their borders.",
- "Follow the directions and work through all of the the tutorial's steps before moving on."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7153d8c441eddfaeb5bd1f",
- "name": "Build Web Apps with Express.js",
- "difficulty": 0.41,
- "challengeSeed": "126411559",
- "description": [
- "We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
- "If you don't already have Cloud 9 account, create one now at http://c9.io.",
- "Open up http://c9.io and sign in to your account.",
- "Click on Create New Workspace at the top right of the c9.io page, then click on the \"Create a new workspace\" popup that appears below it the button after you click on it.",
- "Give your workspace a name.",
- "Choose Node.js in the selection area below the name field",
- "Click the Create button",
- "Wait for the workspace to finish processing and select it on the left sidebar, below the Create New Workspace button",
- "Click the \"Start Editing\" button.",
- "In the lower right hand corner you should see a terminal window. In this window use the following commands. You don't need to know what these mean at this point.",
- "Run this command: git clone http://github.com/reddock/fcc_express && chmod 744 fcc_express/setup.sh && fcc_express/setup.sh && source ~/.profile
",
- "Now start this tutorial by running expressworks
",
- "Note that you can resize the c9.io's windows by dragging their borders.",
- "Follow the directions and work through all of the the tutorial's steps before moving on."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7140d8c441eddfaeb5bdef",
- "name": "Manage Source Code with Git",
- "difficulty": 0.43,
- "challengeSeed": "114635309",
- "description": [
- "Version Control Systems like Git ensure that, no matter how you experiment with your code, you can always roll back your app to a stable previous state.",
- "Git is also a great way to share and contribute to open source software.",
- "Go to https://www.codeschool.com/courses/try-git and complete this short interactive course."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7139d8c441eddfaeb5bdef",
- "name": "Pair Program on Bonfires",
- "difficulty": 0.44,
- "challengeSeed": "119657641",
- "description": [
- "OK, we're finally ready to start pair programming!",
- "Pair Programming is where two people code together on the same computer. It is an efficient way to collaborate, and widely practiced at software companies. Pair Programming is one of the core concepts of \"Agile\" Software Development, which you will hear more about later.",
- "Many people use Skype or Google Hangouts to pair program, but if you talk with professional software engineers, they will tell you that it's not really pair programming unless both people have the ability to use the keyboard and mouse.",
- "The most popular tool for pair programming is Screen Hero. You can download Screen Hero for Mac or Windows. Create your new user account from within the app.",
- "We have a special chat room for people ready to pair program. Go to our Slack chatroom and navigate to the #letspair channel and type \"Hello Pair Programmers!\"",
- "If someone is available, they will be your \"pair\" - the person you pair programming with.",
- "If no one gets back to you in the first few minutes, don't worry. There will be lots of opportunities to pair program in the future.",
- "If someone does get back to you, private message them and ask for the email address they used to register Screen Hero.",
- "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.",
- "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 challenge as complete and move on to the Bonfires."
- ],
- "challengeType": 2,
- "tests": []
- },
- {
- "_id": "bd7158d8c442eddfbeb5bd1f",
- "name": "Get Set for Ziplines",
- "difficulty": 1.00,
- "challengeSeed": "125658022",
- "description": [
- "Now you're ready to start our Zipline challenges. These front-end development challenges will give you many opportunities to apply the HTML, CSS, jQuery and JavaScript you've learned to build static (database-less) applications.",
- "We'll build these challenges using CodePen, a popular tool for creating, sharing, and discovering static web applications.",
- "Go to http://codepen.io and create an account.",
- "Click your user image in the top right corner, then click the \"New pen\" button that drops down.",
- "Drag the windows around and press the buttons in the lower-right hand corner to change the orientation to suit your preference.",
- "Click the gear next to CSS. Then in the \"External CSS File or Another Pen\" text field, type \"bootstrap\" and scroll down until you see the latest version of Bootstrap. Click it.",
- "Verify that bootstrap is active by adding the following code to your HTML: <h1 class='text-primary'>Hello CodePen!</h1>
. The text's color should be Bootstrap blue.",
- "Click the gear next the JavaScript. Click the \"Latest version of...\" select box and choose jQuery.",
- "Now add the following code to your JavaScript: $(document).ready(function() { $('.text-primary').text('Hi CodePen!') });
. Click the \"Save\" button at the top. Your \"Hello CodePen!\" should change to \"Hi CodePen!\". This means that jQuery is working.",
- "Now you're ready for your first Zipline. Click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair."
- ],
- "challengeType": 3,
- "tests": []
- },
- {
- "_id": "bd7158d8c442eddfaeb5bd1f",
- "name": "Zipline: Use the Twitch.tv JSON API",
- "difficulty": 1.01,
- "challengeSeed": "126411564",
- "description": [
- "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/GeoffStorbeck/full/GJKRxZ.",
- "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
- "Rule #2: You may use whichever libraries or APIs you need.",
- "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
- "Here are the user stories you must enable, and optional bonus user stories:",
- "User Story: As a user, I can see whether Free Code Camp is currently streaming on Twitch.tv.",
- "User Story: As a user, I can click the status output and be sent directly to the Free Code Camp's Twitch.tv channel.",
- "User Story: As a user, if Free Code Camp is streaming, I can see additional details about what they are streaming.",
- "Bonus User Story: As a user, I can search through the streams listed.",
- "Hint: Here's an example call to Twitch.tv's JSON API: https://api.twitch.tv/kraken/streams/freecodecamp
.",
- "Hint: The relevant documentation about this API call is here: https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel.",
- "Hint: Here's an array of the Twitch.tv usernames of people who regularly stream coding: [\"freecodecamp\", \"storbeck\", \"terakilobyte\", \"habathcx\",\"notmichaelmcdonald\",\"RobotCaleb\",\"comster404\",\"brunofin\",\"thomasballinger\",\"joe_at_underflow\",\"noobs2ninjas\",\"mdwasp\",\"beohoff\",\"xenocomagain\"]
",
- "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
- "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
- ],
- "challengeType": 3,
- "tests": []
- },
- {
- "_id": "bd7158d8c442eddfaeb5bd13",
- "name": "Zipline: Build a Random Quote Machine",
- "difficulty": 1.02,
- "challengeSeed": "126415122",
- "description": [
- "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/AdventureBear/full/vEoVMw.",
- "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
- "Rule #2: You may use whichever libraries or APIs you need.",
- "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
- "Here are the user stories you must enable, and optional bonus user stories:",
- "User Story: As a user, I can click a button to show me a new random quote.",
- "Bonus User Story: As a user, I can press a button to tweet out a quote.",
- "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
- "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
- ],
- "challengeType": 3,
- "tests": []
- },
- {
- "_id": "bd7158d8c442eddfaeb5bd10",
- "name": "Zipline: Show the Local Weather",
- "difficulty": 1.03,
- "challengeSeed": "126415127",
- "description": [
- "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/AdventureBear/full/yNBJRj.",
- "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
- "Rule #2: You may use whichever libraries or APIs you need.",
- "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
- "Here are the user stories you must enable, and optional bonus user stories:",
- "User Story: As a user, I can see the weather in my current location.",
- "Bonus User Story: As a user, I can see an icon depending on the temperature..",
- "Bonus User Story: As a user, I see a different background image depending on the temperature (e.g. snowy mountain, hot desert).",
- "Bonus User Story: As a user, I can push a button to toggle between Fahrenheit and Celsius.",
- "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
- "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
- ],
- "challengeType": 3,
- "tests": []
- },
- {
- "_id": "bd7158d8c442eddfaeb5bd18",
- "name": "Zipline: Stylize Stories on Camper News",
- "difficulty": 1.04,
- "challengeSeed": "126415129",
- "description": [
- "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/GeoffStorbeck/full/Wveezv.",
- "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
- "Rule #2: You may use whichever libraries or APIs you need.",
- "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
- "Here are the user stories you must enable, and optional bonus user stories:",
- "User Story: As a user, I can browse recent posts from Camper News.",
- "User Story: As a user, I can click on a post to be taken to the story's original URL.",
- "User Story: As a user, I can click a link to go directly to the post's discussion page.",
- "Bonus User Story: As a user, I can see how many upvotes each story has.",
- "Hint: Here's the Camper News Hot Stories API endpoint: http://www.freecodecamp.com/stories/hotStories
.",
- "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
- "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
- ],
- "challengeType": 3,
- "tests": []
- },
- {
- "_id": "bd7158d8c442eddfaeb5bd19",
- "name": "Zipline: Wikipedia Viewer",
- "difficulty": 1.05,
- "challengeSeed": "126415131",
- "description": [
- "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/GeoffStorbeck/full/MwgQea.",
- "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
- "Rule #2: You may use whichever libraries or APIs you need.",
- "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
- "Here are the user stories you must enable, and optional bonus user stories:",
- "User Story: As a user, I can search Wikipedia entries in a search box and see the resulting Wikipedia entries.",
- "Bonus User Story:As a user, I can click a button to see a random Wikipedia entry.",
- "Bonus User Story:As a user, when I type in the search box, I can see a dropdown menu with autocomplete options for matching Wikipedia entries.",
- "Hint: Here's an entry on using Wikipedia's API: http://www.mediawiki.org/wiki/API:Main_page
.",
- "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
- "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
- ],
- "challengeType": 3,
- "tests": []
- },
- {
- "_id": "bd7158d8c442eddfaeb5bd0f",
- "name": "Zipline: Build a Pomodoro Clock",
- "difficulty": 1.06,
- "challengeSeed": "126411567",
- "description": [
- "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/GeoffStorbeck/full/RPbGxZ/.",
- "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
- "Rule #2: You may use whichever libraries or APIs you need.",
- "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
- "Here are the user stories you must enable, and optional bonus user stories:",
- "User Story: As a user, I can start a 25 minute pomodoro, and the timer will go off once 25 minutes has elapsed.",
- "Bonus User Story: As a user, I can reset the clock for my next pomodoro.",
- "Bonus User Story: As a user, I can customize the length of each pomodoro.",
- "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
- "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
- ],
- "challengeType": 3,
- "tests": []
- },
- {
- "_id": "bd7158d8c442eddfaeb5bd17",
- "name": "Zipline: Build a JavaScript Calculator",
- "difficulty": 1.07,
- "challengeSeed": "126411565",
- "description": [
- "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/GeoffStorbeck/full/zxgaqw.",
- "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
- "Rule #2: You may use whichever libraries or APIs you need.",
- "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
- "Here are the user stories you must enable, and optional bonus user stories:",
- "User Story: As a user, I can add, subtract, multiply and divide two numbers.",
- "Bonus User Story: I can clear the input field with a clear button.",
- "Bonus User Story: I can keep chaining mathematical operations together until I hit the clear button, and the calculator will tell me the correct output.",
- "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
- "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
- ],
- "challengeType": 3,
- "tests": []
- },
- {
- "_id": "bd7158d8c442eddfaeb5bd1c",
- "name": "Zipline: Build a Tic Tac Toe Game",
- "difficulty": 1.08,
- "challengeSeed": "126415123",
- "description": [
- "Objective: Build a CodePen.io that successfully reverse-engineers this: http://codepen.io/alex-dixon/full/JogOpQ/.",
- "Rule #1: Don't look at the example project's code. Figure it out for yourself.",
- "Rule #2: You may use whichever libraries or APIs you need.",
- "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.",
- "Here are the user stories you must enable, and optional bonus user stories:",
- "User Story: As a user, I can play a game of Tic Tac Toe with the computer.",
- "Bonus User Story: As a user, I can never actually win against the computer - at best I can tie.",
- "Bonus User Story: As a user, my game will reset as soon as it's over so I can play again.",
- "Bonus User Story: As a user, I can choose whether I want to play as X or O.",
- "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.",
- "If you'd like immediate feedback on your project, click this button and paste in a link to your CodePen project. Otherwise, we'll review it before you start your nonprofit projects.
Click here then add your link to your tweet's text"
- ],
- "challengeType": 3,
- "tests": []
- },
- {
- "_id": "bd7158d8c443eddfaeb5bcef",
- "name": "Get Set for Basejumps",
- "difficulty": 2.00,
- "challengeSeed": "128451852",
- "description": [
- "Objective: Get the MEAN stack running on Cloud 9, push your code to GitHub, and deploy it to Heroku.",
- "We'll build our Basejumps on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
- "If you don't already have Cloud 9 account, create one now at http://c9.io.",
- "Now let's get your development environment ready for a new Angular-Fullstack application provided by Yeoman.",
- "Open up http://c9.io and sign in to your account.",
- "Click on Create New Workspace at the top right of the c9.io page, then click on the \"Create a new workspace\" popup that appears below it the button after you click on it.",
- "Give your workspace a name.",
- "Choose Node.js in the selection area below the name field.",
- "Click the Create button.",
- "Wait for the workspace to finish processing and select it on the left sidebar, below the Create New Workspace button.",
- "Click the \"Start Editing\" button.",
- "In the lower right hand corner you should see a terminal window. In this window use the following commands. You don't need to know what these mean at this point.",
- "Never run this command on your local machine. But in your Cloud 9 terminal window, run: rm -rf * && echo \"export NODE_PATH=$NODE_PATH:/home/ubuntu/.nvm/v0.10.35/lib/node_modules\" >> ~/.bashrc && source ~/.bashrc && npm install -g yo grunt grunt-cli generator-angular-fullstack && yo angular-fullstack
",
- "Yeoman will prompt you to answer some questions. Answer them like this:",
- "What would you like to write scripts with? JavaScript",
- "What would you like to write markup with? HTML",
- "What would you like to write stylesheets with? CSS",
- "What Angular router would you like to use? ngRoute",
- "Would you like to include Bootstrap? Yes",
- "Would you like to include UI Bootstrap? Yes",
- "Would you like to use MongoDB with Mongoose for data modeling? Yes",
- "Would you scaffold out an authentication boilerplate? Yes",
- "Would you like to include additional oAuth strategies? Twitter",
- "Would you like to use socket.io? No",
- "May bower anonymously report usage statistics to improve the tool over time? (Y/n) Y",
- "You may get an error similar to ERR! EEXIST, open ‘/home/ubuntu/.npm
. This is caused when Cloud9 runs out of memory and kills an install. If you get this, simply re-run this process with the command yo angular-fullstack
. You will then be asked a few questions regarding the re-install. Answer them as follows:",
- "Existing .yo-rc configuration found, would you like to use it? (Y/n) Y",
- "Overwrite client/favicon.ico? (Ynaxdh) Y",
- "To finish the installation run the commands: bower install && npm install
",
- "To start MongoDB, run the following commands in your terminal: mkdir data && echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest \"$@\"' > mongod && chmod a+x mongod && ./mongod
",
- "You will want to open up a new terminal to work from by clicking on the + icon and select New Terminal",
- "Start the application by running the following command in your new terminal window: grunt serve
",
- "Wait for the following message to appear: xdg-open: no method available for opening 'http://localhost:8080'
. Now you can open the internal Cloud9 browser. To launch the browser select Preview in the toolbar then select the dropdown option Preview Running Application.",
- "Turn the folder in which your application is running into a Git repository by running the following commands: git init && git add . && git commit -am 'initial commit'
.",
- "Create a new Github repository by signing in to http://github.com and clicking on the + button next to your username in the upper-right hand side of your screen, then selecting \"New Repository\".",
- "Enter a project name, then click the \"Create Repository\" button.",
- "Find the \"...or push an existing repository from the command line\" section and click the Copy to Clipboard button beside it.",
- "Paste the commands from your clipboard into the Cloud9 terminal prompt. This will push your changes to your repository on Cloud 9 up to Github.",
- "Check back on your Github profile to verify the changes were successfully pushed up to Github.",
- "Now let's push your code to Heroku. If you don't already have a Heroku account, create one at http://heroku.com. You shouldn't be charged for anything, but you will need to add your credit card information to your Heroku before you will be able to use Heroku's free MongoLab add on.",
- "Before you publish to Heroku, you should free up as much memory as possible on Cloud9. In each of the Cloud9 terminal prompt tabs where MongoDB and Grunt are running, press the control + c
hotkey to shut down these processes.",
- "Run the following command in a Cloud9 terminal prompt tab: npm install grunt-contrib-imagemin --save-dev && npm install --save-dev && heroku login
. At this point, the terminal will prompt you to log in to Heroku from the command line.",
- "Now run yo angular-fullstack:heroku
. You can choose a name for your Heroku project, or Heroku will create a random one for you. You can choose whether you want to deploy to servers the US or the EU.",
- "Set the config flag for your Heroku environment and add MongoLab for your MongoDB instance by running the following command: cd ~/workspace/dist && heroku config:set NODE_ENV=production && heroku addons:add mongolab
.",
- "As you build your app, you should frequently commit changes to your codebase. Make sure you're in the ~/workspace
directory by running cd ~/workspace
. Then you can this code to stage the changes to your changes and commit them: git commit -am \"your commit message\"
. Note that you should replace \"your commit message\" with a short summary of the changes you made to your code, such as \"added a records controller and corresponding routes\".",
- "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,
- "tests": []
- },
- {
- "_id": "bd7158d8c443eddfaeb5bdef",
- "name": "Basejump: Build a Voting App",
- "difficulty": 2.01,
- "challengeSeed": "128451852",
- "description": [
- "Objective: Build a full stack JavaScript app that successfully reverse-engineers this: http://voteplex.herokuapp.com/ and deploy it to Heroku.",
- "Note that for each Basejump, you should create a new GitHub repository and a new Heroku project. If you can't remember how to do this, revisit http://freecodecamp.com/challenges/get-set-for-basejumps.",
- "As you build your app, you should frequently commit changes to your codebase. You can do this by running git commit -am \"your commit message\"
. Note that you should replace \"your commit message\" with a brief summary of the changes you made to your code.",
- "You can push these new commits to Github by running git push origin master
, and to Heroku by running grunt --force && grunt buildcontrol:heroku
.",
- "Here are the specific User Stories you should implement for this Basejump:",
- "User Story: As an authenticated user, I can keep my polls and come back later to access them.",
- "User Story: As an authenticated user, I can share my polls with my friends.",
- "User Story: As an authenticated user, I can see the aggregate results of my polls.",
- "User Story: As an authenticated user, I can delete polls that I decide I don't want anymore.",
- "User Story: As an authenticated user, I can create a poll with any number of possible items.",
- "Bonus User Story: As an unauthenticated user, I can see everyone's polls, but I can't vote on anything.",
- "Bonus User Story: As an unauthenticated or authenticated user, I can see the results of polls in chart form. (This could be implemented using Chart.js or Google Charts.)",
- "Bonus User Story: As an authenticated user, if I don't like the options on a poll, I can create a new option.",
- "Once you've finished implementing these user stories, 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.",
- "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": []
- },
- {
- "_id": "bd7158d8c443eddfaeb5bdff",
- "name": "Basejump: Build a Nightlife Coordination App",
- "difficulty": 2.02,
- "challengeSeed": "128451852",
- "description": [
- "Objective: Build a full stack JavaScript app that successfully reverse-engineers this: http://sociallife.herokuapp.com/ and deploy it to Heroku.",
- "Note that for each Basejump, you should create a new GitHub repository and a new Heroku project. If you can't remember how to do this, revisit http://freecodecamp.com/challenges/get-set-for-basejumps.",
- "As you build your app, you should frequently commit changes to your codebase. You can do this by running git commit -am \"your commit message\"
. Note that you should replace \"your commit message\" with a brief summary of the changes you made to your code.",
- "You can push these new commits to Github by running git push origin master
, and to Heroku by running grunt --force && grunt buildcontrol:heroku
.",
- "Here are the specific User Stories you should implement for this Basejump:",
- "User Story: As an unauthenticated user, I can view all bars in my area.",
- "User Story: As an authenticated user, I can add myself to a bar to indicate I am going there tonight.",
- "User Story: As an authenticated user, I can remove myself from a bar if I no longer want to go there.",
- "Bonus User Story: As an unauthenticated user, when I login I should not have to search again.",
- "Once you've finished implementing these user stories, 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.",
- "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": []
- },
- {
- "_id": "bd7158d8c443eddfaeb5bd0e",
- "name": "Basejump: Chart the Stock Market",
- "difficulty": 2.03,
- "challengeSeed": "128451852",
- "description": [
- "Objective: Build a full stack JavaScript app that successfully reverse-engineers this: http://stockjump.herokuapp.com/ and deploy it to Heroku.",
- "Note that for each Basejump, you should create a new GitHub repository and a new Heroku project. If you can't remember how to do this, revisit http://freecodecamp.com/challenges/get-set-for-basejumps.",
- "As you build your app, you should frequently commit changes to your codebase. You can do this by running git commit -am \"your commit message\"
. Note that you should replace \"your commit message\" with a brief summary of the changes you made to your code.",
- "You can push these new commits to Github by running git push origin master
, and to Heroku by running grunt --force && grunt buildcontrol:heroku
.",
- "Here are the specific User Stories you should implement for this Basejump:",
- "User Story: As a user, I can view a graph displaying the recent trend lines for each added stock.",
- "User Story: As a user, I can add new stocks by their symbol name.",
- "User Story: As a user, I can remove stocks.",
- "Bonus User Story: As a user, I can see changes in real-time when any other user adds or removes a stock.",
- "Once you've finished implementing these user stories, 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.",
- "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": []
- },
- {
- "_id": "bd7158d8c443eddfaeb5bd0f",
- "name": "Basejump: Manage a Book Trading Club",
- "difficulty": 2.04,
- "challengeSeed": "128451852",
- "description": [
- "Objective: Build a full stack JavaScript app that successfully reverse-engineers this: http://bookoutpost.herokuapp.com/ and deploy it to Heroku.",
- "Note that for each Basejump, you should create a new GitHub repository and a new Heroku project. If you can't remember how to do this, revisit http://freecodecamp.com/challenges/get-set-for-basejumps.",
- "As you build your app, you should frequently commit changes to your codebase. You can do this by running git commit -am \"your commit message\"
. Note that you should replace \"your commit message\" with a brief summary of the changes you made to your code.",
- "You can push these new commits to Github by running git push origin master
, and to Heroku by running grunt --force && grunt buildcontrol:heroku
.",
- "Here are the specific User Stories you should implement for this Basejump:",
- "User Story: As an authenticated user, I can view all books posted by every user.",
- "User Story: As an authenticated user, I can add a new book.",
- "User Story: As an authenticated user, I can update my settings to store my full name, city, and state.",
- "Bonus User Story: As an authenticated user, I can propose a trade and wait for the other user to accept the trade.",
- "Once you've finished implementing these user stories, 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.",
- "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": []
- },
- {
- "_id": "bd7158d8c443eddfaeb5bdee",
- "name": "Basejump: Build a Pinterest Clone",
- "difficulty": 2.05,
- "challengeSeed": "128451852",
- "description": [
- "Objective: Build a full stack JavaScript app that successfully reverse-engineers this: http://linkterest.herokuapp.com/ and deploy it to Heroku.",
- "Note that for each Basejump, you should create a new GitHub repository and a new Heroku project. If you can't remember how to do this, revisit http://freecodecamp.com/challenges/get-set-for-basejumps.",
- "As you build your app, you should frequently commit changes to your codebase. You can do this by running git commit -am \"your commit message\"
. Note that you should replace \"your commit message\" with a brief summary of the changes you made to your code.",
- "You can push these new commits to Github by running git push origin master
, and to Heroku by running grunt --force && grunt buildcontrol:heroku
.",
- "Here are the specific User Stories you should implement for this Basejump:",
- "User Story: As an unauthenticated user, I can login with Twitter.",
- "User Story: As an authenticated user, I can link to images.",
- "User Story: As an authenticated user, I can delete images that I've linked to.",
- "User Story: As an authenticated user, I can see a Pinterest-style wall of all the images I've linked to.",
- "User Story: As an unauthenticated user, I can browse other users' walls of images.",
- "Bonus User Story: As an authenticated user, if I upload an image that is broken, it will be replaced by a placeholder image. (can use jQuery broken image detection)",
- "Hint: Masonry.js is a library that allows for Pinterest-style image grids.",
- "Once you've finished implementing these user stories, 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.",
- "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": []
- }
-]
diff --git a/seed_data/field-guides.json b/seed_data/field-guides.json
index 9fb9b0f585..3938e8a901 100644
--- a/seed_data/field-guides.json
+++ b/seed_data/field-guides.json
@@ -17,7 +17,7 @@
"",
" We're a community of busy people who learn to code by building projects for nonprofits.
",
" We help our campers (students):
",
- " ",
+ "
",
"
",
" - Learn full stack JavaScript
",
" - Build a portfolio of real apps that real people are using
",
@@ -34,13 +34,13 @@
"",
" Learning to code is hard.
",
" Most people who successfully learn to code:
",
- " ",
+ "
",
"
",
" - Make friends with people who code
",
" - Code a little every day
",
"
",
" ",
- " We give you the structure and the community you need so you can successfully learn to code.
",
+ " We give you the structure and the community you need so you can successfully learn to code.
",
""
]
},
@@ -50,7 +50,7 @@
"description": [
"",
" Our main advantage is that we're accessible to busy adults who want to change careers. Specifically, we're:
",
- " ",
+ "
",
"
",
" - • Free
",
" - • Self-paced
",
@@ -89,7 +89,7 @@
" If you complete this program, you will be able to get a coding job. Many of our campers have already gotten coding jobs.
",
"
",
" Here are the facts:
",
- " ",
+ "
",
"
",
" - • There are hundreds of thousands of unfilled coding jobs.
",
" - • Employers and the US government have joined together to promote nontraditional coding programs like Free Code Camp.
",
@@ -106,7 +106,7 @@
"description": [
"",
" First, you'll learn basic web design tools like:
",
- " ",
+ "
",
"
",
" - • HTML - the structure of web pages
",
" - • CSS - the visual style of web pages
",
@@ -116,14 +116,14 @@
"
",
" ",
" Then you'll learn computer science and the art of programming:
",
- " ",
+ "
",
"
",
" - • JavaScript - the one programming language that all web browsers use
",
" - • Algorithms - step-by-step recipes for getting things done
",
"
",
" ",
" Finally you'll learn Agile Methodologies and Full Stack JavaScript to build projects for nonprofits:
",
- " ",
+ "
",
"
",
" - • Agile - a set of software development principles that focus the design and production of a project on the needs of its users
",
" - • Git - a version control system for saving and sharing your projects
",
@@ -142,7 +142,7 @@
"description": [
"",
" It takes about 1,600 hours of coding to develop the skills you'll need to get an entry level software engineering job.
",
- " Most coding bootcamps try to jam all this into 3 or 4 months of intensive study. Free Code Camp is fully online, and there will always be other people at your skill level that you can pair program with, so you can learn at your own pace. Here are some example coding schedules:
",
+ " Most coding bootcamps try to jam all this into 3 or 4 months of intensive study. Free Code Camp is fully online, and there will always be other people at your skill level that you can pair program with, so you can learn at your own pace. Here are some example coding schedules:
",
" ",
" ",
" Time budgeted ",
@@ -178,9 +178,9 @@
"name": "Why does Free Code Camp use JavaScript instead of Ruby or Python?",
"description": [
"",
- " Like JavaScript, Ruby and Python are high-level scripting languages that can be used for full stack web development.
",
- " But even if you learned these languages, you'd still need to learn JavaScript. That's because JavaScript is the only language that runs in web browsers. JavaScript has been around for 20 years, and it is still growing in popularity.
",
- " Because of this, JavaScript has more tools and online learning resources than any other language.
",
+ " Like JavaScript, Ruby and Python are high-level scripting languages that can be used for full stack web development.
",
+ " But even if you learned these languages, you'd still need to learn JavaScript. That's because JavaScript is the only language that runs in web browsers. JavaScript has been around for 20 years, and it is still growing in popularity.
",
+ " Because of this, JavaScript has more tools and online learning resources than any other language.
",
"
",
"
",
""
@@ -193,8 +193,8 @@
"",
" Pair programming is where two people code together on one computer.
",
"
",
- " You discuss different approaches to solving problems, and keep each other motivated. The result is better code than either of you could have written by yourselves. Because of its benefits, many engineers pair program full time. And it's the best way to learn coding. Thanks to tools that allow two people to share mouse and keyboard inputs, you can pair program with a friend without needing to be in the same room.
",
- " By pair programming with other Free Code Camp students on our coding challenges. Eventually, you'll work with people at nonprofits to build real-life software solutions.
",
+ " You discuss different approaches to solving problems, and keep each other motivated. The result is better code than either of you could have written by yourselves. Because of its benefits, many engineers pair program full time. And it's the best way to learn coding. Thanks to tools that allow two people to share mouse and keyboard inputs, you can pair program with a friend without needing to be in the same room.
",
+ " By pair programming with other Free Code Camp students on our coding challenges. Eventually, you'll work with people at nonprofits to build real-life software solutions.
",
""
]
},
@@ -204,7 +204,7 @@
"description": [
"",
" When you get stuck, remember: RSAP.
",
- " ",
+ "
",
"
",
" - Read the documentation or error
",
" - Search Google
",
@@ -212,11 +212,11 @@
" - Post on Stack Overflow
",
"
",
" ",
- " This is the most time-efficient way to handle being stuck, and it's the most respectful of other people's time, too.
",
- " Most of the time, you'll solve your problem after just one or two steps of this algorithm.
",
- " We have a special chat room just for getting help: https://freecode.slack.com/messages/help/
",
- " Also, if you need to post on Stack Overflow, be sure to read their guide to asking good questions: http://stackoverflow.com/help/how-to-ask.
",
- " Learning to code is hard. But it's a lot easier if you ask for help when you need it!
",
+ " This is the most time-efficient way to handle being stuck, and it's the most respectful of other people's time, too.
",
+ " Most of the time, you'll solve your problem after just one or two steps of this algorithm.
",
+ " We have a special chat room just for getting help: https://freecode.slack.com/messages/help/
",
+ " Also, if you need to post on Stack Overflow, be sure to read their guide to asking good questions: http://stackoverflow.com/help/how-to-ask.
",
+ " Learning to code is hard. But it's a lot easier if you ask for help when you need it!
",
""
]
},
@@ -226,8 +226,8 @@
"description": [
"",
" This guide was designed as a reference for you. You shouldn't try to read it all today.
",
- " Feel free to come back any time and jump around, reading any articles that seem interesting to you at the time.
",
- " If you're currently doing our \"Browse our Field Guide\" Waypoint, go ahead and mark that challenge complete and move on to your next Waypoint.
",
+ " Feel free to come back any time and jump around, reading any articles that seem interesting to you at the time.
",
+ " If you're currently doing our \"Browse our Field Guide\" Waypoint, go ahead and mark that challenge complete and move on to your next Waypoint.
",
""
]
},
@@ -237,9 +237,9 @@
"description": [
"",
" We are completely free for both students and for nonprofits.
",
- " Our name is Free Code Camp. We are a free code camp. If you had to pay us (or sign over future earnings), we'd have to change our name. And we are not going to do that.
",
- " Everyone working on our community and our open source projects is a volunteer.
",
- " We plan to eventually cover our operational costs by earning job placement bonuses from companies who hire our graduates. Note that we will not actually garnish any wages from our graduates - employers are already paying recruiters thousands of dollars to find successful candidates. Employers will simply pay the recruitment bonus to Free Code Camp instead of paying a recruiter.
",
+ " Our name is Free Code Camp. We are a free code camp. If you had to pay us (or sign over future earnings), we'd have to change our name. And we are not going to do that.
",
+ " Everyone working on our community and our open source projects is a volunteer.
",
+ " We plan to eventually cover our operational costs by earning job placement bonuses from companies who hire our graduates. Note that we will not actually garnish any wages from our graduates - employers are already paying recruiters thousands of dollars to find successful candidates. Employers will simply pay the recruitment bonus to Free Code Camp instead of paying a recruiter.
",
""
]
},
@@ -249,8 +249,8 @@
"description": [
"",
" Unlike coding bootcamps, anyone can study at Free Code Camp.
",
- " We're not going to tell you that you can't become a software engineer. We believe the only person who should be able to tell you that is you.
",
- " If you persevere, and keep working through our challenges and nonprofit projects, you will become an employable software engineer.
",
+ " We're not going to tell you that you can't become a software engineer. We believe the only person who should be able to tell you that is you.
",
+ " If you persevere, and keep working through our challenges and nonprofit projects, you will become an employable software engineer.
",
""
]
},
@@ -260,17 +260,17 @@
"description": [
"",
" If you're interested in coding JavaScript live in front of dozens of people on our popular twitch.tv channel, we'd love to have you.
",
- "Please follow these steps to get started:
",
- " ",
+ "
Please follow these steps to get started:
",
+ " ",
"
",
" - Follow this tutorial to set up your computer for streaming.
",
" - Contact Jason Ruekert - he's @jsonify in Slack. He's in charge of our Twitch.tv channel. Tell him what you'd like to stream, and when you're available to stream.
",
" - Jason will pair with you using Screen Hero to verify your computer is configured properly to stream.
",
"
",
" ",
- " Be respectful of your audience. Everything you stream should be related to coding JavaScript, and should be acceptable for children. (Yes, children do sometimes watch our Twitch stream to learn to code).
",
- " While you're streaming, keep the chat room open so you can respond to questions from your viewers. If someone follows Free Code Camp on Twitch, try to thank them.
",
- " If you do a good job, we'll invite you back to stream some more. Who knows, you might become one of our regular streamers!
",
+ " Be respectful of your audience. Everything you stream should be related to coding JavaScript, and should be acceptable for children. (Yes, children do sometimes watch our Twitch stream to learn to code).
",
+ " While you're streaming, keep the chat room open so you can respond to questions from your viewers. If someone follows Free Code Camp on Twitch, try to thank them.
",
+ " If you do a good job, we'll invite you back to stream some more. Who knows, you might become one of our regular streamers!
",
""
]
},
@@ -389,7 +389,7 @@
" ",
" ",
" If you didn't see your city on this list, you should create your own Facebook group for your city. Please follow these steps:
",
- " ",
+ "
",
"
",
" - Sign in to Facebook.
",
" - Click the down arrow in the upper right corner of the screen, then choose \"Create Group\" from the options.",
@@ -417,8 +417,8 @@
"
- Join our #local-group-leaders channel on Slack, where we share ideas about involving campers in your city.
",
"
",
" ",
- " If you don't have a Facebook page, we strongly recommend you create one, even if it's just for the purpose of coordinating with campers in your city through this group.
",
- " If Facebook is blocked in your country, feel free to use social network with a similar group functionality that's popular in your region.
",
+ " If you don't have a Facebook page, we strongly recommend you create one, even if it's just for the purpose of coordinating with campers in your city through this group.
",
+ " If Facebook is blocked in your country, feel free to use social network with a similar group functionality that's popular in your region.
",
""
]
},
@@ -431,6 +431,20 @@
""
]
},
+ {
+ "_id": "bd7158d9c442eddfaeb5b2ef",
+ "name": "Why doesn't Free Code Camp teach technical interviewing skills?",
+ "description": [
+ "",
+ " The skills you need to successfully interview for a job are quite different from the skills you'll need on the job.
",
+ " More and more employers are moving to a pair-programming-centric interview style. If you apply to these places, you don't need to make special preparations your interview - just pair program like you would on any Free Code Camp project.
",
+ " If you intend to apply for a job at a larger tech company like Apple, Microsoft, Google, Facebook or Amazon, you can prepare for your interviews by simply working through this single authoritative book. Many of the questions you'll be asked during your interviews will come straight out of this book, which is standard-issue in Silicon Valley.
",
+ "
",
+ " You can download the 4th edition of this book in PDF form for free here or buy the 5th edition of the book here.",
+ "
We may focus more on interview preparation in the future if we determine that it's necessary. In the mean time, Free Code Camp will continue to focus skills that are directly related to becoming a job-ready software engineer.",
+ "
"
+ ]
+ },
{
"_id": "bd7158d9c442eddfaeb5bdef",
"name": "How do I best use the Global Control Shortcuts for Mac?",
@@ -438,8 +452,8 @@
"",
" These Global Control Shortcuts for Mac will save you hours by speeding up your typing.
",
" ",
- " These global shortcuts work everywhere on a Mac:
",
- " ",
+ "
These global shortcuts work everywhere on a Mac:
",
+ " ",
"
",
" - Control + F = Forward
",
" - Control + B = Backward
",
@@ -464,8 +478,8 @@
" ",
- " The shortcuts:
",
- " ",
+ "
The shortcuts:
",
+ " ",
"
",
" - j - move down
",
" - k - move up
",
@@ -492,8 +506,8 @@
" ",
- " Here are the technologies we used here:
",
- " ",
+ "
Here are the technologies we used here:
",
+ " ",
"
",
" - atom.io - a free code editor
",
" - startbootstrap.com - a collection of free responsive (Bootstrap) templates
",
@@ -501,7 +515,7 @@
" - bitballoon.com - a tool for drag and drop website deployment
",
"
",
" ",
- " You will quickly reach the limits of what you can do without actually coding, but it's nice to be able to rapidly build working prototype websites like this.
",
+ " You will quickly reach the limits of what you can do without actually coding, but it's nice to be able to rapidly build working prototype websites like this.
",
"
"
]
},
@@ -510,15 +524,15 @@
"name": "How do Free Code Camp's Nonprofit Projects work?",
"description": [
"",
- " Building nonprofit projects is the main way that our campers learn full stack JavaScript and agile software development. Once you complete the Free Code Camp Waypoints, Bonfires, Ziplines and Basejumps, you'll begin this process.
",
+ " Building nonprofit projects is the main way that our campers learn full stack JavaScript and agile software development. Once you complete the Free Code Camp Waypoints, Bonfires, Ziplines and Basejumps, you'll begin this process.
",
" Starting with the end in mind
",
- " Our goal at Free Code Camp is to help you land a job as a junior software developer (or, if you prefer, a 'pivot job' that leads your current career in a more technical direction).
",
- " You'll continue to work on nonprofit projects until you've built a sufficiently impressive portfolio and references to start your job search. Your portfolio will ultimately have three to five nonprofit projects. We estimate that the 900 hours of nonprofit projects you're going to complete, in addition to the 100 hours of challenges you've already completed, will be enough to qualify you for your first coding job. This will produce a much broader portfolio than a traditional coding bootcamp, which generally only has one or two capstone projects.
",
+ " Our goal at Free Code Camp is to help you land a job as a junior software developer (or, if you prefer, a 'pivot job' that leads your current career in a more technical direction).
",
+ " You'll continue to work on nonprofit projects until you've built a sufficiently impressive portfolio and references to start your job search. Your portfolio will ultimately have three to five nonprofit projects. We estimate that the 900 hours of nonprofit projects you're going to complete, in addition to the 100 hours of challenges you've already completed, will be enough to qualify you for your first coding job. This will produce a much broader portfolio than a traditional coding bootcamp, which generally only has one or two capstone projects.
",
" Choosing your first Nonprofit Project
",
- " We've categorized all the nonprofit projects by estimated time investment per camper: 100 hours, 200 hours, and 300 hours. These are only rough estimates.
",
- " Example: if you and the camper you're paired up with (your pair) each stated you could work 20 hours per week. If the project is a 100 hour per camper project, you should be able to complete it in about 5 weeks.
",
- " Our team of nonprofit project camp counselors will match you and your pair based on:
",
- " ",
+ "
We've categorized all the nonprofit projects by estimated time investment per camper: 100 hours, 200 hours, and 300 hours. These are only rough estimates.
",
+ " Example: if you and the camper you're paired up with (your pair) each stated you could work 20 hours per week. If the project is a 100 hour per camper project, you should be able to complete it in about 5 weeks.
",
+ " Our team of nonprofit project camp counselors will match you and your pair based on:
",
+ " ",
"
",
" - Your estimated time commitment (10, 20 or 40 hours per week)
",
" - Your time zone
",
@@ -526,11 +540,11 @@
" - Prior coding experience (we'd like both campers to be able to contribute equally)
",
"
",
" ",
- " We won't take age or gender into account. This will provide you with valuable experience in meshing with diverse teams, which is a reality of the contemporary workplace.
",
- " You'll only work on one project at a time. Once you start a nonprofit project, we'll remove you from all other nonprofit project you've expressed interest in. There's a good chance those projects will no longer be available when you finish your current project, anyway. Don't worry, though - we get new nonprofit project requests every day, so there will be plenty more projects for you to consider after you finish your current one.
",
+ " We won't take age or gender into account. This will provide you with valuable experience in meshing with diverse teams, which is a reality of the contemporary workplace.
",
+ " You'll only work on one project at a time. Once you start a nonprofit project, we'll remove you from all other nonprofit project you've expressed interest in. There's a good chance those projects will no longer be available when you finish your current project, anyway. Don't worry, though - we get new nonprofit project requests every day, so there will be plenty more projects for you to consider after you finish your current one.
",
" Finalizing the Project
",
- " Before you can start working on the project, our team of Nonprofit Project Coordinators will go through the following process:
",
- " ",
+ "
Before you can start working on the project, our team of Nonprofit Project Coordinators will go through the following process:
",
+ " ",
"
",
" - We'll wait until there are two campers who have chosen the same project and look like they're a good match for one another based on the factors mentioned above.
",
" - We'll call the stakeholder to confirm once again that he or she agrees with our terms and has signed our Nonprofit Project Stakeholder Pledge.
",
@@ -538,27 +552,27 @@
" - If the stakeholder and both campers shows up promptly, and seem enthusiastic and professional, we'll start the project.
",
"
",
" ",
- " This lengthy process serves an important purpose: it reduces the likelihood that any of our campers or stakeholders will waste their precious time.
",
+ " This lengthy process serves an important purpose: it reduces the likelihood that any of our campers or stakeholders will waste their precious time.
",
" Nonprofit Stakeholders
",
- " Each nonprofit project was submitted by a nonprofit. A representative from this nonprofit has agreed to serve as a \"stakeholder\" - an authorative person who understands the organization and its needs for this particular project.
",
- " Stakeholders have a deep understanding of their organizations' needs. Campers will work with them to figure out the best solutions to these needs.
",
- " When you and your pair first speak with your nonprofit stakeholder, you'll:
",
- " ",
+ "
Each nonprofit project was submitted by a nonprofit. A representative from this nonprofit has agreed to serve as a \"stakeholder\" - an authorative person who understands the organization and its needs for this particular project.
",
+ " Stakeholders have a deep understanding of their organizations' needs. Campers will work with them to figure out the best solutions to these needs.
",
+ " When you and your pair first speak with your nonprofit stakeholder, you'll:
",
+ " ",
"
",
" - talk at length to better understand their needs.
",
" - create a new Trello board and use it to prioritize what needs to be built.
",
" - and establish deadlines based on your weekly time commitment, and how long you think each task will take.
",
"
",
" ",
- " It's notoriously difficult to estimate how long building software projects will take, so feel free to ask camp counselors for help.
",
- " You'll continue to meet with your stakeholder at least twice a month in your project's Slack channel.
",
- " You should also ask questions in your project's Slack channel as they come up throughout the week, and your stakeholder can answer them asynchronously.
",
- " Getting \"blocked\" on a task can take away your sense of forward momentum, so be sure to proactively seek answers to any ambiguities you encounter.
",
- " Ultimately, the project will be considered complete once both the stakeholder's needs have been met, and you and your pair are happy with the project. Then you can add it to your portfolio!
",
+ " It's notoriously difficult to estimate how long building software projects will take, so feel free to ask camp counselors for help.
",
+ " You'll continue to meet with your stakeholder at least twice a month in your project's Slack channel.
",
+ " You should also ask questions in your project's Slack channel as they come up throughout the week, and your stakeholder can answer them asynchronously.
",
+ " Getting \"blocked\" on a task can take away your sense of forward momentum, so be sure to proactively seek answers to any ambiguities you encounter.
",
+ " Ultimately, the project will be considered complete once both the stakeholder's needs have been met, and you and your pair are happy with the project. Then you can add it to your portfolio!
",
" Working with your Pair
",
- " You and your pair will pair program (code together on the same computer virtually) about half of the time, and work independently the other half of the time.
",
- " Here are our recommended ways of collaborating:
",
- " ",
+ "
You and your pair will pair program (code together on the same computer virtually) about half of the time, and work independently the other half of the time.
",
+ " Here are our recommended ways of collaborating:
",
+ " ",
"
",
" - • Slack has robust private messaging functionality. It's the main way our team communicates, and we recommend it over email.
",
" - • Trello is great for managing projects. Work with your stakeholder to create Trello cards, and update these cards regularly as you make progress on them.
",
@@ -567,15 +581,15 @@
"
",
" ",
" Hosting Apps
",
- " Unless your stakeholder has an existing modern host (AWS, Digital Ocean), you'll need to transition them over to a new platform. We believe Heroku is the best choice for a vast majority of web projects. It's free, easy to use, and has both browser and command line interfaces. It's owned by Salesforce and used by a ton of companies, so it's accountable and unlikely to go away.
",
- " If you need help convincing your stakeholder that Heroku is the ideal platform, we'll be happy to talk with them.
",
+ " Unless your stakeholder has an existing modern host (AWS, Digital Ocean), you'll need to transition them over to a new platform. We believe Heroku is the best choice for a vast majority of web projects. It's free, easy to use, and has both browser and command line interfaces. It's owned by Salesforce and used by a ton of companies, so it's accountable and unlikely to go away.
",
+ " If you need help convincing your stakeholder that Heroku is the ideal platform, we'll be happy to talk with them.
",
" Maintaining Apps
",
- " Once you complete a nonprofit project, your obligation to its stakeholder is finished. You goal is to leave behind a well documented solution that can be easily maintained by a contract JavaScript developer (or even a less-technical \"super user\").
",
- " While you will no longer need to help with feature development, we encourage you to consider helping your stakeholder with occasional patches down the road. After all, this project will be an important piece of your portfolio, and you'll want it to remain in good shape for curious future employers.
",
+ " Once you complete a nonprofit project, your obligation to its stakeholder is finished. You goal is to leave behind a well documented solution that can be easily maintained by a contract JavaScript developer (or even a less-technical \"super user\").
",
+ " While you will no longer need to help with feature development, we encourage you to consider helping your stakeholder with occasional patches down the road. After all, this project will be an important piece of your portfolio, and you'll want it to remain in good shape for curious future employers.
",
" Pledging to finish the project
",
- " Your nonprofit stakeholder, your pair, and the volunteer camp counselor team are all counting on you to finish your nonprofit project. If you walk away from an unfinished nonprofit project, you'll become ineligible to ever be assigned another one.
",
- " To confirm that you understand the seriousness of this commitment, we require that all campers sign this pledge before starting on their nonprofit projects.
",
- " There will likely be times of confusion or frustration. This is normal in software development. The most important thing is that you do not give up and instead persevere through these setbacks. As Steve Jobs famously said, \"Real artists ship.\" And you are going to ship one successful nonprofit project after another until you feel ready to take the next step in your promising career.
",
+ " Your nonprofit stakeholder, your pair, and the volunteer camp counselor team are all counting on you to finish your nonprofit project. If you walk away from an unfinished nonprofit project, you'll become ineligible to ever be assigned another one.
",
+ " To confirm that you understand the seriousness of this commitment, we require that all campers sign this pledge before starting on their nonprofit projects.
",
+ " There will likely be times of confusion or frustration. This is normal in software development. The most important thing is that you do not give up and instead persevere through these setbacks. As Steve Jobs famously said, \"Real artists ship.\" And you are going to ship one successful nonprofit project after another until you feel ready to take the next step in your promising career.
",
""
]
},
@@ -586,7 +600,7 @@
"",
" Download for Mac
",
" Download for Windows
",
- " You'll use Screen Hero to pair program starting with http://freecodecamp.com/challenges/pair-program-on-bonfires
",
+ " You'll use Screen Hero to pair program starting with http://freecodecamp.com/challenges/pair-program-on-bonfires
",
""
]
},
@@ -596,7 +610,7 @@
"description": [
"",
" Writing Bonfire challenges is a great way to exercise your own problem solving and testing abilities. Follow this process closely to maximize the chances of us accepting your bonfire.
",
- " ",
+ "
",
"
",
" - Fork the Free Code Camp repository and
open seed_data/bonfires.json
to become familiar with the format of our bonfires. ",
" - Regardless of your bonfire's difficulty, put it as the last bonfire in the JSON file. Change one of the numbers in the ID to ensure that your bonfire has a unique ID.
",
@@ -607,21 +621,21 @@
" ",
" Here is a description of each of the Bonfires' fields.
",
" Name
",
- " The name of your challenge. It's OK for this to be humorous but it must be brief and relevant to the task.
",
+ " The name of your challenge. It's OK for this to be humorous but it must be brief and relevant to the task.
",
" Difficulty
",
- " Attempt to rate difficulty compared against existing bonfire challenges. A good proxy for the difficulty of a bonfire is how long it takes you to solve it. For every 15 minutes it takes, increase the difficulty. For example, a one-hour bonfire should probably be a 4.
",
+ " Attempt to rate difficulty compared against existing bonfire challenges. A good proxy for the difficulty of a bonfire is how long it takes you to solve it. For every 15 minutes it takes, increase the difficulty. For example, a one-hour bonfire should probably be a 4.
",
" Description
",
- " Separate paragraphs with a line break. Only the first paragraph is visible prior to a user before they click the the 'More information' button.
",
- " All necessary information must be included in the first paragraph. Write this first paragraph as succinctly as possible. Subsequent paragraphs should offer hints or details if needed.
",
- " If your subject matter warrants deeper understanding, you may link to Wikipedia.
",
+ " Separate paragraphs with a line break. Only the first paragraph is visible prior to a user before they click the the 'More information' button.
",
+ " All necessary information must be included in the first paragraph. Write this first paragraph as succinctly as possible. Subsequent paragraphs should offer hints or details if needed.
",
+ " If your subject matter warrants deeper understanding, you may link to Wikipedia.
",
" Challenge Seed
",
- " This is where you set up what will be in the editor when the camper starts the bonfire.
",
+ " This is where you set up what will be in the editor when the camper starts the bonfire.
",
" Tests
",
- " These tests are what bring your challenge to life. Without them, we cannot confirm the accuracy of a user's submitted answer. Choose your tests wisely.
",
- " Bonfire tests are written using the Chai.js assertion library. Please use the should and expect syntax for end user readability. As an example of what not do to, many of the original Bonfire challenges are written with assert syntax and many of the test cases are difficult to read.
",
- " If your bonfire question has a lot of edge cases, you will need to write many tests for full coverage. If you find yourself writing more tests than you desire, you may consider simplifying the requirements of your bonfire challenge. For difficulty level 1 through 3, you will generally only need 2 to 4 tests.
",
+ " These tests are what bring your challenge to life. Without them, we cannot confirm the accuracy of a user's submitted answer. Choose your tests wisely.
",
+ " Bonfire tests are written using the Chai.js assertion library. Please use the should and expect syntax for end user readability. As an example of what not do to, many of the original Bonfire challenges are written with assert syntax and many of the test cases are difficult to read.
",
+ " If your bonfire question has a lot of edge cases, you will need to write many tests for full coverage. If you find yourself writing more tests than you desire, you may consider simplifying the requirements of your bonfire challenge. For difficulty level 1 through 3, you will generally only need 2 to 4 tests.
",
" MDNlinks
",
- " Take a look at seed_data/bonfireMDNlinks.js
. If any of these concepts are relevant to your bonfire, be sure to include them. If you know of an MDN article that isn't linked here, you can add it to the bonfireMDNlinks.js file before adding it to your bonfire.
",
+ " Take a look at seed_data/bonfireMDNlinks.js
. If any of these concepts are relevant to your bonfire, be sure to include them. If you know of an MDN article that isn't linked here, you can add it to the bonfireMDNlinks.js file before adding it to your bonfire.
",
"
"
]
},
@@ -631,21 +645,21 @@
"description": [
"",
" Free Code Camp is friendly place to learn to code. We're committed to keeping it that way.
",
- " All campers are required to agree with the following code of conduct. We'll enforce this code. We're expecting cooperation from all campers in ensuring a friendly environment for everybody.
",
+ " All campers are required to agree with the following code of conduct. We'll enforce this code. We're expecting cooperation from all campers in ensuring a friendly environment for everybody.
",
" In short: be nice to your fellow campers.
",
" Remember these 3 things and your fellow campers will like you:
",
- " ",
+ "
",
"
",
" - Compliment your fellow campers when they do good work. Congratulate them when they accomplish something (like finishing a nonprofit project or getting a job).
",
" - Critique the work, not the camper doing it.
",
" - Only argue about something if it's important to the greater discussion.
",
"
",
" ",
- " Free Code Camp should be a harassment-free experience for everyone, regardless of gender, gender identity and expression, age, sexual orientation, disability, physical appearance, body size, race, national origin, or religion (or lack thereof).
",
- " We do not tolerate harassment of campers in any form, anywhere on Free Code Camp's online media (Slack, Twitch, etc.) or during pair programming. Harassment includes sexual language and imagery, deliberate intimidation, stalking, unwelcome sexual attention, libel, and any malicious hacking or social engineering.
",
- " If a camper engages in harassing behavior, our team will take any action we deem appropriate, up to and including banning them from Free Code Camp.
",
- " We want everyone to feel safe and respected. If you are being harassed or notice that someone else is being harassed, say something! Message @quincylarson, @terakilobyte and @codenonprofit in Slack (preferably with a screen shot of the offending language) so we can take fast action.
",
- " If you have questions about this code of conduct, email us at team@freecodecamp.com.
",
+ " Free Code Camp should be a harassment-free experience for everyone, regardless of gender, gender identity and expression, age, sexual orientation, disability, physical appearance, body size, race, national origin, or religion (or lack thereof).
",
+ " We do not tolerate harassment of campers in any form, anywhere on Free Code Camp's online media (Slack, Twitch, etc.) or during pair programming. Harassment includes sexual language and imagery, deliberate intimidation, stalking, unwelcome sexual attention, libel, and any malicious hacking or social engineering.
",
+ " If a camper engages in harassing behavior, our team will take any action we deem appropriate, up to and including banning them from Free Code Camp.
",
+ " We want everyone to feel safe and respected. If you are being harassed or notice that someone else is being harassed, say something! Message @quincylarson, @terakilobyte and @codenonprofit in Slack (preferably with a screen shot of the offending language) so we can take fast action.
",
+ " If you have questions about this code of conduct, email us at team@freecodecamp.com.
",
""
]
},
@@ -654,39 +668,39 @@
"name": "What is the Free Code Camp Privacy Policy?",
"description": [
"",
- " Free Code Camp is committed to respecting the privacy of visitors to our web sites and web applications. The guidelines below explain how we protect the privacy of visitors to FreeCodeCamp.com and its features.
",
+ " Free Code Camp is committed to respecting the privacy of visitors to our web sites and web applications. The guidelines below explain how we protect the privacy of visitors to FreeCodeCamp.com and its features.
",
" Personally Identifiable Information
",
- " Free Code Camp protects the identity of visitors to FreeCodeCamp.com by limiting the collection of personally identifiable information.
",
- " Free Code Camp does not knowingly collect or solicit personally identifiable information from or about children under 13, except as permitted by law. If we discover we have received any information from a child under 13 in violation of this policy, we will delete that information immediately. If you believe Free Code Camp has any information from or about anyone under 13, please email us at team@freecodecamp.com.
",
- " All personally identifiable information you provide to us is used by Free Code Camp and its team to process and manage your account, analyze the demographic of our users, or to deliver services through the site.
",
- " If you choose to provide personally identifiable information to us, you may receive occasional emails from us that are relevant to Free Code Camp, getting a job, or learning to code in general.
",
- " Free Code Camp may also use other third-party providers to facilitate the delivery of the services described above, and these third-party providers may be supplied with or have access to personally identifiable information for the sole purpose of providing these services, to you on behalf of Free Code Camp.
",
- " Free Code Camp may also disclose personally identifiable information in special legal circumstances. For instance, such information may be used where it is necessary to protect our copyright or intellectual property rights, or if the law requires us to do so.
",
+ " Free Code Camp protects the identity of visitors to FreeCodeCamp.com by limiting the collection of personally identifiable information.
",
+ " Free Code Camp does not knowingly collect or solicit personally identifiable information from or about children under 13, except as permitted by law. If we discover we have received any information from a child under 13 in violation of this policy, we will delete that information immediately. If you believe Free Code Camp has any information from or about anyone under 13, please email us at team@freecodecamp.com.
",
+ " All personally identifiable information you provide to us is used by Free Code Camp and its team to process and manage your account, analyze the demographic of our users, or to deliver services through the site.
",
+ " If you choose to provide personally identifiable information to us, you may receive occasional emails from us that are relevant to Free Code Camp, getting a job, or learning to code in general.
",
+ " Free Code Camp may also use other third-party providers to facilitate the delivery of the services described above, and these third-party providers may be supplied with or have access to personally identifiable information for the sole purpose of providing these services, to you on behalf of Free Code Camp.
",
+ " Free Code Camp may also disclose personally identifiable information in special legal circumstances. For instance, such information may be used where it is necessary to protect our copyright or intellectual property rights, or if the law requires us to do so.
",
" Anonymous Information
",
- " Anonymous aggregated data may be provided to other organizations we associate with for statistical purposes. For example, we may report to an organization that a certain percentage of our site's visitors are adults between the ages of 25 and 35.
",
+ " Anonymous aggregated data may be provided to other organizations we associate with for statistical purposes. For example, we may report to an organization that a certain percentage of our site's visitors are adults between the ages of 25 and 35.
",
" Cookies and Beacons—Use by Free Code Camp; Opting Out
",
- " We use cookies and software logs to monitor the use of FreeCodeCamp.com and to gather non-personal information about visitors to the site. Cookies are small files that Free Code Camp transfers to the hard drives of visitors for record-keeping purposes. These monitoring systems allow us to track general information about our visitors, such as the type of browsers (for example, Firefox or Internet Explorer), the operating systems (for instance, Windows or Macintosh), or the Internet providers (for instance, Comcast) they use. This information is used for statistical and market research purposes to tailor content to usage patterns and to provide services requested by our customers. To delete these cookies, please see your browser's privacy settings.
",
- " A beacon is an electronic file object (typically a transparent image) placed in the code of a Web page. We use third party beacons to monitor the traffic patterns of visitors from one Free Code Camp.com page to another and to improve site performance.
",
- " None of the information we gather in this way can be used to identify any individual who visits our site.
",
+ " We use cookies and software logs to monitor the use of FreeCodeCamp.com and to gather non-personal information about visitors to the site. Cookies are small files that Free Code Camp transfers to the hard drives of visitors for record-keeping purposes. These monitoring systems allow us to track general information about our visitors, such as the type of browsers (for example, Firefox or Internet Explorer), the operating systems (for instance, Windows or Macintosh), or the Internet providers (for instance, Comcast) they use. This information is used for statistical and market research purposes to tailor content to usage patterns and to provide services requested by our customers. To delete these cookies, please see your browser's privacy settings.
",
+ " A beacon is an electronic file object (typically a transparent image) placed in the code of a Web page. We use third party beacons to monitor the traffic patterns of visitors from one Free Code Camp.com page to another and to improve site performance.
",
+ " None of the information we gather in this way can be used to identify any individual who visits our site.
",
" Security
",
- " Any personally identifiable information collected through this site is stored on limited-access servers. We will maintain safeguards to protect these servers and the information they store.
",
+ " Any personally identifiable information collected through this site is stored on limited-access servers. We will maintain safeguards to protect these servers and the information they store.
",
" Surveys
",
- " We may occasionally conduct on-line surveys. All surveys are voluntary and you may decline to participate.
",
+ " We may occasionally conduct on-line surveys. All surveys are voluntary and you may decline to participate.
",
" Copyright
",
- " All of the content on FreeCodeCamp.com is copyrighted by Free Code Camp. If you'd like to redistribute it beyond simply sharing it through social media, please contact us at team@freecodecamp.com.
",
+ " All of the content on FreeCodeCamp.com is copyrighted by Free Code Camp. If you'd like to redistribute it beyond simply sharing it through social media, please contact us at team@freecodecamp.com.
",
" Contacting Us
",
- " If you have questions about Free Code Camp, or to correct, update, or remove personally identifiable information, please email us at team@freecodecamp.com.
",
+ " If you have questions about Free Code Camp, or to correct, update, or remove personally identifiable information, please email us at team@freecodecamp.com.
",
" Links to Other Web sites
",
- " Free Code Camp's sites each contain links to other Web sites. Free Code Camp is not responsible for the privacy practices or content of these third-party Web sites. We urge all FreeCodeCamp.com visitors to follow safe Internet practices: Do not supply Personally Identifiable Information to these Web sites unless you have verified their security and privacy policies.
",
+ " Free Code Camp's sites each contain links to other Web sites. Free Code Camp is not responsible for the privacy practices or content of these third-party Web sites. We urge all FreeCodeCamp.com visitors to follow safe Internet practices: Do not supply Personally Identifiable Information to these Web sites unless you have verified their security and privacy policies.
",
" Data Retention
",
- " We retain your information for as long as necessary to permit us to use it for the purposes that we have communicated to you and comply with applicable law or regulations.
",
+ " We retain your information for as long as necessary to permit us to use it for the purposes that we have communicated to you and comply with applicable law or regulations.
",
" Business Transfers
",
- " As we continue to develop our business, we might sell or buy subsidiaries, or business units. In such transactions, customer information generally is one of the transferred business assets but remains subject to the promises made in any pre-existing Privacy Policy (unless, of course, the customer consents otherwise). Also, in the unlikely event that Free Code Camp, or substantially all of its assets are acquired, customer information will be one of the transferred assets, and will remain subject to our Privacy Policy.
",
+ " As we continue to develop our business, we might sell or buy subsidiaries, or business units. In such transactions, customer information generally is one of the transferred business assets but remains subject to the promises made in any pre-existing Privacy Policy (unless, of course, the customer consents otherwise). Also, in the unlikely event that Free Code Camp, or substantially all of its assets are acquired, customer information will be one of the transferred assets, and will remain subject to our Privacy Policy.
",
" Your California Privacy Rights
",
- " If you are a California resident, you are entitled to prevent sharing of your personal information with third parties for their own marketing purposes through a cost-free means. If you send a request to the address above, Free Code Camp will provide you with a California Customer Choice Notice that you may use to opt-out of such information sharing. To receive this notice, submit a written request to team@freecodecamp.com, specifying that you seek your "California Customer Choice Notice." Please allow at least thirty (30) days for a response.
",
+ " If you are a California resident, you are entitled to prevent sharing of your personal information with third parties for their own marketing purposes through a cost-free means. If you send a request to the address above, Free Code Camp will provide you with a California Customer Choice Notice that you may use to opt-out of such information sharing. To receive this notice, submit a written request to team@freecodecamp.com, specifying that you seek your "California Customer Choice Notice." Please allow at least thirty (30) days for a response.
",
" Acceptance of Privacy Policy Terms and Conditions
",
- " By using this site, you signify your agreement to the terms and conditions of this FreeCodeCamp.com Privacy Policy. If you do not agree to these terms, please do not use this site. We reserve the right, at our sole discretion, to change, modify, add, or remove portions of this policy at any time. All amended terms automatically take effect 30 days after they are initially posted on the site. Please check this page periodically for any modifications. Your continued use of FreeCodeCamp.com following the posting of any changes to these terms shall mean that you have accepted those changes.
",
- " If you have any questions or concerns, please send an email to team@freecodecamp.com.
",
+ " By using this site, you signify your agreement to the terms and conditions of this FreeCodeCamp.com Privacy Policy. If you do not agree to these terms, please do not use this site. We reserve the right, at our sole discretion, to change, modify, add, or remove portions of this policy at any time. All amended terms automatically take effect 30 days after they are initially posted on the site. Please check this page periodically for any modifications. Your continued use of FreeCodeCamp.com following the posting of any changes to these terms shall mean that you have accepted those changes.
",
+ " If you have any questions or concerns, please send an email to team@freecodecamp.com.
",
""
]
},
@@ -696,7 +710,7 @@
"description": [
"",
" We're happy to do a quick interview for your publication or show. Here's whom you should contact about what, and how to best reach them:
",
- " ",
+ "
",
"
",
" - Want to talk to about Free Code Camp's curriculum or long-term vision? Reach out to Quincy Larson. He's @ossia on Twitter and @quincylarson on Slack.
",
" - Want to talk about Free Code Camp's open source codebase, infrastructure, or JavaScript in general? Talk to Nathan Leniz. He's @terakilobyte on Twitter and @terakilobyte on Slack.
",
@@ -704,7 +718,7 @@
" - Want to get a camper's perspective on our community? Talk with Bianca Mihai (@biancamihai on Slack and @bubuslubu on Twitter) or Suzanne Atkinson (@adventurebear on Slack and @steelcitycoach on Twitter).",
"
",
" ",
- " We strive to be helpful and transparent in everything we do. We'll do what we can to help you share our community with your audience.
",
+ " We strive to be helpful and transparent in everything we do. We'll do what we can to help you share our community with your audience.
",
""
]
},
@@ -713,8 +727,8 @@
"name": "How can I contribute to this guide?",
"description": [
"",
- " Contributing to our field guide is a great way to establish your history on GitHub, add to your portfolio, and help other campers. If you have a question about JavaScript or programming in general that you'd like us to add to the field guide, here are two ways to get it into the guide:
",
- " ",
+ "
Contributing to our field guide is a great way to establish your history on GitHub, add to your portfolio, and help other campers. If you have a question about JavaScript or programming in general that you'd like us to add to the field guide, here are two ways to get it into the guide:
",
+ " ",
"
",
" - You can message @alex-dixon in Slack with your question.
",
" - You can also contribute to this field guide directly via GitHub pull request, by cloning Free Code Camp's main repository and modifying field-guides.json.
",
diff --git a/seed_data/future-coursewares.json b/seed_data/future-coursewares.json
deleted file mode 100644
index badb123236..0000000000
--- a/seed_data/future-coursewares.json
+++ /dev/null
@@ -1,2588 +0,0 @@
-[
- {
- "_id" : "bd7123d8c441eddfaeb5bdef",
- "name": "Learn how Free Code Camp Works",
- "difficulty": 0.00,
- "description": [
- "Watch this 90 second video, or simply read this summary:",
- "Welcome to Free Code Camp. We're a community of busy people learning to code.",
- "We built this community because learning to code is hard. But anyone who can stay motivated can learn to code. And the best way to stay motivated is to code with friends.",
- "To maximize accessibility, all our challenges are self-paced, browser-based, and free.",
- "All of us start with the same 100 hours of interactive coding challenges. These cover Computer Science and databases. They also cover in-demand JavaScript tools like jQuery, Node.js and MongoDB.",
- "Once we have a basic understanding of web development, we'll spend another 900 hours putting that theory into practice. We'll build full stack solutions for nonprofits.",
- "By the end of this process, we'll be good at coding. We'll have a portfolio of apps with happy users to prove it. We'll also have an alumni network of fellow coders and nonprofits ready to serve as references.",
- "If you make it through Free Code Camp, you will be able to get a coding job. There are far more job openings out there than there are qualified coders to fill them.",
- "Also, for every pure coding job, there are at least 5 additional jobs that require some coding skills. So even if you decide not to pursue coding as a career, you'll still walk away with a valuable job skill.",
- "There are 3 keys to succeeding in our community: do the challenges, make friends, and find a routine.",
- "Now it's time to join our chatroom. Click the \"Go to my next challenge\" button to move on to your next challenge."
- ],
- "tests": [
- ""
- ],
- "challengeSeed": [
- "114486344"
- ],
- "challengeType" : 2
- },
- {
- "_id": "bd7123c8c441eddfaeb5bdef",
- "name": "Meet Booleans",
- "difficulty": "0.001",
- "description": [
- "Return true"
- ],
- "tests": [
- "expect(welcomeToBooleans()).to.be.a(\"boolean\");",
- "expect(welcomeToBooleans()).to.be.true;"
- ],
- "challengeSeed": [
- "function welcomeToBooleans() {\n // Good luck!\n return false;\n}\n\nwelcomeToBooleans();"
- ],
- "challengeType": 1
- },
- {
- "_id" : "bd7123c8c441eddfaeb5bdef",
- "name": "Start our Challenges",
- "difficulty": "0.002",
- "description": [
- "Welcome to Free Code Camp's first challenge! Click on the button below for further instructions.",
- "Awesome. Now you can read the rest of this challenge's instructions.",
- "You can edit code
in the text editor
we've embedded into this web page.",
- "Do you see the code in the text editor that says <h1>hello</h1>
? That's an HTML element
.",
- "Most HTML elements have an opening tag
and a closing tag
. Opening tags look like this: <h1>
. Closing tags look like this: </h1>
. Note that the only difference between opening and closing tags is that closing tags have a slash after their opening angle bracket.",
- "Once you've completed the challenge, the \"Go to my next challenge\" button will become enabled. Click it - or press control and enter at the same time - to advance to the next challenge.",
- "To enable the \"Go to my next challenge\" button on this exercise, change the h1
tag's text to say \"Hello World\" instead of \"Hello\"."
- ],
- "tests": [
- "expect((/hello(\\s)+world/gi).test($('h1').text())).to.be.true;"
- ],
- "challengeSeed": [
- "Hello
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf0887a",
- "name": "Use the h2 Element",
- "difficulty" : "0.01",
- "description": [
- "Add an h2
tag that says \"cat photo app\" to make a second HTML element
below the \"hello world\" h1
element.",
- "The h2 element you enter will create an h2 element on the website.",
- "This element tells the browser how to render the text that it contains.",
- "h2
elements are slightly smaller than h1
elements. There are also h3
, h4
, h5
and h6
elements."
- ],
- "tests": [
- "expect((/hello(\\s)+world/gi).test($('h1').text())).to.be.true;",
- "expect((/cat(\\s)+photo(\\s)+app/gi).test($('h2').text())).to.be.true;"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08801",
- "name": "Use the P Element",
- "difficulty" : "0.02",
- "description": [
- "Create a p
element below the h2 element, and give it the text \"hello paragraph\".",
- "p
elements are the preferred element for normal-sized paragraph text on websites.",
- "You can create a p element like so: <p>I'm a p tag!</p>
"
- ],
- "tests": [
- "expect((/hello(\\s)+paragraph/gi).test($('p').text())).to.be.true;"
- ],
- "challengeSeed": [
- "hello world
",
- "hello html
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aeaf08801",
- "name": "Add a Line Break to Visually Separate Elements",
- "difficulty" : "0.03",
- "description": [
- "Add a line break
between the <h2>
and <p>
elements.",
- "You can create an line break element with <br/>
.",
- "Note that <br/>
has no closing tag. It is a self-closing
element. See how a forward-slash precedes the closing bracket?"
- ],
- "tests": [
- "expect($('br')).to.exist;"
- ],
- "challengeSeed": [
- "hello world
",
- "hello html
",
- "hello paragraph
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08802",
- "name": "Uncomment HTML",
- "difficulty" : "0.04",
- "description": [
- "Uncomment the h1
, h2
and p
elements.",
- "Commenting is a way that you can leave comments within your code without affecting the code itself.",
- "Commenting is also a convenient way to make code inactive without having to delete it entirely.",
- "You can start a comment with <!--
and end a comment with -->
."
- ],
- "tests": [
- "expect((/hello(\\s)+world/gi).test($('h1').text())).to.be.true;"
- ],
- "challengeSeed": [
- "",
- "",
- "",
- "hello world
",
- "cat photo app
",
- "lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08809",
- "name": "Using Important to Override Styles",
- "difficulty" : "0.14",
- "description": [
- "Apply both the \"blue-text\" and \"urgently-red\" classes to all h2 elements, but use !important
to ensure the element is rendered as being red.",
- "Sometimes HTML elements will receive conflicting information from CSS classes as to how they should be styled.",
- "If there's a conflict in the CSS, the browser will use whichever style declaration is closest to the bottom of the CSS document (whichever declaration comes last). Note that in-line style declarations are the final authority in how an HTML element will be rendered.",
- "There's one way to ensure that an element is rendered with a certain style, regardless of where that declaration is located. That one way is to use !important
.",
- "Look at the example in the editor's style tag to see how you can use !important.",
- "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": [
- "expect($('h2')).to.have.class('urgently-red');",
- "expect($('h2')).to.have.class('blue-text');",
- "expect($('h2')).to.have.css('color', 'rgb(255, 0, 0)');"
- ],
- "challengeSeed": [
- "",
- "",
- "hello world
",
- "cat photo app
",
- "lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08810",
- "name": "Use Hex Codes for Precise Colors",
- "difficulty" : "0.15",
- "description": [
- "Change the hex code in the \"red-text\" class to hex code for the color red.",
- "Hexadecimal (hex) code
is a popular way of specifying color in CSS.",
- "Hex code is called \"hex\" because each digit has 16 possible values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, and f",
- "The six hex code correspond to red-red-green-green-blue-blue.",
- "You can change these six values to make more than 16 million colors!",
- "The higher the value in a field, the more intense its color. For example, #000000 is black, #ffffff is white, and #00ff00 is bright green. You can also get less intense colors by using values lower than f. For example, #00f000 with the second green digit set to 0 is a light green, and #00f900 is a slightly brighter green",
- "Now figure out how to make the bright green in the \"red-text\" class into a bright red."
- ],
- "tests": [
- "expect($('h2')).to.have.css('color', 'rgb(255, 0, 0)');",
- "expect($('h2')).to.have.class('red-text');"
- ],
- "challengeSeed": [
- "",
- "",
- "hello world
",
- "cat photo app
",
- "lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9bedf08810",
- "name": "Use Shortened 3 Digit Hex Codes",
- "difficulty" : "0.16",
- "description": [
- "Change the hex code in the \"red-text\" class to the shortened 3-digit hex code for the color red.",
- "You can also shorten the 6-digit color hex code to a 3-digit code. For example, #00ff00
becomes #0f0
. This is less precise, but equally effective."
- ],
- "tests": [
- "expect($('h2')).to.have.css('color', 'rgb(255, 0, 0)');",
- "expect($('h2')).to.have.class('red-text');"
- ],
- "challengeSeed": [
- "",
- "",
- "hello world
",
- "cat photo app
",
- "lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08811",
- "name": "Use RGB Codes for Precise Colors",
- "difficulty" : "0.17",
- "description": [
- "Change the RGB code to be red.",
- "Another way to represent color in CSS is with RGB, or red-green-blue notation.",
- "For each of the three colors, you specify a value between 0 and 256.",
- "For example, black is rgb(0, 0, 0)
, white is rgb(255, 255, 255)
, bright green is rgb(0, 255, 0)
. You can also get less intense colors by using values lower than 255. For example, light green is rgb(0, 123, 0).",
- "If you think about it, this is just as precise as using hex code, because 16 times 16 is 256. In practice, most developers use hex code since it's faster to say out loud and to type."
- ],
- "tests": [
- "expect($('h2')).to.have.css('color', 'rgb(255, 0, 0)');",
- "expect($('h2')).to.have.class('red-text');"
- ],
- "challengeSeed": [
- "",
- "",
- "hello world
",
- "cat photo app
",
- "lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08812",
- "name": "Add an Image to your Website",
- "difficulty" : "0.18",
- "description": [
- "Use an img element to add the image http://bit.ly/cutegraycat
to your website.",
- "You can add images to your website by using the img
element.",
- "An example of this would be <img src=\"www.your-image-source.com/your-image.jpg\"/>
. Note that in most cases, img
elements are self-closing.",
- "Try it with this image: http://bit.ly/cutegraycat
."
- ],
- "tests": [
- "expect($('img').attr('src')).to.equal('http://bit.ly/cutegraycat');"
- ],
- "challengeSeed": [
- "",
- "",
- "hello world
",
- "cat photo app
",
- "lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9acdf08812",
- "name": "Specify an Image Size TEST",
- "difficulty" : "0.19",
- "description": [
- "Create a class called narrow-image
and use it to resize the image so that it's only 200 pixels wide",
- "Uh-oh, our image is too big to fit on a mobile phone. As a result, our user will need to scroll horizontally to view the image. But we can fix this by specifying an image size.",
- "CSS has an attribute called width
that controls an element's width. Just like with fonts, we'll use pixels(px) to specify the images width.",
- "Create a class called narrow-image
and added it to the image element. Change the width to 200 pixels."
- ],
- "tests": [
- "expect($('img')).to.have.class('narrow-image');",
- "expect($('img')).to.have.css('width', 200px)"
- ],
- "challengeSeed": [
- "",
- "hello world
",
- "cat photo app
",
- "lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
",
- "
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9bedf08813",
- "name": "Add a Border Around an Element",
- "difficulty" : "0.20",
- "description": [
- "Create a class called \"thick-green-border\" that puts a 5-pixel-wide black border around your cat photo.",
- "CSS Borders
have attributes like style, color and width.",
- "We've created an example border around your h1 element. See if you can add a 10-pixel-wide green border around your cat photo."
- ],
- "tests": [
- "expect($('img')).to.have.class('thick-green-border');",
- "expect($('img')).to.have.css('border-color', 'rgb(0,255,0)'));",
- "expect($('img')).to.have.css('border-width', '10px');"
- ],
- "challengeSeed": [
- "",
- "hello world
",
- "cat photo app
",
- "lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
",
- "
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08814",
- "name": "Add Rounded Corners with a Border Radius",
- "difficulty" : "0.21",
- "description": [
- "Give your cat photo a border radius of 10 pixels.",
- "Your cat photo currently has sharp corners. We can round out those corners with a CSS attribute called border-radius
.",
- "You can specify a border-radius
with pixels. This will affect how rounded the corners are. Add this attribute to your thick-green-border
class and set it to 10 pixels."
- ],
- "tests": [
- "expect($('img')).to.have.class('thick-green-border');",
- "expect($('img')).to.have.css('border-radius', '10px');"
- ],
- "challengeSeed": [
- "",
- "hello world
",
- "cat photo app
",
- "lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
",
- "
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08815",
- "name": "Make an Image Circular with a Border Radius",
- "difficulty" : "0.22",
- "description": [
- "Give your cat photo a border-radius
of 50%.",
- "In addition to pixels, you can also specify a border-radius
of a percentage."
- ],
- "tests": [
- "expect($('img')).to.have.css('border-radius', '50%');"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
",
- "
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08816",
- "name": "Use an Anchor Tag to Link to an External Page",
- "difficulty" : "0.23",
- "description": [
- "Create an anchor tag
hyperlink that links to freecodecamp.com",
- ""
- ],
- "tests": [
- "expect((/free(\\s+)?code(\\s+)?camp(\\s+)?/gi).test($('a').text())).to.be.true;",
- "expect($('a').filter(function(index) { return /freecodecamp\\.com/gi.test($('a')[index]); }).length).to.eql(1);"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
",
- "
",
- "
",
- "This is a link to Google",
- "
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08817",
- "name": "Make Named Anchors using the Hash Symbol",
- "difficulty" : "0.24",
- "description": [
- "Use the hash symbol(#) to turn the link to the bottom of the page into a named anchor
.",
- "Sometimes you want to add anchor elements
to your website before you know where they will link.",
- "This is also handy when you're changing the behavior of a link using jQuery
, which we'll learn about later.",
- "Replace the href in the link to freecodecamp.com with a hash symbol to turn it into a named anchor
."
- ],
- "tests": [
- "expect((/this link leads nowhere/gi).test($('a').text())).to.be.true;",
- "expect($('a').filter(function(index) { return /#/gi.test($('a')[index]); }).length).to.eql(1);"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
",
- "
",
- "
",
- "This named anchor leads nowhere",
- "
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08820",
- "name": "Turn an Image into a Link",
- "difficulty" : "0.25",
- "description": [
- "Wrap the gray cat's image with an anchor tag
that leads nowhere.",
- "You can make elements into links by wrapping them in an anchor tag
.",
- "Check out the example snow-colored cat's photo. When you hover over it with your cursor, you'll see the finger pointer you usually see when you hover over a link. The photo is now a link.",
- "Wrap your gray cat's photo in an anchor tag
",
- "Use the hash symbol as the anchor tag
's href
."
- ],
- "tests": [
- "expect($('a').filter(function(index) { return /#/gi.test($('a')[index]); }).length).to.eql(2);"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "
",
- "
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08818",
- "name": "Add Alt Text to an image",
- "difficulty" : "0.26",
- "description": [
- "Add the alt text
\"a photo of a cute gray cat\" to our cat photo",
- "alt text
is what browsers will display if they fail to load the image. alt text
is also important for blind or visually impaired users to understand what an image portrays. Search engines also look at alt text
.",
- "In short, every image should have alt text
!",
- "You can add alt text right in the image tag, like we've done here with the \"cute white cat\" image."
- ],
- "tests": [
- "expect($('img').filter(function(){ return /cat/gi.test(this.alt) }).length).to.eql(2);"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "
",
- "
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad88fee1348bd9aedf08825",
- "name": "Adjusting the Padding of an Element",
- "difficulty" : "0.27",
- "description": [
- "Change the padding
of the green box to match that of the red box.",
- "An element's padding
controls the amount of space between an element and its border
.",
- "Here, we can see that the green box and the red box and the green box are nested within the yellow box. Note that the red box has more padding
than the green box.",
- "When you increase the green box's padding, it will increase the distance between the word \"padding\" and the border around the text."
- ],
- "tests": [
- "expect($('.green-box')).to.have.css('padding', '20px')"
- ],
- "challengeSeed": [
- "",
- "margin
",
- "",
- "",
- " padding
",
- " padding
",
- ""
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08822",
- "name": "Adjust the Margin of an Element",
- "difficulty" : "0.28",
- "description": [
- "Change the margin
of the green box to match that of the red box.",
- "An element's margin
controls the amount of space between an element's border
and surrounding elements.",
- "Here, we can see that the green box and the red box and the green box are nested within the yellow box. Note that the red box has more margin
than the green box, making it appear smaller.",
- "When you increase the green box's padding, it will increase the distance between its border and surrounding elements."
- ],
- "tests": [
- "expect($('.green-box')).to.have.css('margin', '20px')"
- ],
- "challengeSeed": [
- "",
- "margin
",
- "",
- "",
- " padding
",
- " padding
",
- ""
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08823",
- "name": "Add a Negative Margin to an Element",
- "difficulty" : "0.29",
- "description": [
- "Change the margin
of the green box to a negative value, so it fills the entire horizontal width of the blue box.",
- "An element's margin
controls the amount of space between an element's border
and surrounding elements.",
- "If you set an element's margin to a negative value, the element will grow larger.",
- "Try to set the margin to a negative value like the one for the red box."
- ],
- "tests": [
- "expect($('.green-box')).to.have.css('margin', '-15px')"
- ],
- "challengeSeed": [
- "",
- "",
- "",
- " padding
",
- " padding
",
- ""
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08824",
- "name": "Add Different Padding to Each Side of an Element TEST",
- "difficulty" : "0.30",
- "description": [
- "Give the green box a padding of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.",
- "Sometimes you will want to customize an element so that it has different padding on each of its sides.",
- "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": [
- "expect($('.green-box')).to.have.css('padding-bottom', '20px')",
- "expect($('.green-box')).to.have.css('padding-left', '40px')"
- ],
- "challengeSeed": [
- "",
- "margin
",
- "",
- "",
- " padding
",
- " padding
",
- ""
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1248bd9aedf08824",
- "name": "Add Different a Margin to Each Side of an Element TEST",
- "difficulty" : "0.31",
- "description": [
- "Give the green box a margin of 40 pixels on its top and left side, but only 20 pixels on its bottom and right side.",
- "Sometimes you will want to customize an element so that it has a different margin on each of its sides.",
- "CSS allows you to control the margin of an element on all four sides with margin-top
, margin-right
, margin-bottom
, and margin-left
attributes."
- ],
- "tests": [
- "expect($('.green-box')).to.have.css('margin-bottom', '20px')",
- "expect($('.green-box')).to.have.css('margin-left', '40px')"
- ],
- "challengeSeed": [
- "",
- "margin
",
- "",
- "",
- " padding
",
- " padding
",
- ""
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08826",
- "name": "Use Clockwise Notation to Specify an Element's Padding",
- "difficulty" : "0.32",
- "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.",
- "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": [
- "expect($('.green-box')).to.have.css('margin-bottom', '20px')",
- "expect($('.green-box')).to.have.css('margin-left', '40px')"
- ],
- "challengeSeed": [
- "",
- "margin
",
- "",
- "",
- " padding
",
- " padding
",
- ""
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9acde08812",
- "name": "Use Bootstrap for Responsive Images",
- "difficulty" : "0.33",
- "description": [
- "Add the img-responsive
Bootstrap class to the image.",
- "Specifying a width of 200 pixels on our img element made it fit our phone's screen, but it's not a perfect fit. It would be great if the image could be exactly the width of our phone's screen.",
- "Fortunately, there's a Responsive CSS Framework
called written by Twitter called Bootstrap. You can add Bootstrap to any app just by including it with <link rel='stylesheet' href='//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css'/>
at the top of your HTML, but we've gone ahead and included it for you here.",
- "Bootstrap will figure out how wide your screen is and respond by resizing your HTML elements - hence the name Responsive Design
.",
- "Now all you need to do is add the img-responsive
class to your image."
- ],
- "tests": [
- "expect($('img')).to.have.class('img-responsive');"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "
",
- "
",
- "This is a link to Google",
- "
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd8acde08812",
- "name": "Center Text with Bootstrap",
- "difficulty" : "0.34",
- "description": [
- "Add Bootstrap's text-center
class to your h2 element.",
- "Now that we're using Bootstrap, we can center our heading elements (h2) to make them look better. All we need to do is add the class text-center
to the h1 and h2 elements.",
- "Note that you can add several classes to the same element by seperating each of them with a space, like this: <h2 class=\"text-red text-center\">your text</h2>
."
- ],
- "tests": [
- "expect($('h2')).to.have.class('text-center');"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "
",
- "
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348cd8acde08812",
- "name": "Create a Button",
- "difficulty" : "0.35",
- "description": [
- "Create a button with the text \"Delete\" using the HTML button
element.",
- "HTML has special elements that function like links, but look like buttons. Let's creating a default HTML button."
- ],
- "tests": [
- "expect((/delete/gi).test($('button').text())).to.be.true;"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "
",
- "
",
- "",
- "
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348cd8acdf08812",
- "name": "Create a Bootstrap Button",
- "difficulty" : "0.36",
- "description": [
- "Apply the Bootstrap's btn
class to both of your buttons.",
- "Bootstrap has its own button styles, which look much better than the plain HTML ones."
- ],
- "tests": [
- "expect($('.btn').length).to.eql(2);"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "
",
- "
",
- "",
- "
",
- ""
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348cd8acef08812",
- "name": "Create a Block Element Bootstrap Button",
- "difficulty" : "0.37",
- "description": [
- "Add Bootstrap's btn-block
class to both of your buttons.",
- "Normally, your buttons are only as wide as the text they contain. By making them block elements
, your button will stretch to fill your page's entire horizontal space.",
- "Note that these buttons still need the btn
class."
- ],
- "tests": [
- "expect($('.btn-block').length).to.eql(2);"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "
",
- "
",
- "",
- "
",
- ""
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348cd8acef08812",
- "name": "Color a Bootstrap Button with Button Primary",
- "difficulty" : "0.38",
- "description": [
- "Add Bootstrap's btn-block
class to both of your buttons.",
- "Normally, your buttons are only as wide as the text they contain. By making them block elements
, your button will stretch to fill your page's entire horizontal space.",
- "Note that these buttons still need the btn
class."
- ],
- "tests": [
- "expect($('.btn-block').length).to.eql(2);"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "
",
- "
",
- "",
- "
",
- ""
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348cd8acef08812",
- "name": "Color a Bootstrap Button with Button Primary",
- "difficulty" : "0.39",
- "description": [
- "Add Bootstrap's btn-primary
class to both of your buttons.",
- "Bootstrap comes with several pre-defined colors for buttons. The btn-primary
class is the main button color you'll use throughout your app.",
- "Note that these buttons still need the btn
and btn-block
classes."
- ],
- "tests": [
- "expect($('.btn-primary').length).to.eql(2);"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "
",
- "
",
- "",
- "
",
- ""
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348ce8acef08812",
- "name": "Warn your Users of a Dangerous Action with the Bootstrap Button Danger Class",
- "difficulty" : "0.40",
- "description": [
- "Change the \"Delete\" button from btn-primary
to btn-danger
.",
- "Bootstrap comes with several pre-defined colors for buttons. The btn-danger
class is the button color you'll use to notify users that the button performs a destructive action, such as deleting a cat photo.",
- "Note that this button still needs the btn
and btn-block
classes."
- ],
- "tests": [
- "expect($('.btn-danger').length).to.eql(1);"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "
",
- "
",
- "",
- "
",
- ""
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad88fee1348ce8acef08812",
- "name": "Use the Bootstrap Grid to Put Two Elements Side By Side",
- "difficulty" : "0.41",
- "description": [
- "Put the \"Like\" and \"Delete\" buttons side-by-side by wrapping them in both in a <div class=\"row\">
element and each of them in a <div class=\"row\">
element.",
- "Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a div
element.",
- "The row
class is applied to a div, and the buttons themselves can be nested
within it."
- ],
- "tests": [
- "expect($('.row').length).to.eql(2);",
- "expect($('.col-xs-12').length).to.eql(4);"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "
",
- "
",
- "",
- " ",
- " ",
- " ",
- " ",
- " ",
- " ",
- "",
- "",
- "
",
- ""
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad89fee1348ce8acef08812",
- "name": "Wrap Side By Side Elements in a Bootstrap Row",
- "difficulty" : "0.42",
- "description": [
- "Put the \"Like\" and \"Delete\" buttons side-by-side by wrapping them in both in a <div class=\"row\">
element and each of them in a <div class=\"row\">
element.",
- "Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a div
element.",
- "The row
class is applied to a div, and the buttons themselves can be nested
within it."
- ],
- "tests": [
- "expect($('.row').length).to.eql(2);",
- "expect($('.col-xs-12').length).to.eql(4);"
- ],
- "challengeSeed": [
- "",
- "cat photo app
",
- "
",
- "
",
- "",
- " ",
- " ",
- " ",
- " ",
- " ",
- " ",
- "",
- "",
- "
",
- ""
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08813",
- "name": "Add Alt Text to an Image TEST",
- "difficulty" : "0.43",
- "description": [
- "Add the alt text \"A picture of a gray cat\" to the image.",
- "Alt text
is a useful way to tell people (and web crawlers like Google) what is pictured in a photo. It's extremely important for helping blind or visually impaired people understand the content of your website.",
- "You can add alt text right in the img element like this: <img src=\"www.your-image-source.com/your-image.jpg\" alt=\"your alt text\"/>
."
- ],
- "tests": [
- "expect((/cat/gi).test($('img').attr('alt')).to.be.true;"
- ],
- "challengeSeed": [
- "",
- "hello world
",
- "cat photo app
",
- "lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
",
- "
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08827",
- "name": "Create an Bulleted Unordered List",
- "difficulty" : "0.44",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08828",
- "name": "Created a Numbered Ordered List",
- "difficulty" : "0.45",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08829",
- "name": "Create a Text Field",
- "difficulty" : "0.46",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08830",
- "name": "Use HTML5 to Make a Field Required",
- "difficulty" : "0.47",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08831",
- "name": "Use HTML5 to Specify an Input Type",
- "difficulty" : "0.49",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08832",
- "name": "Create a Text Area",
- "difficulty" : "0.50",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08834",
- "name": "Create a Set of Radio Buttons",
- "difficulty" : "0.51",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08835",
- "name": "Create a Set of Checkboxes",
- "difficulty" : "0.52",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08836",
- "name": "Create a HTML Form",
- "difficulty" : "0.53",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08841",
- "name": "Change the background of element",
- "difficulty" : "0.54",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08842",
- "name": "Make an element translucent",
- "difficulty" : "0.55",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08844",
- "name": "Add a Drop Shadow",
- "difficulty" : "0.56",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08845",
- "name": "Make a Navbar",
- "difficulty" : "0.57",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08847",
- "name": "Add a Logo to a Navbar",
- "difficulty" : "0.58",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08848",
- "name": "Make a Footer",
- "difficulty" : "0.59",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08849",
- "name": "Use Icons as Links",
- "difficulty" : "0.60",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08850",
- "name": "Add Hover Effects to Icons",
- "difficulty" : "0.61",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08851",
- "name": "Add Depth to a Page with a Well",
- "difficulty" : "0.62",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08852",
- "name": "Add an ID to a Button",
- "difficulty" : "0.52",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08853",
- "name": "Fire a Modal by Clicking a Button",
- "difficulty" : "0.63",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08854",
- "name": "Style a Modal with a Header",
- "difficulty" : "0.64",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08855",
- "name": "Style a Modal with a Body",
- "difficulty" : "0.65",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08856",
- "name": "Make a Modal Dismissable",
- "difficulty" : "0.66",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08857",
- "name": "Create an Accordian Menu",
- "difficulty" : "0.67",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08863",
- "name": "Add a Gradient to a Button",
- "difficulty" : "0.68",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08864",
- "name": "Adjust the Line Height of Text",
- "difficulty" : "0.69",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08866",
- "name": "",
- "difficulty" : "0.70",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08867",
- "name": "",
- "difficulty" : "0.71",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08868",
- "name": "",
- "difficulty" : "0.711",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08869",
- "name": "",
- "difficulty" : "0.712",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08870",
- "name": "",
- "difficulty" : "0.713",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08871",
- "name": "",
- "difficulty" : "0.714",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08872",
- "name": "",
- "difficulty" : "0.72",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08873",
- "name": "",
- "difficulty" : "0.73",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08874",
- "name": "",
- "difficulty" : "0.74",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08875",
- "name": "",
- "difficulty" : "0.75",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08876",
- "name": "",
- "difficulty" : "0.76",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08877",
- "name": "",
- "difficulty" : "0.77",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08878",
- "name": "",
- "difficulty" : "0.78",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08879",
- "name": "",
- "difficulty" : "0.79",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08880",
- "name": "",
- "difficulty" : "0.80",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08881",
- "name": "",
- "difficulty" : "0.81",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08882",
- "name": "",
- "difficulty" : "0.82",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08883",
- "name": "",
- "difficulty" : "0.83",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08884",
- "name": "",
- "difficulty" : "0.84",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08885",
- "name": "",
- "difficulty" : "0.85",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08886",
- "name": "",
- "difficulty" : "0.86",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08887",
- "name": "",
- "difficulty" : "0.87",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08888",
- "name": "",
- "difficulty" : "0.88",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08889",
- "name": "",
- "difficulty" : "0.89",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08890",
- "name": "",
- "difficulty" : "0.90",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08891",
- "name": "",
- "difficulty" : "0.91",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08892",
- "name": "",
- "difficulty" : "0.92",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08893",
- "name": "",
- "difficulty" : "0.93",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08894",
- "name": "",
- "difficulty" : "0.94",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08895",
- "name": "",
- "difficulty" : "0.95",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08896",
- "name": "",
- "difficulty" : "0.96",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08897",
- "name": "",
- "difficulty" : "0.97",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08898",
- "name": "",
- "difficulty" : "0.98",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08899",
- "name": "",
- "difficulty" : "0.99",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- },
-
- {
- "_id" : "bad87fee1348bd9aedf08100",
- "name": "",
- "difficulty" : "1.00",
- "description": [
- "",
- ""
- ],
- "tests": [
- "expect($('h1')).to.have.class('text-center');",
- "expect($('h1')).to.have.text('hello world');"
- ],
- "challengeSeed": [
- "hello world
"
- ],
- "challengeType": 0
- }
-
-]
diff --git a/seed_data/future-jquery-ajax-json.json b/seed_data/future-jquery-ajax-json.json
new file mode 100644
index 0000000000..4ceea2fafc
--- /dev/null
+++ b/seed_data/future-jquery-ajax-json.json
@@ -0,0 +1,329 @@
+{
+ "name": "jQuery, Ajax and JSON",
+ "order" : 0.004,
+ "challenges": [
+ {
+ "_id": "bad87fee1348bd9acdd08826",
+ "name": "Waypoint: Learn how Script Tags and Document Ready Work",
+ "difficulty": 0.072,
+ "description": [
+ "Test"
+ ],
+ "tests": [
+ "assert(typeof $('#target').attr('disabled') === 'undefined', 'Change the disabled attribute of the \"target\" button to false');",
+ "expect($('#target')).to.exist()"
+ ],
+ "challengeSeed": [
+ "fccss",
+ " $(document).ready(function() {",
+ " $('#target').attr('disabled', true)",
+ " });",
+ "fcces",
+ ""
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9aedc08826",
+ "name": "Waypoint: Target Elements by Selectors Using jQuery",
+ "difficulty": 0.073,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9aedb08826",
+ "name": "Waypoint: Target Elements by Class Using jQuery",
+ "difficulty": 0.074,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9aeda08826",
+ "name": "Waypoint: Target an element by ID Using jQuery",
+ "difficulty": 0.075,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9aed908826",
+ "name": "Waypoint: Change the CSS of an Element Using jQuery",
+ "difficulty": 0.076,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9aed808826",
+ "name": "Waypoint: Disable an Element Using jQuery",
+ "difficulty": 0.077,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9aed708826",
+ "name": "Waypoint: Remove an Element Using jQuery",
+ "difficulty": 0.078,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9aed608826",
+ "name": "Waypoint: Move an Element Using jQuery",
+ "difficulty": 0.079,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9aed508826",
+ "name": "Waypoint: Clone an Element Using jQuery",
+ "difficulty": 0.080,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9aed408826",
+ "name": "Waypoint: Animate an Element Using jQuery",
+ "difficulty": 0.081,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9aed308826",
+ "name": "Waypoint: Target the Parent of an Element Using jQuery",
+ "difficulty": 0.082,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9aed208826",
+ "name": "Waypoint: Target the Children of an Element Using jQuery",
+ "difficulty": 0.083,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+
+ {
+ "_id": "bad87fee1348bd9aed108826",
+ "name": "Waypoint: Target a Specific Child of an Element Using jQuery",
+ "difficulty": 0.084,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9aed008826",
+ "name": "Waypoint: Target Even Numbered Elements Using jQuery",
+ "difficulty": 0.085,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9aecc08826",
+ "name": "Waypoint: Read Data from an Element Using jQuery",
+ "difficulty": 0.086,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9aebc08826",
+ "name": "Waypoint: Get Data from an URL Using jQuery",
+ "difficulty": 0.087,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9ae9c08826",
+ "name": "Waypoint: Loop through JSON Data Using jQuery",
+ "difficulty": 0.089,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+
+ {
+ "_id": "bad87fee1348bd9ae8c08826",
+ "name": "Waypoint: Setup Click Events Using jQuery",
+ "difficulty": 0.089,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1348bd9aede08826",
+ "name": "Waypoint: Use Hex Codes for Precise Colors",
+ "difficulty": 0.071,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ],
+ "challengeType": 0
+ },
+ {
+ "_id": "bad87fee1348bd9aedd08826",
+ "name": "Waypoint: Use Shortened Hex Codes for Colors",
+ "difficulty": 0.071,
+ "description": [
+
+ ],
+ "tests": [
+
+ ],
+ "challengeSeed": [
+
+ ]
+ }
+ ]
+}
diff --git a/seed_data/nonprofits.json b/seed_data/nonprofits.json
index ff432373ef..89b7cbee48 100644
--- a/seed_data/nonprofits.json
+++ b/seed_data/nonprofits.json
@@ -10,8 +10,6 @@
],
"whatDoesNonprofitDo": "We help the many less-fortunate Jewish families in our community, by providing them with nutritious food and energy to grow, learn, work, and give them hope for a better and brighter future.",
"websiteLink": "http://chasdeikaduri.org/",
- "stakeholderName": "Jonathan Tebeka",
- "stakeholderEmail": "jonathan@chasdeikaduri.org",
"name": "Chasdei Kaduri",
"endUser": "Clients, donors, and admin.",
"approvedDeliverables": [
@@ -25,7 +23,9 @@
"logoUrl": "https://trello-attachments.s3.amazonaws.com/54c7e02f2c173c37015b2f36/604x309/00580a0567a4b3afda29d52b09e7e829/rQQ6zwq31Uya8ie9QHC-MlvfXxqftm9UPPe524JUhmwSEaZjQ7oL7U1tVoHLUj-gVUwM-7uzBGFsAXD_A_cx_JyAZP4Td-GMBJ-AebJNRAQP0m0v253eKMkURp63aG4%3Ds0-d-e1-ft.png",
"imageUrl": "http://chasdeikaduri.org/images/523455_516325865106850_1885515210_n.jpg",
"estimatedHours": 200,
- "currentStatus": "started"
+ "interestedCampers": [],
+ "confirmedCampers": [],
+ "currentStatus": "completed"
},
{
"id": "bd7158d8c464cbafaeb4bdef",
@@ -34,8 +34,6 @@
],
"whatDoesNonprofitDo": "We connect simple technology with last mile communities to reduce poverty.",
"websiteLink": "http://kopernik.info/",
- "stakeholderName": "Amber Gregory",
- "stakeholderEmail": "amber.gregory@kopernik.info",
"name": "Kopernik",
"endUser": "Women in rural Indonesia.",
"approvedDeliverables": [
@@ -54,8 +52,6 @@
],
"whatDoesNonprofitDo": "We distribute biodegradable toothbrushes globally to children in need.",
"websiteLink": "http://www.operationbrush.org/",
- "stakeholderName": "Dane Jonas",
- "stakeholderEmail": "DaneJonas@operationbrush.org",
"name": "Operation Brush",
"endUser": "Donors",
"approvedDeliverables": [
@@ -65,7 +61,9 @@
"logoUrl": "https://trello-attachments.s3.amazonaws.com/54d9810307b159a4d9027aa2/54d981bfe5eb145560fbb769/x/cf7f318bfe4aee631b0d0eeef272225c/logo.png",
"imageUrl": "http://www.operationbrush.org/images/temp/hands1.png",
"estimatedHours": 100,
- "currentStatus": "started"
+ "interestedCampers": [],
+ "confirmedCampers": [],
+ "currentStatus": "completed"
},
{
"id": "bd1325d8c464cbafaeb5bdef",
@@ -74,10 +72,8 @@
],
"whatDoesNonprofitDo": "We are the largest roller derby league in the world with around 250 adults and 150 junior skater members plus 500+ volunteers.",
"websiteLink": "http://www.rosecityrollers.com/about/our-charities/",
- "stakeholderName": "Charity Kuahiwinui",
- "stakeholderEmail": "insurance@rosecityrollers.com",
"name": "Rose City Rollers",
- "endUser": "Administrators, Coaches, and Volunteers",
+ "endUser": "Roller derby administrators, coaches, and volunteers",
"approvedDeliverables": [
"community"
],
@@ -92,10 +88,8 @@
"requestedDeliverables": [
"website"
],
- "whatDoesNonprofitDo": "Save a Child's Heart provides urgently needed pediatric heart surgery and follow-up care for indigent children from developing countries",
+ "whatDoesNonprofitDo": "We provide urgently needed pediatric heart surgery and follow-up care for indigent children from developing countries",
"websiteLink": "http://www.saveachildsheart.com/global/young-leadership-program/",
- "stakeholderName": "Shier Ziser",
- "stakeholderEmail": "Shier_z@hotmail.com",
"name": "Save a Child's Heart",
"endUser": "Donors",
"approvedDeliverables": [
@@ -112,10 +106,8 @@
"requestedDeliverables": [
"website"
],
- "whatDoesNonprofitDo": "Savvy Cyber Kids enables youth to be empowered with technology by providing age appropriate resources and education.",
+ "whatDoesNonprofitDo": "We empower youth with technology by providing age appropriate resources and education.",
"websiteLink": "http://savvycyberkids.org/",
- "stakeholderName": "Ben Halpert",
- "stakeholderEmail": "info@savvycyberkids.org ",
"name": "Savvy Cyber Kids",
"endUser": "Donors",
"approvedDeliverables": [
@@ -132,10 +124,8 @@
"requestedDeliverables": [
"other"
],
- "whatDoesNonprofitDo": "Transcendent Pathways",
+ "whatDoesNonprofitDo": "We bring a new edge to arts and medicine in the Bay Area through powerful live performances of new music to those who feel marginalized by their affliction.",
"websiteLink": "http://transcendentpathways.org/",
- "stakeholderName": "Mark Ackerley",
- "stakeholderEmail": "mackerley.music@gmail.com",
"name": "Transcendent Pathways",
"endUser": "Medical Facilities, Musicians",
"approvedDeliverables": [
@@ -152,19 +142,82 @@
"requestedDeliverables": [
"other"
],
- "whatDoesNonprofitDo": "Timeraiser is a volunteer matching fair, a silent art auction, and a night out on the town. The big Timeraiser twist is rather than bid money on artwork, participants bid volunteer hours. ",
+ "whatDoesNonprofitDo": "We have provide volunteer matching fairs and silent art auctions at events across Canada. Rather than bid money on artwork, participants bid volunteer hours.",
"websiteLink": "http://www.timeraiser.ca/",
- "stakeholderName": "Stephanie McAllister",
- "stakeholderEmail": "stephanie@timeraiser.ca",
"name": "Timeraiser",
- "endUser": "Eventgoers",
+ "endUser": "Working professionals who want to donate their time and expertise",
"approvedDeliverables": [
"other"
],
"projectDescription": "Campers will build a mobile responsive web form to allow Timeraiser eventgoers to select which nonprofit organizations they're interested in volunteering with. System will have Salesforce integration and reporting capabilities.",
"logoUrl": "http://www.timeraiser.ca/uploads/5/6/1/4/5614163/1277176.png?480",
"imageUrl": "http://www.timeraiser.ca/uploads/5/6/1/4/5614163/______________4571248_orig.png",
+ "currentStatus": "started",
+ "interestedCampers": [],
+ "confirmedCampers": [],
"estimatedHours": 100,
+ "currentStatus": "completed"
+ },
+ {
+ "id": "bd1325d8c464cbafaeb7bdef",
+ "requestedDeliverables": [
+ "website",
+ "inventory",
+ "form"
+ ],
+ "whatDoesNonprofitDo": "We focus on raising funds to assist injured homeless animals.",
+ "websiteLink": "http://www.peoplesavinganimals.org/",
+ "name": "People Saving Animals",
+ "endUser": "Animal shelters in Central America and people adopting pets",
+ "approvedDeliverables": [
+ "website",
+ "inventory",
+ "form"
+ ],
+ "projectDescription": "Campers will build an adoption database and all related web interfaces and forms to allow animal shelters to easily post animals, photos, and relevant medical information. They'll make it easy for locals to browse these animals and adopt them. Once completed, this project will be translated into Spanish.",
+ "logoUrl": "https://scontent-sjc2-1.xx.fbcdn.net/hphotos-xfa1/v/t1.0-9/59709_501505959886494_1605714757_n.jpg?oh=e12c08c046d824765a02242b7c8c3bb5&oe=560CFA6A",
+ "imageUrl": "https://scontent-sjc2-1.xx.fbcdn.net/hphotos-xta1/t31.0-8/11270516_844556088914811_757350153964826829_o.jpg",
+ "estimatedHours": 300,
"currentStatus": "started"
+ },
+ {
+ "id": "bd1325d8c464cbafaeb6bdef",
+ "requestedDeliverables": [
+ "inventory",
+ "form",
+ "other"
+ ],
+ "whatDoesNonprofitDo": "We preserve Florida's health by regulating septic contractors and reviewing logs of sewage collection and disposal.",
+ "websiteLink": "http://www.floridahealth.gov/",
+ "name": "Florida Department of Health",
+ "endUser": "Government workers and independent contractors who must comply with regulations.",
+ "approvedDeliverables": [
+ "inventory",
+ "form",
+ "other"
+ ],
+ "projectDescription": "Campers will build mobile responsive web forms to allow contractors to seamlessly log the chain of custody for potentially hazardous sewage. They'll also build a government-facing database that allows for easy monitoring and reporting of activity.",
+ "logoUrl": "http://www.floridahealth.gov/_new/_files/images/DOH_logo.png",
+ "imageUrl": "http://www.dep.state.fl.us/central/Home/Watershed/Home.jpg",
+ "estimatedHours": 200,
+ "currentStatus": "started"
+ },
+ {
+ "id": "bd1325d8c464cbafaeb6bdef",
+ "requestedDeliverables": [
+ "website"
+ ],
+ "whatDoesNonprofitDo": "We strengthen the value of songwriting and independent music in Columbus, Ohio.",
+ "websiteLink": "http://columbussongwritersassociation.com",
+ "name": "Columbus Songwriters Association",
+ "endUser": "Songwriters and their audiences in the Columbus, Ohio community.",
+ "approvedDeliverables": [
+ "website"
+ ],
+ "projectDescription": "Build mobile responsive website that allows users to see browse our partners, their photos and information, and connect with them.",
+ "logoUrl": "https://columbussongwritersassociation.files.wordpress.com/2014/06/csa-logo.jpeg?w=705&h=435&crop=1",
+ "imageUrl": "https://columbussongwritersassociation.files.wordpress.com/2015/03/10502364_918551148225410_5082247612691070613_n.jpg?w=705&h=344&crop=1",
+ "estimatedHours": 100,
+ "currentStatus": "completed"
}
]
diff --git a/seed_data/seed.js b/seed_data/seed.js
index 95c35b328f..351d78da67 100644
--- a/seed_data/seed.js
+++ b/seed_data/seed.js
@@ -1,96 +1,77 @@
require('dotenv').load();
-var Bonfire = require('../models/Bonfire.js'),
- Courseware = require('../models/Courseware.js'),
- FieldGuide = require('../models/FieldGuide.js'),
- Nonprofit = require('../models/Nonprofit.js'),
- mongoose = require('mongoose'),
- secrets = require('../config/secrets'),
- coursewares = require('./coursewares.json'),
- fieldGuides = require('./field-guides.json'),
- nonprofits = require('./nonprofits.json'),
- bonfires = require('./bonfires.json');
+var Challenge = require('../models/Challenge.js'),
+ FieldGuide = require('../models/FieldGuide.js'),
+ Nonprofit = require('../models/Nonprofit.js'),
+ mongoose = require('mongoose'),
+ secrets = require('../config/secrets'),
+ fieldGuides = require('./field-guides.json'),
+ nonprofits = require('./nonprofits.json'),
+ fs = require('fs');
mongoose.connect(secrets.db);
+var challenges = fs.readdirSync(__dirname + '/challenges');
var counter = 0;
-var offerings = 4;
+var offerings = 2 + challenges.length;
var CompletionMonitor = function() {
- counter++;
- console.log('call ' + counter);
+ counter++;
+ console.log('call ' + counter);
- if (counter < offerings) {
- return;
- } else {
- process.exit(0);
- }
+ if (counter < offerings) {
+ return;
+ } else {
+ process.exit(0);
+ }
};
-
-Bonfire.remove({}, function(err, data) {
- if (err) {
- console.error(err);
- } else {
- console.log('Deleted ', data);
- }
- Bonfire.create(bonfires, function(err, data) {
- if (err) {
- console.log(err);
- } else {
- console.log('Saved ', data);
- }
+Challenge.remove({}, function(err, data) {
+ if (err) {
+ console.err(err);
+ } else {
+ console.log('Deleted ', data);
+ }
+ challenges.forEach(function (file) {
+ Challenge.create(require('./challenges/' + file).challenges, function (err, data) {
+ if (err) {
+ console.log(err);
+ } else {
+ console.log('Successfully parsed %s', file);
CompletionMonitor();
+ }
});
- console.log('bonfires');
+ });
});
-
-Courseware.remove({}, function(err, data) {
- if (err) {
- console.error(err);
- } else {
- console.log('Deleted ', data);
- }
- Courseware.create(coursewares, function(err, data) {
- if (err) {
- console.log(err);
- } else {
- console.log('Saved ', data);
- }
- CompletionMonitor();
- });
- console.log('coursewares');
-});
-
FieldGuide.remove({}, function(err, data) {
+ if (err) {
+ console.error(err);
+ } else {
+ console.log('Deleted ', data);
+ }
+ FieldGuide.create(fieldGuides, function(err, data) {
if (err) {
- console.error(err);
+ console.log(err);
} else {
- console.log('Deleted ', data);
+ console.log('Saved ', data);
}
- FieldGuide.create(fieldGuides, function(err, data) {
- if (err) {
- console.log(err);
- } else {
- console.log('Saved ', data);
- }
- CompletionMonitor();
- });
- console.log('field guides');
+ CompletionMonitor();
+ });
+ console.log('field guides');
});
Nonprofit.remove({}, function(err, data) {
+ if (err) {
+ console.error(err);
+ } else {
+ console.log('Deleted ', data);
+ }
+ Nonprofit.create(nonprofits, function(err, data) {
if (err) {
- console.error(err);
+ console.log(err);
} else {
- console.log('Deleted ', data);
+ console.log('Saved ', data);
}
- Nonprofit.create(nonprofits, function(err, data) {
- if (err) {
- console.log(err);
- } else {
- console.log('Saved ', data);
- }
- CompletionMonitor();
- });
- console.log('nonprofits');
+ CompletionMonitor();
+ });
+ console.log('nonprofits');
});
diff --git a/seed_data/storyCleanup.js b/seed_data/storyCleanup.js
index 2598526c8a..c216e67293 100644
--- a/seed_data/storyCleanup.js
+++ b/seed_data/storyCleanup.js
@@ -18,8 +18,8 @@ function storyLinkCleanup(cb) {
console.log(i++);
this.pause();
story.storyLink = story.storyLink.
- replace(/[^a-z0-9\s]/gi, '').
replace(/\s+/g, ' ').
+ replace(/[^a-z0-9\s]/gi, '').
toLowerCase().
trim();
story.save(function (err) {
diff --git a/seed_data/userMigration.js b/seed_data/userMigration.js
index ffad7be0c4..9b27cb3cd9 100644
--- a/seed_data/userMigration.js
+++ b/seed_data/userMigration.js
@@ -1,9 +1,9 @@
+/*eslint-disable block-scoped-var */
require('dotenv').load();
-var mongodb = require('mongodb'),
- User = require('../models/User.js'),
- newChallenges = require('./challengeMapping.json'),
- secrets = require('../config/secrets');
- mongoose = require('mongoose');
+var User = require('../models/User.js'),
+ secrets = require('../config/secrets'),
+ mongoose = require('mongoose'),
+ R = require('ramda');
mongoose.connect(secrets.db);
@@ -57,6 +57,7 @@ function userModelMigration(cb) {
stream.on('data', function (user) {
console.log(i++);
+ /*
if (user.challengesHash) {
this.pause();
user.needsMigration = false;
@@ -88,6 +89,25 @@ function userModelMigration(cb) {
user.progressTimestamps.push(bonfire.completedDate);
});
}
+ */
+ user.needsMigration = false;
+ user.completedChallenges = R.filter(function(elem) {
+ return elem; // getting rid of undefined
+ }, R.concat(
+ user.completedCoursewares,
+ user.completedBonfires.map(function(bonfire) {
+ return ({
+ completedDate: bonfire.completedDate,
+ _id: bonfire._id,
+ name: bonfire.name,
+ completedWith: bonfire.completedWith,
+ solution: bonfire.solution,
+ githubLink: '',
+ verified: false,
+ challengeType: 5
+ });
+ })
+ ));
var self = this;
user.save(function (err) {
diff --git a/views/account/account.jade b/views/account/account.jade
index 918531960a..3ad7a8d442 100644
--- a/views/account/account.jade
+++ b/views/account/account.jade
@@ -117,7 +117,7 @@ block content
span.ion-close-circled
| Your name must be fewer than 15 characters.
.form-group
- label.col-sm-3.col-sm-offset-2.control-label(for='email') Github
+ label.col-sm-3.col-sm-offset-2.control-label(for='email') GitHub
.col-sm-4
input.form-control(type='url', name='githubProfile', id='githubProfile', autocomplete="off", ng-model='user.profile.githubProfile', placeholder='http://')
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.githubProfile.$error.url && !profileForm.githubProfile.$pristine")
diff --git a/views/account/show.jade b/views/account/show.jade
index f202664703..c3255edd26 100644
--- a/views/account/show.jade
+++ b/views/account/show.jade
@@ -150,7 +150,7 @@ block content
td.col-xs-4= challenge.name
td.col-xs-2= moment(challenge.completedDate, 'x').format("MMM DD, YYYY")
td.col-xs-6
- a(href=challenge.solution) View my solution
+ a(href=challenge.solution, target='_blank') View my solution
br
- if (bonfires.length > 0)
@@ -164,7 +164,7 @@ block content
for bonfire in bonfires
tr
td.col-xs-4
- a(href='/bonfires/' + bonfire.name)= bonfire.name
+ a(href='/challenges/' + bonfire.name, target='_blank')= bonfire.name
td.col-xs-2= moment(bonfire.completedDate, 'x').format("MMM DD, YYYY")
td.col-xs-6
pre.wrappable= bonfire.solution
diff --git a/views/bonfire/bonfire.jade b/views/bonfire/bonfire.jade
deleted file mode 100644
index a5fdabf7ca..0000000000
--- a/views/bonfire/bonfire.jade
+++ /dev/null
@@ -1,45 +0,0 @@
-extends ../layout-wide
-block content
- script(src='/js/lib/codemirror/lib/codemirror.js')
- script(src='/js/lib/codemirror/addon/edit/closebrackets.js')
- script(src='/js/lib/codemirror/addon/edit/matchbrackets.js')
- script(src='/js/lib/codemirror/addon/lint/lint.js')
- script(src='/js/lib/codemirror/addon/lint/javascript-lint.js')
- script(src='//ajax.aspnetcdn.com/ajax/jshint/r07/jshint.js')
- script(src='/js/lib/chai/chai.js')
- link(rel='stylesheet', href='/js/lib/codemirror/lib/codemirror.css')
- link(rel='stylesheet', href='/js/lib/codemirror/addon/lint/lint.css')
- link(rel='stylesheet', href='/js/lib/codemirror/theme/monokai.css')
- link(rel="stylesheet", href="http://fonts.googleapis.com/css?family=Ubuntu+Mono")
- script(src='/js/lib/codemirror/mode/javascript/javascript.js')
- script(src='/js/lib/jailed/jailed.js')
- script(src='/js/lib/bonfire/bonfireInit.js')
- .row
- script(type="text/javascript").
- var tests = !{JSON.stringify(tests)};
- var challengeSeed = !{JSON.stringify(challengeSeed)};
- var challengeEntryPoint = !{JSON.stringify(challengeEntryPoint)};
- var title = !{JSON.stringify(title)};
-
- #mainEditorPanel.col-sm-12.col-md-7.col-xs-12
- .panel.panel-primary.panel-bonfire
- .panel-heading.text-center Playground
- .panel.panel-body
- form.code
- .form-group.codeMirrorView
- textarea#codeEditor(autofocus=true)
-
-
- #testCreatePanel.col-sm-12.col-md-5.col-xs-12
- .panel.panel-primary.panel-bonfire
- .panel-heading.text-center Output
- .panel.panel-body
- #submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter)
- br
- form.code
- .form-group.codeMirrorView
- textarea#codeOutput
- br
- ul#testSuite.list-group
- br
- script(src='/js/lib/bonfire/bonfireFramework_v0.1.2.js')
\ No newline at end of file
diff --git a/views/bonfire/generator.jade b/views/bonfire/generator.jade
deleted file mode 100644
index 0d50bad791..0000000000
--- a/views/bonfire/generator.jade
+++ /dev/null
@@ -1,45 +0,0 @@
-extends ../layout
-block content
- .row
- .col-md-offset-2.col-md-8.col-lg-offset-2.col-lg-8.text-center
-
- h1 JSON generator for bonfire challenges - just fill the form out and get the correct format back
- .col-xs-12.col-sm-12.col-md-offset-1.col-md-10.col-lg-offset-1-col-lg-10
- .panel
- form.form-horizontal(method="POST", action="/bonfire-json-generator", name="bonfireInfo")
- .form-group
- label.col-sm-2.control-label(for='name') name:
- .col-sm-10
- input#name.form-control(type='text', placeholder='name', name="name")
- .form-group
- label.col-sm-2.control-label(for='difficultyField') difficulty:
- .col-sm-10
- label.radio-inline 1
- input#inlineRadio1(type='radio', name='difficulty', value='1')
- label.radio-inline 2
- input#inlineRadio2(type='radio', name='difficulty', value='2')
- label.radio-inline 3
- input#inlineRadio3(type='radio', name='difficulty', value='3')
- label.radio-inline 4
- input#inlineRadio4(type='radio', name='difficulty', value='4')
- label.radio-inline 5
- input#inlineRadio5(type='radio', name='difficulty', value='5')
- .form-group
- label.col-sm-2.control-label.wrappable(for='description') description:
- .col-sm-10
- textarea#description.form-control(name="description", rows=5, placeholder="Each \"paragraph\" needs to be separated by a line break(return key).")
- .form-group
- label.col-sm-2.control-label.wrappable(for='challengeSeed') challengeSeed:
- .col-sm-10
- textarea#challengeSeed.form-control(name="challengeSeed", rows=5)
- .form-group
- label.col-sm-2.control-label.wrappable(for='challengeEntryPoint') challenge entrypoint:
- .col-sm-10
- textarea#name.form-control(name="challengeEntryPoint", rows=1, type='text', placeholder="palindrome(\"eye\");")
- .form-group
- label.col-sm-2.control-label.wrappable(for='tests') tests:
- .col-sm-10
- textarea#tests.form-control(name="tests", rows=5, placeholder="Separate tests by a newline.")
- .form-group
- .col-sm-offset-2.col-sm-10
- input.btn.btn-default(type='submit', value="submit")
diff --git a/views/bonfire/public-generator.jade b/views/bonfire/public-generator.jade
deleted file mode 100644
index 4425d90b18..0000000000
--- a/views/bonfire/public-generator.jade
+++ /dev/null
@@ -1,44 +0,0 @@
-extends ../layout
-block content
- .row
- .col-md-offset-2.col-md-8.col-lg-offset-2.col-lg-8.text-center
- h1 Welcome to the challenge generator. Test your ideas out and see them live in bonfire!
- .col-xs-12.col-sm-12.col-md-offset-1.col-md-10.col-lg-offset-1-col-lg-10
- .panel
- form.form-horizontal(method="POST", action="/bonfire-challenge-generator", name="bonfireInfo")
- .form-group
- label.col-sm-2.control-label(for='name') name:
- .col-sm-10
- input#name.form-control(type='text', placeholder='name', name="name")
- .form-group
- label.col-sm-2.control-label(for='difficultyField') difficulty:
- .col-sm-10
- label.radio-inline 1
- input#inlineRadio1(type='radio', name='difficulty', value='1')
- label.radio-inline 2
- input#inlineRadio2(type='radio', name='difficulty', value='2')
- label.radio-inline 3
- input#inlineRadio3(type='radio', name='difficulty', value='3')
- label.radio-inline 4
- input#inlineRadio4(type='radio', name='difficulty', value='4')
- label.radio-inline 5
- input#inlineRadio5(type='radio', name='difficulty', value='5')
- .form-group
- label.col-sm-2.control-label.wrappable(for='description') description:
- .col-sm-10
- textarea#description.form-control(name="description", rows=5, placeholder="Each \"paragraph\" needs to be separated by a line break(return key).")
- .form-group
- label.col-sm-2.control-label.wrappable(for='challengeSeed') challengeSeed:
- .col-sm-10
- textarea#challengeSeed.form-control(name="challengeSeed", rows=5)
- .form-group
- label.col-sm-2.control-label.wrappable(for='challengeEntryPoint') challenge entrypoint:
- .col-sm-10
- textarea#name.form-control(name="challengeEntryPoint", rows=1, type='text', placeholder="palindrome(\"eye\");")
- .form-group
- label.col-sm-2.control-label.wrappable(for='tests') tests:
- .col-sm-10
- textarea#tests.form-control(name="tests", rows=5, placeholder="Separate tests by a newline.")
- .form-group
- .col-sm-offset-2.col-sm-10
- input.btn.btn-default(type='submit', value="submit")
diff --git a/views/challengeMap/show.jade b/views/challengeMap/show.jade
index 71f7c20fe1..a83a74feab 100644
--- a/views/challengeMap/show.jade
+++ b/views/challengeMap/show.jade
@@ -1,5 +1,11 @@
extends ../layout
block content
+ script.
+ var bonfireList = !{JSON.stringify(bonfires)};
+ var waypointList = !{JSON.stringify(waypoints)};
+ var ziplineList = !{JSON.stringify(ziplines)};
+ var basejumpList = !{JSON.stringify(basejumps)};
+ var completedChallenges = !{JSON.stringify(completedChallengeList)};
.panel.panel-info
.panel-heading.text-center
h1 Challenge Map
@@ -8,7 +14,7 @@ block content
img.img-responsive.img-center.border-radius-5(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner-dino.png')
else
img.img-responsive.img-center.border-radius-5(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner.png')
- .col-xs-12.col-md-8.col-md-offset-2
+ .col-xs-12.col-md-10.col-md-offset-1
h2.text-center
span.text-primary #{camperCount}
| campers have joined our community
@@ -16,99 +22,40 @@ block content
| since we launched
span.text-primary #{daysRunning}
| days ago.
- h2
- span.fa.fa-flag
- | Waypoints (200 hours of lessons)
+ .spacer
+ for challengeBlock in challengeList
+ .row
+ .col-xs-12.col-sm-8.col-sm-offset-2
+ h3 #{challengeBlock.name}
+ .row
+ .col-xs-12
+ ol
+ for challenge in challengeBlock.challenges
+ if completedChallengeList.indexOf(challenge._id) > -1
+ .row
+ .hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center.large-p.negative-10
+ .col-xs-12.col-sm-9.col-md-10
+ li.faded.large-p.negative-10
+ a(href="/challenges/#{challenge.name}")= challenge.name
- .col-xs-12.no-right-padding
- h3.negative-15
- ol
- for waypoint in waypoints
- if completedCoursewareList.indexOf(waypoint._id) > -1
- .row
- .hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center
- .col-xs-12.col-sm-9.col-md-10
- li.faded
- a(href="/challenges/#{waypoint.name}")= waypoint.name
-
- else
- .row
- .hidden-xs.col-sm-3.col-md-2
- span
- .col-xs-12.col-sm-9.col-md-10
- li
- a(href="/challenges/#{waypoint.name}")= waypoint.name
- h2
- span.ion-bonfire
- | Bonfires (200 hours of JavaScript algorithm practice)
- .col-xs-12
- h3.negative-15
- ol
- for bonfire in bonfires
- if completedBonfireList.indexOf(bonfire._id) > -1
- .row
- .hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center
- .col-xs-12.col-sm-9.col-md-10
- li.faded
- a(href="/bonfires/#{bonfire.name}")= bonfire.name
- else
- .row
- .hidden-xs.col-sm-3.col-md-2
- span
- .col-xs-12.col-sm-9.col-md-10
- li
- a(href="/bonfires/#{bonfire.name}")= bonfire.name
- h2
- span.fa.fa-angle-double-right
- | Ziplines (200 hours of front end development)
- .col-xs-12
- h3.negative-15
- ol
- for zipline in ziplines
- if completedCoursewareList.indexOf(zipline._id) > -1
- .row
- .hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center
- .col-xs-12.col-sm-9.col-md-10
- li.faded
- a(href="/challenges/#{zipline.name}")= zipline.name
- else
- .row
- .hidden-xs.col-sm-3.col-md-2
- span
- .col-xs-12.col-sm-9.col-md-10
- li
- a(href="/challenges/#{zipline.name}")= zipline.name
- h2
- span.fa.fa-level-down
- | Basejumps (200 hours of full stack development)
- .col-xs-12
- h3.negative-15
- ol
- for basejump in basejumps
- if completedCoursewareList.indexOf(basejump._id) > -1
- .row
- .hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center
- .col-xs-12.col-sm-9.col-md-10
- li.faded
- a(href="/challenges/#{basejump.name}")= basejump.name
- else
- .row
- .hidden-xs.col-sm-3.col-md-2
- span
- .col-xs-12.col-sm-9.col-md-10
- li
- a(href="/challenges/#{basejump.name}")= basejump.name
- h2
- span.ion-ios-heart Nonprofit Projects (800 hours of real-world experience)*
- h3.negative-15
- ul
- .row
- .hidden-xs.col-sm-3.col-md-2
- span
- .col-xs-12.col-sm-9.col-md-10
- li
- a(href="/nonprofits/directory") Browse our nonprofit projects
- p * Complete all Waypoints, Bonfires, Ziplines and Basejumps to be assigned your first nonprofit project
+ else
+ .row
+ .hidden-xs.col-sm-3.col-md-2
+ span.negative-10
+ .col-xs-12.col-sm-9.col-md-10
+ li.large-p.negative-10
+ a(href="/challenges/#{challenge.name}")= challenge.name
+ h3.text-center Nonprofit Projects (800 hours of real-world experience)*
+ .row
+ .col-xs-12
+ ul
+ .row
+ .hidden-xs.col-sm-3.col-md-2
+ span.negative-10
+ .col-xs-12.col-sm-9.col-md-10
+ li.large-p.negative-10
+ a(href="/nonprofits/directory") Browse our nonprofit projects
+ p * Complete all Waypoints, Bonfires, Ziplines and Basejumps to be assigned your first nonprofit project
#announcementModal.modal(tabindex='-1')
.modal-dialog.animated.fadeInUp.fast-animation
diff --git a/views/coursewares/getstuff.jade b/views/coursewares/getstuff.jade
new file mode 100644
index 0000000000..6645059ee2
--- /dev/null
+++ b/views/coursewares/getstuff.jade
@@ -0,0 +1,9 @@
+//
+ Created by nathanleniz on 5/19/15.
+
+extends ../layout-wide
+block content
+ script.
+ var stuff = !{JSON.stringify(stuff)};
+ var challengeMapWithIds = !{JSON.stringify(stuffWithIds)};
+
diff --git a/views/bonfire/show.jade b/views/coursewares/showBonfire.jade
similarity index 72%
rename from views/bonfire/show.jade
rename to views/coursewares/showBonfire.jade
index 9a28e530c2..9c4a9d7c41 100644
--- a/views/bonfire/show.jade
+++ b/views/coursewares/showBonfire.jade
@@ -6,7 +6,7 @@ block content
script(type='text/javascript', src='/js/lib/codemirror/addon/edit/matchbrackets.js')
script(type='text/javascript', src='/js/lib/codemirror/addon/lint/lint.js')
script(type='text/javascript', src='/js/lib/codemirror/addon/lint/javascript-lint.js')
- script(type='text/javascript', src='//ajax.aspnetcdn.com/ajax/jshint/r07/jshint.js')
+ script(type='text/javascript', src='/bower_components/jshint/dist/jshint.js')
script(type='text/javascript', src='/js/lib/chai/chai.js')
link(rel='stylesheet', href='/js/lib/codemirror/lib/codemirror.css')
link(rel='stylesheet', href='/js/lib/codemirror/addon/lint/lint.css')
@@ -14,9 +14,9 @@ block content
link(rel="stylesheet", href="http://fonts.googleapis.com/css?family=Ubuntu+Mono")
script(type='text/javascript', src='/js/lib/codemirror/mode/javascript/javascript.js')
script(type='text/javascript', src='/js/lib/jailed/jailed.js')
- script(type='text/javascript', src='/js/lib/bonfire/bonfireInit.js')
+ script(type='text/javascript', src='/js/lib/coursewares/sandbox.js')
- .row
+ .row(ng-controller="pairedWithController")
.col-xs-12.col-sm-12.col-md-4.bonfire-top
#testCreatePanel
h1#bonfire-name.text-center= name
@@ -58,9 +58,6 @@ block content
i.ion-ios-flame
i.ion-ios-flame
i.ion-ios-flame
- p.text-center Tips: Use
- a(href='/field-guide/how-do-i-get-help-when-I-get-stuck') RSAP
- | . Try to pair program. Write your own code.
.well
.row
.col-xs-12
@@ -73,7 +70,7 @@ block content
#long-instructions.row.hide
.col-xs-12
for sentence in details
- p!= sentence
+ p.wrappable!= sentence
#MDN-links
p Here are some helpful links:
for link, index in MDNlinks
@@ -82,8 +79,31 @@ block content
span.ion-arrow-up-b
| Less information
+ if (user)
+ form.form-horizontal(novalidate='novalidate', name='completedWithForm')
+ .form-group.text-center
+ .col-xs-12
+ // extra field to distract password tools like lastpass from injecting css into our username field
+ input.form-control(ng-show="false")
+ input.form-control#completed-with(name="existingUser", placeholder="Your pair's username if pairing", existing-username='', ng-model="existingUser")
+ .col-xs-12(ng-cloak, ng-show="completedWithForm.$error.exists && !completedWithForm.existingUser.$pristine && existingUser.length > 0")
+ alert(type='danger')
+ span.ion-close-circled
+ | Username not found
#submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter)
- br
+ if (user)
+ .button-spacer
+ .btn-group.input-group.btn-group-justified
+ label.btn.btn-success#i-want-help
+ i.fa.fa-medkit
+ | Help
+ label.btn.btn-success#i-want-to-pair
+ i.fa.fa-user-plus
+ | Pair
+ label.btn.btn-success#report-issue
+ i.fa.fa-bug
+ | Bug
+ .button-spacer
form.code
.form-group.codeMirrorView
textarea#codeOutput(style='display: none;')
@@ -93,9 +113,10 @@ block content
script(type="text/javascript").
var tests = !{JSON.stringify(tests)};
var challengeSeed = !{JSON.stringify(challengeSeed)};
- var passedBonfireHash = !{JSON.stringify(bonfireHash)};
- var challengeName = !{JSON.stringify(name)};
+ var challenge_Id = !{JSON.stringify(challengeId)};
+ var challenge_Name = !{JSON.stringify(name)};
var started = Math.floor(Date.now());
+ var challengeType = !{JSON.stringify(challengeType)};
var _ = R;
var dashed = !{JSON.stringify(dashedName)};
@@ -104,36 +125,24 @@ block content
form.code
.form-group.codeMirrorView
textarea#codeEditor(autofocus=true, style='display: none;')
- script(src='/js/lib/bonfire/bonfireFramework_v0.1.3.js')
+ script(src='/js/lib/coursewares/coursewaresJSFramework_0.0.2.js')
-
-
- #complete-bonfire-dialog.modal(tabindex='-1')
+ #complete-courseware-dialog.modal(tabindex='-1')
.modal-dialog.animated.zoomIn.fast-animation
.modal-content
.modal-header.challenge-list-header= compliment
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
- .modal-body(ng-controller="pairedWithController")
+ .modal-body
.text-center
.animated.zoomInDown.delay-half
span.completion-icon.ion-checkmark-circled.text-primary
- if (user)
- form.form-horizontal(novalidate='novalidate', name='completedWithForm')
- .form-group.text-center
- .col-xs-10.col-xs-offset-1.col-sm-8.col-sm-offset-2.col-md-8.col-md-offset-2.animated.fadeIn
- // extra field to distract password tools like lastpass from injecting css into our username field
- input.form-control(ng-show="false")
- input.form-control#completed-with(name="existingUser", placeholder="If you paired, enter your pair's username here", existing-username='', ng-model="existingUser", autofocus)
- .col-xs-10.col-xs-offset-1.col-sm-8.col-sm-offset-2.col-md-8.col-md-offset-2(ng-cloak, ng-show="completedWithForm.$error.exists && !completedWithForm.existingUser.$pristine && existingUser.length > 0")
- alert(type='danger')
- span.ion-close-circled
- | Username not found
- a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block.next-bonfire-button(name='_csrf', value=_csrf, ng-disabled='completedWithForm.$invalid && existingUser.length > 0') Go to my next bonfire (ctrl + enter)
+ a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf) Go to my next challenge (ctrl + enter)
- if (user.progressTimestamps.length > 2)
- a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20Bonfire:%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/bonfires/#{dashedName}&hashtags=LearnToCode, JavaScript")
+ a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20Bonfire:%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript")
i.fa.fa-twitter
= phrase
- else
diff --git a/views/coursewares/showHTML.jade b/views/coursewares/showHTML.jade
index 6349650804..ad9481e868 100644
--- a/views/coursewares/showHTML.jade
+++ b/views/coursewares/showHTML.jade
@@ -5,7 +5,7 @@ block content
script(src='/js/lib/codemirror/addon/edit/matchbrackets.js')
script(src='/js/lib/codemirror/addon/lint/lint.js')
script(src='/js/lib/codemirror/addon/lint/javascript-lint.js')
- script(src='//ajax.aspnetcdn.com/ajax/jshint/r07/jshint.js')
+ script(src='/bower_components/jshint/dist/jshint.js')
script(src='/js/lib/chai/chai.js')
script(src='/js/lib/chai/chai-jquery.js')
link(rel='stylesheet', href='/js/lib/codemirror/lib/codemirror.css')
@@ -14,7 +14,7 @@ block content
link(rel="stylesheet", href="http://fonts.googleapis.com/css?family=Ubuntu+Mono")
script(src='/js/lib/codemirror/mode/javascript/javascript.js')
script(src='/js/lib/jailed/jailed.js')
- script(src='/js/lib/bonfire/bonfireInit.js')
+ script(src='/js/lib/bonfire/sandbox.js')
script(src='/js/lib/codemirror/mode/xml/xml.js')
script(src='/js/lib/codemirror/mode/css/css.js')
script(src='/js/lib/codemirror/mode/htmlmixed/htmlmixed.js')
@@ -43,6 +43,15 @@ block content
| Go to my next challenge
br
| (ctrl + enter)
+ .button-spacer
+ .btn-group.input-group.btn-group-justified
+ label.btn.btn-success#i-want-help
+ i.fa.fa-medkit
+ | Help
+ label.btn.btn-success#report-issue
+ i.fa.fa-bug
+ | Bug
+ .button-spacer
script.
var userLoggedIn = true;
- else
@@ -56,9 +65,8 @@ block content
$('#next-courseware-button').attr('disabled', 'disabled');
var tests = !{JSON.stringify(tests)};
var challengeSeed = !{JSON.stringify(challengeSeed)};
- var passedCoursewareHash = !{JSON.stringify(coursewareHash)};
- var challengeName = !{JSON.stringify(name)};
- var passedCoursewareName = challengeName;
+ var challenge_Id = !{JSON.stringify(challengeId)};
+ var challenge_Name = !{JSON.stringify(name)};
var prodOrDev = !{JSON.stringify(environment)};
var challengeType = !{JSON.stringify(challengeType)};
var started = Math.floor(Date.now());
diff --git a/views/coursewares/showJS.jade b/views/coursewares/showJS.jade
index b55d8ad4d9..345ac1fab4 100644
--- a/views/coursewares/showJS.jade
+++ b/views/coursewares/showJS.jade
@@ -5,7 +5,7 @@ block content
script(src='/js/lib/codemirror/addon/edit/matchbrackets.js')
script(src='/js/lib/codemirror/addon/lint/lint.js')
script(src='/js/lib/codemirror/addon/lint/javascript-lint.js')
- script(src='//ajax.aspnetcdn.com/ajax/jshint/r07/jshint.js')
+ script(src='/bower_components/jshint/dist/jshint.js')
script(src='/js/lib/chai/chai.js')
link(rel='stylesheet', href='/js/lib/codemirror/lib/codemirror.css')
link(rel='stylesheet', href='/js/lib/codemirror/addon/lint/lint.css')
@@ -13,7 +13,7 @@ block content
link(rel="stylesheet", href="http://fonts.googleapis.com/css?family=Ubuntu+Mono")
script(src='/js/lib/codemirror/mode/javascript/javascript.js')
script(src='/js/lib/jailed/jailed.js')
- script(src='/js/lib/bonfire/bonfireInit.js')
+ script(src='/js/lib/coursewares/sandbox.js')
.row
.col-xs-12.col-sm-12.col-md-4.bonfire-top
#testCreatePanel
@@ -30,12 +30,24 @@ block content
#long-instructions.row.hide
.col-xs-12
for sentence in details
- p!= sentence
+ p.wrappable!= sentence
#less-info.btn.btn-primary.btn-block.btn-primary-ghost
span.ion-arrow-up-b
| Less information
#submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter)
- br
+ .button-spacer
+ if (user)
+ .btn-group.input-group.btn-group-justified
+ label.btn.btn-success#i-want-help
+ i.fa.fa-medkit
+ | Help
+ label.btn.btn-success#i-want-to-pair
+ i.fa.fa-user-plus
+ | Pair
+ label.btn.btn-success#report-issue
+ i.fa.fa-bug
+ | Bug
+ .spacer
form.code
.form-group.codeMirrorView
textarea#codeOutput(style='display: none;')
@@ -45,10 +57,9 @@ block content
script(type="text/javascript").
var tests = !{JSON.stringify(tests)};
var challengeSeed = !{JSON.stringify(challengeSeed)};
- var passedCoursewareHash = !{JSON.stringify(coursewareHash)};
- var challengeName = !{JSON.stringify(name)};
+ var challenge_Id = !{JSON.stringify(challengeId)};
+ var challenge_Name = !{JSON.stringify(name)};
var challengeType = !{JSON.stringify(challengeType)};
- var passedCoursewareName = challengeName;
var started = Math.floor(Date.now());
.col-xs-12.col-sm-12.col-md-8
@@ -56,7 +67,7 @@ block content
form.code
.form-group.codeMirrorView
textarea#codeEditor(autofocus=true, style='display: none;')
- script(src='/js/lib/coursewares/coursewaresJSFramework_0.0.1.js')
+ script(src='/js/lib/coursewares/coursewaresJSFramework_0.0.2.js')
#complete-courseware-dialog.modal(tabindex='-1')
.modal-dialog.animated.zoomIn.fast-animation
.modal-content
diff --git a/views/coursewares/showVideo.jade b/views/coursewares/showVideo.jade
index 053d22e12e..4ea1ad5011 100644
--- a/views/coursewares/showVideo.jade
+++ b/views/coursewares/showVideo.jade
@@ -11,8 +11,7 @@ block content
.col-xs-3.col-sm-1.col-md-2.padded-ionic-icon.text-center
input(type='checkbox' class='challenge-list-checkbox')
.col-xs-9.col-sm-11.col-md-10
- li
- .step-text!= step
+ li.step-text.wrappable!= step
.col-xs-12.col-sm-12.col-md-8
.embed-responsive.embed-responsive-16by9
iframe.embed-responsive-item(src='//player.vimeo.com/video/#{video}')
@@ -21,19 +20,23 @@ block content
a.btn.btn-primary.btn-big.btn-block#completed-courseware I've completed this challenge (ctrl + enter)
script.
var userLoggedIn = true;
+ .button-spacer
+ .btn-group.input-group.btn-group-justified
+ .btn.btn-success.btn-big#i-want-help-editorless
+ i.fa.fa-medkit
+ | Get help
+ .btn.btn-success.btn-big#report-issue
+ i.fa.fa-bug
+ | Report a bug
+ .button-spacer
- else
a.btn.btn-big.signup-btn.btn-block(href='/login') Sign in so you can save your progress
script.
var userLoggedIn = false;
br
- .button-spacer
+
script(type="text/javascript").
- var tests = !{JSON.stringify(tests)};
- var passedCoursewareHash = !{JSON.stringify(coursewareHash)};
- var challengeName = !{JSON.stringify(name)};
- var passedCoursewareName = challengeName;
- var started = Math.floor(Date.now());
- var challengeType = !{JSON.stringify(challengeType)};
+
var controlEnterHandler = function(e) {
$('body').unbind('keypress');
if (e.ctrlKey && e.keyCode == 13) {
@@ -76,3 +79,7 @@ block content
h1 #{name}
script.
$('body').bind('keypress', controlEnterHandler);
+ script.
+ var challenge_Id = !{JSON.stringify(challengeId)};
+ var challenge_Name = !{JSON.stringify(name)};
+ var challengeType = !{JSON.stringify(challengeType)};
diff --git a/views/coursewares/showZiplineOrBasejump.jade b/views/coursewares/showZiplineOrBasejump.jade
index 5be1d7d897..1fe595c8d0 100644
--- a/views/coursewares/showZiplineOrBasejump.jade
+++ b/views/coursewares/showZiplineOrBasejump.jade
@@ -11,14 +11,25 @@ block content
.col-xs-3.col-sm-1.col-md-2.padded-ionic-icon.text-center
input(type='checkbox' class='challenge-list-checkbox')
.col-xs-9.col-sm-11.col-md-10
- li
- .step-text!= step
+ li.step-text.wrappable!= step
.col-xs-12.col-sm-12.col-md-8
.embed-responsive.embed-responsive-16by9
iframe.embed-responsive-item(src='//player.vimeo.com/video/#{video}')
br
- if (user)
- a.btn.btn-primary.btn-lg.btn-block#completed-zipline-or-basejump I've completed this challenge (ctrl + enter)
+ a.btn.btn-primary.btn-big.btn-block#completed-zipline-or-basejump I've completed this challenge (ctrl + enter)
+ .button-spacer
+ .btn-group.input-group.btn-group-justified
+ .btn.btn-success.btn-big#i-want-help-editorless
+ i.fa.fa-medkit
+ | Help
+ .btn.btn-success.btn-big#i-want-to-pair
+ i.fa.fa-user-plus
+ | Pair
+ .btn.btn-success.btn-big#report-issue
+ i.fa.fa-bug
+ | Bug
+ .button-spacer
script.
var userLoggedIn = true;
- else
@@ -27,9 +38,8 @@ block content
var userLoggedIn = false;
br
script(type="text/javascript").
- var passedCoursewareHash = !{JSON.stringify(coursewareHash)};
- var challengeName = !{JSON.stringify(name)};
- var passedCoursewareName = challengeName;
+ var challenge_Id = !{JSON.stringify(challengeId)};
+ var challenge_Name = !{JSON.stringify(name)};
var started = Math.floor(Date.now());
var challengeType = !{JSON.stringify(challengeType)};
var controlEnterHandler = function (e) {
diff --git a/views/field-guide/all-articles.jade b/views/field-guide/all-articles.jade
new file mode 100644
index 0000000000..80bc2f9091
--- /dev/null
+++ b/views/field-guide/all-articles.jade
@@ -0,0 +1,24 @@
+extends ../layout
+block content
+ .col-xs-12.col-sm-12.col-md-12
+ .panel.panel-info
+ .panel-heading.text-center Read our Field Guide in any order
+ .panel-body
+ .col-xs-12.col-md-10.col-md-offset-1
+ .col-xs-12.no-right-padding
+ h3
+ ol
+ each fieldGuide in allFieldGuideNamesAndIds
+ if completedFieldGuides.indexOf(fieldGuide.id) > -1
+ .row
+ .hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center
+ .col-xs-12.col-sm-9.col-md-10
+ li.faded
+ a(href="/field-guide/#{fieldGuide.name}")= fieldGuide.name
+ else
+ .row
+ .hidden-xs.col-sm-3.col-md-2
+ span
+ .col-xs-12.col-sm-9.col-md-10
+ li
+ a(href="/field-guide/#{fieldGuide.name}")= fieldGuide.name
diff --git a/views/field-guide/show.jade b/views/field-guide/show.jade
index dc159ef470..a81eb6682f 100644
--- a/views/field-guide/show.jade
+++ b/views/field-guide/show.jade
@@ -7,26 +7,17 @@ block content
h1= title
.panel-body
div!= description
- .spacer
- .spacer
- .spacer
.col-xs-12.col-sm-6.col-sm-offset-3
+ .spacer
.text-center
if user && user.uncompletedFieldGuides.length > 0
.next-field-guide-button.btn.btn-primary.btn-big.btn-block Next article (ctrl + enter)
.ten-pixel-break
- #showAllButton.btn.btn-info.btn-big.btn-block Show me all articles
+ a.btn.btn-info.btn-big.btn-block(href='/field-guide/all-articles') Show me all articles
if !user
.ten-pixel-break
- a.btn.btn-big.signup-btn.btn-block(href="/login") Start learning to code (it's free)
+ a.btn.btn-big.signup-btn.btn-block(href='/login') Start learning to code (it's free)
.spacer
- #show-all-dialog.modal(tabindex='-1')
- .modal-dialog.animated.fadeInUp.fast-animation
- .modal-content
- .modal-header.all-list-header Field Guide Articles
- a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
- .modal-body
- include ../partials/field-guide
#fieldGuideId.hidden= fieldGuideId
script.
$(document).ready(function() {
diff --git a/views/nonprofits/directory.jade b/views/nonprofits/directory.jade
index 309cad9287..61c5ff44ab 100644
--- a/views/nonprofits/directory.jade
+++ b/views/nonprofits/directory.jade
@@ -6,14 +6,15 @@ block content
.panel.panel-info
.panel-heading.text-center Nonprofits We Help
.panel-body
- for nonprofit in nonprofits
- .spacer
- .row
- .col-xs-12.col-sm-3
- img.img-responsive(src=nonprofit.logoUrl)
- .col-xs-12.col-sm-9
- h2.negative-15= nonprofit.name
- h3.negative-15= nonprofit.whatDoesNonprofitDo
- a.text-center.btn.btn-primary.btn-lg(href='/nonprofits/' + nonprofit.name.toLowerCase().replace(/\s/g, '-')) Read more
- .spacer
- .spacer
+ .col-xs-12.col-sm-12.col-md-10.col-md-offset-1
+ for nonprofit in nonprofits
+ .spacer
+ .row
+ .col-xs-12.col-sm-3
+ img.img-responsive.img-center(src=nonprofit.logoUrl)
+ .col-xs-12.col-sm-9
+ h2.negative-15= nonprofit.name
+ h3.negative-15= nonprofit.whatDoesNonprofitDo
+ a.text-center.btn.btn-primary.btn-lg(href='/nonprofits/' + nonprofit.name.toLowerCase().replace(/\s/g, '-')) Read more
+ .spacer
+ .spacer
diff --git a/views/nonprofits/show.jade b/views/nonprofits/show.jade
index 87d070239d..07a9c6cda0 100644
--- a/views/nonprofits/show.jade
+++ b/views/nonprofits/show.jade
@@ -61,21 +61,14 @@ block content
.text-center
a.btn.btn-primary.btn-big.btn-block.disabled(href='/nonprofits/interested-in-nonprofit/#{dashedName}') I'm interested in building this project *
p * Complete all our Bonfires, Ziplines, and Basejumps to unlock this.
- #showAllButton.btn.btn-info.btn-big.btn-block Show all Nonprofit Projects
+ a.btn.btn-info.btn-big.btn-block(href='/nonprofits/directory') Show all Nonprofit Projects
if (buttonActive)
.col-xs-12.col-sm-8.col-sm-offset-2
.text-center
a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/interested-in-nonprofit/#{dashedName}') I'm interested in building this project
- #showAllButton.btn.btn-info.btn-big.btn-block Show all Nonprofit Projects
+ a.btn.btn-info.btn-big.btn-block(href='/nonprofits/directory') Show all Nonprofit Projects
.row
.col-xs-12.text-center
if !user
a.btn.btn-cta.signup-btn.btn-primary(href="/login") Start learning to code (it's free)
- .spacer
- #show-all-dialog.modal(tabindex='-1')
- .modal-dialog.animated.fadeInUp.fast-animation
- .modal-content
- .modal-header.all-list-header Nonprofit Projects
- a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
- .modal-body
- include ../partials/nonprofits
+ .spacer
diff --git a/views/partials/footer.jade b/views/partials/footer.jade
index 8fdd3f26c3..6230b178ad 100644
--- a/views/partials/footer.jade
+++ b/views/partials/footer.jade
@@ -1,7 +1,7 @@
.fcc-footer
.col-xs-12.hidden-xs.hidden-sm
a.ion-speakerphone(href='http://blog.freecodecamp.com', target='_blank') Blog
- a.ion-social-github(href="http://github.com/freecodecamp", target='_blank') Github
+ a.ion-social-github(href="http://github.com/freecodecamp", target='_blank') GitHub
a.ion-social-twitch-outline(href="/twitch") Twitch
a.ion-social-facebook(href="/field-guide/how-can-i-find-other-free-code-camp-campers-in-my-city") Facebook
a.ion-social-twitter(href="http://twitter.com/freecodecamp", target='_blank') Twitter
diff --git a/views/partials/navbar.jade b/views/partials/navbar.jade
index 7f09909b4b..d8f766fcbf 100644
--- a/views/partials/navbar.jade
+++ b/views/partials/navbar.jade
@@ -15,7 +15,7 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height
if user
li
- a(href='/challenges') Next Challenge
+ a(href='/challenges') Learn
li
a(href='/map') Map
if (user && user.sentSlackInvite)
@@ -27,7 +27,9 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height
li
a(href='/news') News
li
- a(href='/field-guide') Field Guide
+ a(href='/field-guide') Guide
+ li.hidden-xs.hidden-sm
+ a(href='/jobs') Jobs
if !user
li
li
diff --git a/views/partials/universal-head.jade b/views/partials/universal-head.jade
index cfc3fc7b81..81b2895666 100644
--- a/views/partials/universal-head.jade
+++ b/views/partials/universal-head.jade
@@ -31,7 +31,7 @@ script(src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js")
script.
window.moment || document.write('
+