Merge branch 'staging' into clementine
Conflicts: seed/challenges/basejumps.json
This commit is contained in:
30
README.md
30
README.md
@ -15,7 +15,7 @@ Our campers (students) start by working through our free, self-paced, browser-ba
|
|||||||
|
|
||||||
80% of our campers are over 25, and nearly a fifth of our campers are women.
|
80% of our campers are over 25, and nearly a fifth of our campers are women.
|
||||||
|
|
||||||
This code is running live at [FreeCodeCamp.com](http://www.FreeCodeCamp.com). We also have [Gitter](https://gitter.im/FreeCodeCamp/FreeCodeCamp), a [blog](http://blog.freecodecamp.com), and even a [Twitch.tv channel](http://twitch.tv/freecodecamp).
|
This code is running live at [FreeCodeCamp.com](http://www.FreeCodeCamp.com). We also have [Gitter](https://gitter.im/FreeCodeCamp/FreeCodeCamp), a [blog](http://medium.freecodecamp.com), and even a [Twitch.tv channel](http://twitch.tv/freecodecamp).
|
||||||
|
|
||||||
[Join our community here](http://www.freecodecamp.com/signin).
|
[Join our community here](http://www.freecodecamp.com/signin).
|
||||||
|
|
||||||
@ -54,22 +54,26 @@ The easiest way to get started is to clone the repository:
|
|||||||
# Get the latest snapshot
|
# Get the latest snapshot
|
||||||
git clone --depth=1 https://github.com/freecodecamp/freecodecamp.git freecodecamp
|
git clone --depth=1 https://github.com/freecodecamp/freecodecamp.git freecodecamp
|
||||||
|
|
||||||
|
# Change directory
|
||||||
cd freecodecamp
|
cd freecodecamp
|
||||||
|
|
||||||
# Install NPM dependencies
|
# Install NPM dependencies
|
||||||
npm install
|
npm install
|
||||||
|
|
||||||
|
# Install Gulp globally
|
||||||
|
npm install -g gulp
|
||||||
|
|
||||||
|
# Install Bower globally
|
||||||
|
npm install -g bower
|
||||||
|
|
||||||
# Install Bower dependencies
|
# Install Bower dependencies
|
||||||
bower install
|
bower install
|
||||||
|
|
||||||
# Create a .env file and populate it with the necessary API keys and secrets:
|
# Create a .env file and populate it with the necessary API keys and secrets:
|
||||||
touch .env
|
touch .env
|
||||||
|
|
||||||
# Install Gulp globally
|
|
||||||
npm install -g gulp
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Edit your `.env` file with the following API keys accordingly (if you only use email login, only the `MONGOHQ_URL`, `SESSION_SECRET`, `MANDRILL_USER` and `MANDRILL_PASSWORD` fields are necessary. Keep in mind if you want to use more services you'll have to get your own API keys for those services.
|
Edit your `.env` file with the following API keys accordingly. If you only use email login, only the `MONGOHQ_URL`, `SESSION_SECRET`, `MANDRILL_USER` and `MANDRILL_PASSWORD` fields are necessary. Keep in mind if you want to use more services you'll have to get your own API keys for those services. If you only use a subset or no OAuth2 authentication methods, you may want to remove them from ```server/passport-providers.js``` - otherwise the server will complain about missing clientIDs at launch.
|
||||||
|
|
||||||
```
|
```
|
||||||
MONGOHQ_URL='mongodb://localhost:27017/freecodecamp'
|
MONGOHQ_URL='mongodb://localhost:27017/freecodecamp'
|
||||||
@ -107,20 +111,20 @@ DEBUG=true
|
|||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Start the mongo server
|
# Start the mongo server in a seperate terminal
|
||||||
mongod
|
mongod
|
||||||
|
|
||||||
# Create your mongo database.
|
# Initialize Free Code Camp
|
||||||
# Type "mongo" in your terminal to access the mongo shell
|
# This will seed the database for the first time.
|
||||||
use freecodecamp
|
# This command should only be run once.
|
||||||
# Exit the mongo shell with control + d
|
npm run first-time
|
||||||
|
|
||||||
# Seed your database with the challenges
|
|
||||||
node seed/
|
|
||||||
|
|
||||||
# start the application
|
# start the application
|
||||||
gulp
|
gulp
|
||||||
```
|
```
|
||||||
|
Now navigate to your browser and open http://localhost:3001
|
||||||
|
If the app loads, congratulations - you're all set. Otherwise, let us know by opening a GitHub issue and with your error.
|
||||||
|
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
File diff suppressed because one or more lines are too long
24
client/less/chat.less
Normal file
24
client/less/chat.less
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
.chat-embed-main-title {
|
||||||
|
display: flex;
|
||||||
|
flex-grow: 1;
|
||||||
|
padding-left: 31px;
|
||||||
|
padding-top: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gitter-chat-embed {
|
||||||
|
z-index: 100;
|
||||||
|
position: fixed;
|
||||||
|
|
||||||
|
top: 0;
|
||||||
|
left: 60%;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
transition: transform 0.3s cubic-bezier(0.16, 0.22, 0.22, 1.7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.gitter-chat-embed.is-collapsed:not(.is-loading) {
|
||||||
|
transform: translateX(110%);
|
||||||
|
}
|
@ -96,6 +96,10 @@ h1, h2, h3, h4, h5, h6, p, li {
|
|||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fa:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
.img-center {
|
.img-center {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
@ -491,14 +495,16 @@ thead {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.story-section {
|
.story-section {
|
||||||
min-height: 500px;
|
height: 500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.testimonial-copy {
|
.testimonial-copy {
|
||||||
font-size: 20px;
|
text-align: justify;
|
||||||
text-align: center;
|
font-size: 18px !important;
|
||||||
|
margin-left: 20px;
|
||||||
|
margin-right: 20px;
|
||||||
@media (min-width: 991px) and (max-width: 1199px) {
|
@media (min-width: 991px) and (max-width: 1199px) {
|
||||||
height: 120px;
|
height: 140px;
|
||||||
}
|
}
|
||||||
@media (min-width: 1200px) {
|
@media (min-width: 1200px) {
|
||||||
height: 90px;
|
height: 90px;
|
||||||
@ -949,6 +955,11 @@ code {
|
|||||||
margin: 0!important;
|
margin: 0!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// gitter chat
|
||||||
|
.gitter-chat-embed {
|
||||||
|
z-index: 20000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
//uncomment this to see the dimensions of all elements outlined in red
|
//uncomment this to see the dimensions of all elements outlined in red
|
||||||
//* {
|
//* {
|
||||||
// border-color: red;
|
// border-color: red;
|
||||||
@ -1056,3 +1067,5 @@ code {
|
|||||||
transform: rotate(0deg);
|
transform: rotate(0deg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@import "chat.less";
|
||||||
|
108
client/main.js
108
client/main.js
@ -2,6 +2,107 @@ var main = window.main || {};
|
|||||||
|
|
||||||
main.mapShareKey = 'map-shares';
|
main.mapShareKey = 'map-shares';
|
||||||
|
|
||||||
|
main.ga = window.ga || function() {};
|
||||||
|
|
||||||
|
main = (function(main) {
|
||||||
|
|
||||||
|
// should be set before gitter script loads
|
||||||
|
((window.gitter = {}).chat = {}).options = {
|
||||||
|
disableDefaultChat: true
|
||||||
|
};
|
||||||
|
// wait for sidecar to load
|
||||||
|
|
||||||
|
main.chat = {};
|
||||||
|
main.chat.isOpen = false;
|
||||||
|
main.chat.createHelpChat = function createHelpChat() {
|
||||||
|
throw new Error('Sidecar chat has not initialized');
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener('gitter-sidecar-ready', function(e) {
|
||||||
|
main.chat.GitterChat = e.detail.Chat;
|
||||||
|
|
||||||
|
main.chat.createHelpChat = function(room, helpChatBtnClass, roomTitle) {
|
||||||
|
roomTitle = roomTitle || 'Waypoint Help';
|
||||||
|
|
||||||
|
$('body').append(
|
||||||
|
'<aside id="chat-embed-help" class="gitter-chat-embed is-collapsed" />'
|
||||||
|
);
|
||||||
|
|
||||||
|
main.chat.helpChat = new main.chat.GitterChat({
|
||||||
|
room: room,
|
||||||
|
activationElement: false,
|
||||||
|
targetElement: $('#chat-embed-help')
|
||||||
|
});
|
||||||
|
|
||||||
|
$(helpChatBtnClass).on('click', function() {
|
||||||
|
// is button already pressed?
|
||||||
|
// no? open chat
|
||||||
|
// yes? close chat
|
||||||
|
var shouldChatBeOpen = !$(this).hasClass('active');
|
||||||
|
main.chat.helpChat.toggleChat(shouldChatBeOpen);
|
||||||
|
if (shouldChatBeOpen) {
|
||||||
|
$(helpChatBtnClass).addClass('active');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var helpTitleAdd = false;
|
||||||
|
$('#chat-embed-help').on('gitter-chat-toggle', function(e) {
|
||||||
|
var shouldButtonBePressed = !!e.originalEvent.detail.state;
|
||||||
|
|
||||||
|
if (!helpTitleAdd) {
|
||||||
|
helpTitleAdd = true;
|
||||||
|
$('#chat-embed-help > .gitter-chat-embed-action-bar').prepend(
|
||||||
|
'<div class="chat-embed-main-title">' +
|
||||||
|
'<span>' +
|
||||||
|
roomTitle +
|
||||||
|
'</span>' +
|
||||||
|
'</div>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldButtonBePressed) {
|
||||||
|
return $(helpChatBtnClass).addClass('active');
|
||||||
|
}
|
||||||
|
return $(helpChatBtnClass).removeClass('active');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$('body').append(
|
||||||
|
'<aside id="chat-embed-main" class="gitter-chat-embed is-collapsed" />'
|
||||||
|
);
|
||||||
|
|
||||||
|
main.chat.mainChat = new main.chat.GitterChat({
|
||||||
|
room: 'freecodecamp/freecodecamp',
|
||||||
|
activationElement: false,
|
||||||
|
targetElement: $('#chat-embed-main')
|
||||||
|
});
|
||||||
|
|
||||||
|
var mainChatTitleAdded = false;
|
||||||
|
$('#chat-embed-main').on('gitter-chat-toggle', function() {
|
||||||
|
if (mainChatTitleAdded) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
mainChatTitleAdded = true;
|
||||||
|
|
||||||
|
$('#chat-embed-main > .gitter-chat-embed-action-bar').prepend(
|
||||||
|
'<div class="chat-embed-main-title">' +
|
||||||
|
'<span>Free Code Camp\'s Main Chat</span>' +
|
||||||
|
'</div>'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#nav-chat-btn').on('click', function() {
|
||||||
|
if (!main.chat.isOpen) {
|
||||||
|
|
||||||
|
main.chat.mainChat.toggleChat(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return main;
|
||||||
|
}(main));
|
||||||
|
|
||||||
var lastCompleted = typeof lastCompleted !== 'undefined' ?
|
var lastCompleted = typeof lastCompleted !== 'undefined' ?
|
||||||
lastCompleted :
|
lastCompleted :
|
||||||
'';
|
'';
|
||||||
@ -36,9 +137,10 @@ function setMapShare(id) {
|
|||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
|
||||||
var challengeName = typeof challengeName !== 'undefined' ?
|
var challengeName = typeof challengeName !== 'undefined' ?
|
||||||
challengeName :
|
challengeName :
|
||||||
'Untitled';
|
'';
|
||||||
|
|
||||||
if (challengeName) {
|
if (challengeName) {
|
||||||
ga('send', 'event', 'Challenge', 'load', challengeName);
|
ga('send', 'event', 'Challenge', 'load', challengeName);
|
||||||
@ -133,13 +235,14 @@ $(document).ready(function() {
|
|||||||
'links to screenshots if possible.\n\n'
|
'links to screenshots if possible.\n\n'
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
if (editor.getValue().trim()) {
|
if (typeof editor !== 'undefined' && editor.getValue().trim()) {
|
||||||
var type;
|
var type;
|
||||||
switch (challengeType) {
|
switch (challengeType) {
|
||||||
case challengeTypes.HTML_CSS_JQ:
|
case challengeTypes.HTML_CSS_JQ:
|
||||||
type = 'html';
|
type = 'html';
|
||||||
break;
|
break;
|
||||||
case challengeTypes.JAVASCRIPT:
|
case challengeTypes.JAVASCRIPT:
|
||||||
|
case challengeTypes.BONFIRE:
|
||||||
type = 'javascript';
|
type = 'javascript';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -451,6 +554,7 @@ $(document).ready(function() {
|
|||||||
'&redirect_uri=http%3A%2F%2Ffreecodecamp%2Ecom%2Fmap';
|
'&redirect_uri=http%3A%2F%2Ffreecodecamp%2Ecom%2Fmap';
|
||||||
|
|
||||||
setMapShare(challengeBlockName);
|
setMapShare(challengeBlockName);
|
||||||
|
main.ga('send', 'event', 'FB_LINK', 'SHARE', 'Facebook map share');
|
||||||
window.location.href = link;
|
window.location.href = link;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"className": "ion-speakerphone",
|
"className": "ion-speakerphone",
|
||||||
"content": " Blog ",
|
"content": " Blog ",
|
||||||
"href": "http://blog.freecodecamp.com",
|
"href": "http://medium.freecodecamp.com",
|
||||||
"target": "_blank"
|
"target": "_blank"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -8,13 +8,17 @@ const initValue = {
|
|||||||
points: 0
|
points: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Store(initValue)
|
export default Store({
|
||||||
.refs({ displayName: 'AppStore' })
|
refs: {
|
||||||
.init(({ instance: appStore, args: [cat] }) => {
|
displayName: 'AppStore',
|
||||||
|
value: initValue
|
||||||
|
},
|
||||||
|
init({ instance: appStore, args: [cat] }) {
|
||||||
const { setUser, setTitle } = cat.getActions('appActions');
|
const { setUser, setTitle } = cat.getActions('appActions');
|
||||||
const register = createRegistrar(appStore);
|
const register = createRegistrar(appStore);
|
||||||
|
|
||||||
register(setter(fromMany(setUser, setTitle)));
|
register(setter(fromMany(setUser, setTitle)));
|
||||||
|
|
||||||
return appStore;
|
return appStore;
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { PropTypes } from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
import { Button, Col, Row, Panel } from 'react-bootstrap';
|
import { Button, Col, Row, Panel } from 'react-bootstrap';
|
||||||
import { Navigation } from 'react-router';
|
import { History } from 'react-router';
|
||||||
import Vimeo from 'react-vimeo';
|
import Vimeo from 'react-vimeo';
|
||||||
import debugFactory from 'debug';
|
import debugFactory from 'debug';
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ const debug = debugFactory('freecc:hikes');
|
|||||||
|
|
||||||
export default React.createClass({
|
export default React.createClass({
|
||||||
displayName: 'Lecture',
|
displayName: 'Lecture',
|
||||||
mixins: [Navigation],
|
mixins: [History],
|
||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
currentHike: PropTypes.object,
|
currentHike: PropTypes.object,
|
||||||
@ -20,7 +20,7 @@ export default React.createClass({
|
|||||||
handleFinish() {
|
handleFinish() {
|
||||||
debug('loading questions');
|
debug('loading questions');
|
||||||
const { dashedName } = this.props.params;
|
const { dashedName } = this.props.params;
|
||||||
this.transitionTo(`/hikes/${dashedName}/questions/1`);
|
this.history.pushState(null, `/hikes/${dashedName}/questions/1`);
|
||||||
},
|
},
|
||||||
|
|
||||||
renderTranscript(transcript, dashedName) {
|
renderTranscript(transcript, dashedName) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { PropTypes } from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
import { Spring } from 'react-motion';
|
import { Spring } from 'react-motion';
|
||||||
import { Navigation, TransitionHook } from 'react-router';
|
import { History, Lifecycle } from 'react-router';
|
||||||
import debugFactory from 'debug';
|
import debugFactory from 'debug';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@ -19,8 +19,8 @@ export default React.createClass({
|
|||||||
displayName: 'Question',
|
displayName: 'Question',
|
||||||
|
|
||||||
mixins: [
|
mixins: [
|
||||||
Navigation,
|
History,
|
||||||
TransitionHook
|
Lifecycle
|
||||||
],
|
],
|
||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
@ -150,7 +150,8 @@ export default React.createClass({
|
|||||||
|
|
||||||
postJSON$('/completed-challenge', { id, name }).subscribeOnCompleted(() => {
|
postJSON$('/completed-challenge', { id, name }).subscribeOnCompleted(() => {
|
||||||
if (tests[nextQuestionIndex]) {
|
if (tests[nextQuestionIndex]) {
|
||||||
return this.transitionTo(
|
return this.history.pushState(
|
||||||
|
null,
|
||||||
`/hikes/${ dashedName }/questions/${ nextQuestionIndex + 1 }`
|
`/hikes/${ dashedName }/questions/${ nextQuestionIndex + 1 }`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -168,13 +169,13 @@ export default React.createClass({
|
|||||||
}, null);
|
}, null);
|
||||||
|
|
||||||
if (nextHike) {
|
if (nextHike) {
|
||||||
return this.transitionTo(`/hikes/${ nextHike.dashedName }`);
|
return this.history.pushState(null, `/hikes/${ nextHike.dashedName }`);
|
||||||
}
|
}
|
||||||
debug(
|
debug(
|
||||||
'next Hike was not found, currentHike %s',
|
'next Hike was not found, currentHike %s',
|
||||||
currentHike.dashedName
|
currentHike.dashedName
|
||||||
);
|
);
|
||||||
this.transitionTo('/hikes');
|
this.history.pushState(null, '/hikes');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import debugFactory from 'debug';
|
|||||||
|
|
||||||
const debug = debugFactory('freecc:hikes:actions');
|
const debug = debugFactory('freecc:hikes:actions');
|
||||||
|
|
||||||
function getCurrentHike(hikes =[{}], dashedName, currentHike) {
|
function getCurrentHike(hikes = [{}], dashedName, currentHike) {
|
||||||
if (!dashedName) {
|
if (!dashedName) {
|
||||||
debug('no dashedName');
|
debug('no dashedName');
|
||||||
return hikes[0];
|
return hikes[0];
|
||||||
|
@ -5,12 +5,16 @@ const initialValue = {
|
|||||||
currentHike: {}
|
currentHike: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Store(initialValue)
|
export default Store({
|
||||||
.refs({ displayName: 'HikesStore'})
|
refs: {
|
||||||
.init(({ instance: hikeStore, args: [cat] }) => {
|
displayName: 'HikesStore',
|
||||||
|
value: initialValue
|
||||||
|
},
|
||||||
|
init({ instance: hikeStore, args: [cat] }) {
|
||||||
|
|
||||||
let { setHikes } = cat.getActions('hikesActions');
|
let { setHikes } = cat.getActions('hikesActions');
|
||||||
hikeStore.register(setHikes);
|
hikeStore.register(setHikes);
|
||||||
|
|
||||||
return hikeStore;
|
return hikeStore;
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
@ -6,9 +6,12 @@ const {
|
|||||||
transformer
|
transformer
|
||||||
} = Store;
|
} = Store;
|
||||||
|
|
||||||
export default Store({ showModal: false })
|
export default Store({
|
||||||
.refs({ displayName: 'JobsStore' })
|
refs: {
|
||||||
.init(({ instance: jobsStore, args: [cat] }) => {
|
displayName: 'JobsStore',
|
||||||
|
value: { showModal: false }
|
||||||
|
},
|
||||||
|
init({ instance: jobsStore, args: [cat] }) {
|
||||||
const {
|
const {
|
||||||
setJobs,
|
setJobs,
|
||||||
findJob,
|
findJob,
|
||||||
@ -27,4 +30,5 @@ export default Store({ showModal: false })
|
|||||||
|
|
||||||
register(transformer(findJob));
|
register(transformer(findJob));
|
||||||
register(handleForm);
|
register(handleForm);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
@ -82,6 +82,10 @@
|
|||||||
},
|
},
|
||||||
"descriptionPt": {
|
"descriptionPt": {
|
||||||
"type": "array"
|
"type": "array"
|
||||||
|
},
|
||||||
|
"solutions": {
|
||||||
|
"type": "array",
|
||||||
|
"default": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"validations": [],
|
"validations": [],
|
||||||
|
@ -322,7 +322,7 @@ module.exports = function(User) {
|
|||||||
})
|
})
|
||||||
// no results means this is the first brownie point given by giver
|
// no results means this is the first brownie point given by giver
|
||||||
// so return -1 to indicate receiver should receive point
|
// so return -1 to indicate receiver should receive point
|
||||||
.firstOrDefault(null, -1)
|
.first({ defaultValue: -1 })
|
||||||
.flatMap((browniePointsFromGiver) => {
|
.flatMap((browniePointsFromGiver) => {
|
||||||
if (browniePointsFromGiver === -1) {
|
if (browniePointsFromGiver === -1) {
|
||||||
|
|
||||||
|
@ -79,6 +79,7 @@ var paths = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
less: './client/less/main.less',
|
less: './client/less/main.less',
|
||||||
|
lessFiles: './client/less/*.less',
|
||||||
|
|
||||||
manifest: 'server/manifests/',
|
manifest: 'server/manifests/',
|
||||||
|
|
||||||
@ -392,7 +393,7 @@ var watchDependents = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
gulp.task('watch', watchDependents, function() {
|
gulp.task('watch', watchDependents, function() {
|
||||||
gulp.watch(paths.less, ['less']);
|
gulp.watch(paths.lessFiles, ['less']);
|
||||||
gulp.watch(paths.js, ['js']);
|
gulp.watch(paths.js, ['js']);
|
||||||
gulp.watch(paths.challenges, ['test-challenges']);
|
gulp.watch(paths.challenges, ['test-challenges']);
|
||||||
gulp.watch(paths.js, ['js', 'dependents']);
|
gulp.watch(paths.js, ['js', 'dependents']);
|
||||||
|
28
package.json
28
package.json
@ -6,6 +6,8 @@
|
|||||||
"url": "https://github.com/freecodecamp/freecodecamp.git"
|
"url": "https://github.com/freecodecamp/freecodecamp.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"first-time": "npm run create-rev && echo '\n\nseeding database\n\n' && node seed && node seed/nonprofits",
|
||||||
|
"create-rev": "test ! -e server/rev-manifest.json && echo '\n\ncreating manifest\n\n' && touch server/rev-manifest.json && echo '{}' >> server/rev-manifest.json",
|
||||||
"build": "gulp build",
|
"build": "gulp build",
|
||||||
"start": "babel-node server/server.js",
|
"start": "babel-node server/server.js",
|
||||||
"prestart-production": "bower cache clean && bower install && gulp build",
|
"prestart-production": "bower cache clean && bower install && gulp build",
|
||||||
@ -49,6 +51,13 @@
|
|||||||
"forever": "~0.14.1",
|
"forever": "~0.14.1",
|
||||||
"frameguard": "^0.2.2",
|
"frameguard": "^0.2.2",
|
||||||
"github-api": "~0.7.0",
|
"github-api": "~0.7.0",
|
||||||
|
"gulp": "~3.8.8",
|
||||||
|
"gulp-eslint": "~0.9.0",
|
||||||
|
"gulp-inject": "~1.0.2",
|
||||||
|
"gulp-jsonlint": "^1.1.0",
|
||||||
|
"gulp-nodemon": "^2.0.3",
|
||||||
|
"gulp-notify": "^2.2.0",
|
||||||
|
"gulp-plumber": "^1.0.1",
|
||||||
"gulp-less": "^3.0.3",
|
"gulp-less": "^3.0.3",
|
||||||
"gulp-minify-css": "~0.5.1",
|
"gulp-minify-css": "~0.5.1",
|
||||||
"gulp-reduce-file": "0.0.1",
|
"gulp-reduce-file": "0.0.1",
|
||||||
@ -63,8 +72,8 @@
|
|||||||
"json-loader": "^0.5.2",
|
"json-loader": "^0.5.2",
|
||||||
"less": "~2.5.1",
|
"less": "~2.5.1",
|
||||||
"lodash": "^3.9.3",
|
"lodash": "^3.9.3",
|
||||||
"loopback": "https://github.com/FreeCodeCamp/loopback.git#fix/no-password",
|
"loopback": "^2.22.0",
|
||||||
"loopback-boot": "2.8.2",
|
"loopback-boot": "^2.13.0",
|
||||||
"loopback-component-passport": "https://github.com/FreeCodeCamp/loopback-component-passport.git#feature/flashfailure",
|
"loopback-component-passport": "https://github.com/FreeCodeCamp/loopback-component-passport.git#feature/flashfailure",
|
||||||
"loopback-connector-mongodb": "^1.10.0",
|
"loopback-connector-mongodb": "^1.10.0",
|
||||||
"lusca": "~1.0.2",
|
"lusca": "~1.0.2",
|
||||||
@ -89,17 +98,17 @@
|
|||||||
"react": "^0.13.3",
|
"react": "^0.13.3",
|
||||||
"react-bootstrap": "~0.23.7",
|
"react-bootstrap": "~0.23.7",
|
||||||
"react-motion": "~0.1.0",
|
"react-motion": "~0.1.0",
|
||||||
"react-router": "^1.0.0-rc1",
|
"react-router": "https://github.com/BerkeleyTrue/react-router.git#freecodecamp",
|
||||||
"react-vimeo": "^0.0.3",
|
"react-vimeo": "^0.0.3",
|
||||||
"request": "~2.53.0",
|
"request": "~2.53.0",
|
||||||
"rev-del": "^1.0.5",
|
"rev-del": "^1.0.5",
|
||||||
"rx": "^2.5.3",
|
"rx": "^4.0.0",
|
||||||
"sanitize-html": "~1.6.1",
|
"sanitize-html": "~1.6.1",
|
||||||
"sort-keys": "^1.1.1",
|
"sort-keys": "^1.1.1",
|
||||||
"source-map-support": "^0.3.2",
|
"source-map-support": "^0.3.2",
|
||||||
"store": "https://github.com/berkeleytrue/store.js.git#feature/noop-server",
|
"store": "https://github.com/berkeleytrue/store.js.git#feature/noop-server",
|
||||||
"thundercats": "^2.1.0",
|
"thundercats": "^3.0.0",
|
||||||
"thundercats-react": "^0.1.0",
|
"thundercats-react": "^0.3.0",
|
||||||
"twit": "~1.1.20",
|
"twit": "~1.1.20",
|
||||||
"uglify-js": "~2.4.15",
|
"uglify-js": "~2.4.15",
|
||||||
"validator": "^3.22.1",
|
"validator": "^3.22.1",
|
||||||
@ -114,13 +123,6 @@
|
|||||||
"browserify": "^10.2.4",
|
"browserify": "^10.2.4",
|
||||||
"chai": "~1.10.0",
|
"chai": "~1.10.0",
|
||||||
"envify": "^3.4.0",
|
"envify": "^3.4.0",
|
||||||
"gulp": "~3.8.8",
|
|
||||||
"gulp-eslint": "~0.9.0",
|
|
||||||
"gulp-inject": "~1.0.2",
|
|
||||||
"gulp-jsonlint": "^1.1.0",
|
|
||||||
"gulp-nodemon": "^2.0.3",
|
|
||||||
"gulp-notify": "^2.2.0",
|
|
||||||
"gulp-plumber": "^1.0.1",
|
|
||||||
"istanbul": "^0.3.15",
|
"istanbul": "^0.3.15",
|
||||||
"loopback-explorer": "^1.7.2",
|
"loopback-explorer": "^1.7.2",
|
||||||
"loopback-testing": "^1.1.0",
|
"loopback-testing": "^1.1.0",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Advanced Algorithm Scripting",
|
"name": "Advanced Algorithm Scripting",
|
||||||
"order": 15,
|
"order": 15,
|
||||||
|
"time": "50h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "aff0395860f5d3034dc0bfc9",
|
"id": "aff0395860f5d3034dc0bfc9",
|
||||||
@ -39,7 +40,9 @@
|
|||||||
"assert(telephoneCheck(\"27576227382\") === false, 'message: <code>telephoneCheck(\"27576227382\")</code> should return false.');",
|
"assert(telephoneCheck(\"27576227382\") === false, 'message: <code>telephoneCheck(\"27576227382\")</code> should return false.');",
|
||||||
"assert(telephoneCheck(\"(275)76227382\") === false, 'message: <code>telephoneCheck(\"(275)76227382\")</code> should return false.');",
|
"assert(telephoneCheck(\"(275)76227382\") === false, 'message: <code>telephoneCheck(\"(275)76227382\")</code> should return false.');",
|
||||||
"assert(telephoneCheck(\"2(757)6227382\") === false, 'message: <code>telephoneCheck(\"2(757)6227382\")</code> should return false.');",
|
"assert(telephoneCheck(\"2(757)6227382\") === false, 'message: <code>telephoneCheck(\"2(757)6227382\")</code> should return false.');",
|
||||||
"assert(telephoneCheck(\"2(757)622-7382\") === false, 'message: <code>telephoneCheck(\"2(757)622-7382\")</code> should return false.');"
|
"assert(telephoneCheck(\"2(757)622-7382\") === false, 'message: <code>telephoneCheck(\"2(757)622-7382\")</code> should return false.');",
|
||||||
|
"assert(telephoneCheck(\"555)-555-5555\") === false, 'message: <code>telephoneCheck(\"555)555-5555\")</code> should return false.');",
|
||||||
|
"assert(telephoneCheck(\"(555-555-5555\") === false, 'message: <code>telephoneCheck(\"(555-555-5555\")</code> should return false.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"function telephoneCheck(str) {",
|
"function telephoneCheck(str) {",
|
||||||
@ -54,6 +57,9 @@
|
|||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"RegExp"
|
"RegExp"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"var re = /^(?:(?:\\+?1\\s*(?:[.-]\\s*)?)?(?:\\(\\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\\s*\\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\\s*(?:[.-]\\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\\s*(?:[.-]\\s*)?([0-9]{4})$/;\n\nfunction telephoneCheck(str) {\n return !!str.match(re);\n}\n\ntelephoneCheck(\"555-555-5555\");"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -85,13 +91,15 @@
|
|||||||
"tests": [
|
"tests": [
|
||||||
"assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4]), [3, 5, 4], 'message: <code>sym([1, 2, 3], [5, 2, 1, 4])</code> should return <code>[3, 5, 4]</code>.');",
|
"assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4]), [3, 5, 4], 'message: <code>sym([1, 2, 3], [5, 2, 1, 4])</code> should return <code>[3, 5, 4]</code>.');",
|
||||||
"assert.sameMembers(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'message: <code>sym([1, 2, 5], [2, 3, 5], [3, 4, 5])</code> should return <code>[1, 4, 5]</code>');",
|
"assert.sameMembers(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'message: <code>sym([1, 2, 5], [2, 3, 5], [3, 4, 5])</code> should return <code>[1, 4, 5]</code>');",
|
||||||
"assert.sameMembers(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], 'message: <code>sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5])</code> should return <code>[1, 4, 5]</code>.');",
|
"assert.sameMembers(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], 'message: <code>sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5])</code> should return <code>[1, 4, 5]</code>.');"
|
||||||
"assert.sameMembers(sym([1, 1]), [1], 'message: <code>sym([1, 1])</code> should return <code>[1]</code>.');"
|
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Array.reduce()",
|
"Array.reduce()",
|
||||||
"Symmetric Difference"
|
"Symmetric Difference"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function sym(args) {\n var index = -1;\n var length = arguments.length;\n var result;\n while (++index < length) {\n var array = arguments[index];\n result = result ? diff(result, array).concat(diff(array, result)) : array;\n }\n return result ? uniq(result) : [];\n}\n\nfunction uniq(arr) {\n var h = Object.create(null);\n var u = [];\n arr.forEach(function(v) {\n if (v in h) return;\n h[v] = true;\n u.push(v);\n });\n return u;\n}\n\nfunction diff(a, b) {\n var h = Object.create(null);\n b.forEach(function(v) {\n h[v] = true; \n });\n return a.filter(function(v) { return !(v in h);});\n}\nsym([1, 2, 3], [5, 2, 1, 4]);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -142,11 +150,15 @@
|
|||||||
"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]], 'message: <code>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]])</code> should return <code>[[\"QUARTER\", 0.50]]</code>.');",
|
"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]], 'message: <code>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]])</code> should return <code>[[\"QUARTER\", 0.50]]</code>.');",
|
||||||
"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]], 'message: <code>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]])</code> should return <code>[[\"TWENTY\", 60.00], [\"TEN\", 20.00], [\"FIVE\", 15], [\"ONE\", 1], [\"QUARTER\", 0.50], [\"DIME\", 0.20], [\"PENNY\", 0.04]]</code>.');",
|
"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]], 'message: <code>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]])</code> should return <code>[[\"TWENTY\", 60.00], [\"TEN\", 20.00], [\"FIVE\", 15], [\"ONE\", 1], [\"QUARTER\", 0.50], [\"DIME\", 0.20], [\"PENNY\", 0.04]]</code>.');",
|
||||||
"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\", 'message: <code>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]])</code> should return \"Insufficient Funds\".');",
|
"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\", 'message: <code>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]])</code> should return \"Insufficient Funds\".');",
|
||||||
|
"assert.deepEqual(drawer(19.50, 20.00, [[\"PENNY\", 0.01], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 1.00], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]]), \"Insufficient Funds\", 'message: <code>drawer(19.50, 20.00, [[\"PENNY\", 0.01], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 1.00], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]])</code> should return \"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\", 'message: <code>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]])</code> should return \"Closed\".');"
|
"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\", 'message: <code>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]])</code> should return \"Closed\".');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Global Object"
|
"Global Object"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"var VALUES = [1, 5, 10, 25, 100, 500, 1000, 2000, 10000];\n\nfunction drawer(price, cash, cid) {\n cash = ~~(cash * 100);\n price = ~~(price * 100);\n var diff = cash-price;\n cid.forEach(function(c) {\n c[1] = ~~(c[1] * 100);\n });\n var totalCid = cid.reduce(function(a, c) {\n return a + c[1];\n }, 0);\n if (diff > totalCid) {\n return \"Insufficient Funds\";\n }\n if (diff === totalCid) {\n return \"Closed\";\n }\n \n var change = []; \n var index = cid.length;\n while (diff > 0 && --index > -1) {\n var t = 0;\n var value = VALUES[index];\n while (diff >= value && cid[index][1] > 0) {\n t += value;\n cid[index][1] -= value;\n diff -= value;\n }\n if (t) {\n change.push([cid[index][0], t/100]);\n }\n console.log(JSON.stringify(change));\n }\n // Here is your change, ma'am.\n return change;\n}\n\n// Example cash-in-drawer array:\n// [['PENNY', 1.01],\n// ['NICKEL', 2.05],\n// ['DIME', 3.10],\n// ['QUARTER', 4.25],\n// ['ONE', 90.00],\n// ['FIVE', 55.00],\n// ['TEN', 20.00],\n// ['TWENTY', 60.00],\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]]);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -201,6 +213,9 @@
|
|||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Global Array Object"
|
"Global Array Object"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function inventory(arr1, arr2) {\n arr2.forEach(function(item) {\n createOrUpdate(arr1, item);\n });\n // All inventory must be accounted for or you're fired!\n return arr1;\n}\n\nfunction createOrUpdate(arr1, item) {\n var index = -1;\n while (++index < arr1.length) {\n if (arr1[index][1] === item[1]) {\n arr1[index][0] += item[0];\n return;\n }\n if (arr1[index][1] > item[1]) {\n break;\n }\n }\n arr1.splice(index, 0, item);\n}\n\n// Example inventory lists\nvar curInv = [\n [21, 'Bowling Ball'],\n [2, 'Dirty Sock'],\n [1, 'Hair Pin'],\n [5, 'Microphone']\n];\n\nvar newInv = [\n [2, 'Hair Pin'],\n [3, 'Half-Eaten Apple'],\n [67, 'Bowling Ball'],\n [7, 'Toothpaste']\n];\n\ninventory(curInv, newInv);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -242,6 +257,9 @@
|
|||||||
"Permutations",
|
"Permutations",
|
||||||
"RegExp"
|
"RegExp"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function permAlone(str) {\n return permutor(str).filter(function(perm) {\n return !perm.match(/(.)\\1/g);\n }).length;\n}\n\nfunction permutor(str) {\n // http://staff.roguecc.edu/JMiller/JavaScript/permute.html\n //permArr: Global array which holds the list of permutations\n //usedChars: Global utility array which holds a list of \"currently-in-use\" characters\n var permArr = [], usedChars = [];\n function permute(input) {\n //convert input into a char array (one element for each character)\n var i, ch, chars = input.split(\"\");\n for (i = 0; i < chars.length; i++) {\n //get and remove character at index \"i\" from char array\n ch = chars.splice(i, 1);\n //add removed character to the end of used characters\n usedChars.push(ch);\n //when there are no more characters left in char array to add, add used chars to list of permutations\n if (chars.length === 0) permArr[permArr.length] = usedChars.join(\"\");\n //send characters (minus the removed one from above) from char array to be permuted\n permute(chars.join(\"\"));\n //add removed character back into char array in original position\n chars.splice(i, 0, ch);\n //remove the last character used off the end of used characters array\n usedChars.pop();\n }\n }\n permute(str);\n return permArr;\n}\n\npermAlone('aab');\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -287,6 +305,9 @@
|
|||||||
"String.substr()",
|
"String.substr()",
|
||||||
"parseInt()"
|
"parseInt()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function friendly(str) {\n var dates = str.map(function(s) {return s.split('-').map(Number);});\n var start = dates[0];\n var end = dates[1];\n if (str[0] === str[1]) {\n return [readable(start)];\n }\n if (start[0] !== end[0]) {\n if (start[0] + 1 === end[0] && start[1] > end[1]) {\n start[0] = undefined;\n end[0] = undefined;\n }\n return dates.map(readable);\n }\n start[0] = undefined;\n end[0] = undefined;\n if (start[1] !== end[1]) {\n return dates.map(readable);\n }\n end[1] = undefined;\n return dates.map(readable);\n}\n\nfunction readable(arr) {\n var ordD = arr[2] + nth(arr[2]);\n if (!arr[1]) {\n return ordD;\n }\n return MONTH[arr[1]] + \" \" + ordD + (!arr[0] ? \"\" : \", \" + arr[0]);\n}\n\nvar MONTH = {1: \"January\",\n 2: \"February\",\n 3: \"March\",\n 4: \"April\",\n 5: \"May\",\n 6: \"June\",\n 7: \"July\",\n 8: \"August\",\n 9: \"September\",\n 10: \"October\",\n 11: \"November\",\n 12: \"December\"};\n\nfunction nth(d) {\n if(d>3 && d<21) return 'th';\n switch (d % 10) {\n case 1: return \"st\";\n case 2: return \"nd\";\n case 3: return \"rd\";\n default: return \"th\";\n }\n} \n\nfriendly(['2015-07-01', '2015-07-04']);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "AngularJS",
|
"name": "AngularJS",
|
||||||
"order": 16,
|
"order": 16,
|
||||||
|
"time": "5h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "bd7154d8c441eddfaeb5bdef",
|
"id": "bd7154d8c441eddfaeb5bdef",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Automated Testing and Debugging",
|
"name": "Automated Testing and Debugging",
|
||||||
"order": 14,
|
"order": 14,
|
||||||
|
"time": "15m",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c16feddfaeb6bdef",
|
"id":"cf1111c1c16feddfaeb6bdef",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Full Stack JavaScript Projects",
|
"name": "Full Stack JavaScript Projects",
|
||||||
"order": 20,
|
"order": 20,
|
||||||
|
"time": "300h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "bd7158d8c443eddfaeb5bcef",
|
"id": "bd7158d8c443eddfaeb5bcef",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Basic Algorithm Scripting",
|
"name": "Basic Algorithm Scripting",
|
||||||
"order": 8,
|
"order": 8,
|
||||||
|
"time": "50h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "ad7123c8c441eddfaeb5bdef",
|
"id": "ad7123c8c441eddfaeb5bdef",
|
||||||
@ -60,7 +61,7 @@
|
|||||||
" return str;",
|
" return str;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"reverseString(\"hello\", \"\");"
|
"reverseString(\"hello\");"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Global String Object",
|
"Global String Object",
|
||||||
@ -68,6 +69,9 @@
|
|||||||
"Array.reverse()",
|
"Array.reverse()",
|
||||||
"Array.join()"
|
"Array.join()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function reverseString(str) {\n return str.split('').reverse().join(\"\");\n}\n\nreverseString('hello');\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -103,11 +107,14 @@
|
|||||||
" return num;",
|
" return num;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"factorialize(5, '');"
|
"factorialize(5);"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Arithmetic Operators"
|
"Arithmetic Operators"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function factorialize(num) {\n return num === 1 ? 1 : num * factorialize(num-1);\n}\n\nfactorialize(5);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -142,7 +149,7 @@
|
|||||||
"assert(palindrome(\"almostomla\") === false, 'message: <code>palindrome(\"almostomla\")</code> should return false.');",
|
"assert(palindrome(\"almostomla\") === false, 'message: <code>palindrome(\"almostomla\")</code> should return false.');",
|
||||||
"assert(palindrome(\"My age is 0, 0 si ega ym.\") === true, 'message: <code>palindrome(\"My age is 0, 0 si ega ym.\")</code> should return true.');",
|
"assert(palindrome(\"My age is 0, 0 si ega ym.\") === true, 'message: <code>palindrome(\"My age is 0, 0 si ega ym.\")</code> should return true.');",
|
||||||
"assert(palindrome(\"1 eye for of 1 eye.\") === false, 'message: <code>palindrome(\"1 eye for of 1 eye.\")</code> should return false.');",
|
"assert(palindrome(\"1 eye for of 1 eye.\") === false, 'message: <code>palindrome(\"1 eye for of 1 eye.\")</code> should return false.');",
|
||||||
"assert(palindrome(\"0_0 (: /-\\ :) 0-0\") === true, 'message: <code>palindrome(\"0_0 (: /-\\\\ :) 0-0\")</code> should return true.');"
|
"assert(palindrome(\"0_0 (: /-\\ :) 0-0\") === true, 'message: <code>palindrome(\"0_0 (: /-\\ :) 0-0\")</code> should return true.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"function palindrome(str) {",
|
"function palindrome(str) {",
|
||||||
@ -158,6 +165,9 @@
|
|||||||
"String.replace()",
|
"String.replace()",
|
||||||
"String.toLowerCase()"
|
"String.toLowerCase()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function palindrome(str) {\n var a = str.toLowerCase().replace(/[^a-z]/g, '');\n console.log(a.split('').reverse().join(''));\n return a == a.split('').reverse().join('');\n}\n\n\n\npalindrome(\"eye\");\npalindrome(\"A man, a plan, a canal. Panama\");\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -198,6 +208,9 @@
|
|||||||
"String.split()",
|
"String.split()",
|
||||||
"String.length"
|
"String.length"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function findLongestWord(str) {\n return str.split(' ').sort(function(a, b) { return b.length - a.length;})[0].length;\n}\n\nfindLongestWord('The quick brown fox jumped over the lazy dog');\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -224,7 +237,7 @@
|
|||||||
" return str;",
|
" return str;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"titleCase(\"I'm a little tea pot\", \"\");"
|
"titleCase(\"I'm a little tea pot\");"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(typeof(titleCase(\"I'm a little tea pot\")) === \"string\", 'message: <code>titleCase()</code> should return a string.');",
|
"assert(typeof(titleCase(\"I'm a little tea pot\")) === \"string\", 'message: <code>titleCase()</code> should return a string.');",
|
||||||
@ -235,6 +248,9 @@
|
|||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"String.charAt()"
|
"String.charAt()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function titleCase(str) {\n return str.split(' ').map(function(word) {\n return word.charAt(0).toUpperCase() + word.substring(1).toLowerCase();\n }).join(' ');\n}\n\ntitleCase(\"I'm a little tea pot\");\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -300,13 +316,14 @@
|
|||||||
" return str;",
|
" return str;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"end(\"Bastian\", \"n\", \"\");"
|
"end(\"Bastian\", \"n\");"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(end(\"Bastian\", \"n\") === true, 'message: <code>end(\"Bastian\", \"n\")</code> should return true.');",
|
"assert(end(\"Bastian\", \"n\") === true, 'message: <code>end(\"Bastian\", \"n\")</code> should return true.');",
|
||||||
"assert(end(\"Connor\", \"n\") === false, 'message: <code>end(\"Connor\", \"n\")</code> should return false.');",
|
"assert(end(\"Connor\", \"n\") === false, 'message: <code>end(\"Connor\", \"n\")</code> should return false.');",
|
||||||
"assert(end(\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\") === false, 'message: <code>end(\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\")</code> should return false.');",
|
"assert(end(\"Walking on water and developing software from a specification are easy if both are frozen\", \"specification\") === false, '<code>\"Walking on water and developing software from a specification are easy if both are frozen\", \"specification\")</code> should return false.');",
|
||||||
"assert(end(\"He has to give me a new name\", \"name\") === true, 'message: <code>end(\"He has to give me a new name\", \"name\")</code> should return true.');",
|
"assert(end(\"He has to give me a new name\", \"name\") === true, 'message: <code>end(\"He has to give me a new name\", \"name\")</code> should return true.');",
|
||||||
|
"assert(end(\"He has to give me a new name\", \"me\") === true, 'message: <code>end(\"He has to give me a new name\", \"me\")</code> should return true.');",
|
||||||
"assert(end(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") === false, 'message: <code>end(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\")</code> should return false.');"
|
"assert(end(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") === false, 'message: <code>end(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\")</code> should return false.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
@ -338,7 +355,7 @@
|
|||||||
" return str;",
|
" return str;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"repeat(\"abc\", 3, \"\");"
|
"repeat(\"abc\", 3);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(repeat(\"*\", 3) === \"***\", 'message: <code>repeat(\"*\", 3)</code> should return <code>\"***\"</code>.');",
|
"assert(repeat(\"*\", 3) === \"***\", 'message: <code>repeat(\"*\", 3)</code> should return <code>\"***\"</code>.');",
|
||||||
@ -367,6 +384,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
"Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a \"...\" ending.",
|
"Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a \"...\" ending.",
|
||||||
"Note that the three dots at the end add to the string length.",
|
"Note that the three dots at the end add to the string length.",
|
||||||
|
"If the length of the string is less than or equal to 3 characters, then the length of the three dots is not added to the string length.",
|
||||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -375,13 +393,14 @@
|
|||||||
" return str;",
|
" return str;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"truncate(\"A-tisket a-tasket A green and yellow basket\", 11, \"\");"
|
"truncate(\"A-tisket a-tasket A green and yellow basket\", 11);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(truncate(\"A-tisket a-tasket A green and yellow basket\", 11) === \"A-tisket...\", 'message: <code>truncate(\"A-tisket a-tasket A green and yellow basket\", 11)</code> should return \"A-tisket...\".');",
|
"assert(truncate(\"A-tisket a-tasket A green and yellow basket\", 11) === \"A-tisket...\", 'message: <code>truncate(\"A-tisket a-tasket A green and yellow basket\", 11)</code> should return \"A-tisket...\".');",
|
||||||
"assert(truncate(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", 'message: <code>truncate(\"Peter Piper picked a peck of pickled peppers\", 14)</code> should return \"Peter Piper...\".');",
|
"assert(truncate(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", 'message: <code>truncate(\"Peter Piper picked a peck of pickled peppers\", 14)</code> should return \"Peter Piper...\".');",
|
||||||
"assert(truncate(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length) === \"A-tisket a-tasket A green and yellow basket\", 'message: <code>truncate(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length)</code> should return \"A-tisket a-tasket A green and yellow basket\".');",
|
"assert(truncate(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length) === \"A-tisket a-tasket A green and yellow basket\", 'message: <code>truncate(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length)</code> should return \"A-tisket a-tasket A green and yellow basket\".');",
|
||||||
"assert(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2) === 'A-tisket a-tasket A green and yellow basket', 'message: <code>truncate(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length + 2)</code> should return \"A-tisket a-tasket A green and yellow basket\".');"
|
"assert(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2) === 'A-tisket a-tasket A green and yellow basket', 'message: <code>truncate(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length + 2)</code> should return \"A-tisket a-tasket A green and yellow basket\".');",
|
||||||
|
"assert(truncate(\"A-\", 1) === \"A...\", 'message: <code>truncate(\"A-\", 1)</code> should return \"A...\".');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"String.slice()"
|
"String.slice()"
|
||||||
@ -412,7 +431,7 @@
|
|||||||
" return arr;",
|
" return arr;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"chunk([\"a\", \"b\", \"c\", \"d\"], 2, \"\");"
|
"chunk([\"a\", \"b\", \"c\", \"d\"], 2);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.deepEqual(chunk([\"a\", \"b\", \"c\", \"d\"], 2), [[\"a\", \"b\"], [\"c\", \"d\"]], 'message: <code>chunk([\"a\", \"b\", \"c\", \"d\"], 2)</code> should return <code>[[\"a\", \"b\"], [\"c\", \"d\"]]</code>.');",
|
"assert.deepEqual(chunk([\"a\", \"b\", \"c\", \"d\"], 2), [[\"a\", \"b\"], [\"c\", \"d\"]], 'message: <code>chunk([\"a\", \"b\", \"c\", \"d\"], 2)</code> should return <code>[[\"a\", \"b\"], [\"c\", \"d\"]]</code>.');",
|
||||||
@ -450,12 +469,13 @@
|
|||||||
" return arr;",
|
" return arr;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"slasher([1, 2, 3], 2, \"\");"
|
"slasher([1, 2, 3], 2);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.deepEqual(slasher([1, 2, 3], 2), [3], 'message: <code>slasher([1, 2, 3], 2, [3])</code> should return <code>[3]</code>.');",
|
"assert.deepEqual(slasher([1, 2, 3], 2), [3], 'message: <code>slasher([1, 2, 3], 2)</code> should return <code>[3]</code>.');",
|
||||||
"assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], 'message: <code>slasher([1, 2, 3], 0)</code> should return <code>[1, 2, 3]</code>.');",
|
"assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], 'message: <code>slasher([1, 2, 3], 0)</code> should return <code>[1, 2, 3]</code>.');",
|
||||||
"assert.deepEqual(slasher([1, 2, 3], 9), [], 'message: <code>slasher([1, 2, 3], 9)</code> should return <code>[]</code>.');"
|
"assert.deepEqual(slasher([1, 2, 3], 9), [], 'message: <code>slasher([1, 2, 3], 9)</code> should return <code>[]</code>.');",
|
||||||
|
"assert.deepEqual(slasher([1, 2, 3], 4), [], 'message: <code>slasher([1, 2, 3], 4)</code> should return <code>[]</code>.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Array.slice()",
|
"Array.slice()",
|
||||||
@ -489,7 +509,7 @@
|
|||||||
" return arr;",
|
" return arr;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"mutation([\"hello\", \"hey\"], \"\");"
|
"mutation([\"hello\", \"hey\"]);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(mutation([\"hello\", \"hey\"]) === false, 'message: <code>mutation([\"hello\", \"hey\"])</code> should return false.');",
|
"assert(mutation([\"hello\", \"hey\"]) === false, 'message: <code>mutation([\"hello\", \"hey\"])</code> should return false.');",
|
||||||
@ -531,7 +551,7 @@
|
|||||||
" return arr;",
|
" return arr;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"bouncer([7, \"ate\", \"\", false, 9], \"\");"
|
"bouncer([7, \"ate\", \"\", false, 9]);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.deepEqual(bouncer([7, \"ate\", \"\", false, 9]), [7, \"ate\", 9], 'message: <code>bouncer([7, \"ate\", \"\", false, 9])</code> should return <code>[7, \"ate\", 9]</code>.');",
|
"assert.deepEqual(bouncer([7, \"ate\", \"\", false, 9]), [7, \"ate\", 9], 'message: <code>bouncer([7, \"ate\", \"\", false, 9])</code> should return <code>[7, \"ate\", 9]</code>.');",
|
||||||
@ -568,7 +588,7 @@
|
|||||||
" return arr;",
|
" return arr;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"destroyer([1, 2, 3, 1, 2, 3], 2, 3, \"\");"
|
"destroyer([1, 2, 3, 1, 2, 3], 2, 3);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1], 'message: <code>destroyer([1, 2, 3, 1, 2, 3], 2, 3)</code> should return <code>[1, 1]</code>.');",
|
"assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1], 'message: <code>destroyer([1, 2, 3, 1, 2, 3], 2, 3)</code> should return <code>[1, 1]</code>.');",
|
||||||
@ -598,8 +618,9 @@
|
|||||||
"id": "a24c1a4622e3c05097f71d67",
|
"id": "a24c1a4622e3c05097f71d67",
|
||||||
"title": "Where do I belong",
|
"title": "Where do I belong",
|
||||||
"description": [
|
"description": [
|
||||||
"Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument).",
|
"Return the lowest index at which a value (second argument) should be inserted into an array (first argument) once it has been sorted.",
|
||||||
"For example, where([1,2,3,4], 1.5) should return 1 because it is greater than 1 (0th index), but less than 2 (1st index).",
|
"For example, where([1,2,3,4], 1.5) should return 1 because it is greater than 1 (index 0), but less than 2 (index 1).",
|
||||||
|
"Likewise, where([20,3,5], 19) should return 2 because it is less than 20 (index 2) and greater than 5 (index 1).",
|
||||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -608,7 +629,7 @@
|
|||||||
" return num;",
|
" return num;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"where([40, 60], 50, \"\");"
|
"where([40, 60], 50);"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Array.sort()"
|
"Array.sort()"
|
||||||
@ -617,8 +638,8 @@
|
|||||||
"assert(where([10, 20, 30, 40, 50], 35) === 3, 'message: <code>where([10, 20, 30, 40, 50], 35)</code> should return <code>3</code>.');",
|
"assert(where([10, 20, 30, 40, 50], 35) === 3, 'message: <code>where([10, 20, 30, 40, 50], 35)</code> should return <code>3</code>.');",
|
||||||
"assert(where([10, 20, 30, 40, 50], 30) === 2, 'message: <code>where([10, 20, 30, 40, 50], 30)</code> should return <code>2</code>.');",
|
"assert(where([10, 20, 30, 40, 50], 30) === 2, 'message: <code>where([10, 20, 30, 40, 50], 30)</code> should return <code>2</code>.');",
|
||||||
"assert(where([40, 60], 50) === 1, 'message: <code>where([40, 60,], 50)</code> should return <code>1</code>.');",
|
"assert(where([40, 60], 50) === 1, 'message: <code>where([40, 60,], 50)</code> should return <code>1</code>.');",
|
||||||
"assert(where([5, 3, 20, 3], 3) === 0, 'message: <code>where([5, 3, 20, 3], 3)</code> should return <code>0</code>.');",
|
"assert(where([5, 3, 20, 3], 5) === 2, 'message: <code>where([5, 3, 20, 3], 5)</code> should return <code>2</code>.');",
|
||||||
"assert(where([2, 20, 10], 1) === 0, 'message: <code>where([2, 20, 10], 1)</code> should return <code>0</code>.');",
|
"assert(where([2, 20, 10], 19) === 2, 'message: <code>where([2, 20, 10], 19)</code> should return <code>2</code>.');",
|
||||||
"assert(where([2, 5, 10], 15) === 3, 'message: <code>where([2, 5, 10], 15)</code> should return <code>3</code>.');"
|
"assert(where([2, 5, 10], 15) === 3, 'message: <code>where([2, 5, 10], 15)</code> should return <code>3</code>.');"
|
||||||
],
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "Basic JavaScript",
|
"name": "Basic JavaScript",
|
||||||
"order": 6,
|
"order": 6,
|
||||||
|
"time": "3h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id":"bd7123c9c441eddfaeb4bdef",
|
"id": "bd7123c9c441eddfaeb4bdef",
|
||||||
"title": "Comment your JavaScript Code",
|
"title": "Comment your JavaScript Code",
|
||||||
"difficulty":"9.98",
|
"difficulty": "9.98",
|
||||||
"description":[
|
"description": [
|
||||||
"Comments are lines of code that your computer will intentionally ignore. Comments are a great way to leave notes to yourself and to other people who will later need to figure out what it does.",
|
"Comments are lines of code that your computer will intentionally ignore. Comments are a great way to leave notes to yourself and to other people who will later need to figure out what it does.",
|
||||||
"Let's take a look at the two ways you can write comments in JavaScript.",
|
"Let's take a look at the two ways you can write comments in JavaScript.",
|
||||||
"The double-slash comment will comment out the remainder of the text on the current line:",
|
"The double-slash comment will comment out the remainder of the text on the current line:",
|
||||||
@ -16,13 +17,12 @@
|
|||||||
"Try creating one of each.",
|
"Try creating one of each.",
|
||||||
"And one more thing you need to notice. Starting at this waypoint in JavaScript related challenges (except AngularJS, all Ziplines, Git, Node.js and Express.js, MongoDB and Full Stack JavaScript Projects) you can see contents of <code>assert()</code> functions (in some challenges <code>except()</code>, <code>assert.equal()</code> and so on) which are used to test your code. It's part of these challenges that you are able to see the tests that are running against your code."
|
"And one more thing you need to notice. Starting at this waypoint in JavaScript related challenges (except AngularJS, all Ziplines, Git, Node.js and Express.js, MongoDB and Full Stack JavaScript Projects) you can see contents of <code>assert()</code> functions (in some challenges <code>except()</code>, <code>assert.equal()</code> and so on) which are used to test your code. It's part of these challenges that you are able to see the tests that are running against your code."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert(editor.getValue().match(/(\\/\\/)...../g), 'message: Create a <code>//</code> style comment that contains at least five letters');",
|
"assert(editor.getValue().match(/(\\/\\/)...../g), 'message: Create a <code>//</code> style comment that contains at least five letters');",
|
||||||
"assert(editor.getValue().match(/(\\/\\*)[\\w\\W]{5,}(?=\\*\\/)/gm), 'message: Create a <code>/* */</code> style comment that contains at least five letters.');",
|
"assert(editor.getValue().match(/(\\/\\*)[\\w\\W]{5,}(?=\\*\\/)/gm), 'message: Create a <code>/* */</code> style comment that contains at least five letters.');",
|
||||||
"assert(editor.getValue().match(/(\\*\\/)/g), 'message: Make sure that you close the comment with a <code>*/</code>');"
|
"assert(editor.getValue().match(/(\\*\\/)/g), 'message: Make sure that you close the comment with a <code>*/</code>');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [],
|
||||||
],
|
|
||||||
"type": "waypoint",
|
"type": "waypoint",
|
||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
@ -41,11 +41,11 @@
|
|||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"function welcomeToBooleans() {",
|
"function welcomeToBooleans() {",
|
||||||
"",
|
"",
|
||||||
"// Only change code below this line.",
|
" // Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
" return false;",
|
" return false;",
|
||||||
"",
|
"",
|
||||||
"// Only change code above this line.",
|
" // Only change code above this line.",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
"welcomeToBooleans();"
|
"welcomeToBooleans();"
|
||||||
@ -69,10 +69,10 @@
|
|||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"// var ourName = \"Free Code Camp\";",
|
"// var ourName = \"Free Code Camp\";",
|
||||||
"",
|
"",
|
||||||
|
"// Only change code below this line.",
|
||||||
|
"",
|
||||||
"",
|
"",
|
||||||
"// Only change code above this line.",
|
"// Only change code above this line.",
|
||||||
"// We use this function to show you the value of your variable in your output box.",
|
|
||||||
"// You'll learn about functions soon.",
|
|
||||||
"",
|
"",
|
||||||
"if(typeof(myName) !== \"undefined\"){(function(v){return v;})(myName);}"
|
"if(typeof(myName) !== \"undefined\"){(function(v){return v;})(myName);}"
|
||||||
],
|
],
|
||||||
@ -177,9 +177,9 @@
|
|||||||
"id": "bd7123c9c450eddfaeb5bdef",
|
"id": "bd7123c9c450eddfaeb5bdef",
|
||||||
"title": "Use Bracket Notation to Find the Nth Character in a String",
|
"title": "Use Bracket Notation to Find the Nth Character in a String",
|
||||||
"description": [
|
"description": [
|
||||||
"You can also use <code>bracket Notation</code>to get the character at other positions within a string.",
|
"You can also use <code>bracket notation</code> to get the character at other positions within a string.",
|
||||||
"Remember that computers start counting at 0, so the first character is actually the zeroth character.",
|
"Remember that computers start counting at 0, so the first character is actually the zeroth character.",
|
||||||
"Let's try to set <code>thirdLetterOfLastName</code>to equal the <code>third letter</code> of the <code>lastName</code> variable.",
|
"Let's try to set <code>thirdLetterOfLastName</code> to equal the <code>third letter</code> of the <code>lastName</code> variable.",
|
||||||
"Try looking at the <code>secondLetterOfFirstName</code> variable declaration if you get stuck."
|
"Try looking at the <code>secondLetterOfFirstName</code> variable declaration if you get stuck."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
@ -431,17 +431,17 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c11feddfaeb7bdef",
|
"id": "cf1111c1c11feddfaeb7bdef",
|
||||||
"title": "Nest one Array within Another Array",
|
"title": "Nest one Array within Another Array",
|
||||||
"difficulty":"9.98161",
|
"difficulty": "9.98161",
|
||||||
"description":[
|
"description": [
|
||||||
"You can also nest arrays within other arrays, like this: <code>[[\"Bulls\", 23]]</code>.",
|
"You can also nest arrays within other arrays, like this: <code>[[\"Bulls\", 23]]</code>.",
|
||||||
"Let's now go create a nested array called <code>myArray</code>."
|
"Let's now go create a nested array called <code>myArray</code>."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert(Array.isArray(myArray) && myArray.some(Array.isArray), 'message: <code>myArray</code> should have at least one array nested within another array.');"
|
"assert(Array.isArray(myArray) && myArray.some(Array.isArray), 'message: <code>myArray</code> should have at least one array nested within another array.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"var ourArray = [[\"the universe\", \"everything\", 42]];",
|
"var ourArray = [[\"the universe\", \"everything\", 42]];",
|
||||||
"// Only change code below this line.",
|
"// Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
@ -456,10 +456,10 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"bg9997c9c79feddfaeb9bdef",
|
"id": "bg9997c9c79feddfaeb9bdef",
|
||||||
"title": "Access Array Data with Indexes",
|
"title": "Access Array Data with Indexes",
|
||||||
"difficulty":"9.9817",
|
"difficulty": "9.9817",
|
||||||
"description":[
|
"description": [
|
||||||
"We can access the data inside arrays using <code>indexes</code>.",
|
"We can access the data inside arrays using <code>indexes</code>.",
|
||||||
"Array indexes are written in the same bracket notation that strings use, except that instead of specifying a character, they are specifying an entry in the array.",
|
"Array indexes are written in the same bracket notation that strings use, except that instead of specifying a character, they are specifying an entry in the array.",
|
||||||
"For example:",
|
"For example:",
|
||||||
@ -468,10 +468,10 @@
|
|||||||
"<code>var data = array[1];</code>",
|
"<code>var data = array[1];</code>",
|
||||||
"Create a variable called <code>myData</code> and set it to equal the first value of <code>myArray</code>."
|
"Create a variable called <code>myData</code> and set it to equal the first value of <code>myArray</code>."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert((function(){if(typeof(myArray) != 'undefined' && typeof(myData) != 'undefined' && myArray[0] == myData){return true;}else{return false;}})(), 'message: The variable <code>myData</code> should equal the first value of <code>myArray</code>.');"
|
"assert((function(){if(typeof(myArray) != 'undefined' && typeof(myData) != 'undefined' && myArray[0] == myData){return true;}else{return false;}})(), 'message: The variable <code>myData</code> should equal the first value of <code>myArray</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"// var ourArray = [1,2,3];",
|
"// var ourArray = [1,2,3];",
|
||||||
"// var ourData = ourArray[0]; // equals 1",
|
"// var ourData = ourArray[0]; // equals 1",
|
||||||
"",
|
"",
|
||||||
@ -488,21 +488,21 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c11feddfaeb8bdef",
|
"id": "cf1111c1c11feddfaeb8bdef",
|
||||||
"title": "Modify Array Data With Indexes",
|
"title": "Modify Array Data With Indexes",
|
||||||
"difficulty":"9.98171",
|
"difficulty": "9.98171",
|
||||||
"description":[
|
"description": [
|
||||||
"We can also modify the data stored in arrays by using indexes.",
|
"We can also modify the data stored in arrays by using indexes.",
|
||||||
"For example:",
|
"For example:",
|
||||||
"<code>var ourArray = [3,2,1];</code>",
|
"<code>var ourArray = [3,2,1];</code>",
|
||||||
"<code>ourArray[0] = 1; // equals [1,2,1]</code>",
|
"<code>ourArray[0] = 1; // equals [1,2,1]</code>",
|
||||||
"Now modify the data stored at index 0 of <code>myArray</code> to the value of 3."
|
"Now modify the data stored at index 0 of <code>myArray</code> to the value of 3."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert((function(){if(typeof(myArray) != 'undefined' && myArray[0] == 3 && myArray[1] == 2 && myArray[2] == 3){return true;}else{return false;}})(), 'message: <code>myArray</code> should now be [3,2,3].');",
|
"assert((function(){if(typeof(myArray) != 'undefined' && myArray[0] == 3 && myArray[1] == 2 && myArray[2] == 3){return true;}else{return false;}})(), 'message: <code>myArray</code> should now be [3,2,3].');",
|
||||||
"assert((function(){if(editor.getValue().match(/myArray\\[0\\]\\s?=\\s?/g)){return true;}else{return false;}})(), 'message: You should be using correct index to modify the value in <code>myArray</code>.');"
|
"assert((function(){if(editor.getValue().match(/myArray\\[0\\]\\s?=\\s?/g)){return true;}else{return false;}})(), 'message: You should be using correct index to modify the value in <code>myArray</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"var ourArray = [1,2,3];",
|
"var ourArray = [1,2,3];",
|
||||||
"ourArray[1] = 3;",
|
"ourArray[1] = 3;",
|
||||||
"// ourArray now equals [1,3,3].",
|
"// ourArray now equals [1,3,3].",
|
||||||
@ -529,7 +529,7 @@
|
|||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert((function(d){if(d[0] == 'John' && d[1] == 23 && d[2] == undefined){return true;}else{return false;}})(myArray), 'message: <code>myArray</code> should only contain <code>[\"John\", 23]</code>.');",
|
"assert((function(d){if(d[0] == 'John' && d[1] == 23 && d[2] == undefined){return true;}else{return false;}})(myArray), 'message: <code>myArray</code> should only contain <code>[\"John\", 23]</code>.');",
|
||||||
"assert((function(d){if(d[0] == 'cat' && d[1] == 2 && d[2] == undefined){return true;}else{return false;}})(removed), 'message: <code>removed</code> should only contain <code>[\"cat\"], 2</code>.');"
|
"assert((function(d){if(d[0] == 'cat' && d[1] == 2 && d[2] == undefined){return true;}else{return false;}})(removed), 'message: <code>removed</code> should only contain <code>[\"cat\", 2]</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"// var numbers = [1,2,3];",
|
"// var numbers = [1,2,3];",
|
||||||
@ -644,10 +644,10 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"bg9997c9c89feddfaeb9bdef",
|
"id": "bg9997c9c89feddfaeb9bdef",
|
||||||
"title": "Write Reusable JavaScript with Functions",
|
"title": "Write Reusable JavaScript with Functions",
|
||||||
"difficulty":"9.9819",
|
"difficulty": "9.9819",
|
||||||
"description":[
|
"description": [
|
||||||
"In JavaScript, we can divide up our code into reusable parts called functions.",
|
"In JavaScript, we can divide up our code into reusable parts called functions.",
|
||||||
"Here's an example of a function:",
|
"Here's an example of a function:",
|
||||||
"<code>function functionName(a, b) {</code>",
|
"<code>function functionName(a, b) {</code>",
|
||||||
@ -658,10 +658,10 @@
|
|||||||
"In this example, the function will return the number <code>6</code> as this is the result of <code>4 + 2</code>.",
|
"In this example, the function will return the number <code>6</code> as this is the result of <code>4 + 2</code>.",
|
||||||
"Create and call a function called <code>myFunction</code> that returns the sum of <code>a</code> and <code>b</code>."
|
"Create and call a function called <code>myFunction</code> that returns the sum of <code>a</code> and <code>b</code>."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert((function(){if(typeof(f) !== \"undefined\" && f === a + b){return true;}else{return false;}})(), 'message: Your function should return the value of a + b');"
|
"assert((function(){if(typeof(f) !== \"undefined\" && f === a + b){return true;}else{return false;}})(), 'message: Your function should return the value of a + b');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"var a = 4;",
|
"var a = 4;",
|
||||||
"var b = 5;",
|
"var b = 5;",
|
||||||
"",
|
"",
|
||||||
@ -687,10 +687,10 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"bg9998c9c99feddfaeb9bdef",
|
"id": "bg9998c9c99feddfaeb9bdef",
|
||||||
"title": "Build JavaScript Objects",
|
"title": "Build JavaScript Objects",
|
||||||
"difficulty":"9.9822",
|
"difficulty": "9.9822",
|
||||||
"description":[
|
"description": [
|
||||||
"You may have heard the term <code>object</code> before.",
|
"You may have heard the term <code>object</code> before.",
|
||||||
"Objects are similar to <code>arrays</code>, except that instead of using indexes to access and modify their data, you access the data in objects through what are called <code>properties</code>.",
|
"Objects are similar to <code>arrays</code>, except that instead of using indexes to access and modify their data, you access the data in objects through what are called <code>properties</code>.",
|
||||||
"Here's a sample object:",
|
"Here's a sample object:",
|
||||||
@ -704,13 +704,13 @@
|
|||||||
"Objects are useful for storing data in a structured way, and can represent real world objects, like a cat.",
|
"Objects are useful for storing data in a structured way, and can represent real world objects, like a cat.",
|
||||||
"Let's try to make an object that represents a dog called <code>myDog</code> which contains the properties <code>'name'</code> (String), <code>'legs'</code> (Number), <code>'tails'</code> (Number) and <code>'friends'</code> (Array)!"
|
"Let's try to make an object that represents a dog called <code>myDog</code> which contains the properties <code>'name'</code> (String), <code>'legs'</code> (Number), <code>'tails'</code> (Number) and <code>'friends'</code> (Array)!"
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert((function(z){if(z.hasOwnProperty(\"name\") && z.name !== undefined && typeof(z.name) === \"string\"){return true;}else{return false;}})(myDog), 'message: <code>myDog</code> should contain the property <code>name</code> and it should be a <code>string</code>.');",
|
"assert((function(z){if(z.hasOwnProperty(\"name\") && z.name !== undefined && typeof(z.name) === \"string\"){return true;}else{return false;}})(myDog), 'message: <code>myDog</code> should contain the property <code>name</code> and it should be a <code>string</code>.');",
|
||||||
"assert((function(z){if(z.hasOwnProperty(\"legs\") && z.legs !== undefined && typeof(z.legs) === \"number\"){return true;}else{return false;}})(myDog), 'message: <code>myDog</code> should contain the property <code>legs</code> and it should be a <code>number</code>.');",
|
"assert((function(z){if(z.hasOwnProperty(\"legs\") && z.legs !== undefined && typeof(z.legs) === \"number\"){return true;}else{return false;}})(myDog), 'message: <code>myDog</code> should contain the property <code>legs</code> and it should be a <code>number</code>.');",
|
||||||
"assert((function(z){if(z.hasOwnProperty(\"tails\") && z.tails !== undefined && typeof(z.tails) === \"number\"){return true;}else{return false;}})(myDog), 'message: <code>myDog</code> should contain the property <code>tails</code> and it should be a <code>number</code>.');",
|
"assert((function(z){if(z.hasOwnProperty(\"tails\") && z.tails !== undefined && typeof(z.tails) === \"number\"){return true;}else{return false;}})(myDog), 'message: <code>myDog</code> should contain the property <code>tails</code> and it should be a <code>number</code>.');",
|
||||||
"assert((function(z){if(z.hasOwnProperty(\"friends\") && z.friends !== undefined && Array.isArray(z.friends)){return true;}else{return false;}})(myDog), 'message: <code>myDog</code> should contain the property <code>friends</code> and it should be an <code>array</code>.');"
|
"assert((function(z){if(z.hasOwnProperty(\"friends\") && z.friends !== undefined && Array.isArray(z.friends)){return true;}else{return false;}})(myDog), 'message: <code>myDog</code> should contain the property <code>friends</code> and it should be an <code>array</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"// var ourDog = {",
|
"// var ourDog = {",
|
||||||
"// \"name\": \"Camper\",",
|
"// \"name\": \"Camper\",",
|
||||||
"// \"legs\": 4,",
|
"// \"legs\": 4,",
|
||||||
@ -735,10 +735,10 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"bg9999c9c99feddfaeb9bdef",
|
"id": "bg9999c9c99feddfaeb9bdef",
|
||||||
"title": "Manipulate JavaScript Objects",
|
"title": "Manipulate JavaScript Objects",
|
||||||
"difficulty":"9.9823",
|
"difficulty": "9.9823",
|
||||||
"description":[
|
"description": [
|
||||||
"There are many ways to add and remove properties from objects.",
|
"There are many ways to add and remove properties from objects.",
|
||||||
"For example, we can add properties to objects like this:",
|
"For example, we can add properties to objects like this:",
|
||||||
"<code>myObject.myProperty = \"myValue\";</code>",
|
"<code>myObject.myProperty = \"myValue\";</code>",
|
||||||
@ -746,11 +746,11 @@
|
|||||||
"<code>delete myObject.myProperty;</code>",
|
"<code>delete myObject.myProperty;</code>",
|
||||||
"Let's add the property <code>\"bark\"</code>, and delete the property <code>\"tails\"</code>."
|
"Let's add the property <code>\"bark\"</code>, and delete the property <code>\"tails\"</code>."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert(myDog.bark !== undefined, 'message: Add the property <code>\"bark\"</code> to <code>myDog</code>.');",
|
"assert(myDog.bark !== undefined, 'message: Add the property <code>\"bark\"</code> to <code>myDog</code>.');",
|
||||||
"assert(myDog.tails === undefined, 'message: Delete the property <code>\"tails\"</code> from <code>myDog</code>.');"
|
"assert(myDog.tails === undefined, 'message: Delete the property <code>\"tails\"</code> from <code>myDog</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"// var ourDog = {",
|
"// var ourDog = {",
|
||||||
"// \"name\": \"Camper\",",
|
"// \"name\": \"Camper\",",
|
||||||
"// \"legs\": 4,",
|
"// \"legs\": 4,",
|
||||||
@ -784,12 +784,18 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c11feddfaeb5bdef",
|
"id": "cf1111c1c11feddfaeb5bdef",
|
||||||
"title": "Iterate with JavaScript For Loops",
|
"title": "Iterate with JavaScript For Loops",
|
||||||
"difficulty":"9.9824",
|
"difficulty": "9.9824",
|
||||||
"description":[
|
"description": [
|
||||||
"You can run the same code multiple times by using a loop.",
|
"You can run the same code multiple times by using a loop.",
|
||||||
"The most common type of JavaScript loop is called a \"for loop\" because it runs \"for\" a specific number of times.",
|
"The most common type of JavaScript loop is called a \"for loop\" because it runs \"for\" a specific number of times.",
|
||||||
|
"For loops are declared with three optional expressions seperated by semicolons:",
|
||||||
|
"<code>for([initialization]; [condition]; [final-expression])</code>",
|
||||||
|
"The <code>initialization</code> statement is executed one time only before the loop starts. It is typically used to define and setup your loop varaible.",
|
||||||
|
"The <code>condition</code> statement is evaluated at the beginning of every loop and will continue as long as it evalutes <code>true</code>. When <code>condition</code> is <code>false</code> at the start of the loop, the loop will stop executing. This means if <code>condition</code> starts as <code>false</code>, your loop will never execute.",
|
||||||
|
"The <code>final-expression</code> is executed at the end of each loop iteration, prior to the next <code>condition</code> check and is usually used to increment or decrement your loop counter.",
|
||||||
|
"We'll initialize with <code>i = 0</code> and loop while our condition <code>i < 5</code> is true. We'll increment <code>i</code> by 1 each loop with <code>i++</code> as our <code>final-expression</code>.",
|
||||||
"<code>var ourArray = [];</code>",
|
"<code>var ourArray = [];</code>",
|
||||||
"<code>for(var i = 0; i < 5; i++) {</code>",
|
"<code>for(var i = 0; i < 5; i++) {</code>",
|
||||||
"<code>  ourArray.push(i);</code>",
|
"<code>  ourArray.push(i);</code>",
|
||||||
@ -797,12 +803,13 @@
|
|||||||
"<code>ourArray</code> will now contain [0,1,2,3,4] ",
|
"<code>ourArray</code> will now contain [0,1,2,3,4] ",
|
||||||
"Let's try getting a for loop to work by pushing values to an array."
|
"Let's try getting a for loop to work by pushing values to an array."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert(editor.getValue().match(/for/g), 'message: You should be using a <code>for</code> loop for this.');",
|
"assert(editor.getValue().match(/for\\s*\\(/g).length > 1, 'message: You should be using a <code>for</code> loop for this.');",
|
||||||
"assert.deepEqual(myArray, [0,1,2,3,4], 'message: <code>myArray</code> should equal [0,1,2,3,4].');"
|
"assert.deepEqual(myArray, [0,1,2,3,4], 'message: <code>myArray</code> should equal [0,1,2,3,4].');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"ourArray = [];",
|
"var ourArray = [];",
|
||||||
|
"",
|
||||||
"for(var i = 0; i < 5; i++){",
|
"for(var i = 0; i < 5; i++){",
|
||||||
" ourArray.push(i);",
|
" ourArray.push(i);",
|
||||||
"}",
|
"}",
|
||||||
@ -815,6 +822,45 @@
|
|||||||
"// Only change code above this line.",
|
"// Only change code above this line.",
|
||||||
"// We use this function to show you the value of your variable in your output box.",
|
"// We use this function to show you the value of your variable in your output box.",
|
||||||
"// You'll learn about functions soon.",
|
"// You'll learn about functions soon.",
|
||||||
|
"if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}"
|
||||||
|
],
|
||||||
|
"type": "waypoint",
|
||||||
|
"challengeType": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "56104e9e514f539506016a5c",
|
||||||
|
"title": "Iterate Odd Numbers With a For Loop",
|
||||||
|
"difficulty": "9.9824",
|
||||||
|
"description": [
|
||||||
|
"For loops don't have to iterate one at a time. By changing our <code>final-expression</code>, we can count by even numbers.",
|
||||||
|
"We'll start at <code>i = 0</code> and loop while <code>i < 10</code>. We'll increment <code>i</code> by 2 each loop with <code>i += 2</code>.",
|
||||||
|
"<code>var ourArray = [];</code>",
|
||||||
|
"<code>for(var i = 0; i < 10; i += 2) {</code>",
|
||||||
|
"<code>  ourArray.push(i);</code>",
|
||||||
|
"<code>}</code>",
|
||||||
|
"<code>ourArray</code> will now contain [0,2,4,6,8] ",
|
||||||
|
"Let's change our <code>initialization</code> and <code>final-expression</code> so we can count by odd numbers."
|
||||||
|
],
|
||||||
|
"tests": [
|
||||||
|
"assert(editor.getValue().match(/for\\s*\\(/g).length > 1, 'message: You should be using a <code>for</code> loop for this.');",
|
||||||
|
"assert.deepEqual(myArray, [1,3,5,7,9], 'message: <code>myArray</code> should equal [1,3,5,7,9].');"
|
||||||
|
],
|
||||||
|
"challengeSeed": [
|
||||||
|
"var ourArray = [];",
|
||||||
|
"",
|
||||||
|
"for(var i = 1; i < 10; i += 2){",
|
||||||
|
" ourArray.push(i);",
|
||||||
|
"}",
|
||||||
|
"",
|
||||||
|
"var myArray = [];",
|
||||||
|
"",
|
||||||
|
"// Only change code below this line.",
|
||||||
|
"",
|
||||||
|
"// Push the odd numbers from one through nine to myArray using a \"for loop\" like above.",
|
||||||
|
"",
|
||||||
|
"// Only change code above this line.",
|
||||||
|
"// We use this function to show you the value of your variable in your output box.",
|
||||||
|
"// You'll learn about functions soon.",
|
||||||
"if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}",
|
"if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}",
|
||||||
""
|
""
|
||||||
],
|
],
|
||||||
@ -822,10 +868,52 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c11feddfaeb1bdef",
|
"id": "56105e7b514f539506016a5e",
|
||||||
|
"title": "Count Backwards With a For Loop",
|
||||||
|
"difficulty": "9.9824",
|
||||||
|
"description": [
|
||||||
|
"A for loop can also count backwards, so long as we can define the right conditions.",
|
||||||
|
"",
|
||||||
|
"In order to count backwards by twos, we'll need to change our <code>initialization</code>, <code>condition</code>, and <code>final-expression</code>.",
|
||||||
|
"We'll start at <code>i = 10</code> and loop while <code>i > 0</code>. We'll decrement <code>i</code> by 2 each loop with <code>i -= 2</code>.",
|
||||||
|
"<code>var ourArray = [];</code>",
|
||||||
|
"<code>for(var i = 10; i > 0; i -= 2) {</code>",
|
||||||
|
"<code>  ourArray.push(i);</code>",
|
||||||
|
"<code>}</code>",
|
||||||
|
"<code>ourArray</code> will now contain [10,8,6,4,2] ",
|
||||||
|
"Let's change our <code>initialization</code> and <code>final-expression</code> so we can count backward by twos for odd numbers."
|
||||||
|
],
|
||||||
|
"tests": [
|
||||||
|
"assert(editor.getValue().match(/for\\s*\\(/g).length > 1, 'message: You should be using a <code>for</code> loop for this.');",
|
||||||
|
"assert.deepEqual(myArray, [9,7,5,3,1], 'message: <code>myArray</code> should equal [9,7,5,3,1].');"
|
||||||
|
],
|
||||||
|
"challengeSeed": [
|
||||||
|
"var ourArray = [];",
|
||||||
|
"",
|
||||||
|
"for(var i = 9; i > 0; i -= 2){",
|
||||||
|
" ourArray.push(i);",
|
||||||
|
"}",
|
||||||
|
"",
|
||||||
|
"var myArray = [];",
|
||||||
|
"",
|
||||||
|
"// Only change code below this line.",
|
||||||
|
"",
|
||||||
|
"// Push the odd numbers from nine through one to myArray using a \"for loop\" like above.",
|
||||||
|
"",
|
||||||
|
"// Only change code above this line.",
|
||||||
|
"// We use this function to show you the value of your variable in your output box.",
|
||||||
|
"// You'll learn about functions soon.",
|
||||||
|
"if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"type": "waypoint",
|
||||||
|
"challengeType": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "cf1111c1c11feddfaeb1bdef",
|
||||||
"title": "Iterate with JavaScript While Loops",
|
"title": "Iterate with JavaScript While Loops",
|
||||||
"difficulty":"9.9825",
|
"difficulty": "9.9825",
|
||||||
"description":[
|
"description": [
|
||||||
"You can run the same code multiple times by using a loop.",
|
"You can run the same code multiple times by using a loop.",
|
||||||
"Another type of JavaScript loop is called a \"while loop\", because it runs \"while\" something is true and stops once that something is no longer true.",
|
"Another type of JavaScript loop is called a \"while loop\", because it runs \"while\" something is true and stops once that something is no longer true.",
|
||||||
"<code>var ourArray = [];</code>",
|
"<code>var ourArray = [];</code>",
|
||||||
@ -836,11 +924,11 @@
|
|||||||
"<code>}</code>",
|
"<code>}</code>",
|
||||||
"Let's try getting a while loop to work by pushing values to an array."
|
"Let's try getting a while loop to work by pushing values to an array."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert(editor.getValue().match(/while/g), 'message: You should be using a <code>while</code> loop for this.');",
|
"assert(editor.getValue().match(/while/g), 'message: You should be using a <code>while</code> loop for this.');",
|
||||||
"assert.deepEqual(myArray, [0,1,2,3,4], 'message: <code>myArray</code> should equal [0,1,2,3,4].');"
|
"assert.deepEqual(myArray, [0,1,2,3,4], 'message: <code>myArray</code> should equal [0,1,2,3,4].');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"var myArray = [];",
|
"var myArray = [];",
|
||||||
"// Only change code below this line.",
|
"// Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
@ -856,20 +944,20 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c11feddfaeb9bdef",
|
"id": "cf1111c1c11feddfaeb9bdef",
|
||||||
"title": "Generate Random Fractions with JavaScript",
|
"title": "Generate Random Fractions with JavaScript",
|
||||||
"difficulty":"9.9827",
|
"difficulty": "9.9827",
|
||||||
"description":[
|
"description": [
|
||||||
"Random numbers are useful for creating random behavior.",
|
"Random numbers are useful for creating random behavior.",
|
||||||
"JavaScript has a <code>Math.random()</code> function that generates a random decimal number.",
|
"JavaScript has a <code>Math.random()</code> function that generates a random decimal number.",
|
||||||
"Use <code>Math.random()</code> to get <code>myFunction</code> to return a random number."
|
"Use <code>Math.random()</code> to get <code>myFunction</code> to return a random number."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert(typeof(myFunction()) === \"number\", 'message: <code>myFunction</code> should return a random number.');",
|
"assert(typeof(myFunction()) === \"number\", 'message: <code>myFunction</code> should return a random number.');",
|
||||||
"assert((myFunction()+''). match(/\\./g), 'message: The number returned by <code>myFunction</code> should be a decimal.');",
|
"assert((myFunction()+''). match(/\\./g), 'message: The number returned by <code>myFunction</code> should be a decimal.');",
|
||||||
"assert(editor.getValue().match(/Math\\.random/g).length >= 2, 'message: You should be using <code>Math.random</code> to generate the random decimal number.');"
|
"assert(editor.getValue().match(/Math\\.random/g).length >= 2, 'message: You should be using <code>Math.random</code> to generate the random decimal number.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"function myFunction() {",
|
"function myFunction() {",
|
||||||
" // Change the 0 to Math.random().",
|
" // Change the 0 to Math.random().",
|
||||||
" // Only change code below this line.",
|
" // Only change code below this line.",
|
||||||
@ -886,10 +974,10 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c12feddfaeb1bdef",
|
"id": "cf1111c1c12feddfaeb1bdef",
|
||||||
"title": "Generate Random Whole Numbers with JavaScript",
|
"title": "Generate Random Whole Numbers with JavaScript",
|
||||||
"difficulty":"9.9828",
|
"difficulty": "9.9828",
|
||||||
"description":[
|
"description": [
|
||||||
"It's great that we can create random decimal numbers, but it's even more useful if we use it to generate a random whole number.",
|
"It's great that we can create random decimal numbers, but it's even more useful if we use it to generate a random whole number.",
|
||||||
"To achieve this we can multiply the random number by ten and use the <code>Math.floor()</code> to convert the decimal number to the nearest less than or equal whole number.",
|
"To achieve this we can multiply the random number by ten and use the <code>Math.floor()</code> to convert the decimal number to the nearest less than or equal whole number.",
|
||||||
"This technique gives us a whole number between zero and nine.",
|
"This technique gives us a whole number between zero and nine.",
|
||||||
@ -897,13 +985,13 @@
|
|||||||
"<code>Math.floor(Math.random()*10);</code>",
|
"<code>Math.floor(Math.random()*10);</code>",
|
||||||
"Let's give this technique a go now."
|
"Let's give this technique a go now."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert(typeof(myFunction()) === \"number\", 'message: The result of <code>myFunction</code> should be a number.');",
|
"assert(typeof(myFunction()) === \"number\", 'message: The result of <code>myFunction</code> should be a number.');",
|
||||||
"assert(editor.getValue().match(/Math.random/g), 'message: You should be using Math.random to create a random number.');",
|
"assert(editor.getValue().match(/Math.random/g), 'message: You should be using Math.random to create a random number.');",
|
||||||
"assert(editor.getValue().match(/\\(\\s*?Math.random\\s*?\\(\\s*?\\)\\s*?\\*\\s*?10\\s*?\\)/g) || editor.getValue().match(/\\(\\s*?10\\s*?\\*\\s*?Math.random\\s*?\\(\\s*?\\)\\s*?\\)/g), 'message: You should have multiplied the result of <code>Math.random</code> by 10 to make it a number that is between zero and nine.');",
|
"assert(editor.getValue().match(/\\(\\s*?Math.random\\s*?\\(\\s*?\\)\\s*?\\*\\s*?10\\s*?\\)/g) || editor.getValue().match(/\\(\\s*?10\\s*?\\*\\s*?Math.random\\s*?\\(\\s*?\\)\\s*?\\)/g), 'message: You should have multiplied the result of <code>Math.random</code> by 10 to make it a number that is between zero and nine.');",
|
||||||
"assert(editor.getValue().match(/Math.floor/g), 'message: You should use <code>Math.floor</code> to remove the decimal part of the number.');"
|
"assert(editor.getValue().match(/Math.floor/g), 'message: You should use <code>Math.floor</code> to remove the decimal part of the number.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"function myFunction(){",
|
"function myFunction(){",
|
||||||
" // Make myFunction return a random number between zero and nine instead of a decimal.",
|
" // Make myFunction return a random number between zero and nine instead of a decimal.",
|
||||||
"",
|
"",
|
||||||
@ -921,25 +1009,25 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c12feddfaeb2bdef",
|
"id": "cf1111c1c12feddfaeb2bdef",
|
||||||
"title": "Generate Random Whole Numbers within a Range",
|
"title": "Generate Random Whole Numbers within a Range",
|
||||||
"difficulty":"9.9829",
|
"difficulty": "9.9829",
|
||||||
"description":[
|
"description": [
|
||||||
"We can use a certain mathematical expression to get a random number between two numbers.",
|
"We can use a certain mathematical expression to get a random number between two numbers.",
|
||||||
"<code>Math.floor(Math.random() * (max - min + 1)) + min</code>",
|
"<code>Math.floor(Math.random() * (max - min + 1)) + min</code>",
|
||||||
"By using this, we can control the output of a random number."
|
"By using this, we can control the output of a random number."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert(myFunction() >= min, 'message: The random number generated by <code>myFunction</code> should be greater than or equal to the minimum number.');",
|
"assert(myFunction() >= min, 'message: The random number generated by <code>myFunction</code> should be greater than or equal to the minimum number.');",
|
||||||
"assert(myFunction() <= max, 'message: The random number generated by <code>myFunction</code> should be less than or equal to the maximum number.');",
|
"assert(myFunction() <= max, 'message: The random number generated by <code>myFunction</code> should be less than or equal to the maximum number.');",
|
||||||
"assert(myFunction() % 1 === 0 , 'message: The random number generated by <code>myFunction</code> should be an integer, not a decimal.');",
|
"assert(myFunction() % 1 === 0 , 'message: The random number generated by <code>myFunction</code> should be an integer, not a decimal.');",
|
||||||
"assert((function(){if(editor.getValue().match(/max/g).length >= 2 && editor.getValue().match(/min/g).length >= 2 && editor.getValue().match(/Math.floor/g) && editor.getValue().match(/Math.random/g)){return true;}else{return false;}})(), 'message: You should be using the function given in the description to calculate the random in number in a range.');"
|
"assert((function(){if(editor.getValue().match(/max/g).length >= 3 && editor.getValue().match(/min/g).length >= 4 && editor.getValue().match(/Math.floor/g) && editor.getValue().match(/Math.random/g)){return true;}else{return false;}})(), 'message: You should be using the function given in the description to calculate the random in number in a range.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"var min = 0;",
|
"var min = 1;",
|
||||||
"var max = 9;",
|
"var max = 9;",
|
||||||
"function myFunction() {",
|
"function myFunction() {",
|
||||||
" // Make myFunction return a random number between zero and nine instead of a decimal",
|
" // Make myFunction return a random number between min and max values instead of a decimal",
|
||||||
" // Only change code below this line.",
|
" // Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
" return Math.random();",
|
" return Math.random();",
|
||||||
@ -953,10 +1041,10 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c12feddfaeb3bdef",
|
"id": "cf1111c1c12feddfaeb3bdef",
|
||||||
"title": "Use Conditional Logic with If and Else Statements",
|
"title": "Use Conditional Logic with If and Else Statements",
|
||||||
"difficulty":"9.983",
|
"difficulty": "9.983",
|
||||||
"description":[
|
"description": [
|
||||||
"We can use <code>if</code> statements in JavaScript to only execute code if a certain condition is met.",
|
"We can use <code>if</code> statements in JavaScript to only execute code if a certain condition is met.",
|
||||||
"<code>if</code> statements require some sort of boolean condition to evaluate.",
|
"<code>if</code> statements require some sort of boolean condition to evaluate.",
|
||||||
"For example:",
|
"For example:",
|
||||||
@ -968,13 +1056,13 @@
|
|||||||
"Let's use <code>if</code> and <code>else</code> statements to make a coin-flip game.",
|
"Let's use <code>if</code> and <code>else</code> statements to make a coin-flip game.",
|
||||||
"Create <code>if</code> and <code>else</code> statements to return the string <code>\"heads\"</code> if the flip variable is zero, or else return the string <code>\"tails\"</code> if the flip variable is not zero."
|
"Create <code>if</code> and <code>else</code> statements to return the string <code>\"heads\"</code> if the flip variable is zero, or else return the string <code>\"tails\"</code> if the flip variable is not zero."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert((function(){var result = myFunction();if(result === 'heads' || result === 'tails'){return true;} else {return false;}})(), 'message: <code>myFunction</code> should either return <code>heads</code> or <code>tails</code>.');",
|
"assert((function(){var result = myFunction();if(result === 'heads' || result === 'tails'){return true;} else {return false;}})(), 'message: <code>myFunction</code> should either return <code>heads</code> or <code>tails</code>.');",
|
||||||
"assert((function(){var result = myFunction();if(result === 'heads' && flip === 0 || result === 'tails' && flip !== 0){return true;} else {return false;}})(), 'message: <code>myFunction</code> should return <code>heads</code> when flip equals 0 and <code>tails</code> when flip equals 1.');",
|
"assert((function(){var result = myFunction();if(result === 'heads' && flip === 0 || result === 'tails' && flip !== 0){return true;} else {return false;}})(), 'message: <code>myFunction</code> should return <code>heads</code> when flip equals 0 and <code>tails</code> when flip equals 1.');",
|
||||||
"assert(editor.getValue().match(/if/g).length >= 4, 'message: You should have created a new if statement.');",
|
"assert(editor.getValue().match(/if/g).length >= 4, 'message: You should have created a new if statement.');",
|
||||||
"assert(editor.getValue().match(/else/g).length >= 2, 'message: You should have created a new else statement.');"
|
"assert(editor.getValue().match(/else/g).length >= 2, 'message: You should have created a new else statement.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;",
|
"var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;",
|
||||||
"function myFunction(){",
|
"function myFunction(){",
|
||||||
" // Create an if-else statement here to return \"heads\" if flip is 0. Otherwise return \"tails\".",
|
" // Create an if-else statement here to return \"heads\" if flip is 0. Otherwise return \"tails\".",
|
||||||
@ -993,12 +1081,12 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c12feddfaeb6bdef",
|
"id": "cf1111c1c12feddfaeb6bdef",
|
||||||
"title": "Sift through Text with Regular Expressions",
|
"title": "Sift through Text with Regular Expressions",
|
||||||
"difficulty":"9.984",
|
"difficulty": "9.984",
|
||||||
"description":[
|
"description": [
|
||||||
"<code>Regular expressions</code> are used to find certain words or patterns inside of <code>strings</code>.",
|
"<code>Regular expressions</code> are used to find certain words or patterns inside of <code>strings</code>.",
|
||||||
"For example, if we wanted to find the word <code>the</code> in the string <code>The dog chased the cat</code>, we could use the following <code>regular expression</code>: <code>\/the\/gi</code>",
|
"For example, if we wanted to find the word <code>the</code> in the string <code>The dog chased the cat</code>, we could use the following <code>regular expression</code>: <code>/the/gi</code>",
|
||||||
"Let's break this down a bit:",
|
"Let's break this down a bit:",
|
||||||
"<code>the</code> is the pattern we want to match.",
|
"<code>the</code> is the pattern we want to match.",
|
||||||
"<code>g</code> means that we want to search the entire string for this pattern instead of just the first match.",
|
"<code>g</code> means that we want to search the entire string for this pattern instead of just the first match.",
|
||||||
@ -1006,11 +1094,11 @@
|
|||||||
"<code>Regular expressions</code> are written by surrounding the pattern with <code>/</code> symbols.",
|
"<code>Regular expressions</code> are written by surrounding the pattern with <code>/</code> symbols.",
|
||||||
"Let's try selecting all the occurrences of the word <code>and</code> in the string <code>Ada Lovelace and Charles Babbage designed the first computer and the software that would have run on it</code>. We can do this by replacing the <code>.</code> part of our regular expression with the current <code>regular expression</code> with the word <code>and</code>."
|
"Let's try selecting all the occurrences of the word <code>and</code> in the string <code>Ada Lovelace and Charles Babbage designed the first computer and the software that would have run on it</code>. We can do this by replacing the <code>.</code> part of our regular expression with the current <code>regular expression</code> with the word <code>and</code>."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert(test==2, 'message: Your <code>regular expression</code> should find two occurrences of the word <code>and</code>.');",
|
"assert(test==2, 'message: Your <code>regular expression</code> should find two occurrences of the word <code>and</code>.');",
|
||||||
"assert(editor.getValue().match(/\\/and\\/gi/), 'message: You should have used <code>regular expressions</code> to find the word <code>and</code>.');"
|
"assert(editor.getValue().match(/\\/and\\/gi/), 'message: You should have used <code>regular expressions</code> to find the word <code>and</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"var test = (function() {",
|
"var test = (function() {",
|
||||||
" var testString = \"Ada Lovelace and Charles Babbage designed the first computer and the software that would have run on it.\";",
|
" var testString = \"Ada Lovelace and Charles Babbage designed the first computer and the software that would have run on it.\";",
|
||||||
" var expressionToGetSoftware = /software/gi;",
|
" var expressionToGetSoftware = /software/gi;",
|
||||||
@ -1027,21 +1115,21 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c12feddfaeb7bdef",
|
"id": "cf1111c1c12feddfaeb7bdef",
|
||||||
"title": "Find Numbers with Regular Expressions",
|
"title": "Find Numbers with Regular Expressions",
|
||||||
"difficulty":"9.985",
|
"difficulty": "9.985",
|
||||||
"description":[
|
"description": [
|
||||||
"We can use special selectors in <code>Regular Expressions</code> to select a particular type of value.",
|
"We can use special selectors in <code>Regular Expressions</code> to select a particular type of value.",
|
||||||
"One such selector is the digit selector <code>\\d</code> which is used to grab the numbers in a string.",
|
"One such selector is the digit selector <code>\\d</code> which is used to grab the numbers in a string.",
|
||||||
"It is used like this: <code>/\\d/g</code>.",
|
"It is used like this: <code>/\\d/g</code>.",
|
||||||
"For numbers this is often written as <code>/\\d+/g</code>, where the <code>+</code> following the digit selector allows this regular expression to match multi-digit numbers.",
|
"For numbers this is often written as <code>/\\d+/g</code>, where the <code>+</code> following the digit selector allows this regular expression to match multi-digit numbers.",
|
||||||
"Use the <code>\\d</code> selector to select the number of numbers in the string, allowing for the possibility of multi-digit numbers."
|
"Use the <code>\\d</code> selector to select the number of numbers in the string, allowing for the possibility of multi-digit numbers."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert(test === 2, 'message: Your RegEx should have found two numbers in the <code>testString</code>.');",
|
"assert(test === 2, 'message: Your RegEx should have found two numbers in the <code>testString</code>.');",
|
||||||
"assert(editor.getValue().match(/\\/\\\\d\\+\\//g), 'message: You should be using the following expression <code>/\\d+/g</code> to find the numbers in the <code>testString</code>.');"
|
"assert(editor.getValue().match(/\\/\\\\d\\+\\//g), 'message: You should be using the following expression <code>/\\d+/g</code> to find the numbers in the <code>testString</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"var test = (function() {",
|
"var test = (function() {",
|
||||||
" var testString = \"There are 3 cats but 4 dogs.\";",
|
" var testString = \"There are 3 cats but 4 dogs.\";",
|
||||||
"",
|
"",
|
||||||
@ -1058,20 +1146,21 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c12feddfaeb8bdef",
|
"id": "cf1111c1c12feddfaeb8bdef",
|
||||||
"title": "Find White Space with Regular Expressions",
|
"title": "Find Whitespace with Regular Expressions",
|
||||||
"difficulty":"9.986",
|
"difficulty": "9.986",
|
||||||
"description":[
|
"description": [
|
||||||
"We can also use selectors like <code>\\s</code> to find spaces in a string.",
|
"We can also use selectors like <code>\\s</code> to find whitespace in a string.",
|
||||||
|
"The whitespace characters are <code>\" \"</code> (space), <code>\\r</code> (carriage return), <code>\\n</code> (newline), <code>\\t</code> (tab), and <code>\\f</code> (form feed).",
|
||||||
"It is used like this:",
|
"It is used like this:",
|
||||||
"<code>/\\s+/g</code>",
|
"<code>/\\s+/g</code>",
|
||||||
"Select all the spaces in the sentence string."
|
"Select all the whitespace characters in the sentence string."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert(test === 7, 'message: Your RegEx should have found seven spaces in the <code>testString</code>.');",
|
"assert(test === 7, 'message: Your RegEx should have found seven spaces in the <code>testString</code>.');",
|
||||||
"assert(editor.getValue().match(/\\/\\\\s\\+\\//g), 'message: You should be using the following expression <code>/\\s+/g</code> to find the spaces in the <code>testString</code>.');"
|
"assert(editor.getValue().match(/\\/\\\\s\\+\\//g), 'message: You should be using the following expression <code>/\\s+/g</code> to find the spaces in the <code>testString</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"var test = (function(){",
|
"var test = (function(){",
|
||||||
" var testString = \"How many spaces are there in this sentence?\";",
|
" var testString = \"How many spaces are there in this sentence?\";",
|
||||||
"",
|
"",
|
||||||
@ -1088,18 +1177,18 @@
|
|||||||
"challengeType": 1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c13feddfaeb3bdef",
|
"id": "cf1111c1c13feddfaeb3bdef",
|
||||||
"title": "Invert Regular Expression Matches with JavaScript",
|
"title": "Invert Regular Expression Matches with JavaScript",
|
||||||
"difficulty":"9.987",
|
"difficulty": "9.987",
|
||||||
"description":[
|
"description": [
|
||||||
"Use <code>/\\S/g</code> to match everything that isn't a space in the string.",
|
"Use <code>/\\S/g</code> to match everything that isn't a space in the string.",
|
||||||
"You can invert any match by using the uppercase version of the selector <code>\\s</code> versus <code>\\S</code> for example."
|
"You can invert any match by using the uppercase version of the selector <code>\\s</code> versus <code>\\S</code> for example."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert(test === 49, 'message: Your RegEx should have found forty nine non-space characters in the <code>testString</code>.');",
|
"assert(test === 49, 'message: Your RegEx should have found forty nine non-space characters in the <code>testString</code>.');",
|
||||||
"assert(editor.getValue().match(/\\/\\\\S\\/g/g), 'message: You should be using the following expression <code>/\\S/g</code> to find non-space characters in the <code>testString</code>.');"
|
"assert(editor.getValue().match(/\\/\\\\S\\/g/g), 'message: You should be using the following expression <code>/\\S/g</code> to find non-space characters in the <code>testString</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"var test = (function(){",
|
"var test = (function(){",
|
||||||
" var testString = \"How many non-space characters are there in this sentence?\";",
|
" var testString = \"How many non-space characters are there in this sentence?\";",
|
||||||
"",
|
"",
|
||||||
@ -1113,26 +1202,26 @@
|
|||||||
"})();(function(){return test;})();"
|
"})();(function(){return test;})();"
|
||||||
],
|
],
|
||||||
"type": "waypoint",
|
"type": "waypoint",
|
||||||
"challengeType":1
|
"challengeType": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c12feddfaeb9bdef",
|
"id": "cf1111c1c12feddfaeb9bdef",
|
||||||
"title": "Create a JavaScript Slot Machine",
|
"title": "Create a JavaScript Slot Machine",
|
||||||
"difficulty":"9.988",
|
"difficulty": "9.988",
|
||||||
"description":[
|
"description": [
|
||||||
"We are now going to try and combine some of the stuff we've just learned and create the logic for a slot machine game.",
|
"We are now going to try and combine some of the stuff we've just learned and create the logic for a slot machine game.",
|
||||||
"For this we will need to generate three random numbers between <code>1</code> and <code>3</code> to represent the possible values of each individual slot.",
|
"For this we will need to generate three random numbers between <code>1</code> and <code>3</code> to represent the possible values of each individual slot.",
|
||||||
"Store the three random numbers in <code>slotOne</code>, <code>slotTwo</code> and <code>slotThree</code>.",
|
"Store the three random numbers in <code>slotOne</code>, <code>slotTwo</code> and <code>slotThree</code>.",
|
||||||
"Generate the random numbers by using the system we used earlier (an explanation of the formula can be found <a href=\"https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Waypoint-Generate-Random-Whole-Numbers-within-a-Range#explanation\">here</a>):",
|
"Generate the random numbers by using the system we used earlier (an explanation of the formula can be found <a href=\"https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Waypoint-Generate-Random-Whole-Numbers-within-a-Range#explanation\">here</a>):",
|
||||||
"<code>Math.floor(Math.random() * (3 - 1 + 1)) + 1;</code>"
|
"<code>Math.floor(Math.random() * (3 - 1 + 1)) + 1;</code>"
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert(typeof(runSlots($(\".slot\"))[0]) === \"number\", 'message: <code>slotOne</code> should be a random number.')",
|
"assert(typeof(runSlots($(\".slot\"))[0]) === \"number\", '<code>slotOne</code> should be a random number.')",
|
||||||
"assert(typeof(runSlots($(\".slot\"))[1]) === \"number\", 'message: <code>slotTwo</code> should be a random number.')",
|
"assert(typeof(runSlots($(\".slot\"))[1]) === \"number\", '<code>slotTwo</code> should be a random number.')",
|
||||||
"assert(typeof(runSlots($(\".slot\"))[2]) === \"number\", 'message: <code>slotThree</code> should be a random number.')",
|
"assert(typeof(runSlots($(\".slot\"))[2]) === \"number\", '<code>slotThree</code> should be a random number.')",
|
||||||
"assert((function(){if(editor.match(/Math\\.floor\\(\\s?Math\\.random\\(\\)\\s?\\*\\s?\\(\\s?3\\s?\\-\\s?1\\s?\\+\\s?1\\s?\\)\\s?\\)\\s?\\+\\s?1;/gi) !== null){return editor.match(/Math\\.floor\\(\\s?Math\\.random\\(\\)\\s?\\*\\s?\\(\\s?3\\s?\\-\\s?1\\s?\\+\\s?1\\s?\\)\\s?\\)\\s?\\+\\s?1;/gi).length >= 3;}else{return false;}})(), 'message: You should have used <code>Math.floor(Math.random() * (3 - 1 + 1)) + 1;</code> three times to generate your random numbers.')"
|
"assert((function(){if(editor.match(/Math\\.floor\\(\\s?Math\\.random\\(\\)\\s?\\*\\s?\\(\\s?3\\s?\\-\\s?1\\s?\\+\\s?1\\s?\\)\\s?\\)\\s?\\+\\s?1;/gi) !== null){return editor.match(/Math\\.floor\\(\\s?Math\\.random\\(\\)\\s?\\*\\s?\\(\\s?3\\s?\\-\\s?1\\s?\\+\\s?1\\s?\\)\\s?\\)\\s?\\+\\s?1;/gi).length >= 3;}else{return false;}})(), 'You should have used <code>Math.floor(Math.random() * (3 - 1 + 1)) + 1;</code> three times to generate your random numbers.')"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"fccss",
|
"fccss",
|
||||||
" function runSlots(){",
|
" function runSlots(){",
|
||||||
" var slotOne;",
|
" var slotOne;",
|
||||||
@ -1270,10 +1359,10 @@
|
|||||||
"challengeType": 0
|
"challengeType": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c13feddfaeb1bdef",
|
"id": "cf1111c1c13feddfaeb1bdef",
|
||||||
"title": "Add your JavaScript Slot Machine Slots",
|
"title": "Add your JavaScript Slot Machine Slots",
|
||||||
"difficulty":"9.989",
|
"difficulty": "9.989",
|
||||||
"description":[
|
"description": [
|
||||||
"Now that our slots will each generate random numbers, we need to check whether they've all returned the same number.",
|
"Now that our slots will each generate random numbers, we need to check whether they've all returned the same number.",
|
||||||
"If they have, we should notify our user that they've won.",
|
"If they have, we should notify our user that they've won.",
|
||||||
"Otherwise, we should return <code>null</code>, which is a JavaScript data structure that means nothing.",
|
"Otherwise, we should return <code>null</code>, which is a JavaScript data structure that means nothing.",
|
||||||
@ -1283,10 +1372,10 @@
|
|||||||
"<code>  return null;</code>",
|
"<code>  return null;</code>",
|
||||||
"<code>}</code>"
|
"<code>}</code>"
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert((function(){var data = runSlots();if(data === null){return true}else{if(data[0] === data[1] && data[1] === data[2]){return true;}else{return false;}}})(), 'If all three of our random numbers are the same we should return that number. Otherwise we should return <code>null</code>.')"
|
"assert((function(){var data = runSlots();return data === null || data.toString().length === 1;})(), 'If all three of our random numbers are the same we should return that number. Otherwise we should return <code>null</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"fccss",
|
"fccss",
|
||||||
" function runSlots(){",
|
" function runSlots(){",
|
||||||
" var slotOne;",
|
" var slotOne;",
|
||||||
@ -1309,7 +1398,7 @@
|
|||||||
" // Only change code above this line.",
|
" // Only change code above this line.",
|
||||||
" ",
|
" ",
|
||||||
" if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){",
|
" if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){",
|
||||||
" $(\".logger\").html(slotOne);",
|
" $(\".logger\").text(slotOne);",
|
||||||
" $(\".logger\").append(\" \" + slotTwo);",
|
" $(\".logger\").append(\" \" + slotTwo);",
|
||||||
" $(\".logger\").append(\" \" + slotThree);",
|
" $(\".logger\").append(\" \" + slotThree);",
|
||||||
" }",
|
" }",
|
||||||
@ -1430,10 +1519,10 @@
|
|||||||
"challengeType": 0
|
"challengeType": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c13feddfaeb2bdef",
|
"id": "cf1111c1c13feddfaeb2bdef",
|
||||||
"title": "Bring your JavaScript Slot Machine to Life",
|
"title": "Bring your JavaScript Slot Machine to Life",
|
||||||
"difficulty":"9.990",
|
"difficulty": "9.990",
|
||||||
"description":[
|
"description": [
|
||||||
"Now we can detect a win. Let's get this slot machine working.",
|
"Now we can detect a win. Let's get this slot machine working.",
|
||||||
"Let's use the jQuery <code>selector</code> <code>$(\".slot\")</code> to select all of the slots.",
|
"Let's use the jQuery <code>selector</code> <code>$(\".slot\")</code> to select all of the slots.",
|
||||||
"Once they are all selected, we can use <code>bracket notation</code> to access each individual slot:",
|
"Once they are all selected, we can use <code>bracket notation</code> to access each individual slot:",
|
||||||
@ -1441,11 +1530,11 @@
|
|||||||
"This jQuery will select the first and update the slot's HTML to display the correct number.",
|
"This jQuery will select the first and update the slot's HTML to display the correct number.",
|
||||||
"Use the above selector to display each number in its corresponding slot."
|
"Use the above selector to display each number in its corresponding slot."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert((function(){runSlots();if($($(\".slot\")[0]).html().replace(/\\s/gi, \"\") !== \"\" && $($(\".slot\")[1]).html().replace(/\\s/gi, \"\") !== \"\" && $($(\".slot\")[2]).html().replace(/\\s/gi, \"\") !== \"\"){return true;}else{return false;}})(), 'You should be displaying the result of the slot numbers in the corresponding slots.')",
|
"assert((function(){runSlots();if($($(\".slot\")[0]).html().replace(/\\s/gi, \"\") !== \"\" && $($(\".slot\")[1]).html().replace(/\\s/gi, \"\") !== \"\" && $($(\".slot\")[2]).html().replace(/\\s/gi, \"\") !== \"\"){return true;}else{return false;}})(), 'You should be displaying the result of the slot numbers in the corresponding slots.')",
|
||||||
"assert((editor.match( /\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[\\d\\]\\s*?\\)/gi) && editor.match( /\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[\\d\\]\\s*?\\)/gi ).length >= 3 && editor.match( /\\.html\\(slotOne\\)/gi ) && editor.match( /\\.html\\(slotTwo\\)/gi ) && editor.match( /\\.html\\(slotThree\\)/gi )), 'You should have used the the selector given in the description to select each slot and assign it the value of <code>slotOne</code>, <code>slotTwo</code> and <code>slotThree</code> respectively.')"
|
"assert((editor.match( /\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[\\d\\]\\s*?\\)/gi) && editor.match( /\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[\\d\\]\\s*?\\)/gi ).length >= 3 && editor.match( /\\.html\\(slotOne\\)/gi ) && editor.match( /\\.html\\(slotTwo\\)/gi ) && editor.match( /\\.html\\(slotThree\\)/gi )), 'You should have used the the selector given in the description to select each slot and assign it the value of <code>slotOne</code>, <code>slotTwo</code> and <code>slotThree</code> respectively.')"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"fccss",
|
"fccss",
|
||||||
" function runSlots(){",
|
" function runSlots(){",
|
||||||
" var slotOne;",
|
" var slotOne;",
|
||||||
@ -1467,12 +1556,13 @@
|
|||||||
" ",
|
" ",
|
||||||
" // Only change code above this line.",
|
" // Only change code above this line.",
|
||||||
" ",
|
" ",
|
||||||
" if(slotOne !== slotTwo || slotTwo !== slotThree){",
|
" if(slotOne === slotTwo && slotTwo === slotThree){",
|
||||||
" return null;",
|
" return slotOne;",
|
||||||
" }",
|
" }",
|
||||||
|
" return null;",
|
||||||
" ",
|
" ",
|
||||||
" if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){",
|
" if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){",
|
||||||
" $(\".logger\").html(slotOne);",
|
" $(\".logger\").text(slotOne);",
|
||||||
" $(\".logger\").append(\" \" + slotTwo);",
|
" $(\".logger\").append(\" \" + slotTwo);",
|
||||||
" $(\".logger\").append(\" \" + slotThree);",
|
" $(\".logger\").append(\" \" + slotThree);",
|
||||||
" }",
|
" }",
|
||||||
@ -1596,17 +1686,17 @@
|
|||||||
"challengeType": 0
|
"challengeType": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":"cf1111c1c11feddfaeb1bdff",
|
"id": "cf1111c1c11feddfaeb1bdff",
|
||||||
"title": "Give your JavaScript Slot Machine some Stylish Images",
|
"title": "Give your JavaScript Slot Machine some Stylish Images",
|
||||||
"difficulty":"9.9901",
|
"difficulty": "9.9901",
|
||||||
"description":[
|
"description": [
|
||||||
"Now let's add some images to our slots.",
|
"Now let's add some images to our slots.",
|
||||||
"We've already set up the images for you in an array called <code>images</code>. We can use different indexes to grab each of these.",
|
"We've already set up the images for you in an array called <code>images</code>. We can use different indexes to grab each of these.",
|
||||||
"Here's how we would set the first slot to show a different image depending on which number its random number generates:",
|
"Here's how we would set the first slot to show a different image depending on which number its random number generates:",
|
||||||
"<code>$($('.slot')[0]).html('<img src = \"' + images[slotOne-1] + '\">');</code>",
|
"<code>$($('.slot')[0]).html('<img src = \"' + images[slotOne-1] + '\">');</code>",
|
||||||
"Set up all three slots like this, then click the \"Go\" button to play the slot machine."
|
"Set up all three slots like this, then click the \"Go\" button to play the slot machine."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests": [
|
||||||
"assert((editor.match(/\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[\\d\\]\\s*?\\)\\.html\\(\\s*?\\'\\<img\\s?src\\s?=\\s?\"\\'\\s?\\+\\s?images\\[\\w+\\-1\\]\\s?\\+\\s?\\'\"\\>\\'\\s*?\\);/gi) && editor.match(/\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[\\d\\]\\s*?\\)\\.html\\(\\s*?\\'\\<img\\s?src\\s?=\\s?\"\\'\\s?\\+\\s?images\\[\\w+\\-1\\]\\s?\\+\\s?\\'\"\\>\\'\\s*?\\);/gi).length >= 3), 'Use the provided code three times. One for each slot.')",
|
"assert((editor.match(/\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[\\d\\]\\s*?\\)\\.html\\(\\s*?\\'\\<img\\s?src\\s?=\\s?\"\\'\\s?\\+\\s?images\\[\\w+\\-1\\]\\s?\\+\\s?\\'\"\\>\\'\\s*?\\);/gi) && editor.match(/\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[\\d\\]\\s*?\\)\\.html\\(\\s*?\\'\\<img\\s?src\\s?=\\s?\"\\'\\s?\\+\\s?images\\[\\w+\\-1\\]\\s?\\+\\s?\\'\"\\>\\'\\s*?\\);/gi).length >= 3), 'Use the provided code three times. One for each slot.')",
|
||||||
"assert(editor.match(/\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[0\\]\\s*?\\)/gi), 'You should have used <code>$('.slot')[0]</code> at least once.')",
|
"assert(editor.match(/\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[0\\]\\s*?\\)/gi), 'You should have used <code>$('.slot')[0]</code> at least once.')",
|
||||||
"assert(editor.match(/\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[1\\]\\s*?\\)/gi), 'You should have used <code>$('.slot')[1]</code> at least once.')",
|
"assert(editor.match(/\\$\\s*?\\(\\s*?\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.slot\\s*?(?:'|\")\\s*?\\)\\[1\\]\\s*?\\)/gi), 'You should have used <code>$('.slot')[1]</code> at least once.')",
|
||||||
@ -1615,7 +1705,7 @@
|
|||||||
"assert(editor.match(/slotTwo/gi) && editor.match(/slotTwo/gi).length >= 8, 'You should have used the <code>slotTwo</code> value at least once.')",
|
"assert(editor.match(/slotTwo/gi) && editor.match(/slotTwo/gi).length >= 8, 'You should have used the <code>slotTwo</code> value at least once.')",
|
||||||
"assert(editor.match(/slotThree/gi) && editor.match(/slotThree/gi).length >= 7, 'You should have used the <code>slotThree</code> value at least once.')"
|
"assert(editor.match(/slotThree/gi) && editor.match(/slotThree/gi).length >= 7, 'You should have used the <code>slotThree</code> value at least once.')"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed": [
|
||||||
"fccss",
|
"fccss",
|
||||||
" function runSlots(){",
|
" function runSlots(){",
|
||||||
" var slotOne;",
|
" var slotOne;",
|
||||||
@ -1637,9 +1727,10 @@
|
|||||||
" ",
|
" ",
|
||||||
" // Only change code above this line.",
|
" // Only change code above this line.",
|
||||||
" ",
|
" ",
|
||||||
" if(slotOne !== slotTwo || slotTwo !== slotThree){",
|
" if(slotOne === slotTwo && slotTwo === slotThree){",
|
||||||
" return null;",
|
" return slotOne;",
|
||||||
" }",
|
" }",
|
||||||
|
" return null;",
|
||||||
" ",
|
" ",
|
||||||
" if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){",
|
" if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){",
|
||||||
" $('.logger').html(slotOne);",
|
" $('.logger').html(slotOne);",
|
||||||
|
@ -1,50 +1,53 @@
|
|||||||
{
|
{
|
||||||
"name": "Basic Front End Development Projects",
|
"name": "Basic Front End Development Projects",
|
||||||
"order": 9,
|
"order": 9,
|
||||||
|
"time": "100h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "bd7158d8c442eddfbeb5bd1f",
|
"id": "bd7158d8c442eddfbeb5bd1f",
|
||||||
"title": "Get Set for Ziplines",
|
"title": "Get Set for Ziplines",
|
||||||
"difficulty": 1.00,
|
"challengeSeed": [],
|
||||||
"challengeSeed": ["125658022"],
|
|
||||||
"description": [
|
"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.",
|
[
|
||||||
"Whatever you do, don't get discouraged! Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
"http://i.imgur.com/6WLULsC.gif",
|
||||||
"We'll build these challenges using CodePen, a popular tool for creating, sharing, and discovering static web applications.",
|
"A gif showing how to create a Codepen account.",
|
||||||
"Go to <a href='http://codepen.io' target='_blank'>http://codepen.io</a> and create an account.",
|
"For our front end Zipline challenges, we'll use a popular browser-based code editor called CodePen. Open CodePen and click \"Sign up\" in the upper right hand corner, then scroll down to the free plan and click \"Sign up\" again. Click the \"Use info from GitHub button\", then add your email address and create a password. Click the \"Sign up\" button. Then in the upper right hand corner, click \"New pen\".",
|
||||||
"Click your user image in the top right corner, then click the \"New pen\" button that drops down.",
|
"http://codepen.io"
|
||||||
"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 under the \"Add External CSS\" section, use the \"Quick-add\" select box to select Bootstrap. Then click \"Save & Close\".",
|
|
||||||
"Verify that bootstrap is active by adding the following code to your HTML: <code><h1 class='text-primary'>Hello CodePen!</h1></code>. The text's color should be Bootstrap blue.",
|
|
||||||
"Click the gear next to JavaScript. Click the \"Quick-add\" select box and choose jQuery (not jQuery UI).",
|
|
||||||
"Click the \"Quick-add\" select box again and choose Bootstrap. Then click \"Save & Close\".",
|
|
||||||
"Now add the following code to your JavaScript: <code>$(document).ready(function() { $('.text-primary').text('Hi CodePen!') });</code>. Click the \"Save\" button at the top. Your \"Hello CodePen!\" should change to \"Hi CodePen!\". This means that jQuery is working.",
|
|
||||||
"You can use this CodePen that you've just created as a starting point for your Ziplines. Just click the \"fork\" button at the top of your CodePen and it will create a duplicate CodePen.",
|
|
||||||
"Now you're ready for your first Zipline. Click the \"I've completed this challenge\" button."
|
|
||||||
],
|
],
|
||||||
"type": "waypoint",
|
[
|
||||||
"challengeType": 2,
|
"http://i.imgur.com/U4y9RJ1.gif",
|
||||||
|
"A gif showing that you can type \"hello world\" will output \"hello world\" in the preview window. You can also drag windows to resize them, and change their orientation.",
|
||||||
|
"In the HTML box, create an h1 element with the text \"Hello World\". You can drag the frames around to resize them. You can also click the \"Change View\" button and change the orientation of the frames.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/G9KFQDL.gif",
|
||||||
|
"A gif showing the process of adding Bootstrap to your pen.",
|
||||||
|
"Click the gear in the upper left hand corner of the CSS box, then scroll down to \"Quick add\" and choose Bootstrap. Now give your h1 element the class of \"text-primary\" to change its color and prove that Bootstrap is now available.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/Gi3aig0.gif",
|
||||||
|
"A gif showing the process of adding Animate.css and jQuery to pen.",
|
||||||
|
"Click the gear in the upper left hand corner of the CSS box, then scroll down to \"Quick add\" and choose Animate.css. Click the gear in the upper left hand corner of the JS box, then scroll down to \"Quick add\" and choose jQuery. Let's prove that Animate.css and jQuery are loaded properly. In the JS box, add the following code to make your h1 element bounce: <code>$(document).ready(function(){ $(\"h1\").addClass(\"animated bounce\"); });</code>.",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"http://i.imgur.com/Wzt6Y9Y.gif",
|
||||||
|
"A gif showing the process of saving and forking a pen.",
|
||||||
|
"Save your pen with the \"Save\" button. Then click the \"Fork\" button. This will create a fork (copy) of your pen that you can experiment with.",
|
||||||
|
""
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"type": "Waypoint",
|
||||||
|
"challengeType": 7,
|
||||||
"tests": [],
|
"tests": [],
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
"descriptionCn": [],
|
"descriptionCn": [],
|
||||||
"nameFr": "",
|
"nameFr": "",
|
||||||
"descriptionFr": [],
|
"descriptionFr": [],
|
||||||
"nameRu": "Приготовьтесь к Zipline'ам",
|
"nameRu": "",
|
||||||
"descriptionRu": [
|
"descriptionRu": [],
|
||||||
"Теперь вы готовы приступить к Zipline'ам. Это задания по фронт-энд разработке, в них вы примените ранее изученные HTML, CSS, jQuery и JavaScript и создадите статические (не использующие базу данных) приложения.",
|
|
||||||
"Ни в коем случае не унывайте! Воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>, если что-то не получается.",
|
|
||||||
"Задания мы будем выполнять используя CodePen - популярный инструмент для создания и обмена статическими веб приложениями.",
|
|
||||||
"Перейдите по ссылке <a href='http://codepen.io' target='_blank'>http://codepen.io</a> и создайте аккаунт.",
|
|
||||||
"Нажмите на ваш аватар в правом верхнем углу, а затем в открывшемся меню на кнопку \"New pen\".",
|
|
||||||
"Выберите удобное расположение окон с помощью кнопок в правом нижнем углу, отрегулируйте их ширину.",
|
|
||||||
"Нажмите на звездочку рядом с CSS. Затем в секции \"Add External CSS\" выберите \"Quick-add\" и добавьте Bootstrap. Нажмите \"Save & Close\".",
|
|
||||||
"Проверьте, что Bootstrap подключен добавив следующий HTML код: <code><h1 class='text-primary'>Hello CodePen!</h1></code>. Цвет текста должен быть синим.",
|
|
||||||
"Нажмите на звездочку рядом с JavaScript. Нажмите \"Quick-add\" и выберите jQuery (не jQuery UI). Нажмите \"Save & Close\".",
|
|
||||||
"Снова нажмите на поле \"Quick-add\", выберите Bootstrap и затем нажмите \"Save & Close\".",
|
|
||||||
"Теперь добавьте следующий код в окошко JavaScript: <code>$(document).ready(function() { $('.text-primary').text('Hi CodePen!') });</code>. Нажмите на кнопку \"Save\" расположенную наверху. Текст \"Hello CodePen!\" должен измениться на \"Hi CodePen!\". Это значит что jQuery работает.",
|
|
||||||
"CodePen, который мы создали, можно использовать в качестве отправной точки для ваших Zipline'ов. Кликните кнопку \"fork\", чтобы создать копию текущего CodePen'a.",
|
|
||||||
"Все готово для первого Zipline'а. Жмите кнопку \"I've completed this challenge\"."
|
|
||||||
],
|
|
||||||
"nameEs": "",
|
"nameEs": "",
|
||||||
"descriptionEs": [],
|
"descriptionEs": [],
|
||||||
"namePt": "",
|
"namePt": "",
|
||||||
@ -53,7 +56,6 @@
|
|||||||
{
|
{
|
||||||
"id": "bd7158d8c242eddfaeb5bd13",
|
"id": "bd7158d8c242eddfaeb5bd13",
|
||||||
"title": "Build a Personal Portfolio Webpage",
|
"title": "Build a Personal Portfolio Webpage",
|
||||||
"difficulty": 1.01,
|
|
||||||
"challengeSeed": ["133315782"],
|
"challengeSeed": ["133315782"],
|
||||||
"description": [
|
"description": [
|
||||||
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that successfully reverse-engineers this: <a href='http://codepen.io/ThiagoFerreir4/full/eNMxEp' target='_blank'>http://codepen.io/ThiagoFerreir4/full/eNMxEp</a>.",
|
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that successfully reverse-engineers this: <a href='http://codepen.io/ThiagoFerreir4/full/eNMxEp' target='_blank'>http://codepen.io/ThiagoFerreir4/full/eNMxEp</a>.",
|
||||||
@ -107,7 +109,6 @@
|
|||||||
{
|
{
|
||||||
"id": "bd7158d8c442eddfaeb5bd13",
|
"id": "bd7158d8c442eddfaeb5bd13",
|
||||||
"title": "Build a Random Quote Machine",
|
"title": "Build a Random Quote Machine",
|
||||||
"difficulty": 1.02,
|
|
||||||
"challengeSeed": ["126415122"],
|
"challengeSeed": ["126415122"],
|
||||||
"description": [
|
"description": [
|
||||||
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that successfully reverse-engineers this: <a href='http://codepen.io/AdventureBear/full/vEoVMw' target='_blank'>http://codepen.io/AdventureBear/full/vEoVMw</a>.",
|
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that successfully reverse-engineers this: <a href='http://codepen.io/AdventureBear/full/vEoVMw' target='_blank'>http://codepen.io/AdventureBear/full/vEoVMw</a>.",
|
||||||
@ -117,7 +118,6 @@
|
|||||||
"Here are the <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a> you must enable, and optional bonus user stories:",
|
"Here are the <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a> you must enable, and optional bonus user stories:",
|
||||||
"<span class='text-info'>User Story:</span> As a user, I can click a button to show me a new random quote.",
|
"<span class='text-info'>User Story:</span> As a user, I can click a button to show me a new random quote.",
|
||||||
"<span class='text-info'>Bonus User Story:</span> As a user, I can press a button to tweet out a quote.",
|
"<span class='text-info'>Bonus User Story:</span> As a user, I can press a button to tweet out a quote.",
|
||||||
"Note that you can either put your quotes into an array and show them at random, or use an API to get quotes, such as <a href='http://forismatic.com/en/api/'>http://forismatic.com/en/api/</a>.",
|
|
||||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> 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.",
|
"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 from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
@ -203,7 +203,7 @@
|
|||||||
"Here are the <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a> you must enable, and optional bonus user stories:",
|
"Here are the <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a> you must enable, and optional bonus user stories:",
|
||||||
"<span class='text-info'>User Story:</span> As a user, I can add, subtract, multiply and divide two numbers.",
|
"<span class='text-info'>User Story:</span> As a user, I can add, subtract, multiply and divide two numbers.",
|
||||||
"<span class='text-info'>Bonus User Story:</span> I can clear the input field with a clear button.",
|
"<span class='text-info'>Bonus User Story:</span> I can clear the input field with a clear button.",
|
||||||
"<span class='text-info'>Bonus User Story:</span> I can keep chaining mathematical operations together until I hit the clear button, and the calculator will tell me the correct output.",
|
"<span class='text-info'>Bonus User Story:</span> I can keep chaining mathematical operations together until I hit the equal button, and the calculator will tell me the correct output.",
|
||||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> 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.",
|
"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 from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Responsive Design with Bootstrap",
|
"name": "Responsive Design with Bootstrap",
|
||||||
"order": 3,
|
"order": 3,
|
||||||
|
"time": "2h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "bad87fee1348bd9acde08712",
|
"id": "bad87fee1348bd9acde08712",
|
||||||
@ -13,8 +14,9 @@
|
|||||||
"To get started, we should nest all of our HTML in a <code>div</code> element with the class <code>container-fluid</code>."
|
"To get started, we should nest all of our HTML in a <code>div</code> element with the class <code>container-fluid</code>."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"div\").hasClass(\"container-fluid\"), 'Your <code>div</code> element should have the class <code>container-fluid</code>')",
|
"assert($(\"div\").hasClass(\"container-fluid\"), 'Your <code>div</code> element should have the class <code>container-fluid</code>.')",
|
||||||
"assert(editor.match(/<\\/div>/g) && editor.match(/<div/g) && editor.match(/<\\/div>/g).length === editor.match(/<div/g).length, 'Make sure each of your <code>div</code> elements has a closing tag.')"
|
"assert(editor.match(/<\\/div>/g) && editor.match(/<div/g) && editor.match(/<\\/div>/g).length === editor.match(/<div/g).length, 'Make sure each of your <code>div</code> elements has a closing tag.')",
|
||||||
|
"assert($(\".container-fluid\").children().length >= 8, 'Make sure you have nested all HTML elements in <code>.container-fluid</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
|
"<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
|
||||||
@ -89,14 +91,15 @@
|
|||||||
"id": "bad87fee1348bd9acde08812",
|
"id": "bad87fee1348bd9acde08812",
|
||||||
"title": "Make Images Mobile Responsive",
|
"title": "Make Images Mobile Responsive",
|
||||||
"description": [
|
"description": [
|
||||||
"First, add a new image below the existing one. Set it's <code>src</code> attribute to <code>http://bit.ly/fcc-running-cats</code>.",
|
"First, add a new image below the existing one. Set its <code>src</code> attribute to <code>http://bit.ly/fcc-running-cats</code>.",
|
||||||
"It would be great if this image could be exactly the width of our phone's screen.",
|
"It would be great if this image could be exactly the width of our phone's screen.",
|
||||||
"Fortunately, with Bootstrap, all we need to do is add the <code>img-responsive</code> class to your image. Do this, and the image should perfectly fit the width of your page."
|
"Fortunately, with Bootstrap, all we need to do is add the <code>img-responsive</code> class to your image. Do this, and the image should perfectly fit the width of your page."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"img\").length > 1, 'You should have a total of two images.')",
|
"assert($(\"img\").length === 2, 'You should have a total of two images.')",
|
||||||
"assert($(\"img\").hasClass(\"img-responsive\"), 'Your new image should have the class <code>img-responsive</code>.')",
|
"assert($(\"img:eq(1)\").hasClass(\"img-responsive\"), 'Your new image should be below your old one and have the class <code>img-responsive</code>.')",
|
||||||
"assert(new RegExp(\"http://bit.ly/fcc-running-cats\", \"gi\").test($(\"img.img-responsive\").attr(\"src\")), 'Add a second image with the <code>src</code> of <code>http://bit.ly/fcc-running-cats</code>.')"
|
"assert($(\"img:eq(1)\").attr(\"src\") === \"http://bit.ly/fcc-running-cats\", 'Your new image should have a <code>src</code> of <code>http://bit.ly/fcc-running-cats</code>.')",
|
||||||
|
"assert(editor.match(/<img/g) && editor.match(/<img.*>/g).length === 2 && editor.match(/<img/g).length === 2, 'Make sure your new <code>img</code> element has a closing angle bracket.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
|
"<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
|
||||||
@ -2110,7 +2113,7 @@
|
|||||||
"tests": [
|
"tests": [
|
||||||
"assert(editor.match(/<!--/g) && editor.match(/<!--/g).length > 0, 'Start a comment with <code><!--</code>.')",
|
"assert(editor.match(/<!--/g) && editor.match(/<!--/g).length > 0, 'Start a comment with <code><!--</code>.')",
|
||||||
"assert(editor.match(/this line/g) && editor.match(/this line/g).length > 0, 'Your comment should have the text <code>You shouldn't need to modify code below this line</code>.')",
|
"assert(editor.match(/this line/g) && editor.match(/this line/g).length > 0, 'Your comment should have the text <code>You shouldn't need to modify code below this line</code>.')",
|
||||||
"assert(editor.match(/-->/g) && editor.match(/-->/g).length > 0, 'Be sure to close your comment with <code>--></code>.')"
|
"assert(editor.match(/-->.*\\n+.+/g), 'Be sure to close your comment with <code>--></code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"<div class=\"container-fluid\">",
|
"<div class=\"container-fluid\">",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Claim Your Front End Development Certificate",
|
"name": "Claim Your Front End Development Certificate",
|
||||||
"order": 12,
|
"order": 12,
|
||||||
|
"time": "5m",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "561add10cb82ac38a17513be",
|
"id": "561add10cb82ac38a17513be",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Claim Your Full Stack Development Certificate",
|
"name": "Claim Your Full Stack Development Certificate",
|
||||||
"order": 21,
|
"order": 21,
|
||||||
|
"time": "5m",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "660add10cb82ac38a17513be",
|
"id": "660add10cb82ac38a17513be",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Gear up for Success",
|
"name": "Gear up for Success",
|
||||||
"order": 4,
|
"order": 4,
|
||||||
|
"time": "10m",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "560add65cb82ac38a17513c2",
|
"id": "560add65cb82ac38a17513c2",
|
||||||
@ -36,7 +37,7 @@
|
|||||||
[
|
[
|
||||||
"http://i.imgur.com/4GO4zcI.gif",
|
"http://i.imgur.com/4GO4zcI.gif",
|
||||||
"A gif showing how you can click the \"Wiki\" button in your upper-right corner to access the wiki.",
|
"A gif showing how you can click the \"Wiki\" button in your upper-right corner to access the wiki.",
|
||||||
"Try this: Click the \"Wiki\" button in your upper right hand corner. Our community has contributed lots of useful information to this searchable wiki.",
|
"Click the \"Wiki\" button in your upper right hand corner. Our community has contributed lots of useful information to this searchable wiki.",
|
||||||
""
|
""
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@ -60,9 +61,9 @@
|
|||||||
"challengeSeed": [],
|
"challengeSeed": [],
|
||||||
"description": [
|
"description": [
|
||||||
[
|
[
|
||||||
"http://i.imgur.com/P7qfJXt.gif",
|
"http://i.imgur.com/vJyiXzU.gif",
|
||||||
"A gif showing how you can click the link below and fill in the necessary fields to add your Free Code Camp studies to your LinkedIn profile.",
|
"A gif showing how you can click the link below and fill in the necessary fields to add your Free Code Camp studies to your LinkedIn profile.",
|
||||||
"You can add Free Code Camp to your LinkedIn education background. Set your graduation date as next year. For \"Degree\", type \"Full Stack Web Development\". For \"Field of study\", type \"Computer Software Engineering\". Then click \"Save Changes\".",
|
"You can add Free Code Camp to your LinkedIn education background. Set your graduation date as next year. For \"Degree\", type \"Full Stack Web Development Certification\". For \"Field of study\", type \"Computer Software Engineering\". Then click \"Save Changes\".",
|
||||||
"https://www.linkedin.com/profile/edit-education?school=Free+Code+Camp"
|
"https://www.linkedin.com/profile/edit-education?school=Free+Code+Camp"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@ -88,7 +89,7 @@
|
|||||||
[
|
[
|
||||||
"http://i.imgur.com/Og1ifsn.gif",
|
"http://i.imgur.com/Og1ifsn.gif",
|
||||||
"A gif showing how you can commit to a goal for your Free Code Camp studies and pledge a monthly donation to a nonprofit to give you external motivation to reach that goal.",
|
"A gif showing how you can commit to a goal for your Free Code Camp studies and pledge a monthly donation to a nonprofit to give you external motivation to reach that goal.",
|
||||||
"You can set a goal and pledge to donate to a nonprofit each month until you achieve that goal. give you external motivation in your quest to learn to code, as well as the opportunity to help nonprofits right away. Choose your goal, choose a monthly donation. When you click \"commit\", the nonprofit's donate page will open in a new tab. You can change your committment or stop it at any time.",
|
"You can set a goal and pledge to donate to a nonprofit each month until you achieve that goal. give you external motivation in your quest to learn to code, as well as the opportunity to help nonprofits right away. Choose your goal, choose a monthly donation. When you click \"commit\", the nonprofit's donate page will open in a new tab. You can change your commitment or stop it at any time.",
|
||||||
"/commit"
|
"/commit"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Get Started with Free Code Camp",
|
"name": "Get Started with Free Code Camp",
|
||||||
"order": 1,
|
"order": 1,
|
||||||
|
"time": "10m",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "560add10cb82ac38a17513be",
|
"id": "560add10cb82ac38a17513be",
|
||||||
@ -9,13 +10,13 @@
|
|||||||
"description": [
|
"description": [
|
||||||
[
|
[
|
||||||
"http://i.imgur.com/RlEk2IF.jpg",
|
"http://i.imgur.com/RlEk2IF.jpg",
|
||||||
"a picture of Free Code Camp's 4 benefits: Get connected, Learn JavaScript, Build your Portfolio, Help nonprofits",
|
"A picture of Free Code Camp's 4 benefits: Get connected, Learn JavaScript, Build your Portfolio, Help nonprofits",
|
||||||
"Welcome to Free Code Camp. We're an open source community of busy people who learn to code and help nonprofits.",
|
"Welcome to Free Code Camp. We're an open source community of busy people who learn to code and help nonprofits.",
|
||||||
""
|
""
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"http://i.imgur.com/pYsTbjI.jpg",
|
"http://i.imgur.com/pYsTbjI.jpg",
|
||||||
"a screenshot of our curriculum alongside a screenshot of our chat room.",
|
"A screenshot of our curriculum alongside a screenshot of our chat room.",
|
||||||
"Learning to code is hard. To succeed, you'll need lots of practice and support. That's why we've created a rigorous curriculum and supportive community.",
|
"Learning to code is hard. To succeed, you'll need lots of practice and support. That's why we've created a rigorous curriculum and supportive community.",
|
||||||
""
|
""
|
||||||
],
|
],
|
||||||
@ -33,13 +34,13 @@
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
"http://i.imgur.com/sKYQhdG.jpg",
|
"http://i.imgur.com/sKYQhdG.jpg",
|
||||||
"a screenshot of our Front End Development Certificate",
|
"A screenshot of our Front End Development Certificate",
|
||||||
"About half way through our curriculum, you'll earn a verified Front End Development Certificate. If you can finish our entire curriculum, you'll earn a verified Full Stack Development Certificate.",
|
"About half way through our curriculum, you'll earn a verified Front End Development Certificate. If you can finish our entire curriculum, you'll earn a verified Full Stack Development Certificate.",
|
||||||
""
|
""
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"http://i.imgur.com/yXyxbDd.jpg",
|
"http://i.imgur.com/yXyxbDd.jpg",
|
||||||
"a screen shot of our nonprofit project directory.",
|
"A screen shot of our nonprofit project directory.",
|
||||||
"Then you'll build several real-life projects for nonprofits. By the time you finish, you'll have a portfolio of real apps that people use every day.",
|
"Then you'll build several real-life projects for nonprofits. By the time you finish, you'll have a portfolio of real apps that people use every day.",
|
||||||
""
|
""
|
||||||
]
|
]
|
||||||
@ -65,7 +66,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
[
|
[
|
||||||
"http://i.imgur.com/EAR7Lvh.jpg",
|
"http://i.imgur.com/EAR7Lvh.jpg",
|
||||||
"a screenshot of our one of our Gitter chat rooms.",
|
"A screenshot of our one of our Gitter chat rooms.",
|
||||||
"Now let's join Free Code Camp's chat rooms. You can come here any time of day to hang out, ask questions, or find another camper to pair program with. First you'll need a GitHub account.",
|
"Now let's join Free Code Camp's chat rooms. You can come here any time of day to hang out, ask questions, or find another camper to pair program with. First you'll need a GitHub account.",
|
||||||
""
|
""
|
||||||
],
|
],
|
||||||
@ -82,15 +83,15 @@
|
|||||||
"https://github.com/settings/profile"
|
"https://github.com/settings/profile"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"http://i.imgur.com/OXL3G3n.gif",
|
"http://i.imgur.com/pYk0wOk.gif",
|
||||||
"Click the link below to navigate to Free Code Camp's open-source repository. In the upper right hand corner, you can click the \"star\" button to star this repository.",
|
"A gif showing how you can star a GitHub repo.",
|
||||||
"Go to Free Code Camp's open-source repository and \"star\" it. \"Starring\" is the GitHub equivalent of \"liking\" something.",
|
"Go to Free Code Camp's open-source repository and \"star\" it. \"Starring\" is the GitHub equivalent of \"liking\" something.",
|
||||||
"https://github.com/freecodecamp/freecodecamp"
|
"https://github.com/freecodecamp/freecodecamp"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"http://i.imgur.com/EZHzKCV.gif",
|
"http://i.imgur.com/zwYPeQT.gif",
|
||||||
"A gif showing you how to click the link below to go to our chat room and click the \"sign in with GitHub\" button. Then you can click into the text input field and type a message to your fellow campers.",
|
"A gif showing you how to click the link below to go to our chat room and click the \"sign in with GitHub\" button. Then you can click into the text input field and type a message to your fellow campers.",
|
||||||
" Now that you have a GitHub account, you can join our main chat room by logging in with GitHub. Introduce yourself by saying \"Hello world!\". Tell your fellow campers how you found Free Code Camp. Also tell us why you want to learn to code.",
|
"Now that you have a GitHub account, you can join our main chat room by logging in with GitHub. Introduce yourself by saying \"Hello world!\". Tell your fellow campers how you found Free Code Camp. Also tell us why you want to learn to code.",
|
||||||
"https://gitter.im/FreeCodeCamp/FreeCodeCamp"
|
"https://gitter.im/FreeCodeCamp/FreeCodeCamp"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -112,7 +113,7 @@
|
|||||||
""
|
""
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"http://i.imgur.com/SLQ27Gr.gif",
|
"http://i.imgur.com/WvQvNGN.gif",
|
||||||
"A gif showing how you can click the link below to download a native chat room app for your computer.",
|
"A gif showing how you can click the link below to download a native chat room app for your computer.",
|
||||||
"You can also download the chat room app to your computer or phone.",
|
"You can also download the chat room app to your computer or phone.",
|
||||||
"https://gitter.im/apps"
|
"https://gitter.im/apps"
|
||||||
@ -138,15 +139,9 @@
|
|||||||
"challengeSeed": [],
|
"challengeSeed": [],
|
||||||
"description": [
|
"description": [
|
||||||
[
|
[
|
||||||
"http://i.imgur.com/FkEzbto.gif",
|
"http://i.imgur.com/tP2ccTE.gif",
|
||||||
"A gif showing how you can click your profile image in your upper right hand corner to your code portfolio and connect GitHub.",
|
"A gif showing how you can click your profile image in your upper right hand corner to your code portfolio and connect GitHub.",
|
||||||
"Check out your code portfolio. Click your picture your upper right hand corner. To activate your code portfolio, you'll need to link your GitHub account with Free Code Camp.",
|
"Check out your code portfolio. Click your picture in your upper right hand corner. To activate your code portfolio, you'll need to link your GitHub account with Free Code Camp. Your code portfolio shows your progress and how many Brownie Points you have. You can get Brownie Points by completing challenges and by helping other campers in our chat rooms. If you get Brownie Points on several days in a row, you'll get a streak.",
|
||||||
""
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"http://i.imgur.com/WKzEr1q.gif",
|
|
||||||
"A gif showing how you can access your code portfolio and hover over different days to see how many brownie points you got on those days.",
|
|
||||||
"Your code portfolio shows your progress and how many Brownie Points you have. You can get Brownie Points by completing challenges and by helping other campers in our chat rooms. If you get Brownie Points on several days in a row, you'll get a streak.",
|
|
||||||
""
|
""
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@ -176,9 +171,9 @@
|
|||||||
""
|
""
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"http://i.imgur.com/EZHzKCV.gif",
|
"http://i.imgur.com/fTFMjwf.gif",
|
||||||
"A gif showing how you can click the link below, find your city on the list of Campsites, then click on the Facebook link for your city and join your city's Facebook group.",
|
"A gif showing how you can click the link below, find your city on the list of Campsites, then click on the Facebook link for your city and join your city's Facebook group.",
|
||||||
"Find your city on this list, click the \"Facebook\" link, then click the \"Join group\" button to apply to join your city's Facebook group (someone from the campsite should approve you shortly). If your city isn't on this list, scroll to the bottom of the wiki article for instructions for how you can create your city's Campsite.",
|
"Find your city on this list and click it. This will take you to your city's Campsite's Facebook group. Click the \"Join group\" button to apply to join your city's Facebook group. Someone from the campsite should approve you shortly. If your city isn't on this list, scroll to the bottom of the wiki article for instructions for how you can create your city's Campsite.",
|
||||||
"https://github.com/FreeCodeCamp/freecodecamp/wiki/List-of-Free-Code-Camp-city-based-Campsites"
|
"https://github.com/FreeCodeCamp/freecodecamp/wiki/List-of-Free-Code-Camp-city-based-Campsites"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@ -226,8 +221,8 @@
|
|||||||
"https://gitter.im/FreeCodeCamp/Help"
|
"https://gitter.im/FreeCodeCamp/Help"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"http://i.imgur.com/WsfzvVo.gif",
|
"http://i.imgur.com/ZRgXraT.gif",
|
||||||
"A gif showing us clicking the \"map\" button in our upper right hand corner and browsing our challenge map.",
|
"A gif showing us scrolling through our challenge map.",
|
||||||
"Now you're ready to start coding! The \"Map\" button in your upper right hand corner will show you our challenge map. This map shows all our coding challenges. We recommend that you complete these from top to bottom, at a sustainable pace. You can also return to your next challenge by clicking the \"Learn\" button.",
|
"Now you're ready to start coding! The \"Map\" button in your upper right hand corner will show you our challenge map. This map shows all our coding challenges. We recommend that you complete these from top to bottom, at a sustainable pace. You can also return to your next challenge by clicking the \"Learn\" button.",
|
||||||
""
|
""
|
||||||
]
|
]
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Git",
|
"name": "Git",
|
||||||
"order" : 17,
|
"order" : 17,
|
||||||
|
"time": "3h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "bd7353d8c341eddeaeb5bd0f",
|
"id": "bd7353d8c341eddeaeb5bd0f",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Hikes",
|
"name": "Hikes",
|
||||||
"order": 0.050,
|
"order": 0.050,
|
||||||
|
"time": "3h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "bd7128d8c441eddfbeb5bddf",
|
"id": "bd7128d8c441eddfbeb5bddf",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "HTML5 and CSS",
|
"name": "HTML5 and CSS",
|
||||||
"order": 2,
|
"order": 2,
|
||||||
|
"time": "3h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "bd7123c8c441eddfaeb5bdef",
|
"id": "bd7123c8c441eddfaeb5bdef",
|
||||||
@ -376,6 +377,7 @@
|
|||||||
"assert(!$(\"h2\").attr(\"style\"), 'Remove the style attribute from your <code>h2</code> element.')",
|
"assert(!$(\"h2\").attr(\"style\"), 'Remove the style attribute from your <code>h2</code> element.')",
|
||||||
"assert($(\"style\") && $(\"style\").length > 1, 'Create a <code>style</code> element.')",
|
"assert($(\"style\") && $(\"style\").length > 1, 'Create a <code>style</code> element.')",
|
||||||
"assert($(\"h2\").css(\"color\") === \"rgb(0, 0, 255)\", 'Your <code>h2</code> element should be blue.')",
|
"assert($(\"h2\").css(\"color\") === \"rgb(0, 0, 255)\", 'Your <code>h2</code> element should be blue.')",
|
||||||
|
"assert(editor.match(/h2\\s*\\{\\s*color:\\s*blue;\\s*\\}/g), 'Ensure that your stylesheet <code>h2</code> declaration is valid with a semicolon and closing brace')",
|
||||||
"assert(editor.match(/<\\/style>/g) && editor.match(/<\\/style>/g).length === (editor.match(/<style((\\s)*((type|media|scoped|title|disabled)=\"[^\"]*\")?(\\s)*)*>/g) || []).length, 'Make sure all your <code>style</code> elements are valid and have a closing tag.')"
|
"assert(editor.match(/<\\/style>/g) && editor.match(/<\\/style>/g).length === (editor.match(/<style((\\s)*((type|media|scoped|title|disabled)=\"[^\"]*\")?(\\s)*)*>/g) || []).length, 'Make sure all your <code>style</code> elements are valid and have a closing tag.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -434,6 +436,7 @@
|
|||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your <code>h2</code> element should be red.')",
|
"assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your <code>h2</code> element should be red.')",
|
||||||
"assert($(\"h2\").hasClass(\"red-text\"), 'Your <code>h2</code> element should have the class <code>red-text</code>.')",
|
"assert($(\"h2\").hasClass(\"red-text\"), 'Your <code>h2</code> element should have the class <code>red-text</code>.')",
|
||||||
|
"assert(editor.match(/\\.red-text\\s*\\{\\s*color:\\s*red;\\s*\\}/g), 'Your stylesheet should declare a <code>red-text</code> class and have its color set to red.')",
|
||||||
"assert($(\"h2\").attr(\"style\") === undefined, 'Do not use inline style declarations like <code>style=\"color: red\"</code> in your <code>h2</code> element.')"
|
"assert($(\"h2\").attr(\"style\") === undefined, 'Do not use inline style declarations like <code>style=\"color: red\"</code> in your <code>h2</code> element.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -541,7 +544,6 @@
|
|||||||
"assert($(\"p\").length > 1, 'You need 2 <code>p</code> elements with Kitty Ipsum text.')",
|
"assert($(\"p\").length > 1, 'You need 2 <code>p</code> elements with Kitty Ipsum text.')",
|
||||||
"assert(editor.match(/<\\/p>/g) && editor.match(/<\\/p>/g).length === editor.match(/<p/g).length, 'Make sure each of your <code>p</code> elements has a closing tag.')",
|
"assert(editor.match(/<\\/p>/g) && editor.match(/<\\/p>/g).length === editor.match(/<p/g).length, 'Make sure each of your <code>p</code> elements has a closing tag.')",
|
||||||
"assert.isTrue((/Purr\\s+jump\\s+eat/gi).test($(\"p\").text()), 'Your <code>p</code> element should contain the first few words of the provided additional <code>kitty ipsum text</code>.')",
|
"assert.isTrue((/Purr\\s+jump\\s+eat/gi).test($(\"p\").text()), 'Your <code>p</code> element should contain the first few words of the provided additional <code>kitty ipsum text</code>.')",
|
||||||
"assert($(\"p.red-text\").length === 2, 'Give each of your <code>p</code> elements the <code>red-text</code> class.')",
|
|
||||||
"assert($(\"p\").css(\"font-size\") === \"16px\", 'Give elements with the <code>red-text</code> class a <code>font-size</code> of 16px.')"
|
"assert($(\"p\").css(\"font-size\") === \"16px\", 'Give elements with the <code>red-text</code> class a <code>font-size</code> of 16px.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -1122,7 +1124,7 @@
|
|||||||
"assert($(\"a\").text().match(/cat\\sphotos/gi), 'Your <code>a</code> element should have the anchor text of \"cat photos\"')",
|
"assert($(\"a\").text().match(/cat\\sphotos/gi), 'Your <code>a</code> element should have the anchor text of \"cat photos\"')",
|
||||||
"assert($(\"p\") && $(\"p\").length > 2, 'Create a new <code>p</code> element around your <code>a</code> element.')",
|
"assert($(\"p\") && $(\"p\").length > 2, 'Create a new <code>p</code> element around your <code>a</code> element.')",
|
||||||
"assert($(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").parent().is(\"p\"), 'Your <code>a</code> element should be nested within your new <code>p</code> element.')",
|
"assert($(\"a[href=\\\"http://www.freecatphotoapp.com\\\"]\").parent().is(\"p\"), 'Your <code>a</code> element should be nested within your new <code>p</code> element.')",
|
||||||
"assert($(\"p\").text().match(/^View\\smore\\s/gi), 'Your <code>p</code> element should have the text \"View more \" (with a space after it).')",
|
"assert($(\"p\").text().match(/^\\s*View\\smore\\s/gi), 'Your <code>p</code> element should have the text \"View more \" (with a space after it).')",
|
||||||
"assert(!$(\"a\").text().match(/View\\smore/gi), 'Your <code>a</code> element should <em>not</em> have the text \"View more\".')",
|
"assert(!$(\"a\").text().match(/View\\smore/gi), 'Your <code>a</code> element should <em>not</em> have the text \"View more\".')",
|
||||||
"assert(editor.match(/<\\/p>/g) && editor.match(/<p/g) && editor.match(/<\\/p>/g).length === editor.match(/<p/g).length, 'Make sure each of your <code>p</code> elements has a closing tag.')",
|
"assert(editor.match(/<\\/p>/g) && editor.match(/<p/g) && editor.match(/<\\/p>/g).length === editor.match(/<p/g).length, 'Make sure each of your <code>p</code> elements has a closing tag.')",
|
||||||
"assert(editor.match(/<\\/a>/g) && editor.match(/<a/g) && editor.match(/<\\/a>/g).length === editor.match(/<a/g).length, 'Make sure each of your <code>a</code> elements has a closing tag.')"
|
"assert(editor.match(/<\\/a>/g) && editor.match(/<a/g) && editor.match(/<\\/a>/g).length === editor.match(/<a/g).length, 'Make sure each of your <code>a</code> elements has a closing tag.')"
|
||||||
@ -1156,9 +1158,11 @@
|
|||||||
"</style>",
|
"</style>",
|
||||||
"",
|
"",
|
||||||
"<h2 class=\"red-text\">CatPhotoApp</h2>",
|
"<h2 class=\"red-text\">CatPhotoApp</h2>",
|
||||||
|
"<!--Do not alter code above this line-->",
|
||||||
"",
|
"",
|
||||||
"<a href=\"http://www.freecatphotoapp.com\">cat photos</a>",
|
"<a href=\"http://www.freecatphotoapp.com\">cat photos</a>",
|
||||||
"",
|
"",
|
||||||
|
"<!--Do not alter code below this line-->",
|
||||||
"<img class=\"smaller-image thick-green-border\" src=\"https://bit.ly/fcc-relaxing-cat\">",
|
"<img class=\"smaller-image thick-green-border\" src=\"https://bit.ly/fcc-relaxing-cat\">",
|
||||||
"",
|
"",
|
||||||
"<p class=\"red-text\">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>",
|
"<p class=\"red-text\">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>",
|
||||||
@ -1411,7 +1415,7 @@
|
|||||||
"assert($(\"ul\").length > 0, 'Create a <code>ul</code> element.')",
|
"assert($(\"ul\").length > 0, 'Create a <code>ul</code> element.')",
|
||||||
"assert($(\"ul li\").length > 2, 'You should have three <code>li</code> elements within your <code>ul</code> element.')",
|
"assert($(\"ul li\").length > 2, 'You should have three <code>li</code> elements within your <code>ul</code> element.')",
|
||||||
"assert(editor.match(/<\\/ul>/g) && editor.match(/<ul/g) && editor.match(/<\\/ul>/g).length === editor.match(/<ul/g).length, 'Make sure your <code>ul</code> element has a closing tag.')",
|
"assert(editor.match(/<\\/ul>/g) && editor.match(/<ul/g) && editor.match(/<\\/ul>/g).length === editor.match(/<ul/g).length, 'Make sure your <code>ul</code> element has a closing tag.')",
|
||||||
"assert(editor.match(/<\\/li>/g) && editor.match(/<li>/g) && editor.match(/<\\/li>/g).length === editor.match(/<li>/g).length, 'Make sure your <code>li</code> element has a closing tag.')"
|
"assert(editor.match(/<\\/li>/g) && editor.match(/<li[\\s>]/g) && editor.match(/<\\/li>/g).length === editor.match(/<li[\\s>]/g).length, 'Make sure your <code>li</code> elements have closing tags.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
|
"<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
|
||||||
@ -3702,7 +3706,7 @@
|
|||||||
"Let's replace the hex code in our <code>body</code> element's background color with the RGB value for black: <code>rgb(0, 0, 0)</code>"
|
"Let's replace the hex code in our <code>body</code> element's background color with the RGB value for black: <code>rgb(0, 0, 0)</code>"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"body\").css(\"background-color\") === \"rgb(0, 0, 0)\", 'Give your <code>body</code> element the <code>background-color</code> of black.')",
|
"assert($(\"body\").css(\"background-color\") === \"rgb(0, 0, 0)\", 'Your <code>body</code> element should have a black background.')",
|
||||||
"assert(editor.match(/rgb\\s*\\(\\s*0\\s*,\\s*0\\s*,\\s*0\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element the <code>background-color</code> of black. For example <code>body { color: rgb(0, 0, 0); }</code>.')"
|
"assert(editor.match(/rgb\\s*\\(\\s*0\\s*,\\s*0\\s*,\\s*0\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element the <code>background-color</code> of black. For example <code>body { color: rgb(0, 0, 0); }</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -3736,7 +3740,7 @@
|
|||||||
"Change the <code>body</code> element's background color from the RGB value for black to the <code>rgb</code> value for white: <code>rgb(255, 255, 255)</code>"
|
"Change the <code>body</code> element's background color from the RGB value for black to the <code>rgb</code> value for white: <code>rgb(255, 255, 255)</code>"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"body\").css(\"background-color\") === \"rgb(255, 255, 255)\", 'Give your <code>body</code> element the <code>background-color</code> of white.')",
|
"assert($(\"body\").css(\"background-color\") === \"rgb(255, 255, 255)\", 'Your <code>body</code> should have a white background.')",
|
||||||
"assert(editor.match(/rgb\\s*\\(\\s*255\\s*,\\s*255\\s*,\\s*255\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element the <code>background-color</code> of white. For example <code>body { background-color: rgb(255, 255 , 255); }</code>.')"
|
"assert(editor.match(/rgb\\s*\\(\\s*255\\s*,\\s*255\\s*,\\s*255\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element the <code>background-color</code> of white. For example <code>body { background-color: rgb(255, 255 , 255); }</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -3770,7 +3774,7 @@
|
|||||||
"Change the <code>body</code> element's background color to the RGB value red: <code>rgb(255, 0, 0)</code>"
|
"Change the <code>body</code> element's background color to the RGB value red: <code>rgb(255, 0, 0)</code>"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"body\").css(\"background-color\") === \"rgb(255, 0, 0)\", 'Give your <code>body</code> element the <code>background-color</code> of red.')",
|
"assert($(\"body\").css(\"background-color\") === \"rgb(255, 0, 0)\", 'Your <code>body</code> should have a red background.')",
|
||||||
"assert(editor.match(/rgb\\s*\\(\\s*255\\s*,\\s*0\\s*,\\s*0\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element the <code>background-color</code> of red. For example <code>body { background-color: rgb(255, 0, 0); }</code>.')"
|
"assert(editor.match(/rgb\\s*\\(\\s*255\\s*,\\s*0\\s*,\\s*0\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element the <code>background-color</code> of red. For example <code>body { background-color: rgb(255, 0, 0); }</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -3802,7 +3806,7 @@
|
|||||||
"Now change the <code>body</code> element's background color to the <code>rgb</code> value green: <code>rgb(0, 255, 0)</code>"
|
"Now change the <code>body</code> element's background color to the <code>rgb</code> value green: <code>rgb(0, 255, 0)</code>"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"body\").css(\"background-color\") === \"rgb(0, 255, 0)\", 'Give your <code>body</code> element the <code>background-color</code> of green.')",
|
"assert($(\"body\").css(\"background-color\") === \"rgb(0, 255, 0)\", 'Your <code>body</code> element should have a green background.')",
|
||||||
"assert(editor.match(/rgb\\s*\\(\\s*0\\s*,\\s*255\\s*,\\s*0\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element the <code>background-color</code> of green. For example <code>body { background-color: rgb(0, 255, 0); }</code>.')"
|
"assert(editor.match(/rgb\\s*\\(\\s*0\\s*,\\s*255\\s*,\\s*0\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element the <code>background-color</code> of green. For example <code>body { background-color: rgb(0, 255, 0); }</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -3834,7 +3838,7 @@
|
|||||||
"Change the <code>body</code> element's background color to the RGB value blue: <code>rgb(0, 0, 255)</code>"
|
"Change the <code>body</code> element's background color to the RGB value blue: <code>rgb(0, 0, 255)</code>"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"body\").css(\"background-color\") === \"rgb(0, 0, 255)\", 'Give your <code>body</code> element the background-color of blue.')",
|
"assert($(\"body\").css(\"background-color\") === \"rgb(0, 0, 255)\", 'Your <code>body</code> element should have a blue background.')",
|
||||||
"assert(editor.match(/rgb\\s*\\(\\s*0\\s*,\\s*0\\s*,\\s*255\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element the <code>background-color</code> of blue. For example <code>body { background-color: rgb(0, 0, 255); }</code>.')"
|
"assert(editor.match(/rgb\\s*\\(\\s*0\\s*,\\s*0\\s*,\\s*255\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element the <code>background-color</code> of blue. For example <code>body { background-color: rgb(0, 0, 255); }</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -3867,7 +3871,7 @@
|
|||||||
"Change the <code>body</code> element's background color to the RGB value orange: <code>rgb(255, 165, 0)</code>"
|
"Change the <code>body</code> element's background color to the RGB value orange: <code>rgb(255, 165, 0)</code>"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"body\").css(\"background-color\") === \"rgb(255, 165, 0)\", 'Give your <code>body</code> element the background-color of orange.')",
|
"assert($(\"body\").css(\"background-color\") === \"rgb(255, 165, 0)\", 'Your <code>body</code> element should have an orange background.')",
|
||||||
"assert(editor.match(/rgb\\s*\\(\\s*255\\s*,\\s*165\\s*,\\s*0\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element the <code>background-color</code> of orange. For example <code>body { background-color: rgb(255, 165, 0); }</code>.')"
|
"assert(editor.match(/rgb\\s*\\(\\s*255\\s*,\\s*165\\s*,\\s*0\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element the <code>background-color</code> of orange. For example <code>body { background-color: rgb(255, 165, 0); }</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
@ -3900,7 +3904,7 @@
|
|||||||
"Change the <code>body</code> element's background color to the RGB value for gray: <code>rgb(128, 128, 128)</code>"
|
"Change the <code>body</code> element's background color to the RGB value for gray: <code>rgb(128, 128, 128)</code>"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert($(\"body\").css(\"background-color\") === \"rgb(128, 128, 128)\", 'Give your <code>body</code> element the background-color of gray.')",
|
"assert($(\"body\").css(\"background-color\") === \"rgb(128, 128, 128)\", 'Your <code>body</code> element should have a gray background.')",
|
||||||
"assert(editor.match(/rgb\\s*\\(\\s*128\\s*,\\s*128\\s*,\\s*128\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element the <code>background-color</code> of gray. For example <code>body { background-color: rgb(128, 128, 128); }</code>.')"
|
"assert(editor.match(/rgb\\s*\\(\\s*128\\s*,\\s*128\\s*,\\s*128\\s*\\)/ig), 'Use <code>rgb</code> to give your <code>body</code> element the <code>background-color</code> of gray. For example <code>body { background-color: rgb(128, 128, 128); }</code>.')"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Intermediate Algorithm Scripting",
|
"name": "Intermediate Algorithm Scripting",
|
||||||
"order": 9,
|
"order": 10,
|
||||||
|
"time": "50h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "a3566b1109230028080c9345",
|
"id": "a3566b1109230028080c9345",
|
||||||
@ -29,6 +30,9 @@
|
|||||||
"Math.min()",
|
"Math.min()",
|
||||||
"Array.reduce()"
|
"Array.reduce()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function sumAll(arr) {\n var sum = 0;\n arr.sort(function(a,b) {return a-b;});\n for (var i = arr[0]; i <= arr[1]; i++) {\n sum += i; \n }\n return sum;\n}\n\nsumAll([1, 4]);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -65,7 +69,8 @@
|
|||||||
"assert.deepEqual(diff([\"andesite\", \"grass\", \"dirt\", \"dead shrub\"], [\"andesite\", \"grass\", \"dirt\", \"dead shrub\"]), [], 'message: <code>[\"andesite\", \"grass\", \"dirt\", \"dead shrub\"], [\"andesite\", \"grass\", \"dirt\", \"dead shrub\"]</code> should return <code>[]</code>.');",
|
"assert.deepEqual(diff([\"andesite\", \"grass\", \"dirt\", \"dead shrub\"], [\"andesite\", \"grass\", \"dirt\", \"dead shrub\"]), [], 'message: <code>[\"andesite\", \"grass\", \"dirt\", \"dead shrub\"], [\"andesite\", \"grass\", \"dirt\", \"dead shrub\"]</code> should return <code>[]</code>.');",
|
||||||
"assert.deepEqual(diff([1, 2, 3, 5], [1, 2, 3, 4, 5]), [4], 'message: <code>[1, 2, 3, 5], [1, 2, 3, 4, 5]</code> should return <code>[4]</code>.');",
|
"assert.deepEqual(diff([1, 2, 3, 5], [1, 2, 3, 4, 5]), [4], 'message: <code>[1, 2, 3, 5], [1, 2, 3, 4, 5]</code> should return <code>[4]</code>.');",
|
||||||
"assert.includeMembers(diff([1, \"calf\", 3, \"piglet\"], [1, \"calf\", 3, 4]), [\"piglet\", 4], 'message: <code>[1, \"calf\", 3, \"piglet\"], [1, \"calf\", 3, 4]</code> should return <code>[\"piglet\", 4]</code>.');",
|
"assert.includeMembers(diff([1, \"calf\", 3, \"piglet\"], [1, \"calf\", 3, 4]), [\"piglet\", 4], 'message: <code>[1, \"calf\", 3, \"piglet\"], [1, \"calf\", 3, 4]</code> should return <code>[\"piglet\", 4]</code>.');",
|
||||||
"assert.deepEqual(diff([], [\"snuffleupagus\", \"cookie monster\", \"elmo\"]), [\"snuffleupagus\", \"cookie monster\", \"elmo\"], 'message: <code>[], [\"snuffleupagus\", \"cookie monster\", \"elmo\"]</code> should return <code>[\"snuffleupagus\", \"cookie monster\", \"elmo\"]</code>.');"
|
"assert.deepEqual(diff([], [\"snuffleupagus\", \"cookie monster\", \"elmo\"]), [\"snuffleupagus\", \"cookie monster\", \"elmo\"], 'message: <code>[], [\"snuffleupagus\", \"cookie monster\", \"elmo\"]</code> should return <code>[\"snuffleupagus\", \"cookie monster\", \"elmo\"]</code>.');",
|
||||||
|
"assert.includeMembers(diff([1, \"calf\", 3, \"piglet\"], [7, \"filly\"]), [1, \"calf\", 3, \"piglet\", 7, \"filly\"], 'message: <code>[1, \"calf\", 3, \"piglet\"], [7, \"filly\"]</code> should return <code>[1, \"calf\", 3, \"piglet\", 7, \"filly\"]</code>.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Comparison Operators",
|
"Comparison Operators",
|
||||||
@ -74,6 +79,9 @@
|
|||||||
"Array.indexOf()",
|
"Array.indexOf()",
|
||||||
"Array.concat()"
|
"Array.concat()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function diff(arr1, arr2) {\n var newArr = [];\n var h1 = Object.create(null);\n arr1.forEach(function(e) {\n h1[e] = e;\n });\n \n var h2 = Object.create(null);\n arr2.forEach(function(e) {\n h2[e] = e;\n });\n \n Object.keys(h1).forEach(function(e) {\n if (!(e in h2)) newArr.push(h1[e]);\n });\n Object.keys(h2).forEach(function(e) {\n if (!(e in h1)) newArr.push(h2[e]);\n });\n // Same, same; but different.\n return newArr;\n}\n\ndiff([1, 2, 3, 5], [1, 2, 3, 4, 5]);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -115,6 +123,9 @@
|
|||||||
"Array.indexOf()",
|
"Array.indexOf()",
|
||||||
"Array.join()"
|
"Array.join()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function convert(num) {\n var ref = [['M', 1000], ['CM', 900], ['D', 500], ['CD', 400], ['C', 100], ['XC', 90], ['L', 50], ['XL', 40], ['X', 10], ['IX', 9], ['V', 5], ['IV', 4], ['I', 1]];\n var res = [];\n ref.forEach(function(p) {\n while (num >= p[1]) {\n res.push(p[0]);\n num -= p[1];\n }\n });\n return res.join('');\n}\n\nconvert(36);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -146,7 +157,7 @@
|
|||||||
"where([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" });"
|
"where([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" });"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.deepEqual(where([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" }), [{ first: \"Tybalt\", last: \"Capulet\" }], 'message: <code>where()</code> should return an array of objects.');",
|
"assert.deepEqual(where([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" }), [{ first: \"Tybalt\", last: \"Capulet\" }], 'message: <code>where([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" })</code> should return <code>[{ first: \"Tybalt\", last: \"Capulet\" }]</code>.');",
|
||||||
"assert.deepEqual(where([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 }), [{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], 'message: <code>where([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 })</code> should return <code>[{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }]</code>.');",
|
"assert.deepEqual(where([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 }), [{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], 'message: <code>where([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 })</code> should return <code>[{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }]</code>.');",
|
||||||
"assert.deepEqual(where([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"b\": 2 }), [{ \"a\": 1, \"b\": 2 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], 'message: <code>where([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"b\": 2 })</code> should return <code>[{ \"a\": 1, \"b\": 2 }, { \"a\": 1, \"b\": 2, \"c\": 2 }]</code>.');"
|
"assert.deepEqual(where([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"b\": 2 }), [{ \"a\": 1, \"b\": 2 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], 'message: <code>where([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"b\": 2 })</code> should return <code>[{ \"a\": 1, \"b\": 2 }, { \"a\": 1, \"b\": 2, \"c\": 2 }]</code>.');"
|
||||||
],
|
],
|
||||||
@ -155,6 +166,9 @@
|
|||||||
"Object.hasOwnProperty()",
|
"Object.hasOwnProperty()",
|
||||||
"Object.keys()"
|
"Object.keys()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function where(collection, source) {\n var arr = [];\n var keys = Object.keys(source);\n collection.forEach(function(e) {\n if(keys.every(function(key) {return e[key] === source[key];})) {\n arr.push(e); \n }\n });\n return arr;\n}\n\nwhere([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -198,6 +212,9 @@
|
|||||||
"String.replace()",
|
"String.replace()",
|
||||||
"Array.join()"
|
"Array.join()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function replace(str, before, after) {\n if (before.charAt(0) === before.charAt(0).toUpperCase()) {\n after = after.charAt(0).toUpperCase() + after.substring(1);\n } else {\n after = after.charAt(0).toLowerCase() + after.substring(1);\n }\n return str.replace(before, after);\n}\n\nreplace(\"A quick brown fox jumped over the lazy dog\", \"jumped\", \"leaped\");\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -241,6 +258,9 @@
|
|||||||
"String.substr()",
|
"String.substr()",
|
||||||
"String.split()"
|
"String.split()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function translate(str) {\n if (isVowel(str.charAt(0))) return str + \"way\";\n var front = [];\n str = str.split('');\n while (str.length && !isVowel(str[0])) {\n front.push(str.shift());\n }\n return [].concat(str, front).join('') + 'ay';\n}\n\nfunction isVowel(c) {\n return ['a', 'e', 'i', 'o', 'u'].indexOf(c.toLowerCase()) !== -1;\n}\n\ntranslate(\"consonant\");\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -281,6 +301,9 @@
|
|||||||
"Array.push()",
|
"Array.push()",
|
||||||
"String.split()"
|
"String.split()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"var lookup = Object.create(null);\nlookup.A = 'T';\nlookup.T = 'A';\nlookup.C = 'G';\nlookup.G = 'C';\n\nfunction pair(str) {\n return str.split('').map(function(p) {return [p, lookup[p]];});\n}\n\npair(\"GCG\");\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -319,6 +342,9 @@
|
|||||||
"String.charCodeAt()",
|
"String.charCodeAt()",
|
||||||
"String.fromCharCode()"
|
"String.fromCharCode()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function fearNotLetter(str) {\n var s = str.split('').map(function(c) {return c.charCodeAt(0);});\n for (var i = 1; i < s.length; i++) {\n if (s[i]-1 != s[i-1]) {\n return String.fromCharCode(s[i]-1);\n }\n }\n}\n\nfearNotLetter('abce');\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -355,12 +381,15 @@
|
|||||||
"assert.strictEqual(boo([].slice), false, 'message: <code>boo([].slice)</code> should return false.');",
|
"assert.strictEqual(boo([].slice), false, 'message: <code>boo([].slice)</code> should return false.');",
|
||||||
"assert.strictEqual(boo({ \"a\": 1 }), false, 'message: <code>boo({ \"a\": 1 })</code> should return false.');",
|
"assert.strictEqual(boo({ \"a\": 1 }), false, 'message: <code>boo({ \"a\": 1 })</code> should return false.');",
|
||||||
"assert.strictEqual(boo(1), false, 'message: <code>boo(1)</code> should return false.');",
|
"assert.strictEqual(boo(1), false, 'message: <code>boo(1)</code> should return false.');",
|
||||||
"assert.strictEqual(boo(NaN), false, 'message: <code>boo(NaN)</code> should return true.');",
|
"assert.strictEqual(boo(NaN), false, 'message: <code>boo(NaN)</code> should return false.');",
|
||||||
"assert.strictEqual(boo(\"a\"), false, 'message: <code>boo(\"a\")</code> should return false.');"
|
"assert.strictEqual(boo(\"a\"), false, 'message: <code>boo(\"a\")</code> should return false.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Boolean Objects"
|
"Boolean Objects"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function boo(bool) {\n // What is the new fad diet for ghost developers? The Boolean.\n return typeof(bool) === \"boolean\";\n}\n\nboo(null);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -401,6 +430,9 @@
|
|||||||
"Arguments object",
|
"Arguments object",
|
||||||
"Array.reduce()"
|
"Array.reduce()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function unite(arr1, arr2, arr3) {\n return [].slice.call(arguments).reduce(function(a, b) {\n return [].concat(a, b.filter(function(e) {return a.indexOf(e) === -1;}));\n }, []);\n}\n\nunite([1, 2, 3], [5, 2, 1, 4], [2, 1]);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -442,6 +474,9 @@
|
|||||||
"RegExp",
|
"RegExp",
|
||||||
"HTML Entities"
|
"HTML Entities"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"var MAP = { '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''};\n\nfunction convert(str) {\n return str.replace(/[&<>\"']/g, function(c) {\n return MAP[c];\n });\n}\n\nconvert('Dolce & Gabbana');\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -481,6 +516,9 @@
|
|||||||
"RegExp",
|
"RegExp",
|
||||||
"String.replace()"
|
"String.replace()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function spinalCase(str) {\n // \"It's such a fine line between stupid, and clever.\"\n // --David St. Hubbins\n str = str.replace(/([a-z](?=[A-Z]))/g, '$1 ');\n return str.toLowerCase().replace(/\\ |\\_/g, '-');\n}\n\nspinalCase('This Is Spinal Tap');\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -511,7 +549,7 @@
|
|||||||
"sumFibs(4);"
|
"sumFibs(4);"
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(typeof(sumFibs(1)) === \"number\", 'message: <code>sumFibs()</code> should return a number.');",
|
"assert(typeof(sumFibs(1)) === \"number\", 'message: <code>sumFibs(1)</code> should return a number.');",
|
||||||
"assert.deepEqual(sumFibs(1000), 1785, 'message: <code>sumFibs(1000)</code> should return 1785.');",
|
"assert.deepEqual(sumFibs(1000), 1785, 'message: <code>sumFibs(1000)</code> should return 1785.');",
|
||||||
"assert.deepEqual(sumFibs(4000000), 4613732, 'message: <code>sumFibs(4000000)</code> should return 4613732.');",
|
"assert.deepEqual(sumFibs(4000000), 4613732, 'message: <code>sumFibs(4000000)</code> should return 4613732.');",
|
||||||
"assert.deepEqual(sumFibs(4), 5, 'message: <code>sumFibs(4)</code> should return 5.');",
|
"assert.deepEqual(sumFibs(4), 5, 'message: <code>sumFibs(4)</code> should return 5.');",
|
||||||
@ -521,6 +559,9 @@
|
|||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Remainder"
|
"Remainder"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function sumFibs(num) {\n var a = 1; \n var b = 1;\n var s = 0;\n while (a <= num) {\n if (a % 2 !== 0) { \n s += a; \n }\n a = [b, b=b+a][0];\n }\n return s;\n}\n\nsumFibs(4);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -559,6 +600,9 @@
|
|||||||
"For Loops",
|
"For Loops",
|
||||||
"Array.push()"
|
"Array.push()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function eratosthenesArray(n) {\n var primes = [];\n if (n > 2) {\n var half = n>>1;\n var sieve = Array(half);\n for (var i = 1, limit = Math.sqrt(n)>>1; i <= limit; i++) {\n if (!sieve[i]) {\n for (var step = 2*i+1, j = (step*step)>>1; j < half; j+=step) {\n sieve[j] = true;\n }\n }\n }\n primes.push(2);\n for (var p = 1; p < half; p++) {\n if (!sieve[p]) primes.push(2*p+1);\n }\n }\n return primes;\n}\n\nfunction sumPrimes(num) {\n return eratosthenesArray(num+1).reduce(function(a,b) {return a+b;}, 0);\n}\n\nsumPrimes(10);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -598,6 +642,9 @@
|
|||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Smallest Common Multiple"
|
"Smallest Common Multiple"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function gcd(a, b) {\n while (b !== 0) {\n a = [b, b = a % b][0];\n }\n return a;\n}\n\nfunction lcm(a, b) {\n return (a * b) / gcd(a, b);\n}\n\nfunction smallestCommons(arr) {\n arr.sort(function(a,b) {return a-b;});\n var rng = [];\n for (var i = arr[0]; i <= arr[1]; i++) {\n rng.push(i);\n }\n return rng.reduce(lcm);\n}\n\n\nsmallestCommons([1,5]);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -631,7 +678,10 @@
|
|||||||
"assert.strictEqual(find([1, 3, 5, 9], function(num) { return num % 2 === 0; }), undefined, 'message: <code>find([1, 3, 5, 9], function(num) { return num % 2 === 0; })</code> should return undefined.');"
|
"assert.strictEqual(find([1, 3, 5, 9], function(num) { return num % 2 === 0; }), undefined, 'message: <code>find([1, 3, 5, 9], function(num) { return num % 2 === 0; })</code> should return undefined.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Array.some()"
|
"Array.filter()"
|
||||||
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function find(arr, func) {\n var num;\n arr.some(function(e) {\n if (func(e)) {\n num = e;\n return true;\n }\n });\n return num;\n}\n\nfind([1, 2, 3, 4], function(num){ return num % 2 === 0; });\n"
|
||||||
],
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
@ -671,6 +721,9 @@
|
|||||||
"Arguments object",
|
"Arguments object",
|
||||||
"Array.shift()"
|
"Array.shift()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"(function drop(arr, func) {\n // Drop them elements.\n while (arr.length && !func(arr[0])) {\n arr.shift();\n }\n return arr;\n}\n\ndrop([1, 2, 3], function(n) {return n < 3; });\n)"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -708,6 +761,9 @@
|
|||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Array.isArray()"
|
"Array.isArray()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function steamroller(arr) {\n if (!Array.isArray(arr)) {\n return [arr];\n }\n var out = [];\n arr.forEach(function(e) {\n steamroller(e).forEach(function(v) {\n out.push(v);\n });\n });\n return out;\n}\n\nsteamroller([1, [2], [3, [[4]]]]);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -744,6 +800,9 @@
|
|||||||
"String.charCodeAt()",
|
"String.charCodeAt()",
|
||||||
"String.fromCharCode()"
|
"String.fromCharCode()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function binaryAgent(str) {\n return str.split(' ').map(function(s) { return parseInt(s, 2); }).map(function(b) { return String.fromCharCode(b);}).join('');\n}\n\nbinaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111');\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -761,14 +820,13 @@
|
|||||||
"id": "a10d2431ad0c6a099a4b8b52",
|
"id": "a10d2431ad0c6a099a4b8b52",
|
||||||
"title": "Everything Be True",
|
"title": "Everything Be True",
|
||||||
"description": [
|
"description": [
|
||||||
"Check if the predicate (second argument) returns truthy (defined) for all elements of a collection (first argument).",
|
"Check if the predicate (second argument) is truthy on all elements of a collection (first argument).",
|
||||||
"For this, check to see if the property defined in the second argument is present on every element of the collection.",
|
|
||||||
"Remember, you can access object properties through either dot notation or [] notation.",
|
"Remember, you can access object properties through either dot notation or [] notation.",
|
||||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck. Try to pair program. Write your own code."
|
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck. Try to pair program. Write your own code."
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"function every(collection, pre) {",
|
"function every(collection, pre) {",
|
||||||
" // Does everyone have one of these?",
|
" // Is everyone being true?",
|
||||||
" return pre;",
|
" return pre;",
|
||||||
"}",
|
"}",
|
||||||
"",
|
"",
|
||||||
@ -776,12 +834,17 @@
|
|||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.strictEqual(every([{\"user\": \"Tinky-Winky\", \"sex\": \"male\"}, {\"user\": \"Dipsy\", \"sex\": \"male\"}, {\"user\": \"Laa-Laa\", \"sex\": \"female\"}, {\"user\": \"Po\", \"sex\": \"female\"}], \"sex\"), true, 'message: <code>every([{\"user\": \"Tinky-Winky\", \"sex\": \"male\"}, {\"user\": \"Dipsy\", \"sex\": \"male\"}, {\"user\": \"Laa-Laa\", \"sex\": \"female\"}, {\"user\": \"Po\", \"sex\": \"female\"}], \"sex\")</code> should return true.');",
|
"assert.strictEqual(every([{\"user\": \"Tinky-Winky\", \"sex\": \"male\"}, {\"user\": \"Dipsy\", \"sex\": \"male\"}, {\"user\": \"Laa-Laa\", \"sex\": \"female\"}, {\"user\": \"Po\", \"sex\": \"female\"}], \"sex\"), true, 'message: <code>every([{\"user\": \"Tinky-Winky\", \"sex\": \"male\"}, {\"user\": \"Dipsy\", \"sex\": \"male\"}, {\"user\": \"Laa-Laa\", \"sex\": \"female\"}, {\"user\": \"Po\", \"sex\": \"female\"}], \"sex\")</code> should return true.');",
|
||||||
"assert.strictEqual(every([{\"user\": \"Tinky-Winky\", \"sex\": \"male\"}, {\"user\": \"Dipsy\", \"sex\": \"male\"}, {\"user\": \"Laa-Laa\", \"sex\": \"female\"}, {\"user\": \"Po\", \"sex\": \"female\"}], {\"sex\": \"female\"}), false, 'message: <code>every([{\"user\": \"Tinky-Winky\", \"sex\": \"male\"}, {\"user\": \"Dipsy\", \"sex\": \"male\"}, {\"user\": \"Laa-Laa\", \"sex\": \"female\"}, {\"user\": \"Po\", \"sex\": \"female\"}], {\"sex\": \"female\"})</code> should return false.');",
|
"assert.strictEqual(every([{\"user\": \"Tinky-Winky\", \"sex\": \"male\"}, {\"user\": \"Dipsy\"}, {\"user\": \"Laa-Laa\", \"sex\": \"female\"}, {\"user\": \"Po\", \"sex\": \"female\"}], \"sex\"), false, 'message: <code>every([{\"user\": \"Tinky-Winky\", \"sex\": \"male\"}, {\"user\": \"Dipsy\"}, {\"user\": \"Laa-Laa\", \"sex\": \"female\"}, {\"user\": \"Po\", \"sex\": \"female\"}], \"sex\")</code> should return false.');",
|
||||||
"assert.strictEqual(every([{\"user\": \"Tinky-Winky\", \"sex\": \"female\"}, {\"user\": \"Dipsy\", \"sex\": \"male\"}, {\"user\": \"Laa-Laa\", \"sex\": \"female\"}, {\"user\": \"Po\", \"sex\": \"female\"}], {\"sex\": \"female\"}), false, 'message: <code>every([{\"user\": \"Tinky-Winky\", \"sex\": \"female\"}, {\"user\": \"Dipsy\", \"sex\": \"male\"}, {\"user\": \"Laa-Laa\", \"sex\": \"female\"}, {\"user\": \"Po\", \"sex\": \"female\"}], {\"sex\": \"female\"})</code> should return false.');"
|
"assert.strictEqual(every([{\"user\": \"Tinky-Winky\", \"sex\": \"male\", \"age\": 2}, {\"user\": \"Dipsy\", \"sex\": \"male\", \"age\": 0}, {\"user\": \"Laa-Laa\", \"sex\": \"female\", \"age\": 5}, {\"user\": \"Po\", \"sex\": \"female\", \"age\": 4}], \"age\"), false, 'message: <code>every([{\"user\": \"Tinky-Winky\", \"sex\": \"male\", \"age\": 0}, {\"user\": \"Dipsy\", \"sex\": \"male\", \"age\": 3}, {\"user\": \"Laa-Laa\", \"sex\": \"female\", \"age\": 5}, {\"user\": \"Po\", \"sex\": \"female\", \"age\": 4}], \"age\")</code> should return false.');",
|
||||||
|
"assert.strictEqual(every([{\"name\": \"Pete\", \"onBoat\": true}, {\"name\": \"Repeat\", \"onBoat\": true}, {\"name\": \"FastFoward\", \"onBoat\": null}], \"onBoat\"), false, 'message: <code>every([{\"name\": \"Pete\", \"onBoat\": true}, {\"name\": \"Repeat\", \"onBoat\": true}, {\"name\": \"FastFoward\", \"onBoat\": null}], \"onBoat\")</code> should return false');",
|
||||||
|
"assert.strictEqual(every([{\"name\": \"Pete\", \"onBoat\": true}, {\"name\": \"Repeat\", \"onBoat\": true, \"alias\": \"Repete\"}, {\"name\": \"FastFoward\", \"onBoat\": true}], \"onBoat\"), true, 'message: <code>every([{\"name\": \"Pete\", \"onBoat\": true}, {\"name\": \"Repeat\", \"onBoat\": true, \"alias\": \"Repete\"}, {\"name\": \"FastFoward\", \"onBoat\": true}], \"onBoat\")</code> should return true');",
|
||||||
|
"assert.strictEqual(every([{\"single\": \"yes\"}], \"single\"), true, 'message: <code>every([{\"single\": \"yes\"}], \"single\")</code> should return true');",
|
||||||
|
"assert.strictEqual(every([{\"single\": \"\"}, {\"single\": \"double\"}], \"single\"), false, 'message: <code>every([{\"single\": \"\"}, {\"single\": \"double\"}], \"single\")</code> should return false');",
|
||||||
|
"assert.strictEqual(every([{\"single\": \"double\"}, {\"single\": undefined}], \"single\"), false, 'message: <code>every([{\"single\": \"double\"}, {\"single\": undefined}], \"single\")</code> should return false');",
|
||||||
|
"assert.strictEqual(every([{\"single\": \"double\"}, {\"single\": NaN}], \"single\"), false, 'message: <code>every([{\"single\": \"double\"}, {\"single\": NaN}], \"single\")</code> should return false');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"solutions": [
|
||||||
"Object.hasOwnProperty()",
|
"function every(collection, pre) {\n // Does everyone have one of these?\n return collection.every(function(e) { return e[pre]; });\n}\n\nevery([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], 'sex');\n"
|
||||||
"Object.getOwnPropertyNames()"
|
|
||||||
],
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
@ -823,9 +886,13 @@
|
|||||||
"assert.isUndefined(add(2)([3]), 'message: <code>add(2)([3])</code> should return undefined.');"
|
"assert.isUndefined(add(2)([3]), 'message: <code>add(2)([3])</code> should return undefined.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Global Function Object",
|
"Closures",
|
||||||
"Arguments object"
|
"Arguments object"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function add() {\n if (arguments.length == 1) {\n var a = arguments[0];\n if (!isNumber(a)) return;\n return function(b) {\n if (!isNumber(b)) return;\n return a+b;\n };\n }\n if (![].slice.call(arguments).every(isNumber)) return;\n return arguments[0] + arguments[1];\n}\n \nfunction isNumber(obj) {\n return toString.call(obj) == '[object Number]';\n}\n\nadd(2,3);\n",
|
||||||
|
"function add() {\n var a = arguments[0];\n if (toString.call(a) !== '[object Number]') return; \n if (arguments.length === 1) {\n return function(b) {\n if (toString.call(b) !== '[object Number]') return;\n return a + b;\n };\n }\n var b = arguments[1];\n if (toString.call(b) !== '[object Number]') return; \n return a + arguments[1];\n}\n\nadd(2,3);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "Intermediate Front End Development Projects",
|
"name": "Intermediate Front End Development Projects",
|
||||||
"order": 11,
|
"order": 11,
|
||||||
|
"time": "200h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "bd7158d8c442eddfaeb5bd10",
|
"id": "bd7158d8c442eddfaeb5bd10",
|
||||||
"title": "Show the Local Weather",
|
"title": "Show the Local Weather",
|
||||||
"challengeSeed": ["126415127"],
|
"challengeSeed": ["126415127"],
|
||||||
"description": [
|
"description": [
|
||||||
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that successfully reverse-engineers this: <a href='http://codepen.io/AdventureBear/full/yNBJRj' target='_blank'>http://codepen.io/AdventureBear/full/yNBJRj</a>.",
|
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that successfully reverse-engineers this: <a href='http://codepen.io/FreeCodeCamp/pen/avqvgJ' target='_blank'>http://codepen.io/FreeCodeCamp/pen/avqvgJ</a>.",
|
||||||
"<span class='text-info'>Rule #1:</span> Don't look at the example project's code on CodePen. Figure it out for yourself.",
|
"<span class='text-info'>Rule #1:</span> Don't look at the example project's code on CodePen. Figure it out for yourself.",
|
||||||
"<span class='text-info'>Rule #2:</span> You may use whichever libraries or APIs you need.",
|
"<span class='text-info'>Rule #2:</span> You may use whichever libraries or APIs you need.",
|
||||||
"<span class='text-info'>Rule #3:</span> Reverse engineer the example project's functionality, and also feel free to personalize it.",
|
"<span class='text-info'>Rule #3:</span> Reverse engineer the example project's functionality, and also feel free to personalize it.",
|
||||||
@ -16,6 +17,7 @@
|
|||||||
"<span class='text-info'>Bonus User Story:</span> As a user, I can see an icon depending on the weather.",
|
"<span class='text-info'>Bonus User Story:</span> As a user, I can see an icon depending on the weather.",
|
||||||
"<span class='text-info'>Bonus User Story:</span> As a user, I see a different background image (e.g. snowy mountain, hot desert) depending on the weather.",
|
"<span class='text-info'>Bonus User Story:</span> As a user, I see a different background image (e.g. snowy mountain, hot desert) depending on the weather.",
|
||||||
"<span class='text-info'>Bonus User Story:</span> As a user, I can push a button to toggle between Fahrenheit and Celsius.",
|
"<span class='text-info'>Bonus User Story:</span> As a user, I can push a button to toggle between Fahrenheit and Celsius.",
|
||||||
|
"We recommend using the <a href='http://openweathermap.org/current#geo' target='_blank'>Open Weather API</a>. This will require creating a free API key. Normally you want to avoid exposing API keys on CodePen, but we haven't been able to find a keyless API for weather.",
|
||||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> 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.",
|
"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 from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
"If you'd like immediate feedback on your project from fellow campers, click this button and paste in a link to your CodePen project. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jQuery",
|
"name": "jQuery",
|
||||||
"order": 5,
|
"order": 5,
|
||||||
|
"time": "2h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "bad87fee1348bd9acdd08826",
|
"id": "bad87fee1348bd9acdd08826",
|
||||||
@ -10,11 +11,12 @@
|
|||||||
"Before we can start using jQuery, we need to add some things to our HTML.",
|
"Before we can start using jQuery, we need to add some things to our HTML.",
|
||||||
"First, add a <code>script</code> element at the top of your page. Be sure to close it on the following line.",
|
"First, add a <code>script</code> element at the top of your page. Be sure to close it on the following line.",
|
||||||
"Your browser will run any JavaScript inside a <code>script</code> element, including jQuery.",
|
"Your browser will run any JavaScript inside a <code>script</code> element, including jQuery.",
|
||||||
"Inside your <code>script</code> element, add this code: <code>$(document).ready(function() {</code> to your <code>script</code>. Then close it on the following line (still inside your <code>script</code> element) with: <code>});</code>"
|
"Inside your <code>script</code> element, add this code: <code>$(document).ready(function() {</code> to your <code>script</code>. Then close it on the following line (still inside your <code>script</code> element) with: <code>});</code>",
|
||||||
|
"We'll learn more about <code>functions</code> later. The important thing to know is that code you put inside this <code>function</code> will run as soon as your browser has loaded your page.",
|
||||||
|
"This is important because without your <code>document ready function</code>, your code may run before your HTML is rendered, which would cause bugs."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(editor.match(/<script>/g), 'Create a <code>script</code> element.')",
|
"assert(editor.match(/<\\/script\\s*>/g) && editor.match(/<script(\\sasync|\\sdefer)*(\\s(charset|src|type)\\s*=\\s*[\"\\']+[^\"\\']*[\"\\']+)*(\\sasync|\\sdefer)*\\s*>/g) && editor.match(/<\\/script\\s*>/g).length === editor.match(/<script(\\sasync|\\sdefer)*(\\s(charset|src|type)\\s*=\\s*[\"\\']+[^\"\\']*[\"\\']+)*(\\sasync|\\sdefer)*\\s*>/g).length, 'Create a <code>script</code> element making sure it is valid and has a closing tag.')",
|
||||||
"assert(editor.match(/<\\/script>/g) && editor.match(/<script/g) && editor.match(/<\\/script>/g).length === editor.match(/<script/g).length, 'Make sure your <code>script</code> element has a closing tag.')",
|
|
||||||
"assert(editor.match(/\\$\\s*?\\(\\s*?document\\)\\.ready\\s*?\\(\\s*?function\\s*?\\(\\s*?\\)\\s*?\\{/g), 'You should add <code>$(document).ready(function() {</code> to the beginning of your <code>script</code> element.')",
|
"assert(editor.match(/\\$\\s*?\\(\\s*?document\\)\\.ready\\s*?\\(\\s*?function\\s*?\\(\\s*?\\)\\s*?\\{/g), 'You should add <code>$(document).ready(function() {</code> to the beginning of your <code>script</code> element.')",
|
||||||
"assert(editor.match(/\\n*?\\s*?\\}\\s*?\\);/g), 'Close your <code>$(document).ready(function() {</code> function with <code>});</code>.')"
|
"assert(editor.match(/\\n*?\\s*?\\}\\s*?\\);/g), 'Close your <code>$(document).ready(function() {</code> function with <code>});</code>.')"
|
||||||
],
|
],
|
||||||
@ -52,8 +54,7 @@
|
|||||||
"id": "bad87fee1348bd9bedc08826",
|
"id": "bad87fee1348bd9bedc08826",
|
||||||
"title": "Target HTML Elements with Selectors Using jQuery",
|
"title": "Target HTML Elements with Selectors Using jQuery",
|
||||||
"description": [
|
"description": [
|
||||||
"Now we have a <code>document ready function</code>. We'll learn more about <code>functions</code> later. The important thing to know is that code you put inside this <code>function</code> will run as soon as your browser has loaded your page.",
|
"Now we have a <code>document ready function</code>.",
|
||||||
"This is important because without your <code>document ready function</code>, your code may run before your HTML is rendered, which would cause bugs.",
|
|
||||||
"Now let's write our first jQuery statement. All jQuery functions start with a <code>$</code>, usually referred to as a <code>dollar sign operator</code>, or simply as <code>bling</code>.",
|
"Now let's write our first jQuery statement. All jQuery functions start with a <code>$</code>, usually referred to as a <code>dollar sign operator</code>, or simply as <code>bling</code>.",
|
||||||
"jQuery often selects an HTML element with a <code>selector</code>, then does something to that element.",
|
"jQuery often selects an HTML element with a <code>selector</code>, then does something to that element.",
|
||||||
"For example, let's make all of your <code>button</code> elements bounce. Just add this code inside your document ready function: <code>$(\"button\").addClass(\"animated bounce\")</code>.",
|
"For example, let's make all of your <code>button</code> elements bounce. Just add this code inside your document ready function: <code>$(\"button\").addClass(\"animated bounce\")</code>.",
|
||||||
@ -253,8 +254,10 @@
|
|||||||
"title": "Target the same element with multiple jQuery Selectors",
|
"title": "Target the same element with multiple jQuery Selectors",
|
||||||
"description": [
|
"description": [
|
||||||
"Now you know three ways of targeting elements: by type: <code>$(\"button\")</code>, by class: <code>$(\".btn\")</code>, and by id <code>$(\"#target1\")</code>.",
|
"Now you know three ways of targeting elements: by type: <code>$(\"button\")</code>, by class: <code>$(\".btn\")</code>, and by id <code>$(\"#target1\")</code>.",
|
||||||
"Use each of these jQuery selectors to target your <code>button</code> element with the class <code>btn</code> and the id <code>target1</code>.",
|
"Using each of the above jQuery selectors and the <code>addClass()</code> function:",
|
||||||
"Use the <code>addClass()</code> jQuery function to give the element one new class for each selector: <code>animated</code>, <code>shake</code>, and <code>btn-primary</code>."
|
"Add the <code>animated</code> class to all elements with type <code>button</code>.",
|
||||||
|
"Add the <code>shake</code> class to all the buttons with class <code>.btn</code>.",
|
||||||
|
"Add the <code>btn-primary</code> class to the button with id <code>#target1</code>."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(editor.match(/\\$\\s*?\\(\\s*?(?:'|\")\\s*?button\\s*?(?:'|\")/gi), 'Use the <code>$(\"button\")</code> selector.')",
|
"assert(editor.match(/\\$\\s*?\\(\\s*?(?:'|\")\\s*?button\\s*?(?:'|\")/gi), 'Use the <code>$(\"button\")</code> selector.')",
|
||||||
|
404
seed/challenges/json-apis-and-ajax.json
Normal file
404
seed/challenges/json-apis-and-ajax.json
Normal file
@ -0,0 +1,404 @@
|
|||||||
|
{
|
||||||
|
"name": "JSON APIs and Ajax",
|
||||||
|
"order": 10.5,
|
||||||
|
"time": "30m",
|
||||||
|
"challenges": [
|
||||||
|
{
|
||||||
|
"id": "bb000000000000000000001",
|
||||||
|
"title": "Trigger Click Events with jQuery",
|
||||||
|
"description": [
|
||||||
|
"In this section, we'll learn how to get data from APIs. APIs - or Application Interfaces - are tools that computers use to communicate with one another.",
|
||||||
|
"We'll also learn how to update HTML with the data we get from these APIs using a technology called Ajax.",
|
||||||
|
"First, let's review what the <code>$(document).ready()</code> function does. This function makes it so all code inside of it only runs once our page loads.",
|
||||||
|
"Let's make our \"Get Message\" button change the text of the element with the class <code>message</code>.",
|
||||||
|
"Before we can do this, we need to implement a <code>click event</code> inside of our <code>$(document).ready()</code> function by adding this code:",
|
||||||
|
"<code>$(\"#getMessage\").on(\"click\", function(){</code>",
|
||||||
|
"",
|
||||||
|
"<code>});</code>"
|
||||||
|
],
|
||||||
|
"tests": [
|
||||||
|
"assert(editor.match(/\\$\\s*?\\(\\s*?(?:'|\")\\#getMessage(?:'|\")\\s*?\\)\\s*?\\.on\\s*?\\(\\s*?(?:'|\")click(?:'|\")\\s*?\\,\\s*?function\\s*?\\(\\s*?\\)\\s*?\\{/gi), 'Bind the click event to the button with the ID of <code>getMessage</code>')",
|
||||||
|
"assert(editor.match(/\\n*?\\s*?\\}\\n*?\\s*?\\);/gi) && editor.match(/\\n*?\\s*?\\}\\);/gi).length >= 2, 'Be sure to close your functions with <code>});</code>')"
|
||||||
|
],
|
||||||
|
"challengeSeed": [
|
||||||
|
"fccss",
|
||||||
|
" $(document).ready(function() {",
|
||||||
|
" // Only change code below this line.",
|
||||||
|
" ",
|
||||||
|
" // Only change code above this line.",
|
||||||
|
" });",
|
||||||
|
"fcces",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"<div class=\"container-fluid\">",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <h2>Cat Photo Finder</h2>",
|
||||||
|
" </div>",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <div class = \"col-xs-12 well message\">",
|
||||||
|
" The message will go here",
|
||||||
|
" </div>",
|
||||||
|
" </div>",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <div class = \"col-xs-12\">",
|
||||||
|
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||||
|
" Get Message",
|
||||||
|
" </button>",
|
||||||
|
" </div>",
|
||||||
|
" </div>",
|
||||||
|
"</div>"
|
||||||
|
],
|
||||||
|
"challengeType": 0,
|
||||||
|
"type": "waypoint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bc000000000000000000001",
|
||||||
|
"title": "Change Text with Click Events",
|
||||||
|
"description": [
|
||||||
|
"When our click event happens, we can use Ajax to update an HTML element.",
|
||||||
|
"Let's make it so that when a user clicks the \"Get Message\" button, we change the text of the element with the class <code>message</code> to say \"Here is the message\".",
|
||||||
|
"We can do this by adding the following code within our click event:",
|
||||||
|
"<code>  $(\".message\").html(\"Here is the message\");</code>"
|
||||||
|
],
|
||||||
|
"tests": [
|
||||||
|
"assert(editor.match(/\\$\\s*?\\(\\s*?(?:'|\")\\.message(?:'|\")\\s*?\\)\\s*?\\.html\\s*?\\(\\s*?(?:'|\")Here\\sis\\sthe\\smessage(?:'|\")\\s*?\\);/gi), 'Clicking the \"Get Message\" button should give the element with the class <code>message</code> the text \"Here is the message\".')"
|
||||||
|
],
|
||||||
|
"challengeSeed": [
|
||||||
|
"fccss",
|
||||||
|
" $(document).ready(function() {",
|
||||||
|
" $(\"#getMessage\").on(\"click\", function(){",
|
||||||
|
" // Only change code below this line.",
|
||||||
|
"",
|
||||||
|
" // Only change code above this line.",
|
||||||
|
" });",
|
||||||
|
" });",
|
||||||
|
"fcces",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
|
||||||
|
"<div class=\"container-fluid\">",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <h2>Cat Photo Finder</h2>",
|
||||||
|
" </div>",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <div class = \"col-xs-12 well message\">",
|
||||||
|
" The message will go here",
|
||||||
|
" </div>",
|
||||||
|
" </div>",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <div class = \"col-xs-12\">",
|
||||||
|
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||||
|
" Get Message",
|
||||||
|
" </button>",
|
||||||
|
" </div>",
|
||||||
|
" </div>",
|
||||||
|
"</div>"
|
||||||
|
],
|
||||||
|
"challengeType": 0,
|
||||||
|
"type": "waypoint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bb000000000000000000002",
|
||||||
|
"title": "Get JSON with the jQuery getJSON Method",
|
||||||
|
"description": [
|
||||||
|
"You can also request data from an external source. This is where APIs come into play.",
|
||||||
|
"Remember that APIs - or Application Interfaces - are tools that computers use to communicate with one another.",
|
||||||
|
"Most web APIs transfer data in a format called JSON. JSON stands for JavaScript Object Notation.",
|
||||||
|
"You've already been using JSON whenever you create a JavaScript object. JSON is nothing more than object properties and their current values, sandwiched between a <code>{</code> and a <code>}</code>.",
|
||||||
|
"These properties and their values are often referred to as \"key-value pairs\".",
|
||||||
|
"Let's get the JSON from Free Code Camp's Cat Photo API.",
|
||||||
|
"Here's the code you can put in your click event to do this:",
|
||||||
|
"<code>  $.getJSON(\"/json/cats.json?callback=\", function( json ) {</code>",
|
||||||
|
"<code>    $(\".message\").html(JSON.stringify(json))</code>",
|
||||||
|
"<code>  });</code>",
|
||||||
|
"Once you've added this, click the \"Get Message\" button. Your Ajax function will replace the \"The message will go here\" text with the raw JSON output from the Free Code Camp Cat Photo API."
|
||||||
|
],
|
||||||
|
"tests": [
|
||||||
|
"assert(editor.match(/\\$\\s*?\\(\\s*?(\\\"|\\')\\#getMessage(\\\"|\\')\\s*?\\)\\s*?\\.\\s*?on\\s*?\\(\\s*?(\\\"|\\')click(\\\"|\\')\\s*?\\,\\s*?function\\s*?\\(\\s*?\\)\\s*?\\{/gi), 'You should have a click handler on the getMessage button to trigger the AJAX request.')",
|
||||||
|
"assert(editor.match(/\\s*?\\}\\s*?\\)\\s*?\\;/gi), 'You should have at least on closing set of brackets and parenthesis.')",
|
||||||
|
"assert(editor.match(/\\s*?\\}\\s*?\\)\\s*?\\;/gi) && editor.match(/\\,\\s*?function\\s*?\\(\\s*?\\w*?\\s*?\\)\\s*?\\{/gi) && editor.match(/\\s*?\\}\\s*?\\)\\s*?\\;/gi).length === editor.match(/\\s*?function\\s*?\\(\\s*?\\w*?\\s*?\\)\\s*?\\{/gi).length, 'Each callback function should have a closing set of brackets and parenthesis.')",
|
||||||
|
"assert(editor.match(/\\$\\s*?\\.\\s*?getJSON\\s*?\\(\\s*?\"\\\/json\\\/cats\\.json\\?callback\\=\"\\s*?\\,\\s*?function\\s*?\\(\\s*?json\\s*?\\)\\s*?\\{/gi), 'You should be making use of the getJSON method given in the description to load data from the json file.')",
|
||||||
|
"assert(editor.match(/\\$\\s*?\\(\\s*?\\\"\\.message\\\"\\s*?\\)\\s*?\\.\\s*?html\\s*?\\(\\s*?JSON\\s*?\\.\\s*?stringify\\s*?\\(\\s*?json\\s*?\\)\\s*?\\)/gi), 'Don\\'t forget to make the <code>.html</code> change the contents of the message box so that it contains the result of the getJSON.')"
|
||||||
|
],
|
||||||
|
"challengeSeed": [
|
||||||
|
"fccss",
|
||||||
|
" $(document).ready(function() {",
|
||||||
|
" ",
|
||||||
|
" $(\"#getMessage\").on(\"click\", function(){",
|
||||||
|
" // Only change code below this line.",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
" // Only change code above this line.",
|
||||||
|
" });",
|
||||||
|
" ",
|
||||||
|
" });",
|
||||||
|
"fcces",
|
||||||
|
"",
|
||||||
|
"<div class=\"container-fluid\">",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <h2>Cat Photo Finder</h2>",
|
||||||
|
" </div>",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <div class = \"col-xs-12 well message\">",
|
||||||
|
" The message will go here",
|
||||||
|
" </div>",
|
||||||
|
" </div>",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <div class = \"col-xs-12\">",
|
||||||
|
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||||
|
" Get Message",
|
||||||
|
" </button>",
|
||||||
|
" </div>",
|
||||||
|
" </div>",
|
||||||
|
"</div>"
|
||||||
|
],
|
||||||
|
"challengeType": 0,
|
||||||
|
"type": "waypoint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bb000000000000000000003",
|
||||||
|
"title": "Convert JSON Data to HTML",
|
||||||
|
"description": [
|
||||||
|
"Now that we're getting data from a JSON API, let's display it in our HTML.",
|
||||||
|
"We can use the <code>.map()</code> method to loop through our data and modify our HTML elements.",
|
||||||
|
"First, let's declare an html variable with <code>var html = \"\";</code>.",
|
||||||
|
"Then, let's loop through our JSON, adding more HTML to that variable. When the loop is finished, we'll render it.",
|
||||||
|
"Here's the code that does this:",
|
||||||
|
"<code>json.map(function(val) {</code>",
|
||||||
|
"<code>  html = html + \"<div class = 'cat'>\"</code>",
|
||||||
|
"<code>  for(var key in val) {</code>",
|
||||||
|
"<code>    html = html + '<div class = \"' + key + '\">' + val[key] + '</div>';</code>",
|
||||||
|
"<code>  }</code>",
|
||||||
|
"<code>  html = html + \"</div><br/>\"</code>",
|
||||||
|
"<code>});</code>"
|
||||||
|
],
|
||||||
|
"tests": [
|
||||||
|
"assert(editor.match(/json\\.map/gi), 'The message box should have something in it.')"
|
||||||
|
],
|
||||||
|
"challengeSeed": [
|
||||||
|
"fccss",
|
||||||
|
" $(document).ready(function() {",
|
||||||
|
"",
|
||||||
|
" $(\"#getMessage\").on(\"click\", function() {",
|
||||||
|
" $.getJSON(\"/json/cats.json?callback=\", function( json ) {",
|
||||||
|
"",
|
||||||
|
" // Only change code below this line.",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
" // Only change code above this line.",
|
||||||
|
"",
|
||||||
|
" $(\".message\").html(html);",
|
||||||
|
"",
|
||||||
|
" });",
|
||||||
|
" });",
|
||||||
|
" });",
|
||||||
|
"fcces",
|
||||||
|
"",
|
||||||
|
"<div class=\"container-fluid\">",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <h2>Cat Photo Finder</h2>",
|
||||||
|
" </div>",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <div class = \"col-xs-12 well message\">",
|
||||||
|
" The message will go here"," </div>",
|
||||||
|
" </div>",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <div class = \"col-xs-12\">",
|
||||||
|
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||||
|
" Get Message",
|
||||||
|
" </button>",
|
||||||
|
" </div>",
|
||||||
|
" </div>",
|
||||||
|
"</div>"
|
||||||
|
],
|
||||||
|
"challengeType": 0,
|
||||||
|
"type": "waypoint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bb000000000000000000004",
|
||||||
|
"title": "Render Images from Data Sources",
|
||||||
|
"description": [
|
||||||
|
"In the JSON that we receive from Free Code Camp's Cat Photo API, each object has an attribute called \"imageLink\".",
|
||||||
|
"When we're looping through these objects, let's check whether an object attribute (key) is <code>imageLink</code>. If it is, instead of outputing the image link, let's render the image.",
|
||||||
|
"Here's the code that does this:",
|
||||||
|
"<code>if(key === \"imageLink\") {</code>",
|
||||||
|
"<code>  html = html + '<img class = \"' + key + '\"src = \"' + val[key] + '\">';</code>",
|
||||||
|
"<code>} else {</code>",
|
||||||
|
"<code>  html = html + '<div class = \"' + key + '\">' + val[key] + '</div>';</code>",
|
||||||
|
"<code>}</code>"
|
||||||
|
],
|
||||||
|
"tests": [
|
||||||
|
"assert(editor.match(/imageLink/gi), 'You should have accessed the imageLink of each cat object.')"
|
||||||
|
],
|
||||||
|
"challengeSeed": [
|
||||||
|
"fccss",
|
||||||
|
" $(document).ready(function() {",
|
||||||
|
"",
|
||||||
|
" $(\"#getMessage\").on(\"click\", function() {",
|
||||||
|
" $.getJSON(\"/json/cats.json?callback=\", function( json ) {",
|
||||||
|
"",
|
||||||
|
" var html = \"\";",
|
||||||
|
"",
|
||||||
|
" json.map(function(val) {",
|
||||||
|
"",
|
||||||
|
" html = html + \"<div class = 'cat'>\"",
|
||||||
|
"",
|
||||||
|
" for (var key in val) {",
|
||||||
|
"",
|
||||||
|
" // Only change code below this line.",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
" // Only change code above this line.",
|
||||||
|
"",
|
||||||
|
" }",
|
||||||
|
"",
|
||||||
|
" html = html + \"</div>\"",
|
||||||
|
"",
|
||||||
|
" });",
|
||||||
|
"",
|
||||||
|
" $(\".message\").html(html);",
|
||||||
|
"",
|
||||||
|
" });",
|
||||||
|
" });",
|
||||||
|
" });",
|
||||||
|
"fcces",
|
||||||
|
"",
|
||||||
|
"<div class=\"container-fluid\">",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <h2>Cat Photo Finder</h2>",
|
||||||
|
" </div>",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <div class = \"col-xs-12 well message\">",
|
||||||
|
" The message will go here",
|
||||||
|
" </div>",
|
||||||
|
" </div>",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <div class = \"col-xs-12\">",
|
||||||
|
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||||
|
" Get Message",
|
||||||
|
" </button>",
|
||||||
|
" </div>",
|
||||||
|
" </div>",
|
||||||
|
"</div>"
|
||||||
|
],
|
||||||
|
"challengeType": 0,
|
||||||
|
"type": "waypoint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bb000000000000000000005",
|
||||||
|
"title": "Prefilter JSON",
|
||||||
|
"description": [
|
||||||
|
"If we don't want to render every cat photo we get from our Free Code Camp's Cat Photo JSON API, we can pre-filter the json before we loop through it.",
|
||||||
|
"Let's filter out the cat who's \"id\" key has a value of 1.",
|
||||||
|
"Here's the code to do this:",
|
||||||
|
"<code>json = json.filter(function(val) {</code>",
|
||||||
|
"<code>  return(val.id !== 1);</code>",
|
||||||
|
"<code>});</code>"
|
||||||
|
],
|
||||||
|
"tests": [
|
||||||
|
"assert(editor.match(/filter/gi), 'You should be making use of the .filter method.')"
|
||||||
|
],
|
||||||
|
"challengeSeed": [
|
||||||
|
"fccss",
|
||||||
|
" $(document).ready(function() {",
|
||||||
|
"",
|
||||||
|
" $(\"#getMessage\").on(\"click\", function() {",
|
||||||
|
" $.getJSON(\"/json/cats.json?callback=\", function( json ) {",
|
||||||
|
"",
|
||||||
|
" var html = \"\";",
|
||||||
|
"",
|
||||||
|
" json.map(function(val){",
|
||||||
|
"",
|
||||||
|
" val = \"<img src = '\" + val.imageLink + \"'/>\" ",
|
||||||
|
"",
|
||||||
|
" html = html + \"<div class = 'cat'>\"",
|
||||||
|
"",
|
||||||
|
" // Only change code below this line.",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
" // Only change code above this line.",
|
||||||
|
"",
|
||||||
|
" for(var key in val){",
|
||||||
|
"",
|
||||||
|
" html = html + '<div class = \"' + key + '\">' + val[key] + '</div>';",
|
||||||
|
"",
|
||||||
|
" }",
|
||||||
|
"",
|
||||||
|
" html = html + \"</div>\"",
|
||||||
|
"",
|
||||||
|
" });",
|
||||||
|
"",
|
||||||
|
" $(\".message\").html(html);",
|
||||||
|
"",
|
||||||
|
" });",
|
||||||
|
" });",
|
||||||
|
" });",
|
||||||
|
"fcces",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"<div class=\"container-fluid\">",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <h2>Cat Photo Finder</h2>",
|
||||||
|
" </div>",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <div class = \"col-xs-12 well message\">",
|
||||||
|
" The message will go here",
|
||||||
|
" </div>",
|
||||||
|
" </div>",
|
||||||
|
" <div class = \"row text-center\">",
|
||||||
|
" <div class = \"col-xs-12\">",
|
||||||
|
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||||
|
" Get Message",
|
||||||
|
" </button>",
|
||||||
|
" </div>",
|
||||||
|
" </div>",
|
||||||
|
"</div>",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"challengeType": 0,
|
||||||
|
"type": "waypoint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bb000000000000000000006",
|
||||||
|
"title": "Get Geo-location Data",
|
||||||
|
"description": [
|
||||||
|
"Another cool thing we can do is access our user's current location. Every browser has a built in navigator that can give us this information.",
|
||||||
|
"The navigator will get our user's current longitude and latitude.",
|
||||||
|
"Here's some code that does this:",
|
||||||
|
"<code>if (navigator.geolocation) {</code>",
|
||||||
|
"<code>  navigator.geolocation.getCurrentPosition(function(position) {</code>",
|
||||||
|
"<code>    $(\"#data\").html(\"latitiude\" + position.coords.latitude + \"longitude\" + position.coords.longitude);</code>",
|
||||||
|
"<code>  });</code>",
|
||||||
|
"<code>}</code>"
|
||||||
|
],
|
||||||
|
"tests": [
|
||||||
|
"assert(editor.match(/navigator\\.geolocation\\.getCurrentPosition/gi), 'You should make use of the <code>navigator.geolocation</code> to access the users current location.')"
|
||||||
|
],
|
||||||
|
"challengeSeed": [
|
||||||
|
"fccss",
|
||||||
|
" // Only change code below this line.",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
" // Only change code above this line.",
|
||||||
|
"fcces",
|
||||||
|
"<div id = \"data\">",
|
||||||
|
" <h4>You are here:</h4>",
|
||||||
|
" ",
|
||||||
|
"</div>"
|
||||||
|
],
|
||||||
|
"challengeType": 0,
|
||||||
|
"type": "waypoint"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "MongoDB",
|
"name": "MongoDB",
|
||||||
"order" : 19,
|
"order" : 19,
|
||||||
|
"time": "3h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "bd7243d8c341eddeaeb5bd0f",
|
"id": "bd7243d8c341eddeaeb5bd0f",
|
||||||
@ -24,7 +25,7 @@
|
|||||||
"Complete \"Mongod\"",
|
"Complete \"Mongod\"",
|
||||||
"Complete \"Connect\"",
|
"Complete \"Connect\"",
|
||||||
"Complete \"Find\"",
|
"Complete \"Find\"",
|
||||||
"Complete \"Find Limit\"",
|
"Complete \"Find Project\"",
|
||||||
"Complete \"Insert\"",
|
"Complete \"Insert\"",
|
||||||
"Complete \"Update\"",
|
"Complete \"Update\"",
|
||||||
"Complete \"Remove\"",
|
"Complete \"Remove\"",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Node.js and Express.js",
|
"name": "Node.js and Express.js",
|
||||||
"order" : 18,
|
"order" : 18,
|
||||||
|
"time": "20h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "bd7153d8c441eddfaeb5bd0f",
|
"id": "bd7153d8c441eddfaeb5bd0f",
|
||||||
@ -33,13 +34,7 @@
|
|||||||
"Complete \"Publish\"",
|
"Complete \"Publish\"",
|
||||||
"Complete \"Version\"",
|
"Complete \"Version\"",
|
||||||
"Complete \"Publish Again\"",
|
"Complete \"Publish Again\"",
|
||||||
"Complete \"Dist Tag\"",
|
"Note Once you've completed these steps, you can skip the rest (which are currently buggy) and move on to our next challenge."
|
||||||
"Complete \"Dist Tag Removal\"",
|
|
||||||
"Complete \"Outdated\"",
|
|
||||||
"Complete \"Update\"",
|
|
||||||
"Complete \"RM\"",
|
|
||||||
"Complete \"Finale\"",
|
|
||||||
"Once you've completed these steps, move on to our next challenge."
|
|
||||||
],
|
],
|
||||||
"type": "waypoint",
|
"type": "waypoint",
|
||||||
"challengeType": 2,
|
"challengeType": 2,
|
||||||
@ -103,7 +98,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
"Let's continue the LearnYouNode Node School challenge. For this Waypoint, we'll do challenges 8 through 10.",
|
"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: <code>cd ~/workspace</code>.",
|
"Make sure that you are always in your project's \"workspace\" directory. You can always navigate back to this directory by running this command: <code>cd ~/workspace</code>.",
|
||||||
"Return to the c9.io workspace you created Now start this tutorial by running <code>learnyounode</code>",
|
"Return to the c9.io workspace you created. Now start this tutorial by running <code>learnyounode</code>",
|
||||||
"You can view this Node School module's source code on GitHub at <a href='https://github.com/workshopper/learnyounode'>https://github.com/workshopper/learnyounode</a>.",
|
"You can view this Node School module's source code on GitHub at <a href='https://github.com/workshopper/learnyounode'>https://github.com/workshopper/learnyounode</a>.",
|
||||||
"Complete \"HTTP Collect\"",
|
"Complete \"HTTP Collect\"",
|
||||||
"Complete \"Juggling Async\"",
|
"Complete \"Juggling Async\"",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Object Oriented and Functional Programming",
|
"name": "Object Oriented and Functional Programming",
|
||||||
"order": 7,
|
"order": 7,
|
||||||
|
"time": "1h",
|
||||||
"note": [
|
"note": [
|
||||||
"Methods",
|
"Methods",
|
||||||
"Closures",
|
"Closures",
|
||||||
@ -99,7 +100,7 @@
|
|||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert(typeof(myBike.getSpeed)!=='undefined' && typeof(myBike.getSpeed) === 'function', 'message: The method getSpeed of myBike should be accessible outside the object.');",
|
"assert(typeof(myBike.getSpeed)!=='undefined' && typeof(myBike.getSpeed) === 'function', 'message: The method getSpeed of myBike should be accessible outside the object.');",
|
||||||
"assert(typeof(myBike.speed) === 'undefined', 'message: <code>myBike.speed</code> should remain undefined.');",
|
"assert(typeof(myBike.speed) === 'undefined', 'message: <code>myBike.speed</code> should be undefined.');",
|
||||||
"assert(typeof(myBike.addUnit) === 'undefined', 'message: <code>myBike.addUnit</code> should remain undefined.');"
|
"assert(typeof(myBike.addUnit) === 'undefined', 'message: <code>myBike.addUnit</code> should remain undefined.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
@ -146,10 +147,11 @@
|
|||||||
"A function that creates objects is called a <code>constructor</code>.",
|
"A function that creates objects is called a <code>constructor</code>.",
|
||||||
"You can create <code>instances</code> of an object using a <code>constructor</code>.",
|
"You can create <code>instances</code> of an object using a <code>constructor</code>.",
|
||||||
"Each new <code>instance</code> of this object <code>inherits</code> all the <code>properties</code> and <code>methods</code> of your original object.",
|
"Each new <code>instance</code> of this object <code>inherits</code> all the <code>properties</code> and <code>methods</code> of your original object.",
|
||||||
"Then you can give the instance new properties."
|
"Once an <code>instance</code> has been created you can add <code>properties</code> to that <code>instance</code> individually.",
|
||||||
|
"Add an <code>engines</code> property with a number value to the <code>myCar</code> instance."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert((new Car()).wheels === 4, 'message: The property <code>wheels</code> should still be 4 like in the object constructor.');",
|
"assert((new Car()).wheels === 4, 'message: The property <code>wheels</code> should still be 4 in the object constructor.');",
|
||||||
"assert(typeof((new Car()).engines) === 'undefined', 'message: There should not be a property <code>engines</code> in the object constructor.');",
|
"assert(typeof((new Car()).engines) === 'undefined', 'message: There should not be a property <code>engines</code> in the object constructor.');",
|
||||||
"assert(myCar.wheels === 4, 'message: The property <code>wheels</code> of myCar should equal 4.');",
|
"assert(myCar.wheels === 4, 'message: The property <code>wheels</code> of myCar should equal 4.');",
|
||||||
"assert(typeof(myCar.engines) === 'number', 'message: The property <code>engines</code> of myCar should be a number.');"
|
"assert(typeof(myCar.engines) === 'number', 'message: The property <code>engines</code> of myCar should be a number.');"
|
||||||
@ -176,17 +178,19 @@
|
|||||||
"title":"Iterate over Arrays with .map",
|
"title":"Iterate over Arrays with .map",
|
||||||
"difficulty":0,
|
"difficulty":0,
|
||||||
"description":[
|
"description":[
|
||||||
"<code>array = array.map(function(val){</code>",
|
"The <code>map</code> method is a convenient way to iterate through arrays. Here's an example usage:",
|
||||||
"<code>  return val+1;</code>",
|
"<code>var timesFour = array.map(function(val){</code>",
|
||||||
|
"<code>  return val*4;</code>",
|
||||||
"<code>});</code>",
|
"<code>});</code>",
|
||||||
"",
|
"",
|
||||||
"The map method is one of the easiest ways to iterate through an array or object there is. Let's use it now.",
|
"The <code>map</code> method will iterate through every element of the array, creating a new array with values that have been modified by the callback function, and return it.",
|
||||||
"Use the map function to add 3 to every value in the variable <code>array</code>"
|
"In our example the callback only uses the value of the array element (the <code>val</code> argument) but your callback can also include arguments for the <code>index</code> and <code>array</code> being acted on.",
|
||||||
|
"Use the map function to add 3 to every value in the variable <code>array</code>."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert.deepEqual(array, [4,5,6,7,8], 'message: You should add three to each value in the array.');",
|
"assert.deepEqual(array, [4,5,6,7,8], 'message: You should add three to each value in the array.');",
|
||||||
"assert(editor.getValue().match(/\\.map\\s*\\(/gi), 'message: You should be making use of the map method.');",
|
"assert(editor.getValue().match(/\\.map\\s*\\(/gi), 'message: You should be making use of the <code>map</code> method.');",
|
||||||
"assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\]/gi), 'message: You should only modify the array with <code>.map</code>.');"
|
"assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\]/gi), 'message: You should only modify the array with <code>map</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"//Use map to add three to each value in the array",
|
"//Use map to add three to each value in the array",
|
||||||
@ -198,6 +202,9 @@
|
|||||||
"// Only change code above this line.",
|
"// Only change code above this line.",
|
||||||
"(function() {return array;})();"
|
"(function() {return array;})();"
|
||||||
],
|
],
|
||||||
|
"MDNlinks":[
|
||||||
|
"Array.map()"
|
||||||
|
],
|
||||||
"challengeType":1,
|
"challengeType":1,
|
||||||
"type": "waypoint"
|
"type": "waypoint"
|
||||||
},
|
},
|
||||||
@ -206,14 +213,18 @@
|
|||||||
"title":"Condense arrays with .reduce",
|
"title":"Condense arrays with .reduce",
|
||||||
"difficulty":0,
|
"difficulty":0,
|
||||||
"description":[
|
"description":[
|
||||||
"Reduce can be useful for condensing an array or numbers into one value.",
|
"The array method <code>reduce</code> is used to iterate through an array and condense it into one value.",
|
||||||
|
"To use <code>reduce</code> you pass in a callback whose arguments are an accumulator (in this case, <code>previousVal</code>) and the current value (<code>currentVal</code>).",
|
||||||
|
"<code>reduce</code> has an optional second argument which can be used to set the initial value of the accumulator. If no initial value is specified if will be the first array element.",
|
||||||
|
"Here is an example of <code>reduce</code> being used to sum all the values of an array:",
|
||||||
"<code>var singleVal = array.reduce(function(previousVal, currentVal){</code>",
|
"<code>var singleVal = array.reduce(function(previousVal, currentVal){</code>",
|
||||||
"<code>  return previousVal+currentVal;</code>",
|
"<code>  return previousVal+currentVal;</code>",
|
||||||
"<code>});</code>"
|
"<code>});</code>",
|
||||||
|
"Use the <code>reduce</code> method to sum all the values in <code>array</code> and assign it to <code>singleVal</code>."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert(singleVal == 30, 'message: <code>singleVal</code> should have been set to the result of your reduce operation.');",
|
"assert(singleVal == 30, 'message: <code>singleVal</code> should be equal to the sum of all items in the <code>array</code> variable.');",
|
||||||
"assert(editor.getValue().match(/\\.reduce\\s*\\(/gi), 'message: You should have made use of the reduce method.');"
|
"assert(editor.getValue().match(/\\.reduce\\s*\\(/gi), 'message: You should have made use of the <code>reduce</code> method.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"var array = [4,5,6,7,8];",
|
"var array = [4,5,6,7,8];",
|
||||||
@ -225,6 +236,9 @@
|
|||||||
"// Only change code above this line.",
|
"// Only change code above this line.",
|
||||||
"(function() {return singleVal;})();"
|
"(function() {return singleVal;})();"
|
||||||
],
|
],
|
||||||
|
"MDNlinks":[
|
||||||
|
"Array.reduce()"
|
||||||
|
],
|
||||||
"challengeType":1,
|
"challengeType":1,
|
||||||
"type": "waypoint"
|
"type": "waypoint"
|
||||||
},
|
},
|
||||||
@ -233,26 +247,32 @@
|
|||||||
"title":"Filter Arrays with .filter",
|
"title":"Filter Arrays with .filter",
|
||||||
"difficulty":0,
|
"difficulty":0,
|
||||||
"description":[
|
"description":[
|
||||||
"filter is a useful method that can filter out values that don't match a certain criteria",
|
"The <code>filter</code> method is used to iterate through an array and filter out elements where a given condition is not true.",
|
||||||
"Let's remove all the values greater than five",
|
"<code>filter</code> is passed a callback function which takes the current value (we've called that <code>val</code>) as an argument. It can also use arguments for the <code>index</code> and <code>array</code> being acted on.",
|
||||||
|
"Any array element for which the callback returns true will be kept and elements that return false will be filtered out.",
|
||||||
|
"The following code is an example of using filter to remove array elements that are not even numbers:",
|
||||||
"<code>array = array.filter(function(val) {</code>",
|
"<code>array = array.filter(function(val) {</code>",
|
||||||
"<code>  return val <= 5;</code>",
|
"<code>  return val % 2 === 0;</code>",
|
||||||
"<code>});</code>"
|
"<code>});</code>",
|
||||||
|
"Use <code>filter</code> to remove all elements from <code>array</code> that are greater than 5."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert.deepEqual(array, [1,2,3,4], 'message: You should have removed all the values from the array that are greater than 4.');",
|
"assert.deepEqual(array, [1,2,3,4,5], 'message: You should have removed all the values from the array that are greater than 5.');",
|
||||||
"assert(editor.getValue().match(/array\\.filter\\s*\\(/gi), 'message: You should be using the filter method to remove the values from the array.');",
|
"assert(editor.getValue().match(/array\\.filter\\s*\\(/gi), 'message: You should be using the <code>filter</code> method to remove the values from the array.');",
|
||||||
"assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\,6\\,7\\,8\\,9\\,10\\]/gi), 'message: You should only be using <code>.filter</code> to modify the contents of the array.');"
|
"assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\,6\\,7\\,8\\,9\\,10\\]/gi), 'message: You should only be using <code>filter</code> to modify the contents of the array.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"var array = [1,2,3,4,5,6,7,8,9,10];",
|
"var array = [1,2,3,4,5,6,7,8,9,10];",
|
||||||
" // Only change code below this line.",
|
"// Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
" // Only change code above this line.",
|
"// Only change code above this line.",
|
||||||
"(function() {return array;})();"
|
"(function() {return array;})();"
|
||||||
],
|
],
|
||||||
|
"MDNlinks":[
|
||||||
|
"Array.filter()"
|
||||||
|
],
|
||||||
"challengeType":1,
|
"challengeType":1,
|
||||||
"type": "waypoint"
|
"type": "waypoint"
|
||||||
},
|
},
|
||||||
@ -261,15 +281,20 @@
|
|||||||
"title": "Sort Arrays with .sort",
|
"title": "Sort Arrays with .sort",
|
||||||
"difficulty":0,
|
"difficulty":0,
|
||||||
"description":[
|
"description":[
|
||||||
"You can use the method sort to easily sort the values in the array alphabetically or numerically",
|
"You can use the method <code>sort</code> to easily sort the values in an array alphabetically or numerically.",
|
||||||
"<code>var array = [1,3,2];</code>",
|
"Unlike the previous array methods we have been looking at, <code>sort</code> actually alters the array in place. However, it also returns this sorted array.",
|
||||||
"<code>array = array.sort();</code>",
|
"<code>sort</code> can be passed a compare function as a callback. If no compare function is passed in it will convert the values to strings and sort alphabetically.",
|
||||||
"This will return <code>[1, 2, 3]</code>"
|
"Here is an example of using sort with a compare function that will sort the elements from smallest to largest number:",
|
||||||
|
"<code>var array = [1, 12, 21, 2];</code>",
|
||||||
|
"<code>array.sort(function(a, b) {</code>",
|
||||||
|
"<code>  return a - b;</code>",
|
||||||
|
"<code>});</code>",
|
||||||
|
"Use <code>sort</code> to sort <code>array</code> alphabetically."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert.deepEqual(array, ['alpha', 'beta', 'charlie'], 'message: You should have sorted the array alphabetically.');",
|
"assert.deepEqual(array, ['alpha', 'beta', 'charlie'], 'message: You should have sorted the array alphabetically.');",
|
||||||
"assert(editor.getValue().match(/\\[\\'beta\\'\\,\\s\\'alpha\\'\\,\\s'charlie\\'\\];/gi), 'message: You should be sorting the array using sort.');",
|
"assert(editor.getValue().match(/\\[\\'beta\\'\\,\\s\\'alpha\\'\\,\\s'charlie\\'\\];/gi), 'message: You should only be using <code>sort</code> to modify the array.');",
|
||||||
"assert(editor.getValue().match(/\\.sort\\s*\\(\\)/gi), 'message: You should have made use of the sort method.');"
|
"assert(editor.getValue().match(/\\.sort\\s*\\(\\)/gi), 'message: You should have made use of the <code>sort</code> method.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"var array = ['beta', 'alpha', 'charlie'];",
|
"var array = ['beta', 'alpha', 'charlie'];",
|
||||||
@ -277,9 +302,12 @@
|
|||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
" // Only change code above this line.",
|
"// Only change code above this line.",
|
||||||
"(function() {return array;})();"
|
"(function() {return array;})();"
|
||||||
],
|
],
|
||||||
|
"MDNlinks":[
|
||||||
|
"Array.sort()"
|
||||||
|
],
|
||||||
"challengeType":1,
|
"challengeType":1,
|
||||||
"type": "waypoint"
|
"type": "waypoint"
|
||||||
},
|
},
|
||||||
@ -287,22 +315,27 @@
|
|||||||
"id": "cf1111c1c16feddfaeb2bdef",
|
"id": "cf1111c1c16feddfaeb2bdef",
|
||||||
"title": "Reverse Arrays with .reverse",
|
"title": "Reverse Arrays with .reverse",
|
||||||
"description": [
|
"description": [
|
||||||
"You can use the <code>.reverse()</code> function to reverse the contents of an array."
|
"You can use the <code>reverse</code> method to reverse the elements of an array.",
|
||||||
|
"<code>reverse</code> is another array method that alters the array in place, but it also returns the reversed array.",
|
||||||
|
"Add a line of code that uses <code>reverse</code> to reverse the <code>array</code> variable."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.deepEqual(array, [7,6,5,4,3,2,1], 'message: You should reverse the array.');",
|
"assert.deepEqual(array, [7,6,5,4,3,2,1], 'message: You should reverse the array.');",
|
||||||
"assert(editor.getValue().match(/\\.reverse\\s*\\(\\)/gi), 'message: You should use the reverse method.');",
|
"assert(editor.getValue().match(/\\.reverse\\s*\\(\\)/gi), 'message: You should use the <code>reverse</code> method.');",
|
||||||
"assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\,6\\,7/gi), 'message: You should return <code>[7,6,5,4,3,2,1]</code>.');"
|
"assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\,6\\,7/gi), 'message: You should only be using <code>revserse</code> to modify <code>array</code>.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var array = [1,2,3,4,5,6,7];",
|
"var array = [1,2,3,4,5,6,7];",
|
||||||
" // Only change code below this line.",
|
"// Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
" // Only change code above this line.",
|
"// Only change code above this line.",
|
||||||
"(function() {return array;})();"
|
"(function() {return array;})();"
|
||||||
],
|
],
|
||||||
|
"MDNlinks":[
|
||||||
|
"Array.reverse()"
|
||||||
|
],
|
||||||
"challengeType": 1,
|
"challengeType": 1,
|
||||||
"type": "waypoint"
|
"type": "waypoint"
|
||||||
},
|
},
|
||||||
@ -310,13 +343,16 @@
|
|||||||
"id": "cf1111c1c16feddfaeb3bdef",
|
"id": "cf1111c1c16feddfaeb3bdef",
|
||||||
"title": "Concatenate Strings with .concat",
|
"title": "Concatenate Strings with .concat",
|
||||||
"description": [
|
"description": [
|
||||||
"<code>.concat()</code> can be used to merge the contents of two arrays into one.",
|
"<code>concat</code> can be used to merge the contents of two arrays into one.",
|
||||||
"<code>array = array.concat(otherArray);</code>"
|
"<code>concat</code> takes an array as an argument and returns a new array with the elements of this array concatenated onto the end.",
|
||||||
|
"Here is an example of <code>concat</code> being used to concatenate <code>otherArray</code> onto the end of <code>array</code>:",
|
||||||
|
"<code>array = array.concat(otherArray);</code>",
|
||||||
|
"Use <code>.concat()</code> to concatenate <code>concatMe</code> onto the end of <code>array</code> and assign it back to <code>array</code>."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.deepEqual(array, [1,2,3,4,5,6], 'You should concat the two arrays together.');",
|
"assert.deepEqual(array, [1,2,3,4,5,6], 'message: You should concatenate the two arrays together.');",
|
||||||
"assert(editor.getValue().match(/\\.concat\\s*\\(/gi), 'message: You should be use the concat method to merge the two arrays.');",
|
"assert(editor.getValue().match(/\\.concat\\s*\\(/gi), 'message: You should be using the <code>concat</code> method to merge the two arrays.');",
|
||||||
"assert(editor.getValue().match(/\\[1\\,2\\,3\\]/gi) && editor.getValue().match(/\\[4\\,5\\,6\\]/gi), 'message: You should only modify the two arrays without changing the origional ones.');"
|
"assert(editor.getValue().match(/\\[1\\,2\\,3\\]/gi) && editor.getValue().match(/\\[4\\,5\\,6\\]/gi), 'message: You should only be using <code>concat</code> to modify the arrays.');"
|
||||||
],
|
],
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var array = [1,2,3];",
|
"var array = [1,2,3];",
|
||||||
@ -329,6 +365,9 @@
|
|||||||
"// Only change code above this line.",
|
"// Only change code above this line.",
|
||||||
"(function() {return array;})();"
|
"(function() {return array;})();"
|
||||||
],
|
],
|
||||||
|
"MDNlinks":[
|
||||||
|
"Array.concat()"
|
||||||
|
],
|
||||||
"challengeType": 1,
|
"challengeType": 1,
|
||||||
"type": "waypoint"
|
"type": "waypoint"
|
||||||
},
|
},
|
||||||
@ -337,13 +376,15 @@
|
|||||||
"title":"Split Strings with .split",
|
"title":"Split Strings with .split",
|
||||||
"difficulty":0,
|
"difficulty":0,
|
||||||
"description":[
|
"description":[
|
||||||
"You can use the <code>.split()</code> method to split a string into an array.",
|
"You can use the <code>split</code> method to split a string into an array.",
|
||||||
"split uses the argument you give to to split the string.",
|
"<code>split</code> uses the argument you pass in as a delimiter to determine which points the string should be split at.",
|
||||||
"<code>array = string.split(' ');</code>"
|
"Here is an example of <code>split</code> being used to split an array at every space character:",
|
||||||
|
"<code>var array = string.split(' ');</code>",
|
||||||
|
"Use <code>split</code> to create an array of words from <code>string</code> and assign it to <code>array</code>."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert(typeof(array) === 'object' && array.length === 5, 'message: You should split the string by its spaces.');",
|
"assert(typeof(array) === 'object' && array.length === 5, 'message: You should split the string by its spaces.');",
|
||||||
"assert(/\\.split\\(/gi, 'message: You should use the split method on the string.');"
|
"assert(/\\.split\\(/gi, 'message: You should use the <code>split</code> method on the string.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"var string = \"Split me into an array\";",
|
"var string = \"Split me into an array\";",
|
||||||
@ -354,6 +395,9 @@
|
|||||||
"// Only change code above this line.",
|
"// Only change code above this line.",
|
||||||
"(function() {return array;})();"
|
"(function() {return array;})();"
|
||||||
],
|
],
|
||||||
|
"MDNlinks":[
|
||||||
|
"String.split()"
|
||||||
|
],
|
||||||
"challengeType":1,
|
"challengeType":1,
|
||||||
"type": "waypoint"
|
"type": "waypoint"
|
||||||
},
|
},
|
||||||
@ -362,21 +406,26 @@
|
|||||||
"title":"Join Strings with .join",
|
"title":"Join Strings with .join",
|
||||||
"difficulty":0,
|
"difficulty":0,
|
||||||
"description":[
|
"description":[
|
||||||
"We can use the <code>.join()</code> method to join each element in an array into a string separated by whatever delimiter you provide as an argument to the join operation.",
|
"We can use the <code>join</code> method to join each element of an array into a string separated by whatever delimiter you provide as an argument.",
|
||||||
"<code>var joinMe = joinMe.join(\" \");</code>"
|
"The following is an example of using <code>join</code> to join all of the elements of an array into a string with all the elements seperated by a space:",
|
||||||
|
"<code>var joinedString = joinMe.join(\" \");</code>",
|
||||||
|
"Use the <code>join</code> method to create a string from <code>joinMe</code> with spaces in between each element and assign it to <code>joinedString</code>."
|
||||||
],
|
],
|
||||||
"tests":[
|
"tests":[
|
||||||
"assert(typeof(joinMe) === 'string' && joinMe === \"Split me into an array\", 'message: You should join the arrays by their spaces.');",
|
"assert(typeof(joinedString) === 'string' && joinedString === \"Split me into an array\", 'message: You should join the elements of the array with spaces.');",
|
||||||
"assert(/\\.join\\(/gi, 'message: You should use of the join method on the array.');"
|
"assert(/\\.join\\(/gi, 'message: You should use of the <code>join</code> method on the array.');"
|
||||||
],
|
],
|
||||||
"challengeSeed":[
|
"challengeSeed":[
|
||||||
"var joinMe = [\"Split\",\"me\",\"into\",\"an\",\"array\"];",
|
"var joinMe = [\"Split\",\"me\",\"into\",\"an\",\"array\"];",
|
||||||
"// Only change code below this line.",
|
"// Only change code below this line.",
|
||||||
"",
|
"",
|
||||||
"joinMe = joinMe;",
|
"var joinedString = joinMe;",
|
||||||
"",
|
"",
|
||||||
"// Only change code above this line.",
|
"// Only change code above this line.",
|
||||||
"(function() {return joinMe;})();"
|
"(function() {return joinedString;})();"
|
||||||
|
],
|
||||||
|
"MDNlinks":[
|
||||||
|
"Array.join()"
|
||||||
],
|
],
|
||||||
"challengeType":1,
|
"challengeType":1,
|
||||||
"type": "waypoint"
|
"type": "waypoint"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Upper Intermediate Algorithm Scripting",
|
"name": "Upper Intermediate Algorithm Scripting",
|
||||||
"order": 13,
|
"order": 13,
|
||||||
|
"time": "50h",
|
||||||
"challenges": [
|
"challenges": [
|
||||||
{
|
{
|
||||||
"id": "a2f1d72d9b908d0bd72bb9f6",
|
"id": "a2f1d72d9b908d0bd72bb9f6",
|
||||||
@ -27,12 +28,20 @@
|
|||||||
"assert.deepEqual(bob.lastName, undefined, 'message: <code>bob.lastName</code> should return undefined.');",
|
"assert.deepEqual(bob.lastName, undefined, 'message: <code>bob.lastName</code> should return undefined.');",
|
||||||
"assert.deepEqual(bob.getFirstName(), 'Bob', 'message: <code>bob.getFirstName()</code> should return \"Bob\".');",
|
"assert.deepEqual(bob.getFirstName(), 'Bob', 'message: <code>bob.getFirstName()</code> should return \"Bob\".');",
|
||||||
"assert.deepEqual(bob.getLastName(), 'Ross', 'message: <code>bob.getLastName()</code> should return \"Ross\".');",
|
"assert.deepEqual(bob.getLastName(), 'Ross', 'message: <code>bob.getLastName()</code> should return \"Ross\".');",
|
||||||
"assert.deepEqual(bob.getFullName(), 'Bob Ross', 'message: <code>bob.getFullName()</code> should return \"Bob Ross\".');"
|
"assert.deepEqual(bob.getFullName(), 'Bob Ross', 'message: <code>bob.getFullName()</code> should return \"Bob Ross\".');",
|
||||||
|
"assert.strictEqual((function () { bob.setFirstName(\"Haskell\"); return bob.getFullName(); })(), 'Haskell Ross', 'message: <code>bob.getFullName()</code> should return \"Haskell Ross\" after <code>bob.setFirstName(\"Haskell\")</code>.');",
|
||||||
|
"assert.strictEqual((function () { bob.setLastName(\"Curry\"); return bob.getFullName(); })(), 'Bob Curry', 'message: <code>bob.getFullName()</code> should return \"Bob Curry\" after <code>bob.setLastName(\"Curry\")</code>.');",
|
||||||
|
"assert.strictEqual((function () { bob.setFullName(\"Haskell Curry\"); return bob.getFullName(); })(), 'Haskell Curry', 'message: <code>bob.getFullName()</code> should return \"Haskell Curry\" after <code>bob.setFullName(\"Haskell Curry\")</code>.');",
|
||||||
|
"assert.strictEqual((function () { bob.setFullName(\"Haskell Curry\"); return bob.getFirstName(); })(), 'Haskell', 'message: <code>bob.getFirstName()</code> should return \"Haskell\" after <code>bob.setFullName(\"Haskell Curry\")</code>.');",
|
||||||
|
"assert.strictEqual((function () { bob.setFullName(\"Haskell Curry\"); return bob.getLastName(); })(), 'Curry', 'message: <code>bob.getLastName()</code> should return \"Curry\" after <code>bob.setFullName(\"Haskell Curry\")</code>.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Closures",
|
"Closures",
|
||||||
"Details of the Object Model"
|
"Details of the Object Model"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"var Person = function(firstAndLast) {\n\n var firstName, lastName;\n\n function updateName(str) { \n firstName = str.split(\" \")[0];\n lastName = str.split(\" \")[1]; \n }\n\n updateName(firstAndLast);\n\n this.getFirstName = function(){\n return firstName;\n };\n \n this.getLastName = function(){\n return lastName;\n };\n \n this.getFullName = function(){\n return firstName + \" \" + lastName;\n };\n \n this.setFirstName = function(str){\n firstName = str;\n };\n \n\n this.setLastName = function(str){\n lastName = str;\n };\n \n this.setFullName = function(str){\n updateName(str);\n };\n};\n\nvar bob = new Person('Bob Ross');\nbob.getFullName();"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -74,6 +83,9 @@
|
|||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Math.pow()"
|
"Math.pow()"
|
||||||
],
|
],
|
||||||
|
"solutions": [
|
||||||
|
"function orbitalPeriod(arr) {\n var GM = 398600.4418;\n var earthRadius = 6367.4447;\n var TAU = 2 * Math.PI; \n return arr.map(function(obj) {\n return {\n name: obj.name,\n orbitalPeriod: Math.round(TAU * Math.sqrt(Math.pow(obj.avgAlt+earthRadius, 3)/GM))\n };\n });\n}\n\norbitalPeriod([{name : \"sputkin\", avgAlt : 35873.5553}]);\n"
|
||||||
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
@ -105,15 +117,18 @@
|
|||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert.deepEqual(pairwise([1, 4, 2, 3, 0, 5], 7), 11, 'message: <code>pairwise([1, 4, 2, 3, 0, 5], 7)</code> should return 11.');",
|
"assert.deepEqual(pairwise([1, 4, 2, 3, 0, 5], 7), 11, 'message: <code>pairwise([1, 4, 2, 3, 0, 5], 7)</code> should return 11.');",
|
||||||
"expect(pairwise([1, 3, 2, 4], 4), 1, 'message: <code>pairwise([1, 3, 2, 4], 4), 1</code> should return 1.');",
|
"assert.deepEqual(pairwise([1, 3, 2, 4], 4), 1, 'message: <code>pairwise([1, 3, 2, 4], 4), 1</code> should return 1.');",
|
||||||
"expect(pairwise([1,1,1], 2), 1, 'message: <code>pairwise([1,1,1], 2)</code> should return 1.');",
|
"assert.deepEqual(pairwise([1,1,1], 2), 1, 'message: <code>pairwise([1,1,1], 2)</code> should return 1.');",
|
||||||
"expect(pairwise([0, 0, 0, 0, 1, 1], 1), 10, 'message: <code>pairwise([0, 0, 0, 0, 1, 1], 1)</code> should return 10.');",
|
"assert.deepEqual(pairwise([0, 0, 0, 0, 1, 1], 1), 10, 'message: <code>pairwise([0, 0, 0, 0, 1, 1], 1)</code> should return 10.');",
|
||||||
"expect(pairwise([], 100), 0, 'message: <code>pairwise([], 100)</code> should return 0.');"
|
"assert.deepEqual(pairwise([], 100), 0, 'message: <code>pairwise([], 100)</code> should return 0.');"
|
||||||
],
|
],
|
||||||
"MDNlinks": [
|
"MDNlinks": [
|
||||||
"Array.reduce()"
|
"Array.reduce()"
|
||||||
],
|
],
|
||||||
"type": "bonfire",
|
"type": "bonfire",
|
||||||
|
"solutions": [
|
||||||
|
"function pairwise(arr, arg) {\n var sum = 0;\n arr.forEach(function(e, i, a) {\n if (e != null) { \n var diff = arg-e;\n a[i] = null;\n var dix = a.indexOf(diff);\n if (dix !== -1) {\n sum += dix;\n sum += i;\n a[dix] = null;\n } \n }\n });\n return sum;\n}\n\npairwise([1,4,2,3,0,5], 7);\n"
|
||||||
|
],
|
||||||
"challengeType": 5,
|
"challengeType": 5,
|
||||||
"nameCn": "",
|
"nameCn": "",
|
||||||
"descriptionCn": [],
|
"descriptionCn": [],
|
||||||
|
@ -1,55 +1,34 @@
|
|||||||
/* eslint-disable no-process-exit */
|
/* eslint-disable no-process-exit */
|
||||||
require('babel/register');
|
require('babel/register');
|
||||||
require('dotenv').load();
|
require('dotenv').load();
|
||||||
|
|
||||||
var fs = require('fs'),
|
var fs = require('fs'),
|
||||||
|
Rx = require('rx'),
|
||||||
_ = require('lodash'),
|
_ = require('lodash'),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
app = require('../server/server'),
|
app = require('../server/server');
|
||||||
nonprofits = require('./nonprofits.json'),
|
|
||||||
jobs = require('./jobs.json');
|
|
||||||
|
|
||||||
function getFilesFor(dir) {
|
function getFilesFor(dir) {
|
||||||
return fs.readdirSync(path.join(__dirname, '/' + dir));
|
return fs.readdirSync(path.join(__dirname, '/' + dir));
|
||||||
}
|
}
|
||||||
|
|
||||||
var Challenge = app.models.Challenge;
|
var Challenge = app.models.Challenge;
|
||||||
var Nonprofit = app.models.Nonprofit;
|
|
||||||
var Job = app.models.Job;
|
|
||||||
var counter = 0;
|
|
||||||
var challenges = getFilesFor('challenges');
|
var challenges = getFilesFor('challenges');
|
||||||
// plus two accounts for nonprofits and jobs seed.
|
var destroy = Rx.Observable.fromNodeCallback(Challenge.destroyAll, Challenge);
|
||||||
var numberToSave = challenges.length + 1;
|
var create = Rx.Observable.fromNodeCallback(Challenge.create, Challenge);
|
||||||
|
|
||||||
function completionMonitor() {
|
destroy()
|
||||||
// Increment counter
|
.flatMap(function() { return Rx.Observable.from(challenges); })
|
||||||
counter++;
|
.flatMap(function(file) {
|
||||||
|
|
||||||
// Exit if all challenges have been checked
|
|
||||||
if (counter >= numberToSave) {
|
|
||||||
process.exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Log where in the seed order we're currently at
|
|
||||||
console.log('Call: ' + counter + '/' + numberToSave);
|
|
||||||
}
|
|
||||||
|
|
||||||
Challenge.destroyAll(function(err, info) {
|
|
||||||
if (err) {
|
|
||||||
throw err;
|
|
||||||
} else {
|
|
||||||
console.log('Deleted ', info);
|
|
||||||
}
|
|
||||||
challenges.forEach(function(file) {
|
|
||||||
var challengeSpec = require('./challenges/' + file);
|
var challengeSpec = require('./challenges/' + file);
|
||||||
var order = challengeSpec.order;
|
var order = challengeSpec.order;
|
||||||
var block = challengeSpec.name;
|
var block = challengeSpec.name;
|
||||||
var isBeta = !!challengeSpec.isBeta;
|
var isBeta = !!challengeSpec.isBeta;
|
||||||
|
console.log('parsed %s successfully', file);
|
||||||
|
|
||||||
// challenge file has no challenges...
|
// challenge file has no challenges...
|
||||||
if (challengeSpec.challenges.length === 0) {
|
if (challengeSpec.challenges.length === 0) {
|
||||||
console.log('file %s has no challenges', file);
|
return Rx.Observable.just([{ block: 'empty ' + block }]);
|
||||||
completionMonitor();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var challenges = challengeSpec.challenges
|
var challenges = challengeSpec.challenges
|
||||||
@ -68,54 +47,20 @@ Challenge.destroyAll(function(err, info) {
|
|||||||
challenge.suborder = index + 1;
|
challenge.suborder = index + 1;
|
||||||
challenge.block = block;
|
challenge.block = block;
|
||||||
challenge.isBeta = challenge.isBeta || isBeta;
|
challenge.isBeta = challenge.isBeta || isBeta;
|
||||||
|
challenge.time = challengeSpec.time;
|
||||||
|
|
||||||
return challenge;
|
return challenge;
|
||||||
});
|
});
|
||||||
|
|
||||||
Challenge.create(
|
return create(challenges);
|
||||||
challenges,
|
})
|
||||||
function(err) {
|
.subscribe(
|
||||||
if (err) {
|
function(challenges) {
|
||||||
throw err;
|
console.log('%s successfully saved', challenges[0].block);
|
||||||
} else {
|
},
|
||||||
console.log('Successfully parsed %s', file);
|
function(err) { throw err; },
|
||||||
completionMonitor(err);
|
function() {
|
||||||
}
|
console.log('challenge seed completed');
|
||||||
|
process.exit(0);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
Nonprofit.destroyAll(function(err, info) {
|
|
||||||
if (err) {
|
|
||||||
console.error(err);
|
|
||||||
} else {
|
|
||||||
console.log('Deleted ', info);
|
|
||||||
}
|
|
||||||
Nonprofit.create(nonprofits, function(err, data) {
|
|
||||||
if (err) {
|
|
||||||
throw err;
|
|
||||||
} else {
|
|
||||||
console.log('Saved ', data);
|
|
||||||
}
|
|
||||||
completionMonitor(err);
|
|
||||||
console.log('nonprofits');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
Job.destroyAll(function(err, info) {
|
|
||||||
if (err) {
|
|
||||||
throw err;
|
|
||||||
} else {
|
|
||||||
console.log('Deleted ', info);
|
|
||||||
}
|
|
||||||
Job.create(jobs, function(err, data) {
|
|
||||||
if (err) {
|
|
||||||
console.log('error: ', err);
|
|
||||||
} else {
|
|
||||||
console.log('Saved ', data);
|
|
||||||
}
|
|
||||||
console.log('jobs');
|
|
||||||
completionMonitor(err);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
29
seed/nonprofits.js
Normal file
29
seed/nonprofits.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/* eslint-disable no-process-exit */
|
||||||
|
require('babel/register');
|
||||||
|
require('dotenv').load();
|
||||||
|
|
||||||
|
var Rx = require('rx');
|
||||||
|
var app = require('../server/server');
|
||||||
|
|
||||||
|
var Nonprofits = app.models.Nonprofit;
|
||||||
|
var nonprofits = require('./nonprofits.json');
|
||||||
|
var destroy = Rx.Observable.fromNodeCallback(Nonprofits.destroyAll, Nonprofits);
|
||||||
|
var create = Rx.Observable.fromNodeCallback(Nonprofits.create, Nonprofits);
|
||||||
|
|
||||||
|
destroy()
|
||||||
|
.flatMap(function() {
|
||||||
|
if (!nonprofits) {
|
||||||
|
return Rx.Observable.throw(new Error('No nonprofits found'));
|
||||||
|
}
|
||||||
|
return create(nonprofits);
|
||||||
|
})
|
||||||
|
.subscribe(
|
||||||
|
function(nonprofits) {
|
||||||
|
console.log('successfully saved %d nonprofits', nonprofits.length);
|
||||||
|
},
|
||||||
|
function(err) { throw err; },
|
||||||
|
function() {
|
||||||
|
console.log('nonprofit seed completed');
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
);
|
@ -1,6 +1,5 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": "bd7157d8c441cbafaeb5bdef",
|
|
||||||
"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.",
|
"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/",
|
"websiteLink": "http://chasdeikaduri.org/",
|
||||||
"name": "Chasdei Kaduri",
|
"name": "Chasdei Kaduri",
|
||||||
@ -20,7 +19,6 @@
|
|||||||
"moneySaved": 60000
|
"moneySaved": 60000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd7158d8c464cbafaeb4bdef",
|
|
||||||
"whatDoesNonprofitDo": "We connect simple technology with last mile communities to reduce poverty.",
|
"whatDoesNonprofitDo": "We connect simple technology with last mile communities to reduce poverty.",
|
||||||
"websiteLink": "http://kopernik.info/",
|
"websiteLink": "http://kopernik.info/",
|
||||||
"name": "Kopernik",
|
"name": "Kopernik",
|
||||||
@ -36,7 +34,6 @@
|
|||||||
"moneySaved": 20000
|
"moneySaved": 20000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1326d9c245cbafaeb4bdef",
|
|
||||||
"whatDoesNonprofitDo": "We distribute biodegradable toothbrushes globally to children in need.",
|
"whatDoesNonprofitDo": "We distribute biodegradable toothbrushes globally to children in need.",
|
||||||
"websiteLink": "http://www.operationbrush.org/",
|
"websiteLink": "http://www.operationbrush.org/",
|
||||||
"name": "Operation Brush",
|
"name": "Operation Brush",
|
||||||
@ -52,7 +49,6 @@
|
|||||||
"moneySaved": 20000
|
"moneySaved": 20000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c464cbafaeb5bdef",
|
|
||||||
"whatDoesNonprofitDo": "We are the largest roller derby league in the world with around 250 adults and 150 junior skater members plus 500+ volunteers.",
|
"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/",
|
"websiteLink": "http://www.rosecityrollers.com/about/our-charities/",
|
||||||
"name": "Rose City Rollers",
|
"name": "Rose City Rollers",
|
||||||
@ -68,7 +64,6 @@
|
|||||||
"moneySaved": 40000
|
"moneySaved": 40000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c464cbafaeb6bde1",
|
|
||||||
"whatDoesNonprofitDo": "We provide 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/",
|
"websiteLink": "http://www.saveachildsheart.com/global/young-leadership-program/",
|
||||||
"name": "Save a Child's Heart",
|
"name": "Save a Child's Heart",
|
||||||
@ -84,7 +79,6 @@
|
|||||||
"moneySaved": 40000
|
"moneySaved": 40000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1225d8c464cbafaeb4bdef",
|
|
||||||
"whatDoesNonprofitDo": "We empower youth 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/",
|
"websiteLink": "http://savvycyberkids.org/",
|
||||||
"name": "Savvy Cyber Kids",
|
"name": "Savvy Cyber Kids",
|
||||||
@ -100,7 +94,6 @@
|
|||||||
"moneySaved": 40000
|
"moneySaved": 40000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c464cbafaeb7bcef",
|
|
||||||
"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.",
|
"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/",
|
"websiteLink": "http://transcendentpathways.org/",
|
||||||
"name": "Transcendent Pathways",
|
"name": "Transcendent Pathways",
|
||||||
@ -116,7 +109,6 @@
|
|||||||
"moneySaved": 40000
|
"moneySaved": 40000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c464cbafaeb8bdef",
|
|
||||||
"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.",
|
"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/",
|
"websiteLink": "http://www.timeraiser.ca/",
|
||||||
"name": "Timeraiser",
|
"name": "Timeraiser",
|
||||||
@ -132,7 +124,6 @@
|
|||||||
"moneySaved": 40000
|
"moneySaved": 40000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c464cbafaeb7bdef",
|
|
||||||
"whatDoesNonprofitDo": "We focus on raising funds to assist injured homeless animals.",
|
"whatDoesNonprofitDo": "We focus on raising funds to assist injured homeless animals.",
|
||||||
"websiteLink": "http://www.peoplesavinganimals.org/",
|
"websiteLink": "http://www.peoplesavinganimals.org/",
|
||||||
"name": "People Saving Animals",
|
"name": "People Saving Animals",
|
||||||
@ -150,7 +141,6 @@
|
|||||||
"moneySaved": 60000
|
"moneySaved": 60000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c464cbafaeb6bde2",
|
|
||||||
"whatDoesNonprofitDo": "We preserve Florida's health by regulating septic contractors and reviewing logs of sewage collection and disposal.",
|
"whatDoesNonprofitDo": "We preserve Florida's health by regulating septic contractors and reviewing logs of sewage collection and disposal.",
|
||||||
"websiteLink": "http://www.floridahealth.gov/",
|
"websiteLink": "http://www.floridahealth.gov/",
|
||||||
"name": "Florida Department of Health",
|
"name": "Florida Department of Health",
|
||||||
@ -168,7 +158,6 @@
|
|||||||
"moneySaved": 40000
|
"moneySaved": 40000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c464cbafaeb6bde3",
|
|
||||||
"whatDoesNonprofitDo": "We strengthen the value of songwriting and independent music in Columbus, Ohio.",
|
"whatDoesNonprofitDo": "We strengthen the value of songwriting and independent music in Columbus, Ohio.",
|
||||||
"websiteLink": "http://columbussongwritersassociation.com",
|
"websiteLink": "http://columbussongwritersassociation.com",
|
||||||
"name": "Columbus Songwriters Association",
|
"name": "Columbus Songwriters Association",
|
||||||
@ -184,7 +173,6 @@
|
|||||||
"moneySaved": 20000
|
"moneySaved": 20000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c464cbafaeb4bbb",
|
|
||||||
"whatDoesNonprofitDo": "We leverage all the benefits of cycling to support and improve the lives of youth and teens in the Triangle region.",
|
"whatDoesNonprofitDo": "We leverage all the benefits of cycling to support and improve the lives of youth and teens in the Triangle region.",
|
||||||
"websiteLink": "http://www.trianglebikeworks.org",
|
"websiteLink": "http://www.trianglebikeworks.org",
|
||||||
"name": "Triangle Bike Works",
|
"name": "Triangle Bike Works",
|
||||||
@ -200,7 +188,6 @@
|
|||||||
"moneySaved": 0
|
"moneySaved": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c464cbafaeb4bccc",
|
|
||||||
"whatDoesNonprofitDo": "We work to eradicate female genital mutilation in the US and Gambia. We work with survivors and communities.",
|
"whatDoesNonprofitDo": "We work to eradicate female genital mutilation in the US and Gambia. We work with survivors and communities.",
|
||||||
"websiteLink": "http://safehandsforgirls.org/",
|
"websiteLink": "http://safehandsforgirls.org/",
|
||||||
"name": "Safe Hands for Girls",
|
"name": "Safe Hands for Girls",
|
||||||
@ -216,7 +203,6 @@
|
|||||||
"moneySaved": 0
|
"moneySaved": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c464cbafaeb4beff",
|
|
||||||
"whatDoesNonprofitDo": "We're a part of the Department of Psychiatry at Mass General Hospital. We teach an innovative way for helping people that have challenging behaviors.",
|
"whatDoesNonprofitDo": "We're a part of the Department of Psychiatry at Mass General Hospital. We teach an innovative way for helping people that have challenging behaviors.",
|
||||||
"websiteLink": "http://www.thinkkids.org/",
|
"websiteLink": "http://www.thinkkids.org/",
|
||||||
"name": "Think Kids at Massachusetts General Hospital",
|
"name": "Think Kids at Massachusetts General Hospital",
|
||||||
@ -232,7 +218,6 @@
|
|||||||
"moneySaved": 0
|
"moneySaved": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c464cbaeaeb4bdef",
|
|
||||||
"whatDoesNonprofitDo": "We enable, educate, and empower students from rural backgrounds in Uttar Pradesh, India.",
|
"whatDoesNonprofitDo": "We enable, educate, and empower students from rural backgrounds in Uttar Pradesh, India.",
|
||||||
"websiteLink": "http://www.milaan.in/",
|
"websiteLink": "http://www.milaan.in/",
|
||||||
"name": "Milaan",
|
"name": "Milaan",
|
||||||
@ -248,7 +233,6 @@
|
|||||||
"moneySaved": 0
|
"moneySaved": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c464cbafaeb4beee",
|
|
||||||
"whatDoesNonprofitDo": "We're committed to closing the opportunity gap for children in Baltimore City by providing high quality after school and in-school programs.",
|
"whatDoesNonprofitDo": "We're committed to closing the opportunity gap for children in Baltimore City by providing high quality after school and in-school programs.",
|
||||||
"websiteLink": "http://childfirstauthority.org/",
|
"websiteLink": "http://childfirstauthority.org/",
|
||||||
"name": "Child First Authority",
|
"name": "Child First Authority",
|
||||||
@ -264,52 +248,42 @@
|
|||||||
"moneySaved": 0
|
"moneySaved": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c464cbafaeb4bdef",
|
|
||||||
"whatDoesNonprofitDo": "SOLACE Foundation provides drug overdose prevention and awareness training as well as grief support for bereaved families.",
|
"whatDoesNonprofitDo": "SOLACE Foundation provides drug overdose prevention and awareness training as well as grief support for bereaved families.",
|
||||||
"websiteLink": "https://www.facebook.com/www.solaceorangecounty.org",
|
"websiteLink": "https://www.facebook.com/www.solaceorangecounty.org",
|
||||||
"name": "The Solace Foundation of Orange County",
|
"name": "The Solace Foundation of Orange County",
|
||||||
"endUser": "Donors",
|
"endUser": "Donors",
|
||||||
"approvedDeliverables": ["Website"],
|
"approvedDeliverables": [
|
||||||
|
"Website"
|
||||||
|
],
|
||||||
"projectDescription": "Campers will build a basic website that accepts donations.",
|
"projectDescription": "Campers will build a basic website that accepts donations.",
|
||||||
"logoUrl": "http://i.imgur.com/79E3nP0.png",
|
"logoUrl": "http://i.imgur.com/79E3nP0.png",
|
||||||
"imageUrl": "http://i.imgur.com/kCWN1iT.jpg",
|
"imageUrl": "http://i.imgur.com/kCWN1iT.jpg",
|
||||||
"interestedCampers": [],
|
|
||||||
"confirmedCampers": [],
|
|
||||||
"estimatedHours": 100
|
"estimatedHours": 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c463cbafaeb4bdef",
|
|
||||||
"whatDoesNonprofitDo": "We are an interdisciplinary team that works towards harmony among humans and nature through three distinct branches: sustainable agriculture, environmental education and applied and appropriate technology; focused in Líbano, Tolima, Colombia.",
|
"whatDoesNonprofitDo": "We are an interdisciplinary team that works towards harmony among humans and nature through three distinct branches: sustainable agriculture, environmental education and applied and appropriate technology; focused in Líbano, Tolima, Colombia.",
|
||||||
"websiteLink": "string",
|
"websiteLink": "",
|
||||||
"name": "QET America",
|
"name": "QET America",
|
||||||
"endUser": "Donors",
|
"endUser": "Donors",
|
||||||
"approvedDeliverables": ["Website"],
|
"approvedDeliverables": ["Website"],
|
||||||
"projectDescription": "Campers will build a multiple language website (English, Spanish) that accepts donations.",
|
"projectDescription": "Campers will build a multiple language website (English, Spanish) that accepts donations.",
|
||||||
"logoUrl": "http://i.imgur.com/jPuiPOy.jpg",
|
"logoUrl": "http://i.imgur.com/jPuiPOy.jpg",
|
||||||
"imageUrl": "http://i.imgur.com/zaaL2pj.jpg",
|
"imageUrl": "http://i.imgur.com/zaaL2pj.jpg",
|
||||||
"interestedCampers": [],
|
|
||||||
"confirmedCampers": [],
|
|
||||||
"estimatedHours": 100
|
"estimatedHours": 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c462cbafaeb4bdef",
|
|
||||||
"whatDoesNonprofitDo": "1to1 Movement provides free environmental education in schools",
|
"whatDoesNonprofitDo": "1to1 Movement provides free environmental education in schools",
|
||||||
"websiteLink": "http://1to1movement.org/",
|
"websiteLink": "http://1to1movement.org/",
|
||||||
"stakeholderName": "string",
|
|
||||||
"stakeholderEmail": "string",
|
|
||||||
"name": "1 to 1 Movement",
|
"name": "1 to 1 Movement",
|
||||||
"endUser": "Pledgers",
|
"endUser": "Pledgers",
|
||||||
"approvedDeliverables": ["Web App"],
|
"approvedDeliverables": ["Web App"],
|
||||||
"projectDescription": "Campers will build a simple, social, data-driven application that allows people to see the impact of their actions. User can make a pledge and track the outcome. Will make use of the D3.js visualization library.",
|
"projectDescription": "Campers will build a simple, social, data-driven application that allows people to see the impact of their actions. User can make a pledge and track the outcome. Will make use of the D3.js visualization library.",
|
||||||
"logoUrl": "http://i.imgur.com/jaqxg0O.png",
|
"logoUrl": "http://i.imgur.com/jaqxg0O.png",
|
||||||
"imageUrl": "http://i.imgur.com/GXSWTZw.jpg",
|
"imageUrl": "http://i.imgur.com/GXSWTZw.jpg",
|
||||||
"interestedCampers": [],
|
|
||||||
"confirmedCampers": [],
|
|
||||||
"estimatedHours": 300
|
"estimatedHours": 300
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c464cbcfaeb4bdef",
|
|
||||||
"whatDoesNonprofitDo": "Our missions is to elevate the national dialogue and engage the American people around climate change policy and the promotion of real clean energy solutions in the United States.",
|
"whatDoesNonprofitDo": "Our missions is to elevate the national dialogue and engage the American people around climate change policy and the promotion of real clean energy solutions in the United States.",
|
||||||
"websiteLink": "http://www.usclimateplan.org/",
|
"websiteLink": "http://www.usclimateplan.org/",
|
||||||
"name": "US Climate Plan",
|
"name": "US Climate Plan",
|
||||||
@ -318,24 +292,17 @@
|
|||||||
"projectDescription": "Campers will build a basic website for sharing information, feeds from different campaign’s websites.",
|
"projectDescription": "Campers will build a basic website for sharing information, feeds from different campaign’s websites.",
|
||||||
"logoUrl": "http://i.imgur.com/uAyUiMN.png",
|
"logoUrl": "http://i.imgur.com/uAyUiMN.png",
|
||||||
"imageUrl": "http://i.imgur.com/2Og5tqy.jpg",
|
"imageUrl": "http://i.imgur.com/2Og5tqy.jpg",
|
||||||
"interestedCampers": [],
|
|
||||||
"confirmedCampers": [],
|
|
||||||
"estimatedHours": 100
|
"estimatedHours": 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bd1325d8c461cbafaeb4bdef",
|
|
||||||
"whatDoesNonprofitDo": "We empower the community through improved literacy.",
|
"whatDoesNonprofitDo": "We empower the community through improved literacy.",
|
||||||
"websiteLink": "http://www.tleliteracy.com/",
|
"websiteLink": "http://www.tleliteracy.com/",
|
||||||
"stakeholderName": "Darlene Brown",
|
|
||||||
"stakeholderEmail": "string",
|
|
||||||
"name": "The Learning Exchange",
|
"name": "The Learning Exchange",
|
||||||
"endUser": "string",
|
"endUser": "Community members",
|
||||||
"approvedDeliverables": ["Website"],
|
"approvedDeliverables": ["Website"],
|
||||||
"projectDescription": "Campers will build a simple website to replace essentialskillsquebec.com. Site will host many documents related to the Nine Essential Skills.",
|
"projectDescription": "Campers will build a simple website to replace essentialskillsquebec.com. Site will host many documents related to the Nine Essential Skills.",
|
||||||
"logoUrl": "http://i.imgur.com/jXQY01H.png",
|
"logoUrl": "http://i.imgur.com/jXQY01H.png",
|
||||||
"imageUrl": "http://i.imgur.com/iUXBpeL.jpg",
|
"imageUrl": "http://i.imgur.com/iUXBpeL.jpg",
|
||||||
"interestedCampers": [],
|
|
||||||
"confirmedCampers": [],
|
|
||||||
"estimatedHours": 100
|
"estimatedHours": 100
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1,522 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "JSON APIs and Ajax",
|
|
||||||
"order": 0.0065,
|
|
||||||
"challenges": [
|
|
||||||
{
|
|
||||||
"id": "bad87fed1348bd9aeca08826",
|
|
||||||
"title": "Trigger on click Events with jQuery",
|
|
||||||
"description": [
|
|
||||||
"With jQuery we are able to get data from APIs via Ajax",
|
|
||||||
"This data normally comes in the form of JSON",
|
|
||||||
"Let's get the <code>Get Message</code> button to set the text of a div",
|
|
||||||
"We will later use this to display the result of out API request",
|
|
||||||
"<code>$(\"#getMessage\").on(\"click\", function(){</code>",
|
|
||||||
"<code>  $(\".message\").html(\"Here is the message\");</code>",
|
|
||||||
"<code>});</code>"
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
"assert(editor.match(/\\$\\(\\s?\\\"\\#getMessage\\\"\\s?\\)\\.on\\s?\\(\\s?\\\"click\\\"\\,\\s?function\\s?\\(\\)\\s?\\{/gi), 'You should have bound the click event to the getMessage button')",
|
|
||||||
"assert(editor.match(/\\$\\(\\s?\\\"\\.message\\\"\\s?\\)\\.html\\(\\s?\\\"Here\\sis\\sthe\\smessage\\\"\\s?\\);/gi), 'You should set te value of the #message box to be the message given in the description')",
|
|
||||||
"assert(editor.match(/\\}\\);/gi) && editor.match(/\\}\\);/gi).length >= 2, 'Make sure that you close off all of your functions')"
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"fccss",
|
|
||||||
" $(document).ready(function() {",
|
|
||||||
" ",
|
|
||||||
" });",
|
|
||||||
"fcces",
|
|
||||||
"",
|
|
||||||
"<!-- You shouldn't need to modify code below this line -->",
|
|
||||||
"",
|
|
||||||
"<div class=\"container-fluid\">",
|
|
||||||
" <div class = \"row text-center\">",
|
|
||||||
" <h2>Cat Photo Finder</h2>",
|
|
||||||
" </div>",
|
|
||||||
" <br/>",
|
|
||||||
" <div class = \"row text-center\">",
|
|
||||||
" <div class = \"col-xs-12 well Message\">",
|
|
||||||
" The message will go here",
|
|
||||||
" </div>",
|
|
||||||
" </div>",
|
|
||||||
" <br/>",
|
|
||||||
" <div class = \"row text-center\">",
|
|
||||||
" <div class = \"col-xs-12\">",
|
|
||||||
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
|
||||||
" Get Message",
|
|
||||||
" </button>",
|
|
||||||
" </div>",
|
|
||||||
" </div>",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "bad87fee1348bd9aebc08726",
|
|
||||||
"title": "Learn JSON Syntax",
|
|
||||||
"description": [
|
|
||||||
"JSON stands for \"JavaScript Object Notation\". It\"s how you create objects in JavaScript.",
|
|
||||||
"JSON is a series of \"key-value pairs\". Everything on the left of the colon (<code>:</code>) is the \"key\" you use to unlock the \"value\" on the right of the colon."
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
"assert(typeof data != \"undefined\", \"Whoops! It looks like you deleted the <code>data</code> variable!\");",
|
|
||||||
"assert(typeof getAnId != \"undefined\", \"Whoops! It looks like you deleted the <code>getAnId</code> function!\");",
|
|
||||||
"assert(data[0]['id'] === getAnId(), \"The duntion getFirstId should return the id of the first element in the array\");"
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"fccss",
|
|
||||||
"var data = [",
|
|
||||||
" {",
|
|
||||||
" \"id\": 0,",
|
|
||||||
" \"imageLink\": \"http://rs611.pbsrc.com/albums/tt194/allypopper423/Funny-Cat-Green-Avacado.jpg~c200\",",
|
|
||||||
" \"codeNames\": [",
|
|
||||||
" \"Juggernaut\",",
|
|
||||||
" \"Mrs. Wallace\",",
|
|
||||||
" \"Buttercup\"",
|
|
||||||
" ]",
|
|
||||||
" },",
|
|
||||||
" {",
|
|
||||||
" \"id\": 1,",
|
|
||||||
" \"imageLink\": \"http://cdn.grumpycats.com/wp-content/uploads/2012/09/GC-Gravatar-copy.png\",",
|
|
||||||
" \"codeNames\": [",
|
|
||||||
" \"Oscar\",",
|
|
||||||
" \"Scrooge\",",
|
|
||||||
" \"Tyrion\"",
|
|
||||||
" ]",
|
|
||||||
" },",
|
|
||||||
" {",
|
|
||||||
" \"id\": 2,",
|
|
||||||
" \"imageLink\": \"http://www.kittenspet.com/wp-content/uploads/2012/08/cat_with_funny_face_3-200x200.jpg\",",
|
|
||||||
" \"codeNames\": [",
|
|
||||||
" \"The Doctor\",",
|
|
||||||
" \"Loki\",",
|
|
||||||
" \"Joker\"",
|
|
||||||
" ]",
|
|
||||||
" }",
|
|
||||||
"]",
|
|
||||||
"function getAnId(){",
|
|
||||||
" return();",
|
|
||||||
"}",
|
|
||||||
"fcces"
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "bad87fee1348bd9aeca08826",
|
|
||||||
"title": "Displaying JSON data in HTML",
|
|
||||||
"description": [
|
|
||||||
"JSON stands for \"JavaScript Object Notation\". It\"s how you create objects in JavaScript.",
|
|
||||||
"JSON is a series of \"key-value pairs\". Everything on the left of the colon (<code>:</code>) is the \"key\" you use to unlock the \"value\" on the right of the colon."
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"fccss",
|
|
||||||
" $(document).ready(function() {",
|
|
||||||
" $(\"#getMessage\").on(\"click\", function(){",
|
|
||||||
" $(\".message\").html(\"Here is the message\");",
|
|
||||||
" });",
|
|
||||||
" });",
|
|
||||||
"fcces",
|
|
||||||
"",
|
|
||||||
"<!-- You shouldn't need to modify code below this line -->",
|
|
||||||
"",
|
|
||||||
"<div class=\"container-fluid\">",
|
|
||||||
" <div class = \"row text-center\">",
|
|
||||||
" <h2>Cat Photo Finder</h2>",
|
|
||||||
" </div>",
|
|
||||||
" <br/>",
|
|
||||||
" <div class = \"row text-center\">",
|
|
||||||
" <div class = \"col-xs-12 well Message\">",
|
|
||||||
" The message will go here",
|
|
||||||
" </div>",
|
|
||||||
" </div>",
|
|
||||||
" <br/>",
|
|
||||||
" <div class = \"row text-center\">",
|
|
||||||
" <div class = \"col-xs-12\">",
|
|
||||||
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
|
||||||
" Get Message",
|
|
||||||
" </button>",
|
|
||||||
" </div>",
|
|
||||||
" </div>",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "bad84fee1348bd9aecc48826",
|
|
||||||
"title": "Read Data from an Element Using jQuery",
|
|
||||||
"dashedName": "waypoint-read-data-from-an-element-using-jquery",
|
|
||||||
"description": [
|
|
||||||
"Let's make everything roll with <code>rollOut</code>."
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"fccss",
|
|
||||||
" $(document).ready(function() {",
|
|
||||||
" $(\"button\").on(\"click\", function() {",
|
|
||||||
" $(\"#click-me\").addClass(\"animated shake\");",
|
|
||||||
" });",
|
|
||||||
" });",
|
|
||||||
"fcces",
|
|
||||||
"",
|
|
||||||
"<!-- You shouldn't need to modify code below this line -->",
|
|
||||||
"",
|
|
||||||
"<div class=\"container-fluid\">",
|
|
||||||
" <div class=\"row\">",
|
|
||||||
" <div class=\"col-xs-2\">",
|
|
||||||
" <input type=\"checkbox\" id=\"check-me\">",
|
|
||||||
" </div>",
|
|
||||||
" <div class=\"col-xs-10\">",
|
|
||||||
" <p>#check-me</p>",
|
|
||||||
" </div>",
|
|
||||||
" <button class=\"btn btn-block btn-primary\">#click-me</button>",
|
|
||||||
" <span>Is the checkbox checked?</span>",
|
|
||||||
" <span id=\"checked-state\"></span>",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "bad84fee1348bd9aecc38826",
|
|
||||||
"title": "Read Data from an Element Using jQuery",
|
|
||||||
"dashedName": "waypoint-read-data-from-an-element-using-jquery",
|
|
||||||
"description": [
|
|
||||||
"Let's make everything roll with <code>rollOut</code>."
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"fccss",
|
|
||||||
" $(document).ready(function() {",
|
|
||||||
" $(\"button\").on(\"click\", function() {",
|
|
||||||
" $(\"#click-me\").addClass(\"animated shake\");",
|
|
||||||
" $(\"#checked-state\").text(\"happy text\");",
|
|
||||||
" });",
|
|
||||||
" });",
|
|
||||||
"fcces",
|
|
||||||
"",
|
|
||||||
"<!-- You shouldn't need to modify code below this line -->",
|
|
||||||
"",
|
|
||||||
"<div class=\"container-fluid\">",
|
|
||||||
" <div class=\"row\">",
|
|
||||||
" <div class=\"col-xs-2\">",
|
|
||||||
" <input type=\"checkbox\" id=\"check-me\">",
|
|
||||||
" </div>",
|
|
||||||
" <div class=\"col-xs-10\">",
|
|
||||||
" <p>#check-me</p>",
|
|
||||||
" </div>",
|
|
||||||
" <button class=\"btn btn-block btn-primary\">#click-me</button>",
|
|
||||||
" <span>Is the checkbox checked?</span>",
|
|
||||||
" <span id=\"checked-state\"></span>",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "bad84fee1348bd9aecc28826",
|
|
||||||
"title": "Read Data from an Element Using jQuery",
|
|
||||||
"dashedName": "waypoint-read-data-from-an-element-using-jquery",
|
|
||||||
"description": [
|
|
||||||
"Let's make everything roll with <code>rollOut</code>."
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"fccss",
|
|
||||||
" $(document).ready(function() {",
|
|
||||||
" $(\"button\").on(\"click\", function() {",
|
|
||||||
" $(\"#click-me\").addClass(\"animated shake\");",
|
|
||||||
" $(\"#checked-state\").text($(\"#check-me\").prop(\"checked\"));",
|
|
||||||
" });",
|
|
||||||
" });",
|
|
||||||
"fcces",
|
|
||||||
"",
|
|
||||||
"<!-- You shouldn't need to modify code below this line -->",
|
|
||||||
"",
|
|
||||||
"<div class=\"container-fluid\">",
|
|
||||||
" <div class=\"row\">",
|
|
||||||
" <div class=\"col-xs-2\">",
|
|
||||||
" <input type=\"checkbox\" id=\"check-me\">",
|
|
||||||
" </div>",
|
|
||||||
" <div class=\"col-xs-10\">",
|
|
||||||
" <p>#check-me</p>",
|
|
||||||
" </div>",
|
|
||||||
" <button class=\"btn btn-block btn-primary\">#click-me</button>",
|
|
||||||
" <span>Is the checkbox checked?</span>",
|
|
||||||
" <span id=\"checked-state\"></span>",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "bad84fee1348bd9aecc18826",
|
|
||||||
"title": "Read Data from an Element Using jQuery",
|
|
||||||
"dashedName": "waypoint-read-data-from-an-element-using-jquery",
|
|
||||||
"description": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"fccss",
|
|
||||||
" $(document).ready(function() {",
|
|
||||||
" $(\"button\").on(\"click\", function() {",
|
|
||||||
" $(\"#click-me\").addClass(\"animated shake\");",
|
|
||||||
" $(\"#checked-state\").text($(\"#check-me\").prop(\"checked\"));",
|
|
||||||
" });",
|
|
||||||
" });",
|
|
||||||
"fcces",
|
|
||||||
"",
|
|
||||||
"<!-- You shouldn't need to modify code below this line -->",
|
|
||||||
"",
|
|
||||||
"<div class=\"container-fluid\">",
|
|
||||||
" <div class=\"row\">",
|
|
||||||
" <div class=\"col-xs-2\">",
|
|
||||||
" <input type=\"checkbox\" id=\"check-me\">",
|
|
||||||
" </div>",
|
|
||||||
" <div class=\"col-xs-10\">",
|
|
||||||
" <p>#check-me</p>",
|
|
||||||
" </div>",
|
|
||||||
" <button class=\"btn btn-block btn-primary\">#click-me</button>",
|
|
||||||
" <span>Is the checkbox checked?</span>",
|
|
||||||
" <span id=\"checked-state\"></span>",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "bad87fee1348bd9aecc08826",
|
|
||||||
"title": "Trigger onHover Events with jQuery",
|
|
||||||
"dashedName": "waypoint-trigger-onhover-events-with-jquery",
|
|
||||||
"description": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "bad87fee1348bd9aebc08826",
|
|
||||||
"title": "Get Data from an URL Using jQuery",
|
|
||||||
"dashedName": "waypoint-get-data-from-a-url-using-jquery",
|
|
||||||
"description": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"fccss",
|
|
||||||
"",
|
|
||||||
" $(document).ready(function() {",
|
|
||||||
"",
|
|
||||||
" $(\"#cat-button\").on(\"click\", function() {",
|
|
||||||
" $.getJSON(\"/json/cats.json\", function( json ) {",
|
|
||||||
"",
|
|
||||||
" });",
|
|
||||||
" });",
|
|
||||||
"",
|
|
||||||
" });",
|
|
||||||
"fcces",
|
|
||||||
"<div class=\"container-fluid\">",
|
|
||||||
" <button id=\"cat-button\" class=\"btn btn-primary btn-block btn-lg\">#cat-button</button>",
|
|
||||||
" <div class=\"jumbotron\" id=\"output\">",
|
|
||||||
" </div>",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "bad87fee1348bd9ae9c08826",
|
|
||||||
"title": "Loop through JSON Data Using jQuery",
|
|
||||||
"dashedName": "waypoint-loop-through-json-data-using-jquery",
|
|
||||||
"description": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"fccss",
|
|
||||||
"",
|
|
||||||
" $(document).ready(function() {",
|
|
||||||
"",
|
|
||||||
" $(\"#cat-button\").on(\"click\", function() {",
|
|
||||||
" $.getJSON(\"/json/cats.json\", function( json ) {",
|
|
||||||
"",
|
|
||||||
" });",
|
|
||||||
" });",
|
|
||||||
"",
|
|
||||||
" });",
|
|
||||||
"fcces",
|
|
||||||
"<div class=\"container-fluid\">",
|
|
||||||
" <button id=\"cat-button\" class=\"btn btn-primary btn-block btn-lg\">#cat-button</button>",
|
|
||||||
" <div class=\"jumbotron\" id=\"output\">",
|
|
||||||
" </div>",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "bad88fee1348bd9ae8c08726",
|
|
||||||
"title": "Wire AJAX Call into a jQuery Click Event",
|
|
||||||
"dashedName": "waypoint-wire-ajax-call-into-a-jquery-click-event",
|
|
||||||
"description": [
|
|
||||||
"<img src=\"https://www.evernote.com/l/AjmAQ5BxGrFGRrWl_j2eSpGZMfrunfse89gB/image.png\">"
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"fccss",
|
|
||||||
" var random = function() { return Math.floor(Math.random() * 3) }",
|
|
||||||
" $(document).ready(function() {",
|
|
||||||
"",
|
|
||||||
" $(\"#cat-button\").on(\"click\", function() {",
|
|
||||||
" $.getJSON(\"/json/cats.json\", function( json ) {",
|
|
||||||
"",
|
|
||||||
" });",
|
|
||||||
" });",
|
|
||||||
"",
|
|
||||||
" });",
|
|
||||||
"fcces",
|
|
||||||
"<div class=\"container-fluid\">",
|
|
||||||
" <button id=\"cat-button\" class=\"btn btn-primary btn-block btn-lg\">#cat-button</button>",
|
|
||||||
" <div class=\"jumbotron\" id=\"output\">",
|
|
||||||
" </div>",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "bad88fee1348bd9ae8c08626",
|
|
||||||
"title": "Wire AJAX Call into a jQuery Click Event",
|
|
||||||
"dashedName": "waypoint-wire-ajax-call-into-a-jquery-click-event",
|
|
||||||
"description": [
|
|
||||||
"<img src=\"https://www.evernote.com/l/AjmAQ5BxGrFGRrWl_j2eSpGZMfrunfse89gB/image.png\">"
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"fccss",
|
|
||||||
" var random = function() { return Math.floor(Math.random() * 3) }",
|
|
||||||
" $(document).ready(function() {",
|
|
||||||
"",
|
|
||||||
" $(\"#cat-button\").on(\"click\", function() {",
|
|
||||||
" $.getJSON(\"/json/cats.json\", function( json ) {",
|
|
||||||
" var kitten = json[random()];",
|
|
||||||
" });",
|
|
||||||
" });",
|
|
||||||
"",
|
|
||||||
" });",
|
|
||||||
"fcces",
|
|
||||||
"<div class=\"container-fluid\">",
|
|
||||||
" <button id=\"cat-button\" class=\"btn btn-primary btn-block btn-lg\">#cat-button</button>",
|
|
||||||
" <div class=\"jumbotron\" id=\"output\">",
|
|
||||||
" </div>",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "bad88fee1348bd9ae8c08526",
|
|
||||||
"title": "Wire AJAX Call into a jQuery Click Event",
|
|
||||||
"dashedName": "waypoint-wire-ajax-call-into-a-jquery-click-event",
|
|
||||||
"description": [
|
|
||||||
"<img src=\"https://www.evernote.com/l/AjmAQ5BxGrFGRrWl_j2eSpGZMfrunfse89gB/image.png\">"
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"fccss",
|
|
||||||
" var random = function() { return Math.floor(Math.random() * 3) }",
|
|
||||||
" $(document).ready(function() {",
|
|
||||||
"",
|
|
||||||
" $(\"#cat-button\").on(\"click\", function() {",
|
|
||||||
" $.getJSON(\"/json/cats.json\", function( json ) {",
|
|
||||||
" var kitten = json[random()];",
|
|
||||||
" $(\"<img src=\"\" + kitten.imageLink + \"\">\").appendTo(\"#output\");",
|
|
||||||
" });",
|
|
||||||
" });",
|
|
||||||
"",
|
|
||||||
" });",
|
|
||||||
"<div class=\"container-fluid\">",
|
|
||||||
" <button id=\"cat-button\" class=\"btn btn-primary btn-block btn-lg\">#cat-button</button>",
|
|
||||||
" <div class=\"jumbotron\" id=\"output\">",
|
|
||||||
" </div>",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "bad88fee1348bd9ae8c08426",
|
|
||||||
"title": "Wire AJAX Call into a jQuery Click Event",
|
|
||||||
"dashedName": "waypoint-wire-ajax-call-into-a-jquery-click-event",
|
|
||||||
"description": [
|
|
||||||
"<img src=\"https://www.evernote.com/l/AjmAQ5BxGrFGRrWl_j2eSpGZMfrunfse89gB/image.png\">"
|
|
||||||
],
|
|
||||||
"tests": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"challengeSeed": [
|
|
||||||
"fccss",
|
|
||||||
" var random = function() { return Math.floor(Math.random() * 3) }",
|
|
||||||
" $(document).ready(function() {",
|
|
||||||
"",
|
|
||||||
" $(\"#cat-button\").on(\"click\", function() {",
|
|
||||||
" $.getJSON(\"/json/cats.json\", function( json ) {",
|
|
||||||
" var kitten = json[random()];",
|
|
||||||
" $(\"<img src=\"\" + kitten.imageLink + \"\">\").appendTo(\"#output\");",
|
|
||||||
" $(\"<h3>Code name: \" + kitten.codeNames[random()] + \"</h3>\").appendTo(\"#output\");",
|
|
||||||
" });",
|
|
||||||
" });",
|
|
||||||
"",
|
|
||||||
" });",
|
|
||||||
"fcces",
|
|
||||||
"<div class=\"container-fluid\">",
|
|
||||||
" <button id=\"cat-button\" class=\"btn btn-primary btn-block btn-lg\">#cat-button</button>",
|
|
||||||
" <div class=\"jumbotron\" id=\"output\">",
|
|
||||||
" </div>",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"challengeType": 0,
|
|
||||||
"type": "waypoint"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -72,9 +72,9 @@ module.exports = function(app) {
|
|||||||
'Feel free to email us at this address if you have ',
|
'Feel free to email us at this address if you have ',
|
||||||
'any questions about Free Code Camp.\n',
|
'any questions about Free Code Camp.\n',
|
||||||
'And if you have a moment, check out our blog: ',
|
'And if you have a moment, check out our blog: ',
|
||||||
'blog.freecodecamp.com.\n\n',
|
'medium.freecodecamp.com.\n\n',
|
||||||
'Good luck with the challenges!\n\n',
|
'Good luck with the challenges!\n\n',
|
||||||
'- the Free Code Camp Volunteer Team'
|
'- the Free Code Camp Team'
|
||||||
].join('')
|
].join('')
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,7 +31,11 @@ function isCertified(frontEndIds, { completedChallenges, isFrontEndCert }) {
|
|||||||
if (isFrontEndCert) {
|
if (isFrontEndCert) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return _.every(frontEndIds, ({ id }) => _.some(completedChallenges, { id }));
|
return _.every(frontEndIds, ({ id }) => {
|
||||||
|
return _.some(completedChallenges, (challenge) => {
|
||||||
|
return challenge.id === id || challenge._id === id;
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function certificate(app) {
|
export default function certificate(app) {
|
||||||
@ -145,8 +149,8 @@ export default function certificate(app) {
|
|||||||
}
|
}
|
||||||
return res.status(200).send(
|
return res.status(200).send(
|
||||||
dedent`
|
dedent`
|
||||||
Looks like you have not completed the neccessary steps,
|
Looks like you have not completed the neccessary steps.
|
||||||
Please return the map
|
Please return to the challenge map.
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -49,12 +49,12 @@ function updateUserProgress(user, challengeId, completedChallenge) {
|
|||||||
let { completedChallenges } = user;
|
let { completedChallenges } = user;
|
||||||
|
|
||||||
// migrate user challenges object to remove
|
// migrate user challenges object to remove
|
||||||
if (!user.isUniqMigrated) {
|
/* if (!user.isUniqMigrated) {
|
||||||
user.isUniqMigrated = true;
|
user.isUniqMigrated = true;
|
||||||
|
|
||||||
completedChallenges = user.completedChallenges =
|
completedChallenges = user.completedChallenges =
|
||||||
makeChallengesUnique(completedChallenges);
|
makeChallengesUnique(completedChallenges);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
const indexOfChallenge = _.findIndex(completedChallenges, {
|
const indexOfChallenge = _.findIndex(completedChallenges, {
|
||||||
id: challengeId
|
id: challengeId
|
||||||
@ -186,7 +186,7 @@ module.exports = function(app) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
const firstChallengeOfNextBlock$ = blocks$
|
const firstChallengeOfNextBlock$ = blocks$
|
||||||
.elementAtOrDefault(blockIndex + 1, {})
|
.elementAt(blockIndex + 1, {})
|
||||||
.map(({ challenges = [] }) => challenges[0]);
|
.map(({ challenges = [] }) => challenges[0]);
|
||||||
|
|
||||||
return blocks$
|
return blocks$
|
||||||
@ -259,7 +259,7 @@ module.exports = function(app) {
|
|||||||
.filter((challenge) => {
|
.filter((challenge) => {
|
||||||
return testChallengeName.test(challenge.name);
|
return testChallengeName.test(challenge.name);
|
||||||
})
|
})
|
||||||
.lastOrDefault(null)
|
.last({ defaultValue: null })
|
||||||
.flatMap(challenge => {
|
.flatMap(challenge => {
|
||||||
|
|
||||||
// Handle not found
|
// Handle not found
|
||||||
@ -555,7 +555,8 @@ module.exports = function(app) {
|
|||||||
name: blockArray[0].block,
|
name: blockArray[0].block,
|
||||||
dashedName: dasherize(blockArray[0].block),
|
dashedName: dasherize(blockArray[0].block),
|
||||||
challenges: blockArray,
|
challenges: blockArray,
|
||||||
completed: completedCount / blockArray.length * 100
|
completed: completedCount / blockArray.length * 100,
|
||||||
|
time: blockArray[0] && blockArray[0].time || "???"
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter(({ name }) => name !== 'Hikes')
|
.filter(({ name }) => name !== 'Hikes')
|
||||||
|
@ -158,11 +158,11 @@ export default function commit(app) {
|
|||||||
return saveInstance(pledge);
|
return saveInstance(pledge);
|
||||||
})
|
})
|
||||||
.subscribe(
|
.subscribe(
|
||||||
({ nonprofit, goal, amount }) => {
|
({ displayName, goal, amount }) => {
|
||||||
req.flash('success', {
|
req.flash('success', {
|
||||||
msg: dedent`
|
msg: dedent`
|
||||||
Congratulations, you have committed to giving
|
Congratulations, you have committed to giving
|
||||||
${nonprofit} $${amount} each month until you have completed
|
${displayName} $${amount} each month until you have completed
|
||||||
your ${goal}.
|
your ${goal}.
|
||||||
`
|
`
|
||||||
});
|
});
|
||||||
|
@ -64,23 +64,6 @@ module.exports = function(app) {
|
|||||||
return res.redirect('../nonprofit/' + dashedNameFull);
|
return res.redirect('../nonprofit/' + dashedNameFull);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need to create logic that verifies completion.
|
|
||||||
// Defaulting to false for now.
|
|
||||||
// var buttonActive = false;
|
|
||||||
// if (
|
|
||||||
// req.user &&
|
|
||||||
// req.user.completedCoursewares.length > 63
|
|
||||||
// ) {
|
|
||||||
// var hasShownInterest =
|
|
||||||
// nonprofit.interestedCampers.filter(function(user) {
|
|
||||||
// return user.username === req.user.username;
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// if (hasShownInterest.length === 0) {
|
|
||||||
// buttonActive = true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
res.render('nonprofits/show', {
|
res.render('nonprofits/show', {
|
||||||
dashedName: dashedNameFull,
|
dashedName: dashedNameFull,
|
||||||
title: nonprofit.name,
|
title: nonprofit.name,
|
||||||
|
@ -29,7 +29,6 @@ module.exports = function(app) {
|
|||||||
router.get('/nonprofits', nonprofits);
|
router.get('/nonprofits', nonprofits);
|
||||||
router.get('/nonprofits-form', nonprofitsForm);
|
router.get('/nonprofits-form', nonprofitsForm);
|
||||||
router.get('/our-sponsors', sponsors);
|
router.get('/our-sponsors', sponsors);
|
||||||
router.get('/jobs-form', jobsForm);
|
|
||||||
router.get('/unsubscribe/:email', unsubscribe);
|
router.get('/unsubscribe/:email', unsubscribe);
|
||||||
router.get('/unsubscribed', unsubscribed);
|
router.get('/unsubscribed', unsubscribed);
|
||||||
router.get('/get-started', getStarted);
|
router.get('/get-started', getStarted);
|
||||||
@ -208,13 +207,6 @@ module.exports = function(app) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function jobsForm(req, res) {
|
|
||||||
res.render('resources/jobs-form', {
|
|
||||||
title: 'Employer Partnership Form for Job Postings,' +
|
|
||||||
' Recruitment and Corporate Sponsorships'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function sponsors(req, res) {
|
function sponsors(req, res) {
|
||||||
res.render('sponsors/sponsors', {
|
res.render('sponsors/sponsors', {
|
||||||
title: 'The Sponsors who make Free Code Camp Possible'
|
title: 'The Sponsors who make Free Code Camp Possible'
|
||||||
|
@ -12,13 +12,18 @@ var Rx = require('rx'),
|
|||||||
validator = require('validator'),
|
validator = require('validator'),
|
||||||
secrets = require('../../config/secrets');
|
secrets = require('../../config/secrets');
|
||||||
|
|
||||||
var foundationDate = 1413298800000;
|
import {
|
||||||
var time48Hours = 172800000;
|
ifNoUser401,
|
||||||
|
ifNoUserRedirectTo
|
||||||
|
} from '../utils/middleware';
|
||||||
|
|
||||||
var unDasherize = utils.unDasherize;
|
const foundationDate = 1413298800000;
|
||||||
var dasherize = utils.dasherize;
|
const time48Hours = 172800000;
|
||||||
var getURLTitle = utils.getURLTitle;
|
|
||||||
var ifNoUser401 = require('../utils/middleware').ifNoUser401;
|
const unDasherize = utils.unDasherize;
|
||||||
|
const dasherize = utils.dasherize;
|
||||||
|
const getURLTitle = utils.getURLTitle;
|
||||||
|
const sendNonUserToNews = ifNoUserRedirectTo('/news');
|
||||||
|
|
||||||
function hotRank(timeValue, rank) {
|
function hotRank(timeValue, rank) {
|
||||||
/*
|
/*
|
||||||
@ -62,8 +67,16 @@ module.exports = function(app) {
|
|||||||
|
|
||||||
router.get('/news/hot', hotJSON);
|
router.get('/news/hot', hotJSON);
|
||||||
router.get('/stories/hotStories', hotJSON);
|
router.get('/stories/hotStories', hotJSON);
|
||||||
router.get('/stories/submit', submitNew);
|
router.get(
|
||||||
router.get('/stories/submit/new-story', preSubmit);
|
'/stories/submit',
|
||||||
|
sendNonUserToNews,
|
||||||
|
submitNew
|
||||||
|
);
|
||||||
|
router.get(
|
||||||
|
'/stories/submit/new-story',
|
||||||
|
sendNonUserToNews,
|
||||||
|
preSubmit
|
||||||
|
);
|
||||||
router.post('/stories/preliminary', ifNoUser401, newStory);
|
router.post('/stories/preliminary', ifNoUser401, newStory);
|
||||||
router.post('/stories/', ifNoUser401, storySubmission);
|
router.post('/stories/', ifNoUser401, storySubmission);
|
||||||
router.get('/news/', hot);
|
router.get('/news/', hot);
|
||||||
@ -102,17 +115,25 @@ module.exports = function(app) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function submitNew(req, res) {
|
function submitNew(req, res) {
|
||||||
|
if (!req.user.isGithubCool) {
|
||||||
|
req.flash('errors', {
|
||||||
|
msg: 'You must link GitHub with your account before you can post' +
|
||||||
|
' on Camper News.'
|
||||||
|
});
|
||||||
|
return res.redirect('/news');
|
||||||
|
}
|
||||||
|
|
||||||
return res.render('stories/index', {
|
return res.render('stories/index', {
|
||||||
title: 'Submit a new story to Camper News',
|
title: 'Submit a new story to Camper News',
|
||||||
page: 'submit'
|
page: 'submit'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function preSubmit(req, res, next) {
|
function preSubmit(req, res) {
|
||||||
var data = req.query;
|
var data = req.query;
|
||||||
if (typeof data.url !== 'string') {
|
if (typeof data.url !== 'string') {
|
||||||
req.flash('errors', { msg: 'No URL supplied with story' });
|
req.flash('errors', { msg: 'No URL supplied with story' });
|
||||||
return next(new TypeError('No URL supplied with story'));
|
return res.redirect('/news');
|
||||||
}
|
}
|
||||||
var cleanedData = cleanData(data.url);
|
var cleanedData = cleanData(data.url);
|
||||||
|
|
||||||
@ -264,8 +285,11 @@ module.exports = function(app) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function newStory(req, res, next) {
|
function newStory(req, res, next) {
|
||||||
if (!req.user) {
|
if (!req.user.isGithubCool) {
|
||||||
return next(new Error('Must be logged in'));
|
req.flash('errors', {
|
||||||
|
msg: 'You must authenticate with Github to post to Camper News'
|
||||||
|
});
|
||||||
|
return res.redirect('/news');
|
||||||
}
|
}
|
||||||
var url = req.body.data.url;
|
var url = req.body.data.url;
|
||||||
|
|
||||||
|
@ -272,8 +272,10 @@ module.exports = function(app) {
|
|||||||
return Observable.just(user);
|
return Observable.just(user);
|
||||||
}
|
}
|
||||||
return findUserByUsername$(username, {
|
return findUserByUsername$(username, {
|
||||||
|
isGithubCool: true,
|
||||||
isFrontEndCert: true,
|
isFrontEndCert: true,
|
||||||
isFullStackCert: true,
|
isFullStackCert: true,
|
||||||
|
isHonest: true,
|
||||||
completedChallenges: true,
|
completedChallenges: true,
|
||||||
username: true,
|
username: true,
|
||||||
name: true
|
name: true
|
||||||
@ -319,11 +321,12 @@ module.exports = function(app) {
|
|||||||
showFront && user.isFrontEndCert ||
|
showFront && user.isFrontEndCert ||
|
||||||
!showFront && user.isFullStackCert
|
!showFront && user.isFullStackCert
|
||||||
) {
|
) {
|
||||||
var { completedDate } = _.find(user.completedChallenges, {
|
var { completedDate = new Date() } =
|
||||||
|
_.find(user.completedChallenges, {
|
||||||
id: showFront ?
|
id: showFront ?
|
||||||
frontEndChallangeId :
|
frontEndChallangeId :
|
||||||
fullStackChallangeId
|
fullStackChallangeId
|
||||||
});
|
}) || {};
|
||||||
|
|
||||||
return res.render(
|
return res.render(
|
||||||
showFront ?
|
showFront ?
|
||||||
@ -342,7 +345,7 @@ module.exports = function(app) {
|
|||||||
`Looks like user ${username} is not Front End certified` :
|
`Looks like user ${username} is not Front End certified` :
|
||||||
`Looks like user ${username} is not Full Stack certified`
|
`Looks like user ${username} is not Full Stack certified`
|
||||||
});
|
});
|
||||||
res.redirect('/map');
|
res.redirect('back');
|
||||||
},
|
},
|
||||||
next
|
next
|
||||||
);
|
);
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
"initial": {
|
"initial": {
|
||||||
"compression": {},
|
"compression": {},
|
||||||
"morgan": {
|
"morgan": {
|
||||||
"params": "dev"
|
"params": ":status :method :response-time ms - :url"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"session": {
|
"session": {
|
||||||
|
@ -55,6 +55,7 @@ export default function csp() {
|
|||||||
return helmet.csp({
|
return helmet.csp({
|
||||||
defaultSrc: trusted,
|
defaultSrc: trusted,
|
||||||
scriptSrc: [
|
scriptSrc: [
|
||||||
|
'https://*.gitter.im',
|
||||||
'*.optimizely.com',
|
'*.optimizely.com',
|
||||||
'*.aspnetcdn.com',
|
'*.aspnetcdn.com',
|
||||||
'*.d3js.org',
|
'*.d3js.org',
|
||||||
@ -72,7 +73,8 @@ export default function csp() {
|
|||||||
imgSrc: [
|
imgSrc: [
|
||||||
// allow all input since we have user submitted images for
|
// allow all input since we have user submitted images for
|
||||||
// public profile
|
// public profile
|
||||||
'*'
|
'*',
|
||||||
|
'data:'
|
||||||
].concat(trusted),
|
].concat(trusted),
|
||||||
fontSrc: [
|
fontSrc: [
|
||||||
'*.googleapis.com',
|
'*.googleapis.com',
|
||||||
|
@ -1,4 +1,18 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"camper": "Meta Hirschl",
|
||||||
|
"quote": "By building a robust and highly functional web app I was able to not only increase my confidence but was able to show potential employers what I was able to create. Both were huge for me and led me to getting a fantastic job.",
|
||||||
|
"github": "MetaCoderHirschl",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=ADEAAAKX2fEBfeZ1GVdOh-c0zzkYZKw38o8qzow&authType=NAME_SEARCH&authToken=hfRS&locale=en_US&srchid=147930701444634954491&srchindex=1&srchtotal=1&trk=vsrp_people_res_photo&trkInfo=VSRPsearchId%3A147930701444634954491%2CVSRPtargetId%3A43506161%2CVSRPcmpt%3Aprimary%2CVSRPnm%3Atrue%2CauthType%3ANAME_SEARCH",
|
||||||
|
"image": "https://media.licdn.com/media/p/6/005/0ac/31c/05f0e58.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"camper": "Branden Byers",
|
||||||
|
"quote": "My goal was to become employed by the end of 2015. Instead, I ended up with a job at the beginning of 2015. This was directly related to my work at Free Code Camp.",
|
||||||
|
"github": "brandenbyers",
|
||||||
|
"linkedin": "https://www.linkedin.com/in/brandenbyers",
|
||||||
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/4/005/0a0/1e4/378908c.jpg"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"camper": "Bruna Torman Reseres Franasa",
|
"camper": "Bruna Torman Reseres Franasa",
|
||||||
"quote": "I’m now receiving offers for internships. I have no experience in IT, but now good things are happening!",
|
"quote": "I’m now receiving offers for internships. I have no experience in IT, but now good things are happening!",
|
||||||
@ -7,11 +21,88 @@
|
|||||||
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/8/005/09e/16e/32c3d3f.jpg"
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/8/005/09e/16e/32c3d3f.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"camper": "Branden Byers",
|
"camper": "Maxim Orlov",
|
||||||
"quote": "Could I have gotten a job without Free Code Camp? Eventually, sure. But Free Code Camp provided a far denser experience than in my roughly 24 previous years of dabbling in tech.",
|
"quote": "I started Free Code Camp with zero knowledge of web development. 6 months later, I landed my first job as a back end engineer.",
|
||||||
"github": "brandenbyers",
|
"github": "Maximization",
|
||||||
"linkedin": "https://www.linkedin.com/in/brandenbyers",
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAo83nwBF57LpD9mZlm5dH6OcovOpYKPs3k&authType=NAME_SEARCH&authToken=yG4h&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A171761276%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1444635014777%2Ctas%3AMaxim%20Orlov",
|
||||||
"image": "https://pbs.twimg.com/profile_images/539515557184167936/JqJXzV9x.jpeg"
|
"image": "https://media.licdn.com/media/AAEAAQAAAAAAAALJAAAAJGI5ZGFhODA0LWI4MzAtNDU5Ny04NjU3LTIwMjdhMmIxYjFjNg.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"camper": "Alexander Black, Jr.",
|
||||||
|
"quote": "My work on a nonprofit project gave me the opportunity to learn how to build Chrome extensions and showcase my skills as a full-stack developer.",
|
||||||
|
"github": "alexblackjr",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAA553L4BgfgBR-M9RQc7x5matd6FUx3a6-I&authType=NAME_SEARCH&authToken=TW_a&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A242867390%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1444634592237%2Ctas%3Aalexander%20black%20jr",
|
||||||
|
"image": "https://media.licdn.com/media/AAEAAQAAAAAAAANmAAAAJDQ1ZWIxMmVjLTAwNjUtNDFlNS04OWVhLTk4ZGZkNmViODkxNw.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"camper": "Cristiane Henriques",
|
||||||
|
"quote": "I am getting more work contacts after including Free Code Camp on my CV and my LinkedIn.",
|
||||||
|
"github": "CrisHenriques",
|
||||||
|
"linkedin": "https://www.linkedin.com/in/crishenriques",
|
||||||
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAKEAAAAJGFjMTBjZWY5LTE2ZWMtNGU2OC05MTk3LTdkZjUyYWI1NjA5NQ.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"camper": "Viktor Bakurin",
|
||||||
|
"quote": "During my work on Free Code Camp's nonprofit projects, I found a MEAN stack position outside of my home country. Now I work in Budapest.",
|
||||||
|
"github": "letalumil",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAq6G3QBA1DIwFZGrS4DGqDzBDTzFjrbNQo&authType=NAME_SEARCH&authToken=QoJ0&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A179968884%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1444635040141%2Ctas%3AViktor%20Bakurin",
|
||||||
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAM3AAAAJDVkZThkNjk3LWY4MTgtNGNmMS05MTZkLTkxZDljOGEzMGM5Nw.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"camper": "Ashley Drake",
|
||||||
|
"quote": "Free Code Camp helped me get my first engineering job. This amazing community made my career switch a lot easier and more fun.",
|
||||||
|
"github": "aldraco",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAABcdBycB1iVHvcW7N3yVK-18ES7Nrxx2jbE&authType=NAME_SEARCH&authToken=gKNN&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A387778343%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1444635725853%2Ctas%3Aashley%20",
|
||||||
|
"image": "http://i.imgur.com/xzDoJef.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"camper": "Brian Grant",
|
||||||
|
"quote": "I've received new employment opportunities and I have not even finished Free Code Camp's first 800 hours of training yet.",
|
||||||
|
"github": "codeseekingman",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAEUqXoBFOq1SWQrBsTMHG4ij9Ss4Qqnrtg&authType=NAME_SEARCH&authToken=a85-&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A18131322%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1444635878707%2Ctas%3Abrian%20grant",
|
||||||
|
"image": "https://media.licdn.com/media/AAEAAQAAAAAAAANEAAAAJGY5ZjZkMDVjLTJhY2EtNDZjYS1iMDk5LTY0ZDliN2EyODUxMQ.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"camper": "Thomas Joseph Izen",
|
||||||
|
"quote": "After spending lots of time trying different sites that aim to teach people how to code, FreeCodeCamp has been different from the beginning. They provide the best and most organized track for anyone at any level to learn how to code and build an amazing, marketable portfolio.",
|
||||||
|
"github": "TommyIzen",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAA79qIYB_RHmvOP59S6VPK3Lm06oG8fM6dw&authType=NAME_SEARCH&authToken=PfeR&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A251504774%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1444636112016%2Ctas%3AThomas%20%20Izen",
|
||||||
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAMaAAAAJGRjZTQ4MTdmLTZmZGItNGFhNS1hNTE0LWJmYjFhZDY3YmM3MQ.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"camper": "Lori Becker",
|
||||||
|
"quote": "After graduating with a Masters degree in computer science, I could not share any of my code with employers (university policy: fear of aiding cheating). With FreeCodeCamp, I was able to develop a small portfolio.",
|
||||||
|
"github": "LCBecker",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAADrtuwBOA_0ihkKIbUFXoXskXikQT9uVeo&authType=NAME_SEARCH&authToken=sctO&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A15447788%2CauthType%3ANAME_SEARCH%2Cidx%3A1-2-2%2CtarId%3A1441907195702%2Ctas%3Alori",
|
||||||
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/1/005/080/392/295a574.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"camper": "Robert Trammel",
|
||||||
|
"quote": "I'm working a job integrating JavaScript into FileMaker and doing some custom web publishing for a school district. I've also have job offers from Apple and a few technology firms around the country. If it wasn't for Free Code Camp, I'd still be in the dark with some really awesome but irrelevant skills.",
|
||||||
|
"github": "comajama",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAIAABQsM30BEAI6xyAhk-OqbBNUJL0WD2uA3GE&authType=NAME_SEARCH&authToken=4xB-&trk=Skyline_click_NPS&sl=NPS%3B147930701444636308659%3B1%3B147930701444636308659%3B",
|
||||||
|
"image": "https://media.licdn.com/media/AAEAAQAAAAAAAAIBAAAAJDI5YjRmMTRmLTFjNWItNGQ5ZC05MTNjLTA0MWQ0YjRhOTdhNQ.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"camper": "Brian Atkins",
|
||||||
|
"quote": "I'm spending less time then I am used to on Free Code Camp because people have begun to hire me to work on their projects. Free Code Camp has provided me the foundation I have needed to get these jobs.",
|
||||||
|
"github": "BrianAtk",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAABtTx0BmDzmB7eDGOkAJbRw8RZdvysreso&authType=NAME_SEARCH&authToken=CecH&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A7163677%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1444636556530%2Ctas%3ABrian%20Atkins",
|
||||||
|
"image": "https://media.licdn.com/media/p/8/000/2aa/36c/2d218a8.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"camper": "Andrea Goulet",
|
||||||
|
"quote": "Before enrolling in Free Code Camp, I was nervous when people asked me, \"Do you code?\", Now, I answer with a confident \"YES!\"",
|
||||||
|
"github": "andreagoulet",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAA4KWYB-mCMwEU3LvDHXt6H0rVHbBvszq0&authType=NAME_SEARCH&authToken=hUBG&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A3680614%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907386771%2Ctas%3Aandrea%20go",
|
||||||
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAMyAAAAJDI1MWU4OWU4LTZmNTAtNGFmMS1iYzcxLTA5Y2IwYzIyMWIxYQ.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"camper": "David McGill",
|
||||||
|
"quote": "Even if you have a CS degree like I do, you still need projects to prove to employers that you care about coding. Free Code Camp provided me with a platform for doing this. It's all laid out for you - you just have step up and step into the map!",
|
||||||
|
"github": "dmcgill50",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAEBy74BHsJCpgrbohr2dJxbdXuvMuJDx6k&authType=NAME_SEARCH&authToken=9k8t&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A16894910%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1444637012056%2Ctas%3ADavid%20McGill",
|
||||||
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAANdAAAAJGE4YWI5NjFiLTQ5MzUtNGQwNC04YThiLWYxMTI4NWM3YmFlMQ.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"camper": "Qing Huang",
|
"camper": "Qing Huang",
|
||||||
@ -28,11 +119,18 @@
|
|||||||
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/5/000/268/01a/0492529.jpg"
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/5/000/268/01a/0492529.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"camper": "Lori Becker",
|
"camper": "Jonathan Lucas",
|
||||||
"quote": "After graduating with a Masters degree in computer science, I could not share any of my code with employers (university policy: fear of aiding cheating). With FreeCodeCamp, I was able to develop a small portfolio.",
|
"quote": "Free Code Camp has been nothing but supportive and helpful, taking me from a rather basic knowledge of front end technologies to a better, more complete understanding from a full stack perspective.",
|
||||||
"github": "LCBecker",
|
"github": "jonslucas",
|
||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAADrtuwBOA_0ihkKIbUFXoXskXikQT9uVeo&authType=NAME_SEARCH&authToken=sctO&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A15447788%2CauthType%3ANAME_SEARCH%2Cidx%3A1-2-2%2CtarId%3A1441907195702%2Ctas%3Alori",
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAATn9H4BI7BP7MBpZ0NR1EvldkWTvAdGy2w&authType=NAME_SEARCH&authToken=hLmG&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A82310270%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1444635490853%2Ctas%3AJon%20Lucas",
|
||||||
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/1/005/080/392/295a574.jpg"
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAIcAAAAJGMxMjY3MmEwLTM0ODgtNGU3OS1hZjFiLTJjZjNhMDM3YTUyZQ.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"camper": "Alex Dixon",
|
||||||
|
"quote": "I was hired by the owner of the company, a programmer with 25 years of experience in web development. I graduated from university with a degree in English and had no programming experience prior to attending FreeCodeCamp.",
|
||||||
|
"github": "alex-dixon",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAABhCmLMBLAR1AXskaJXDMT-uLPZ8M7TynPQ&authType=NAME_SEARCH&authToken=k8uX&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A407017651%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1444633871133%2Ctas%3Aalex%20dixon",
|
||||||
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAMcAAAAJGZhM2Y2ZTU5LWNjODAtNDM5My1hYjAzLTYyYjFlOTcwZjVmZg.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"camper": "Ryan Lindeman",
|
"camper": "Ryan Lindeman",
|
||||||
@ -133,18 +231,11 @@
|
|||||||
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAL8AAAAJDliMGU0MTk0LWQ3YTUtNDY0NS1hMTg1LTdhN2Q1NTBlMzA5MQ.jpg"
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAL8AAAAJDliMGU0MTk0LWQ3YTUtNDY0NS1hMTg1LTdhN2Q1NTBlMzA5MQ.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"camper": "Nicholas Slaven",
|
"camper": "Rhonadale Florentino",
|
||||||
"quote": "Free Code Camp has given me the courage to open the door to the idea of programming for a career.",
|
"quote": "I can now confidently tell clients that I can design their website.",
|
||||||
"github": "nslaven22",
|
"github": "None Given",
|
||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAA5HGyIBmpNcXY_tfHBkWxXI6OtwsFAeHRQ&authType=NAME_SEARCH&authToken=IIqr&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A239541026%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907370759%2Ctas%3Aslaven",
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAI53oUBmy6MPKp1UeHxBy3_y0cyTS4bWow&authType=NAME_SEARCH&authToken=gz62&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A37346949%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907434768%2Ctas%3Arhona",
|
||||||
"image": "https://media.licdn.com/media/p/3/000/222/0d1/2606078.jpg"
|
"image": "https://media.licdn.com/media/p/7/005/0aa/319/1aaa08f.jpg"
|
||||||
},
|
|
||||||
{
|
|
||||||
"camper": "Andrea Goulet",
|
|
||||||
"quote": "Before enrolling in Free Code Camp, I was nervous when people asked me, \"Do you code?\", Now, I answer with a confident \"YES!\"",
|
|
||||||
"github": "andreagoulet",
|
|
||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAA4KWYB-mCMwEU3LvDHXt6H0rVHbBvszq0&authType=NAME_SEARCH&authToken=hUBG&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A3680614%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907386771%2Ctas%3Aandrea%20go",
|
|
||||||
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAMyAAAAJDI1MWU4OWU4LTZmNTAtNGFmMS1iYzcxLTA5Y2IwYzIyMWIxYQ.jpg"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"camper": "Justin Clay Lane",
|
"camper": "Justin Clay Lane",
|
||||||
@ -160,13 +251,6 @@
|
|||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAhIipMB6vAXaratEs0MtUd3GgyYm70cvbE&authType=NAME_SEARCH&authToken=pbTj&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A138971795%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907423626%2Ctas%3Aangsh",
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAhIipMB6vAXaratEs0MtUd3GgyYm70cvbE&authType=NAME_SEARCH&authToken=pbTj&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A138971795%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907423626%2Ctas%3Aangsh",
|
||||||
"image": "https://media.licdn.com/media/AAEAAQAAAAAAAAKPAAAAJGRjMmQwZjY5LTViMmUtNDQyZS04Y2Y3LTRhYjZiYWJlZDQzNw.jpg"
|
"image": "https://media.licdn.com/media/AAEAAQAAAAAAAAKPAAAAJGRjMmQwZjY5LTViMmUtNDQyZS04Y2Y3LTRhYjZiYWJlZDQzNw.jpg"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"camper": "Rhonadale Florentino",
|
|
||||||
"quote": "I can now confidently tell clients that I can design their website.",
|
|
||||||
"github": "None Given",
|
|
||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAI53oUBmy6MPKp1UeHxBy3_y0cyTS4bWow&authType=NAME_SEARCH&authToken=gz62&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A37346949%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907434768%2Ctas%3Arhona",
|
|
||||||
"image": "https://media.licdn.com/media/p/7/005/0aa/319/1aaa08f.jpg"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"camper": "Nick Galluzzo",
|
"camper": "Nick Galluzzo",
|
||||||
"quote": "I currently work in a support role for a tech startup (www.knackhq.com). The more I learn about JavaScript, the more I’m able to contribute to a product I really believe in!",
|
"quote": "I currently work in a support role for a tech startup (www.knackhq.com). The more I learn about JavaScript, the more I’m able to contribute to a product I really believe in!",
|
||||||
@ -181,6 +265,13 @@
|
|||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAOISlMBAi43m1SG-xM_S2B8Vy05yiQz5rE&authType=NAME_SEARCH&authToken=AY6E&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A59263571%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907488270%2Ctas%3Agenav",
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAOISlMBAi43m1SG-xM_S2B8Vy05yiQz5rE&authType=NAME_SEARCH&authToken=AY6E&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A59263571%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907488270%2Ctas%3Agenav",
|
||||||
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAWUAAAAJDc2ODU4MjVkLTlmMDUtNDM4My05OTY2LTliMTQxNzFlZmY0OQ.jpg"
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAWUAAAAJDc2ODU4MjVkLTlmMDUtNDM4My05OTY2LTliMTQxNzFlZmY0OQ.jpg"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"camper": "Nicholas Slaven",
|
||||||
|
"quote": "Free Code Camp has given me the courage to open the door to the idea of programming for a career.",
|
||||||
|
"github": "nslaven22",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAA5HGyIBmpNcXY_tfHBkWxXI6OtwsFAeHRQ&authType=NAME_SEARCH&authToken=IIqr&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A239541026%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907370759%2Ctas%3Aslaven",
|
||||||
|
"image": "https://media.licdn.com/media/p/3/000/222/0d1/2606078.jpg"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"camper": "Tim Stauffer",
|
"camper": "Tim Stauffer",
|
||||||
"quote": "I found Free Code Camp more helpful than my MS degree, so I quit college. Learning so much. Also saving $50,000.",
|
"quote": "I found Free Code Camp more helpful than my MS degree, so I quit college. Learning so much. Also saving $50,000.",
|
||||||
@ -188,6 +279,13 @@
|
|||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAADVcVIBz8UCNjQKl2GUy9ka8UGnQXAXAYw&authType=NAME_SEARCH&authToken=7Hkg&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A13988178%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907522559%2Ctas%3Astauffer",
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAADVcVIBz8UCNjQKl2GUy9ka8UGnQXAXAYw&authType=NAME_SEARCH&authToken=7Hkg&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A13988178%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907522559%2Ctas%3Astauffer",
|
||||||
"image": "https://avatars1.githubusercontent.com/u/3429096?v=3&s=460"
|
"image": "https://avatars1.githubusercontent.com/u/3429096?v=3&s=460"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"camper": "Marquina M Iliev-Piselli",
|
||||||
|
"quote": "I’m re-designing a site for my full-time job.",
|
||||||
|
"github": "Marquina",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAACYvVUBTuu8dNRHthN1TFiyk137PLDqnv4&authType=NAME_SEARCH&authToken=V_iG&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A10009941%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907639677%2Ctas%3Amarquin",
|
||||||
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAZLAAAAJDQ5Nzg4MjJmLWUyMjQtNDI5Ny05NmY5LTE5Yjc1Y2Q1YWFhOA.jpg"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"camper": "Pete Considine",
|
"camper": "Pete Considine",
|
||||||
"quote": "The guided and structured lessons have been really helpful, as has the relatively slow pace that new concepts are introduced. I had been taking a Udemy course and it really seemed to be skimming the surface of JavaScript in the interest of \"getting to everything.\"",
|
"quote": "The guided and structured lessons have been really helpful, as has the relatively slow pace that new concepts are introduced. I had been taking a Udemy course and it really seemed to be skimming the surface of JavaScript in the interest of \"getting to everything.\"",
|
||||||
@ -202,13 +300,6 @@
|
|||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAbdUsIBApacWEmL7CIxe2q7aevMn7aQvmQ&authType=NAME_SEARCH&authToken=a_zs&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A115167938%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907569985%2Ctas%3Akhatra",
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAbdUsIBApacWEmL7CIxe2q7aevMn7aQvmQ&authType=NAME_SEARCH&authToken=a_zs&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A115167938%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907569985%2Ctas%3Akhatra",
|
||||||
"image": "https://avatars0.githubusercontent.com/u/11299138?v=3&s=460"
|
"image": "https://avatars0.githubusercontent.com/u/11299138?v=3&s=460"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"camper": "Miranda Bashore",
|
|
||||||
"quote": "I want to be able to freelance and create dynamic websites. Free Code Camp makes that more of a reality for me, as I cannot afford an expensive bootcamp while getting my Master’s degree.",
|
|
||||||
"github": "DutchBay",
|
|
||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAA8KmJMBTtvvgJzjeAUo_YOssh2yLZZlvlk&authType=NAME_SEARCH&authToken=fWay&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A252352659%2CauthType%3ANAME_SEARCH%2Cidx%3A1-2-2%2CtarId%3A1441907584953%2Ctas%3Amiranda",
|
|
||||||
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/5/005/078/187/0ca3604.jpg"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"camper": "Marcus Lyons",
|
"camper": "Marcus Lyons",
|
||||||
"quote": "Free Code Camp has helped me gain the confidence to automate part of my work responsibilities. I was able to use skills I learned from Free Code Camp to help with writing a bash script to search through mobile app database log files to find errors.",
|
"quote": "Free Code Camp has helped me gain the confidence to automate part of my work responsibilities. I was able to use skills I learned from Free Code Camp to help with writing a bash script to search through mobile app database log files to find errors.",
|
||||||
@ -237,14 +328,6 @@
|
|||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAVdU1MBFFiei4ZYNImnVDcR3H_EiuS6qLY&authType=NAME_SEARCH&authToken=TlgU&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A90002259%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907626390%2Ctas%3Acameron%20",
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAVdU1MBFFiei4ZYNImnVDcR3H_EiuS6qLY&authType=NAME_SEARCH&authToken=TlgU&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A90002259%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907626390%2Ctas%3Acameron%20",
|
||||||
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/6/005/0a4/178/079a07b.jpg"
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/6/005/0a4/178/079a07b.jpg"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"camper": "Marquina M Iliev-Piselli",
|
|
||||||
"quote": "I’m re-designing a site for my full-time job.",
|
|
||||||
"github": "Marquina",
|
|
||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAACYvVUBTuu8dNRHthN1TFiyk137PLDqnv4&authType=NAME_SEARCH&authToken=V_iG&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A10009941%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907639677%2Ctas%3Amarquin",
|
|
||||||
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAZLAAAAJDQ5Nzg4MjJmLWUyMjQtNDI5Ny05NmY5LTE5Yjc1Y2Q1YWFhOA.jpg"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"camper": "Devarsh Ruparelia",
|
"camper": "Devarsh Ruparelia",
|
||||||
"quote": "Even though I am still just a high school student. The startup I intern for said that if I finish the full track of Free Code Camp, they will strongly consider me for their programming jobs. Thanks Free Code Camp!",
|
"quote": "Even though I am still just a high school student. The startup I intern for said that if I finish the full track of Free Code Camp, they will strongly consider me for their programming jobs. Thanks Free Code Camp!",
|
||||||
@ -252,6 +335,13 @@
|
|||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAApxpP8BZBcHQzr6Ci3xmkkZX-OSH_oLuJs&authType=NAME_SEARCH&authToken=wdjb&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A175219967%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907682493%2Ctas%3Adevarsh",
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAApxpP8BZBcHQzr6Ci3xmkkZX-OSH_oLuJs&authType=NAME_SEARCH&authToken=wdjb&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A175219967%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907682493%2Ctas%3Adevarsh",
|
||||||
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/7/005/087/339/14535ee.jpg"
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/7/005/087/339/14535ee.jpg"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"camper": "Miranda Bashore",
|
||||||
|
"quote": "I want to be able to freelance and create dynamic websites. Free Code Camp makes that more of a reality for me, as I cannot afford an expensive bootcamp while getting my Master’s degree.",
|
||||||
|
"github": "DutchBay",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAA8KmJMBTtvvgJzjeAUo_YOssh2yLZZlvlk&authType=NAME_SEARCH&authToken=fWay&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A252352659%2CauthType%3ANAME_SEARCH%2Cidx%3A1-2-2%2CtarId%3A1441907584953%2Ctas%3Amiranda",
|
||||||
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/5/005/078/187/0ca3604.jpg"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"camper": "Christian Morera",
|
"camper": "Christian Morera",
|
||||||
"quote": "Free Code Camp has been a great experience. I’ve learned so many things. I am in the process of transitioning from content developer to full stack developer.",
|
"quote": "Free Code Camp has been a great experience. I’ve learned so many things. I am in the process of transitioning from content developer to full stack developer.",
|
||||||
@ -329,13 +419,6 @@
|
|||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAFitUwByB_tgxdExntMnakgQnTK1H3eEd8&authType=NAME_SEARCH&authToken=230A&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A23246156%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907829391%2Ctas%3Aeric%20har",
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAFitUwByB_tgxdExntMnakgQnTK1H3eEd8&authType=NAME_SEARCH&authToken=230A&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A23246156%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907829391%2Ctas%3Aeric%20har",
|
||||||
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/2/000/1e1/095/12800b6.jpg"
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/2/000/1e1/095/12800b6.jpg"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"camper": "Brian Grant ",
|
|
||||||
"quote": "It has given me a place where like minded people are learning to code together. It has also inspired me to start a code camp here in the midwest.",
|
|
||||||
"github": "codeseekingman",
|
|
||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAEUqXoBFOq1SWQrBsTMHG4ij9Ss4Qqnrtg&authType=NAME_SEARCH&authToken=a85-&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A18131322%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441907840255%2Ctas%3Abrian%20g",
|
|
||||||
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAANEAAAAJGY5ZjZkMDVjLTJhY2EtNDZjYS1iMDk5LTY0ZDliN2EyODUxMQ.jpg"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"camper": "Danielle J Moss",
|
"camper": "Danielle J Moss",
|
||||||
"quote": "Aside from learning to code in a fun way, I also know I’m not alone and have somewhere to go when I do get stuck and need help.",
|
"quote": "Aside from learning to code in a fun way, I also know I’m not alone and have somewhere to go when I do get stuck and need help.",
|
||||||
@ -434,6 +517,13 @@
|
|||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAApQxGQBYz-WAQu_0zXPTkW-R7QbdaXEZeA&authType=NAME_SEARCH&authToken=r84S&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A173065316%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441908038920%2Ctas%3Amihai%20p",
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAApQxGQBYz-WAQu_0zXPTkW-R7QbdaXEZeA&authType=NAME_SEARCH&authToken=r84S&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A173065316%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441908038920%2Ctas%3Amihai%20p",
|
||||||
"image": "https://lh6.googleusercontent.com/-4JB6FPzm9ZE/VakUEj7WYsI/AAAAAAAALkU/4C0ILUwn-B8/w888-h891-no/profilepic.png"
|
"image": "https://lh6.googleusercontent.com/-4JB6FPzm9ZE/VakUEj7WYsI/AAAAAAAALkU/4C0ILUwn-B8/w888-h891-no/profilepic.png"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"camper": "Normandy Real",
|
||||||
|
"quote": "I'm doing Free Code Camp to transition from mainframe programming to front end development.",
|
||||||
|
"github": "mandyreal",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAdebIIBHfcSRnxGI-j6g5y6crfOXSg55Dc&authType=NAME_SEARCH&authToken=xLNy&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A123628674%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1444636619442%2Ctas%3ANormandy%20Real",
|
||||||
|
"image": "https://media.licdn.com/media/AAEAAQAAAAAAAAMrAAAAJDAxMmE0ZWI1LWU0MjctNDRjYS1hNjdkLTYwZTI5NjUxMDhjYw.jpg"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"camper": "Zlatko Cabric",
|
"camper": "Zlatko Cabric",
|
||||||
"quote": "I am still in school, pursuing an AS in web development. The JavaScript course in college was a breeze thanks to Free Code Camp.",
|
"quote": "I am still in school, pursuing an AS in web development. The JavaScript course in college was a breeze thanks to Free Code Camp.",
|
||||||
@ -441,6 +531,20 @@
|
|||||||
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAsCCFMBUlE24Ie41G_YS3XhdtQMDl5vCZA&authType=NAME_SEARCH&authToken=h1m7&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A184682579%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441908055072%2Ctas%3Azlat",
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAsCCFMBUlE24Ie41G_YS3XhdtQMDl5vCZA&authType=NAME_SEARCH&authToken=h1m7&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A184682579%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1441908055072%2Ctas%3Azlat",
|
||||||
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAALQAAAAJDMzNjY4M2UwLWVlYWEtNGQwYS04MDY0LTVjNGVhNGNhYWM5OQ.jpg"
|
"image": "https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAALQAAAAJDMzNjY4M2UwLWVlYWEtNGQwYS04MDY0LTVjNGVhNGNhYWM5OQ.jpg"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"camper": "Travis Wouters",
|
||||||
|
"quote": "Free Code Camp helped me add skillsets to my resume that show experience instead of knowledge without practical application.",
|
||||||
|
"github": "",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAABHP0YBddxsmaf2OghV2jAy17RVMhig4RM&authType=NAME_SEARCH&authToken=a7pC&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A4669254%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1444634846844%2Ctas%3ATravis%20Wouters",
|
||||||
|
"image": "https://media.licdn.com/media/p/8/005/07d/2f1/1792a44.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"camper": "Geoff Storbeck",
|
||||||
|
"quote": "I've been able to build tools that has helped moved my current career further and has opened up many more doors in the field.",
|
||||||
|
"github": "storbeck",
|
||||||
|
"linkedin": "https://www.linkedin.com/profile/view?id=AAkAAAdVQZYBHPYLt5efKwqZmiDM5SqIdH0_AR4&authType=NAME_SEARCH&authToken=EDd-&locale=en_US&trk=tyah&trkInfo=clickedVertical%3Amynetwork%2CclickedEntityId%3A123027862%2CauthType%3ANAME_SEARCH%2Cidx%3A1-1-1%2CtarId%3A1444635255807%2Ctas%3AGeoff%20Storbeck%09",
|
||||||
|
"image": "https://media.licdn.com/media/p/1/000/124/306/339eee6.jpg"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"camper": "Anthony DePaolo",
|
"camper": "Anthony DePaolo",
|
||||||
"quote": "I can learn web development at my own pace, which is great with my crazy life’s schedule. It also doesn’t cost $10k-$17k, which I just can’t fork over right now.",
|
"quote": "I can learn web development at my own pace, which is great with my crazy life’s schedule. It also doesn’t cost $10k-$17k, which I just can’t fork over right now.",
|
||||||
|
@ -2,7 +2,8 @@ require('dotenv').load();
|
|||||||
var pmx = require('pmx');
|
var pmx = require('pmx');
|
||||||
pmx.init();
|
pmx.init();
|
||||||
|
|
||||||
var uuid = require('node-uuid'),
|
var _ = require('lodash'),
|
||||||
|
uuid = require('node-uuid'),
|
||||||
assign = require('lodash').assign,
|
assign = require('lodash').assign,
|
||||||
loopback = require('loopback'),
|
loopback = require('loopback'),
|
||||||
boot = require('loopback-boot'),
|
boot = require('loopback-boot'),
|
||||||
@ -93,7 +94,7 @@ Object.keys(passportProviders).map(function(strategy) {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
app.start = function() {
|
app.start = _.once(function() {
|
||||||
app.listen(app.get('port'), function() {
|
app.listen(app.get('port'), function() {
|
||||||
app.emit('started');
|
app.emit('started');
|
||||||
console.log(
|
console.log(
|
||||||
@ -105,7 +106,7 @@ app.start = function() {
|
|||||||
console.log('Free Code Camp is in beta mode');
|
console.log('Free Code Camp is in beta mode');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
});
|
||||||
|
|
||||||
module.exports = app;
|
module.exports = app;
|
||||||
|
|
||||||
|
@ -20,14 +20,17 @@ block content
|
|||||||
.spacer
|
.spacer
|
||||||
if (user && user.progressTimestamps.length > 5)
|
if (user && user.progressTimestamps.length > 5)
|
||||||
#tshirt-notice.col-xs-12.col-md-8.col-md-offset-2.hidden
|
#tshirt-notice.col-xs-12.col-md-8.col-md-offset-2.hidden
|
||||||
h2.text-center Get our first-edition t-shirt
|
h2.text-center Get our first-edition t-shirt.
|
||||||
|
br
|
||||||
|
span.text-success Only available until Oct 29!
|
||||||
img.thumbnail.img-center.img-responsive(src="http://i.imgur.com/o07uuOL.png")
|
img.thumbnail.img-center.img-responsive(src="http://i.imgur.com/o07uuOL.png")
|
||||||
p.text-justify Our community has voted. Get our winning design emblazoned on a durable, American-made American Apparel shirt (available in women's and men's sizes). 
|
p.text-justify Our community has voted. Get our winning design emblazoned on a durable, American-made American Apparel shirt (available in women's and men's sizes). 
|
||||||
a(href="https://teespring.com/free-code-camp-shirt-eu" target="_blank") Also ships from Europe
|
a(href="https://teespring.com/free-code-camp-shirt-eu" target="_blank") Also ships from Europe
|
||||||
| .
|
| .
|
||||||
a.button.btn.btn-block.signup-btn(href="https://teespring.com/get-free-code-camp-t-shirt" target="_blank") Get yours
|
a.button.btn.btn-block.signup-btn(href="https://teespring.com/get-free-code-camp-t-shirt" target="_blank") Get yours
|
||||||
.button-spacer
|
.button-spacer
|
||||||
#hideTshirtNoticeButton.button.btn.btn-block.btn-info Hide this
|
.text-center
|
||||||
|
a#hideTshirtNoticeButton(href='#') Hide this forever
|
||||||
.spacer
|
.spacer
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-8.col-sm-offset-2
|
.col-xs-12.col-sm-8.col-sm-offset-2
|
||||||
@ -85,10 +88,15 @@ block content
|
|||||||
.spacer.negative-55
|
.spacer.negative-55
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-8.col-sm-offset-2
|
.hidden-xs.col-sm-3.col-md-2
|
||||||
h3 #{challengeBlock.name}
|
h3.text-primary.text-right.nowrap
|
||||||
|
i.fa.fa-clock-o
|
||||||
|
= challengeBlock.time
|
||||||
|
.col-xs-12.col-sm-9.col-md-10
|
||||||
|
h3 #{challengeBlock.name}  
|
||||||
|
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col-xs-12
|
|
||||||
ol
|
ol
|
||||||
for challenge in challengeBlock.challenges
|
for challenge in challengeBlock.challenges
|
||||||
if challenge.completed
|
if challenge.completed
|
||||||
@ -117,7 +125,7 @@ block content
|
|||||||
.button-spacer
|
.button-spacer
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-8.col-md-6.col-sm-offset-3.col-md-offset-2.hidden
|
.col-xs-12.col-sm-8.col-md-6.col-sm-offset-3.col-md-offset-2.hidden
|
||||||
a.btn.btn-lg.btn-block.signup-btn.map-challenge-block-share Section complete. Share your Portfolio with your friends.
|
a.btn.btn-lg.btn-block.signup-btn.map-challenge-block-share Section complete. Share your code portfolio with your friends.
|
||||||
.hidden(id="#{challengeBlock.name}")
|
.hidden(id="#{challengeBlock.name}")
|
||||||
script.
|
script.
|
||||||
var username = !{JSON.stringify(user && user.username || '')};
|
var username = !{JSON.stringify(user && user.username || '')};
|
||||||
|
@ -11,7 +11,7 @@ block content
|
|||||||
h2= nonprofit.displayName
|
h2= nonprofit.displayName
|
||||||
img.testimonial-image.img-responsive.img-center(src=nonprofit.imgUrl)
|
img.testimonial-image.img-responsive.img-center(src=nonprofit.imgUrl)
|
||||||
.button-spacer
|
.button-spacer
|
||||||
a.text-center(href='/commit?nonprofit=#{nonprofit.name}') Commmit to #{nonprofit.displayName}
|
a.text-center(href='/commit?nonprofit=#{nonprofit.name}') Commit to #{nonprofit.displayName}
|
||||||
p= nonprofit.description
|
p= nonprofit.description
|
||||||
.spacer
|
.spacer
|
||||||
.col-xs-12
|
.col-xs-12
|
||||||
|
@ -22,7 +22,7 @@ block content
|
|||||||
input(type='text' value='#{name}' name='nonprofit')
|
input(type='text' value='#{name}' name='nonprofit')
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-6.col-sm-offset-3
|
.col-xs-12.col-sm-6.col-sm-offset-3
|
||||||
h3 Choose your goal:
|
h3 Step 1: Choose your goal
|
||||||
.btn-group.btn-group-justified(data-toggle='buttons' role='group')
|
.btn-group.btn-group-justified(data-toggle='buttons' role='group')
|
||||||
label.btn.btn-primary.btn-lg.active
|
label.btn.btn-primary.btn-lg.active
|
||||||
input(type='radio' id=frontEndCert value=frontEndCert name='goal' checked="checked")
|
input(type='radio' id=frontEndCert value=frontEndCert name='goal' checked="checked")
|
||||||
@ -33,7 +33,7 @@ block content
|
|||||||
.spacer
|
.spacer
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-6.col-sm-offset-3
|
.col-xs-12.col-sm-6.col-sm-offset-3
|
||||||
h3 Choose your monthly pledge:
|
h3 Step 2: Choose your monthly pledge
|
||||||
.btn-group.btn-group-justified(data-toggle='buttons' role='group')
|
.btn-group.btn-group-justified(data-toggle='buttons' role='group')
|
||||||
label.btn.btn-success
|
label.btn.btn-success
|
||||||
input(type='radio' id='5-dollar-pledge' value='5' name='amount')
|
input(type='radio' id='5-dollar-pledge' value='5' name='amount')
|
||||||
@ -42,29 +42,48 @@ block content
|
|||||||
input(type='radio' id='10-dollar-pledge' value='10' name='amount' checked="checked")
|
input(type='radio' id='10-dollar-pledge' value='10' name='amount' checked="checked")
|
||||||
| $10 per month
|
| $10 per month
|
||||||
label.btn.btn-success
|
label.btn.btn-success
|
||||||
input(type='radio' id='25-dollar-pledge' value='25' name='amount' checked="checked")
|
input(type='radio' id='25-dollar-pledge' value='25' name='amount')
|
||||||
| $25 per month
|
| $25 per month
|
||||||
label.btn.btn-success
|
label.btn.btn-success
|
||||||
input(type='radio' id='50-dollar-pledge' value='50' name='amount')
|
input(type='radio' id='50-dollar-pledge' value='50' name='amount')
|
||||||
| $50 per month
|
| $50 per month
|
||||||
.spacer
|
.spacer
|
||||||
|
.col-xs-12.col-sm-6.col-sm-offset-3
|
||||||
|
h3 Step 3: Set up your monthly donation
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
|
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
|
||||||
a#commit-btn-submit.btn.btn-block.btn-lg.signup-btn(href=donateUrl target='_blank') Commit (and open donate page)
|
a#commit-btn-donate.btn.btn-block.btn-lg.btn-primary(href=donateUrl target='_blank') Open the #{displayName} donation page
|
||||||
|
|
||||||
|
.spacer
|
||||||
|
.col-xs-12.col-sm-6.col-sm-offset-3
|
||||||
|
h3#commit-step4-text.disabled
|
||||||
|
Step 4: Confirm
|
||||||
|
span#commit-step4-hidden.disabled (Do step 3 first)
|
||||||
|
span#commit-step4-show.hidden your commitment to your goal
|
||||||
|
.row
|
||||||
|
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
|
||||||
|
button#commit-btn-submit.btn.btn-block.btn-lg.btn-primary.disabled Commit
|
||||||
|
|
||||||
if pledge
|
if pledge
|
||||||
form.row(name='stop-pledge' action='/commit/stop-commitment' method='post')
|
form.row(name='stop-pledge' action='/commit/stop-commitment' method='post')
|
||||||
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
|
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
|
||||||
.button-spacer
|
.button-spacer
|
||||||
button.btn.btn-block.btn-danger(name='submit' type='submit') Stop my current pledge
|
button.btn.btn-block.btn-lg.btn-default(name='submit' type='submit') Stop my current pledge
|
||||||
else
|
else
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
|
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
|
||||||
.button-spacer
|
.button-spacer
|
||||||
a.btn.btn-block.btn-default(href='/') Maybe later
|
a.btn.btn-block.btn-lg.btn-default(href='/map') Maybe later
|
||||||
.spacer
|
.spacer
|
||||||
script.
|
script.
|
||||||
$(function() {
|
$(function() {
|
||||||
|
$('#commit-btn-donate').click(function() {
|
||||||
|
$('#commit-btn-submit').removeClass('disabled');
|
||||||
|
$('#commit-step4-text').removeClass('disabled');
|
||||||
|
$('#commit-step4-hidden').hide();
|
||||||
|
$('#commit-step4-show').removeClass('hidden');
|
||||||
|
});
|
||||||
|
|
||||||
$('#commit-btn-submit').click(function() {
|
$('#commit-btn-submit').click(function() {
|
||||||
window.location.href = '/commit/pledge?' + $('form').serialize();
|
window.location.href = '/commit/pledge?' + $('form').serialize();
|
||||||
});
|
});
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
extends ../layout-wide
|
extends ../layout-wide
|
||||||
block content
|
block content
|
||||||
|
|
||||||
|
script(type='text/javascript', src='/bower_components/jshint/dist/jshint.js')
|
||||||
script(type='text/javascript', src='/js/lib/codemirror/lib/codemirror.js')
|
script(type='text/javascript', src='/js/lib/codemirror/lib/codemirror.js')
|
||||||
script(type='text/javascript', src='/js/lib/codemirror/addon/edit/closebrackets.js')
|
script(type='text/javascript', src='/js/lib/codemirror/addon/edit/closebrackets.js')
|
||||||
script(type='text/javascript', src='/js/lib/codemirror/addon/edit/matchbrackets.js')
|
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/lint.js')
|
||||||
script(type='text/javascript', src='/js/lib/codemirror/addon/lint/javascript-lint.js')
|
script(type='text/javascript', src='/js/lib/codemirror/addon/lint/javascript-lint.js')
|
||||||
script(type='text/javascript', src='/bower_components/jshint/dist/jshint.js')
|
|
||||||
script(type='text/javascript', src='/js/lib/chai/chai.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/lib/codemirror.css')
|
||||||
link(rel='stylesheet', href='/js/lib/codemirror/addon/lint/lint.css')
|
link(rel='stylesheet', href='/js/lib/codemirror/addon/lint/lint.css')
|
||||||
@ -52,7 +52,7 @@ block content
|
|||||||
label.btn.btn-success#trigger-reset-modal
|
label.btn.btn-success#trigger-reset-modal
|
||||||
i.fa.fa-refresh
|
i.fa.fa-refresh
|
||||||
| Reset
|
| Reset
|
||||||
label.btn.btn-success#trigger-help-modal
|
label.btn.btn-success#challenge-help-btn
|
||||||
i.fa.fa-medkit
|
i.fa.fa-medkit
|
||||||
| Help
|
| Help
|
||||||
label.btn.btn-success#trigger-issue-modal
|
label.btn.btn-success#trigger-issue-modal
|
||||||
@ -88,8 +88,6 @@ block content
|
|||||||
.form-group.codeMirrorView
|
.form-group.codeMirrorView
|
||||||
textarea#codeEditor(autofocus=true, style='display: none;')
|
textarea#codeEditor(autofocus=true, style='display: none;')
|
||||||
script(src=rev('/js', 'commonFramework.js'))
|
script(src=rev('/js', 'commonFramework.js'))
|
||||||
script.
|
|
||||||
editor.setOption("mode", "javascript");
|
|
||||||
|
|
||||||
#complete-courseware-dialog.modal(tabindex='-1')
|
#complete-courseware-dialog.modal(tabindex='-1')
|
||||||
.modal-dialog.animated.fadeIn.fast-animation
|
.modal-dialog.animated.fadeIn.fast-animation
|
||||||
@ -106,7 +104,7 @@ block content
|
|||||||
if (user)
|
if (user)
|
||||||
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to my next challenge (ctrl + enter)
|
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to my next challenge (ctrl + enter)
|
||||||
if (user.progressTimestamps.length > 2)
|
if (user.progressTimestamps.length > 2)
|
||||||
a.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript")
|
a.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript", onclick="ga('send', 'event', 'twitter', 'share', 'challenge completion share');")
|
||||||
i.fa.fa-twitter  
|
i.fa.fa-twitter  
|
||||||
= phrase
|
= phrase
|
||||||
else
|
else
|
||||||
@ -122,6 +120,13 @@ block content
|
|||||||
a.btn.btn-lg.btn-primary.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
|
a.btn.btn-lg.btn-primary.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
|
||||||
include ../partials/challenge-modals
|
include ../partials/challenge-modals
|
||||||
script.
|
script.
|
||||||
|
|
||||||
|
document.addEventListener('gitter-sidecar-ready', function(e) {
|
||||||
|
if (window.main) {
|
||||||
|
window.main.chat.createHelpChat('freecodecamp/helpbonfires', '#challenge-help-btn', 'Bonfires Help');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var MDNlinks = !{JSON.stringify(MDNlinks)};
|
var MDNlinks = !{JSON.stringify(MDNlinks)};
|
||||||
if (!MDNlinks.length) {
|
if (!MDNlinks.length) {
|
||||||
$('#MDN-links').addClass('collapse');
|
$('#MDN-links').addClass('collapse');
|
||||||
|
@ -38,7 +38,11 @@ block content
|
|||||||
label.btn.btn-success#trigger-reset-modal
|
label.btn.btn-success#trigger-reset-modal
|
||||||
i.fa.fa-refresh
|
i.fa.fa-refresh
|
||||||
| Reset
|
| Reset
|
||||||
label.btn.btn-success#trigger-help-modal
|
label.btn.btn-success.hidden-sm.hidden-md.hidden-lg
|
||||||
|
a(href='//gitter.im/freecodecamp/help')
|
||||||
|
i.fa.fa-medkit
|
||||||
|
| Help
|
||||||
|
label.btn.btn-success.hidden-xs#challenge-help-btn
|
||||||
i.fa.fa-medkit
|
i.fa.fa-medkit
|
||||||
| Help
|
| Help
|
||||||
label.btn.btn-success#trigger-issue-modal
|
label.btn.btn-success#trigger-issue-modal
|
||||||
@ -72,6 +76,7 @@ block content
|
|||||||
textarea#codeEditor(autofocus=true, style='display: none;')
|
textarea#codeEditor(autofocus=true, style='display: none;')
|
||||||
script(src=rev('/js', 'commonFramework.js'))
|
script(src=rev('/js', 'commonFramework.js'))
|
||||||
script.
|
script.
|
||||||
|
editor.setOption('lint', false);
|
||||||
editor.setOption("mode", "text/html");
|
editor.setOption("mode", "text/html");
|
||||||
.col-md-4.col-lg-3
|
.col-md-4.col-lg-3
|
||||||
.hidden-xs.hidden-sm
|
.hidden-xs.hidden-sm
|
||||||
@ -95,3 +100,9 @@ block content
|
|||||||
else
|
else
|
||||||
a.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge
|
a.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge
|
||||||
include ../partials/challenge-modals
|
include ../partials/challenge-modals
|
||||||
|
script.
|
||||||
|
document.addEventListener('gitter-sidecar-ready', function(e) {
|
||||||
|
if (window.main) {
|
||||||
|
window.main.chat.createHelpChat('freecodecamp/help', '#challenge-help-btn');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
@ -43,7 +43,7 @@ block content
|
|||||||
label.btn.btn-success#trigger-reset-modal
|
label.btn.btn-success#trigger-reset-modal
|
||||||
i.fa.fa-refresh
|
i.fa.fa-refresh
|
||||||
| Reset
|
| Reset
|
||||||
label.btn.btn-success#trigger-help-modal
|
label.btn.btn-success#challenge-help-btn
|
||||||
i.fa.fa-medkit
|
i.fa.fa-medkit
|
||||||
| Help
|
| Help
|
||||||
label.btn.btn-success#trigger-issue-modal
|
label.btn.btn-success#trigger-issue-modal
|
||||||
@ -102,3 +102,8 @@ block content
|
|||||||
if (!MDNlinks.length) {
|
if (!MDNlinks.length) {
|
||||||
$('#MDN-links').addClass('collapse');
|
$('#MDN-links').addClass('collapse');
|
||||||
}
|
}
|
||||||
|
document.addEventListener('gitter-sidecar-ready', function(e) {
|
||||||
|
if (window.main) {
|
||||||
|
window.main.chat.createHelpChat('freecodecamp/help', '#challenge-help-btn');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
@ -6,7 +6,7 @@ block content
|
|||||||
.thumbnail.challenge-step(class=index !== 0 ? 'hidden': '')
|
.thumbnail.challenge-step(class=index !== 0 ? 'hidden': '')
|
||||||
img.gif-block.img-center.img-responsive.thumbnail(src='#{step[0]}' alt='#{step[1]}')
|
img.gif-block.img-center.img-responsive.thumbnail(src='#{step[0]}' alt='#{step[1]}')
|
||||||
.caption
|
.caption
|
||||||
p.large-p= step[2]
|
p.large-p!= step[2]
|
||||||
if step[3]
|
if step[3]
|
||||||
a.btn.btn-block.btn-primary.challenge-step-btn-action(id='#{index}' href='#{step[3]}' target='_blank') Open link in new tab
|
a.btn.btn-block.btn-primary.challenge-step-btn-action(id='#{index}' href='#{step[3]}' target='_blank') Open link in new tab
|
||||||
if index + 1 === description.length
|
if index + 1 === description.length
|
||||||
|
@ -24,7 +24,7 @@ block content
|
|||||||
var userLoggedIn = true;
|
var userLoggedIn = true;
|
||||||
.button-spacer
|
.button-spacer
|
||||||
.btn-group.input-group.btn-group-justified
|
.btn-group.input-group.btn-group-justified
|
||||||
.btn.btn-success.btn-big#trigger-help-modal
|
.btn.btn-success.btn-big#challenge-help-btn
|
||||||
i.fa.fa-medkit
|
i.fa.fa-medkit
|
||||||
| Get help
|
| Get help
|
||||||
.btn.btn-success.btn-big#trigger-issue-modal
|
.btn.btn-success.btn-big#trigger-issue-modal
|
||||||
@ -78,4 +78,10 @@ block content
|
|||||||
var challenge_Name = !{JSON.stringify(name)};
|
var challenge_Name = !{JSON.stringify(name)};
|
||||||
var challengeType = !{JSON.stringify(challengeType)};
|
var challengeType = !{JSON.stringify(challengeType)};
|
||||||
var dashedName = !{JSON.stringify(dashedName)};
|
var dashedName = !{JSON.stringify(dashedName)};
|
||||||
|
document.addEventListener('gitter-sidecar-ready', function(e) {
|
||||||
|
if (window.main) {
|
||||||
|
window.main.chat.createHelpChat('freecodecamp/help', '#challenge-help-btn');
|
||||||
|
}
|
||||||
|
});
|
||||||
include ../partials/challenge-modals
|
include ../partials/challenge-modals
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ block content
|
|||||||
a.btn.btn-big.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge (ctrl + enter)
|
a.btn.btn-big.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge (ctrl + enter)
|
||||||
.button-spacer
|
.button-spacer
|
||||||
.btn-group.input-group.btn-group-justified
|
.btn-group.input-group.btn-group-justified
|
||||||
.btn.btn-success.btn-big#trigger-help-modal
|
.btn.btn-success.btn-big#challenge-help-btn
|
||||||
i.fa.fa-medkit
|
i.fa.fa-medkit
|
||||||
| Help
|
| Help
|
||||||
.btn.btn-success.btn-big#trigger-issue-modal
|
.btn.btn-success.btn-big#trigger-issue-modal
|
||||||
@ -96,3 +96,23 @@ block content
|
|||||||
script.
|
script.
|
||||||
$('body').on('keypress', controlEnterHandler);
|
$('body').on('keypress', controlEnterHandler);
|
||||||
include ../partials/challenge-modals
|
include ../partials/challenge-modals
|
||||||
|
script.
|
||||||
|
document.addEventListener('gitter-sidecar-ready', function(e) {
|
||||||
|
var challengeType = !{JSON.stringify(challengeType)};
|
||||||
|
var room = 'freecodecamp/help';
|
||||||
|
var title;
|
||||||
|
|
||||||
|
if (challengeType === '4') {
|
||||||
|
room = 'freecodecamp/helpBasejumps';
|
||||||
|
title = 'Basejump Help';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (challengeType === '3') {
|
||||||
|
room = 'freecodecamp/helpZiplines';
|
||||||
|
title = 'Zipline Help';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window.main) {
|
||||||
|
window.main.chat.createHelpChat(room, '#challenge-help-btn', title);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
@ -33,21 +33,21 @@ block content
|
|||||||
h2 Campers you'll hang out with:
|
h2 Campers you'll hang out with:
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-12.col-md-4
|
.col-xs-12.col-sm-12.col-md-4
|
||||||
img.img-responsive.testimonial-image.img-center(src="https://s3.amazonaws.com/freecodecamp/testimonial-jen.jpg", alt="@jenthebest's testimonial image")
|
img.img-responsive.testimonial-image.img-center(src="http://i.imgur.com/xzDoJef.jpg", alt="'s testimonial image")
|
||||||
.testimonial-copy Getting back on track with Free Code Camp and committing to a new career in 2015!
|
p.testimonial-copy Free Code Camp helped me get my first engineering job. This amazing community made my career switch a lot easier and more fun.
|
||||||
h3 - @jenbestyoga
|
h3 - Ashley Drake
|
||||||
.col-xs-12.col-sm-12.col-md-4
|
.col-xs-12.col-sm-12.col-md-4
|
||||||
img.img-responsive.testimonial-image.img-center(src="https://s3.amazonaws.com/freecodecamp/testimonial-tate.jpg", alt="@TateThurston's testimonial image")
|
img.img-responsive.testimonial-image.img-center(src="http://i.imgur.com/wjlDigg.jpg", alt="Maxim Orlov's LinkedIn photo")
|
||||||
.testimonial-copy Just built my company's website with skills I've learned from Free Code Camp!
|
p.testimonial-copy I started Free Code Camp with zero knowledge of web development. 6 months later, I landed my first job as a back end engineer.
|
||||||
h3 - @TateThurston
|
h3 - Maxim Orlov
|
||||||
.col-xs-12.col-sm-12.col-md-4
|
.col-xs-12.col-sm-12.col-md-4
|
||||||
img.img-responsive.testimonial-image.img-center(src="https://s3.amazonaws.com/freecodecamp/testimonial-cynthia.jpg", alt="@cynthialanel's testimonial image")
|
img.img-responsive.testimonial-image.img-center(src="http://i.imgur.com/dE2Di78.jpg", alt="'s testimonial image")
|
||||||
.testimonial-copy I'm currently working through Free Code Camp to improve my JavaScript. The community is very welcoming!
|
p.testimonial-copy Free Code Camp gives me more confidence at work. Code doesn’t look as foreign anymore.
|
||||||
h3 - @cynthialanel
|
h3 - Qing Huang
|
||||||
.button-spacer
|
.spacer
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-8.col-sm-offset-2
|
.col-xs-12.col-sm-8.col-sm-offset-2
|
||||||
a.btn.btn-big.btn-primary.btn-block(href='/stories') Hear from more of our campers
|
a.btn.btn-lg.btn-primary.btn-primary-ghost.btn-block(href='/stories') Hear from more of our campers
|
||||||
.big-break
|
.big-break
|
||||||
h2 Skills you'll learn:
|
h2 Skills you'll learn:
|
||||||
.text-center.negative-35
|
.text-center.negative-35
|
||||||
|
@ -10,20 +10,6 @@
|
|||||||
a.btn.btn-lg.btn-primary.btn-block#report-issue(name='_csrf', value=_csrf) Create my GitHub issue
|
a.btn.btn-lg.btn-primary.btn-block#report-issue(name='_csrf', value=_csrf) Create my GitHub issue
|
||||||
a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
|
a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
|
||||||
|
|
||||||
#help-modal.modal(tabindex='-1')
|
|
||||||
.modal-dialog.animated.fadeIn.fast-animation
|
|
||||||
.modal-content
|
|
||||||
.modal-header.challenge-list-header Need some help?
|
|
||||||
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
|
||||||
.modal-body.text-center
|
|
||||||
h3 Remember to use  
|
|
||||||
a(href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck', target='_blank') Read-Search-Ask
|
|
||||||
| .
|
|
||||||
h3 If you've already read the errors and searched Google, you should ask for help.
|
|
||||||
h3 This will take you to our help room.
|
|
||||||
a.btn.btn-lg.btn-primary.btn-block.close-modal(href='https://gitter.im/FreeCodeCamp/help', target='_blank') Take me to the help room
|
|
||||||
a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
|
|
||||||
|
|
||||||
#reset-modal.modal(tabindex='-1')
|
#reset-modal.modal(tabindex='-1')
|
||||||
.modal-dialog.animated.fadeInUp.fast-animation
|
.modal-dialog.animated.fadeInUp.fast-animation
|
||||||
.modal-content
|
.modal-content
|
||||||
|
@ -1,24 +1,27 @@
|
|||||||
.fcc-footer
|
.fcc-footer
|
||||||
.col-xs-12.hidden-xs.hidden-sm
|
.col-xs-12.hidden-xs.hidden-sm
|
||||||
a.ion-speakerphone(href='http://blog.freecodecamp.com', target='_blank') Blog
|
a.ion-speakerphone(href='//medium.freecodecamp.com', target='_blank') Blog
|
||||||
a.ion-social-github(href="http://github.com/freecodecamp", target='_blank') GitHub
|
a.ion-social-github(href="//github.com/freecodecamp", target='_blank') GitHub
|
||||||
a.ion-social-twitch-outline(href="/twitch")  Twitch
|
a.ion-social-linkedin(href="//www.linkedin.com/edu/school?id=166029", target='_blank')  LinkedIn
|
||||||
a.ion-social-linkedin(href="https://www.linkedin.com/edu/school?id=166029", target='_blank')  LinkedIn
|
a.ion-social-twitter(href="//twitter.com/freecodecamp", target='_blank') Twitter
|
||||||
a.ion-social-facebook(href="//facebook.com/freecodecamp") Facebook
|
a.ion-social-facebook(href="//facebook.com/freecodecamp") Facebook
|
||||||
a.ion-social-twitter(href="http://twitter.com/freecodecamp", target='_blank') Twitter
|
a.ion-social-twitch-outline(href="//twitch.tv/freecodecamp", target='_blank')  Twitch
|
||||||
a.ion-locked(href="//github.com/FreeCodeCamp/freecodecamp/wiki/Free-Code-Camp's-Privacy-Policy") Privacy
|
a.ion-locked(href="//github.com/FreeCodeCamp/freecodecamp/wiki/Free-Code-Camp's-Privacy-Policy") Privacy
|
||||||
.col-xs-12.visible-xs.visible-sm
|
.col-xs-12.visible-xs.visible-sm
|
||||||
a.ion-speakerphone(href='http://blog.freecodecamp.com', target='_blank')
|
a.ion-speakerphone(href='//medium.freecodecamp.com', target='_blank')
|
||||||
span.sr-only Free Code Camp's Blog
|
span.sr-only Free Code Camp's Blog
|
||||||
a.ion-social-github(href="http://github.com/freecodecamp", target='_blank')
|
a.ion-social-github(href="//github.com/freecodecamp", target='_blank')
|
||||||
span.sr-only Free Code Camp on GitHub
|
span.sr-only Free Code Camp on GitHub
|
||||||
a.ion-social-twitch-outline(href="/twitch")
|
a.ion-social-linkedin(href="//www.linkedin.com/edu/school?id=166029", target='_blank')
|
||||||
span.sr-only Free Code Camp Live Pair Programming on Twitch.tv
|
|
||||||
a.ion-social-linkedin(href="https://www.linkedin.com/edu/school?id=166029", target='_blank')
|
|
||||||
span.sr-only Free Code Camp LinkedIn Alumni Network
|
span.sr-only Free Code Camp LinkedIn Alumni Network
|
||||||
a.ion-social-facebook(href="//facebook.com/freecodecamp")
|
a.ion-social-twitter(href="//twitter.com/freecodecamp", target='_blank')
|
||||||
span.sr-only Free Code Camp local groups on Facebook
|
|
||||||
a.ion-social-twitter(href="http://twitter.com/freecodecamp", target='_blank')
|
|
||||||
span.sr-only Free Code Camp on Twitter
|
span.sr-only Free Code Camp on Twitter
|
||||||
|
a.ion-social-facebook(href="//facebook.com/freecodecamp", target='_blank')
|
||||||
|
span.sr-only Free Code Camp local groups on Facebook
|
||||||
|
a.ion-social-twitch-outline(href="/twitch", target='_blank')
|
||||||
|
span.sr-only Free Code Camp Live Pair Programming on Twitch.tv
|
||||||
a.ion-locked(href="//github.com/FreeCodeCamp/freecodecamp/wiki/Free-Code-Camp's-Privacy-Policy")
|
a.ion-locked(href="//github.com/FreeCodeCamp/freecodecamp/wiki/Free-Code-Camp's-Privacy-Policy")
|
||||||
span.sr-only Free Code Camp's Privacy Policy
|
span.sr-only Free Code Camp's Privacy Policy
|
||||||
|
|
||||||
|
// scripts should be moved here
|
||||||
|
script(src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer)
|
||||||
|
@ -11,10 +11,12 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height
|
|||||||
a.learn-btn(href='#') Learn
|
a.learn-btn(href='#') Learn
|
||||||
li
|
li
|
||||||
a(href='/map') Map
|
a(href='/map') Map
|
||||||
|
li.hidden-xs
|
||||||
|
a#nav-chat-btn(href='#' onclick="return false") Chat
|
||||||
|
li.visible-xs
|
||||||
|
a(href="//gitter.im/freecodecamp/freecodecamp" target="_blank") Chat
|
||||||
li
|
li
|
||||||
a(href='//gitter.im/FreeCodeCamp/FreeCodeCamp', target='_blank') Chat
|
a(href='/news', target='_blank') News
|
||||||
li
|
|
||||||
a(href='/news') News
|
|
||||||
li
|
li
|
||||||
a(href='//github.com/FreeCodeCamp/freecodecamp/wiki/Home', target='_blank') Wiki
|
a(href='//github.com/FreeCodeCamp/freecodecamp/wiki/Home', target='_blank') Wiki
|
||||||
if !user
|
if !user
|
||||||
@ -27,3 +29,19 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height
|
|||||||
.hidden-xs.hidden-sm
|
.hidden-xs.hidden-sm
|
||||||
a(href='/' + user.username)
|
a(href='/' + user.username)
|
||||||
img.profile-picture.float-right(src='#{user.picture}')
|
img.profile-picture.float-right(src='#{user.picture}')
|
||||||
|
script.
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('.learn-btn').click(function(e) {
|
||||||
|
var challengeDashedName = null;
|
||||||
|
e.preventDefault();
|
||||||
|
if (typeof dashedName === "string") {
|
||||||
|
return location.reload();
|
||||||
|
}
|
||||||
|
if (typeof localStorage !== 'undefined') {
|
||||||
|
challengeDashedName = localStorage.getItem('currentDashedName');
|
||||||
|
}
|
||||||
|
window.location = challengeDashedName ?
|
||||||
|
'/challenges/' + challengeDashedName :
|
||||||
|
'/map';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
script.
|
||||||
|
(function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
ga('create', 'UA-55446531-1', 'auto');
|
||||||
|
ga('require', 'displayfeatures');
|
||||||
|
ga('send', 'pageview');
|
||||||
script(src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js")
|
script(src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js")
|
||||||
script.
|
script.
|
||||||
window.jQuery || document.write('<script src="/bower_components/jquery/dist/jquery.min.js"><\/script>');
|
window.jQuery || document.write('<script src="/bower_components/jquery/dist/jquery.min.js"><\/script>');
|
||||||
@ -29,11 +37,3 @@ script(src=rev('/js', 'main.js'))
|
|||||||
script(src="/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js")
|
script(src="/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js")
|
||||||
script(src="/bower_components/ramda/dist/ramda.min.js")
|
script(src="/bower_components/ramda/dist/ramda.min.js")
|
||||||
script(src='/bower_components/lightbox2/dist/js/lightbox.min.js')
|
script(src='/bower_components/lightbox2/dist/js/lightbox.min.js')
|
||||||
script.
|
|
||||||
(function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
|
||||||
ga('create', 'UA-55446531-1', 'auto');
|
|
||||||
ga('require', 'displayfeatures');
|
|
||||||
ga('send', 'pageview');
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
script(src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js")
|
script(src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js")
|
||||||
script(src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js")
|
script(src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js")
|
||||||
link(rel='stylesheet', href='/bower_components/font-awesome/css/font-awesome.min.css')
|
link(rel='stylesheet', href='/bower_components/font-awesome/css/font-awesome.min.css')
|
||||||
link(rel='stylesheet', href=rev('/css', 'main.css'))
|
link(rel='stylesheet', href='/css/main.css')
|
||||||
link(rel='stylesheet', href='/css/Vimeo.css')
|
link(rel='stylesheet', href='/css/Vimeo.css')
|
||||||
// End **REQUIRED** includes
|
// End **REQUIRED** includes
|
||||||
|
|
||||||
|
@ -11,11 +11,13 @@ block content
|
|||||||
.story-section
|
.story-section
|
||||||
a(href=story.linkedin target='_blank')
|
a(href=story.linkedin target='_blank')
|
||||||
img.testimonial-image.img-responsive.img-center(src=story.image)
|
img.testimonial-image.img-responsive.img-center(src=story.image)
|
||||||
h3.text-center
|
h3.text-center= story.camper
|
||||||
a(href=story.linkedin target='_blank')= story.camper
|
|
|
||||||
|
a.fa.fa-linkedin-square.text-primary(alt="#{story.camper}'s LinkedIn Profile", href=story.linkedin, target='_blank')
|
||||||
p.text-justify= story.quote
|
p.text-justify= story.quote
|
||||||
|
|
||||||
|
|
||||||
if !user
|
if !user
|
||||||
a.btn.btn-cta.signup-btn.btn-primary(href="/login") Start learning to code (it's free)
|
.text-center
|
||||||
|
a.btn.btn-cta.signup-btn(href="/login") Start learning to code (it's free)
|
||||||
.spacer
|
.spacer
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
(typeof username !== 'undefined' ?
|
(typeof username !== 'undefined' ?
|
||||||
"<button id='" + data[i].id + "' class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost btn-upvote'>upvote</button>" :
|
"<button id='" + data[i].id + "' class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost btn-upvote'>upvote</button>" :
|
||||||
"<a href='/signin' class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost'>upvote</a>") +
|
"<a href='/signin' class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost'>upvote</a>") +
|
||||||
"<a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost hidden' href='/news/" + linkedName + "'>more info</a> · " +
|
"<a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost hidden' href='/news/" + linkedName + "'>more info</a> " +
|
||||||
rank + (rank > 1 ? " points" : " point") + " · posted " +
|
rank + (rank > 1 ? " points" : " point") + " · posted " +
|
||||||
moment(data[i].timePosted).fromNow() +
|
moment(data[i].timePosted).fromNow() +
|
||||||
" by <a href='/" + data[i].author.username + "'>@" + data[i].author.username + "</a> " +
|
" by <a href='/" + data[i].author.username + "'>@" + data[i].author.username + "</a> " +
|
||||||
|
Reference in New Issue
Block a user