resolve difference with the JSON and AJAX differing from staging
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
language: node_js
|
||||
|
||||
services:
|
||||
- mongodb
|
||||
|
||||
node_js:
|
||||
- '0.10'
|
||||
- 'node'
|
||||
- '1.6.4'
|
||||
|
||||
sudo: false
|
||||
|
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@ import React from 'react';
|
||||
import Fetchr from 'fetchr';
|
||||
import debugFactory from 'debug';
|
||||
import { Router } from 'react-router';
|
||||
import { history } from 'react-router/lib/BrowserHistory';
|
||||
import { createLocation, createHistory } from 'history';
|
||||
import { hydrate } from 'thundercats';
|
||||
import { Render } from 'thundercats-react';
|
||||
|
||||
@ -18,21 +18,29 @@ const services = new Fetchr({
|
||||
});
|
||||
|
||||
Rx.config.longStackSupport = !!debug.enabled;
|
||||
|
||||
const history = createHistory();
|
||||
const appLocation = createLocation(
|
||||
location.pathname + location.search
|
||||
);
|
||||
// returns an observable
|
||||
app$(history)
|
||||
app$({ history, location: appLocation })
|
||||
.flatMap(
|
||||
({ AppCat }) => {
|
||||
// instantiate the cat with service
|
||||
const appCat = AppCat(null, services);
|
||||
// hydrate the stores
|
||||
return hydrate(appCat, catState)
|
||||
.map(() => appCat);
|
||||
},
|
||||
({ initialState }, appCat) => ({ initialState, appCat })
|
||||
// not using nextLocation at the moment but will be used for
|
||||
// redirects in the future
|
||||
({ nextLocation, props }, appCat) => ({ nextLocation, props, appCat })
|
||||
)
|
||||
.flatMap(({ initialState, appCat }) => {
|
||||
.flatMap(({ props, appCat }) => {
|
||||
props.history = history;
|
||||
return Render(
|
||||
appCat,
|
||||
React.createElement(Router, initialState),
|
||||
React.createElement(Router, props),
|
||||
DOMContianer
|
||||
);
|
||||
})
|
||||
|
@ -610,6 +610,7 @@ form.code span {
|
||||
.test-output {
|
||||
font-size: 15px;
|
||||
font-family: "Ubuntu Mono";
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
#mainEditorPanel .panel-body {
|
||||
@ -899,6 +900,10 @@ hr {
|
||||
color: @gray-light;
|
||||
}
|
||||
|
||||
code {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 993px) {
|
||||
.iframe-scroll {
|
||||
position: fixed !important;
|
||||
|
@ -1,3 +1,32 @@
|
||||
var mapShareKey = 'map-shares';
|
||||
var lastCompleted = typeof lastCompleted !== 'undefined' ?
|
||||
lastCompleted :
|
||||
'';
|
||||
|
||||
function getMapShares() {
|
||||
var alreadyShared = JSON.parse(localStorage.getItem(mapShareKey) || '[]');
|
||||
if (!alreadyShared || !Array.isArray(alreadyShared)) {
|
||||
localStorage.setItem(mapShareKey, JSON.stringify([]));
|
||||
alreadyShared = [];
|
||||
}
|
||||
return alreadyShared;
|
||||
}
|
||||
|
||||
function setMapShare(id) {
|
||||
var alreadyShared = getMapShares();
|
||||
var found = false;
|
||||
alreadyShared.forEach(function(_id) {
|
||||
if (_id === id) {
|
||||
found = true;
|
||||
}
|
||||
});
|
||||
if (!found) {
|
||||
alreadyShared.push(id);
|
||||
}
|
||||
localStorage.setItem(mapShareKey, JSON.stringify(alreadyShared));
|
||||
return alreadyShared;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
var challengeName = typeof challengeName !== 'undefined' ?
|
||||
@ -383,6 +412,40 @@ $(document).ready(function() {
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
|
||||
// map sharing
|
||||
var alreadyShared = getMapShares();
|
||||
|
||||
if (lastCompleted && alreadyShared.indexOf(lastCompleted) === -1) {
|
||||
$('div[id="' + lastCompleted + '"]')
|
||||
.parent()
|
||||
.parent()
|
||||
.removeClass('hidden');
|
||||
}
|
||||
|
||||
// on map view
|
||||
$('.map-challenge-block-share').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var challengeBlockName = $(this).children().attr('id');
|
||||
var challengeBlockEscapedName = challengeBlockName.replace(/\s/, '%20');
|
||||
var username = typeof window.username !== 'undefined' ?
|
||||
window.username :
|
||||
'';
|
||||
|
||||
var link = 'https://www.facebook.com/dialog/feed?' +
|
||||
'app_id=1644598365767721' +
|
||||
'&display=page&' +
|
||||
'caption=I%20just%20completed%20the%20' +
|
||||
challengeBlockEscapedName +
|
||||
'%20section%20on%20Free%20Code%20Camp%2E' +
|
||||
'&link=http%3A%2F%2Ffreecodecamp%2Ecom%2F' +
|
||||
username +
|
||||
'&redirect_uri=http%3A%2F%2Ffreecodecamp%2Ecom%2Fmap';
|
||||
|
||||
setMapShare(challengeBlockName);
|
||||
window.location.href = link;
|
||||
});
|
||||
});
|
||||
|
||||
function defCheck(a){
|
||||
|
@ -1,17 +1,17 @@
|
||||
import Rx from 'rx';
|
||||
import { Router } from 'react-router';
|
||||
import { match } from 'react-router';
|
||||
import App from './App.jsx';
|
||||
import AppCat from './Cat';
|
||||
|
||||
import childRoutes from './routes';
|
||||
|
||||
const router$ = Rx.Observable.fromNodeCallback(Router.run, Router);
|
||||
const route$ = Rx.Observable.fromNodeCallback(match);
|
||||
|
||||
const routes = Object.assign({ components: App }, childRoutes);
|
||||
|
||||
export default function app$(location) {
|
||||
return router$(routes, location)
|
||||
.map(([initialState, transistion]) => {
|
||||
return { initialState, transistion, AppCat };
|
||||
export default function app$({ location, history }) {
|
||||
return route$({ routes, location, history })
|
||||
.map(([nextLocation, props]) => {
|
||||
return { nextLocation, props, AppCat };
|
||||
});
|
||||
}
|
||||
|
43
common/app/routes/Jobs/components/CreateJobModal.jsx
Normal file
43
common/app/routes/Jobs/components/CreateJobModal.jsx
Normal file
@ -0,0 +1,43 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import { History } from 'react-router';
|
||||
import { Button, Modal } from 'react-bootstrap';
|
||||
|
||||
export default React.createClass({
|
||||
displayName: 'CreateJobsModal',
|
||||
|
||||
propTypes: {
|
||||
onHide: PropTypes.func,
|
||||
showModal: PropTypes.bool
|
||||
},
|
||||
|
||||
mixins: [History],
|
||||
|
||||
goToNewJob(onHide) {
|
||||
onHide();
|
||||
this.history.pushState(null, '/jobs/new');
|
||||
},
|
||||
|
||||
render() {
|
||||
const {
|
||||
showModal,
|
||||
onHide
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<Modal
|
||||
onHide={ onHide }
|
||||
show={ showModal }>
|
||||
<Modal.Body>
|
||||
<h4>Welcome to Free Code Camp's board</h4>
|
||||
<p>We post jobs specifically target to our junior developers.</p>
|
||||
<Button
|
||||
block={ true }
|
||||
className='signup-btn'
|
||||
onClick={ () => this.goToNewJob(onHide) }>
|
||||
Post a Job
|
||||
</Button>
|
||||
</Modal.Body>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
});
|
@ -1,7 +1,9 @@
|
||||
import React, { cloneElement, PropTypes } from 'react';
|
||||
import { contain } from 'thundercats-react';
|
||||
import { Navigation } from 'react-router';
|
||||
import { History } from 'react-router';
|
||||
import { Button, Jumbotron, Row } from 'react-bootstrap';
|
||||
|
||||
import CreateJobModal from './CreateJobModal.jsx';
|
||||
import ListJobs from './List.jsx';
|
||||
|
||||
export default contain(
|
||||
@ -13,12 +15,14 @@ export default contain(
|
||||
React.createClass({
|
||||
displayName: 'Jobs',
|
||||
|
||||
mixins: [History],
|
||||
|
||||
propTypes: {
|
||||
children: PropTypes.element,
|
||||
jobActions: PropTypes.object,
|
||||
jobs: PropTypes.array
|
||||
jobs: PropTypes.array,
|
||||
showModal: PropTypes.bool
|
||||
},
|
||||
mixins: [Navigation],
|
||||
|
||||
handleJobClick(id) {
|
||||
const { jobActions } = this.props;
|
||||
@ -26,7 +30,7 @@ export default contain(
|
||||
return null;
|
||||
}
|
||||
jobActions.findJob(id);
|
||||
this.transitionTo(`/jobs/${id}`);
|
||||
this.history.pushState(null, `/jobs/${id}`);
|
||||
},
|
||||
|
||||
renderList(handleJobClick, jobs) {
|
||||
@ -48,7 +52,12 @@ export default contain(
|
||||
},
|
||||
|
||||
render() {
|
||||
const { children, jobs } = this.props;
|
||||
const {
|
||||
children,
|
||||
jobs,
|
||||
showModal,
|
||||
jobActions
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<div>
|
||||
@ -62,7 +71,8 @@ export default contain(
|
||||
</p>
|
||||
<Button
|
||||
bsSize='large'
|
||||
className='signup-btn'>
|
||||
className='signup-btn'
|
||||
onClick={ jobActions.openModal }>
|
||||
Try the first month 20% off!
|
||||
</Button>
|
||||
</Jumbotron>
|
||||
@ -70,7 +80,10 @@ export default contain(
|
||||
<Row>
|
||||
{ this.renderChild(children, jobs) ||
|
||||
this.renderList(this.handleJobClick, jobs) }
|
||||
</Row>
|
||||
</Row>
|
||||
<CreateJobModal
|
||||
onHide={ jobActions.closeModal }
|
||||
showModal={ showModal } />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ export default React.createClass({
|
||||
id,
|
||||
company,
|
||||
position,
|
||||
isHighlighted,
|
||||
description,
|
||||
logo,
|
||||
city,
|
||||
@ -44,6 +45,7 @@ export default React.createClass({
|
||||
);
|
||||
return (
|
||||
<Panel
|
||||
bsStyle={ isHighlighted ? 'warning' : 'default' }
|
||||
collapsible={ true }
|
||||
eventKey={ index }
|
||||
header={ header }
|
||||
|
319
common/app/routes/Jobs/components/NewJob.jsx
Normal file
319
common/app/routes/Jobs/components/NewJob.jsx
Normal file
@ -0,0 +1,319 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import { History } from 'react-router';
|
||||
import { contain } from 'thundercats-react';
|
||||
import debugFactory from 'debug';
|
||||
import { getDefaults } from '../utils';
|
||||
|
||||
import {
|
||||
inHTMLData,
|
||||
uriInSingleQuotedAttr
|
||||
} from 'xss-filters';
|
||||
|
||||
import {
|
||||
Button,
|
||||
Col,
|
||||
Input,
|
||||
Row,
|
||||
Well
|
||||
} from 'react-bootstrap';
|
||||
|
||||
import {
|
||||
isAscii,
|
||||
isEmail,
|
||||
isMobilePhone,
|
||||
isURL
|
||||
} from 'validator';
|
||||
|
||||
const debug = debugFactory('freecc:jobs:newForm');
|
||||
|
||||
const checkValidity = [
|
||||
'position',
|
||||
'locale',
|
||||
'description',
|
||||
'email',
|
||||
'phone',
|
||||
'url',
|
||||
'logo',
|
||||
'name',
|
||||
'highlight'
|
||||
];
|
||||
|
||||
function formatValue(value, validator, type = 'string') {
|
||||
const formated = getDefaults(type);
|
||||
if (validator && type === 'string') {
|
||||
formated.valid = validator(value);
|
||||
}
|
||||
if (value) {
|
||||
formated.value = value;
|
||||
formated.bsStyle = formated.valid ? 'success' : 'error';
|
||||
}
|
||||
return formated;
|
||||
}
|
||||
|
||||
function isValidURL(data) {
|
||||
return isURL(data, { 'require_protocol': true });
|
||||
}
|
||||
|
||||
function isValidPhone(data) {
|
||||
return isMobilePhone(data, 'en-US');
|
||||
}
|
||||
|
||||
export default contain({
|
||||
actions: 'jobActions',
|
||||
store: 'jobsStore',
|
||||
map({ form = {} }) {
|
||||
const {
|
||||
position,
|
||||
locale,
|
||||
description,
|
||||
email,
|
||||
phone,
|
||||
url,
|
||||
logo,
|
||||
name,
|
||||
highlight
|
||||
} = form;
|
||||
return {
|
||||
position: formatValue(position, isAscii),
|
||||
locale: formatValue(locale, isAscii),
|
||||
description: formatValue(description, isAscii),
|
||||
email: formatValue(email, isEmail),
|
||||
phone: formatValue(phone, isValidPhone),
|
||||
url: formatValue(url, isValidURL),
|
||||
logo: formatValue(logo, isValidURL),
|
||||
name: formatValue(name, isAscii),
|
||||
highlight: formatValue(highlight, null, 'bool')
|
||||
};
|
||||
},
|
||||
subscribeOnWillMount() {
|
||||
return typeof window !== 'undefined';
|
||||
}
|
||||
},
|
||||
React.createClass({
|
||||
displayName: 'NewJob',
|
||||
|
||||
propTypes: {
|
||||
jobActions: PropTypes.object,
|
||||
position: PropTypes.object,
|
||||
locale: PropTypes.object,
|
||||
description: PropTypes.object,
|
||||
email: PropTypes.object,
|
||||
phone: PropTypes.object,
|
||||
url: PropTypes.object,
|
||||
logo: PropTypes.object,
|
||||
name: PropTypes.object,
|
||||
highlight: PropTypes.object
|
||||
},
|
||||
|
||||
mixins: [History],
|
||||
|
||||
handleSubmit(e) {
|
||||
e.preventDefault();
|
||||
const props = this.props;
|
||||
let valid = true;
|
||||
checkValidity.forEach((prop) => {
|
||||
// if value exist, check if it is valid
|
||||
if (props[prop].value && props[prop].type !== 'boolean') {
|
||||
valid = valid && !!props[prop].valid;
|
||||
}
|
||||
});
|
||||
|
||||
if (!valid) {
|
||||
debug('form not valid');
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
position,
|
||||
locale,
|
||||
description,
|
||||
email,
|
||||
phone,
|
||||
url,
|
||||
logo,
|
||||
name,
|
||||
highlight,
|
||||
jobActions
|
||||
} = this.props;
|
||||
|
||||
// sanitize user output
|
||||
const jobValues = {
|
||||
position: inHTMLData(position.value),
|
||||
location: inHTMLData(locale.value),
|
||||
description: inHTMLData(description.value),
|
||||
email: inHTMLData(email.value),
|
||||
phone: inHTMLData(phone.value),
|
||||
url: uriInSingleQuotedAttr(url.value),
|
||||
logo: uriInSingleQuotedAttr(logo.value),
|
||||
name: inHTMLData(name.value),
|
||||
highlight: !!highlight.value
|
||||
};
|
||||
|
||||
const job = Object.keys(jobValues).reduce((accu, prop) => {
|
||||
if (jobValues[prop]) {
|
||||
accu[prop] = jobValues[prop];
|
||||
}
|
||||
return accu;
|
||||
}, {});
|
||||
|
||||
job.postedOn = new Date();
|
||||
debug('job sanitized', job);
|
||||
jobActions.saveForm(job);
|
||||
|
||||
this.history.pushState(null, '/jobs/new/preview');
|
||||
},
|
||||
|
||||
componentDidMount() {
|
||||
const { jobActions } = this.props;
|
||||
jobActions.getSavedForm();
|
||||
},
|
||||
|
||||
handleChange(name, { target: { value } }) {
|
||||
const { jobActions: { handleForm } } = this.props;
|
||||
handleForm({ [name]: value });
|
||||
},
|
||||
|
||||
render() {
|
||||
const {
|
||||
position,
|
||||
locale,
|
||||
description,
|
||||
email,
|
||||
phone,
|
||||
url,
|
||||
logo,
|
||||
name,
|
||||
highlight,
|
||||
jobActions: { handleForm }
|
||||
} = this.props;
|
||||
const { handleChange } = this;
|
||||
const labelClass = 'col-sm-offset-1 col-sm-2';
|
||||
const inputClass = 'col-sm-6';
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Row>
|
||||
<Col>
|
||||
<Well className='text-center'>
|
||||
<h1>Create Your Job Post</h1>
|
||||
<form
|
||||
className='form-horizontal'
|
||||
onSubmit={ this.handleSubmit }>
|
||||
|
||||
<div className='spacer'>
|
||||
<h2>Job Information</h2>
|
||||
</div>
|
||||
<Input
|
||||
bsStyle={ position.bsStyle }
|
||||
label='Position'
|
||||
labelClassName={ labelClass }
|
||||
onChange={ (e) => handleChange('position', e) }
|
||||
placeholder='Position'
|
||||
type='text'
|
||||
value={ position.value }
|
||||
wrapperClassName={ inputClass } />
|
||||
<Input
|
||||
bsStyle={ locale.bsStyle }
|
||||
label='Location'
|
||||
labelClassName={ labelClass }
|
||||
onChange={ (e) => handleChange('locale', e) }
|
||||
placeholder='Location'
|
||||
type='text'
|
||||
value={ locale.value }
|
||||
wrapperClassName={ inputClass } />
|
||||
<Input
|
||||
bsStyle={ description.bsStyle }
|
||||
label='Description'
|
||||
labelClassName={ labelClass }
|
||||
onChange={ (e) => handleChange('description', e) }
|
||||
placeholder='Description'
|
||||
rows='10'
|
||||
type='textarea'
|
||||
value={ description.value }
|
||||
wrapperClassName={ inputClass } />
|
||||
|
||||
<div className='divider'>
|
||||
<h2>Company Information</h2>
|
||||
</div>
|
||||
<Input
|
||||
bsStyle={ name.bsStyle }
|
||||
label='Company Name'
|
||||
labelClassName={ labelClass }
|
||||
onChange={ (e) => handleChange('name', e) }
|
||||
placeholder='Foo, INC'
|
||||
type='text'
|
||||
value={ name.value }
|
||||
wrapperClassName={ inputClass } />
|
||||
<Input
|
||||
bsStyle={ email.bsStyle }
|
||||
label='Email'
|
||||
labelClassName={ labelClass }
|
||||
onChange={ (e) => handleChange('email', e) }
|
||||
placeholder='Email'
|
||||
type='email'
|
||||
value={ email.value }
|
||||
wrapperClassName={ inputClass } />
|
||||
<Input
|
||||
bsStyle={ phone.bsStyle }
|
||||
label='Phone'
|
||||
labelClassName={ labelClass }
|
||||
onChange={ (e) => handleChange('phone', e) }
|
||||
placeholder='555-123-1234'
|
||||
type='tel'
|
||||
value={ phone.value }
|
||||
wrapperClassName={ inputClass } />
|
||||
<Input
|
||||
bsStyle={ url.bsStyle }
|
||||
label='URL'
|
||||
labelClassName={ labelClass }
|
||||
onChange={ (e) => handleChange('url', e) }
|
||||
placeholder='http://freecatphotoapp.com'
|
||||
type='url'
|
||||
value={ url.value }
|
||||
wrapperClassName={ inputClass } />
|
||||
<Input
|
||||
bsStyle={ logo.bsStyle }
|
||||
label='Logo'
|
||||
labelClassName={ labelClass }
|
||||
onChange={ (e) => handleChange('logo', e) }
|
||||
placeholder='http://freecatphotoapp.com/logo.png'
|
||||
type='url'
|
||||
value={ logo.value }
|
||||
wrapperClassName={ inputClass } />
|
||||
|
||||
<div className='divider'>
|
||||
<h2>Make it stand out</h2>
|
||||
</div>
|
||||
<Input
|
||||
checked={ highlight.value }
|
||||
label='Highlight your ad'
|
||||
labelClassName={ 'col-sm-offset-1 col-sm-6'}
|
||||
onChange={
|
||||
({ target: { checked } }) => handleForm({
|
||||
highlight: !!checked
|
||||
})
|
||||
}
|
||||
type='checkbox' />
|
||||
<div className='spacer' />
|
||||
<Row>
|
||||
<Col
|
||||
lg={ 6 }
|
||||
lgOffset={ 3 }>
|
||||
<Button
|
||||
block={ true }
|
||||
bsSize='large'
|
||||
bsStyle='primary'
|
||||
type='submit'>
|
||||
Preview My Ad
|
||||
</Button>
|
||||
</Col>
|
||||
</Row>
|
||||
</form>
|
||||
</Well>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
})
|
||||
);
|
14
common/app/routes/Jobs/components/Preview.jsx
Normal file
14
common/app/routes/Jobs/components/Preview.jsx
Normal file
@ -0,0 +1,14 @@
|
||||
// import React, { PropTypes } from 'react';
|
||||
import { contain } from 'thundercats-react';
|
||||
import ShowJob from './ShowJob.jsx';
|
||||
|
||||
export default contain(
|
||||
{
|
||||
store: 'JobsStore',
|
||||
actions: 'JobActions',
|
||||
map({ form: job = {} }) {
|
||||
return { job };
|
||||
}
|
||||
},
|
||||
ShowJob
|
||||
);
|
@ -1,13 +1,5 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import { contain } from 'thundercats-react';
|
||||
import { Row, Thumbnail, Panel, Well } from 'react-bootstrap';
|
||||
import moment from 'moment';
|
||||
|
||||
const thumbnailStyle = {
|
||||
backgroundColor: 'white',
|
||||
maxHeight: '100px',
|
||||
maxWidth: '100px'
|
||||
};
|
||||
import ShowJob from './ShowJob.jsx';
|
||||
|
||||
export default contain(
|
||||
{
|
||||
@ -28,61 +20,5 @@ export default contain(
|
||||
return job.id !== id;
|
||||
}
|
||||
},
|
||||
React.createClass({
|
||||
displayName: 'ShowJob',
|
||||
propTypes: {
|
||||
job: PropTypes.object,
|
||||
params: PropTypes.object
|
||||
},
|
||||
|
||||
renderHeader({ company, position }) {
|
||||
return (
|
||||
<div>
|
||||
<h4 style={{ display: 'inline-block' }}>{ company }</h4>
|
||||
<h5
|
||||
className='pull-right hidden-xs hidden-md'
|
||||
style={{ display: 'inline-block' }}>
|
||||
{ position }
|
||||
</h5>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
render() {
|
||||
const { job = {} } = this.props;
|
||||
const {
|
||||
logo,
|
||||
position,
|
||||
city,
|
||||
company,
|
||||
state,
|
||||
email,
|
||||
phone,
|
||||
postedOn,
|
||||
description
|
||||
} = job;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Row>
|
||||
<Well>
|
||||
<Thumbnail
|
||||
alt={ company + 'company logo' }
|
||||
src={ logo }
|
||||
style={ thumbnailStyle } />
|
||||
<Panel>
|
||||
Position: { position }
|
||||
Location: { city }, { state }
|
||||
<br />
|
||||
Contact: { email || phone || 'N/A' }
|
||||
<br />
|
||||
Posted On: { moment(postedOn).format('MMMM Do, YYYY') }
|
||||
</Panel>
|
||||
<p>{ description }</p>
|
||||
</Well>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
})
|
||||
ShowJob
|
||||
);
|
||||
|
67
common/app/routes/Jobs/components/ShowJob.jsx
Normal file
67
common/app/routes/Jobs/components/ShowJob.jsx
Normal file
@ -0,0 +1,67 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import { Row, Thumbnail, Panel, Well } from 'react-bootstrap';
|
||||
import moment from 'moment';
|
||||
|
||||
const thumbnailStyle = {
|
||||
backgroundColor: 'white',
|
||||
maxHeight: '100px',
|
||||
maxWidth: '100px'
|
||||
};
|
||||
|
||||
export default React.createClass({
|
||||
displayName: 'ShowJob',
|
||||
propTypes: {
|
||||
job: PropTypes.object,
|
||||
params: PropTypes.object
|
||||
},
|
||||
|
||||
renderHeader({ company, position }) {
|
||||
return (
|
||||
<div>
|
||||
<h4 style={{ display: 'inline-block' }}>{ company }</h4>
|
||||
<h5
|
||||
className='pull-right hidden-xs hidden-md'
|
||||
style={{ display: 'inline-block' }}>
|
||||
{ position }
|
||||
</h5>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
render() {
|
||||
const { job = {} } = this.props;
|
||||
const {
|
||||
logo,
|
||||
position,
|
||||
city,
|
||||
company,
|
||||
state,
|
||||
email,
|
||||
phone,
|
||||
postedOn,
|
||||
description
|
||||
} = job;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Row>
|
||||
<Well>
|
||||
<Thumbnail
|
||||
alt={ company + 'company logo' }
|
||||
src={ logo }
|
||||
style={ thumbnailStyle } />
|
||||
<Panel>
|
||||
Position: { position }
|
||||
Location: { city }, { state }
|
||||
<br />
|
||||
Contact: { email || phone || 'N/A' }
|
||||
<br />
|
||||
Posted On: { moment(postedOn).format('MMMM Do, YYYY') }
|
||||
</Panel>
|
||||
<p>{ description }</p>
|
||||
</Well>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
@ -1,7 +1,9 @@
|
||||
import { Actions } from 'thundercats';
|
||||
import store from 'store';
|
||||
import debugFactory from 'debug';
|
||||
|
||||
const debug = debugFactory('freecc:jobs:actions');
|
||||
const assign = Object.assign;
|
||||
|
||||
export default Actions({
|
||||
setJobs: null,
|
||||
@ -23,7 +25,7 @@ export default Actions({
|
||||
|
||||
// if no job found this will be null which is a op noop
|
||||
return foundJob ?
|
||||
Object.assign({}, oldState, { currentJob: foundJob }) :
|
||||
assign({}, oldState, { currentJob: foundJob }) :
|
||||
null;
|
||||
};
|
||||
},
|
||||
@ -31,6 +33,31 @@ export default Actions({
|
||||
getJob: null,
|
||||
getJobs(params) {
|
||||
return { params };
|
||||
},
|
||||
openModal() {
|
||||
return { showModal: true };
|
||||
},
|
||||
closeModal() {
|
||||
return { showModal: false };
|
||||
},
|
||||
handleForm(value) {
|
||||
return {
|
||||
transform(oldState) {
|
||||
const { form } = oldState;
|
||||
const newState = assign({}, oldState);
|
||||
newState.form = assign(
|
||||
{},
|
||||
form,
|
||||
value
|
||||
);
|
||||
return newState;
|
||||
}
|
||||
};
|
||||
},
|
||||
saveForm: null,
|
||||
getSavedForm: null,
|
||||
setForm(form) {
|
||||
return { form };
|
||||
}
|
||||
})
|
||||
.refs({ displayName: 'JobActions' })
|
||||
@ -56,8 +83,22 @@ export default Actions({
|
||||
debug('job services experienced an issue', err);
|
||||
return jobActions.setError({ err });
|
||||
}
|
||||
jobActions.setJobs({ currentJob: job });
|
||||
if (job) {
|
||||
jobActions.setJobs({ currentJob: job });
|
||||
}
|
||||
jobActions.setJobs({});
|
||||
});
|
||||
});
|
||||
|
||||
jobActions.saveForm.subscribe((form) => {
|
||||
store.set('newJob', form);
|
||||
});
|
||||
|
||||
jobActions.getSavedForm.subscribe(() => {
|
||||
const job = store.get('newJob');
|
||||
if (job && !Array.isArray(job) && typeof job === 'object') {
|
||||
jobActions.setForm(job);
|
||||
}
|
||||
});
|
||||
return jobActions;
|
||||
});
|
||||
|
@ -6,12 +6,25 @@ const {
|
||||
transformer
|
||||
} = Store;
|
||||
|
||||
export default Store()
|
||||
export default Store({ showModal: false })
|
||||
.refs({ displayName: 'JobsStore' })
|
||||
.init(({ instance: jobsStore, args: [cat] }) => {
|
||||
const { setJobs, findJob, setError } = cat.getActions('JobActions');
|
||||
const {
|
||||
setJobs,
|
||||
findJob,
|
||||
setError,
|
||||
openModal,
|
||||
closeModal,
|
||||
handleForm,
|
||||
setForm
|
||||
} = cat.getActions('JobActions');
|
||||
const register = createRegistrar(jobsStore);
|
||||
register(setter(setJobs));
|
||||
register(transformer(findJob));
|
||||
register(setter(setError));
|
||||
register(setter(openModal));
|
||||
register(setter(closeModal));
|
||||
register(setter(setForm));
|
||||
|
||||
register(transformer(findJob));
|
||||
register(handleForm);
|
||||
});
|
||||
|
@ -1,5 +1,7 @@
|
||||
import Jobs from './components/Jobs.jsx';
|
||||
import NewJob from './components/NewJob.jsx';
|
||||
import Show from './components/Show.jsx';
|
||||
import Preview from './components/Preview.jsx';
|
||||
|
||||
/*
|
||||
* index: /jobs list jobs
|
||||
@ -11,6 +13,12 @@ export default {
|
||||
childRoutes: [{
|
||||
path: '/jobs',
|
||||
component: Jobs
|
||||
}, {
|
||||
path: 'jobs/new',
|
||||
component: NewJob
|
||||
}, {
|
||||
path: 'jobs/new/preview',
|
||||
component: Preview
|
||||
}, {
|
||||
path: 'jobs/:id',
|
||||
component: Show
|
||||
|
22
common/app/routes/Jobs/utils.js
Normal file
22
common/app/routes/Jobs/utils.js
Normal file
@ -0,0 +1,22 @@
|
||||
const defaults = {
|
||||
'string': {
|
||||
value: '',
|
||||
valid: false,
|
||||
pristine: true,
|
||||
type: 'string'
|
||||
},
|
||||
bool: {
|
||||
value: false,
|
||||
type: 'boolean'
|
||||
}
|
||||
};
|
||||
|
||||
export function getDefaults(type, value) {
|
||||
if (!type) {
|
||||
return defaults['string'];
|
||||
}
|
||||
if (value) {
|
||||
return Object.assign({}, defaults[type], { value });
|
||||
}
|
||||
return Object.assign({}, defaults[type]);
|
||||
}
|
@ -3,12 +3,8 @@ import Hikes from './Hikes';
|
||||
|
||||
export default {
|
||||
path: '/',
|
||||
getChildRoutes(locationState, cb) {
|
||||
setTimeout(() => {
|
||||
cb(null, [
|
||||
Jobs,
|
||||
Hikes
|
||||
]);
|
||||
}, 0);
|
||||
}
|
||||
childRoutes: [
|
||||
Jobs,
|
||||
Hikes
|
||||
]
|
||||
};
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "job",
|
||||
"base": "PersistedModel",
|
||||
"strict": true,
|
||||
"idInjection": true,
|
||||
"trackChanges": false,
|
||||
"properties": {
|
||||
@ -29,6 +30,9 @@
|
||||
"state": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"country": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -38,7 +42,7 @@
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"isApproverd": {
|
||||
"isApproved": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"isHighlighted": {
|
||||
|
@ -88,39 +88,6 @@
|
||||
"google": {
|
||||
"type": "string"
|
||||
},
|
||||
"completedBonfires": {
|
||||
"type": [
|
||||
{
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"completedWith": "string",
|
||||
"completedDate": "string",
|
||||
"solution": "string"
|
||||
}
|
||||
],
|
||||
"default": []
|
||||
},
|
||||
"uncompletedCoursewares": {
|
||||
"type": "array",
|
||||
"default": []
|
||||
},
|
||||
"completedCoursewares": {
|
||||
"type": [
|
||||
{
|
||||
"completedDate": {
|
||||
"type": "string",
|
||||
"defaultFn": "now"
|
||||
},
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"completedWith": "string",
|
||||
"solution": "string",
|
||||
"githubLink": "string",
|
||||
"verified": "boolean"
|
||||
}
|
||||
],
|
||||
"default": []
|
||||
},
|
||||
"currentStreak": {
|
||||
"type": "number",
|
||||
"default": 0
|
||||
@ -133,13 +100,22 @@
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"isLocked": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"currentChallenge": {
|
||||
"type": {}
|
||||
},
|
||||
"isUniqMigrated": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"completedChallenges": {
|
||||
"type": [
|
||||
{
|
||||
"completedDate": "number",
|
||||
"lastUpdated": "number",
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"completedWith": "string",
|
||||
|
@ -49,6 +49,7 @@ var paths = {
|
||||
'!public/js/bundle*',
|
||||
'node_modules/',
|
||||
'client/',
|
||||
'seed',
|
||||
'server/manifests/*.json',
|
||||
'server/rev-manifest.json'
|
||||
],
|
||||
|
12
package.json
12
package.json
@ -11,7 +11,7 @@
|
||||
"prestart-production": "bower cache clean && bower install && gulp build",
|
||||
"start-production": "node pm2Start",
|
||||
"lint": "eslint --ext=.js,.jsx .",
|
||||
"test": "mocha --compilers js:babel/register"
|
||||
"test": "gulp test-challenges"
|
||||
},
|
||||
"license": "(BSD-3-Clause AND CC-BY-SA-4.0)",
|
||||
"dependencies": {
|
||||
@ -58,10 +58,10 @@
|
||||
"gulp-webpack": "^1.5.0",
|
||||
"helmet": "~0.9.0",
|
||||
"helmet-csp": "^0.2.3",
|
||||
"history": "^1.9.0",
|
||||
"jade": "~1.8.0",
|
||||
"json-loader": "^0.5.2",
|
||||
"less": "~1.7.5",
|
||||
"less-middleware": "~2.0.1",
|
||||
"less": "~2.5.1",
|
||||
"lodash": "^3.9.3",
|
||||
"loopback": "https://github.com/FreeCodeCamp/loopback.git#fix/no-password",
|
||||
"loopback-boot": "2.8.2",
|
||||
@ -89,7 +89,7 @@
|
||||
"react": "^0.13.3",
|
||||
"react-bootstrap": "~0.23.7",
|
||||
"react-motion": "~0.1.0",
|
||||
"react-router": "https://github.com/BerkeleyTrue/react-router#freecodecamp",
|
||||
"react-router": "^1.0.0-rc1",
|
||||
"react-vimeo": "^0.0.3",
|
||||
"request": "~2.53.0",
|
||||
"rev-del": "^1.0.5",
|
||||
@ -97,12 +97,14 @@
|
||||
"sanitize-html": "~1.6.1",
|
||||
"sort-keys": "^1.1.1",
|
||||
"source-map-support": "^0.3.2",
|
||||
"store": "https://github.com/berkeleytrue/store.js.git#feature/noop-server",
|
||||
"thundercats": "^2.1.0",
|
||||
"thundercats-react": "^0.1.0",
|
||||
"twit": "~1.1.20",
|
||||
"uglify-js": "~2.4.15",
|
||||
"validator": "~3.22.1",
|
||||
"validator": "^3.22.1",
|
||||
"webpack": "^1.9.12",
|
||||
"xss-filters": "^1.2.6",
|
||||
"yui": "~3.18.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -1,41 +1,45 @@
|
||||
{
|
||||
"name": "Advanced Algorithm Scripting",
|
||||
"order": 0.013,
|
||||
"order": 15,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "aff0395860f5d3034dc0bfc9",
|
||||
"title": "Validate US Telephone Numbers",
|
||||
"difficulty": "4.01",
|
||||
"description": [
|
||||
"Return true if the passed string is a valid US phone number",
|
||||
"The user may fill out the form field any way they choose as long as it is a valid US number. The following are all valid formats for US numbers:",
|
||||
"555-555-5555, (555)555-5555, (555) 555-5555, 555 555 5555, 5555555555, 1 555 555 5555",
|
||||
"For this challenge you will be presented with a string such as \"800-692-7753\" or \"8oo-six427676;laskdjf\". Your job is to validate or reject the US phone number based on any combination of the formats provided above. The area code is required. If the country code is provided, you must confirm that the country code is \"1\". Return true if the string is a valid US phone number; otherwise false.",
|
||||
"<code>555-555-5555</code>",
|
||||
"<code>(555)555-5555</code>",
|
||||
"<code>(555) 555-5555</code>",
|
||||
"<code>555 555 5555</code>",
|
||||
"<code>5555555555</code>",
|
||||
"<code>1 555 555 5555</code>",
|
||||
"For this challenge you will be presented with a string such as <code>800-692-7753</code> or <code>8oo-six427676;laskdjf</code>. Your job is to validate or reject the US phone number based on any combination of the formats provided above. The area code is required. If the country code is provided, you must confirm that the country code is <code>1</code>. Return true if the string is a valid US phone number; otherwise false.",
|
||||
"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."
|
||||
],
|
||||
"tests": [
|
||||
"assert.isBoolean(telephoneCheck(\"555-555-5555\"), 'should return a boolean.');",
|
||||
"assert.deepEqual(telephoneCheck(\"1 555-555-5555\"), true);",
|
||||
"assert.deepEqual(telephoneCheck(\"1 (555) 555-5555\"), true);",
|
||||
"assert.deepEqual(telephoneCheck(\"5555555555\"), true);",
|
||||
"assert.deepEqual(telephoneCheck(\"555-555-5555\"), true);",
|
||||
"assert.deepEqual(telephoneCheck(\"(555)555-5555\"), true);",
|
||||
"assert.deepEqual(telephoneCheck(\"1(555)555-5555\"), true);",
|
||||
"assert.deepEqual(telephoneCheck(\"1 555 555 5555\"), true);",
|
||||
"assert.deepEqual(telephoneCheck(\"555-555-5555\"), true);",
|
||||
"assert.deepEqual(telephoneCheck(\"1 456 789 4444\"), true);",
|
||||
"assert.deepEqual(telephoneCheck(\"123**&!!asdf#\"), false);",
|
||||
"assert.deepEqual(telephoneCheck(\"55555555\"), false);",
|
||||
"assert.deepEqual(telephoneCheck(\"(6505552368)\"), false);",
|
||||
"assert.deepEqual(telephoneCheck(\"2 (757) 622-7382\"), false);",
|
||||
"assert.deepEqual(telephoneCheck(\"0 (757) 622-7382\"), false);",
|
||||
"assert.deepEqual(telephoneCheck(\"-1 (757) 622-7382\"), false);",
|
||||
"assert.deepEqual(telephoneCheck(\"2 757 622-7382\"), false);",
|
||||
"assert.deepEqual(telephoneCheck(\"10 (757) 622-7382\"), false);",
|
||||
"assert.deepEqual(telephoneCheck(\"27576227382\"), false);",
|
||||
"assert.deepEqual(telephoneCheck(\"(275)76227382\"), false);",
|
||||
"assert.deepEqual(telephoneCheck(\"2(757)6227382\"), false);",
|
||||
"assert.deepEqual(telephoneCheck(\"2(757)622-7382\"), false);"
|
||||
"assert.isBoolean(telephoneCheck(\"555-555-5555\"), 'message: should return a boolean.');",
|
||||
"assert(telephoneCheck(\"1 555-555-5555\") === true, 'message: <code>telephoneCheck(\"1 555-555-5555\")</code> should return true.');",
|
||||
"assert(telephoneCheck(\"1 (555) 555-5555\") === true, 'message: <code>telephoneCheck(\"1 (555) 555-5555\")</code> should return true.');",
|
||||
"assert(telephoneCheck(\"5555555555\") === true, 'message: <code>telephoneCheck(\"5555555555\")</code> should return true.');",
|
||||
"assert(telephoneCheck(\"555-555-5555\") === true, 'message: <code>telephoneCheck(\"555-555-5555\")</code> should return true.');",
|
||||
"assert(telephoneCheck(\"(555)555-5555\") === true, 'message: <code>telephoneCheck(\"(555)555-5555\")</code> should return true.');",
|
||||
"assert(telephoneCheck(\"1(555)555-5555\") === true, 'message: <code>telephoneCheck(\"1(555)555-5555\")</code> should return true.');",
|
||||
"assert(telephoneCheck(\"1 555 555 5555\") === true, 'message: <code>telephoneCheck(\"1 555 555 5555\")</code> should return true.');",
|
||||
"assert(telephoneCheck(\"555-555-5555\") === true, 'message: <code>telephoneCheck(\"555-555-5555\")</code> should return true.');",
|
||||
"assert(telephoneCheck(\"1 456 789 4444\") === true, 'message: <code>telephoneCheck(\"1 456 789 4444\")</code> should return true.');",
|
||||
"assert(telephoneCheck(\"123**&!!asdf#\") === false, 'message: <code>telephoneCheck(\"123**&!!asdf#\")</code> should return false.');",
|
||||
"assert(telephoneCheck(\"55555555\") === false, 'message: <code>telephoneCheck(\"55555555\")</code> should return false.');",
|
||||
"assert(telephoneCheck(\"(6505552368)\") === false, 'message: <code>telephoneCheck(\"(6505552368)\")</code> should return false');",
|
||||
"assert(telephoneCheck(\"2 (757) 622-7382\") === false, 'message: <code>telephoneCheck(\"2 (757) 622-7382\")</code> should return false.');",
|
||||
"assert(telephoneCheck(\"0 (757) 622-7382\") === false, 'message: <code>telephoneCheck(\"0 (757) 622-7382\")</code> should return false.');",
|
||||
"assert(telephoneCheck(\"-1 (757) 622-7382\") === false, 'message: <code>telephoneCheck(\"-1 (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(\"10 (757) 622-7382\") === false, 'message: <code>telephoneCheck(\"10 (757) 622-7382\")</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(\"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.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function telephoneCheck(str) {",
|
||||
@ -66,7 +70,6 @@
|
||||
{
|
||||
"id": "a3f503de51cf954ede28891d",
|
||||
"title": "Symmetric Difference",
|
||||
"difficulty": "4.02",
|
||||
"description": [
|
||||
"Create a function that takes two or more arrays and returns an array of the symmetric difference of the provided arrays.",
|
||||
"The mathematical term symmetric difference refers to the elements in two sets that are in either the first or second set, but not in both.",
|
||||
@ -74,16 +77,16 @@
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function sym(args) {",
|
||||
" return arguments;",
|
||||
" return args;",
|
||||
"}",
|
||||
"",
|
||||
"sym([1, 2, 3], [5, 2, 1, 4]);"
|
||||
],
|
||||
"tests": [
|
||||
"assert.sameMembers(sym([1, 2, 3], [5, 2, 1, 4]), [3, 5, 4], 'should return an array of unique values');",
|
||||
"assert.sameMembers(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'should return the symmetric difference of the given arrays');",
|
||||
"assert.sameMembers(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], 'should return an array of unique values');",
|
||||
"assert.sameMembers(sym([1, 1]), [1], 'should return an array of unique values');"
|
||||
"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, 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": [
|
||||
"Array.reduce()",
|
||||
@ -105,7 +108,6 @@
|
||||
{
|
||||
"id": "aa2e6f85cab2ab736c9a9b24",
|
||||
"title": "Exact Change",
|
||||
"difficulty": "4.03",
|
||||
"description": [
|
||||
"Design a cash register drawer function that accepts purchase price as the first argument, payment as the second argument, and cash-in-drawer (cid) as the third argument.",
|
||||
"cid is a 2d array listing available currency.",
|
||||
@ -121,26 +123,26 @@
|
||||
"}",
|
||||
"",
|
||||
"// Example cash-in-drawer array:",
|
||||
"// [['PENNY', 1.01],",
|
||||
"// ['NICKEL', 2.05],",
|
||||
"// ['DIME', 3.10],",
|
||||
"// ['QUARTER', 4.25],",
|
||||
"// ['ONE', 90.00],",
|
||||
"// ['FIVE', 55.00],",
|
||||
"// ['TEN', 20.00],",
|
||||
"// ['TWENTY', 60.00],",
|
||||
"// ['ONE HUNDRED', 100.00]]",
|
||||
"// [[\"PENNY\", 1.01],",
|
||||
"// [\"NICKEL\", 2.05],",
|
||||
"// [\"DIME\", 3.10],",
|
||||
"// [\"QUARTER\", 4.25],",
|
||||
"// [\"ONE\", 90.00],",
|
||||
"// [\"FIVE\", 55.00],",
|
||||
"// [\"TEN\", 20.00],",
|
||||
"// [\"TWENTY\", 60.00],",
|
||||
"// [\"ONE HUNDRED\", 100.00]]",
|
||||
"",
|
||||
"drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);"
|
||||
"drawer(19.50, 20.00, [[\"PENNY\", 1.01], [\"NICKEL\", 2.05], [\"DIME\", 3.10], [\"QUARTER\", 4.25], [\"ONE\", 90.00], [\"FIVE\", 55.00], [\"TEN\", 20.00], [\"TWENTY\", 60.00], [\"ONE HUNDRED\", 100.00]]);"
|
||||
],
|
||||
"tests": [
|
||||
"assert.isArray(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]]), 'should return an array.');",
|
||||
"assert.isString(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]]), 'should return a string.');",
|
||||
"assert.isString(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]]), 'should return a string.');",
|
||||
"assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['QUARTER', 0.50]], 'return correct change');",
|
||||
"assert.deepEqual(drawer(3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]), [['TWENTY', 60.00], ['TEN', 20.00], ['FIVE', 15], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04] ], 'return correct change with multiple coins and bills');",
|
||||
"assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.01], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), 'Insufficient Funds', 'insufficient funds');",
|
||||
"assert.deepEqual(drawer(19.50, 20.00, [['PENNY', 0.50], ['NICKEL', 0], ['DIME', 0], ['QUARTER', 0], ['ONE', 0], ['FIVE', 0], ['TEN', 0], ['TWENTY', 0], ['ONE HUNDRED', 0]]), \"Closed\", 'cash-in-drawer equals change');"
|
||||
"assert.isArray(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]]), '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 an array.');",
|
||||
"assert.isString(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]]), '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 a string.');",
|
||||
"assert.isString(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]]), '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 a string.');",
|
||||
"assert.deepEqual(drawer(19.50, 20.00, [[\"PENNY\", 1.01], [\"NICKEL\", 2.05], [\"DIME\", 3.10], [\"QUARTER\", 4.25], [\"ONE\", 90.00], [\"FIVE\", 55.00], [\"TEN\", 20.00], [\"TWENTY\", 60.00], [\"ONE HUNDRED\", 100.00]]), [[\"QUARTER\", 0.50]], '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(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.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": [
|
||||
"Global Object"
|
||||
@ -161,7 +163,6 @@
|
||||
{
|
||||
"id": "a56138aff60341a09ed6c480",
|
||||
"title": "Inventory Update",
|
||||
"difficulty": "4.04",
|
||||
"description": [
|
||||
"Compare and update inventory stored in a 2d array against a second 2d array of a fresh delivery. Update current inventory item quantity, and if an item cannot be found, add the new item and quantity into the inventory array in alphabetical order.",
|
||||
"Remember to use <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."
|
||||
@ -174,28 +175,28 @@
|
||||
"",
|
||||
"// Example inventory lists",
|
||||
"var curInv = [",
|
||||
" [21, 'Bowling Ball'],",
|
||||
" [2, 'Dirty Sock'],",
|
||||
" [1, 'Hair Pin'],",
|
||||
" [5, 'Microphone']",
|
||||
" [21, \"Bowling Ball\"],",
|
||||
" [2, \"Dirty Sock\"],",
|
||||
" [1, \"Hair Pin\"],",
|
||||
" [5, \"Microphone\"]",
|
||||
"];",
|
||||
"",
|
||||
"var newInv = [",
|
||||
" [2, 'Hair Pin'],",
|
||||
" [3, 'Half-Eaten Apple'],",
|
||||
" [67, 'Bowling Ball'],",
|
||||
" [7, 'Toothpaste']",
|
||||
" [2, \"Hair Pin\"],",
|
||||
" [3, \"Half-Eaten Apple\"],",
|
||||
" [67, \"Bowling Ball\"],",
|
||||
" [7, \"Toothpaste\"]",
|
||||
"];",
|
||||
"",
|
||||
"inventory(curInv, newInv);"
|
||||
],
|
||||
"tests": [
|
||||
"assert.isArray(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), 'should return an array.');",
|
||||
"assert.equal(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]).length, 6, 'should return an array with a length of 6.');",
|
||||
"assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']]);",
|
||||
"assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], []), [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']]);",
|
||||
"assert.deepEqual(inventory([], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[67, 'Bowling Ball'], [2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [7, 'Toothpaste']]);",
|
||||
"assert.deepEqual(inventory([[0, 'Bowling Ball'], [0, 'Dirty Sock'], [0, 'Hair Pin'], [0, 'Microphone']], [[1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [1, 'Bowling Ball'], [1, 'Toothpaste']]), [[1, 'Bowling Ball'], [0, 'Dirty Sock'], [1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [0, 'Microphone'], [1, 'Toothpaste']]);"
|
||||
"assert.isArray(inventory([[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], [[2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [67, \"Bowling Ball\"], [7, \"Toothpaste\"]]), 'message: <code>inventory()</code> should return an array.');",
|
||||
"assert.equal(inventory([[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], [[2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [67, \"Bowling Ball\"], [7, \"Toothpaste\"]]).length, 6, 'message: <code>inventory([[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], [[2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [67, \"Bowling Ball\"], [7, \"Toothpaste\"]]).length</code> should return an array with a length of 6.');",
|
||||
"assert.deepEqual(inventory([[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], [[2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [67, \"Bowling Ball\"], [7, \"Toothpaste\"]]), [[88, \"Bowling Ball\"], [2, \"Dirty Sock\"], [3, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [5, \"Microphone\"], [7, \"Toothpaste\"]], 'message: <code>inventory([[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], [[2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [67, \"Bowling Ball\"], [7, \"Toothpaste\"]])</code> should return <code>[[88, \"Bowling Ball\"], [2, \"Dirty Sock\"], [3, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [5, \"Microphone\"], [7, \"Toothpaste\"]]</code>.');",
|
||||
"assert.deepEqual(inventory([[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], []), [[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], 'message: <code>inventory([[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], [])</code> should return <code>[[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]]</code>.');",
|
||||
"assert.deepEqual(inventory([], [[2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [67, \"Bowling Ball\"], [7, \"Toothpaste\"]]), [[67, \"Bowling Ball\"], [2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [7, \"Toothpaste\"]], 'message: <code>inventory([], [[2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [67, \"Bowling Ball\"], [7, \"Toothpaste\"]])</code> should return <code>[[67, \"Bowling Ball\"], [2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [7, \"Toothpaste\"]]</code>.');",
|
||||
"assert.deepEqual(inventory([[0, \"Bowling Ball\"], [0, \"Dirty Sock\"], [0, \"Hair Pin\"], [0, \"Microphone\"]], [[1, \"Hair Pin\"], [1, \"Half-Eaten Apple\"], [1, \"Bowling Ball\"], [1, \"Toothpaste\"]]), [[1, \"Bowling Ball\"], [0, \"Dirty Sock\"], [1, \"Hair Pin\"], [1, \"Half-Eaten Apple\"], [0, \"Microphone\"], [1, \"Toothpaste\"]], 'message: <code>inventory([[0, \"Bowling Ball\"], [0, \"Dirty Sock\"], [0, \"Hair Pin\"], [0, \"Microphone\"]], [[1, \"Hair Pin\"], [1, \"Half-Eaten Apple\"], [1, \"Bowling Ball\"], [1, \"Toothpaste\"]])</code> should return <code>[[1, \"Bowling Ball\"], [0, \"Dirty Sock\"], [1, \"Hair Pin\"], [1, \"Half-Eaten Apple\"], [0, \"Microphone\"], [1, \"Toothpaste\"]]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Global Array Object"
|
||||
@ -216,7 +217,6 @@
|
||||
{
|
||||
"id": "a7bf700cd123b9a54eef01d5",
|
||||
"title": "No repeats please",
|
||||
"difficulty": "4.05",
|
||||
"description": [
|
||||
"Return the number of total permutations of the provided string that don't have repeated consecutive letters.",
|
||||
"For example, 'aab' should return 2 because it has 6 total permutations, but only 2 of them don't have the same letter (in this case 'a') repeating.",
|
||||
@ -230,13 +230,13 @@
|
||||
"permAlone('aab');"
|
||||
],
|
||||
"tests": [
|
||||
"assert.isNumber(permAlone('aab'), 'should return a \"number\".');",
|
||||
"assert.strictEqual(permAlone('aab'), 2, 'should return 2.');",
|
||||
"assert.strictEqual(permAlone('aaa'), 0, 'should return 0.');",
|
||||
"assert.strictEqual(permAlone('aabb'), 8, 'should return 8.');",
|
||||
"assert.strictEqual(permAlone('abcdefa'), 3600, 'should return 3600.');",
|
||||
"assert.strictEqual(permAlone('abfdefa'), 2640, 'should return 2640.');",
|
||||
"assert.strictEqual(permAlone('zzzzzzzz'), 0, 'should return 0.');"
|
||||
"assert.isNumber(permAlone('aab'), 'message: <code>permAlone()</code> should return a number.');",
|
||||
"assert.strictEqual(permAlone('aab'), 2, 'message: <code>permAlone(aab)</code> should return 2.');",
|
||||
"assert.strictEqual(permAlone('aaa'), 0, 'message: <code>permAlone(aaa)</code> should return 0.');",
|
||||
"assert.strictEqual(permAlone('aabb'), 8, 'message: <code>permAlone(aabb)</code> should return 8.');",
|
||||
"assert.strictEqual(permAlone('abcdefa'), 3600, 'message: <code>permAlone(abcdefa)</code> should return 3600.');",
|
||||
"assert.strictEqual(permAlone('abfdefa'), 2640, 'message: <code>permAlone(abfdefa)</code> should return 2640.');",
|
||||
"assert.strictEqual(permAlone('zzzzzzzz'), 0, 'message: <code>permAlone(zzzzzzzz)</code> should return 0.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Permutations",
|
||||
@ -259,7 +259,6 @@
|
||||
"id": "a19f0fbe1872186acd434d5a",
|
||||
"title": "Friendly Date Ranges",
|
||||
"dashedName": "bonfire-friendly-date-ranges",
|
||||
"difficulty": "4.06",
|
||||
"description": [
|
||||
"Implement a way of converting two dates into a more friendly date range that could be presented to a user.",
|
||||
"It must not show any redundant information in the date range.",
|
||||
@ -276,12 +275,12 @@
|
||||
"friendly(['2015-07-01', '2015-07-04']);"
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'ending month should be omitted since it is already mentioned');",
|
||||
"assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'two months apart can be inferred if it is the next year');",
|
||||
"assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017']);",
|
||||
"assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th'], 'one month apart can be inferred it is the same year');",
|
||||
"assert.deepEqual(friendly(['2017-01-01', '2017-01-01']), ['January 1st, 2017'], 'since we do not duplicate only return once');",
|
||||
"assert.deepEqual(friendly(['2022-09-05', '2023-09-04']), ['September 5th, 2022','September 4th, 2023']);"
|
||||
"assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'message: <code>friendly([\"2015-07-01\", \"2015-07-04\"])</code> should return <code>[\"July 1st\",\"4th\"]</code>.');",
|
||||
"assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'message: <code>friendly([\"2015-12-01\", \"2016-02-03\"])</code> should return <code>[\"December 1st\",\"February 3rd\"]</code>.');",
|
||||
"assert.deepEqual(friendly(['2015-12-01', '2017-02-03']), ['December 1st, 2015','February 3rd, 2017'], 'message: <code>friendly([\"2015-12-01\", \"2017-02-03\"])</code> should return <code>[\"December 1st, 2015\",\"February 3rd, 2017\"]</code>.');",
|
||||
"assert.deepEqual(friendly(['2016-03-01', '2016-05-05']), ['March 1st','May 5th'], 'message: <code>friendly([\"2016-03-01\", \"2016-05-05\"])</code> should return <code>[\"March 1st\",\"May 5th\"]</code>');",
|
||||
"assert.deepEqual(friendly(['2017-01-01', '2017-01-01']), ['January 1st, 2017'], 'message: <code>friendly([\"2017-01-01\", \"2017-01-01\"])</code> should return <code>[\"January 1st, 2017\"]</code>.');",
|
||||
"assert.deepEqual(friendly(['2022-09-05', '2023-09-04']), ['September 5th, 2022','September 4th, 2023'], 'message: <code>friendly([\"2022-09-05\", \"2023-09-04\"])</code> should return <code>[\"September 5th, 2022\",\"September 4th, 2023\"]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"String.split()",
|
||||
|
@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "AngularJS",
|
||||
"order": 0.014,
|
||||
"order": 16,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bd7154d8c441eddfaeb5bdef",
|
||||
"title": "Get Started with Angular.js",
|
||||
"difficulty": 0.34,
|
||||
"challengeSeed": ["114684726"],
|
||||
"description": [
|
||||
"Code School has a short, free Angular.js course. This will give us a quick tour of Angular.js's mechanics and features.",
|
||||
@ -29,7 +28,6 @@
|
||||
{
|
||||
"id": "bd7155d8c441eddfaeb5bdef",
|
||||
"title": "Apply Angular.js Directives",
|
||||
"difficulty": 0.35,
|
||||
"challengeSeed": ["114684727"],
|
||||
"description": [
|
||||
"Directives serve as markers in your HTML. When Angular.js compiles your HTML, it will alter the behavior of DOM elements based on the directives you've used.",
|
||||
@ -53,7 +51,6 @@
|
||||
{
|
||||
"id": "bd7156d8c441eddfaeb5bdef",
|
||||
"title": "Power Forms with Angular.js",
|
||||
"difficulty": 0.36,
|
||||
"challengeSeed": ["114684729"],
|
||||
"description": [
|
||||
"One area where Angular.js really shines is its powerful web forms.",
|
||||
@ -77,7 +74,6 @@
|
||||
{
|
||||
"id": "bd7157d8c441eddfaeb5bdef",
|
||||
"title": "Customize Angular.js Directives",
|
||||
"difficulty": 0.37,
|
||||
"challengeSeed": ["114685062"],
|
||||
"description": [
|
||||
"Now we'll learn how to modify existing Angular.js directives, and even build directives of your own.",
|
||||
@ -100,7 +96,6 @@
|
||||
{
|
||||
"id": "bd7158d8c441eddfaeb5bdef",
|
||||
"title": "Create Angular.js Services",
|
||||
"difficulty": 0.38,
|
||||
"challengeSeed": ["114685060"],
|
||||
"description": [
|
||||
"Services are functions that you can use and reuse throughout your Angular.js app to get things done.",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Automated Testing and Debugging",
|
||||
"order": 0.012,
|
||||
"order": 14,
|
||||
"challenges": [
|
||||
{
|
||||
"id":"cf1111c1c16feddfaeb6bdef",
|
||||
@ -13,7 +13,7 @@
|
||||
"<code>console.log('Hello world!')</code>"
|
||||
],
|
||||
"tests":[
|
||||
"assert(editor.getValue().match(/console\\.log\\(/gi), 'You should use the console.log method to log \"Hello world!\" to your JavaScript console.');"
|
||||
"assert(editor.getValue().match(/console\\.log\\(/gi), 'message: You should use the console.log method to log \"Hello world!\" to your JavaScript console.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"",
|
||||
@ -37,10 +37,10 @@
|
||||
"<code>console.log(typeof({}));</code>"
|
||||
],
|
||||
"tests":[
|
||||
"assert(editor.getValue().match(/console\\.log\\(typeof\\(\"\"\\)\\);/gi), 'You should <code>console.log</code> the <code>typeof</code> a string.');",
|
||||
"assert(editor.getValue().match(/console\\.log\\(typeof\\(0\\)\\);/gi), 'You should <code>console.log</code> the <code>typeof</code> a number.');",
|
||||
"assert(editor.getValue().match(/console\\.log\\(typeof\\(\\[\\]\\)\\);/gi), 'You should <code>console.log</code> the <code>typeof</code> an array.');",
|
||||
"assert(editor.getValue().match(/console\\.log\\(typeof\\(\\{\\}\\)\\);/gi), 'You should <code>console.log</code> the <code>typeof</code> a object.');"
|
||||
"assert(editor.getValue().match(/console\\.log\\(typeof\\(\"\"\\)\\);/gi), 'message: You should <code>console.log</code> the <code>typeof</code> a string.');",
|
||||
"assert(editor.getValue().match(/console\\.log\\(typeof\\(0\\)\\);/gi), 'message: You should <code>console.log</code> the <code>typeof</code> a number.');",
|
||||
"assert(editor.getValue().match(/console\\.log\\(typeof\\(\\[\\]\\)\\);/gi), 'message: You should <code>console.log</code> the <code>typeof</code> an array.');",
|
||||
"assert(editor.getValue().match(/console\\.log\\(typeof\\(\\{\\}\\)\\);/gi), 'message: You should <code>console.log</code> the <code>typeof</code> a object.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"",
|
||||
|
@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "Full Stack JavaScript Projects",
|
||||
"order": 0.019,
|
||||
"order": 20,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bd7158d8c443eddfaeb5bcef",
|
||||
"title": "Get Set for Basejumps",
|
||||
"difficulty": 2.00,
|
||||
"challengeSeed": ["128451852"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Get the MEAN stack running on Cloud 9, push your code to GitHub, and deploy it to Heroku.",
|
||||
@ -66,7 +65,6 @@
|
||||
{
|
||||
"id": "bd7158d8c443eddfaeb5bdef",
|
||||
"title": "Build a Voting App",
|
||||
"difficulty": 2.01,
|
||||
"challengeSeed": ["133315786"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a full stack JavaScript app that successfully reverse-engineers this: <a href='http://votingapp.herokuapp.com/' target='_blank'>http://votingapp.herokuapp.com/</a> and deploy it to Heroku.",
|
||||
@ -86,7 +84,7 @@
|
||||
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku. If you pair programmed with a friend, enter his or her Free Code Camp username as well so that you both get credit for completing it.",
|
||||
"If you'd like immediate feedback on your project 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>"
|
||||
],
|
||||
"type": "basejumps",
|
||||
"type": "basejump",
|
||||
"challengeType": 4,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
@ -103,7 +101,6 @@
|
||||
{
|
||||
"id": "bd7158d8c443eddfaeb5bdff",
|
||||
"title": "Build a Nightlife Coordination App",
|
||||
"difficulty": 2.02,
|
||||
"challengeSeed": ["133315781"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a full stack JavaScript app that successfully reverse-engineers this: <a href='http://whatsgoinontonight.herokuapp.com/' target='_blank'>http://whatsgoinontonight.herokuapp.com/</a> and deploy it to Heroku.",
|
||||
@ -137,7 +134,6 @@
|
||||
{
|
||||
"id": "bd7158d8c443eddfaeb5bd0e",
|
||||
"title": "Chart the Stock Market",
|
||||
"difficulty": 2.03,
|
||||
"challengeSeed": ["133315787"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a full stack JavaScript app that successfully reverse-engineers this: <a href='http://stockstream.herokuapp.com/' target='_blank'>http://stockstream.herokuapp.com/</a> and deploy it to Heroku.",
|
||||
@ -170,7 +166,6 @@
|
||||
{
|
||||
"id": "bd7158d8c443eddfaeb5bd0f",
|
||||
"title": "Manage a Book Trading Club",
|
||||
"difficulty": 2.04,
|
||||
"challengeSeed": ["133316032"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a full stack JavaScript app that successfully reverse-engineers this: <a href='http://bookjump.herokuapp.com/' target='_blank'>http://bookjump.herokuapp.com/</a> and deploy it to Heroku.",
|
||||
@ -203,7 +198,6 @@
|
||||
{
|
||||
"id": "bd7158d8c443eddfaeb5bdee",
|
||||
"title": "Build a Pinterest Clone",
|
||||
"difficulty": 2.05,
|
||||
"challengeSeed": ["133315784"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a full stack JavaScript app that successfully reverse-engineers this: <a href='http://stark-lowlands-3680.herokuapp.com/' target='_blank'>http://stark-lowlands-3680.herokuapp.com/</a> and deploy it to Heroku.",
|
||||
|
@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "Basic Algorithm Scripting",
|
||||
"order": 0.007,
|
||||
"order": 7,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "ad7123c8c441eddfaeb5bdef",
|
||||
"title": "Meet Bonfire",
|
||||
"difficulty": "0",
|
||||
"description": [
|
||||
"Your goal is to fix the failing test.",
|
||||
"First, run all the tests by clicking \"Run tests\" or by pressing Control + Enter.",
|
||||
@ -13,8 +12,8 @@
|
||||
"Make this function return true no matter what."
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof(meetBonfire()) === \"boolean\", 'The result should be a Boolean value of true or false.');",
|
||||
"assert(meetBonfire() === true, 'Your <code>meetBonfire()</code> function should return <code>true</code>.');"
|
||||
"assert(typeof(meetBonfire()) === \"boolean\", 'message: <code>meetBonfire()</code> should return a boolean value.');",
|
||||
"assert(meetBonfire() === true, 'message: <code>meetBonfire()</code> should return true.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function meetBonfire(argument) {",
|
||||
@ -44,12 +43,11 @@
|
||||
{
|
||||
"id": "a202eed8fc186c8434cb6d61",
|
||||
"title": "Reverse a String",
|
||||
"difficulty": "1.01",
|
||||
"tests": [
|
||||
"assert(typeof(reverseString(\"hello\")) === \"string\", '<code>reverseString()</code> should return a string.');",
|
||||
"assert(reverseString(\"hello\") === \"olleh\", '<code>\"hello\"</code> should become <code>\"olleh\"</code>.');",
|
||||
"assert(reverseString(\"Howdy\") === \"ydwoH\", '<code>\"Howdy\"</code> should become <code>\"ydwoH\"</code>.');",
|
||||
"assert(reverseString(\"Greetings from Earth\") === \"htraE morf sgniteerG\", '<code>\"Greetings from Earth\"</code> should return <code>\"htraE morf sgniteerG\"</code>.');"
|
||||
"assert(typeof(reverseString(\"hello\")) === \"string\", 'message: <code>reverseString()</code> should return a string.');",
|
||||
"assert(reverseString(\"hello\") === \"olleh\", 'message: <code>reverseString(\"hello\")</code> should become <code>\"olleh\"</code>.');",
|
||||
"assert(reverseString(\"Howdy\") === \"ydwoH\", 'message: <code>reverseString(\"Howdy\")</code> should become <code>\"ydwoH\"</code>.');",
|
||||
"assert(reverseString(\"Greetings from Earth\") === \"htraE morf sgniteerG\", 'message: <code>reverseString(\"Greetings from Earth\")</code> should return <code>\"htraE morf sgniteerG\"</code>.');"
|
||||
],
|
||||
"description": [
|
||||
"Reverse the provided string.",
|
||||
@ -87,13 +85,12 @@
|
||||
"id": "a302f7aae1aa3152a5b413bc",
|
||||
"title": "Factorialize a Number",
|
||||
"tests": [
|
||||
"assert(typeof(factorialize(5)) === \"number\", '<code>factorialize()</code> should return a number.');",
|
||||
"assert(factorialize(5) === 120, '<code>5</code> should return <code>120</code>.');",
|
||||
"assert(factorialize(10) === 3628800, '<code>10</code> should return <code>3,628,800</code>.');",
|
||||
"assert(factorialize(20) === 2432902008176640000, '<code>20</code> should return <code>2,432,902,008,176,640,000</code>.');",
|
||||
"assert(factorialize(0) === 1, '<code>0</code> should return 1.');"
|
||||
"assert(typeof(factorialize(5)) === \"number\", 'message: <code>factorialize()</code> should return a number.');",
|
||||
"assert(factorialize(5) === 120, 'message: <code>factorialize(5)</code> should return 120.');",
|
||||
"assert(factorialize(10) === 3628800, 'message: <code>factorialize(10)</code> should return 3628800.');",
|
||||
"assert(factorialize(20) === 2432902008176640000, 'message: <code>factorialize(20)</code> should return 2432902008176640000.');",
|
||||
"assert(factorialize(0) === 1, 'message: <code>factorialize(0)</code> should return 1.');"
|
||||
],
|
||||
"difficulty": "1.02",
|
||||
"description": [
|
||||
"Return the factorial of the provided integer.",
|
||||
"If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.",
|
||||
@ -127,7 +124,6 @@
|
||||
{
|
||||
"id": "aaa48de84e1ecc7c742e1124",
|
||||
"title": "Check for Palindromes",
|
||||
"difficulty": "1.03",
|
||||
"description": [
|
||||
"Return true if the given string is a palindrome. Otherwise, return false.",
|
||||
"A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.",
|
||||
@ -136,17 +132,17 @@
|
||||
"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."
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof(palindrome(\"eye\")) === \"boolean\", '<code>palindrome()<code> should return a boolean.');",
|
||||
"assert(palindrome(\"eye\") === true, '<code>\"eye\"</code> should return true.');",
|
||||
"assert(palindrome(\"race car\") === true, '<code>\"race car\"</code> should return true.');",
|
||||
"assert(palindrome(\"not a palindrome\") === false, '<code>\"not a palindrome\"</code> should return false.');",
|
||||
"assert(palindrome(\"A man, a plan, a canal. Panama\") === true, '<code>\"A man, a plan, a canal. Panama\"</code> should return true.');",
|
||||
"assert(palindrome(\"never odd or even\") === true, '<code>\"never odd or even\"</code> should return true.');",
|
||||
"assert(palindrome(\"nope\") === false, '<code>\"nope\"</code> should return false.');",
|
||||
"assert(palindrome(\"almostomla\") === false, '<code>\"almostomla\"</code> should return false.');",
|
||||
"assert(palindrome(\"My age is 0, 0 si ega ym.\") === true, '<code>\"My age is 0, 0 si ega ym.\"</code> should return true.');",
|
||||
"assert(palindrome(\"1 eye for of 1 eye.\") === false, '<code>\"1 eye for of 1 eye.\"</code> should return false.');",
|
||||
"assert(palindrome(\"0_0 (: /-\\ :) 0-0\") === true, '<code>\"0_0 (: /-\\\\ :) 0-0\"</code> should return true.');"
|
||||
"assert(typeof(palindrome(\"eye\")) === \"boolean\", 'message: <code>palindrome()</code> should return a boolean.');",
|
||||
"assert(palindrome(\"eye\") === true, 'message: <code>palindrome(\"eye\")</code> should return true.');",
|
||||
"assert(palindrome(\"race car\") === true, 'message: <code>palindrome(\"race car\")</code> should return true.');",
|
||||
"assert(palindrome(\"not a palindrome\") === false, 'message: <code>palindrome(\"not a palindrome\")</code> should return false.');",
|
||||
"assert(palindrome(\"A man, a plan, a canal. Panama\") === true, 'message: <code>palindrome(\"A man, a plan, a canal. Panama\")</code> should return true.');",
|
||||
"assert(palindrome(\"never odd or even\") === true, 'message: <code>palindrome(\"never odd or even\")</code> should return true.');",
|
||||
"assert(palindrome(\"nope\") === false, 'message: <code>palindrome(\"nope\")</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(\"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.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function palindrome(str) {",
|
||||
@ -178,7 +174,6 @@
|
||||
{
|
||||
"id": "a26cbbe9ad8655a977e1ceb5",
|
||||
"title": "Find the Longest Word in a String",
|
||||
"difficulty": "1.04",
|
||||
"description": [
|
||||
"Return the length of the longest word in the provided sentence.",
|
||||
"Your response should be a number.",
|
||||
@ -192,12 +187,12 @@
|
||||
"findLongestWord(\"The quick brown fox jumped over the lazy dog\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof(findLongestWord(\"The quick brown fox jumped over the lazy dog\")) === \"number\", '<code>findLongestWord()</code> should return a number.');",
|
||||
"assert(findLongestWord(\"The quick brown fox jumped over the lazy dog\") === 6, '<code>\"The quick brown fox jumped over the lazy dog\"</code> should return <code>6</code>.');",
|
||||
"assert(findLongestWord(\"May the force be with you\") === 5, '<code>\"May the force be with you\"</code> should return <code>5</code>.');",
|
||||
"assert(findLongestWord(\"Google do a barrel roll\") === 6, '<code>\"Google do a barrel roll\"</code> should return <code>6</code>.');",
|
||||
"assert(findLongestWord(\"What is the average airspeed velocity of an unladen swallow\") === 8, '<code>\"What is the average airspeed velocity of an unladen swallow\"</code> should return <code>8</code>.');",
|
||||
"assert(findLongestWord(\"What if we try a super-long word such as otorhinolaryngology\") === 19, '<code>\"What if we try a super-long word such as otorhinolaryngology\"</code> should return <code>19</code>.');"
|
||||
"assert(typeof(findLongestWord(\"The quick brown fox jumped over the lazy dog\")) === \"number\", 'message: <code>findLongestWord()</code> should return a number.');",
|
||||
"assert(findLongestWord(\"The quick brown fox jumped over the lazy dog\") === 6, 'message: <code>findLongestWord(\"The quick brown fox jumped over the lazy dog\")</code> should return 6.');",
|
||||
"assert(findLongestWord(\"May the force be with you\") === 5, 'message: <code>findLongestWord(\"May the force be with you\")</code> should return 5.');",
|
||||
"assert(findLongestWord(\"Google do a barrel roll\") === 6, 'message: <code>findLongestWord(\"Google do a barrel roll\")</code> should return 6.');",
|
||||
"assert(findLongestWord(\"What is the average airspeed velocity of an unladen swallow\") === 8, 'message: <code>findLongestWord(\"What is the average airspeed velocity of an unladen swallow\")</code> should return 8.');",
|
||||
"assert(findLongestWord(\"What if we try a super-long word such as otorhinolaryngology\") === 19, 'message: <code>findLongestWord(\"What if we try a super-long word such as otorhinolaryngology\")</code> should return 19.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"String.split()",
|
||||
@ -219,7 +214,6 @@
|
||||
{
|
||||
"id": "ab6137d4e35944e21037b769",
|
||||
"title": "Title Case a Sentence",
|
||||
"difficulty": "1.05",
|
||||
"description": [
|
||||
"Return the provided string with the first letter of each word capitalized. Make sure the rest of the word is in lower case.",
|
||||
"For the purpose of this exercise, you should also capitalize connecting words like \"the\" and \"of\".",
|
||||
@ -233,10 +227,10 @@
|
||||
"titleCase(\"I'm a little tea pot\", \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof(titleCase(\"I'm a little tea pot\")) === \"string\", '<code>titleCase()</code> should return a string.');",
|
||||
"assert(titleCase(\"I'm a little tea pot\") === \"I'm A Little Tea Pot\", '<code>\"I'm a little tea pot\"</code> should return <code>\"I'm A Little Tea Pot\"</code>.');",
|
||||
"assert(titleCase(\"sHoRt AnD sToUt\") === \"Short And Stout\", '<code>\"sHoRt AnD sToUt\"</code> should return <code>\"Short And Stout\"</code>.');",
|
||||
"assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", '<code>\"HERE IS MY HANDLE HERE IS MY SPOUT\"</code> should return <code>\"Here Is My Handle Here Is My Spout\"</code>');"
|
||||
"assert(typeof(titleCase(\"I'm a little tea pot\")) === \"string\", 'message: <code>titleCase()</code> should return a string.');",
|
||||
"assert(titleCase(\"I'm a little tea pot\") === \"I'm A Little Tea Pot\", 'message: <code>titleCase(\"I'm a little tea pot\")</code> should return \"I'm A Little Tea Pot\".');",
|
||||
"assert(titleCase(\"sHoRt AnD sToUt\") === \"Short And Stout\", 'message: <code>titleCase(\"sHoRt AnD sToUt\")</code> should return \"Short And Stout\".');",
|
||||
"assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", 'message: <code>titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\")</code> should return \"Here Is My Handle Here Is My Spout\".');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"String.charAt()"
|
||||
@ -257,7 +251,6 @@
|
||||
{
|
||||
"id": "a789b3483989747d63b0e427",
|
||||
"title": "Return Largest Numbers in Arrays",
|
||||
"difficulty": "1.06",
|
||||
"description": [
|
||||
"Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays.",
|
||||
"Remember, you can iterate through an array with a simple for loop, and access each member with array syntax arr[i] .",
|
||||
@ -270,12 +263,12 @@
|
||||
" return arr;",
|
||||
"}",
|
||||
"",
|
||||
"largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]], \"\");"
|
||||
"largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);"
|
||||
],
|
||||
"tests": [
|
||||
"assert(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]).constructor === Array, '<code>largestOfFour()</code> should return an array.');",
|
||||
"assert.deepEqual(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]), [27,5,39,1001], '<code>[[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]</code> should return <code>[27,5,39,1001]</code>.');",
|
||||
"assert.deepEqual(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]), [9,35,97,1000000], '<code>[[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]</code> should return <code>[9, 35, 97, 1000000]</code>.');"
|
||||
"assert(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]).constructor === Array, 'message: <code>largestOfFour()</code> should return an array.');",
|
||||
"assert.deepEqual(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]), [27,5,39,1001], 'message: <code>largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])</code> should return <code>[27,5,39,1001]</code>.');",
|
||||
"assert.deepEqual(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]), [9,35,97,1000000], 'message: <code>largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]])</code> should return <code>[9, 35, 97, 1000000]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Comparison Operators"
|
||||
@ -296,7 +289,6 @@
|
||||
{
|
||||
"id": "acda2fb1324d9b0fa741e6b5",
|
||||
"title": "Confirm the Ending",
|
||||
"difficulty": "1.07",
|
||||
"description": [
|
||||
"Check if a string (first argument) ends with the given target string (second argument).",
|
||||
"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."
|
||||
@ -311,11 +303,11 @@
|
||||
"end(\"Bastian\", \"n\", \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(end(\"Bastian\", \"n\") === true, '<code>\"Bastian\", \"n\"</code> should return true.');",
|
||||
"assert(end(\"Connor\", \"n\") === false, '<code>\"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, '<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, '<code>\"He has to give me a new name\", \"name\"</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, '<code>\"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(\"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(\"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(\"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(\"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": [
|
||||
"String.substr()"
|
||||
@ -336,7 +328,6 @@
|
||||
{
|
||||
"id": "afcc8d540bea9ea2669306b6",
|
||||
"title": "Repeat a string repeat a string",
|
||||
"difficulty": "1.08",
|
||||
"description": [
|
||||
"Repeat a given string (first argument) n times (second argument). Return an empty string if n is a negative number.",
|
||||
"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."
|
||||
@ -350,9 +341,9 @@
|
||||
"repeat(\"abc\", 3, \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(repeat(\"*\", 3) === \"***\", '<code>\"*\", 3</code> should return <code>\"***\"</code>.');",
|
||||
"assert(repeat(\"abc\", 3) === \"abcabcabc\", '<code>\"abc\", 3</code> should return <code>\"abcabcabc\"</code>.');",
|
||||
"assert(repeat(\"abc\", -2) === \"\", '<code>\"abc\", -2</code> should return <code>\"\"</code>.');"
|
||||
"assert(repeat(\"*\", 3) === \"***\", 'message: <code>repeat(\"*\", 3)</code> should return <code>\"***\"</code>.');",
|
||||
"assert(repeat(\"abc\", 3) === \"abcabcabc\", 'message: <code>repeat(\"abc\", 3)</code> should return <code>\"abcabcabc\"</code>.');",
|
||||
"assert(repeat(\"abc\", -2) === \"\", 'message: <code>repeat(\"abc\", -2)</code> should return <code>\"\"</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Global String Object"
|
||||
@ -373,7 +364,6 @@
|
||||
{
|
||||
"id": "ac6993d51946422351508a41",
|
||||
"title": "Truncate a string",
|
||||
"difficulty": "1.09",
|
||||
"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.",
|
||||
"Note that the three dots at the end add to the string length.",
|
||||
@ -388,10 +378,10 @@
|
||||
"truncate(\"A-tisket a-tasket A green and yellow basket\", 11, \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(truncate(\"A-tisket a-tasket A green and yellow basket\", 11) === \"A-tisket...\", '<code>\"A-tisket a-tasket A green and yellow basket\", 1</code> should return <code>\"A-tisket...\"</code>.');",
|
||||
"assert(truncate(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", '<code>\"Peter Piper picked a peck of pickled peppers\", 14</code> should return <code>\"Peter Piper...\"</code>.');",
|
||||
"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\", '<code>\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length)</code> should return <code>\"A-tisket a-tasket A green and yellow basket\"</code>.');",
|
||||
"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', '<code>\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length + 2</code> should return <code>\"A-tisket a-tasket A green and yellow basket\"</code>.');"
|
||||
"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\", 1)</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(\"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\".');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"String.slice()"
|
||||
@ -412,7 +402,6 @@
|
||||
{
|
||||
"id": "a9bd25c716030ec90084d8a1",
|
||||
"title": "Chunky Monkey",
|
||||
"difficulty": "1.10",
|
||||
"description": [
|
||||
"Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.",
|
||||
"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."
|
||||
@ -426,10 +415,10 @@
|
||||
"chunk([\"a\", \"b\", \"c\", \"d\"], 2, \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(chunk([\"a\", \"b\", \"c\", \"d\"], 2), [[\"a\", \"b\"], [\"c\", \"d\"]], '<code>[\"a\", \"b\", \"c\", \"d\"], 2</code> should return <code>[[\"a\", \"b\"], [\"c\", \"d\"]]</code>.');",
|
||||
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], '<code>[0, 1, 2, 3, 4, 5]</code> should return <code>[[0, 1, 2], [3, 4, 5]]</code>.');",
|
||||
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], '<code>[0, 1, 2, 3, 4, 5], 2</code> should return <code>[[0, 1], [2, 3], [4, 5]]</code>.');",
|
||||
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], '<code>[0, 1, 2, 3, 4, 5], 4</code> should return <code>[[0, 1, 2, 3], [4, 5]]</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>.');",
|
||||
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'message: <code>chunk([0, 1, 2, 3, 4, 5], 3)</code> should return <code>[[0, 1, 2], [3, 4, 5]]</code>.');",
|
||||
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], 'message: <code>chunk([0, 1, 2, 3, 4, 5], 2)</code> should return <code>[[0, 1], [2, 3], [4, 5]]</code>.');",
|
||||
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'message: <code>chunk([0, 1, 2, 3, 4, 5], 4)</code> should return <code>[[0, 1, 2, 3], [4, 5]]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Array.push()"
|
||||
@ -450,9 +439,9 @@
|
||||
{
|
||||
"id": "ab31c21b530c0dafa9e241ee",
|
||||
"title": "Slasher Flick",
|
||||
"difficulty": "1.11",
|
||||
"description": [
|
||||
"Return the remaining elements of an array after chopping off n elements from the head.",
|
||||
"The head meaning the beginning of the array, or the zeroth index",
|
||||
"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": [
|
||||
@ -464,9 +453,9 @@
|
||||
"slasher([1, 2, 3], 2, \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(slasher([1, 2, 3], 2), [3], '<code>slasher([1, 2, 3], 2)</code> should return <code>[3]</code>.');",
|
||||
"assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], '<code>slasher([1, 2, 3], 0)</code> should return <code>[1, 2, 3]</code>.');",
|
||||
"assert.deepEqual(slasher([1, 2, 3], 9), [], '<code>slasher([1, 2, 3], 9)</code> should return <code>[]</code>.');"
|
||||
"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], 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>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Array.slice()",
|
||||
@ -488,7 +477,6 @@
|
||||
{
|
||||
"id": "af2170cad53daa0770fabdea",
|
||||
"title": "Mutations",
|
||||
"difficulty": "1.12",
|
||||
"description": [
|
||||
"Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array.",
|
||||
"For example, <code>[\"hello\", \"Hello\"]</code>, should return true because all of the letters in the second string are present in the first, ignoring case.",
|
||||
@ -504,14 +492,14 @@
|
||||
"mutation([\"hello\", \"hey\"], \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(mutation([\"hello\", \"hey\"]) === false, '<code>[\"hello\", \"hey\"]</code> should return false.');",
|
||||
"assert(mutation([\"hello\", \"Hello\"]) === true, '<code>[\"hello\", \"Hello\"]</code> should return true.');",
|
||||
"assert(mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]) === true, '<code>[\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]</code> should return true.');",
|
||||
"assert(mutation([\"Mary\", \"Army\"]) === true, '<code>[\"Mary\", \"Army\"]</code> should return true.');",
|
||||
"assert(mutation([\"Mary\", \"Aarmy\"]) === true, '<code>[\"Mary\", \"Aarmy\"]</code> should return true.');",
|
||||
"assert(mutation([\"Alien\", \"line\"]) === true, '<code>[\"Alien\", \"line\"]</code> should return true.');",
|
||||
"assert(mutation([\"floor\", \"for\"]) === true, '<code>[\"floor\", \"for\"]</code> should return true.');",
|
||||
"assert(mutation([\"hello\", \"neo\"]) === false, '<code>[\"hello\", \"neo\"]</code> should return false.');"
|
||||
"assert(mutation([\"hello\", \"hey\"]) === false, 'message: <code>mutation([\"hello\", \"hey\"])</code> should return false.');",
|
||||
"assert(mutation([\"hello\", \"Hello\"]) === true, 'message: <code>mutation([\"hello\", \"Hello\"])</code> should return true.');",
|
||||
"assert(mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]) === true, 'message: <code>mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"])</code> should return true.');",
|
||||
"assert(mutation([\"Mary\", \"Army\"]) === true, 'message: <code>mutation([\"Mary\", \"Army\"])</code> should return true.');",
|
||||
"assert(mutation([\"Mary\", \"Aarmy\"]) === true, 'message: <code>mutation([\"Mary\", \"Aarmy\"])</code> should return true.');",
|
||||
"assert(mutation([\"Alien\", \"line\"]) === true, 'message: <code>mutation([\"Alien\", \"line\"])</code> should return true.');",
|
||||
"assert(mutation([\"floor\", \"for\"]) === true, 'message: <code>mutation([\"floor\", \"for\"])</code> should return true.');",
|
||||
"assert(mutation([\"hello\", \"neo\"]) === false, 'message: <code>mutation([\"hello\", \"neo\"])</code> should return false.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Array.indexOf()"
|
||||
@ -532,10 +520,9 @@
|
||||
{
|
||||
"id": "adf08ec01beb4f99fc7a68f2",
|
||||
"title": "Falsy Bouncer",
|
||||
"difficulty": "1.50",
|
||||
"description": [
|
||||
"Remove all falsy values from an array.",
|
||||
"Falsy values in javascript are false, null, 0, \"\", undefined, and NaN.",
|
||||
"Falsy values in javascript are <code>false</code>, <code>null</code>, <code>0</code>, <code>\"\"</code>, <code>undefined</code>, and <code>NaN</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": [
|
||||
@ -547,9 +534,9 @@
|
||||
"bouncer([7, \"ate\", \"\", false, 9], \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(bouncer([7, \"ate\", \"\", false, 9]), [7, \"ate\", 9], '<code>[7, \"ate\", \"\", false, 9]</code> should return <code>[7, \"ate\", 9]</code>.');",
|
||||
"assert.deepEqual(bouncer([\"a\", \"b\", \"c\"]), [\"a\", \"b\", \"c\"], '<code>[\"a\", \"b\", \"c\"]</code> should return <code>[\"a\", \"b\", \"c\"]</code>.');",
|
||||
"assert.deepEqual(bouncer([false, null, 0, NaN, undefined, '']), [], '<code>[false, null, 0]</code> should return <code>[]</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>.');",
|
||||
"assert.deepEqual(bouncer([\"a\", \"b\", \"c\"]), [\"a\", \"b\", \"c\"], 'message: <code>bouncer([\"a\", \"b\", \"c\"])</code> should return <code>[\"a\", \"b\", \"c\"]</code>.');",
|
||||
"assert.deepEqual(bouncer([false, null, 0, NaN, undefined, \"\"]), [], 'message: <code>bouncer([false, null, 0, NaN, undefined, \"\"])</code> should return <code>[]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Boolean Objects",
|
||||
@ -571,7 +558,6 @@
|
||||
{
|
||||
"id": "a39963a4c10bc8b4d4f06d7e",
|
||||
"title": "Seek and Destroy",
|
||||
"difficulty": "1.60",
|
||||
"description": [
|
||||
"You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.",
|
||||
"Remember to use <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."
|
||||
@ -585,11 +571,11 @@
|
||||
"destroyer([1, 2, 3, 1, 2, 3], 2, 3, \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1], '<code>[1, 2, 3, 1, 2, 3], 2, 3</code> should return <code>[1, 1]</code>.');",
|
||||
"assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], '<code>[1, 2, 3, 5, 1, 2, 3], 2, 3</code> should return <code>[1, 5, 1]</code>.');",
|
||||
"assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1], '<code>[3, 5, 1, 2, 2], 2, 3, 5</code> should return <code>[1]</code>.');",
|
||||
"assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), [], '<code>[2, 3, 2, 3], 2, 3</code> should return <code>[]</code>.');",
|
||||
"assert.deepEqual(destroyer([\"tree\", \"hamburger\", 53], \"tree\", 53), [\"hamburger\"], '<code>[\"tree\", \"hamburger\", 53], \"tree\", 53)</code> should return <code>[\"hamburger\"]</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>.');",
|
||||
"assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], 'message: <code>destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3)</code> should return <code>[1, 5, 1]</code>.');",
|
||||
"assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1], 'message: <code>destroyer([3, 5, 1, 2, 2], 2, 3, 5)</code> should return <code>[1]</code>.');",
|
||||
"assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), [], 'message: <code>destroyer([2, 3, 2, 3], 2, 3)</code> should return <code>[]</code>.');",
|
||||
"assert.deepEqual(destroyer([\"tree\", \"hamburger\", 53], \"tree\", 53), [\"hamburger\"], 'message: <code>destroyer([\"tree\", \"hamburger\", 53], \"tree\", 53)</code> should return <code>[\"hamburger\"]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Arguments object",
|
||||
@ -611,7 +597,6 @@
|
||||
{
|
||||
"id": "a24c1a4622e3c05097f71d67",
|
||||
"title": "Where do I belong",
|
||||
"difficulty": "1.61",
|
||||
"description": [
|
||||
"Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument).",
|
||||
"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).",
|
||||
@ -629,12 +614,12 @@
|
||||
"Array.sort()"
|
||||
],
|
||||
"tests": [
|
||||
"assert(where([10, 20, 30, 40, 50], 35) === 3, '<code>[10, 20, 30, 40, 50], 35</code> should return <code>3</code>.');",
|
||||
"assert(where([10, 20, 30, 40, 50], 30) === 2, '<code>[10, 20, 30, 40, 50], 30)</code> should return <code>2</code>.');",
|
||||
"assert(where([40, 60], 50) === 1, '<code>[40, 60,], 50</code> should return <code>1</code>.');",
|
||||
"assert(where([5, 3, 20, 3], 3) === 0, '<code>[5, 3, 20, 3], 3</code> should return <code>0</code>.');",
|
||||
"assert(where([2, 20, 10], 1) === 0, '<code>[2, 20, 10], 1</code> should return <code>0</code>.');",
|
||||
"assert(where([2, 5, 10], 15) === 3, '<code>[2, 5, 10], 15</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([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([2, 20, 10], 1) === 0, 'message: <code>where([2, 20, 10], 1)</code> should return <code>0</code>.');",
|
||||
"assert(where([2, 5, 10], 15) === 3, 'message: <code>where([2, 5, 10], 15)</code> should return <code>3</code>.');"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Basic JavaScript",
|
||||
"order": 0.005,
|
||||
"order": 5,
|
||||
"challenges": [
|
||||
{
|
||||
"id":"bd7123c9c441eddfaeb4bdef",
|
||||
@ -17,9 +17,9 @@
|
||||
"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":[
|
||||
"assert(editor.getValue().match(/(\\/\\/)...../g), 'Create a <code>//</code> style comment that contains at least five letters');",
|
||||
"assert(editor.getValue().match(/(\\/\\*)[\\w\\W]{5,}(?=\\*\\/)/gm), 'Create a <code>/* */</code> style comment that contains at least five letters.');",
|
||||
"assert(editor.getValue().match(/(\\*\\/)/g), 'Make sure that you close the comment with a <code>*/</code>');"
|
||||
"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(/(\\*\\/)/g), 'message: Make sure that you close the comment with a <code>*/</code>');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
],
|
||||
@ -29,15 +29,14 @@
|
||||
{
|
||||
"id": "bd7123c9c441eddfaeb5bdef",
|
||||
"title": "Understand Boolean Values",
|
||||
"difficulty": "9.98001",
|
||||
"description": [
|
||||
"In computer science, <code>data structures</code> are things that hold data. JavaScript has seven of these. For example, the <code>Number</code> data structure holds numbers.",
|
||||
"Let's learn about the most basic data structure of all: the <code>Boolean</code>. Booleans can only hold the value of either true or false. They are basically little on-off switches.",
|
||||
"Let's modify our <code>welcomeToBooleans</code>function so that it will return <code>true</code>instead of <code>false</code>when the run button is clicked."
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof(welcomeToBooleans()) === 'boolean', 'The <code>welcomeToBooleans()</code> function should return a boolean (true/false) value.');",
|
||||
"assert(welcomeToBooleans() === true, '<code>welcomeToBooleans()</code> should return true.');"
|
||||
"assert(typeof(welcomeToBooleans()) === 'boolean', 'message: The <code>welcomeToBooleans()</code> function should return a boolean (true/false) value.');",
|
||||
"assert(welcomeToBooleans() === true, 'message: <code>welcomeToBooleans()</code> should return true.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function welcomeToBooleans() {",
|
||||
@ -57,7 +56,6 @@
|
||||
{
|
||||
"id": "bd7123c9c443eddfaeb5bdef",
|
||||
"title": "Declare JavaScript Variables",
|
||||
"difficulty": "9.9801",
|
||||
"description": [
|
||||
"When we store data in a <code>data structure</code>, we call it a <code>variable</code>. These variables are no different from the x and y variables you use in math.",
|
||||
"Let's create our first variable and call it \"myName\".",
|
||||
@ -66,7 +64,7 @@
|
||||
"Look at the <code>ourName</code> example if you get stuck."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(){if(typeof(myName) !== \"undefined\" && typeof(myName) === \"string\" && myName.length > 0){return true;}else{return false;}})(), '<code>myName</code> should be a string that contains at least one character in it.');"
|
||||
"assert((function(){if(typeof(myName) !== \"undefined\" && typeof(myName) === \"string\" && myName.length > 0){return true;}else{return false;}})(), 'message: <code>myName</code> should be a string that contains at least one character in it.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"// var ourName = \"Free Code Camp\";",
|
||||
@ -84,14 +82,13 @@
|
||||
{
|
||||
"id": "bd7123c9c444eddfaeb5bdef",
|
||||
"title": "Declare String Variables",
|
||||
"difficulty": "9.9802",
|
||||
"description": [
|
||||
"In the previous challenge, we used the code <code>var myName = \"your name\"</code>. This is what we call a <code>String</code> variable. It is nothing more than a \"string\" of characters. JavaScript strings are always wrapped in quotes.",
|
||||
"Now let's create two new string variables: <code>myFirstName</code>and <code>myLastName</code> and assign them the values of your first and last name, respectively."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(){if(typeof(myFirstName) !== \"undefined\" && typeof(myFirstName) === \"string\" && myFirstName.length > 0){return true;}else{return false;}})(), '<code>myFirstName</code> should be a string with at least one character in it.');",
|
||||
"assert((function(){if(typeof(myLastName) !== \"undefined\" && typeof(myLastName) === \"string\" && myLastName.length > 0){return true;}else{return false;}})(), '<code>myLastName</code> should be a string with at least one character in it.');"
|
||||
"assert((function(){if(typeof(myFirstName) !== \"undefined\" && typeof(myFirstName) === \"string\" && myFirstName.length > 0){return true;}else{return false;}})(), 'message: <code>myFirstName</code> should be a string with at least one character in it.');",
|
||||
"assert((function(){if(typeof(myLastName) !== \"undefined\" && typeof(myLastName) === \"string\" && myLastName.length > 0){return true;}else{return false;}})(), 'message: <code>myLastName</code> should be a string with at least one character in it.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"// var name = \"Alan Turing\";",
|
||||
@ -110,15 +107,14 @@
|
||||
{
|
||||
"id": "bd7123c9c448eddfaeb5bdef",
|
||||
"title": "Check the Length Property of a String Variable",
|
||||
"difficulty": "9.9809",
|
||||
"description": [
|
||||
"<code>Data structures</code> have <code>properties</code>. For example, <code>strings</code> have a property called <code>.length</code> that will tell you how many characters are in the string.",
|
||||
"For example, if we created a variable <code>var firstName = \"Charles\"</code>, we could find out how long the string \"Charles\" is by using the <code>firstName.length</code> property.",
|
||||
"Use the <code>.length</code> property to count the number of characters in the <code>lastName</code> variable."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(){if(typeof(lastNameLength) !== \"undefined\" && typeof(lastNameLength) === \"number\" && lastNameLength === 8){return true;}else{return false;}})(), '<code>lastNameLength</code> should be equal to eight.');",
|
||||
"assert((function(){if(editor.getValue().match(/\\.length/gi) && editor.getValue().match(/\\.length/gi).length >= 2 && editor.getValue().match(/var lastNameLength \\= 0;/gi) && editor.getValue().match(/var lastNameLength \\= 0;/gi).length >= 1){return true;}else{return false;}})(), 'You should be getting the length of <code>lastName</code> by using <code>.length</code> like this: <code>lastName.length</code>.');"
|
||||
"assert((function(){if(typeof(lastNameLength) !== \"undefined\" && typeof(lastNameLength) === \"number\" && lastNameLength === 8){return true;}else{return false;}})(), 'message: <code>lastNameLength</code> should be equal to eight.');",
|
||||
"assert((function(){if(editor.getValue().match(/\\.length/gi) && editor.getValue().match(/\\.length/gi).length >= 2 && editor.getValue().match(/var lastNameLength \\= 0;/gi) && editor.getValue().match(/var lastNameLength \\= 0;/gi).length >= 1){return true;}else{return false;}})(), 'message: You should be getting the length of <code>lastName</code> by using <code>.length</code> like this: <code>lastName.length</code>.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var firstNameLength = 0;",
|
||||
@ -146,7 +142,6 @@
|
||||
{
|
||||
"id": "bd7123c9c549eddfaeb5bdef",
|
||||
"title": "Use Bracket Notation to Find the First Character in a String",
|
||||
"difficulty": "9.9810",
|
||||
"description": [
|
||||
"<code>Bracket notation</code> is a way to get a character at a specific <code>index</code> within a string.",
|
||||
"Computers don't start counting at 1 like humans do. They start at 0.",
|
||||
@ -155,7 +150,7 @@
|
||||
"Try looking at the <code>firstLetterOfFirstName</code> variable declaration if you get stuck."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(){if(typeof(firstLetterOfLastName) !== \"undefined\" && editor.getValue().match(/\\[0\\]/gi) && typeof(firstLetterOfLastName) === \"string\" && firstLetterOfLastName === \"L\"){return true;}else{return false;}})(), 'The first letter of <code>firstLetterOfLastName</code> should be a <code>\"L\"</code>.');"
|
||||
"assert((function(){if(typeof(firstLetterOfLastName) !== \"undefined\" && editor.getValue().match(/\\[0\\]/gi) && typeof(firstLetterOfLastName) === \"string\" && firstLetterOfLastName === \"L\"){return true;}else{return false;}})(), 'message: The first letter of <code>firstLetterOfLastName</code> should be a <code>\"L\"</code>.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var firstLetterOfFirstName = \"\";",
|
||||
@ -181,7 +176,6 @@
|
||||
{
|
||||
"id": "bd7123c9c450eddfaeb5bdef",
|
||||
"title": "Use Bracket Notation to Find the Nth Character in a String",
|
||||
"difficulty": "9.9811",
|
||||
"description": [
|
||||
"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.",
|
||||
@ -189,7 +183,7 @@
|
||||
"Try looking at the <code>secondLetterOfFirstName</code> variable declaration if you get stuck."
|
||||
],
|
||||
"tests": [
|
||||
"assert(thirdLetterOfLastName === 'v', 'The third letter of <code>lastName</code> should be a <code>\"v\"</code>.');"
|
||||
"assert(thirdLetterOfLastName === 'v', 'message: The third letter of <code>lastName</code> should be a \"v\".');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var firstName = \"Ada\";",
|
||||
@ -212,7 +206,6 @@
|
||||
{
|
||||
"id": "bd7123c9c451eddfaeb5bdef",
|
||||
"title": "Use Bracket Notation to Find the Last Character in a String",
|
||||
"difficulty": "9.9812",
|
||||
"description": [
|
||||
"In order to get the last letter of a string, you can subtract one from the string's length.",
|
||||
"For example, if <code>var firstName = \"Charles\"</code>, you can get the value of the last letter of the string by using <code>firstName[firstName.length - 1]</code>.",
|
||||
@ -220,8 +213,8 @@
|
||||
"Try looking at the <code>lastLetterOfFirstName</code> variable declaration if you get stuck."
|
||||
],
|
||||
"tests": [
|
||||
"assert(lastLetterOfLastName === \"e\", '<code>lastLetterOfLastName</code> should be <code>\"e\"</code>.');",
|
||||
"assert(editor.getValue().match(/\\.length/g).length === 2, 'You have to use <code>.length</code> to get the last letter.');"
|
||||
"assert(lastLetterOfLastName === \"e\", 'message: <code>lastLetterOfLastName</code> should be \"e\".');",
|
||||
"assert(editor.getValue().match(/\\.length/g).length === 2, 'message: You have to use <code>.length</code> to get the last letter.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var firstName = \"Ada\";",
|
||||
@ -244,7 +237,6 @@
|
||||
{
|
||||
"id": "bd7123c9c452eddfaeb5bdef",
|
||||
"title": "Use Bracket Notation to Find the Nth-to-Last Character in a String",
|
||||
"difficulty": "9.9813",
|
||||
"description": [
|
||||
"In order to get the last letter of a string, you can subtract one from the string's length.",
|
||||
"For example, you can get the value of the third-to-last letter of the <code>var firstName = \"Charles\"</code> string by using <code>firstName[firstName.length - 3]</code>.",
|
||||
@ -252,8 +244,8 @@
|
||||
"Try looking at the <code>thirdToLastLetterOfFirstName</code> variable declaration if you get stuck."
|
||||
],
|
||||
"tests": [
|
||||
"assert(secondToLastLetterOfLastName === 'c', '<code>secondToLastLetterOfLastName</code> should be <code>\"c\"</code>.');",
|
||||
"assert(editor.getValue().match(/\\.length/g).length === 2, 'You have to use .length to get the second last letter.');"
|
||||
"assert(secondToLastLetterOfLastName === 'c', 'message: <code>secondToLastLetterOfLastName</code> should be \"c\".');",
|
||||
"assert(editor.getValue().match(/\\.length/g).length === 2, 'message: You have to use <code>.length</code> to get the second last letter.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var firstName = \"Ada\";",
|
||||
@ -276,14 +268,13 @@
|
||||
{
|
||||
"id": "cf1111c1c11feddfaeb3bdef",
|
||||
"title": "Add Two Numbers with JavaScript",
|
||||
"difficulty": "9.98141",
|
||||
"description": [
|
||||
"Let's try to add two numbers using JavaScript.",
|
||||
"JavaScript uses the <code>+</code> symbol for addition.",
|
||||
"Replace the <code>0</code> with the correct number so you can get the result mentioned in the comment."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(){if(sum === 20 && editor.getValue().match(/\\+/g).length >= 2){return true;}else{return false;}})(), 'Make the variable <code>sum</code> equal 20.');"
|
||||
"assert((function(){if(sum === 20 && editor.getValue().match(/\\+/g).length >= 2){return true;}else{return false;}})(), 'message: Make the variable <code>sum</code> equal 20.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var sum = 10 + 0; //make this equal to 20 by changing the 0 into the appropriate number.",
|
||||
@ -299,14 +290,13 @@
|
||||
{
|
||||
"id": "cf1111c1c11feddfaeb4bdef",
|
||||
"title": "Subtract One Number from Another with JavaScript",
|
||||
"difficulty": "9.98142",
|
||||
"description": [
|
||||
"We can also subtract one number from another.",
|
||||
"JavaScript uses the <code>-</code> symbol for subtraction.",
|
||||
"Replace the <code>0</code> with the correct number so you can get the result mentioned in the comment."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(){if(difference === 12 && editor.getValue().match(/\\-/g)){return true;}else{return false;}})(), 'Make the variable <code>difference</code> equal 12.');"
|
||||
"assert((function(){if(difference === 12 && editor.getValue().match(/\\-/g)){return true;}else{return false;}})(), 'message: Make the variable <code>difference</code> equal 12.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var difference = 45 - 0; //make this equal to 12 by changing the 0 into the appropriate number.",
|
||||
@ -322,14 +312,13 @@
|
||||
{
|
||||
"id": "cf1231c1c11feddfaeb5bdef",
|
||||
"title": "Multiply Two Numbers with JavaScript",
|
||||
"difficulty": "9.98143",
|
||||
"description": [
|
||||
"We can also multiply one number by another.",
|
||||
"JavaScript uses the <code>*</code> symbol for multiplication.",
|
||||
"Replace the <code>0</code> with the correct number so you can get the result mentioned in the comment."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(){if(product === 80 && editor.getValue().match(/\\*/g)){return true;}else{return false;}})(), 'Make the variable <code>product</code> equal 80.');"
|
||||
"assert((function(){if(product === 80 && editor.getValue().match(/\\*/g)){return true;}else{return false;}})(), 'message: Make the variable <code>product</code> equal 80.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var product = 8 * 0; // Make this equal to 80 by changing the 0 into the appropriate number.",
|
||||
@ -345,14 +334,13 @@
|
||||
{
|
||||
"id": "cf1111c1c11feddfaeb6bdef",
|
||||
"title": "Divide One Number by Another with JavaScript",
|
||||
"difficulty": "9.9814",
|
||||
"description": [
|
||||
"We can also divide one number by another.",
|
||||
"JavaScript uses the <code>/</code> symbol for division.",
|
||||
"Replace the <code>0</code> with the correct number so you can get the result mentioned in the comment."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(){if(quotient === 2 && editor.getValue().match(/var\\s*?quotient\\s*?\\=\\s*?\\d+\\s*?\\/\\s*?\\d+\\s*?;/g)){return true;}else{return false;}})(), 'Make the variable <code>quotient</code> equal 2.');"
|
||||
"assert((function(){if(quotient === 2 && editor.getValue().match(/var\\s*?quotient\\s*?\\=\\s*?\\d+\\s*?\\/\\s*?\\d+\\s*?;/g)){return true;}else{return false;}})(), 'message: Make the variable <code>quotient</code> equal 2.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var quotient = 66 / 0; //make this equal to 2 by changing the 0 into the appropriate number.",
|
||||
@ -368,13 +356,12 @@
|
||||
{
|
||||
"id": "cf1391c1c11feddfaeb4bdef",
|
||||
"title": "Create Decimal Numbers with JavaScript",
|
||||
"difficulty": "9.9815",
|
||||
"description": [
|
||||
"JavaScript number variables can also have decimals.",
|
||||
"Let's create a variable <code>myDecimal</code> and give it a decimal value."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(){if(typeof(myDecimal) !== \"undefined\" && typeof(myDecimal) === \"number\" && editor.getValue().match(/\\./g).length >=2){return true;}else{return false;}})(), 'myDecimal should be a decimal point number.');"
|
||||
"assert((function(){if(typeof(myDecimal) !== \"undefined\" && typeof(myDecimal) === \"number\" && editor.getValue().match(/\\./g).length >=2){return true;}else{return false;}})(), 'message: <code>myDecimal</code> should be a decimal point number.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"// var ourDecimal = 5.7;",
|
||||
@ -393,14 +380,13 @@
|
||||
{
|
||||
"id": "bd7993c9c69feddfaeb7bdef",
|
||||
"title": "Perform Arithmetic Operations on Decimals with JavaScript",
|
||||
"difficulty": "9.98151",
|
||||
"description": [
|
||||
"In JavaScript, you can also perform calculations with decimal numbers, just like whole numbers.",
|
||||
"Replace the <code>0.0</code> with the correct number so that you get the result mentioned in the comments."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(){if(product === 5.0 && editor.getValue().match(/\\*/g)){return true;}else{return false;}})(), 'Make the variable <code>product</code> equal 5.0.');",
|
||||
"assert((function(){if(quotient === 2.2 && editor.getValue().match(/\\//g)){return true;}else{return false;}})(), 'Make the variable <code>quotient</code> equal 2.2.');"
|
||||
"assert((function(){if(product === 5.0 && editor.getValue().match(/\\*/g)){return true;}else{return false;}})(), 'message: Make the variable <code>product</code> equal 5.0.');",
|
||||
"assert((function(){if(quotient === 2.2 && editor.getValue().match(/\\//g)){return true;}else{return false;}})(), 'message: Make the variable <code>quotient</code> equal 2.2.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var quotient = 4.4 / 2.0; // equals 2.2",
|
||||
@ -418,7 +404,6 @@
|
||||
{
|
||||
"id": "bd7993c9c69feddfaeb8bdef",
|
||||
"title": "Store Multiple Values in one Variable using JavaScript Arrays",
|
||||
"difficulty": "9.9816",
|
||||
"description": [
|
||||
"With JavaScript <code>array</code> variables, we can store several pieces of data in one place.",
|
||||
"You start an array declaration with an opening square bracket, end it with a closing square bracket, and put a comma between each entry, like this: <code>var sandwich = [\"peanut butter\", \"jelly\", \"bread\"]</code>.",
|
||||
@ -426,9 +411,9 @@
|
||||
"Refer to the commented code in the text editor if you get stuck."
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof(myArray) == 'object', '<code>myArray</code> should be an <code>array</code>.');",
|
||||
"assert(typeof(myArray[0]) !== 'undefined' && typeof(myArray[0]) == 'string', 'The first item in <code>myArray</code> should be a <code>string</code>.');",
|
||||
"assert(typeof(myArray[1]) !== 'undefined' && typeof(myArray[1]) == 'number', 'The second item in <code>myArray</code> should be a <code>number</code>.');"
|
||||
"assert(typeof(myArray) == 'object', 'message: <code>myArray</code> should be an <code>array</code>.');",
|
||||
"assert(typeof(myArray[0]) !== 'undefined' && typeof(myArray[0]) == 'string', 'message: The first item in <code>myArray</code> should be a <code>string</code>.');",
|
||||
"assert(typeof(myArray[1]) !== 'undefined' && typeof(myArray[1]) == 'number', 'message: The second item in <code>myArray</code> should be a <code>number</code>.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"// var array = [\"John\", 23];",
|
||||
@ -454,7 +439,7 @@
|
||||
"Let's now go create a nested array called <code>myArray</code>."
|
||||
],
|
||||
"tests":[
|
||||
"assert(Array.isArray(myArray) && myArray.some(Array.isArray), '<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":[
|
||||
"var ourArray = [[\"the universe\", \"everything\", 42]];",
|
||||
@ -484,7 +469,7 @@
|
||||
"Create a variable called <code>myData</code> and set it to equal the first value of <code>myArray</code>."
|
||||
],
|
||||
"tests":[
|
||||
"assert((function(){if(typeof(myArray) != 'undefined' && typeof(myData) != 'undefined' && myArray[0] == myData){return true;}else{return false;}})(), '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":[
|
||||
"// var ourArray = [1,2,3];",
|
||||
@ -514,8 +499,8 @@
|
||||
"Now modify the data stored at index 0 of <code>myArray</code> to the value of 3."
|
||||
],
|
||||
"tests":[
|
||||
"assert((function(){if(typeof(myArray) != 'undefined' && myArray[0] == 3 && myArray[1] == 2 && myArray[2] == 3){return true;}else{return false;}})(), '<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;}})(), 'You should be using correct index to modify the value in <code>myArray</code>.');"
|
||||
"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>.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var ourArray = [1,2,3];",
|
||||
@ -536,7 +521,6 @@
|
||||
{
|
||||
"id": "bg9994c9c69feddfaeb9bdef",
|
||||
"title": "Manipulate Arrays With pop()",
|
||||
"difficulty": "9.9818",
|
||||
"description": [
|
||||
"Another way to change the data in an array is with the <code>.pop()</code> function.",
|
||||
"<code>.pop()</code>is used to \"pop\" a value off of the end of an array. We can retrieve this value by performing <code>pop()</code> in a variable declaration.",
|
||||
@ -544,8 +528,8 @@
|
||||
"Use the <code>.pop()</code> function to remove the last item from <code>myArray</code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(d){if(d[0] == 'John' && d[1] == 23 && d[2] == undefined){return true;}else{return false;}})(myArray), '<code>myArray</code> should only have the first two values left([\"John\", 23]).');",
|
||||
"assert((function(d){if(d[0] == 'cat' && d[1] == 2 && d[2] == undefined){return true;}else{return false;}})(removed), '<code>removed</code> should only have the first two values left([\"cat\"], 2).');"
|
||||
"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>.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"// var numbers = [1,2,3];",
|
||||
@ -570,13 +554,12 @@
|
||||
{
|
||||
"id": "bg9995c9c69feddfaeb9bdef",
|
||||
"title": "Manipulate Arrays With push()",
|
||||
"difficulty": "9.9818",
|
||||
"description": [
|
||||
"Not only can you <code>pop()</code> data off of the end of an array, you can also <code>push()</code> data onto the end of an array.",
|
||||
"Take the <code>myArray</code> array and <code>push()</code> this value to the end of it: <code>[\"dog\", 3]</code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(d){if(d[2] != undefined && d[0] == 'John' && d[1] == 23 && d[2][0] == 'dog' && d[2][1] == 3 && d[2].length == 2){return true;}else{return false;}})(myArray), '<code>myArray</code> should only have the first two values left([\"John\", 23, [\"dog\", 3]]).');"
|
||||
"assert((function(d){if(d[2] != undefined && d[0] == 'John' && d[1] == 23 && d[2][0] == 'dog' && d[2][1] == 3 && d[2].length == 2){return true;}else{return false;}})(myArray), 'message: <code>myArray</code> should now equal <code>[\"John\", 23, [\"dog\", 3]]</code>.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];",
|
||||
@ -601,14 +584,13 @@
|
||||
{
|
||||
"id": "bg9996c9c69feddfaeb9bdef",
|
||||
"title": "Manipulate Arrays With shift()",
|
||||
"difficulty": "9.9817",
|
||||
"description": [
|
||||
"<code>pop()</code> always removes the last element of an array. What if you want to remove the first? That's where <code>.shift()</code> comes in.",
|
||||
"Take the <code>myArray</code> array and <code>shift()</code> the first value off of it. Set <code>myRemoved</code> to the first value of <code>myArray</code> using <code>shift()</code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(d){if(d[0] == 23 && d[1][0] == 'dog' && d[1][1] == 3 && d[2] == undefined){return true;}else{return false;}})(myArray), '<code>myArray</code> should only have the last two values left([23, [\"dog\", 3]]).');",
|
||||
"assert((function(d){if(d === 'John' && typeof(myRemoved) === 'string'){return true;}else{return false;}})(myRemoved), '<code>myRemoved</code> should contain <code>\"John\"</code>.');"
|
||||
"assert((function(d){if(d[0] == 23 && d[1][0] == 'dog' && d[1][1] == 3 && d[2] == undefined){return true;}else{return false;}})(myArray), 'message: <code>myArray</code> should now equal <code>[23, [\"dog\", 3]]</code>.');",
|
||||
"assert((function(d){if(d === 'John' && typeof(myRemoved) === 'string'){return true;}else{return false;}})(myRemoved), 'message: <code>myRemoved</code> should contain <code>\"John\"</code>.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];",
|
||||
@ -632,13 +614,12 @@
|
||||
{
|
||||
"id": "bg9997c9c69feddfaeb9bdef",
|
||||
"title": "Manipulate Arrays With unshift()",
|
||||
"difficulty": "9.9818",
|
||||
"description": [
|
||||
"Now that we've learned how to <code>shift</code>things from the start of the array, we need to learn how to <code>unshift</code>stuff back to the start.",
|
||||
"Let's take the code we had last time and <code>unshift</code>this value to the start: <code>\"Paul\"</code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(d){if(typeof(d[0]) === \"string\" && d[0].toLowerCase() == 'paul' && d[1] == 23 && d[2][0] != undefined && d[2][0] == 'dog' && d[2][1] != undefined && d[2][1] == 3){return true;}else{return false;}})(myArray), '<code>myArray</code> should now have [\"Paul\", 23, [\"dog\", 3]]).');"
|
||||
"assert((function(d){if(typeof(d[0]) === \"string\" && d[0].toLowerCase() == 'paul' && d[1] == 23 && d[2][0] != undefined && d[2][0] == 'dog' && d[2][1] != undefined && d[2][1] == 3){return true;}else{return false;}})(myArray), 'message: <code>myArray</code> should now have [\"Paul\", 23, [\"dog\", 3]]).');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];",
|
||||
@ -678,7 +659,7 @@
|
||||
"Create and call a function called <code>myFunction</code> that returns the sum of <code>a</code> and <code>b</code>."
|
||||
],
|
||||
"tests":[
|
||||
"assert((function(){if(typeof(f) !== \"undefined\" && f === a + b){return true;}else{return false;}})(), '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":[
|
||||
"var a = 4;",
|
||||
@ -686,7 +667,7 @@
|
||||
"",
|
||||
"function ourFunction(a, b) {",
|
||||
" return a - b;",
|
||||
"};",
|
||||
"}",
|
||||
"",
|
||||
"// Create a function called myFunction that returns the value of a plus b.",
|
||||
"// Only change code below this line.",
|
||||
@ -724,10 +705,10 @@
|
||||
"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":[
|
||||
"assert((function(z){if(z.hasOwnProperty(\"name\") && z.name !== undefined && typeof(z.name) === \"string\"){return true;}else{return false;}})(myDog), '<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), '<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), '<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), '<code>myDog</code> should contain the property <code>friends</code> and it should be an <code>array</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(\"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>.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"// var ourDog = {",
|
||||
@ -766,8 +747,8 @@
|
||||
"Let's add the property <code>\"bark\"</code>, and delete the property <code>\"tails\"</code>."
|
||||
],
|
||||
"tests":[
|
||||
"assert(myDog.bark !== undefined, 'Add the property <code>\"bark\"</code> to <code>myDog</code>.');",
|
||||
"assert(myDog.tails === undefined, 'Delete the property <code>\"tails\"</code> from <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>.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"// var ourDog = {",
|
||||
@ -817,8 +798,8 @@
|
||||
"Let's try getting a for loop to work by pushing values to an array."
|
||||
],
|
||||
"tests":[
|
||||
"assert(editor.getValue().match(/for/g), 'You should be using a <code>for</code> loop for this.');",
|
||||
"assert.deepEqual(myArray, [0,1,2,3,4], '<code>myArray</code> should equal [0,1,2,3,4].');"
|
||||
"assert(editor.getValue().match(/for/g), '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].');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"ourArray = [];",
|
||||
@ -856,8 +837,8 @@
|
||||
"Let's try getting a while loop to work by pushing values to an array."
|
||||
],
|
||||
"tests":[
|
||||
"assert(editor.getValue().match(/while/g), 'You should be using a <code>while</code> loop for this.');",
|
||||
"assert.deepEqual(myArray, [0,1,2,3,4], '<code>myArray</code> should equal [0,1,2,3,4].');"
|
||||
"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].');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var myArray = [];",
|
||||
@ -884,9 +865,9 @@
|
||||
"Use <code>Math.random()</code> to get <code>myFunction</code> to return a random number."
|
||||
],
|
||||
"tests":[
|
||||
"assert(typeof(myFunction()) === \"number\", '<code>myFunction</code> should return a random number.');",
|
||||
"assert((myFunction()+''). match(/\\./g), 'The number returned by <code>myFunction</code> should be a decimal.');",
|
||||
"assert(editor.getValue().match(/Math\\.random/g).length >= 2, 'You should be using <code>Math.random</code> to generate the random decimal 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(editor.getValue().match(/Math\\.random/g).length >= 2, 'message: You should be using <code>Math.random</code> to generate the random decimal number.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"function myFunction() {",
|
||||
@ -917,10 +898,10 @@
|
||||
"Let's give this technique a go now."
|
||||
],
|
||||
"tests":[
|
||||
"assert(typeof(myFunction()) === \"number\", 'The result of <code>myFunction</code> should be a number.');",
|
||||
"assert(editor.getValue().match(/Math.random/g), '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), 'You should have multiplied the result of <code>Math.random</code> by 10 to make it a number that\\'s between zero and nine.');",
|
||||
"assert(editor.getValue().match(/Math.floor/g), 'You should use <code>Math.floor</code> to remove the decimal part of the 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(/\\(\\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.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"function myFunction(){",
|
||||
@ -949,10 +930,10 @@
|
||||
"By using this, we can control the output of a random number."
|
||||
],
|
||||
"tests":[
|
||||
"assert(myFunction() >= min, 'The random number that\\'s generated by myFunction should be greater than or equal to the minimum number');",
|
||||
"assert(myFunction() <= max, 'The random number that\\'s generated by myFunction should be less than or equal to the maximum number');",
|
||||
"assert(myFunction() % 1 === 0 , 'The random number that\\'s generated by myFunction should be an integer');",
|
||||
"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;}})(), 'You should be using the function given in the description to calculate the random in number in a range');"
|
||||
"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() % 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.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var min = 0;",
|
||||
@ -988,10 +969,10 @@
|
||||
"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":[
|
||||
"assert((function(){var result = myFunction();if(result === 'heads' || result === 'tails'){return true;} else {return false;}})(), '<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;}})(), '<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, 'You should have created a new if statement.');",
|
||||
"assert(editor.getValue().match(/else/g).length >= 2, 'You should have created a new else statement.');"
|
||||
"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(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.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;",
|
||||
@ -1026,8 +1007,8 @@
|
||||
"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":[
|
||||
"assert(test==2, 'Your <code>regular expression</code> should find two occurrences of the word <code>and</code>.');",
|
||||
"assert(editor.getValue().match(/\\/and\\/gi/), 'You should have used <code>regular expressions</code> to find 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>.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var test = (function() {",
|
||||
@ -1057,8 +1038,8 @@
|
||||
"Use the <code>\\d</code> selector to select the number of numbers in the string, allowing for the possibility of multi-digit numbers."
|
||||
],
|
||||
"tests":[
|
||||
"assert(test === 2, 'Your RegEx should have found two numbers in the <code>testString</code>.');",
|
||||
"assert(editor.getValue().match(/\\/\\\\d\\+\\//gi), 'You should be using the following expression <code>/\\\\d+/gi</code> to find the 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\\+\\//gi), 'message: You should be using the following expression <code>/\\\\d+/gi</code> to find the numbers in the <code>testString</code>.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var test = (function() {",
|
||||
@ -1087,8 +1068,8 @@
|
||||
"Select all the spaces in the sentence string."
|
||||
],
|
||||
"tests":[
|
||||
"assert(test === 7, 'Your RegEx should have found seven spaces in the <code>testString</code>.');",
|
||||
"assert(editor.getValue().match(/\\/\\\\s\\+\\//gi), 'You should be using the following expression <code>/\\\\s+/gi</code> to find the 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\\+\\//gi), 'message: You should be using the following expression <code>/\\\\s+/gi</code> to find the spaces in the <code>testString</code>.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var test = (function(){",
|
||||
@ -1115,8 +1096,8 @@
|
||||
"You can invert any match by using the uppercase version of the selector <code>\\s</code> versus <code>\\S</code> for example."
|
||||
],
|
||||
"tests":[
|
||||
"assert(test === 49, 'Your RegEx should have found forty nine non-space characters in the <code>testString</code>.');",
|
||||
"assert(editor.getValue().match(/\\/\\\\S\\/gi/gi), 'You should be using the following expression <code>/\\\\S/gi</code> to find 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\\/gi/gi), 'message: You should be using the following expression <code>/\\\\S/gi</code> to find non-space characters in the <code>testString</code>.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var test = (function(){",
|
||||
@ -1146,10 +1127,10 @@
|
||||
"<code>Math.floor(Math.random() * (3 - 1 + 1)) + 1;</code>"
|
||||
],
|
||||
"tests":[
|
||||
"assert(typeof(runSlots($(\".slot\"))[0]) === \"number\", '<code>slotOne</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\", '<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;}})(), 'You should have used <code>Math.floor(Math.random() * (3 - 1 + 1)) + 1;</code> three times to generate your random numbers.')"
|
||||
"assert(typeof(runSlots($(\".slot\"))[0]) === \"number\", 'message: <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\"))[2]) === \"number\", 'message: <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.')"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"fccss",
|
||||
@ -1616,7 +1597,7 @@
|
||||
},
|
||||
{
|
||||
"id":"cf1111c1c11feddfaeb1bdff",
|
||||
"title": "Give your JavaScript Slot Machine some stylish images",
|
||||
"title": "Give your JavaScript Slot Machine some Stylish Images",
|
||||
"difficulty":"9.9901",
|
||||
"description":[
|
||||
"Now let's add some images to our slots.",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Basic Front End Development Projects",
|
||||
"order": 0.008,
|
||||
"order": 8,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bd7158d8c442eddfbeb5bd1f",
|
||||
@ -148,56 +148,9 @@
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd10",
|
||||
"title": "Show the Local Weather",
|
||||
"difficulty": 1.03,
|
||||
"challengeSeed": ["126415127"],
|
||||
"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'>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 #3:</span> Reverse engineer the example project's functionality, and also feel free to personalize it.",
|
||||
"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 see the weather in my current location.",
|
||||
"<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 can push a button to toggle between Fahrenheit and Celsius.",
|
||||
"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.",
|
||||
"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>"
|
||||
],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "Покажите местную погоду",
|
||||
"descriptionRu": [
|
||||
"<span class='text-info'>Задание:</span> Создайте <a href='http://codepen.io' target='_blank'>CodePen.io</a> который успешно копирует вот этот: <a href='http://codepen.io/AdventureBear/full/yNBJRj' target='_blank'>http://codepen.io/AdventureBear/full/yNBJRj</a>.",
|
||||
"<span class='text-info'>Правило #1:</span> Не подсматривайте код приведенного на CodePen примера. Напишите его самостоятельно.",
|
||||
"<span class='text-info'>Правило #2:</span> Можете использовать любые библиотеки или API, которые потребуются.",
|
||||
"<span class='text-info'>Правило #3:</span> Воссоздайте функционал приведенного примера и не стесняйтесь добавить что-нибудь от себя.",
|
||||
"Реализуйте следующие <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>пользовательские истории</a>, сделайте также бонусные по желанию:",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу узнать погоду с учетом моего текущего местоположения.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу в зависимости от погоды видеть различные температурные значки.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу в зависимости от погоды видеть различные фоновые изображения (снежные горы, знойная пустыня).",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу нажать на кнопку чтобы переключится между градусами по Цельсию или по Фаренгейту.",
|
||||
"Если что-то не получается, воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>.",
|
||||
"Когда выполните задание кликните кнопку \"I've completed this challenge\" и добавьте ссылку на ваш CodePen. Если вы программировали с кем-то в паре, также добавьте имя вашего напарника.",
|
||||
"Если вы хотите получить немедленную оценку вашего проекта, нажмите эту кнопку и добавьте ссылку на ваш CodePen. В противном случае мы проверим его перед тем как вы приступите к проектам для некоммерческих организаций.<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:%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||
],
|
||||
"nameEs": "",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd0f",
|
||||
"title": "Build a Pomodoro Clock",
|
||||
"difficulty": 1.04,
|
||||
"challengeSeed": ["126411567"],
|
||||
"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/GeoffStorbeck/full/RPbGxZ/' target='_blank'>http://codepen.io/GeoffStorbeck/full/RPbGxZ/</a>.",
|
||||
@ -239,24 +192,18 @@
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd1f",
|
||||
"title": "Use the Twitch.tv JSON API",
|
||||
"difficulty": 1.05,
|
||||
"challengeSeed": ["126411564"],
|
||||
"id": "bd7158d8c442eddfaeb5bd17",
|
||||
"title": "Build a JavaScript Calculator",
|
||||
"challengeSeed": ["126411565"],
|
||||
"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/GeoffStorbeck/full/GJKRxZ' target='_blank'>http://codepen.io/GeoffStorbeck/full/GJKRxZ</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/GeoffStorbeck/full/zxgaqw' target='_blank'>http://codepen.io/GeoffStorbeck/full/zxgaqw</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 #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.",
|
||||
"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 see whether Free Code Camp is currently streaming on Twitch.tv.",
|
||||
"<span class='text-info'>User Story:</span> As a user, I can click the status output and be sent directly to the Free Code Camp's Twitch.tv channel.",
|
||||
"<span class='text-info'>User Story:</span> As a user, if Free Code Camp is streaming, I can see additional details about what they are streaming.",
|
||||
"<span class='text-info'>Bonus User Story:</span> As a user, I can search through the streams listed.",
|
||||
"<span class='text-info'>Bonus User Story:</span> As a user, I will see a placeholder notification if a streamer has closed their Twitch account. You can verify this works by adding brunofin and comster404 to your array of Twitch streamers.",
|
||||
"<span class='text-info'>Hint:</span> Here's an example call to Twitch.tv's JSON API: <code>https://api.twitch.tv/kraken/streams/freecodecamp</code>.",
|
||||
"<span class='text-info'>Hint:</span> The relevant documentation about this API call is here: <a href='https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel' target='_blank'>https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel</a>.",
|
||||
"<span class='text-info'>Hint:</span> Here's an array of the Twitch.tv usernames of people who regularly stream coding: <code>[\"freecodecamp\", \"storbeck\", \"terakilobyte\", \"habathcx\",\"RobotCaleb\",\"thomasballinger\",\"noobs2ninjas\",\"beohoff\"]</code>",
|
||||
"<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 keep chaining mathematical operations together until I hit the clear 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.",
|
||||
"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>"
|
||||
@ -268,25 +215,8 @@
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "Используйте Twitch.tv JSON API",
|
||||
"descriptionRu": [
|
||||
"<span class='text-info'>Задание:</span> Создайте <a href='http://codepen.io' target='_blank'>CodePen.io</a> который успешно копирует вот этот: <a href='http://codepen.io/GeoffStorbeck/full/GJKRxZ' target='_blank'>http://codepen.io/GeoffStorbeck/full/GJKRxZ</a>.",
|
||||
"<span class='text-info'>Правило #1:</span> Не подсматривайте код приведенного на CodePen примера. Напишите его самостоятельно.",
|
||||
"<span class='text-info'>Правило #2:</span> Можете использовать любые библиотеки или API, которые потребуются.",
|
||||
"<span class='text-info'>Правило #3:</span> Воссоздайте функционал приведенного примера и не стесняйтесь добавить что-нибудь от себя.",
|
||||
"Реализуйте следующие <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>пользовательские истории</a>, сделайте также бонусные по желанию:",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу увидеть идет ли в данный момент на Twitch.tv трансляция Free Code Camp.",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу, кликнув на описание трансляции, перейти на канал Free Code Camp.",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу видеть дополнительную информацию о текущей трансляции Free Code Camp.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу произвести поиск среди перечисленных каналов.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу видеть уведомление, если создатель канала закрыл свой аккаунт на Twitch.tv. Добавьте в массив имена пользователей brunofin и comster404, чтобы убедиться, что эта функция реализована правильно.",
|
||||
"<span class='text-info'>Подсказка:</span> Пример запроса к Twitch.tv JSON API: <code>https://api.twitch.tv/kraken/streams/freecodecamp</code>.",
|
||||
"<span class='text-info'>Подсказка:</span> Документацию об этом запросе можно найти по ссылке: <a href='https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel' target='_blank'>https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel</a>.",
|
||||
"<span class='text-info'>Подсказка:</span> В этом массиве приведены имена пользователей, которые регулярно пишут код онлайн: <code>[\"freecodecamp\", \"storbeck\", \"terakilobyte\", \"habathcx\",\"RobotCaleb\",\"comster404\",\"brunofin\",\"thomasballinger\",\"noobs2ninjas\",\"beohoff\"]</code>",
|
||||
"Если что-то не получается, воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>.",
|
||||
"Когда выполните задание кликните кнопку \"I've completed this challenge\" и добавьте ссылку на ваш CodePen. Если вы программировали с кем-то в паре, также добавьте имя вашего напарника.",
|
||||
"Если вы хотите получить немедленную оценку вашего проекта, нажмите эту кнопку и добавьте ссылку на ваш CodePen. В противном случае мы проверим его перед тем как вы приступите к проектам для некоммерческих организаций.<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:%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||
],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
|
@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "Responsive Design with Bootstrap",
|
||||
"order": 0.003,
|
||||
"order": 3,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bad87fee1348bd9acde08712",
|
||||
"title": "Use Responsive Design with Bootstrap Fluid Containers",
|
||||
"difficulty": 2.01,
|
||||
"description": [
|
||||
"Now let's go back to our Cat Photo App. This time, we'll style it using the popular Bootstrap responsive CSS framework.",
|
||||
"Bootstrap will figure out how wide your screen is and respond by resizing your HTML elements - hence the name <code>Responsive Design</code>.",
|
||||
@ -89,7 +88,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9acde08812",
|
||||
"title": "Make Images Mobile Responsive",
|
||||
"difficulty": 2.02,
|
||||
"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>.",
|
||||
"It would be great if this image could be exactly the width of our phone's screen.",
|
||||
@ -174,7 +172,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd8acde08812",
|
||||
"title": "Center Text with Bootstrap",
|
||||
"difficulty": 2.03,
|
||||
"description": [
|
||||
"Now that we're using Bootstrap, we can center our heading element to make it look better. All we need to do is add the class <code>text-center</code> to our <code>h2</code> element.",
|
||||
"Remember that you can add several classes to the same element by separating each of them with a space, like this: <code><h2 class=\"red-text text-center\">your text</h2></code>."
|
||||
@ -257,7 +254,6 @@
|
||||
{
|
||||
"id": "bad87fee1348cd8acdf08812",
|
||||
"title": "Create a Bootstrap Button",
|
||||
"difficulty": 2.04,
|
||||
"description": [
|
||||
"Bootstrap has its own styles for <code>button</code> elements, which look much better than the plain HTML ones.",
|
||||
"Create a new <code>button</code> element below your large kitten photo. Give it the class <code>btn</code> and the text of \"Like\"."
|
||||
@ -343,7 +339,6 @@
|
||||
{
|
||||
"id": "bad87fee1348cd8acef08812",
|
||||
"title": "Create a Block Element Bootstrap Button",
|
||||
"difficulty": 2.05,
|
||||
"description": [
|
||||
"Normally, your <code>button</code> elements are only as wide as the text that they contain. By making them block elements, your button will stretch to fill your page's entire horizontal space.",
|
||||
"This image illustrates the difference between <code>inline</code> elements and <code>block-level</code> elements:",
|
||||
@ -432,7 +427,6 @@
|
||||
{
|
||||
"id": "bad87fee1348cd8acef08811",
|
||||
"title": "Taste the Bootstrap Button Color Rainbow",
|
||||
"difficulty": 2.06,
|
||||
"description": [
|
||||
"The <code>btn-primary</code> class is the main color you'll use in your app. It is useful for highlighting actions you want your user to take.",
|
||||
"Add Bootstrap's <code>btn-primary</code> class to your button.",
|
||||
@ -519,7 +513,6 @@
|
||||
{
|
||||
"id": "bad87fee1348cd8acef08813",
|
||||
"title": "Call out Optional Actions with Button Info",
|
||||
"difficulty": 2.07,
|
||||
"description": [
|
||||
"Bootstrap comes with several pre-defined colors for buttons. The <code>btn-info</code> class is used to call attention to optional actions that the user can take.",
|
||||
"Create a new block-level Bootstrap button below your \"Like\" button with the text \"Info\", and add Bootstrap's <code>btn-info</code> and <code>btn-block</code> classes to it.",
|
||||
@ -607,7 +600,6 @@
|
||||
{
|
||||
"id": "bad87fee1348ce8acef08814",
|
||||
"title": "Warn your Users of a Dangerous Action",
|
||||
"difficulty": 2.08,
|
||||
"description": [
|
||||
"Bootstrap comes with several pre-defined colors for buttons. The <code>btn-danger</code> class is the button color you'll use to notify users that the button performs a destructive action, such as deleting a cat photo.",
|
||||
"Create a button with the text \"Delete\" and give it the class <code>btn-danger</code>.",
|
||||
@ -696,7 +688,6 @@
|
||||
{
|
||||
"id": "bad88fee1348ce8acef08815",
|
||||
"title": "Use the Bootstrap Grid to Put Elements Side By Side",
|
||||
"difficulty": 2.09,
|
||||
"description": [
|
||||
"Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a <code>div</code> element.",
|
||||
"Here's a diagram of how Bootstrap's 12-column grid layout works:",
|
||||
@ -790,7 +781,6 @@
|
||||
{
|
||||
"id": "bad87fee1347bd9aedf08845",
|
||||
"title": "Ditch Custom CSS for Bootstrap",
|
||||
"difficulty": 2.10,
|
||||
"description": [
|
||||
"We can clean up our code and make our Cat Photo App look more conventional by using Bootstrap's built-in styles instead of the custom styles we created earlier.",
|
||||
"Don't worry - there will be plenty of time to customize our CSS later.",
|
||||
@ -891,7 +881,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08845",
|
||||
"title": "Use Spans for Inline Elements",
|
||||
"difficulty": 2.105,
|
||||
"description": [
|
||||
"You can use spans to create inline elements. Remember when we used the <code>btn-block</code> class to make the button fill the entire row?",
|
||||
"This image illustrates the difference between <code>inline</code> elements and <code>block-level</code> elements:",
|
||||
@ -979,7 +968,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aede08845",
|
||||
"title": "Create a Custom Heading",
|
||||
"difficulty": 2.11,
|
||||
"description": [
|
||||
"We will make a simple heading for our Cat Photo App by putting them in the same row.",
|
||||
"Remember, Bootstrap uses a responsive grid system, which makes it easy to put elements into rows and specify each element's relative width. Most of Bootstrap's classes can be applied to a <code>div</code> element.",
|
||||
@ -1068,7 +1056,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedd08845",
|
||||
"title": "Add Font Awesome Icons to our Buttons",
|
||||
"difficulty": 2.12,
|
||||
"description": [
|
||||
"Font Awesome is a convenient library of icons. These icons are vector graphics, stored in the <code>.svg</code> file format. These icons are treated just like fonts. You can specify their size using pixels, and they will assume the font size of their parent HTML elements.",
|
||||
"Use Font Awesome to add a <code>thumbs-up</code> icon to your like button by giving it a <code>i</code> element with the classes <code>fa</code> and <code>fa-thumbs-up</code>."
|
||||
@ -1153,7 +1140,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedc08845",
|
||||
"title": "Add Font Awesome Icons to all of our Buttons",
|
||||
"difficulty": 2.13,
|
||||
"description": [
|
||||
"Font Awesome is a convenient library of icons. These icons are vector graphics, stored in the <code>.svg</code> file format. These icons are treated just like fonts. You can specify their size using pixels, and they will assume the font size of their parent HTML elements.",
|
||||
"Use Font Awesome to add a <code>info-circle</code> icon to your info button and a <code>trash</code> icon to your delete button."
|
||||
@ -1238,7 +1224,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedb08845",
|
||||
"title": "Responsively Style Radio Buttons",
|
||||
"difficulty": 2.14,
|
||||
"description": [
|
||||
"You can use Bootstrap's <code>col-xs-*</code> classes on <code>form</code> elements, too! This way, our radio buttons will be evenly spread out across the page, regardless of how wide the screen resolution is.",
|
||||
"Nest all of your radio buttons within a <code><div class=\"row\"></code> element. Then nest each of them within a <code><div class=\"col-xs-6\"></code> element."
|
||||
@ -1323,7 +1308,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aeda08845",
|
||||
"title": "Responsively Style Checkboxes",
|
||||
"difficulty": 2.15,
|
||||
"description": [
|
||||
"You can use Bootstrap's <code>col-xs-*</code> classes on <code>form</code> elements, too! This way, our checkboxes will be evenly spread out across the page, regardless of how wide the screen resolution is.",
|
||||
"Nest all your checkboxes in a <code><div class=\"row\"></code> element. Then nest each of them in a <code><div class=\"col-xs-4\"></code> element."
|
||||
@ -1415,7 +1399,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aed908845",
|
||||
"title": "Style Text Inputs as Form Controls",
|
||||
"difficulty": 2.16,
|
||||
"description": [
|
||||
"You can add the <code>fa-paper-plane</code> Font Awesome icon by adding <code><i class=\"fa fa-paper-plane\"></i></code> within your submit <code>button</code> element.",
|
||||
"Give your form's text input field a class of <code>form-control</code>. Give your form's submit button the classes <code>btn btn-primary</code>. Also give this button the Font Awesome icon of <code>fa-paper-plane</code>."
|
||||
@ -1516,7 +1499,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aec908845",
|
||||
"title": "Line up Form Elements Responsively with Bootstrap",
|
||||
"difficulty": 2.17,
|
||||
"description": [
|
||||
"Now let's get your form <code>input</code> and your submission <code>button</code> on the same line. We'll do this the same way we have previously: by using a <code>div</code> element with the class <code>row</code>, and other <code>div</code> elements within it using the <code>col-xs-*</code> class.",
|
||||
"Nest both your form's text <code>input</code> and submit <code>button</code> within a <code>div</code> with the class <code>row</code>. Nest your form's text <code>input</code> within a div with the class of <code>col-xs-7</code>. Nest your form's submit <code>button</code> in a <code>div</code> with the class <code>col-xs-5</code>.",
|
||||
@ -1618,7 +1600,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aec908846",
|
||||
"title": "Create a Bootstrap Headline",
|
||||
"difficulty": 2.18,
|
||||
"description": [
|
||||
"Now let's build something from scratch to practice our HTML, CSS and Bootstrap skills.",
|
||||
"We'll build a jQuery playground, which we'll soon put to use in our jQuery challenges.",
|
||||
@ -1653,7 +1634,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aec908746",
|
||||
"title": "House our page within a Bootstrap Container Fluid Div",
|
||||
"difficulty": 2.18,
|
||||
"description": [
|
||||
"Now let's make sure all the content on your page is mobile-responsive.",
|
||||
"Let's nest your <code>h3</code> element within a <code>div</code> element with the class <code>container-fluid</code>."
|
||||
@ -1683,7 +1663,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9bec908846",
|
||||
"title": "Create a Bootstrap Row",
|
||||
"difficulty": 2.19,
|
||||
"description": [
|
||||
"Now we'll create a Bootstrap row for our inline elements.",
|
||||
"Create a <code>div</code> element with the class <code>row</code>."
|
||||
@ -1716,7 +1695,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aec908847",
|
||||
"title": "Split your Bootstrap Row",
|
||||
"difficulty": 2.20,
|
||||
"description": [
|
||||
"Now that we have a Bootstrap Row, let's split it into two columns to house our elements.",
|
||||
"Create two <code>div</code> elements within your row, both with the class <code>col-xs-6</code>."
|
||||
@ -1750,7 +1728,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aec908848",
|
||||
"title": "Create Bootstrap Wells",
|
||||
"difficulty": 2.21,
|
||||
"description": [
|
||||
"Bootstrap has a class called <code>well</code> that can create a visual sense of depth for your columns.",
|
||||
"Nest one <code>div</code> element with the class <code>well</code> within each of your <code>col-xs-6</code> <code>div</code> elements."
|
||||
@ -1789,7 +1766,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aec908849",
|
||||
"title": "Add Elements within your Bootstrap Wells",
|
||||
"difficulty": 2.22,
|
||||
"description": [
|
||||
"Now we're several <code>div</code> elements deep on each column of our row. This is as deep as we'll need to go. Now we can add our <code>button</code> elements.",
|
||||
"Nest three <code>button</code> elements within each of your <code>well</code> <code>div</code> elements."
|
||||
@ -1836,7 +1812,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aec908850",
|
||||
"title": "Apply the Default Bootstrap Button Style",
|
||||
"difficulty": 2.23,
|
||||
"description": [
|
||||
"Bootstrap has another button class called <code>btn-default</code>.",
|
||||
"Apply both the <code>btn</code> and <code>btn-default</code> classes to each of your <code>button</code> elements."
|
||||
@ -1882,7 +1857,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aec908852",
|
||||
"title": "Create a Class to Target with jQuery Selectors",
|
||||
"difficulty": 2.24,
|
||||
"description": [
|
||||
"Not every class needs to have corresponding CSS. Sometimes we create classes just for the purpose of selecting these elements more easily using jQuery.",
|
||||
"Give each of your <code>button</code> elements the class <code>target</code>."
|
||||
@ -1927,7 +1901,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aec908853",
|
||||
"title": "Add ID Attributes to Bootstrap Elements",
|
||||
"difficulty": 2.25,
|
||||
"description": [
|
||||
"Recall that in addition to class attributes, you can give each of your elements an <code>id</code> attribute.",
|
||||
"Each id should be unique to a specific element.",
|
||||
@ -1976,7 +1949,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aec908854",
|
||||
"title": "Label Bootstrap Wells",
|
||||
"difficulty": 2.26,
|
||||
"description": [
|
||||
"For the sake of clarity, let's label both of our wells with their ids.",
|
||||
"Above your left-well, inside its <code>col-xs-6</code> <code>div</code> element, add a <code>h4</code> element with the text <code>#left-well</code>.",
|
||||
@ -2027,7 +1999,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aec908855",
|
||||
"title": "Give Each Element a Unique ID",
|
||||
"difficulty": 2.27,
|
||||
"description": [
|
||||
"We will also want to be able to use jQuery to target each button by its unique id.",
|
||||
"Give each of your buttons a unique id like, starting with <code>target1</code> and ending with <code>target6</code>."
|
||||
@ -2079,7 +2050,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aec908856",
|
||||
"title": "Label Bootstrap Buttons",
|
||||
"difficulty": 2.28,
|
||||
"description": [
|
||||
"Just like we labeled our wells, we want to label our buttons.",
|
||||
"Give each of your <code>button</code> elements text that corresponds to their <code>id</code>."
|
||||
@ -2131,7 +2101,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aec908857",
|
||||
"title": "Use Comments to Clarify Code",
|
||||
"difficulty": 2.29,
|
||||
"description": [
|
||||
"When we start using jQuery, we will modify HTML elements without needing to actually change them in HTML.",
|
||||
"Let's make sure that everyone knows they shouldn't actually modify any of this code directly.",
|
||||
|
226
seed/challenges/front-end-development-certificate.json
Normal file
226
seed/challenges/front-end-development-certificate.json
Normal file
@ -0,0 +1,226 @@
|
||||
{
|
||||
"name": "Claim Your Front End Development Certificate",
|
||||
"order": 12,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "561add10cb82ac38a17513be",
|
||||
"title": "Claim Your Front End Development Certificate",
|
||||
"difficulty": 0.00,
|
||||
"challengeSeed": [],
|
||||
"description": [
|
||||
[
|
||||
"http://i.imgur.com/RlEk2IF.jpg",
|
||||
"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.",
|
||||
""
|
||||
]
|
||||
],
|
||||
"type": "Waypoint",
|
||||
"challengeType": 7,
|
||||
"tests": [
|
||||
{
|
||||
"id": "ad7123c8c441eddfaeb5bdef",
|
||||
"title": "Meet Bonfire"
|
||||
},
|
||||
{
|
||||
"id": "a202eed8fc186c8434cb6d61",
|
||||
"title": "Reverse a String"
|
||||
},
|
||||
{
|
||||
"id": "a302f7aae1aa3152a5b413bc",
|
||||
"title": "Factorialize a Number"
|
||||
},
|
||||
{
|
||||
"id": "aaa48de84e1ecc7c742e1124",
|
||||
"title": "Check for Palindromes"
|
||||
},
|
||||
{
|
||||
"id": "a26cbbe9ad8655a977e1ceb5",
|
||||
"title": "Find the Longest Word in a String"
|
||||
},
|
||||
{
|
||||
"id": "ab6137d4e35944e21037b769",
|
||||
"title": "Title Case a Sentence"
|
||||
},
|
||||
{
|
||||
"id": "a789b3483989747d63b0e427",
|
||||
"title": "Return Largest Numbers in Arrays"
|
||||
},
|
||||
{
|
||||
"id": "acda2fb1324d9b0fa741e6b5",
|
||||
"title": "Confirm the Ending"
|
||||
},
|
||||
{
|
||||
"id": "afcc8d540bea9ea2669306b6",
|
||||
"title": "Repeat a string repeat a string"
|
||||
},
|
||||
{
|
||||
"id": "ac6993d51946422351508a41",
|
||||
"title": "Truncate a string"
|
||||
},
|
||||
{
|
||||
"id": "a9bd25c716030ec90084d8a1",
|
||||
"title": "Chunky Monkey"
|
||||
},
|
||||
{
|
||||
"id": "ab31c21b530c0dafa9e241ee",
|
||||
"title": "Slasher Flick"
|
||||
},
|
||||
{
|
||||
"id": "af2170cad53daa0770fabdea",
|
||||
"title": "Mutations"
|
||||
},
|
||||
{
|
||||
"id": "adf08ec01beb4f99fc7a68f2",
|
||||
"title": "Falsy Bouncer"
|
||||
},
|
||||
{
|
||||
"id": "a39963a4c10bc8b4d4f06d7e",
|
||||
"title": "Seek and Destroy"
|
||||
},
|
||||
{
|
||||
"id": "a24c1a4622e3c05097f71d67",
|
||||
"title": "Where do I belong"
|
||||
},
|
||||
{
|
||||
"id": "a3566b1109230028080c9345",
|
||||
"title": "Sum All Numbers in a Range"
|
||||
},
|
||||
{
|
||||
"id": "a5de63ebea8dbee56860f4f2",
|
||||
"title": "Diff Two Arrays"
|
||||
},
|
||||
{
|
||||
"id": "a7f4d8f2483413a6ce226cac",
|
||||
"title": "Roman Numeral Converter"
|
||||
},
|
||||
{
|
||||
"id": "a8e512fbe388ac2f9198f0fa",
|
||||
"title": "Where art thou"
|
||||
},
|
||||
{
|
||||
"id": "a0b5010f579e69b815e7c5d6",
|
||||
"title": "Search and Replace"
|
||||
},
|
||||
{
|
||||
"id": "aa7697ea2477d1316795783b",
|
||||
"title": "Pig Latin"
|
||||
},
|
||||
{
|
||||
"id": "afd15382cdfb22c9efe8b7de",
|
||||
"title": "DNA Pairing"
|
||||
},
|
||||
{
|
||||
"id": "af7588ade1100bde429baf20",
|
||||
"title": "Missing letters"
|
||||
},
|
||||
{
|
||||
"id": "a77dbc43c33f39daa4429b4f",
|
||||
"title": "Boo who"
|
||||
},
|
||||
{
|
||||
"id": "a105e963526e7de52b219be9",
|
||||
"title": "Sorted Union"
|
||||
},
|
||||
{
|
||||
"id": "a6b0bb188d873cb2c8729495",
|
||||
"title": "Convert HTML Entities"
|
||||
},
|
||||
{
|
||||
"id": "a103376db3ba46b2d50db289",
|
||||
"title": "Spinal Tap Case"
|
||||
},
|
||||
{
|
||||
"id": "a5229172f011153519423690",
|
||||
"title": "Sum All Odd Fibonacci Numbers"
|
||||
},
|
||||
{
|
||||
"id": "a3bfc1673c0526e06d3ac698",
|
||||
"title": "Sum All Primes"
|
||||
},
|
||||
{
|
||||
"id": "ae9defd7acaf69703ab432ea",
|
||||
"title": "Smallest Common Multiple"
|
||||
},
|
||||
{
|
||||
"id": "a6e40f1041b06c996f7b2406",
|
||||
"title": "Finders Keepers"
|
||||
},
|
||||
{
|
||||
"id": "a5deed1811a43193f9f1c841",
|
||||
"title": "Drop it"
|
||||
},
|
||||
{
|
||||
"id": "ab306dbdcc907c7ddfc30830",
|
||||
"title": "Steamroller"
|
||||
},
|
||||
{
|
||||
"id": "a8d97bd4c764e91f9d2bda01",
|
||||
"title": "Binary Agents"
|
||||
},
|
||||
{
|
||||
"id": "a10d2431ad0c6a099a4b8b52",
|
||||
"title": "Everything Be True"
|
||||
},
|
||||
{
|
||||
"id": "a97fd23d9b809dac9921074f",
|
||||
"title": "Arguments Optional"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfbeb5bd1f",
|
||||
"title": "Get Set for Ziplines"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c242eddfaeb5bd13",
|
||||
"title": "Build a Personal Portfolio Webpage"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd13",
|
||||
"title": "Build a Random Quote Machine"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd0f",
|
||||
"title": "Build a Pomodoro Clock"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd17",
|
||||
"title": "Build a JavaScript Calculator"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd10",
|
||||
"title": "Show the Local Weather"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd1f",
|
||||
"title": "Use the Twitch.tv JSON API"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd18",
|
||||
"title": "Stylize Stories on Camper News"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd19",
|
||||
"title": "Build a Wikipedia Viewer"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eedfaeb5bd1c",
|
||||
"title": "Build a Tic Tac Toe Game"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd1c",
|
||||
"title": "Build a Simon Game"
|
||||
}
|
||||
],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
}
|
||||
]
|
||||
}
|
286
seed/challenges/full-stack-development-certificate.json
Normal file
286
seed/challenges/full-stack-development-certificate.json
Normal file
@ -0,0 +1,286 @@
|
||||
{
|
||||
"name": "Claim Your Full Stack Development Certificate",
|
||||
"order": 21,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "660add10cb82ac38a17513be",
|
||||
"title": "Claim Your Full Stack Development Certificate",
|
||||
"difficulty": 0.00,
|
||||
"challengeSeed": [],
|
||||
"description": [
|
||||
[
|
||||
"http://i.imgur.com/RlEk2IF.jpg",
|
||||
"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.",
|
||||
""
|
||||
]
|
||||
],
|
||||
"type": "Waypoint",
|
||||
"challengeType": 7,
|
||||
"tests": [
|
||||
{
|
||||
"id": "ad7123c8c441eddfaeb5bdef",
|
||||
"title": "Meet Bonfire"
|
||||
},
|
||||
{
|
||||
"id": "a202eed8fc186c8434cb6d61",
|
||||
"title": "Reverse a String"
|
||||
},
|
||||
{
|
||||
"id": "a302f7aae1aa3152a5b413bc",
|
||||
"title": "Factorialize a Number"
|
||||
},
|
||||
{
|
||||
"id": "aaa48de84e1ecc7c742e1124",
|
||||
"title": "Check for Palindromes"
|
||||
},
|
||||
{
|
||||
"id": "a26cbbe9ad8655a977e1ceb5",
|
||||
"title": "Find the Longest Word in a String"
|
||||
},
|
||||
{
|
||||
"id": "ab6137d4e35944e21037b769",
|
||||
"title": "Title Case a Sentence"
|
||||
},
|
||||
{
|
||||
"id": "a789b3483989747d63b0e427",
|
||||
"title": "Return Largest Numbers in Arrays"
|
||||
},
|
||||
{
|
||||
"id": "acda2fb1324d9b0fa741e6b5",
|
||||
"title": "Confirm the Ending"
|
||||
},
|
||||
{
|
||||
"id": "afcc8d540bea9ea2669306b6",
|
||||
"title": "Repeat a string repeat a string"
|
||||
},
|
||||
{
|
||||
"id": "ac6993d51946422351508a41",
|
||||
"title": "Truncate a string"
|
||||
},
|
||||
{
|
||||
"id": "a9bd25c716030ec90084d8a1",
|
||||
"title": "Chunky Monkey"
|
||||
},
|
||||
{
|
||||
"id": "ab31c21b530c0dafa9e241ee",
|
||||
"title": "Slasher Flick"
|
||||
},
|
||||
{
|
||||
"id": "af2170cad53daa0770fabdea",
|
||||
"title": "Mutations"
|
||||
},
|
||||
{
|
||||
"id": "adf08ec01beb4f99fc7a68f2",
|
||||
"title": "Falsy Bouncer"
|
||||
},
|
||||
{
|
||||
"id": "a39963a4c10bc8b4d4f06d7e",
|
||||
"title": "Seek and Destroy"
|
||||
},
|
||||
{
|
||||
"id": "a24c1a4622e3c05097f71d67",
|
||||
"title": "Where do I belong"
|
||||
},
|
||||
{
|
||||
"id": "a3566b1109230028080c9345",
|
||||
"title": "Sum All Numbers in a Range"
|
||||
},
|
||||
{
|
||||
"id": "a5de63ebea8dbee56860f4f2",
|
||||
"title": "Diff Two Arrays"
|
||||
},
|
||||
{
|
||||
"id": "a7f4d8f2483413a6ce226cac",
|
||||
"title": "Roman Numeral Converter"
|
||||
},
|
||||
{
|
||||
"id": "a8e512fbe388ac2f9198f0fa",
|
||||
"title": "Where art thou"
|
||||
},
|
||||
{
|
||||
"id": "a0b5010f579e69b815e7c5d6",
|
||||
"title": "Search and Replace"
|
||||
},
|
||||
{
|
||||
"id": "aa7697ea2477d1316795783b",
|
||||
"title": "Pig Latin"
|
||||
},
|
||||
{
|
||||
"id": "afd15382cdfb22c9efe8b7de",
|
||||
"title": "DNA Pairing"
|
||||
},
|
||||
{
|
||||
"id": "af7588ade1100bde429baf20",
|
||||
"title": "Missing letters"
|
||||
},
|
||||
{
|
||||
"id": "a77dbc43c33f39daa4429b4f",
|
||||
"title": "Boo who"
|
||||
},
|
||||
{
|
||||
"id": "a105e963526e7de52b219be9",
|
||||
"title": "Sorted Union"
|
||||
},
|
||||
{
|
||||
"id": "a6b0bb188d873cb2c8729495",
|
||||
"title": "Convert HTML Entities"
|
||||
},
|
||||
{
|
||||
"id": "a103376db3ba46b2d50db289",
|
||||
"title": "Spinal Tap Case"
|
||||
},
|
||||
{
|
||||
"id": "a5229172f011153519423690",
|
||||
"title": "Sum All Odd Fibonacci Numbers"
|
||||
},
|
||||
{
|
||||
"id": "a3bfc1673c0526e06d3ac698",
|
||||
"title": "Sum All Primes"
|
||||
},
|
||||
{
|
||||
"id": "ae9defd7acaf69703ab432ea",
|
||||
"title": "Smallest Common Multiple"
|
||||
},
|
||||
{
|
||||
"id": "a6e40f1041b06c996f7b2406",
|
||||
"title": "Finders Keepers"
|
||||
},
|
||||
{
|
||||
"id": "a5deed1811a43193f9f1c841",
|
||||
"title": "Drop it"
|
||||
},
|
||||
{
|
||||
"id": "ab306dbdcc907c7ddfc30830",
|
||||
"title": "Steamroller"
|
||||
},
|
||||
{
|
||||
"id": "a8d97bd4c764e91f9d2bda01",
|
||||
"title": "Binary Agents"
|
||||
},
|
||||
{
|
||||
"id": "a10d2431ad0c6a099a4b8b52",
|
||||
"title": "Everything Be True"
|
||||
},
|
||||
{
|
||||
"id": "a97fd23d9b809dac9921074f",
|
||||
"title": "Arguments Optional"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfbeb5bd1f",
|
||||
"title": "Get Set for Ziplines"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c242eddfaeb5bd13",
|
||||
"title": "Build a Personal Portfolio Webpage"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd13",
|
||||
"title": "Build a Random Quote Machine"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd0f",
|
||||
"title": "Build a Pomodoro Clock"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd17",
|
||||
"title": "Build a JavaScript Calculator"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd10",
|
||||
"title": "Show the Local Weather"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd1f",
|
||||
"title": "Use the Twitch.tv JSON API"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd18",
|
||||
"title": "Stylize Stories on Camper News"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd19",
|
||||
"title": "Build a Wikipedia Viewer"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eedfaeb5bd1c",
|
||||
"title": "Build a Tic Tac Toe Game"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd1c",
|
||||
"title": "Build a Simon Game"
|
||||
},
|
||||
{
|
||||
"id": "a2f1d72d9b908d0bd72bb9f6",
|
||||
"title": "Make a Person"
|
||||
},
|
||||
{
|
||||
"id": "af4afb223120f7348cdfc9fd",
|
||||
"title": "Map the Debris"
|
||||
},
|
||||
{
|
||||
"id": "a3f503de51cfab748ff001aa",
|
||||
"title": "Pairwise"
|
||||
},
|
||||
{
|
||||
"id": "aff0395860f5d3034dc0bfc9",
|
||||
"title": "Validate US Telephone Numbers"
|
||||
},
|
||||
{
|
||||
"id": "a3f503de51cf954ede28891d",
|
||||
"title": "Symmetric Difference"
|
||||
},
|
||||
{
|
||||
"id": "aa2e6f85cab2ab736c9a9b24",
|
||||
"title": "Exact Change"
|
||||
},
|
||||
{
|
||||
"id": "a56138aff60341a09ed6c480",
|
||||
"title": "Inventory Update"
|
||||
},
|
||||
{
|
||||
"id": "a7bf700cd123b9a54eef01d5",
|
||||
"title": "No repeats please"
|
||||
},
|
||||
{
|
||||
"id": "a19f0fbe1872186acd434d5a",
|
||||
"title": "Friendly Date Ranges"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c443eddfaeb5bcef",
|
||||
"title": "Get Set for Basejumps"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c443eddfaeb5bdef",
|
||||
"title": "Build a Voting App"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c443eddfaeb5bdff",
|
||||
"title": "Build a Nightlife Coordination App"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c443eddfaeb5bd0e",
|
||||
"title": "Chart the Stock Market"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c443eddfaeb5bd0f",
|
||||
"title": "Manage a Book Trading Club"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c443eddfaeb5bdee",
|
||||
"title": "Build a Pinterest Clone"
|
||||
}
|
||||
],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
}
|
||||
]
|
||||
}
|
314
seed/challenges/getting-started.json
Normal file
314
seed/challenges/getting-started.json
Normal file
@ -0,0 +1,314 @@
|
||||
{
|
||||
"name": "Get Started with Free Code Camp",
|
||||
"order": 1,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "560add10cb82ac38a17513be",
|
||||
"title": "Learn how Free Code Camp Works",
|
||||
"challengeSeed": [],
|
||||
"description": [
|
||||
[
|
||||
"http://i.imgur.com/RlEk2IF.jpg",
|
||||
"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.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/pYsTbjI.jpg",
|
||||
"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.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/D7Y5luw.jpg",
|
||||
"A graph of the rate of job growth against growth in computer science degree graduates. There are 1.4 million jobs and only 400 million people to fill them.",
|
||||
"There are thousands of coding jobs currently going unfilled, and the demand for coders grows every year. If you want a coding job, we can help prepare you to get one.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/dLx8nrg.jpg",
|
||||
"An illustration showing that you will learn HTML5, CSS3, JavaScript, Databases, Git, Node.js, Angular.js and Agile.",
|
||||
"First you'll work through our rigorous 800-hour curriculum learn technologies like HTML5, Node.js and databases. It's self-paced and 100% free.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/q4IjuCL.jpg",
|
||||
"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.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/yXyxbDd.jpg",
|
||||
"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.",
|
||||
""
|
||||
]
|
||||
],
|
||||
"type": "Waypoint",
|
||||
"challengeType": 7,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "560add37cb82ac38a17513bf",
|
||||
"title": "Create a GitHub Account and Join our Chat Rooms",
|
||||
"challengeSeed": [],
|
||||
"description": [
|
||||
[
|
||||
"http://i.imgur.com/EAR7Lvh.jpg",
|
||||
"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.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/FEImaEN.gif",
|
||||
"A gif showing you to click the link below to go to GitHub. Fill in the necessary fields and click submit.",
|
||||
"Create an account with GitHub. Be sure to use your real email address - GitHub will keep this private.",
|
||||
"https://github.com/join"
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/ALN6zPK.gif",
|
||||
"A gif showing you how to click the profile image in the upper right hand corner of GitHub. Upload a photo of yourself or you will continue to use the automatically generated pixel art. Then fill in the remaining form fields and click submit.",
|
||||
"Click the pixel art in the upper right hand corner of GitHub, then choose settings. Upload a picture of yourself. A picture of your face works best. This is how your fellow campers will see you in our chat rooms, so put your best foot forward. You can add your city and your name if you want.",
|
||||
"https://github.com/settings/profile"
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/OXL3G3n.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.",
|
||||
"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"
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/EZHzKCV.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.",
|
||||
" 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"
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/Ecs5XAd.gif",
|
||||
"A gif showing you how you can click the settings button in the upper right hand corner and modify your notification settings.",
|
||||
"Our chat rooms are extremely active. You should change your settings so you're only notified if someone mentions you.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/T0bGJPe.gif",
|
||||
"A gif showing how you can click on a user profile image to initiate a private message with that user.",
|
||||
"Please note that all of our chat rooms are visible to the public. If you need to share sensitive information, such as an email address or phone number, do it in a private message.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/vDTMJSh.gif",
|
||||
"A gif showing that you can tab back and forth between challenges and our chat rooms.",
|
||||
"Keep our chat room open while you work through our challenges. That way, you can ask for help if you get stuck. You can also socialize with other campers when you feel like taking a break.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/SLQ27Gr.gif",
|
||||
"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.",
|
||||
"https://gitter.im/apps"
|
||||
]
|
||||
],
|
||||
"type": "Waypoint",
|
||||
"challengeType": 7,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "560add56cb82ac38a17513c0",
|
||||
"title": "Configure your Public Profile",
|
||||
"challengeSeed": [],
|
||||
"description": [
|
||||
[
|
||||
"http://i.imgur.com/FkEzbto.gif",
|
||||
"A gif showing how you can click your profile image in your upper right hand corner to access the account page and connect GitHub.",
|
||||
"Check out your portfolio page. Click your picture your upper right hand corner. To activate your portfolio page, you'll need to link your GitHub account with Free Code Camp.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/WKzEr1q.gif",
|
||||
"A gif showing how you can access your profile page and hover over different days to see how many brownie points you got on those days.",
|
||||
"Your portfolio page 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.",
|
||||
""
|
||||
]
|
||||
],
|
||||
"type": "Waypoint",
|
||||
"challengeType": 7,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "560add65cb82ac38a17513c1",
|
||||
"title": "Try our Wiki and Camper News",
|
||||
"challengeSeed": [],
|
||||
"description": [
|
||||
[
|
||||
"http://i.imgur.com/DoOqkNW.gif",
|
||||
"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.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/nmSiMy1.gif",
|
||||
"A gif showing how you can access our Camper News page and click the \"upvote\" button to upvote a story.",
|
||||
"Click the \"News\" button in your upper right hand corner. You can browse links on Camper News and upvote ones that you enjoy.",
|
||||
""
|
||||
]
|
||||
],
|
||||
"type": "Waypoint",
|
||||
"challengeType": 7,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "560add71cb82ac38a17513c2",
|
||||
"title": "Join a Campsite in Your City",
|
||||
"challengeSeed": [],
|
||||
"description": [
|
||||
[
|
||||
"http://i.imgur.com/Elb3dfj.jpg",
|
||||
"A picture of some of our campers meeting in a local cafe. 3 men and 3 women are sitting around a table with laptops out, and are smiling and coding.",
|
||||
"Our Campsites help you code with campers in your city. You can coordinate study groups or attend local coding events together.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/EZHzKCV.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.",
|
||||
"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.",
|
||||
"https://github.com/FreeCodeCamp/freecodecamp/wiki/List-of-Free-Code-Camp-city-based-Campsites"
|
||||
]
|
||||
],
|
||||
"type": "Waypoint",
|
||||
"challengeType": 7,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "560add8ccb82ac38a17513c3",
|
||||
"title": "Join our Alumni Network and Commit to Your Goal",
|
||||
"challengeSeed": [],
|
||||
"description": [
|
||||
[
|
||||
"http://i.imgur.com/P7qfJXt.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.",
|
||||
"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\".",
|
||||
"https://www.linkedin.com/profile/edit-education?school=Free+Code+Camp"
|
||||
],
|
||||
[
|
||||
"",
|
||||
"",
|
||||
"Free Code Camp will always be free. If you want to feel more motivated to earn our certificates faster, we encourage you to instead donate each month to a nonprofit.",
|
||||
""
|
||||
]
|
||||
],
|
||||
"type": "Waypoint",
|
||||
"challengeType": 7,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "560add8ccb82ac38a17513c4",
|
||||
"title": "Learn What to Do If You Get Stuck",
|
||||
"challengeSeed": [],
|
||||
"description": [
|
||||
[
|
||||
"http://i.imgur.com/EWWZBag.jpg",
|
||||
"An image with the text \"1. Read the error 2. Search Google 3. Ask for help.",
|
||||
"Let's cover one last thing before you start working through our challenges: how to get help. Any time you get stuck or don't know what to do next: Read-Search-Ask.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/99BfAcK.jpg",
|
||||
"An image showing jQuery documentation",
|
||||
"First, read the documentation or error message. A key skill that good coders have is the ability to interpret and then follow instructions.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/GxvrsFb.gif",
|
||||
"A gif showing you how to do an advanced Google search. First, we enter the query \"jquery doesn't run when my page loads\". Then we click search tools button and change the \"Any time\" select box to \"within the last year\". Then we click on a result and read through the article and find our answer.",
|
||||
"If that didn't help, search Google. Good Google queries take a lot of practice. When you search Google, you usually want to include the language or framework you're using. You also want to limit the results to a recent period.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/LZYU7p2.gif",
|
||||
"A gif showing us following the link below to go to the help chat room and ask \"jquery doesn't run when my page loads\".",
|
||||
"If that didn't help, ask your friends. If you have trouble, you can ask your fellow campers in our help chat room.",
|
||||
"https://gitter.im/FreeCodeCamp/Help"
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/WsfzvVo.gif",
|
||||
"A gif showing us clicking the \"map\" button in our upper right hand corner and browsing 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.",
|
||||
""
|
||||
]
|
||||
],
|
||||
"type": "Waypoint",
|
||||
"challengeType": 7,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
}
|
||||
]
|
||||
}
|
@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "Git",
|
||||
"order" : 0.016,
|
||||
"order" : 17,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bd7353d8c341eddeaeb5bd0f",
|
||||
"title": "Save your Code Revisions Forever with Git",
|
||||
"difficulty": 0.01,
|
||||
"challengeSeed": ["133316034"],
|
||||
"description": [
|
||||
"We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
|
||||
|
@ -5,7 +5,6 @@
|
||||
{
|
||||
"id": "bd7128d8c441eddfbeb5bddf",
|
||||
"title": "Computer Basics 1: The 4 Basic Parts of a Computer",
|
||||
"difficulty": 9.01,
|
||||
"challengeSeed": [
|
||||
"132542064"
|
||||
],
|
||||
@ -45,7 +44,6 @@
|
||||
{
|
||||
"id": "bd7127d8c441eddfbeb5bddf",
|
||||
"title": "Computer Basics 2: More Computer Hardware",
|
||||
"difficulty": 9.02,
|
||||
"challengeSeed": [
|
||||
"132542458"
|
||||
],
|
||||
@ -84,7 +82,6 @@
|
||||
{
|
||||
"id": "bd7126d8c441eddfbeb5bddf",
|
||||
"title": "Computer Basics 3: Intro to Binary Code",
|
||||
"difficulty": 9.03,
|
||||
"challengeSeed": [
|
||||
"132542757"
|
||||
],
|
||||
@ -118,7 +115,6 @@
|
||||
{
|
||||
"id": "bd7125d8c441eddfbeb5bddf",
|
||||
"title": "Computer Basics 4: Decoding a Binary Number",
|
||||
"difficulty": 9.04,
|
||||
"challengeSeed": [
|
||||
"132543332"
|
||||
],
|
||||
@ -154,7 +150,6 @@
|
||||
{
|
||||
"id": "bd7124d8c441eddfbeb5bddf",
|
||||
"title": "Computer Basics 5: How To Measure Data Size",
|
||||
"difficulty": 9.05,
|
||||
"challengeSeed": [
|
||||
"132543959"
|
||||
],
|
||||
@ -193,7 +188,6 @@
|
||||
{
|
||||
"id": "bd7123d8c441eddfbeb5bddf",
|
||||
"title": "Computer Basics 6: Measuring Data Speed",
|
||||
"difficulty": 9.06,
|
||||
"challengeSeed": [
|
||||
"132545171"
|
||||
],
|
||||
@ -230,7 +224,6 @@
|
||||
{
|
||||
"id": "bd7122d8c441eddfbeb5bddf",
|
||||
"title": "Computer Basics 7: Binary Bytes",
|
||||
"difficulty": 9.07,
|
||||
"challengeSeed": [
|
||||
"132545417"
|
||||
],
|
||||
@ -264,7 +257,6 @@
|
||||
{
|
||||
"id": "bd7121d8c441eddfbeb5bddf",
|
||||
"title": "Computer Basics 8: Types of Computers",
|
||||
"difficulty": 9.08,
|
||||
"challengeSeed": [
|
||||
"132546182"
|
||||
],
|
||||
@ -303,7 +295,6 @@
|
||||
{
|
||||
"id": "bd7120d8c441eddfbeb5bddf",
|
||||
"title": "Computer Basics 9: More on the Motherboard",
|
||||
"difficulty": 9.09,
|
||||
"challengeSeed": [
|
||||
"132547285"
|
||||
],
|
||||
@ -344,7 +335,6 @@
|
||||
{
|
||||
"id": "bd712fd8c441eddfbeb5bddf",
|
||||
"title": "Computer Basics 10: Data Networks",
|
||||
"difficulty": 9.10,
|
||||
"challengeSeed": [
|
||||
"132547590"
|
||||
],
|
||||
@ -384,7 +374,6 @@
|
||||
{
|
||||
"id": "bd712ed8c441eddfbeb5bddf",
|
||||
"title": "Computer Basics 11: IP Addresses",
|
||||
"difficulty": 9.11,
|
||||
"challengeSeed": [
|
||||
"132548071"
|
||||
],
|
||||
@ -423,7 +412,6 @@
|
||||
{
|
||||
"id": "bd712dd8c441eddfbeb5bddf",
|
||||
"title": "Computer Basics 12: How the Internet Works",
|
||||
"difficulty": 9.12,
|
||||
"challengeSeed": [
|
||||
"132548579"
|
||||
],
|
||||
@ -462,7 +450,6 @@
|
||||
{
|
||||
"id": "bd712cd8c441eddfbeb5bddf",
|
||||
"title": "Computer Basics 13: Software",
|
||||
"difficulty": 9.13,
|
||||
"challengeSeed": [
|
||||
"132548908"
|
||||
],
|
||||
@ -495,7 +482,6 @@
|
||||
{
|
||||
"id": "bd712bd8c441eddfbeb5bddf",
|
||||
"title": "What Do Programmers Do?",
|
||||
"difficulty": 9.14,
|
||||
"challengeSeed": [
|
||||
"133166912"
|
||||
],
|
||||
@ -532,7 +518,6 @@
|
||||
{
|
||||
"id": "bd712ad8c441eddfbeb5bddf",
|
||||
"title": "Console and Logging",
|
||||
"difficulty": 9.15,
|
||||
"challengeSeed": [
|
||||
"133170880"
|
||||
],
|
||||
@ -569,7 +554,6 @@
|
||||
{
|
||||
"id": "bd7119d8c441eddfbeb5bddf",
|
||||
"title": "Variables In Code",
|
||||
"difficulty": 9.16,
|
||||
"challengeSeed": [
|
||||
"133172920"
|
||||
],
|
||||
@ -602,7 +586,6 @@
|
||||
{
|
||||
"id": "bd7029d8c441eddfbeb5bddf",
|
||||
"title": "Source Code",
|
||||
"difficulty": 9.17,
|
||||
"challengeSeed": [
|
||||
"133177129"
|
||||
],
|
||||
@ -647,7 +630,6 @@
|
||||
{
|
||||
"id": "bd7129d8b441eddfbeb5bddf",
|
||||
"title": "Routers and Packets",
|
||||
"difficulty": 9.18,
|
||||
"challengeSeed": [
|
||||
"133181251"
|
||||
],
|
||||
@ -698,7 +680,6 @@
|
||||
{
|
||||
"id": "bd7129d8a441eddfbeb5bddf",
|
||||
"title": "Hardware: Chips and Moore's Law",
|
||||
"difficulty": 9.19,
|
||||
"challengeSeed": [
|
||||
"133182057"
|
||||
],
|
||||
@ -735,7 +716,6 @@
|
||||
{
|
||||
"id": "bd7129d80441eddfbeb5bddf",
|
||||
"title": "Analog vs Digital and File Compression",
|
||||
"difficulty": 9.20,
|
||||
"challengeSeed": [
|
||||
"133182587"
|
||||
],
|
||||
@ -774,7 +754,6 @@
|
||||
{
|
||||
"id": "bd7129d89441eddfbeb5bddf",
|
||||
"title": "Computer Security",
|
||||
"difficulty": 9.21,
|
||||
"challengeSeed": [
|
||||
"133186284"
|
||||
],
|
||||
|
@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "HTML5 and CSS",
|
||||
"order": 0.002,
|
||||
"order": 2,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bd7123c8c441eddfaeb5bdef",
|
||||
"title": "Say Hello to HTML Elements",
|
||||
"difficulty": 1.01,
|
||||
"description": [
|
||||
"Welcome to Free Code Camp's first coding challenge!",
|
||||
"You can edit <code>code</code> in your <code>text editor</code>, which we've embedded into this web page.",
|
||||
@ -54,8 +53,9 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf0887a",
|
||||
"title": "Headline with the h2 Element",
|
||||
"difficulty": 1.02,
|
||||
"description": [
|
||||
"Over the next few challenges, we'll build an HTML5 app that will look something like this:",
|
||||
"<a href=\"http://i.imgur.com/jOc1JF1.png\" data-lightbox=\"img-enlarge\"><img class=\"img-responsive\" src=\"http://i.imgur.com/jOc1JF1.png\" title=\"Click to enlarge\" alt=\"A screen shot of our finished Cat Photo App\"></a>",
|
||||
"Add an <code>h2</code> tag that says \"CatPhotoApp\" to create a second HTML <code>element</code> below your \"Hello World\" <code>h1</code> element.",
|
||||
"The <code>h2</code> element you enter will create an <code>h2</code> element on the website.",
|
||||
"This element tells the browser how to render the text that it contains.",
|
||||
@ -98,7 +98,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08801",
|
||||
"title": "Inform with the Paragraph Element",
|
||||
"difficulty": 1.03,
|
||||
"description": [
|
||||
"Create a <code>p</code> element below your <code>h2</code> element, and give it the text \"Hello Paragraph\".",
|
||||
"<code>p</code> elements are the preferred element for normal-sized paragraph text on websites. P is short for \"paragraph\".",
|
||||
@ -139,7 +138,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08802",
|
||||
"title": "Uncomment HTML",
|
||||
"difficulty": 1.04,
|
||||
"description": [
|
||||
"Uncomment your <code>h1</code>, <code>h2</code> and <code>p</code> elements.",
|
||||
"Commenting is a way that you can leave comments within your code without affecting the code itself.",
|
||||
@ -189,7 +187,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08804",
|
||||
"title": "Comment out HTML",
|
||||
"difficulty": 1.05,
|
||||
"description": [
|
||||
"Comment out your <code>h1</code> element and your <code>p</code> element, but leave your <code>h2</code> element uncommented.",
|
||||
"Remember that in order to start a comment, you need to use <code><!--</code> and to end a comment, you need to use <code>--></code>.",
|
||||
@ -236,7 +233,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08833",
|
||||
"title": "Fill in the Blank with Placeholder Text",
|
||||
"difficulty": 1.06,
|
||||
"description": [
|
||||
"Web developers traditionally use <code>lorem ipsum text</code> as placeholder text. It's called <code>lorem ipsum text</code> because those are the first two words of a famous passage by Cicero of Ancient Rome.",
|
||||
"<code>lorem ipsum text</code> has been used as placeholder text by typesetters since the 16th century, and this tradition continues on the web.",
|
||||
@ -283,7 +279,6 @@
|
||||
{
|
||||
"id": "bad87fed1348bd9aedf08833",
|
||||
"title": "Delete HTML Elements",
|
||||
"difficulty": 1.07,
|
||||
"description": [
|
||||
"Delete your <code>h1</code> element so we can simplify our view.",
|
||||
"Our phone doesn't have much vertical space.",
|
||||
@ -327,7 +322,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08803",
|
||||
"title": "Change the Color of Text",
|
||||
"difficulty": 1.08,
|
||||
"description": [
|
||||
"Change your <code>h2</code> element's style so that its text color is red.",
|
||||
"We can do this by changing the \"style\" of your <code>h2</code> element.",
|
||||
@ -369,7 +363,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08805",
|
||||
"title": "Use CSS Selectors to Style Elements",
|
||||
"difficulty": 1.09,
|
||||
"description": [
|
||||
"Delete your <code>h2</code> element's style attribute and instead create a CSS <code>style</code> element. Add the necessary CSS to turn all <code>h2</code> elements blue.",
|
||||
"With CSS, there are hundreds of CSS <code>properties</code> that you can use to change the way an element looks on your page.",
|
||||
@ -424,7 +417,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aecf08806",
|
||||
"title": "Use a CSS Class to Style an Element",
|
||||
"difficulty": 1.11,
|
||||
"description": [
|
||||
"Create a CSS class called <code>red-text</code> and apply it to your <code>h2</code> element.",
|
||||
"Classes are reusable styles that can be added to HTML elements.",
|
||||
@ -491,7 +483,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aefe08806",
|
||||
"title": "Style Multiple Elements with a CSS Class",
|
||||
"difficulty": 1.12,
|
||||
"description": [
|
||||
"Apply the <code>red-text</code> class to your <code>h2</code> and <code>p</code> elements.",
|
||||
"Remember that you can attach classes to HTML elements by using <code>class=\"your-class-here\"</code> within the relevant element's opening tag.",
|
||||
@ -540,7 +531,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08806",
|
||||
"title": "Change the Font Size of an Element",
|
||||
"difficulty": 1.13,
|
||||
"description": [
|
||||
"Create a second <code>p</code> element with the following <code>kitty ipsum text</code>: <code>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</code>",
|
||||
"Then, inside your <code><style></code> element, set the <code>font-size</code> of all <code>p</code> elements to 16 pixels.",
|
||||
@ -593,7 +583,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aede08807",
|
||||
"title": "Set the Font Family of an Element",
|
||||
"difficulty": 1.14,
|
||||
"description": [
|
||||
"Make all of your <code>p</code> elements use the <code>Monospace</code> font.",
|
||||
"You can set an element's font by using the <code>font-family</code> property.",
|
||||
@ -640,7 +629,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08807",
|
||||
"title": "Import a Google Font",
|
||||
"difficulty": 1.15,
|
||||
"description": [
|
||||
"Apply the <code>font-family</code> of <code>Lobster</code> to your <code>h2</code> element.",
|
||||
"First, you'll need to make a <code>call</code> to Google to grab the <code>Lobster</code> font and load it into your HTML.",
|
||||
@ -694,7 +682,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08808",
|
||||
"title": "Specify How Fonts Should Degrade",
|
||||
"difficulty": 1.16,
|
||||
"description": [
|
||||
"There are several default fonts that are available in all browsers. These include <code>Monospace</code>, <code>Serif</code> and <code>Sans-Serif</code>. Leave <code>Lobster</code> as the font-family for your <code>h2</code> elements. Make them \"degrade\" to <code>Monospace</code> when <code>Lobster</code> isn't available.",
|
||||
"For example, if you wanted an element to use the <code>Helvetica</code> font, but also degrade to the <code>Sans-Serif</code> font when <code>Helvetica</code> wasn't available, you could use this CSS style: <code>p { font-family: Helvetica, Sans-Serif; }</code>.",
|
||||
@ -752,7 +739,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08812",
|
||||
"title": "Add Images to your Website",
|
||||
"difficulty": 1.17,
|
||||
"description": [
|
||||
"You can add images to your website by using the <code>img</code> element, and point to a specific image's URL using the <code>src</code> attribute.",
|
||||
"An example of this would be <code><img src=\"http://www.your-image-source.com/your-image.jpg\"></code>. Note that in most cases, <code>img</code> elements are self-closing.",
|
||||
@ -807,7 +793,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9acdf08812",
|
||||
"title": "Size your Images",
|
||||
"difficulty": 1.18,
|
||||
"description": [
|
||||
"CSS has a property called <code>width</code> that controls an element's width. Just like with fonts, we'll use <code>px</code> (pixels) to specify the image's width.",
|
||||
"For example, if we wanted to create a CSS class called <code>larger-image</code> that gave HTML elements a width of 500 pixels, we'd use: <code><style> .larger-image { width: 500px; } </style></code>.",
|
||||
@ -863,7 +848,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9bedf08813",
|
||||
"title": "Add Borders Around your Elements",
|
||||
"difficulty": 1.19,
|
||||
"description": [
|
||||
"CSS borders have properties like <code>style</code>, <code>color</code> and <code>width</code>.",
|
||||
"For example, if we wanted to create a red, 5 pixel border around an HTML element, we could use this class: <code><style> .thin-red-border { border-color: red; border-width: 5px; border-style: solid; } </style></code>.",
|
||||
@ -927,7 +911,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08814",
|
||||
"title": "Add Rounded Corners with a Border Radius",
|
||||
"difficulty": 1.20,
|
||||
"description": [
|
||||
"Your cat photo currently has sharp corners. We can round out those corners with a CSS property called <code>border-radius</code>.",
|
||||
"You can specify a <code>border-radius</code> with pixels. This will affect how rounded the corners are. Add this property to your <code>thick-green-border</code> class and set it to <code>10px</code>.",
|
||||
@ -993,7 +976,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08815",
|
||||
"title": "Make Circular Images with a Border Radius",
|
||||
"difficulty": 1.21,
|
||||
"description": [
|
||||
"In addition to pixels, you can also specify a <code>border-radius</code> using a percentage.",
|
||||
"Give your cat photo a <code>border-radius</code> of <code>50%</code>."
|
||||
@ -1058,7 +1040,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08816",
|
||||
"title": "Link to External Pages with Anchor Elements",
|
||||
"difficulty": 1.22,
|
||||
"description": [
|
||||
"<code>a</code> elements, also known as <code>anchor</code> elements, are used to link to content outside of the current page.",
|
||||
"Here's a diagram of an <code>a</code> element. In this case, the <code>a</code> element is used in the middle of a paragraph element, which means the link will appear in the middle of a sentence.",
|
||||
@ -1129,7 +1110,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aede08817",
|
||||
"title": "Nest an Anchor Element within a Paragraph",
|
||||
"difficulty": 1.23,
|
||||
"description": [
|
||||
"Again, here's a diagram of an <code>a</code> element for your reference:",
|
||||
"<a href=\"http://i.imgur.com/hviuZwe.png\" data-lightbox=\"img-enlarge\"><img class=\"img-responsive\" title=\"Click to enlarge\" alt=\"a diagram of how anchor tags are composed with the same text as on the following line\" src=\"http://i.imgur.com/hviuZwe.png\"></a>",
|
||||
@ -1142,7 +1122,8 @@
|
||||
"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($(\"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/gi), 'Your <code>p</code> element should have the text \"View more\".')",
|
||||
"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(!$(\"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(/<\\/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.')"
|
||||
],
|
||||
@ -1205,7 +1186,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08817",
|
||||
"title": "Make Dead Links using the Hash Symbol",
|
||||
"difficulty": 1.24,
|
||||
"description": [
|
||||
"Sometimes you want to add <code>a</code> elements to your website before you know where they will link.",
|
||||
"This is also handy when you're changing the behavior of a link using <code>jQuery</code>, which we'll learn about later.",
|
||||
@ -1274,7 +1254,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08820",
|
||||
"title": "Turn an Image into a Link",
|
||||
"difficulty": 1.25,
|
||||
"description": [
|
||||
"You can make elements into links by nesting them within an <code>a</code> element.",
|
||||
"Nest your image within an <code>a</code> element. Here's an example: <code><a href=\"#\"><img src=\"http://bit.ly/fcc-running-cats\"/></a></code>.",
|
||||
@ -1347,7 +1326,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08818",
|
||||
"title": "Add Alt Text to an Image for Accessibility",
|
||||
"difficulty": 1.26,
|
||||
"description": [
|
||||
"<code>alt</code> attributes, also known as <code>alt text</code>, are what browsers will display if they fail to load the image. <code>alt</code> attributes are also important for blind or visually impaired users to understand what an image portrays. And search engines also look at <code>alt</code> attributes.",
|
||||
"In short, every image should have an <code>alt</code> attribute!",
|
||||
@ -1418,7 +1396,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08827",
|
||||
"title": "Create a Bulleted Unordered List",
|
||||
"difficulty": 1.27,
|
||||
"description": [
|
||||
"HTML has a special element for creating <code>unordered lists</code>, or bullet point-style lists.",
|
||||
"Unordered lists start with a <code><ul></code> element. Then they contain some number of <code><li></code> elements.",
|
||||
@ -1496,7 +1473,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08828",
|
||||
"title": "Create an Ordered List",
|
||||
"difficulty": 1.28,
|
||||
"description": [
|
||||
"HTML has a special element for creating <code>ordered lists</code>, or numbered-style lists.",
|
||||
"Ordered lists start with a <code><ol></code> element. Then they contain some number of <code><li></code> elements.",
|
||||
@ -1582,7 +1558,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08829",
|
||||
"title": "Create a Text Field",
|
||||
"difficulty": 1.29,
|
||||
"description": [
|
||||
"Now let's create a web <code>form</code>.",
|
||||
"Text inputs are a convenient way to get input from your user.",
|
||||
@ -1661,7 +1636,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08830",
|
||||
"title": "Add Placeholder Text to a Text Field",
|
||||
"difficulty": 1.30,
|
||||
"description": [
|
||||
"Your placeholder text is what appears in your text <code>input</code> before your user has inputed anything.",
|
||||
"You can create placeholder text like so: <code><input type=\"text\" placeholder=\"this is placeholder text\"></code>.",
|
||||
@ -1741,7 +1715,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aede08830",
|
||||
"title": "Create a Form Element",
|
||||
"difficulty": 1.31,
|
||||
"description": [
|
||||
"You can build web forms that actually submit data to a server using nothing more than pure HTML. You can do this by specifying an action on your <code>form</code> element.",
|
||||
"For example: <code><form action=\"/url-where-you-want-to-submit-form-data\"></form></code>.",
|
||||
@ -1822,7 +1795,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedd08830",
|
||||
"title": "Add a Submit Button to a Form",
|
||||
"difficulty": 1.32,
|
||||
"description": [
|
||||
"Let's add a <code>submit</code> button to your form. Clicking this button will send the data from your form to the URL you specified with your form's <code>action</code> attribute.",
|
||||
"Here's an example submit button: <code><button type=\"submit\">this button submits the form</button></code>.",
|
||||
@ -1906,7 +1878,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedc08830",
|
||||
"title": "Use HTML5 to Require a Field",
|
||||
"difficulty": 1.33,
|
||||
"description": [
|
||||
"You can require specific form fields so that your user will not be able to submit your form until he or she has filled them out.",
|
||||
"For example, if you wanted to make a text input field required, you can just add the word <code>required</code> within your <code>input</code> element, you would use: <code><input type=\"text\" required></code>.",
|
||||
@ -1988,7 +1959,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08834",
|
||||
"title": "Create a Set of Radio Buttons",
|
||||
"difficulty": 1.34,
|
||||
"description": [
|
||||
"You can use <code>radio buttons</code> for questions where you want the user to only give you one answer.",
|
||||
"Radio buttons are a type of <code>input</code>.",
|
||||
@ -2081,7 +2051,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08835",
|
||||
"title": "Create a Set of Checkboxes",
|
||||
"difficulty": 1.35,
|
||||
"description": [
|
||||
"Forms commonly use <code>checkboxes</code> for questions that may have more than one answer.",
|
||||
"Checkboxes are a type of <code>input</code>.",
|
||||
@ -2171,7 +2140,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedd08835",
|
||||
"title": "Check Radio Buttons and Checkboxes by Default",
|
||||
"difficulty": 1.37,
|
||||
"description": [
|
||||
"You can set a checkbox or radio button to be checked by default using the <code>checked</code> attribute.",
|
||||
"To do this, just add the word \"checked\" to the inside of an input element. For example, <code><input type=\"radio\" name=\"test-name\" checked></code>.",
|
||||
@ -2259,7 +2227,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aede08835",
|
||||
"title": "Nest Many Elements within a Single Div Element",
|
||||
"difficulty": 1.38,
|
||||
"description": [
|
||||
"The <code>div</code> element, also known as a division element, is a general purpose container for other elements.",
|
||||
"The <code>div</code> element is probably the most commonly used HTML element of all. It's useful for passing the CSS of its own class declarations down to all the elements that it contains.",
|
||||
@ -2354,7 +2321,6 @@
|
||||
{
|
||||
"id": "bad87fed1348bd9aede07836",
|
||||
"title": "Give a Background Color to a Div Element",
|
||||
"difficulty": 1.39,
|
||||
"description": [
|
||||
"You can set an element's background color with the <code>background-color</code> property.",
|
||||
"For example, if you wanted an element's background color to be <code>green</code>, you'd use <code>.green-background { background-color: green; }</code> within your <code>style</code> element.",
|
||||
@ -2441,7 +2407,6 @@
|
||||
{
|
||||
"id": "bad87eee1348bd9aede07836",
|
||||
"title": "Set the ID of an Element",
|
||||
"difficulty": 1.391,
|
||||
"description": [
|
||||
"In addition to classes, each HTML element can also have an <code>id</code> attribute.",
|
||||
"There are several benefits to using <code>id</code> attributes, and you'll learn more about them once you start using jQuery.",
|
||||
@ -2532,7 +2497,6 @@
|
||||
{
|
||||
"id": "bad87dee1348bd9aede07836",
|
||||
"title": "Use an ID Attribute to Style an Element",
|
||||
"difficulty": 1.392,
|
||||
"description": [
|
||||
"One cool thing about <code>id</code> attributes is that, like classes, you can style them using CSS.",
|
||||
"Here's an example of how you can take your element with the <code>id</code> attribute of <code>cat-photo-element</code> and give it the background color of green. In your <code>style</code> element: <code>#cat-photo-element { background-color: green; }</code>",
|
||||
@ -2625,7 +2589,6 @@
|
||||
{
|
||||
"id": "bad88fee1348bd9aedf08825",
|
||||
"title": "Adjusting the Padding of an Element",
|
||||
"difficulty": 1.40,
|
||||
"description": [
|
||||
"You may have already noticed this, but all HTML elements are essentially little rectangles.",
|
||||
"Three important properties control the space that surrounds each HTML element: <code>padding</code>, <code>margin</code>, and <code>border</code>.",
|
||||
@ -2696,7 +2659,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08822",
|
||||
"title": "Adjust the Margin of an Element",
|
||||
"difficulty": 1.41,
|
||||
"description": [
|
||||
"An element's <code>margin</code> controls the amount of space between an element's <code>border</code> and surrounding elements.",
|
||||
"Here, we can see that the green box and the red box are nested within the yellow box. Note that the red box has more <code>margin</code> than the green box, making it appear smaller.",
|
||||
@ -2767,7 +2729,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08823",
|
||||
"title": "Add a Negative Margin to an Element",
|
||||
"difficulty": 1.42,
|
||||
"description": [
|
||||
"An element's <code>margin</code> controls the amount of space between an element's <code>border</code> and surrounding elements.",
|
||||
"If you set an element's <code>margin</code> to a negative value, the element will grow larger.",
|
||||
@ -2837,7 +2798,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08824",
|
||||
"title": "Add Different Padding to Each Side of an Element",
|
||||
"difficulty": 1.43,
|
||||
"description": [
|
||||
"Sometimes you will want to customize an element so that it has different <code>padding</code> on each of its sides.",
|
||||
"CSS allows you to control the <code>padding</code> of an element on all four sides with <code>padding-top</code>, <code>padding-right</code>, <code>padding-bottom</code>, and <code>padding-left</code> properties.",
|
||||
@ -2909,7 +2869,6 @@
|
||||
{
|
||||
"id": "bad87fee1248bd9aedf08824",
|
||||
"title": "Add Different Margins to Each Side of an Element",
|
||||
"difficulty": 1.44,
|
||||
"description": [
|
||||
"Give the green box a <code>margin</code> of <code>40px</code> on its top and left side, but only <code>20px</code> on its bottom and right side.",
|
||||
"Sometimes you will want to customize an element so that it has a different <code>margin</code> on each of its sides.",
|
||||
@ -2980,7 +2939,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08826",
|
||||
"title": "Use Clockwise Notation to Specify the Padding of an Element",
|
||||
"difficulty": 1.44,
|
||||
"description": [
|
||||
"Instead of specifying an element's <code>padding-top</code>, <code>padding-right</code>, <code>padding-bottom</code>, and <code>padding-left</code> properties, you can specify them all in one line, like this: <code>padding: 10px 20px 10px 20px;</code>.",
|
||||
"These four values work like a clock: top, right, bottom, left, and will produce the exact same result as using the side-specific padding instructions.",
|
||||
@ -3049,7 +3007,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9afdf08726",
|
||||
"title": "Use Clockwise Notation to Specify the Margin of an Element",
|
||||
"difficulty": 1.45,
|
||||
"description": [
|
||||
"Let's try this again, but with <code>margin</code> this time.",
|
||||
"Instead of specifying an element's <code>margin-top</code>, <code>margin-right</code>, <code>margin-bottom</code>, and <code>margin-left</code> properties, you can specify them all in one line, like this: <code>margin: 10px 20px 10px 20px;</code>.",
|
||||
@ -3119,7 +3076,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08736",
|
||||
"title": "Style the HTML Body Element",
|
||||
"difficulty": 1.46,
|
||||
"description": [
|
||||
"Now let's start fresh and talk about CSS inheritance.",
|
||||
"Every HTML page has a <code>body</code> element.",
|
||||
@ -3152,7 +3108,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08746",
|
||||
"title": "Inherit Styles from the Body Element",
|
||||
"difficulty": 1.47,
|
||||
"description": [
|
||||
"Now we've proven that every HTML page has a <code>body</code> element, and that its <code>body</code> element can also be styled with CSS.",
|
||||
"Remember, you can style your <code>body</code> element just like any other HTML element, and all your other elements will inherit your <code>body</code> element's styles.",
|
||||
@ -3195,7 +3150,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08756",
|
||||
"title": "Prioritize One Style Over Another",
|
||||
"difficulty": 1.48,
|
||||
"description": [
|
||||
"Sometimes your HTML elements will receive multiple styles that conflict with one another.",
|
||||
"For example, your <code>h1</code> element can't be both green and pink at the same time.",
|
||||
@ -3235,7 +3189,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf04756",
|
||||
"title": "Override Styles in Subsequent CSS",
|
||||
"difficulty": 1.49,
|
||||
"description": [
|
||||
"Our \"pink-text\" class overrode our <code>body</code> element's CSS declaration!",
|
||||
"We just proved that our classes will override the <code>body</code> element's CSS. So the next logical question is, what can we do to override our <code>pink-text</code> class?",
|
||||
@ -3279,7 +3232,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd8aedf06756",
|
||||
"title": "Override Class Declarations by Styling ID Attributes",
|
||||
"difficulty": 1.52,
|
||||
"description": [
|
||||
"We just proved that browsers read CSS from top to bottom. That means that, in the event of a conflict, the browser will use whichever CSS declaration came last.",
|
||||
"But we're not done yet. There are other ways that you can override CSS. Do you remember id attributes?",
|
||||
@ -3330,7 +3282,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf06756",
|
||||
"title": "Override Class Declarations with Inline Styles",
|
||||
"difficulty": 1.52,
|
||||
"description": [
|
||||
"So we've proven that id declarations override class declarations, regardless of where they are declared in your <code>style</code> element CSS.",
|
||||
"There are other ways that you can override CSS. Do you remember inline styles?",
|
||||
@ -3381,7 +3332,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf07756",
|
||||
"title": "Override All Other Styles by using Important",
|
||||
"difficulty": 1.53,
|
||||
"description": [
|
||||
"Yay! We just proved that in-line styles will override all the CSS declarations in your <code>style</code> element.",
|
||||
"But wait. There's one last way to override CSS. This is the most powerful method of all. But before we do it, let's talk about why you would ever want to override CSS.",
|
||||
@ -3435,7 +3385,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08726",
|
||||
"title": "Use Hex Code for Specific Colors",
|
||||
"difficulty": 1.54,
|
||||
"description": [
|
||||
"Did you know there are other ways to represent colors in CSS? One of these ways is called hexadecimal code, or <code>hex code</code> for short.",
|
||||
"<code>Decimal</code> means the numbers zero through nine - the numbers that people use in everyday life. <code>Hexadecimal</code> includes these 10 numbers, plus the letters A, B, C, D, E and F. This means that Hexidecimal has a total of 16 possible values, instead of the 10 possible values that our normal base-10 number system gives us.",
|
||||
@ -3471,7 +3420,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08725",
|
||||
"title": "Use Hex Code to Color Elements White",
|
||||
"difficulty": 1.55,
|
||||
"description": [
|
||||
"<code>0</code> is the lowest number in hex code, and represents a complete absence of color.",
|
||||
"<code>F</code> is the highest number in hex code, and it represents the maximum possible brightness.",
|
||||
@ -3506,7 +3454,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08724",
|
||||
"title": "Use Hex Code to Color Elements Red",
|
||||
"difficulty": 1.56,
|
||||
"description": [
|
||||
"You may be wondering why we use 6 digits to represent a color instead of just one or two. The answer is that using 6 digits gives us a huge variety.",
|
||||
"How many colors are possible? 16 values and 6 positions means we have 16 to the 6th power, or more than 16 million possible colors.",
|
||||
@ -3543,7 +3490,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08723",
|
||||
"title": "Use Hex Code to Color Elements Green",
|
||||
"difficulty": 1.57,
|
||||
"description": [
|
||||
"Remember that <code>hex code</code> follows the red-green-blue, or <code>rgb</code> format. The first two digits of hex code represent the amount of red in the color. The third and fourth digit represent the amount of green. The fifth and sixth represent the amount of blue.",
|
||||
"So to get the absolute brightest green, you would just use <code>F</code> for the third and fourth digits (the highest possible value) and <code>0</code> for all the other digits (the lowest possible value).",
|
||||
@ -3578,7 +3524,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08722",
|
||||
"title": "Use Hex Code to Color Elements Blue",
|
||||
"difficulty": 1.58,
|
||||
"description": [
|
||||
"Hex code follows the red-green-blue, or <code>rgb</code> format. The first two digits of hex code represent the amount of red in the color. The third and fourth digit represent the amount of green. The fifth and sixth represent the amount of blue.",
|
||||
"So to get the absolute brightest blue, we use <code>F</code> for the fifth and sixth digits (the highest possible value) and <code>0</code> for all the other digits (the lowest possible value).",
|
||||
@ -3613,7 +3558,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08721",
|
||||
"title": "Use Hex Code to Mix Colors",
|
||||
"difficulty": 1.59,
|
||||
"description": [
|
||||
"From these three pure colors (red, green and blue), we can create 16 million other colors.",
|
||||
"For example, orange is pure red, mixed with some green, and no blue.",
|
||||
@ -3648,7 +3592,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aede08720",
|
||||
"title": "Use Hex Code to Color Elements Gray",
|
||||
"difficulty": 1.60,
|
||||
"description": [
|
||||
"From these three pure colors (red, green and blue), we can create 16 million other colors.",
|
||||
"We can also create different shades of gray by evenly mixing all three colors.",
|
||||
@ -3683,7 +3626,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08720",
|
||||
"title": "Use Hex Code for Specific Shades of Gray",
|
||||
"difficulty": 1.61,
|
||||
"description": [
|
||||
"We can also create other shades of gray by evenly mixing all three colors. We can go very close to true black.",
|
||||
"Make the <code>body</code> element's background color a dark gray by giving it the hex code value of <code>#111111</code>."
|
||||
@ -3717,7 +3659,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedf08719",
|
||||
"title": "Use Abbreviated Hex Code",
|
||||
"difficulty": 1.62,
|
||||
"description": [
|
||||
"Many people feel overwhelmed by the possibilities of more than 16 million colors. And it's difficult to remember hex code. Fortunately, you can shorten it.",
|
||||
"For example, red, which is <code>#FF0000</code> in hex code, can be shortened to <code>#F00</code>. That is, one digit for red, one digit for green, one digit for blue.",
|
||||
@ -3753,7 +3694,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aede08718",
|
||||
"title": "Use RGB values to Color Elements",
|
||||
"difficulty": 1.63,
|
||||
"description": [
|
||||
"Another way you can represent colors in CSS is by using <code>rgb</code> values.",
|
||||
"RGB values look like this: <code>rgb(0, 0, 0)</code> for black and <code>rgb(255, 255, 255)</code> for white.",
|
||||
@ -3790,7 +3730,6 @@
|
||||
{
|
||||
"id": "bad88fee1348bd9aedf08726",
|
||||
"title": "Use RGB to Color Elements White",
|
||||
"difficulty": 1.64,
|
||||
"description": [
|
||||
"RGB values look like this: <code>rgb(0, 0, 0)</code> for black and <code>rgb(255, 255, 255)</code> for white.",
|
||||
"Instead of using six hexadecimal digits like you do with hex code, with <code>rgb</code> you specify the brightness of each color with a number between 0 and 255.",
|
||||
@ -3825,7 +3764,6 @@
|
||||
{
|
||||
"id": "bad89fee1348bd9aedf08724",
|
||||
"title": "Use RGB to Color Elements Red",
|
||||
"difficulty": 1.65,
|
||||
"description": [
|
||||
"Just like with hex code, you can represent different colors in RGB by using combinations of different values.",
|
||||
"These values follow the pattern of RGB: the first number represents red, the second number represents green, and the third number represents blue.",
|
||||
@ -3860,7 +3798,6 @@
|
||||
{
|
||||
"id": "bad80fee1348bd9aedf08723",
|
||||
"title": "Use RGB to Color Elements Green",
|
||||
"difficulty": 1.66,
|
||||
"description": [
|
||||
"Now change the <code>body</code> element's background color to the <code>rgb</code> value green: <code>rgb(0, 255, 0)</code>"
|
||||
],
|
||||
@ -3893,7 +3830,6 @@
|
||||
{
|
||||
"id": "bad81fee1348bd9aedf08722",
|
||||
"title": "Use RGB to Color Elements Blue",
|
||||
"difficulty": 1.67,
|
||||
"description": [
|
||||
"Change the <code>body</code> element's background color to the RGB value blue: <code>rgb(0, 0, 255)</code>"
|
||||
],
|
||||
@ -3926,7 +3862,6 @@
|
||||
{
|
||||
"id": "bad82fee1348bd9aedf08721",
|
||||
"title": "Use RGB to Mix Colors",
|
||||
"difficulty": 1.68,
|
||||
"description": [
|
||||
"Just like with hex code, you can mix colors in RGB by using combinations of different values.",
|
||||
"Change the <code>body</code> element's background color to the RGB value orange: <code>rgb(255, 165, 0)</code>"
|
||||
@ -3960,7 +3895,6 @@
|
||||
{
|
||||
"id": "bad83fee1348bd9aede08720",
|
||||
"title": "Use RGB to Color Elements Gray",
|
||||
"difficulty": 1.69,
|
||||
"description": [
|
||||
"With RGB values, we can make an element gray by using combinations of the same value for all three colors.",
|
||||
"Change the <code>body</code> element's background color to the RGB value for gray: <code>rgb(128, 128, 128)</code>"
|
||||
|
@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "Intermediate Algorithm Scripting",
|
||||
"order": 0.009,
|
||||
"order": 9,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "a3566b1109230028080c9345",
|
||||
"title": "Sum All Numbers in a Range",
|
||||
"difficulty": "2.00",
|
||||
"description": [
|
||||
"We'll pass you an array of two numbers. Return the sum of those two numbers and all numbers between them.",
|
||||
"The lowest number will not always come first.",
|
||||
@ -19,11 +18,11 @@
|
||||
"sumAll([1, 4]);"
|
||||
],
|
||||
"tests": [
|
||||
"expect(sumAll([1, 4])).to.be.a('Number');",
|
||||
"expect(sumAll([1, 4])).to.equal(10);",
|
||||
"expect(sumAll([4, 1])).to.equal(10);",
|
||||
"expect(sumAll([5, 10])).to.equal(45);",
|
||||
"expect(sumAll([10, 5])).to.equal(45);"
|
||||
"assert(typeof(sumAll([1, 4])) === \"number\", 'message: <code>sumAll()</code> should return a number.');",
|
||||
"assert.deepEqual(sumAll([1, 4]), 10, 'message: <code>sumAll([1, 4])</code> should return 10.');",
|
||||
"assert.deepEqual(sumAll([4, 1]), 10, 'message: <code>sumAll([4, 1])</code> should return 10.');",
|
||||
"assert.deepEqual(sumAll([5, 10]), 45, 'message: <code>sumAll([5, 10])</code> should return 45.');",
|
||||
"assert.deepEqual(sumAll([10, 5]), 45, 'message: <code>sumAll([10, 5])</code> should return 45.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Math.max()",
|
||||
@ -46,7 +45,6 @@
|
||||
{
|
||||
"id": "a5de63ebea8dbee56860f4f2",
|
||||
"title": "Diff Two Arrays",
|
||||
"difficulty": "2.01",
|
||||
"description": [
|
||||
"Compare two arrays and return a new array with any items not found in both of the original arrays.",
|
||||
"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."
|
||||
@ -61,13 +59,13 @@
|
||||
"diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);"
|
||||
],
|
||||
"tests": [
|
||||
"expect(diff([1, 2, 3, 5], [1, 2, 3, 4, 5])).to.be.a('array');",
|
||||
"assert.deepEqual(diff(['diorite', 'andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']), ['pink wool'], 'arrays with only one difference');",
|
||||
"assert.includeMembers(diff(['andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']), ['diorite', 'pink wool'], 'arrays with more than one difference');",
|
||||
"assert.deepEqual(diff(['andesite', 'grass', 'dirt', 'dead shrub'], ['andesite', 'grass', 'dirt', 'dead shrub']), [], 'arrays with no difference');",
|
||||
"assert.deepEqual(diff([1, 2, 3, 5], [1, 2, 3, 4, 5]), [4], 'arrays with numbers');",
|
||||
"assert.includeMembers(diff([1, 'calf', 3, 'piglet'], [1, 'calf', 3, 4]), ['piglet', 4], 'arrays with numbers and strings');",
|
||||
"assert.deepEqual(diff([], ['snuffleupagus', 'cookie monster', 'elmo']), ['snuffleupagus', 'cookie monster', 'elmo'], 'empty array');"
|
||||
"assert(typeof(diff([1, 2, 3, 5], [1, 2, 3, 4, 5])) === \"object\", 'message: <code>diff()</code> should return an array.');",
|
||||
"assert.deepEqual(diff([\"diorite\", \"andesite\", \"grass\", \"dirt\", \"pink wool\", \"dead shrub\"], [\"diorite\", \"andesite\", \"grass\", \"dirt\", \"dead shrub\"]), [\"pink wool\"], 'message: <code>[\"diorite\", \"andesite\", \"grass\", \"dirt\", \"pink wool\", \"dead shrub\"], [\"diorite\", \"andesite\", \"grass\", \"dirt\", \"dead shrub\"]</code> should return <code>[\"pink wool\"]</code>.');",
|
||||
"assert.includeMembers(diff([\"andesite\", \"grass\", \"dirt\", \"pink wool\", \"dead shrub\"], [\"diorite\", \"andesite\", \"grass\", \"dirt\", \"dead shrub\"]), [\"diorite\", \"pink wool\"], 'message: <code>[\"andesite\", \"grass\", \"dirt\", \"pink wool\", \"dead shrub\"], [\"diorite\", \"andesite\", \"grass\", \"dirt\", \"dead shrub\"]</code> should return <code>[\"diorite\", \"pink wool\"]</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.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>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Comparison Operators",
|
||||
@ -93,13 +91,12 @@
|
||||
"id": "a7f4d8f2483413a6ce226cac",
|
||||
"title": "Roman Numeral Converter",
|
||||
"tests": [
|
||||
"expect(convert(12)).to.equal(\"XII\");",
|
||||
"expect(convert(5)).to.equal(\"V\");",
|
||||
"expect(convert(9)).to.equal(\"IX\");",
|
||||
"expect(convert(29)).to.equal(\"XXIX\");",
|
||||
"expect(convert(16)).to.equal(\"XVI\");"
|
||||
"assert.deepEqual(convert(12), \"XII\", 'message: <code>convert(12)</code> should return \"XII\".');",
|
||||
"assert.deepEqual(convert(5), \"V\", 'message: <code>convert(5)</code> should return \"V\".');",
|
||||
"assert.deepEqual(convert(9), \"IX\", 'message: <code>convert(9)</code> should return \"IX\".');",
|
||||
"assert.deepEqual(convert(29), \"XXIX\", 'message: <code>convert(29)</code> should return \"XXIX\".');",
|
||||
"assert.deepEqual(convert(16), \"XVI\", 'message: <code>convert(16)</code> should return \"XVI\".');"
|
||||
],
|
||||
"difficulty": "2.02",
|
||||
"description": [
|
||||
"Convert the given number into a roman numeral.",
|
||||
"All <a href=\"http://www.mathsisfun.com/roman-numerals.html\" target=\"_blank\">roman numerals</a> answers should be provided in upper-case.",
|
||||
@ -134,10 +131,9 @@
|
||||
{
|
||||
"id": "a8e512fbe388ac2f9198f0fa",
|
||||
"title": "Where art thou",
|
||||
"difficulty": "2.03",
|
||||
"description": [
|
||||
"Make a function that looks through an array of objects (first argument) and returns an array of all objects that have matching property and value pairs (second argument). Each property and value pair of the source object has to be present in the object from the collection if it is to be included in the returned array.",
|
||||
"For example, if the first argument is <code>[{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }]</code>, and the second argument is <code>{ last: 'Capulet' }</code>, then you must return the third object from the array (the first argument), because it contains the property and it's value, that was passed on as the second argument.",
|
||||
"For example, if the first argument is <code>[{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }]</code>, and the second argument is <code>{ last: \"Capulet\" }</code>, then you must return the third object from the array (the first argument), because it contains the property and it's value, that was passed on as the second argument.",
|
||||
"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": [
|
||||
@ -147,13 +143,12 @@
|
||||
" return arr;",
|
||||
"}",
|
||||
"",
|
||||
"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": [
|
||||
"assert.deepEqual(where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }), [{ first: 'Tybalt', last: 'Capulet' }], 'should return an array of objects');",
|
||||
"assert.deepEqual(where([{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], { 'a': 1 }), [{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], 'should return with multiples');",
|
||||
"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 }], 'should return two objects in array');",
|
||||
"assert.deepEqual(where([{ 'a': 5 }, { 'b': 10 }, { 'a': 5, 'b': 10 }], { 'a': 5, 'b': 10 }), [{ 'a': 5, 'b': 10 }], 'should return a single object in array');"
|
||||
"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([{ \"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>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Global Object",
|
||||
@ -177,19 +172,18 @@
|
||||
"id": "a0b5010f579e69b815e7c5d6",
|
||||
"title": "Search and Replace",
|
||||
"tests": [
|
||||
"expect(myReplace(\"Let us go to the store\", \"store\", \"mall\")).to.equal(\"Let us go to the mall\");",
|
||||
"expect(myReplace(\"He is Sleeping on the couch\", \"Sleeping\", \"sitting\")).to.equal(\"He is Sitting on the couch\");",
|
||||
"expect(myReplace(\"This has a spellngi error\", \"spellngi\", \"spelling\")).to.equal(\"This has a spelling error\");",
|
||||
"expect(myReplace(\"His name is Tom\", \"Tom\", \"john\")).to.equal(\"His name is John\");",
|
||||
"expect(myReplace(\"Let us get back to more Coding\", \"Coding\", \"bonfires\")).to.equal(\"Let us get back to more Bonfires\");"
|
||||
"assert.deepEqual(myReplace(\"Let us go to the store\", \"store\", \"mall\"), \"Let us go to the mall\", 'message: <code>myReplace(\"Let us go to the store\", \"store\", \"mall\")</code> should return \"Let us go to the mall\".');",
|
||||
"assert.deepEqual(myReplace(\"He is Sleeping on the couch\", \"Sleeping\", \"sitting\"), \"He is Sitting on the couch\", 'message: <code>myReplace(\"He is Sleeping on the couch\", \"Sleeping\", \"sitting\")</code> should return \"He is Sitting on the couch\".');",
|
||||
"assert.deepEqual(myReplace(\"This has a spellngi error\", \"spellngi\", \"spelling\"), \"This has a spelling error\", 'message: <code>myReplace(\"This has a spellngi error\", \"spellingi\", \"spelling\")</code> should return \"This has a spelling error\".');",
|
||||
"assert.deepEqual(myReplace(\"His name is Tom\", \"Tom\", \"john\"), \"His name is John\", 'message: <code>myReplace(\"His name is Tom\", \"Tom\", \"john\")</code> should return \"His name is John\".');",
|
||||
"assert.deepEqual(myReplace(\"Let us get back to more Coding\", \"Coding\", \"bonfires\"), \"Let us get back to more Bonfires\", 'message: <code>myReplace(\"Let us get back to more Coding\", \"Coding\", \"bonfires\")</code> should return \"Let us get back to more Bonfires\".');"
|
||||
],
|
||||
"difficulty": "2.035",
|
||||
"description": [
|
||||
"Perform a search and replace on the sentence using the arguments provided and return the new sentence.",
|
||||
"First argument is the sentence to perform the search and replace on.",
|
||||
"Second argument is the word that you will be replacing (before).",
|
||||
"Third argument is what you will be replacing the second argument with (after).",
|
||||
"NOTE: Preserve the case of the original word when you are replacing it. For example if you mean to replace the word 'Book' with the word 'dog', it should be replaced as 'Dog'",
|
||||
"NOTE: Preserve the case of the original word when you are replacing it. For example if you mean to replace the word \"Book\" with the word \"dog\", it should be replaced as \"Dog\"",
|
||||
"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": [
|
||||
@ -221,13 +215,12 @@
|
||||
"id": "aa7697ea2477d1316795783b",
|
||||
"title": "Pig Latin",
|
||||
"tests": [
|
||||
"expect(translate(\"california\")).to.equal(\"aliforniacay\");",
|
||||
"expect(translate(\"paragraphs\")).to.equal(\"aragraphspay\");",
|
||||
"expect(translate(\"glove\")).to.equal(\"oveglay\");",
|
||||
"expect(translate(\"algorithm\")).to.equal(\"algorithmway\");",
|
||||
"expect(translate(\"eight\")).to.equal(\"eightway\");"
|
||||
"assert.deepEqual(translate(\"california\"), \"aliforniacay\", 'message: <code>translate(\"california\")</code> should return \"aliforniacay\".');",
|
||||
"assert.deepEqual(translate(\"paragraphs\"), \"aragraphspay\", 'message: <code>translate(\"paragraphs\")</code> should return \"aragraphspay\".');",
|
||||
"assert.deepEqual(translate(\"glove\"), \"oveglay\", 'message: <code>translate(\"glove\")</code> should return \"oveglay\".');",
|
||||
"assert.deepEqual(translate(\"algorithm\"), \"algorithmway\", 'message: <code>translate(\"algorithm\")</code> should return \"algorithmway\".');",
|
||||
"assert.deepEqual(translate(\"eight\"), \"eightway\", 'message: <code>translate(\"eight\")</code> should return \"eightway\".');"
|
||||
],
|
||||
"difficulty": "2.04",
|
||||
"description": [
|
||||
"Translate the provided string to pig latin.",
|
||||
"<a href=\"http://en.wikipedia.org/wiki/Pig_Latin\" target=\"_blank\">Pig Latin</a> takes the first consonant (or consonant cluster) of an English word, moves it to the end of the word and suffixes an \"ay\".",
|
||||
@ -265,16 +258,15 @@
|
||||
"id": "afd15382cdfb22c9efe8b7de",
|
||||
"title": "DNA Pairing",
|
||||
"tests": [
|
||||
"assert.deepEqual(pair(\"ATCGA\"),[['A','T'],['T','A'],['C','G'],['G','C'],['A','T']], 'should return the dna pair');",
|
||||
"assert.deepEqual(pair(\"TTGAG\"),[['T','A'],['T','A'],['G','C'],['A','T'],['G','C']], 'should return the dna pair');",
|
||||
"assert.deepEqual(pair(\"CTCTA\"),[['C','G'],['T','A'],['C','G'],['T','A'],['A','T']], 'should return the dna pair');"
|
||||
"assert.deepEqual(pair(\"ATCGA\"),[[\"A\",\"T\"],[\"T\",\"A\"],[\"C\",\"G\"],[\"G\",\"C\"],[\"A\",\"T\"]], 'message: <code>pair(\"ATCGA\")</code> should return <code>[[\"A\",\"T\"],[\"T\",\"A\"],[\"C\",\"G\"],[\"G\",\"C\"],[\"A\",\"T\"]]</code>.');",
|
||||
"assert.deepEqual(pair(\"TTGAG\"),[[\"T\",\"A\"],[\"T\",\"A\"],[\"G\",\"C\"],[\"A\",\"T\"],[\"G\",\"C\"]], 'message: <code>pair(\"TTGAG\")</code> should return <code>[[\"T\",\"A\"],[\"T\",\"A\"],[\"G\",\"C\"],[\"A\",\"T\"],[\"G\",\"C\"]]</code>.');",
|
||||
"assert.deepEqual(pair(\"CTCTA\"),[[\"C\",\"G\"],[\"T\",\"A\"],[\"C\",\"G\"],[\"T\",\"A\"],[\"A\",\"T\"]], 'message: <code>pair(\"CTCTA\")</code> should return <code>[[\"C\",\"G\"],[\"T\",\"A\"],[\"C\",\"G\"],[\"T\",\"A\"],[\"A\",\"T\"]]</code>.');"
|
||||
],
|
||||
"difficulty": "2.05",
|
||||
"description": [
|
||||
"The DNA strand is missing the pairing element. Take each character, get its pair, and return the results as a 2d array.",
|
||||
"<a href=\"http://en.wikipedia.org/wiki/Base_pair\" target=\"_blank\">Base pairs</a> are a pair of AT and CG. Match the missing element to the provided character.",
|
||||
"Return the provided character as the first element in each array.",
|
||||
"For example, for the input GCG, return [['G', 'C'], ['C','G'],['G', 'C']]",
|
||||
"For example, for the input GCG, return [[\"G\", \"C\"], [\"C\",\"G\"],[\"G\", \"C\"]]",
|
||||
"The character and its pair are paired up in an array, and all the arrays are grouped into one encapsulating array.",
|
||||
"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."
|
||||
],
|
||||
@ -305,7 +297,6 @@
|
||||
{
|
||||
"id": "af7588ade1100bde429baf20",
|
||||
"title": "Missing letters",
|
||||
"difficulty": "2.05",
|
||||
"description": [
|
||||
"Find the missing letter in the passed letter range and return it.",
|
||||
"If all letters are present in the range, return undefined.",
|
||||
@ -316,13 +307,13 @@
|
||||
" return str;",
|
||||
"}",
|
||||
"",
|
||||
"fearNotLetter('abce');"
|
||||
"fearNotLetter(\"abce\");"
|
||||
],
|
||||
"tests": [
|
||||
"expect(fearNotLetter('abce')).to.equal('d');",
|
||||
"expect(fearNotLetter('bcd')).to.be.undefined;",
|
||||
"expect(fearNotLetter('abcdefghjklmno')).to.equal('i');",
|
||||
"expect(fearNotLetter('yz')).to.be.undefined;"
|
||||
"assert.deepEqual(fearNotLetter(\"abce\"), \"d\", 'message: <code>fearNotLetter(\"abce\")</code> should return \"d\".');",
|
||||
"assert.deepEqual(fearNotLetter(\"abcdefghjklmno\"), \"i\", 'message: <code>fearNotLetter(\"abcdefghjklmno\")</code> should return \"i\".');",
|
||||
"assert.isUndefined(fearNotLetter(\"bcd\"), 'message: <code>fearNotLetter(\"bcd\")</code> should return undefined.');",
|
||||
"assert.isUndefined(fearNotLetter(\"yz\"), 'message: <code>fearNotLetter(\"yz\")</code> should return undefined.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"String.charCodeAt()",
|
||||
@ -344,7 +335,6 @@
|
||||
{
|
||||
"id": "a77dbc43c33f39daa4429b4f",
|
||||
"title": "Boo who",
|
||||
"difficulty": "2.06",
|
||||
"description": [
|
||||
"Check if a value is classified as a boolean primitive. Return true or false.",
|
||||
"Boolean primitives are true and false.",
|
||||
@ -359,14 +349,14 @@
|
||||
"boo(null);"
|
||||
],
|
||||
"tests": [
|
||||
"assert.strictEqual(boo(true), true);",
|
||||
"assert.strictEqual(boo(false), true);",
|
||||
"assert.strictEqual(boo([1, 2, 3]), false);",
|
||||
"assert.strictEqual(boo([].slice), false);",
|
||||
"assert.strictEqual(boo({ 'a': 1 }), false);",
|
||||
"assert.strictEqual(boo(1), false);",
|
||||
"assert.strictEqual(boo(NaN), false);",
|
||||
"assert.strictEqual(boo('a'), false);"
|
||||
"assert.strictEqual(boo(true), true, 'message: <code>boo(true)</code> should return true.');",
|
||||
"assert.strictEqual(boo(false), true, 'message: <code>boo(false)</code> should return true.');",
|
||||
"assert.strictEqual(boo([1, 2, 3]), false, 'message: <code>boo([1, 2, 3])</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(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(\"a\"), false, 'message: <code>boo(\"a\")</code> should return false.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Boolean Objects"
|
||||
@ -387,7 +377,6 @@
|
||||
{
|
||||
"id": "a105e963526e7de52b219be9",
|
||||
"title": "Sorted Union",
|
||||
"difficulty": "2.07",
|
||||
"description": [
|
||||
"Write a function that takes two or more arrays and returns a new array of unique values in the order of the original provided arrays.",
|
||||
"In other words, all values present from all arrays should be included in their original order, but with no duplicates in the final array.",
|
||||
@ -403,10 +392,10 @@
|
||||
"unite([1, 3, 2], [5, 2, 1, 4], [2, 1]);"
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(unite([1, 3, 2], [5, 2, 1, 4], [2, 1]), [1, 3, 2, 5, 4], 'should return the union of the given arrays');",
|
||||
"assert.deepEqual(unite([1, 3, 2], [1, [5]], [2, [4]]), [1, 3, 2, [5], [4]], 'should not flatten nested arrays');",
|
||||
"assert.deepEqual(unite([1, 2, 3], [5, 2, 1]), [1, 2, 3, 5], 'should correctly handle exactly two arguments');",
|
||||
"assert.deepEqual(unite([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]), [ 1, 2, 3, 5, 4, 6, 7, 8 ], 'should correctly handle higher numbers of arguments');"
|
||||
"assert.deepEqual(unite([1, 3, 2], [5, 2, 1, 4], [2, 1]), [1, 3, 2, 5, 4], 'message: <code>unite([1, 3, 2], [5, 2, 1, 4], [2, 1])</code> should return <code>[1, 3, 2, 5, 4]</code>.');",
|
||||
"assert.deepEqual(unite([1, 3, 2], [1, [5]], [2, [4]]), [1, 3, 2, [5], [4]], 'message: <code>unite([1, 3, 2], [1, [5]], [2, [4]])</code> should return <code>[1, 3, 2, [5], [4]]</code>.');",
|
||||
"assert.deepEqual(unite([1, 2, 3], [5, 2, 1]), [1, 2, 3, 5], 'message: <code>unite([1, 2, 3], [5, 2, 1])</code> should return <code>[1, 2, 3, 5]</code>.');",
|
||||
"assert.deepEqual(unite([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]), [1, 2, 3, 5, 4, 6, 7, 8], 'message: <code>unite([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8])</code> should return <code>[1, 2, 3, 5, 4, 6, 7, 8]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Arguments object",
|
||||
@ -428,7 +417,6 @@
|
||||
{
|
||||
"id": "a6b0bb188d873cb2c8729495",
|
||||
"title": "Convert HTML Entities",
|
||||
"difficulty": "2.07",
|
||||
"description": [
|
||||
"Convert the characters \"&\", \"<\", \">\", '\"' (double quote), and \"'\" (apostrophe), in a string to their corresponding HTML entities.",
|
||||
"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."
|
||||
@ -439,16 +427,16 @@
|
||||
" return str;",
|
||||
"}",
|
||||
"",
|
||||
"convert('Dolce & Gabbana');"
|
||||
"convert(\"Dolce & Gabbana\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert.match(convert('Dolce & Gabbana'), /Dolce &(amp|AMP|#x00026|#38); Gabbana/, 'should escape characters');",
|
||||
"assert.match(convert('Hamburgers < Pizza < Tacos'), /Hamburgers &(lt|LT|#x0003C|#60); Pizza &(lt|LT|#x0003C|#60); Tacos/, 'should escape characters');",
|
||||
"assert.match(convert('Sixty > twelve'), /Sixty &(gt|GT|#x0003E|#62); twelve/, 'should escape characters');",
|
||||
"assert.match(convert('Stuff in \"quotation marks\"'), /Stuff in &(quot|QUOT|#x00022|#34);quotation marks&(quot|QUOT|#x00022|#34);/, 'should escape characters');",
|
||||
"assert.match(convert(\"Shindler's List\"), /Shindler&(apos|#x00027|#39);s List/, 'should escape characters');",
|
||||
"assert.match(convert('<>'), /&(lt|LT|#x0003C|#60);&(gt|GT|#x0003E|#62);/, 'should escape characters');",
|
||||
"assert.strictEqual(convert('abc'), 'abc', 'should handle strings with nothing to escape');"
|
||||
"assert.match(convert(\"Dolce & Gabbana\"), /Dolce & Gabbana/, 'message: <code>convert(\"Dolce & Gabbana\")</code> should return <code>Dolce &​amp; Gabbana</code>.');",
|
||||
"assert.match(convert(\"Hamburgers < Pizza < Tacos\"), /Hamburgers < Pizza < Tacos/, 'message: <code>convert(\"Hamburgers < Pizza < Tacos\")</code> should return <code>Hamburgers &​lt; Pizza &​lt; Tacos</code>.');",
|
||||
"assert.match(convert(\"Sixty > twelve\"), /Sixty > twelve/, 'message: <code>convert(\"Sixty > twelve\")</code> should return <code>Sixty &​gt; twelve</code>.');",
|
||||
"assert.match(convert('Stuff in \"quotation marks\"'), /Stuff in "quotation marks"/, 'message: <code>convert('Stuff in \"quotation marks\"')</code> should return <code>Stuff in &​quot;quotation marks&​quot;</code>.');",
|
||||
"assert.match(convert(\"Shindler's List\"), /Shindler's List/, 'message: <code>convert(\"Shindler's List\")</code> should return <code>Shindler&​apos;s List</code>.');",
|
||||
"assert.match(convert('<>'), /<>/, 'message: <code>convert(\"<>\")</code> should return <code>&​lt;&​gt;</code>.');",
|
||||
"assert.strictEqual(convert('abc'), 'abc', 'message: <code>convert(\"abc\")</code> should return <code>abc</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"RegExp",
|
||||
@ -470,7 +458,6 @@
|
||||
{
|
||||
"id": "a103376db3ba46b2d50db289",
|
||||
"title": "Spinal Tap Case",
|
||||
"difficulty": "2.08",
|
||||
"description": [
|
||||
"Convert a string to spinal case. Spinal case is all-lowercase-words-joined-by-dashes.",
|
||||
"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."
|
||||
@ -485,10 +472,10 @@
|
||||
"spinalCase('This Is Spinal Tap');"
|
||||
],
|
||||
"tests": [
|
||||
"assert.strictEqual(spinalCase('This Is Spinal Tap'), 'this-is-spinal-tap', 'should return spinal case from string with spaces');",
|
||||
"assert.strictEqual(spinalCase('thisIsSpinalTap'), 'this-is-spinal-tap', 'should return spinal case from string with camel case');",
|
||||
"assert.strictEqual(spinalCase('The_Andy_Griffith_Show'), 'the-andy-griffith-show', 'should return spinal case from string with snake case');",
|
||||
"assert.strictEqual(spinalCase('Teletubbies say Eh-oh'), 'teletubbies-say-eh-oh', 'should return spinal case from string with spaces and hyphens');"
|
||||
"assert.deepEqual(spinalCase(\"This Is Spinal Tap\"), \"this-is-spinal-tap\", 'message: <code>spinalCase(\"This Is Spinal Tap\")</code> should return <code>\"this-is-spinal-tap\"</code>.');",
|
||||
"assert.strictEqual(spinalCase('thisIsSpinalTap'), \"this-is-spinal-tap\", 'message: <code>spinalCase(\"thisIsSpinalTap\")</code> should return <code>\"this-is-spinal-tap\"</code>.');",
|
||||
"assert.strictEqual(spinalCase(\"The_Andy_Griffith_Show\"), \"the-andy-griffith-show\", 'message: <code>spinalCase(\"The_Andy_Griffith_Show\")</code> should return <code>\"the-andy-griffith-show\"</code>.');",
|
||||
"assert.strictEqual(spinalCase(\"Teletubbies say Eh-oh\"), \"teletubbies-say-eh-oh\", 'message: <code>spinalCase(\"Teletubbies say Eh-oh\")</code> should return <code>\"teletubbies-say-eh-oh\"</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"RegExp",
|
||||
@ -510,7 +497,6 @@
|
||||
{
|
||||
"id": "a5229172f011153519423690",
|
||||
"title": "Sum All Odd Fibonacci Numbers",
|
||||
"difficulty": "2.09",
|
||||
"description": [
|
||||
"Return the sum of all odd Fibonacci numbers up to and including the passed number if it is a Fibonacci number.",
|
||||
"The first few numbers of the Fibonacci sequence are 1, 1, 2, 3, 5 and 8, and each subsequent number is the sum of the previous two numbers.",
|
||||
@ -525,12 +511,12 @@
|
||||
"sumFibs(4);"
|
||||
],
|
||||
"tests": [
|
||||
"expect(sumFibs(1)).to.be.a('number');",
|
||||
"expect(sumFibs(1000)).to.equal(1785);",
|
||||
"expect(sumFibs(4000000)).to.equal(4613732);",
|
||||
"expect(sumFibs(4)).to.equal(5);",
|
||||
"expect(sumFibs(75024)).to.equal(60696);",
|
||||
"expect(sumFibs(75025)).to.equal(135721);"
|
||||
"assert(typeof(sumFibs(1)) === \"number\", 'message: <code>sumFibs()</code> should return a number.');",
|
||||
"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(4), 5, 'message: <code>sumFibs(4)</code> should return 5.');",
|
||||
"assert.deepEqual(sumFibs(75024), 60696, 'message: <code>sumFibs(75024)</code> should return 60696.');",
|
||||
"assert.deepEqual(sumFibs(75025), 135721, 'message: <code>sumFibs(75025)</code> should return 135721.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Remainder"
|
||||
@ -551,7 +537,6 @@
|
||||
{
|
||||
"id": "a3bfc1673c0526e06d3ac698",
|
||||
"title": "Sum All Primes",
|
||||
"difficulty": "2.10",
|
||||
"description": [
|
||||
"Sum all the prime numbers up to and including the provided number.",
|
||||
"A prime number is defined as having only two divisors, 1 and itself. For example, 2 is a prime number because it's only divisible by 1 and 2. 1 isn't a prime number, because it's only divisible by itself.",
|
||||
@ -566,9 +551,9 @@
|
||||
"sumPrimes(10);"
|
||||
],
|
||||
"tests": [
|
||||
"expect(sumPrimes(10)).to.be.a('number');",
|
||||
"expect(sumPrimes(10)).to.equal(17);",
|
||||
"expect(sumPrimes(977)).to.equal(73156);"
|
||||
"assert.deepEqual(typeof(sumPrimes(10)), \"number\", 'message: <code>sumPrimes()</code> should return a number.');",
|
||||
"assert.deepEqual(sumPrimes(10), 17, 'message: <code>sumPrimes(10)</code> should return 17.');",
|
||||
"assert.deepEqual(sumPrimes(977), 73156, 'message: <code>sumPrimes(977)</code> should return 73156.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"For Loops",
|
||||
@ -590,7 +575,6 @@
|
||||
{
|
||||
"id": "ae9defd7acaf69703ab432ea",
|
||||
"title": "Smallest Common Multiple",
|
||||
"difficulty": "2.11",
|
||||
"description": [
|
||||
"Find the smallest common multiple of the provided parameters that can be evenly divided by both, as well as by all sequential numbers in the range between these parameters.",
|
||||
"The range will be an array of two numbers that will not necessarily be in numerical order.",
|
||||
@ -606,10 +590,10 @@
|
||||
"smallestCommons([1,5]);"
|
||||
],
|
||||
"tests": [
|
||||
"expect(smallestCommons([1,5])).to.be.a('number');",
|
||||
"expect(smallestCommons([1,5])).to.equal(60);",
|
||||
"expect(smallestCommons([5,1])).to.equal(60);",
|
||||
"expect(smallestCommons([1,13])).to.equal(360360);"
|
||||
"assert.deepEqual(typeof(smallestCommons([1, 5])), \"number\", 'message: <code>smallestCommons()</code> should return a number.');",
|
||||
"assert.deepEqual(smallestCommons([1, 5]), 60, 'message: <code>smallestCommons([1, 5])</code> should return 60.');",
|
||||
"assert.deepEqual(smallestCommons([5, 1]), 60, 'message: <code>smallestCommons([5, 1])</code> should return 60.');",
|
||||
"assert.deepEqual(smallestCommons([1, 13]), 360360, 'message: <code>smallestCommons([1, 13])</code> should return 360360.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Smallest Common Multiple"
|
||||
@ -630,7 +614,6 @@
|
||||
{
|
||||
"id": "a6e40f1041b06c996f7b2406",
|
||||
"title": "Finders Keepers",
|
||||
"difficulty": "2.12",
|
||||
"description": [
|
||||
"Create a function that looks through an array (first argument) and returns the first element in the array that passes a truth test (second argument).",
|
||||
"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."
|
||||
@ -644,8 +627,8 @@
|
||||
"find([1, 2, 3, 4], function(num){ return num % 2 === 0; });"
|
||||
],
|
||||
"tests": [
|
||||
"assert.strictEqual(find([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }), 8, 'should return first found value');",
|
||||
"assert.strictEqual(find([1, 3, 5, 9], function(num) { return num % 2 === 0; }), undefined, 'should return undefined if not found');"
|
||||
"assert.strictEqual(find([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }), 8, 'message: <code>find([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; })</code> should return 8.');",
|
||||
"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": [
|
||||
"Array.some()"
|
||||
@ -666,7 +649,6 @@
|
||||
{
|
||||
"id": "a5deed1811a43193f9f1c841",
|
||||
"title": "Drop it",
|
||||
"difficulty": "2.13",
|
||||
"description": [
|
||||
"Drop the elements of an array (first argument), starting from the front, until the predicate (second argument) returns true.",
|
||||
"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."
|
||||
@ -680,10 +662,10 @@
|
||||
"drop([1, 2, 3], function(n) {return n < 3; });"
|
||||
],
|
||||
"tests": [
|
||||
"expect(drop([1, 2, 3, 4], function(n) {return n >= 3; })).to.eqls([3, 4]);",
|
||||
"expect(drop([1, 2, 3], function(n) {return n > 0; })).to.eqls([1, 2, 3]);",
|
||||
"expect(drop([1, 2, 3, 4], function(n) {return n > 5; })).to.eqls([]);",
|
||||
"expect(drop([1, 2, 3, 7, 4], function(n) { return n > 5; })).to.eqls([7, 4]);"
|
||||
"assert.deepEqual(drop([1, 2, 3, 4], function(n) {return n>= 3;}), [3, 4], 'message: <code>drop([1, 2, 3, 4], function(n) {return n>= 3;})</code> should return <code>[3, 4]</code>.');",
|
||||
"assert.deepEqual(drop([1, 2, 3], function(n) {return n > 0; }), [1, 2, 3], 'message: <code>drop([1, 2, 3], function(n) {return n > 0; })</code> should return <code>[1, 2, 3]</code>.');",
|
||||
"assert.deepEqual(drop([1, 2, 3, 4], function(n) {return n > 5;}), [], 'message: <code>drop([1, 2, 3, 4], function(n) {return n > 5;})</code> should return <code>[]</code>.');",
|
||||
"assert.deepEqual(drop([1, 2, 3, 7, 4], function(n) {return n > 3}), [7, 4], 'message: <code>drop([1, 2, 3, 7, 4], function(n) {return n>= 3})</code> should return <code>[7, 4]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Arguments object",
|
||||
@ -705,7 +687,6 @@
|
||||
{
|
||||
"id": "ab306dbdcc907c7ddfc30830",
|
||||
"title": "Steamroller",
|
||||
"difficulty": "2.14",
|
||||
"description": [
|
||||
"Flatten a nested array. You must account for varying levels of nesting.",
|
||||
"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."
|
||||
@ -719,10 +700,10 @@
|
||||
"steamroller([1, [2], [3, [[4]]]]);"
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(steamroller([[['a']], [['b']]]), ['a', 'b'], 'should flatten nested arrays');",
|
||||
"assert.deepEqual(steamroller([1, [2], [3, [[4]]]]), [1, 2, 3, 4], 'should flatten nested arrays');",
|
||||
"assert.deepEqual(steamroller([1, [], [3, [[4]]]]), [1, 3, 4], 'should work with empty arrays');",
|
||||
"assert.deepEqual(steamroller([1, {}, [3, [[4]]]]), [1, {}, 3, 4], 'should work with actual objects');"
|
||||
"assert.deepEqual(steamroller([[[\"a\"]], [[\"b\"]]]), [\"a\", \"b\"], 'message: <code>steamroller([[[\"a\"]], [[\"b\"]]])</code> should return <code>[\"a\", \"b\"]</code>.');",
|
||||
"assert.deepEqual(steamroller([1, [2], [3, [[4]]]]), [1, 2, 3, 4], 'message: <code>steamroller([1, [2], [3, [[4]]]])</code> should return <code>[1, 2, 3, 4]</code>.');",
|
||||
"assert.deepEqual(steamroller([1, [], [3, [[4]]]]), [1, 3, 4], 'message: <code>steamroller([1, [], [3, [[4]]]])</code> should return <code>[1, 3, 4]</code>.');",
|
||||
"assert.deepEqual(steamroller([1, {}, [3, [[4]]]]), [1, {}, 3, 4], 'message: <code>steamroller([1, {}, [3, [[4]]]])</code> should return <code>[1, {}, 3, 4]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Array.isArray()"
|
||||
@ -743,7 +724,6 @@
|
||||
{
|
||||
"id": "a8d97bd4c764e91f9d2bda01",
|
||||
"title": "Binary Agents",
|
||||
"difficulty": "2.15",
|
||||
"description": [
|
||||
"Return an English translated sentence of the passed binary string.",
|
||||
"The binary string will be space separated.",
|
||||
@ -754,11 +734,11 @@
|
||||
" return str;",
|
||||
"}",
|
||||
"",
|
||||
"binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111');"
|
||||
"binaryAgent(\"01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111\");"
|
||||
],
|
||||
"tests": [
|
||||
"expect(binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111')).to.equal(\"Aren't bonfires fun!?\");",
|
||||
"expect(binaryAgent('01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001')).to.equal(\"I love FreeCodeCamp!\");"
|
||||
"assert.deepEqual(binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111'), \"Aren't bonfires fun!?\", 'message: <code>binaryAgent(\"01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111\")</code> should return \"Aren't bonfires fun!?\"');",
|
||||
"assert.deepEqual(binaryAgent(\"01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001\"), \"I love FreeCodeCamp!\", 'message: <code>binaryAgent(\"01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001\"</code> should return \"I love FreeCodeCamp!\"');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"String.charCodeAt()",
|
||||
@ -780,7 +760,6 @@
|
||||
{
|
||||
"id": "a10d2431ad0c6a099a4b8b52",
|
||||
"title": "Everything Be True",
|
||||
"difficulty": "2.21",
|
||||
"description": [
|
||||
"Check if the predicate (second argument) returns truthy (defined) for 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.",
|
||||
@ -793,12 +772,12 @@
|
||||
" return pre;",
|
||||
"}",
|
||||
"",
|
||||
"every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], 'sex');"
|
||||
"every([{\"user\": \"Tinky-Winky\", \"sex\": \"male\"}, {\"user\": \"Dipsy\", \"sex\": \"male\"}, {\"user\": \"Laa-Laa\", \"sex\": \"female\"}, {\"user\": \"Po\", \"sex\": \"female\"}], \"sex\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], 'sex'), true, 'should return true if predicate returns truthy for all elements in the collection');",
|
||||
"assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'male'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], {'sex': 'female'}), false, 'should return false if predicate returns falsey for any element in the collection');",
|
||||
"assert.strictEqual(every([{'user': 'Tinky-Winky', 'sex': 'female'}, {'user': 'Dipsy', 'sex': 'male'}, {'user': 'Laa-Laa', 'sex': 'female'}, {'user': 'Po', 'sex': 'female'}], {'sex': 'female'}), false, 'should return false if predicate returns falsey for any element in the collection');"
|
||||
"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\": \"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.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Object.hasOwnProperty()",
|
||||
@ -820,7 +799,6 @@
|
||||
{
|
||||
"id": "a97fd23d9b809dac9921074f",
|
||||
"title": "Arguments Optional",
|
||||
"difficulty": "2.22",
|
||||
"description": [
|
||||
"Create a function that sums two arguments together. If only one argument is provided, then return a function that expects one argument and returns the sum.",
|
||||
"For example, <code>add(2, 3)</code> should return <code>5</code>, and <code>add(2)</code> should return a function.",
|
||||
@ -838,11 +816,11 @@
|
||||
"add(2,3);"
|
||||
],
|
||||
"tests": [
|
||||
"expect(add(2, 3)).to.equal(5);",
|
||||
"expect(add(2)(3)).to.equal(5);",
|
||||
"expect(add('http://bit.ly/IqT6zt')).to.be.undefined;",
|
||||
"expect(add(2, '3')).to.be.undefined;",
|
||||
"expect(add(2)([3])).to.be.undefined;"
|
||||
"assert.deepEqual(add(2, 3), 5, 'message: <code>add(2, 3)</code> should return 5.');",
|
||||
"assert.deepEqual(add(2)(3), 5, 'message: <code>add(2)(3)</code> should return 5.');",
|
||||
"assert.isUndefined(add(\"http://bit.ly/IqT6zt\"), 'message: <code>add(\"http://bit.ly/IqT6zt\")</code> should return undefined.');",
|
||||
"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": [
|
||||
"Global Function Object",
|
||||
|
@ -1,11 +1,109 @@
|
||||
{
|
||||
"name": "Intermediate Front End Development Projects",
|
||||
"order": 0.015,
|
||||
"order": 11,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd10",
|
||||
"title": "Show the Local Weather",
|
||||
"challengeSeed": ["126415127"],
|
||||
"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'>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 #3:</span> Reverse engineer the example project's functionality, and also feel free to personalize it.",
|
||||
"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 see the weather in my current location.",
|
||||
"<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 can push a button to toggle between Fahrenheit and Celsius.",
|
||||
"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.",
|
||||
"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>"
|
||||
],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "Покажите местную погоду",
|
||||
"descriptionRu": [
|
||||
"<span class='text-info'>Задание:</span> Создайте <a href='http://codepen.io' target='_blank'>CodePen.io</a> который успешно копирует вот этот: <a href='http://codepen.io/AdventureBear/full/yNBJRj' target='_blank'>http://codepen.io/AdventureBear/full/yNBJRj</a>.",
|
||||
"<span class='text-info'>Правило #1:</span> Не подсматривайте код приведенного на CodePen примера. Напишите его самостоятельно.",
|
||||
"<span class='text-info'>Правило #2:</span> Можете использовать любые библиотеки или API, которые потребуются.",
|
||||
"<span class='text-info'>Правило #3:</span> Воссоздайте функционал приведенного примера и не стесняйтесь добавить что-нибудь от себя.",
|
||||
"Реализуйте следующие <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>пользовательские истории</a>, сделайте также бонусные по желанию:",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу узнать погоду с учетом моего текущего местоположения.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу в зависимости от погоды видеть различные температурные значки.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу в зависимости от погоды видеть различные фоновые изображения (снежные горы, знойная пустыня).",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу нажать на кнопку чтобы переключится между градусами по Цельсию или по Фаренгейту.",
|
||||
"Если что-то не получается, воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>.",
|
||||
"Когда выполните задание кликните кнопку \"I've completed this challenge\" и добавьте ссылку на ваш CodePen. Если вы программировали с кем-то в паре, также добавьте имя вашего напарника.",
|
||||
"Если вы хотите получить немедленную оценку вашего проекта, нажмите эту кнопку и добавьте ссылку на ваш CodePen. В противном случае мы проверим его перед тем как вы приступите к проектам для некоммерческих организаций.<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:%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||
],
|
||||
"nameEs": "",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd1f",
|
||||
"title": "Use the Twitch.tv JSON API",
|
||||
"challengeSeed": ["126411564"],
|
||||
"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/GeoffStorbeck/full/GJKRxZ' target='_blank'>http://codepen.io/GeoffStorbeck/full/GJKRxZ</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 #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.",
|
||||
"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 see whether Free Code Camp is currently streaming on Twitch.tv.",
|
||||
"<span class='text-info'>User Story:</span> As a user, I can click the status output and be sent directly to the Free Code Camp's Twitch.tv channel.",
|
||||
"<span class='text-info'>User Story:</span> As a user, if Free Code Camp is streaming, I can see additional details about what they are streaming.",
|
||||
"<span class='text-info'>Bonus User Story:</span> As a user, I can search through the streams listed.",
|
||||
"<span class='text-info'>Bonus User Story:</span> As a user, I will see a placeholder notification if a streamer has closed their Twitch account. You can verify this works by adding brunofin and comster404 to your array of Twitch streamers.",
|
||||
"<span class='text-info'>Hint:</span> Here's an example call to Twitch.tv's JSON API: <code>https://api.twitch.tv/kraken/streams/freecodecamp</code>.",
|
||||
"<span class='text-info'>Hint:</span> The relevant documentation about this API call is here: <a href='https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel' target='_blank'>https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel</a>.",
|
||||
"<span class='text-info'>Hint:</span> Here's an array of the Twitch.tv usernames of people who regularly stream coding: <code>[\"freecodecamp\", \"storbeck\", \"terakilobyte\", \"habathcx\",\"RobotCaleb\",\"thomasballinger\",\"noobs2ninjas\",\"beohoff\"]</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.",
|
||||
"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>"
|
||||
],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "Используйте Twitch.tv JSON API",
|
||||
"descriptionRu": [
|
||||
"<span class='text-info'>Задание:</span> Создайте <a href='http://codepen.io' target='_blank'>CodePen.io</a> который успешно копирует вот этот: <a href='http://codepen.io/GeoffStorbeck/full/GJKRxZ' target='_blank'>http://codepen.io/GeoffStorbeck/full/GJKRxZ</a>.",
|
||||
"<span class='text-info'>Правило #1:</span> Не подсматривайте код приведенного на CodePen примера. Напишите его самостоятельно.",
|
||||
"<span class='text-info'>Правило #2:</span> Можете использовать любые библиотеки или API, которые потребуются.",
|
||||
"<span class='text-info'>Правило #3:</span> Воссоздайте функционал приведенного примера и не стесняйтесь добавить что-нибудь от себя.",
|
||||
"Реализуйте следующие <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>пользовательские истории</a>, сделайте также бонусные по желанию:",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу увидеть идет ли в данный момент на Twitch.tv трансляция Free Code Camp.",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу, кликнув на описание трансляции, перейти на канал Free Code Camp.",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу видеть дополнительную информацию о текущей трансляции Free Code Camp.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу произвести поиск среди перечисленных каналов.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу видеть уведомление, если создатель канала закрыл свой аккаунт на Twitch.tv. Добавьте в массив имена пользователей brunofin и comster404, чтобы убедиться, что эта функция реализована правильно.",
|
||||
"<span class='text-info'>Подсказка:</span> Пример запроса к Twitch.tv JSON API: <code>https://api.twitch.tv/kraken/streams/freecodecamp</code>.",
|
||||
"<span class='text-info'>Подсказка:</span> Документацию об этом запросе можно найти по ссылке: <a href='https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel' target='_blank'>https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel</a>.",
|
||||
"<span class='text-info'>Подсказка:</span> В этом массиве приведены имена пользователей, которые регулярно пишут код онлайн: <code>[\"freecodecamp\", \"storbeck\", \"terakilobyte\", \"habathcx\",\"RobotCaleb\",\"comster404\",\"brunofin\",\"thomasballinger\",\"noobs2ninjas\",\"beohoff\"]</code>",
|
||||
"Если что-то не получается, воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>.",
|
||||
"Когда выполните задание кликните кнопку \"I've completed this challenge\" и добавьте ссылку на ваш CodePen. Если вы программировали с кем-то в паре, также добавьте имя вашего напарника.",
|
||||
"Если вы хотите получить немедленную оценку вашего проекта, нажмите эту кнопку и добавьте ссылку на ваш CodePen. В противном случае мы проверим его перед тем как вы приступите к проектам для некоммерческих организаций.<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:%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||
],
|
||||
"nameEs": "",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
|
||||
"id": "bd7158d8c442eddfaeb5bd18",
|
||||
"title": "Stylize Stories on Camper News",
|
||||
"difficulty": 1.02,
|
||||
"challengeSeed": ["126415129"],
|
||||
"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/MarufSarker/full/ZGPZLq/' target='_blank'>http://codepen.io/MarufSarker/full/ZGPZLq/</a>.",
|
||||
@ -38,7 +136,6 @@
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd19",
|
||||
"title": "Build a Wikipedia Viewer",
|
||||
"difficulty": 1.03,
|
||||
"challengeSeed": ["126415131"],
|
||||
"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/GeoffStorbeck/full/MwgQea' target='_blank'>http://codepen.io/GeoffStorbeck/full/MwgQea</a>.",
|
||||
@ -68,42 +165,9 @@
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd17",
|
||||
"title": "Build a JavaScript Calculator",
|
||||
"difficulty": 1.05,
|
||||
"challengeSeed": ["126411565"],
|
||||
"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/GeoffStorbeck/full/zxgaqw' target='_blank'>http://codepen.io/GeoffStorbeck/full/zxgaqw</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 #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.",
|
||||
"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'>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.",
|
||||
"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.",
|
||||
"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>"
|
||||
],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eedfaeb5bd1c",
|
||||
"title": "Build a Tic Tac Toe Game",
|
||||
"difficulty": 1.06,
|
||||
"challengeSeed": ["126415123"],
|
||||
"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/alex-dixon/full/JogOpQ/' target='_blank'>http://codepen.io/alex-dixon/full/JogOpQ/</a>.",
|
||||
@ -136,7 +200,6 @@
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd1c",
|
||||
"title": "Build a Simon Game",
|
||||
"difficulty": 1.07,
|
||||
"challengeSeed": ["137213633"],
|
||||
"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/Em-Ant/full/QbRyqq/' target='_blank'>http://codepen.io/dting/full/QbRyqq/</a>.",
|
||||
|
@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "jQuery",
|
||||
"order": 0.004,
|
||||
"order": 4,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bad87fee1348bd9acdd08826",
|
||||
"title": "Learn how Script Tags and Document Ready Work",
|
||||
"difficulty": 3.01,
|
||||
"description": [
|
||||
"Now we're ready to learn jQuery, the most popular JavaScript tool of all time. Don't worry about JavaScript itself - we will cover it soon.",
|
||||
"Before we can start using jQuery, we need to add some things to our HTML.",
|
||||
@ -52,7 +51,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9bedc08826",
|
||||
"title": "Target HTML Elements with Selectors Using jQuery",
|
||||
"difficulty": 3.02,
|
||||
"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.",
|
||||
"This is important because without your <code>document ready function</code>, your code may run before your HTML is rendered, which would cause bugs.",
|
||||
@ -102,7 +100,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aedc08826",
|
||||
"title": "Target Elements by Class Using jQuery",
|
||||
"difficulty": 3.03,
|
||||
"description": [
|
||||
"You see how we made all of your <code>button</code> elements bounce? We selected them with <code>$(\"button\")</code>, then we added some CSS classes to them with <code>.addClass(\"animated bounce\");</code>.",
|
||||
"You just used jQuery's <code>.addClass()</code> function, which allows you to add classes to elements.",
|
||||
@ -152,7 +149,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aeda08826",
|
||||
"title": "Target Elements by ID Using jQuery",
|
||||
"difficulty": 3.04,
|
||||
"description": [
|
||||
"You can also target elements by their id attributes.",
|
||||
"First target your <code>button</code> element with the id <code>target3</code> by using the <code>$(\"#target3\")</code> selector.",
|
||||
@ -204,7 +200,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aeda08726",
|
||||
"title": "Delete your jQuery Functions",
|
||||
"difficulty": 3.05,
|
||||
"description": [
|
||||
"These animations were cool at first, but now they're getting kind of distracting.",
|
||||
"Delete all three of these jQuery functions from your <code>document ready function</code>, but leave your <code>document ready function</code> itself intact."
|
||||
@ -256,7 +251,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aed908626",
|
||||
"title": "Target the same element with multiple jQuery Selectors",
|
||||
"difficulty": 3.06,
|
||||
"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>.",
|
||||
"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>.",
|
||||
@ -307,7 +301,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aed918626",
|
||||
"title": "Remove Classes from an element with jQuery",
|
||||
"difficulty": 3.07,
|
||||
"description": [
|
||||
"In the same way you can add classes to an element with jQuery's <code>addClass()</code> function, you can remove them with jQuery's <code>removeClass()</code> function.",
|
||||
"Here's how you would do this for a specific button, add <code>$(\"#target2\").removeClass(\"btn-default\");</code>",
|
||||
@ -358,7 +351,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aed908826",
|
||||
"title": "Change the CSS of an Element Using jQuery",
|
||||
"difficulty": 3.08,
|
||||
"description": [
|
||||
"We can also change the CSS of an HTML element directly with jQuery.",
|
||||
"jQuery has a function called <code>.css()</code> that allows you to change the CSS of an element.",
|
||||
@ -412,7 +404,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aed808826",
|
||||
"title": "Disable an Element Using jQuery",
|
||||
"difficulty": 3.09,
|
||||
"description": [
|
||||
"You can also change the non-CSS properties of HTML elements with jQuery. For example, you can disable buttons.",
|
||||
"When you disable a button, it will become grayed-out and can no longer be clicked.",
|
||||
@ -463,7 +454,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aed708826",
|
||||
"title": "Remove an Element Using jQuery",
|
||||
"difficulty": 3.10,
|
||||
"description": [
|
||||
"Now let's remove an HTML element from your page using jQuery.",
|
||||
"jQuery has a function called <code>.remove()</code> that will remove an HTML element entirely",
|
||||
@ -512,7 +502,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aed608826",
|
||||
"title": "Use appendTo to Move Elements with jQuery",
|
||||
"difficulty": 3.11,
|
||||
"description": [
|
||||
"Now let's try moving elements from one <code>div</code> to another.",
|
||||
"jQuery has a function called <code>appendTo()</code> that allows you to select HTML elements and append them to another element.",
|
||||
@ -564,7 +553,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aed508826",
|
||||
"title": "Clone an Element Using jQuery",
|
||||
"difficulty": 3.12,
|
||||
"description": [
|
||||
"In addition to moving elements, you can also copy them from one place to another.",
|
||||
"jQuery has a function called <code>clone()</code> that makes a copy of an element.",
|
||||
@ -618,7 +606,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aed308826",
|
||||
"title": "Target the Parent of an Element Using jQuery",
|
||||
"difficulty": 3.13,
|
||||
"description": [
|
||||
"Every HTML element has a <code>parent</code> element from which it <code>inherits</code> properties.",
|
||||
"For example, your <code>jQuery Playground</code> <code>h3</code> element has the parent element of <code><div class=\"container-fluid\"></code>, which itself has the parent <code>body</code>.",
|
||||
@ -674,7 +661,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aed208826",
|
||||
"title": "Target the Children of an Element Using jQuery",
|
||||
"difficulty": 3.14,
|
||||
"description": [
|
||||
"Many HTML elements have <code>children</code> which <code>inherit</code> their properties from their parent HTML elements.",
|
||||
"For example, every HTML element is a child of your <code>body</code> element, and your \"jQuery Playground\" <code>h3</code> element is a child of your <code><div class=\"container-fluid\"></code> element.",
|
||||
@ -730,7 +716,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aed108826",
|
||||
"title": "Target a Specific Child of an Element Using jQuery",
|
||||
"difficulty": 3.15,
|
||||
"description": [
|
||||
"You've seen why id attributes are so convenient for targeting with jQuery selectors. But you won't always have such neat ids to work with.",
|
||||
"Fortunately, jQuery has some other tricks for targeting the right elements.",
|
||||
@ -787,7 +772,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aed008826",
|
||||
"title": "Target Even Numbered Elements Using jQuery",
|
||||
"difficulty": 3.16,
|
||||
"description": [
|
||||
"You can also target all the even-numbered elements.",
|
||||
"Here's how you would target all the odd-numbered elements with class <code>target</code> and give them classes: <code>$(\".target:odd\").addClass(\"animated shake\");</code>",
|
||||
@ -845,7 +829,6 @@
|
||||
{
|
||||
"id": "bad87fee1348bd9aecb08826",
|
||||
"title": "Use jQuery to Modify the Entire Page",
|
||||
"difficulty": 3.20,
|
||||
"description": [
|
||||
"We're done playing with our jQuery playground. Let's tear it down!",
|
||||
"jQuery can target the <code>body</code> element as well.",
|
||||
|
@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "MongoDB",
|
||||
"order" : 0.018,
|
||||
"order" : 19,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bd7243d8c341eddeaeb5bd0f",
|
||||
"title": "Store Data in MongoDB",
|
||||
"difficulty": 0.01,
|
||||
"challengeSeed": ["133316035"],
|
||||
"description": [
|
||||
"We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
|
||||
|
@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "Node.js and Express.js",
|
||||
"order" : 0.017,
|
||||
"order" : 18,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bd7153d8c441eddfaeb5bd0f",
|
||||
"title": "Manage Packages with NPM",
|
||||
"difficulty": 0.39,
|
||||
"challengeSeed": ["126433450"],
|
||||
"description": [
|
||||
"We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud.",
|
||||
@ -59,7 +58,6 @@
|
||||
{
|
||||
"id": "bd7153d8c441eddfaeb5bdff",
|
||||
"title": "Start a Node.js Server",
|
||||
"difficulty": 0.40,
|
||||
"challengeSeed": ["126411561"],
|
||||
"description": [
|
||||
"We'll build this Waypoint on Cloud 9, a powerful online code editor with a full Ubuntu Linux workspace, all running in the cloud. We'll do the first 7 steps of Node School's LearnYouNode challenges.",
|
||||
@ -101,7 +99,6 @@
|
||||
{
|
||||
"id": "bd7153d8c441eddfaeb5bdfe",
|
||||
"title": "Continue working with Node.js Servers",
|
||||
"difficulty": 0.41,
|
||||
"challengeSeed": ["128836506"],
|
||||
"description": [
|
||||
"Let's continue the LearnYouNode Node School challenge. For this Waypoint, we'll do challenges 8 through 10.",
|
||||
@ -130,7 +127,6 @@
|
||||
{
|
||||
"id": "bd7153d8c441eddfaeb5bdfd",
|
||||
"title": "Finish working with Node.js Servers",
|
||||
"difficulty": 0.42,
|
||||
"challengeSeed": ["128836507"],
|
||||
"description": [
|
||||
"Let's continue the LearnYouNode Node School challenge. For this Waypoint, we'll do challenges 11 through 13.",
|
||||
@ -159,7 +155,6 @@
|
||||
{
|
||||
"id": "bd7153d8c441eddfaeb5bd1f",
|
||||
"title": "Build Web Apps with Express.js",
|
||||
"difficulty": 0.43,
|
||||
"challengeSeed": [
|
||||
"126411559"
|
||||
],
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Object Oriented and Functional Programming",
|
||||
"order": 0.006,
|
||||
"order": 6,
|
||||
"note": [
|
||||
"Methods",
|
||||
"Closures",
|
||||
@ -20,9 +20,9 @@
|
||||
"Give your <code>motorBike</code> object a <code>wheels</code>, <code>engines</code> and <code>seats</code> attribute and set them to numbers."
|
||||
],
|
||||
"tests":[
|
||||
"assert(typeof(motorBike.engines) === 'number', '<code>motorBike</code> should have a <code>engines</code> attribute set to a number.');",
|
||||
"assert(typeof(motorBike.wheels) === 'number', '<code>motorBike</code> should have a <code>wheels</code> attribute set to a number.');",
|
||||
"assert(typeof(motorBike.seats) === 'number', '<code>motorBike</code> should have a <code>seats</code> attribute set to a number.');"
|
||||
"assert(typeof(motorBike.engines) === 'number', 'message: <code>motorBike</code> should have a <code>engines</code> attribute set to a number.');",
|
||||
"assert(typeof(motorBike.wheels) === 'number', 'message: <code>motorBike</code> should have a <code>wheels</code> attribute set to a number.');",
|
||||
"assert(typeof(motorBike.seats) === 'number', 'message: <code>motorBike</code> should have a <code>seats</code> attribute set to a number.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"//Here is a sample Object",
|
||||
@ -57,9 +57,9 @@
|
||||
"Give your <code>myMotorBike</code> object a <code>wheels</code>, <code>engines</code> and <code>seats</code> attribute and set them to numbers."
|
||||
],
|
||||
"tests":[
|
||||
"assert(typeof((new MotorBike()).engines) === 'number', '<code>myMotorBike</code> should have a <code>engines</code> attribute set to a number.');",
|
||||
"assert(typeof((new MotorBike()).wheels) === 'number', '<code>myMotorBike</code> should have a <code>wheels</code> attribute set to a number.');",
|
||||
"assert(typeof((new MotorBike()).seats) === 'number', '<code>myMotorBike</code> should have a <code>seats</code> attribute set to a number.');"
|
||||
"assert(typeof((new MotorBike()).engines) === 'number', 'message: <code>myMotorBike</code> should have a <code>engines</code> attribute set to a number.');",
|
||||
"assert(typeof((new MotorBike()).wheels) === 'number', 'message: <code>myMotorBike</code> should have a <code>wheels</code> attribute set to a number.');",
|
||||
"assert(typeof((new MotorBike()).seats) === 'number', 'message: <code>myMotorBike</code> should have a <code>seats</code> attribute set to a number.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"// Let's add the properties engines and seats to the car in the same way that the property wheels has been added below. They should both be numbers.",
|
||||
@ -98,12 +98,12 @@
|
||||
"See if you can keep <code>myBike.speed</code> and <code>myBike.addUnit</code> private, while making <code>myBike.getSpeed</code> publicly accessible."
|
||||
],
|
||||
"tests":[
|
||||
"assert(typeof(myBike.getSpeed)!=='undefined' && typeof(myBike.getSpeed) === 'function', 'The method getSpeed of myBike should be accessible outside the object');",
|
||||
"assert(typeof(myBike.speed) === 'undefined', '<code>myBike.speed</code> should remain undefined.');",
|
||||
"assert(typeof(myBike.addUnit) === 'undefined', '<code>myBike.addUnit</code> should remain undefined.');"
|
||||
"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.addUnit) === 'undefined', 'message: <code>myBike.addUnit</code> should remain undefined.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"//Let's create an object with a two functions. One attached as a property and one not.",
|
||||
"//Let's create an object with two functions. One attached as a property and one not.",
|
||||
"var Car = function() {",
|
||||
" this.gear = 1;",
|
||||
" function addStyle(styleMe){",
|
||||
@ -149,10 +149,10 @@
|
||||
"Then you can give the instance new properties."
|
||||
],
|
||||
"tests":[
|
||||
"assert((new Car()).wheels === 4, 'The property <code>wheels</code> should still be 4 like in the object constructor');",
|
||||
"assert(typeof((new Car()).engines) === 'undefined', 'There should not be a property engine in the object constructor');",
|
||||
"assert(myCar.wheels === 4, 'The property wheels of myCar should be four');",
|
||||
"assert(typeof(myCar.engines) === 'number', 'The property engine of myCar should be a number');"
|
||||
"assert((new Car()).wheels === 4, 'message: The property <code>wheels</code> should still be 4 like 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(typeof(myCar.engines) === 'number', 'message: The property <code>engines</code> of myCar should be a number.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var Car = function() {",
|
||||
@ -184,9 +184,9 @@
|
||||
"Use the map function to add 3 to every value in the variable <code>array</code>"
|
||||
],
|
||||
"tests":[
|
||||
"assert.deepEqual(array, [4,5,6,7,8], 'You should have added three to each value in the array');",
|
||||
"assert(editor.getValue().match(/\\.map\\(/gi), 'You should be making use of the map method');",
|
||||
"assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\]/gi), 'You should only modify the array with .map');"
|
||||
"assert.deepEqual(array, [4,5,6,7,8], 'message: You should add three to each value in the array.');",
|
||||
"assert(editor.getValue().match(/\\.map\\(/gi), 'message: You should be making use of the map method.');",
|
||||
"assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\]/gi), 'message: You should only modify the array with <code>.map</code>.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"//Use map to add three to each value in the array",
|
||||
@ -212,8 +212,8 @@
|
||||
"<code>});</code>"
|
||||
],
|
||||
"tests":[
|
||||
"assert(singleVal == 30, 'singleVal should have been set to the result of you reduce operation');",
|
||||
"assert(editor.getValue().match(/\\.reduce\\(/gi), 'You should have made use of the reduce method');"
|
||||
"assert(singleVal == 30, 'message: <code>singleVal</code> should have been set to the result of you reduce operation.');",
|
||||
"assert(editor.getValue().match(/\\.reduce\\(/gi), 'message: You should have made use of the reduce method.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var array = [4,5,6,7,8];",
|
||||
@ -240,9 +240,9 @@
|
||||
"<code>});</code>"
|
||||
],
|
||||
"tests":[
|
||||
"assert.deepEqual(array, [1,2,3,4,5], 'You should have removed all the values from the array that are greater than five');",
|
||||
"assert(editor.getValue().match(/array\\.filter\\(/gi), 'You should be using the filter method to remove the values from the array');",
|
||||
"assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\,6\\,7\\,8\\,9\\,10\\]/gi), 'You should only be using .filter to modify the contents of the array');"
|
||||
"assert.deepEqual(array, [1,2,3,4], 'message: You should have removed all the values from the array that are greater than 4.');",
|
||||
"assert(editor.getValue().match(/array\\.filter\\(/gi), 'message: You should be using the filter 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.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var array = [1,2,3,4,5,6,7,8,9,10];",
|
||||
@ -267,9 +267,9 @@
|
||||
"This will return <code>[1, 2, 3]</code>"
|
||||
],
|
||||
"tests":[
|
||||
"assert.deepEqual(array, ['alpha', 'beta', 'charlie'], 'You should have sorted the array alphabetically');",
|
||||
"assert(editor.getValue().match(/\\[\\'beta\\'\\,\\s\\'alpha\\'\\,\\s'charlie\\'\\];/gi), 'You should be sorting the array using sort');",
|
||||
"assert(editor.getValue().match(/\\.sort\\(\\)/gi), 'You should have made use of the sort method');"
|
||||
"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(/\\.sort\\(\\)/gi), 'message: You should have made use of the sort method.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var array = ['beta', 'alpha', 'charlie'];",
|
||||
@ -286,14 +286,13 @@
|
||||
{
|
||||
"id": "cf1111c1c16feddfaeb2bdef",
|
||||
"title": "Reverse Arrays with .reverse",
|
||||
"difficulty": 0,
|
||||
"description": [
|
||||
"You can use the <code>.reverse()</code> function to reverse the contents of an array."
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(array, [7,6,5,4,3,2,1], 'You should reverse the array');",
|
||||
"assert(editor.getValue().match(/\\.reverse\\(\\)/gi), '');",
|
||||
"assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\,6\\,7/gi), '');"
|
||||
"assert.deepEqual(array, [7,6,5,4,3,2,1], 'message: You should reverse the array.');",
|
||||
"assert(editor.getValue().match(/\\.reverse\\(\\)/gi), 'message: You should use the reverse 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>.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var array = [1,2,3,4,5,6,7];",
|
||||
@ -310,15 +309,14 @@
|
||||
{
|
||||
"id": "cf1111c1c16feddfaeb3bdef",
|
||||
"title": "Concatenate Strings with .concat",
|
||||
"difficulty": 0,
|
||||
"description": [
|
||||
"<code>.concat()</code> can be used to merge the contents of two arrays into one.",
|
||||
"<code>array = array.concat(otherArray);</code>"
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(array, [1,2,3,4,5,6], 'You should concat the two arrays together');",
|
||||
"assert(editor.getValue().match(/\\.concat\\(/gi), 'You should be using the concat method to merge the two arrays');",
|
||||
"assert(editor.getValue().match(/\\[1\\,2\\,3\\]/gi) && editor.getValue().match(/\\[4\\,5\\,6\\]/gi), 'You should only modify the two arrays without changing the origional ones');"
|
||||
"assert.deepEqual(array, [1,2,3,4,5,6], 'You should concat the two arrays together.');",
|
||||
"assert(editor.getValue().match(/\\.concat\\(/gi), 'message: You should be use the concat 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.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var array = [1,2,3];",
|
||||
@ -344,8 +342,8 @@
|
||||
"<code>array = string.split(' ');</code>"
|
||||
],
|
||||
"tests":[
|
||||
"assert(typeof(array) === 'object' && array.length === 5, 'You should have split the string by it\\'s spaces');",
|
||||
"assert(/\\.split\\(/gi, 'You should have made use of the split method on the string');"
|
||||
"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.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var string = \"Split me into an array\";",
|
||||
@ -368,8 +366,8 @@
|
||||
"<code>var joinMe = joinMe.join(\" \");</code>"
|
||||
],
|
||||
"tests":[
|
||||
"assert(typeof(joinMe) === 'string' && joinMe === \"Split me into an array\", 'You should have joined the arrays by it\\'s spaces');",
|
||||
"assert(/\\.join\\(/gi, 'You should have made use of the join method on the array');"
|
||||
"assert(typeof(joinMe) === 'string' && joinMe === \"Split me into an array\", 'message: You should join the arrays by their spaces.');",
|
||||
"assert(/\\.join\\(/gi, 'message: You should use of the join method on the array.');"
|
||||
],
|
||||
"challengeSeed":[
|
||||
"var joinMe = [\"Split\",\"me\",\"into\",\"an\",\"array\"];",
|
||||
|
@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "Upper Intermediate Algorithm Scripting",
|
||||
"order": 0.011,
|
||||
"order": 13,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "a2f1d72d9b908d0bd72bb9f6",
|
||||
"title": "Make a Person",
|
||||
"difficulty": "3.01",
|
||||
"description": [
|
||||
"Fill in the object constructor with the methods specified in the tests.",
|
||||
"Those methods are getFirstName(), getLastName(), getFullName(), setFirstName(first), setLastName(last), and setFullName(firstAndLast).",
|
||||
@ -22,20 +21,13 @@
|
||||
"bob.getFullName();"
|
||||
],
|
||||
"tests": [
|
||||
"expect(Object.keys(bob).length).to.eql(6);",
|
||||
"expect(bob instanceof Person).to.be.true;",
|
||||
"expect(bob.firstName).to.be.undefined();",
|
||||
"expect(bob.lastName).to.be.undefined();",
|
||||
"expect(bob.getFirstName()).to.eql('Bob');",
|
||||
"expect(bob.getLastName()).to.eql('Ross');",
|
||||
"expect(bob.getFullName()).to.eql('Bob Ross');",
|
||||
"bob.setFirstName('Happy');",
|
||||
"expect(bob.getFirstName()).to.eql('Happy');",
|
||||
"bob.setLastName('Trees');",
|
||||
"expect(bob.getLastName()).to.eql('Trees');",
|
||||
"bob.setFullName('George Carlin');",
|
||||
"expect(bob.getFullName()).to.eql('George Carlin');",
|
||||
"bob.setFullName('Bob Ross');"
|
||||
"assert.deepEqual(Object.keys(bob).length, 6, 'message: <code>Object.keys(bob).length</code> should return 6.');",
|
||||
"assert.deepEqual(bob instanceof Person, true, 'message: <code>bob instanceof Person</code> should return true.');",
|
||||
"assert.deepEqual(bob.firstName, undefined, 'message: <code>bob.firstName</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.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\".');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Closures",
|
||||
@ -58,7 +50,6 @@
|
||||
"id": "af4afb223120f7348cdfc9fd",
|
||||
"title": "Map the Debris",
|
||||
"dashedName": "bonfire-map-the-debris",
|
||||
"difficulty": "3.02",
|
||||
"description": [
|
||||
"Return a new array that transforms the element's average altitude into their orbital periods.",
|
||||
"The array will contain objects in the format <code>{name: 'name', avgAlt: avgAlt}</code>.",
|
||||
@ -77,8 +68,8 @@
|
||||
"orbitalPeriod([{name : \"sputnik\", avgAlt : 35873.5553}]);"
|
||||
],
|
||||
"tests": [
|
||||
"expect(orbitalPeriod([{name : \"sputnik\", avgAlt : 35873.5553}])).to.eqls([{name: \"sputnik\", orbitalPeriod: 86400}]);",
|
||||
"expect(orbitalPeriod([{name: \"iss\", avgAlt: 413.6}, {name: \"hubble\", avgAlt: 556.7}, {name: \"moon\", avgAlt: 378632.553}])).to.eqls([{name : \"iss\", orbitalPeriod: 5557}, {name: \"hubble\", orbitalPeriod: 5734}, {name: \"moon\", orbitalPeriod: 2377399}]);"
|
||||
"assert.deepEqual(orbitalPeriod([{name : \"sputnik\", avgAlt : 35873.5553}]), [{name: \"sputnik\", orbitalPeriod: 86400}], 'message: <code>orbitalPeriod([{name : \"sputnik\", avgAlt : 35873.5553}])</code> should return <code>[{name: \"sputnik\", orbitalPeriod: 86400}]</code>.');",
|
||||
"assert.deepEqual(orbitalPeriod([{name: \"iss\", avgAlt: 413.6}, {name: \"hubble\", avgAlt: 556.7}, {name: \"moon\", avgAlt: 378632.553}]), [{name : \"iss\", orbitalPeriod: 5557}, {name: \"hubble\", orbitalPeriod: 5734}, {name: \"moon\", orbitalPeriod: 2377399}], 'message: <code>orbitalPeriod([{name: \"iss\", avgAlt: 413.6}, {name: \"hubble\", avgAlt: 556.7}, {name: \"moon\", avgAlt: 378632.553}])</code> should return <code>[{name : \"iss\", orbitalPeriod: 5557}, {name: \"hubble\", orbitalPeriod: 5734}, {name: \"moon\", orbitalPeriod: 2377399}]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Math.pow()"
|
||||
@ -99,7 +90,6 @@
|
||||
{
|
||||
"id": "a3f503de51cfab748ff001aa",
|
||||
"title": "Pairwise",
|
||||
"difficulty": "3.03",
|
||||
"description": [
|
||||
"Return the sum of all indices of elements of 'arr' that can be paired with one other element to form a sum that equals the value in the second argument 'arg'. If multiple sums are possible, return the smallest sum. Once an element has been used, it cannot be reused to pair with another.",
|
||||
"For example, pairwise([1, 4, 2, 3, 0, 5], 7) should return 11 because 4, 2, 3 and 5 can be paired with each other to equal 7.",
|
||||
@ -114,11 +104,11 @@
|
||||
"pairwise([1,4,2,3,0,5], 7);"
|
||||
],
|
||||
"tests": [
|
||||
"expect(pairwise([1, 4, 2, 3, 0, 5], 7)).to.equal(11);",
|
||||
"expect(pairwise([1, 3, 2, 4], 4)).to.equal(1);",
|
||||
"expect(pairwise([1,1,1], 2)).to.equal(1);",
|
||||
"expect(pairwise([0, 0, 0, 0, 1, 1], 1)).to.equal(10);",
|
||||
"expect(pairwise([], 100)).to.equal(0);"
|
||||
"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.');",
|
||||
"expect(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.');",
|
||||
"expect(pairwise([], 100), 0, 'message: <code>pairwise([], 100)</code> should return 0.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Array.reduce()"
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import Router from 'react-router';
|
||||
import { RoutingContext } from 'react-router';
|
||||
import Fetchr from 'fetchr';
|
||||
import Location from 'react-router/lib/Location';
|
||||
import { createLocation } from 'history';
|
||||
import debugFactory from 'debug';
|
||||
import { app$ } from '../../common/app';
|
||||
import { RenderToString } from 'thundercats-react';
|
||||
@ -30,25 +30,25 @@ export default function reactSubRouter(app) {
|
||||
|
||||
function serveReactApp(req, res, next) {
|
||||
const services = new Fetchr({ req });
|
||||
const location = new Location(req.path, req.query);
|
||||
const location = createLocation(req.path);
|
||||
|
||||
// returns a router wrapped app
|
||||
app$(location)
|
||||
app$({ location })
|
||||
// if react-router does not find a route send down the chain
|
||||
.filter(function({ initialState }) {
|
||||
if (!initialState) {
|
||||
.filter(function({ props}) {
|
||||
if (!props) {
|
||||
debug('react tried to find %s but got 404', location.pathname);
|
||||
return next();
|
||||
}
|
||||
return !!initialState;
|
||||
return !!props;
|
||||
})
|
||||
.flatMap(function({ initialState, AppCat }) {
|
||||
.flatMap(function({ props, AppCat }) {
|
||||
// call thundercats renderToString
|
||||
// prefetches data and sets up it up for current state
|
||||
debug('rendering to string');
|
||||
return RenderToString(
|
||||
AppCat(null, services),
|
||||
React.createElement(Router, initialState)
|
||||
React.createElement(RoutingContext, props)
|
||||
);
|
||||
})
|
||||
// makes sure we only get one onNext and closes subscription
|
||||
|
@ -26,29 +26,60 @@ const challengeView = {
|
||||
2: 'coursewares/showVideo',
|
||||
3: 'coursewares/showZiplineOrBasejump',
|
||||
4: 'coursewares/showZiplineOrBasejump',
|
||||
5: 'coursewares/showBonfire'
|
||||
5: 'coursewares/showBonfire',
|
||||
7: 'coursewares/showStep'
|
||||
};
|
||||
|
||||
const dasherize = utils.dasherize;
|
||||
const unDasherize = utils.unDasherize;
|
||||
const getMDNLinks = utils.getMDNLinks;
|
||||
|
||||
function makeChallengesUnique(challengeArr) {
|
||||
// clone and reverse challenges
|
||||
// then filter by unique id's
|
||||
// then reverse again
|
||||
return _.uniq(challengeArr.slice().reverse(), 'id').reverse();
|
||||
}
|
||||
function numberWithCommas(x) {
|
||||
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||
}
|
||||
|
||||
function updateUserProgress(user, challengeId, completedChallenge) {
|
||||
const alreadyCompleted = user.completedChallenges.some(({ id }) => {
|
||||
return id === challengeId;
|
||||
let { completedChallenges } = user;
|
||||
|
||||
// migrate user challenges object to remove
|
||||
if (!user.isUniqMigrated) {
|
||||
user.isUniqMigrated = true;
|
||||
|
||||
completedChallenges = user.completedChallenges =
|
||||
makeChallengesUnique(completedChallenges);
|
||||
}
|
||||
|
||||
const indexOfChallenge = _.findIndex(completedChallenges, {
|
||||
id: challengeId
|
||||
});
|
||||
|
||||
const alreadyCompleted = indexOfChallenge !== -1;
|
||||
|
||||
if (!alreadyCompleted) {
|
||||
user.progressTimestamps.push({
|
||||
timestamp: Date.now(),
|
||||
completedChallenge
|
||||
completedChallenge: challengeId
|
||||
});
|
||||
user.completedChallenges.push(completedChallenge);
|
||||
return user;
|
||||
}
|
||||
user.completedChallenges.push(completedChallenge);
|
||||
|
||||
const oldCompletedChallenge = completedChallenges[indexOfChallenge];
|
||||
user.completedChallenges[indexOfChallenge] =
|
||||
Object.assign(
|
||||
{},
|
||||
completedChallenge,
|
||||
{
|
||||
completedDate: oldCompletedChallenge.completedDate,
|
||||
lastUpdated: completedChallenge.completedDate
|
||||
}
|
||||
);
|
||||
return user;
|
||||
}
|
||||
|
||||
@ -209,6 +240,7 @@ module.exports = function(app) {
|
||||
|
||||
function returnIndividualChallenge(req, res, next) {
|
||||
const origChallengeName = req.params.challengeName;
|
||||
const solutionCode = req.query.solution;
|
||||
const unDashedName = unDasherize(origChallengeName);
|
||||
|
||||
const challengeName = challengesRegex.test(unDashedName) ?
|
||||
@ -238,7 +270,12 @@ module.exports = function(app) {
|
||||
}
|
||||
|
||||
if (dasherize(challenge.name) !== origChallengeName) {
|
||||
return Observable.just('/challenges/' + dasherize(challenge.name));
|
||||
return Observable.just(
|
||||
'/challenges/' +
|
||||
dasherize(challenge.name) +
|
||||
'?solution=' +
|
||||
encodeURIComponent(solutionCode)
|
||||
);
|
||||
}
|
||||
|
||||
// save user does nothing if user does not exist
|
||||
@ -247,6 +284,7 @@ module.exports = function(app) {
|
||||
dashedName: origChallengeName,
|
||||
name: challenge.name,
|
||||
details: challenge.description,
|
||||
description: challenge.description,
|
||||
tests: challenge.tests,
|
||||
challengeSeed: challenge.challengeSeed,
|
||||
verb: utils.randomVerb(),
|
||||
@ -471,6 +509,7 @@ module.exports = function(app) {
|
||||
}
|
||||
|
||||
function challengeMap({ user = {} }, res, next) {
|
||||
let lastCompleted;
|
||||
const daysRunning = moment().diff(new Date('10/15/2014'), 'days');
|
||||
|
||||
// if user
|
||||
@ -513,7 +552,13 @@ module.exports = function(app) {
|
||||
})
|
||||
.filter(({ name }) => name !== 'Hikes')
|
||||
// turn stream of blocks into a stream of an array
|
||||
.toArray();
|
||||
.toArray()
|
||||
.doOnNext((blocks) => {
|
||||
const lastCompletedBlock = _.findLast(blocks, (block) => {
|
||||
return block.completed === 100;
|
||||
});
|
||||
lastCompleted = lastCompletedBlock && lastCompletedBlock.name || null;
|
||||
});
|
||||
|
||||
Observable.combineLatest(
|
||||
camperCount$,
|
||||
@ -526,6 +571,7 @@ module.exports = function(app) {
|
||||
blocks,
|
||||
daysRunning,
|
||||
camperCount,
|
||||
lastCompleted,
|
||||
title: "A map of all Free Code Camp's Challenges"
|
||||
});
|
||||
},
|
||||
|
@ -22,7 +22,7 @@ module.exports = function(app) {
|
||||
|
||||
function index(req, res) {
|
||||
if (req.user) {
|
||||
return res.render('resources/get-started', { title: message });
|
||||
return res.redirect('/map');
|
||||
}
|
||||
res.render('home', { title: message });
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
import _ from 'lodash';
|
||||
import async from 'async';
|
||||
import dedent from 'dedent';
|
||||
import moment from 'moment';
|
||||
import debugFactory from 'debug';
|
||||
|
||||
import { ifNoUser401 } from '../utils/middleware';
|
||||
import { ifNoUser401, ifNoUserRedirectTo } from '../utils/middleware';
|
||||
|
||||
const debug = debugFactory('freecc:boot:user');
|
||||
const daysBetween = 1.5;
|
||||
const sendNonUserToMap = ifNoUserRedirectTo('/map');
|
||||
|
||||
function calcCurrentStreak(cals) {
|
||||
const revCals = cals.concat([Date.now()]).slice().reverse();
|
||||
@ -52,7 +52,7 @@ function dayDiff([head, tail]) {
|
||||
module.exports = function(app) {
|
||||
var router = app.loopback.Router();
|
||||
var User = app.models.User;
|
||||
var Story = app.models.Story;
|
||||
// var Story = app.models.Story;
|
||||
|
||||
router.get('/login', function(req, res) {
|
||||
res.redirect(301, '/signin');
|
||||
@ -68,14 +68,21 @@ module.exports = function(app) {
|
||||
router.post('/reset-password', postReset);
|
||||
router.get('/email-signup', getEmailSignup);
|
||||
router.get('/email-signin', getEmailSignin);
|
||||
router.get('/account/api', getAccountAngular);
|
||||
router.get(
|
||||
'/toggle-lockdown-mode',
|
||||
sendNonUserToMap,
|
||||
toggleLockdownMode
|
||||
);
|
||||
router.post(
|
||||
'/account/delete',
|
||||
ifNoUser401,
|
||||
postDeleteAccount
|
||||
);
|
||||
router.get('/account/unlink/:provider', getOauthUnlink);
|
||||
router.get('/account', getAccount);
|
||||
router.get(
|
||||
'/account',
|
||||
sendNonUserToMap,
|
||||
getAccount
|
||||
);
|
||||
router.get('/vote1', vote1);
|
||||
router.get('/vote2', vote2);
|
||||
// Ensure this is the last route!
|
||||
@ -116,18 +123,8 @@ module.exports = function(app) {
|
||||
}
|
||||
|
||||
function getAccount(req, res) {
|
||||
if (!req.user) {
|
||||
return res.redirect('/');
|
||||
}
|
||||
res.render('account/account', {
|
||||
title: 'Manage your Free Code Camp Account'
|
||||
});
|
||||
}
|
||||
|
||||
function getAccountAngular(req, res) {
|
||||
res.json({
|
||||
user: req.user || {}
|
||||
});
|
||||
const { username } = req.user;
|
||||
return res.redirect('/' + username);
|
||||
}
|
||||
|
||||
function returnUser(req, res, next) {
|
||||
@ -135,26 +132,18 @@ module.exports = function(app) {
|
||||
const { path } = req;
|
||||
User.findOne(
|
||||
{ where: { username } },
|
||||
function(err, user) {
|
||||
function(err, profileUser) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
if (!user) {
|
||||
if (!profileUser) {
|
||||
req.flash('errors', {
|
||||
msg: `404: We couldn't find path ${ path }`
|
||||
});
|
||||
return res.redirect('/');
|
||||
}
|
||||
if (!user.isGithubCool && !user.isMigrationGrandfathered) {
|
||||
req.flash('errors', {
|
||||
msg: `
|
||||
user ${ username } has not completed account signup
|
||||
`
|
||||
});
|
||||
return res.redirect('/');
|
||||
}
|
||||
|
||||
var cals = user
|
||||
var cals = profileUser
|
||||
.progressTimestamps
|
||||
.map(objOrNum => {
|
||||
return typeof objOrNum === 'number' ?
|
||||
@ -163,10 +152,10 @@ module.exports = function(app) {
|
||||
})
|
||||
.sort();
|
||||
|
||||
user.currentStreak = calcCurrentStreak(cals);
|
||||
user.longestStreak = calcLongestStreak(cals);
|
||||
profileUser.currentStreak = calcCurrentStreak(cals);
|
||||
profileUser.longestStreak = calcLongestStreak(cals);
|
||||
|
||||
const data = user
|
||||
const data = profileUser
|
||||
.progressTimestamps
|
||||
.map((objOrNum) => {
|
||||
return typeof objOrNum === 'number' ?
|
||||
@ -181,39 +170,83 @@ module.exports = function(app) {
|
||||
return data;
|
||||
}, {});
|
||||
|
||||
const challenges = user.completedChallenges.filter(function(obj) {
|
||||
const baseAndZip = profileUser.completedChallenges.filter(
|
||||
function(obj) {
|
||||
return obj.challengeType === 3 || obj.challengeType === 4;
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
const bonfires = user.completedChallenges.filter(function(obj) {
|
||||
const bonfires = profileUser.completedChallenges.filter(function(obj) {
|
||||
return obj.challengeType === 5 && (obj.name || '').match(/Bonfire/g);
|
||||
});
|
||||
|
||||
const waypoints = profileUser.completedChallenges.filter(function(obj) {
|
||||
return (obj.name || '').match(/^Waypoint/i);
|
||||
});
|
||||
|
||||
res.render('account/show', {
|
||||
title: 'Camper ' + user.username + '\'s portfolio',
|
||||
username: user.username,
|
||||
name: user.name,
|
||||
isMigrationGrandfathered: user.isMigrationGrandfathered,
|
||||
isGithubCool: user.isGithubCool,
|
||||
location: user.location,
|
||||
github: user.githubURL,
|
||||
linkedin: user.linkedin,
|
||||
google: user.google,
|
||||
facebook: user.facebook,
|
||||
twitter: user.twitter,
|
||||
picture: user.picture,
|
||||
progressTimestamps: user.progressTimestamps,
|
||||
title: 'Camper ' + profileUser.username + '\'s portfolio',
|
||||
username: profileUser.username,
|
||||
name: profileUser.name,
|
||||
isMigrationGrandfathered: profileUser.isMigrationGrandfathered,
|
||||
isGithubCool: profileUser.isGithubCool,
|
||||
isLocked: !!profileUser.isLocked,
|
||||
|
||||
location: profileUser.location,
|
||||
calender: data,
|
||||
challenges: challenges,
|
||||
bonfires: bonfires,
|
||||
moment: moment,
|
||||
longestStreak: user.longestStreak,
|
||||
currentStreak: user.currentStreak
|
||||
|
||||
github: profileUser.githubURL,
|
||||
linkedin: profileUser.linkedin,
|
||||
google: profileUser.google,
|
||||
facebook: profileUser.facebook,
|
||||
twitter: profileUser.twitter,
|
||||
picture: profileUser.picture,
|
||||
|
||||
progressTimestamps: profileUser.progressTimestamps,
|
||||
|
||||
baseAndZip,
|
||||
bonfires,
|
||||
waypoints,
|
||||
moment,
|
||||
|
||||
longestStreak: profileUser.longestStreak,
|
||||
currentStreak: profileUser.currentStreak
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function toggleLockdownMode(req, res, next) {
|
||||
if (req.user.isLocked === true) {
|
||||
req.user.isLocked = false;
|
||||
return req.user.save(function(err) {
|
||||
if (err) { return next(err); }
|
||||
|
||||
req.flash('success', {
|
||||
msg: dedent`
|
||||
Other people can now view all your challenge solutions.
|
||||
You can change this back at any time in the "Manage My Account"
|
||||
section at the bottom of this page.
|
||||
`
|
||||
});
|
||||
res.redirect('/' + req.user.username);
|
||||
});
|
||||
}
|
||||
req.user.isLocked = true;
|
||||
return req.user.save(function(err) {
|
||||
if (err) { return next(err); }
|
||||
|
||||
req.flash('success', {
|
||||
msg: dedent`
|
||||
All your challenge solutions are now hidden from other people.
|
||||
You can change this back at any time in the "Manage My Account"
|
||||
section at the bottom of this page.
|
||||
`
|
||||
});
|
||||
res.redirect('/' + req.user.username);
|
||||
});
|
||||
}
|
||||
|
||||
function postDeleteAccount(req, res, next) {
|
||||
User.destroyById(req.user.id, function(err) {
|
||||
if (err) { return next(err); }
|
||||
@ -223,25 +256,6 @@ module.exports = function(app) {
|
||||
});
|
||||
}
|
||||
|
||||
function getOauthUnlink(req, res, next) {
|
||||
var provider = req.params.provider;
|
||||
User.findById(req.user.id, function(err, user) {
|
||||
if (err) { return next(err); }
|
||||
|
||||
user[provider] = null;
|
||||
user.tokens =
|
||||
_.reject(user.tokens, function(token) {
|
||||
return token.kind === provider;
|
||||
});
|
||||
|
||||
user.save(function(err) {
|
||||
if (err) { return next(err); }
|
||||
req.flash('info', { msg: provider + ' account has been unlinked.' });
|
||||
res.redirect('/account');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getReset(req, res) {
|
||||
if (!req.accessToken) {
|
||||
req.flash('errors', { msg: 'access token invalid' });
|
||||
@ -314,6 +328,7 @@ module.exports = function(app) {
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
function updateUserStoryPictures(userId, picture, username, cb) {
|
||||
Story.find({ 'author.userId': userId }, function(err, stories) {
|
||||
if (err) { return cb(err); }
|
||||
@ -334,31 +349,30 @@ module.exports = function(app) {
|
||||
});
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
function vote1(req, res) {
|
||||
function vote1(req, res, next) {
|
||||
if (req.user) {
|
||||
req.user.tshirtVote = 1;
|
||||
req.user.save(function (err) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
req.flash('success', {msg: 'Thanks for voting!'});
|
||||
req.user.save(function(err) {
|
||||
if (err) { return next(err); }
|
||||
|
||||
req.flash('success', { msg: 'Thanks for voting!' });
|
||||
res.redirect('/map');
|
||||
});
|
||||
} else {
|
||||
req.flash('error', {msg: 'You must be signed in to vote.'});
|
||||
req.flash('error', { msg: 'You must be signed in to vote.' });
|
||||
res.redirect('/map');
|
||||
}
|
||||
}
|
||||
|
||||
function vote2(req, res) {
|
||||
function vote2(req, res, next) {
|
||||
if (req.user) {
|
||||
req.user.tshirtVote = 2;
|
||||
req.user.save(function (err) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
req.flash('success', {msg: 'Thanks for voting!'});
|
||||
req.user.save(function(err) {
|
||||
if (err) { return next(err); }
|
||||
|
||||
req.flash('success', { msg: 'Thanks for voting!' });
|
||||
res.redirect('/map');
|
||||
});
|
||||
} else {
|
||||
|
@ -1,75 +0,0 @@
|
||||
extends ../layout
|
||||
block content
|
||||
script.
|
||||
var challengeName = 'Account View'
|
||||
.panel.panel-info
|
||||
.panel-heading.text-center Manage your account here
|
||||
.panel-body
|
||||
.row
|
||||
.col-xs-12
|
||||
if (!user.isGithubCool)
|
||||
a.btn.btn-lg.btn-block.btn-github.btn-link-social(href='/link/github')
|
||||
i.fa.fa-github
|
||||
| Link my GitHub to unlock this profile
|
||||
else
|
||||
a.btn.btn-lg.btn-block.btn-github.btn-link-social(href='/link/github')
|
||||
i.fa.fa-github
|
||||
| Update my profile from GitHub
|
||||
|
||||
if (!user.twitter)
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-twitter.btn-link-social(href='/link/twitter')
|
||||
i.fa.fa-twitter
|
||||
| Add my Twitter to my profile
|
||||
if (!user.facebook)
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-facebook.btn-link-social(href='/link/facebook')
|
||||
i.fa.fa-facebook
|
||||
| Add my Facebook to my profile
|
||||
if (!user.linkedin)
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-linkedin.btn-link-social(href='/link/linkedin')
|
||||
i.fa.fa-linkedin
|
||||
| Add my LinkedIn to my profile
|
||||
if (!user.google)
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-google-plus.btn-link-social(href='/link/google')
|
||||
i.fa.fa-google-plus
|
||||
| Add my Google+ to my profile
|
||||
.big-spacer
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-warning.btn-link-social(href='/logout')
|
||||
span.ion-android-exit
|
||||
| Sign me out of Free Code Camp
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='mailto:team@freecodecamp.com')
|
||||
span.ion-email
|
||||
| Email us at team@freecodecamp.com
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-danger.btn-link-social.confirm-deletion
|
||||
span.ion-trash-b
|
||||
| Delete my Free Code Camp account
|
||||
script.
|
||||
$('.confirm-deletion').on("click", function() {
|
||||
$('#modal-dialog').modal('show');
|
||||
});
|
||||
#modal-dialog.modal.animated.wobble
|
||||
.modal-dialog
|
||||
.modal-content
|
||||
.modal-header
|
||||
a.close(href='#', data-dismiss='modal', aria-hidden='true') ×
|
||||
h3 Are you really leaving us?
|
||||
.modal-body
|
||||
p Pro Tip: If you tweet feedback to 
|
||||
a(href="https://twitter.com/intent/tweet?text=Hey%20@freecodecamp") @FreeCodeCamp
|
||||
| , we'll act quickly on it!
|
||||
.modal-footer
|
||||
a.btn.btn-success.btn-block(href='#', data-dismiss='modal', aria-hidden='true')
|
||||
span.ion-happy
|
||||
| Nevermind, I'll stick around
|
||||
br
|
||||
form(action='/account/delete', method='POST')
|
||||
input(type='hidden', name='_csrf', value=_csrf)
|
||||
button.btn.btn-danger.btn-block(type='submit')
|
||||
span.ion-trash-b
|
||||
| Yes, delete my account
|
@ -3,48 +3,66 @@ block content
|
||||
script(src="/bower_components/cal-heatmap/cal-heatmap.min.js")
|
||||
script.
|
||||
var challengeName = 'Profile View';
|
||||
if (user && user.username === username)
|
||||
.panel.panel-info
|
||||
.panel-heading.text-center Update Your Portfolio
|
||||
.panel-body
|
||||
.row
|
||||
.col-xs-12
|
||||
if (!user.isGithubCool)
|
||||
a.btn.btn-lg.btn-block.btn-github.btn-link-social(href='/link/github')
|
||||
i.fa.fa-github
|
||||
| Link my GitHub to unlock this profile
|
||||
else
|
||||
a.btn.btn-lg.btn-block.btn-github.btn-link-social(href='/link/github')
|
||||
i.fa.fa-github
|
||||
| Update my profile from GitHub
|
||||
if (!user.twitter)
|
||||
a.btn.btn-lg.btn-block.btn-twitter.btn-link-social(href='/link/twitter')
|
||||
i.fa.fa-twitter
|
||||
| Add my Twitter to my profile
|
||||
if (!user.facebook)
|
||||
a.btn.btn-lg.btn-block.btn-facebook.btn-link-social(href='/link/facebook')
|
||||
i.fa.fa-facebook
|
||||
| Add my Facebook to my profile
|
||||
if (!user.linkedin)
|
||||
a.btn.btn-lg.btn-block.btn-linkedin.btn-link-social(href='/link/linkedin')
|
||||
i.fa.fa-linkedin
|
||||
| Add my LinkedIn to my profile
|
||||
if (!user.google)
|
||||
a.btn.btn-lg.btn-block.btn-google-plus.btn-link-social(href='/link/google')
|
||||
i.fa.fa-google-plus
|
||||
| Add my Google+ to my profile
|
||||
|
||||
.panel.panel-info
|
||||
.panel-heading.text-center
|
||||
h1 #{username}'s portfolio
|
||||
.panel-body
|
||||
if (user && user.username === username)
|
||||
.row.text-center
|
||||
.col-xs-12.col-sm-10.col-sm-offset-1
|
||||
a.btn.btn-big.btn-primary.btn-block(href="/account") Manage my account
|
||||
.button-spacer
|
||||
.col-xs-12.col-sm-10.col-sm-offset-1
|
||||
a.btn.btn-big.btn-success.btn-block(href="/signout") Sign out of Free Code Camp
|
||||
.spacer
|
||||
.row
|
||||
.col-xs-12
|
||||
.col-xs-12.col-sm-12.col-md-5
|
||||
if picture
|
||||
img.img-center.img-responsive.public-profile-img(src=picture)
|
||||
else
|
||||
img.img-center.img-responsive.public-profile-img(src='https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png')
|
||||
h1.text-center.negative-5.profile-social-icons
|
||||
if (twitter)
|
||||
a.fa.fa-twitter-square.text-primary(title="@#{username}'s Twitter Profile", href='https://twitter.com/' + twitter, target='_blank')
|
||||
if (github)
|
||||
a.fa.fa-github-square.text-primary(title="@#{username}'s GitHub Profile", href=github, target='_blank')
|
||||
if (linkedin)
|
||||
a.fa.fa-linkedin-square.text-primary(title="@#{username}'s LinkedIn Profile", href=linkedin, target='_blank')
|
||||
if (facebook)
|
||||
a.fa.fa-facebook-square.text-primary(title="@#{username}'s Facebook Profile", href='https://facebook.com/' + facebook, target='_blank')
|
||||
if (google)
|
||||
a.fa.fa-google-plus-square.text-primary(title="@#{username}'s Google Profile", href='https://plus.google.com/' + google, target='_blank')
|
||||
.visible-md.visible-lg
|
||||
.col-xs-12.col-sm-12.col-md-4.text-justify
|
||||
h1.flat-top.wrappable= name
|
||||
h3.flat-top.bolded.wrappable= location
|
||||
.visible-xs.visible-sm
|
||||
.col-xs-12.col-sm-12.col-md-4.text-center
|
||||
h1.flat-top.wrappable= name
|
||||
h3.flat-top.bolded.wrappable= location
|
||||
.col-xs-12.col-sm-12.col-md-3.text-center
|
||||
.background-svg.img-center
|
||||
.points-on-top
|
||||
= "[ " + (progressTimestamps.length) + " ]"
|
||||
.col-xs-12.col-sm-10.col-sm-offset-1.col-md-8.col-md-offset-2.text-center
|
||||
if picture
|
||||
img.img-center.img-responsive.public-profile-img(src=picture)
|
||||
else
|
||||
img.img-center.img-responsive.public-profile-img(src='https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png')
|
||||
h1.text-center.negative-5.profile-social-icons
|
||||
if (twitter)
|
||||
a.fa.fa-twitter-square.text-primary(title="@#{username}'s Twitter Profile", href='https://twitter.com/' + twitter, target='_blank')
|
||||
if (github)
|
||||
a.fa.fa-github-square.text-primary(title="@#{username}'s GitHub Profile", href=github, target='_blank')
|
||||
if (linkedin)
|
||||
a.fa.fa-linkedin-square.text-primary(title="@#{username}'s LinkedIn Profile", href=linkedin, target='_blank')
|
||||
if (facebook)
|
||||
a.fa.fa-facebook-square.text-primary(title="@#{username}'s Facebook Profile", href='https://facebook.com/' + facebook, target='_blank')
|
||||
if (google)
|
||||
a.fa.fa-google-plus-square.text-primary(title="@#{username}'s Google Profile", href='https://plus.google.com/' + google, target='_blank')
|
||||
h1.flat-top.wrappable= name
|
||||
h1.flat-top.wrappable= location
|
||||
h1.flat-top.text-primary= "[ " + (progressTimestamps.length) + " ]"
|
||||
if (user && user.username !== username)
|
||||
a.btn.btn-lg.btn-block.btn-twitter.btn-link-social(href='/link/twitter')
|
||||
i.fa.fa-plus-square
|
||||
| Add them to my personal leaderboard
|
||||
|
||||
.spacer
|
||||
.hidden-xs.hidden-sm.col-md-12
|
||||
#cal-heatmap.d3-centered
|
||||
@ -79,23 +97,22 @@ block content
|
||||
h4.col-sm-6.text-left Current Streak: #{currentStreak} #{currentStreak + currentStreak === 1 ? ' day' : ' days'}
|
||||
|
||||
|
||||
if (challenges.length > 0)
|
||||
.col-sm-12
|
||||
table.table.table-striped
|
||||
thead
|
||||
tr
|
||||
th.col-xs-4 Challenge
|
||||
th.col-xs-2 Completed
|
||||
th.col-xs-6 Link
|
||||
for challenge in challenges
|
||||
tr
|
||||
td.col-xs-4
|
||||
a(href='/challenges/' + challenge.name, target='_blank')= challenge.name
|
||||
td.col-xs-2= moment(challenge.completedDate, 'x').format("MMM DD, YYYY")
|
||||
td.col-xs-6
|
||||
a(href=challenge.solution, target='_blank') View my solution
|
||||
if (user && user.username === username)
|
||||
br
|
||||
if (user && user.username == username || !isLocked)
|
||||
if (baseAndZip.length > 0)
|
||||
.col-sm-12
|
||||
table.table.table-striped
|
||||
thead
|
||||
tr
|
||||
th.col-xs-4 Project
|
||||
th.col-xs-2 Completed
|
||||
th.col-xs-6 Link
|
||||
for challenge in baseAndZip
|
||||
tr
|
||||
td.col-xs-4
|
||||
a(href='/challenges/' + challenge.name, target='_blank')= challenge.name
|
||||
td.col-xs-2= moment(challenge.completedDate, 'x').format("MMM DD, YYYY")
|
||||
td.col-xs-6
|
||||
a(href=challenge.solution, target='_blank') View my project
|
||||
if (bonfires.length > 0)
|
||||
.col-sm-12
|
||||
table.table.table-striped
|
||||
@ -106,9 +123,77 @@ block content
|
||||
th.col-xs-6 Solution
|
||||
for bonfire in bonfires
|
||||
tr
|
||||
td.col-xs-4
|
||||
a(href='/challenges/' + bonfire.name, target='_blank')= bonfire.name
|
||||
td.col-xs-4= bonfire.name
|
||||
td.col-xs-2= moment(bonfire.completedDate, 'x').format("MMM DD, YYYY")
|
||||
td.col-xs-6
|
||||
pre.wrappable= bonfire.solution
|
||||
br
|
||||
a(href='/challenges/' + bonfire.name + '?solution=' + encodeURIComponent(bonfire.solution), target='_blank') View my solution
|
||||
if (waypoints.length > 0)
|
||||
.col-sm-12
|
||||
table.table.table-striped
|
||||
thead
|
||||
tr
|
||||
th.col-xs-4 Waypoints
|
||||
th.col-xs-2 Completed
|
||||
th.col-xs-6 Solution
|
||||
for challenge in waypoints
|
||||
tr
|
||||
td.col-xs-4= challenge.name
|
||||
td.col-xs-2= moment(challenge.completedDate, 'x').format("MMM DD, YYYY")
|
||||
td.col-xs-6
|
||||
if (challenge.solution)
|
||||
a(href='/challenges/' + challenge.name + '?solution=' + encodeURIComponent(challenge.solution), target='_blank') View my solution
|
||||
else
|
||||
a(href='/challenges/' + challenge.name) View this challenge
|
||||
|
||||
if (user && user.username === username)
|
||||
.panel.panel-info
|
||||
.panel-heading.text-center Manage Your Account
|
||||
.panel-body
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='mailto:team@freecodecamp.com')
|
||||
span.ion-email
|
||||
| Email us at team@freecodecamp.com
|
||||
if (!user.isLocked)
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-info.btn-link-social(href='/toggle-lockdown-mode')
|
||||
span.ion-locked
|
||||
| Hide all my solutions from other people
|
||||
else
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-info.btn-link-social(href='/toggle-lockdown-mode')
|
||||
span.ion-unlocked
|
||||
| Let other people see all my solutions
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-warning.btn-link-social(href='/logout')
|
||||
span.ion-android-exit
|
||||
| Sign me out of Free Code Camp
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-danger.btn-link-social.confirm-deletion
|
||||
span.ion-trash-b
|
||||
| Delete my Free Code Camp account
|
||||
script.
|
||||
$('.confirm-deletion').on("click", function () {
|
||||
$('#modal-dialog').modal('show');
|
||||
});
|
||||
#modal-dialog.modal.animated.wobble
|
||||
.modal-dialog
|
||||
.modal-content
|
||||
.modal-header
|
||||
a.close(href='#', data-dismiss='modal', aria-hidden='true') ×
|
||||
h3 You don't really want to delete your account, do you?
|
||||
.modal-body
|
||||
p This will really delete all your data, including all your progress, news stories and brownie points.
|
||||
p We won't be able to recover any of it for you later, even if you change your mind.
|
||||
p If there's something we could do better, send us an email instead and we'll do our best:  
|
||||
a(href="mailto:team@freecodecamp.com") team@freecodecamp.com
|
||||
| .
|
||||
.modal-footer
|
||||
a.btn.btn-success.btn-block(href='#', data-dismiss='modal', aria-hidden='true')
|
||||
span.ion-happy
|
||||
| Nevermind, I don't want to delete all my progress
|
||||
.btn-spacer
|
||||
form(action='/account/delete', method='POST')
|
||||
input(type='hidden', name='_csrf', value=_csrf)
|
||||
button.btn.btn-danger.btn-block(type='submit')
|
||||
span.ion-trash-b
|
||||
| I am 100% sure I want to delete all my progress
|
||||
|
@ -131,7 +131,16 @@ block content
|
||||
span= challenge.title
|
||||
span.sr-only= " Incomplete"
|
||||
|
||||
//#announcementModal.modal(tabindex='-1')
|
||||
if (challengeBlock.completed === 100)
|
||||
.button-spacer
|
||||
.row
|
||||
.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.
|
||||
.hidden(id="#{challengeBlock.name}")
|
||||
script.
|
||||
var username = !{JSON.stringify(user && user.username || '')};
|
||||
var lastCompleted = !{JSON.stringify(lastCompleted || false)}
|
||||
// #announcementModal.modal(tabindex='-1')
|
||||
// .modal-dialog.animated.fadeInUp.fast-animation
|
||||
// .modal-content
|
||||
// .modal-header.challenge-list-header Add us to your LinkedIn profile
|
||||
|
@ -1,9 +0,0 @@
|
||||
//
|
||||
Created by nathanleniz on 5/19/15.
|
||||
|
||||
extends ../layout-wide
|
||||
block content
|
||||
script.
|
||||
var stuff = !{JSON.stringify(stuff)};
|
||||
var challengeMapWithIds = !{JSON.stringify(stuffWithIds)};
|
||||
|
@ -21,44 +21,6 @@ block content
|
||||
.innerMarginFix(style=' width: 99%')
|
||||
#testCreatePanel.well
|
||||
h3.text-center.negative-10= name
|
||||
.positive-15.positive-15-bottom
|
||||
h4.text-center.bonfire-flames Difficulty: 
|
||||
if (difficulty == "0")
|
||||
i.ion-ios-flame-outline
|
||||
i.ion-ios-flame-outline
|
||||
i.ion-ios-flame-outline
|
||||
i.ion-ios-flame-outline
|
||||
i.ion-ios-flame-outline
|
||||
if (difficulty == "1")
|
||||
i.ion-ios-flame
|
||||
i.ion-ios-flame-outline
|
||||
i.ion-ios-flame-outline
|
||||
i.ion-ios-flame-outline
|
||||
i.ion-ios-flame-outline
|
||||
if (difficulty == "2")
|
||||
i.ion-ios-flame
|
||||
i.ion-ios-flame
|
||||
i.ion-ios-flame-outline
|
||||
i.ion-ios-flame-outline
|
||||
i.ion-ios-flame-outline
|
||||
if (difficulty == "3")
|
||||
i.ion-ios-flame
|
||||
i.ion-ios-flame
|
||||
i.ion-ios-flame
|
||||
i.ion-ios-flame-outline
|
||||
i.ion-ios-flame-outline
|
||||
if (difficulty == "4")
|
||||
i.ion-ios-flame
|
||||
i.ion-ios-flame
|
||||
i.ion-ios-flame
|
||||
i.ion-ios-flame
|
||||
i.ion-ios-flame-outline
|
||||
if (difficulty == "5")
|
||||
i.ion-ios-flame
|
||||
i.ion-ios-flame
|
||||
i.ion-ios-flame
|
||||
i.ion-ios-flame
|
||||
i.ion-ios-flame
|
||||
.row
|
||||
.col-xs-12
|
||||
.bonfire-instructions
|
||||
@ -93,9 +55,6 @@ block content
|
||||
label.btn.btn-success#trigger-help-modal
|
||||
i.fa.fa-medkit
|
||||
| Help
|
||||
label.btn.btn-success#trigger-pair-modal
|
||||
i.fa.fa-user-plus
|
||||
| Pair
|
||||
label.btn.btn-success#trigger-issue-modal
|
||||
i.fa.fa-bug
|
||||
| Bug
|
||||
|
@ -52,7 +52,7 @@ block content
|
||||
script.
|
||||
var userLoggedIn = false;
|
||||
.button-spacer
|
||||
ul#testSuite.list-group
|
||||
#testSuite
|
||||
br
|
||||
script(type="text/javascript").
|
||||
$('#next-courseware-button').attr('disabled', 'disabled');
|
||||
|
@ -94,10 +94,6 @@ block content
|
||||
.row
|
||||
if (user)
|
||||
#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)
|
||||
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")
|
||||
i.fa.fa-twitter  
|
||||
= phrase
|
||||
else
|
||||
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge
|
||||
include ../partials/challenge-modals
|
||||
|
39
server/views/coursewares/showStep.jade
Normal file
39
server/views/coursewares/showStep.jade
Normal file
@ -0,0 +1,39 @@
|
||||
extends ../layout-wide
|
||||
block content
|
||||
.row
|
||||
.col-md-8.col-md-offset-2
|
||||
.jumbotron
|
||||
for step, index in description
|
||||
.thumbnail.challenge-step(class=index !== 0 ? 'hidden': '')
|
||||
img.gif-block.img-center.img-responsive.thumbnail(src='#{step[0]}' alt='#{step[1]}')
|
||||
.caption
|
||||
p.large-p= step[2]
|
||||
if step[3]
|
||||
a.btn.btn-block.btn-primary.challenge-step-btn-action(href='#{step[3]}' target='_blank') Go To Link
|
||||
if index + 1 === description.length
|
||||
.btn.btn-block.btn-primary.challenge-step-btn-finish(id='last' class=step[3] ? 'disabled' : '') Finish challenge
|
||||
else
|
||||
.btn.btn-block.btn-primary.challenge-step-btn-next(id='#{index}' class=step[3] ? 'disabled' : '') Go to my next step
|
||||
#challenge-step-modal.modal(tabindex='-1')
|
||||
.modal-dialog.animated.fadeIn.fast-animation
|
||||
.modal-content
|
||||
.modal-header.challenge-list-header= compliment
|
||||
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
||||
.modal-body
|
||||
.text-center
|
||||
#checkmark-container.row
|
||||
#challenge-checkmark.animated.zoomInDown.delay-half
|
||||
span.completion-icon.ion-checkmark-circled.text-primary
|
||||
.spacer
|
||||
.row
|
||||
if (user)
|
||||
#challenge-step-btn-submit.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to my next challenge (ctrl + enter)
|
||||
else
|
||||
a.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge
|
||||
script(src=rev('/js', 'commonFramework.js'))
|
||||
script.
|
||||
var common = common || { init: [] };
|
||||
common.challengeId = !{JSON.stringify(challengeId)};
|
||||
common.challengeName = !{JSON.stringify(name)};
|
||||
common.challengeType = 7;
|
||||
common.dashedName = !{JSON.stringify(dashedName || '')};
|
@ -69,12 +69,6 @@ block content
|
||||
a.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf) I've completed this challenge (ctrl + enter)
|
||||
script.
|
||||
$('#complete-courseware-editorless-dialog').bind('keypress', modalControlEnterHandler);
|
||||
|
||||
if (user.progressTimestamps.length > 2)
|
||||
.button-spacer
|
||||
a.btn.btn-lg.btn-block.btn-twitter(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" target="_blank")
|
||||
i.fa.fa-twitter  
|
||||
= phrase
|
||||
else
|
||||
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) I've completed this challenge (ctrl + enter)
|
||||
script.
|
||||
|
@ -27,9 +27,6 @@ block content
|
||||
.btn.btn-success.btn-big#trigger-help-modal
|
||||
i.fa.fa-medkit
|
||||
| Help
|
||||
.btn.btn-success.btn-big#trigger-pair-modal
|
||||
i.fa.fa-user-plus
|
||||
| Pair
|
||||
.btn.btn-success.btn-big#trigger-issue-modal
|
||||
i.fa.fa-bug
|
||||
| Bug
|
||||
|
@ -1,17 +1,3 @@
|
||||
#pair-modal.modal(tabindex='-1')
|
||||
.modal-dialog.animated.fadeIn.fast-animation
|
||||
.modal-content
|
||||
.modal-header.challenge-list-header Ready to pair program?
|
||||
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
||||
.modal-body.text-center
|
||||
h3 This will take you to our pair programming room where you can request a pair.
|
||||
h3 You'll need  
|
||||
a(href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-install-Screenhero' target='_blank') Screenhero
|
||||
| .
|
||||
h3 Other campers may then message you about pair programming.
|
||||
a.btn.btn-lg.btn-primary.btn-block.close-modal(href='https://gitter.im/FreeCodeCamp/LetsPair', target='_blank') Take me to the pair programming room
|
||||
a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
|
||||
|
||||
#issue-modal.modal(tabindex='-1')
|
||||
.modal-dialog.animated.fadeIn.fast-animation
|
||||
.modal-content
|
||||
@ -49,5 +35,5 @@
|
||||
a.btn.btn-lg.btn-primary.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
|
||||
script.
|
||||
if (typeof localStorage !== 'undefined') {
|
||||
localStorage.setItem('currentDashedName', dashedName);
|
||||
localStorage.setItem('currentDashedName', typeof common !== 'undefined' && common.dashedName || dashedName || '');
|
||||
}
|
||||
|
@ -22,31 +22,8 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height
|
||||
li
|
||||
a.btn.signup-btn.signup-btn-nav(href='/login') Sign in
|
||||
else
|
||||
if user.isGithubCool
|
||||
li
|
||||
a(href='/' + user.username) [ #{user.progressTimestamps.length} ]
|
||||
.hidden-xs.hidden-sm
|
||||
a(href='/' + user.username)
|
||||
img.profile-picture.float-right(src='#{user.picture}')
|
||||
else
|
||||
li
|
||||
a(href='/account') [ #{user.progressTimestamps.length} ]
|
||||
.hidden-xs.hidden-sm
|
||||
a(href='/account')
|
||||
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,189 +0,0 @@
|
||||
extends ../layout
|
||||
block content
|
||||
.jumbotron
|
||||
h2.text-center Scroll down and follow along with this 8-minute guide.
|
||||
br
|
||||
| It will help you get the most out of Free Code Camp.
|
||||
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive.thumbnail(src='http://i.imgur.com/RlEk2IF.jpg' alt="a picture of Free Code Camp's 4 benefits: Get connected, Learn JavaScript, Build your Portfolio, Help nonprofits")
|
||||
.caption
|
||||
p.large-p Welcome to Free Code Camp. We're an open source community of busy people who learn to code and build projects for nonprofits.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/pYsTbjI.jpg' alt='a screenshot of our curriculum alongside a screenshot of our chat room.')
|
||||
.caption
|
||||
p.large-p 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.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/D7Y5luw.jpg' alt='A graph of the rate of job growth against growth in computer science degree graduates. There are 1.4 million jobs and only 400 million people to fill them.')
|
||||
.caption
|
||||
p.large-p There are thousands of coding jobs currently going unfilled, and the demand for coders grows every year. If you want a coding job, we can help prepare you to get one.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/dLx8nrg.jpg' alt='An illustration showing that you will learn HTML5, CSS3, JavaScript, Databases, Git, Node.js, Angular.js and Agile.')
|
||||
.caption
|
||||
p.large-p During the first 800 hours of Free Code Camp, you'll learn technologies like HTML5, Node.js and databases.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/yXyxbDd.jpg' alt='a screen shot of our nonprofit project directory.')
|
||||
.caption
|
||||
p.large-p During the last 800 hours, 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.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/EAR7Lvh.jpg' alt='a screenshot of our one of our Gitter chat rooms.')
|
||||
.caption
|
||||
p.large-p 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.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/FEImaEN.gif' alt='A gif showing you to click the link below to go to GitHub. Fill in the necessary fields and click submit.')
|
||||
.caption
|
||||
p.large-p Try this: 
|
||||
a(href='https://github.com/join' target='_blank') Create an account with GitHub
|
||||
| . Be sure to use your real email address - GitHub will keep this private.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/ALN6zPK.gif' alt='A gif showing you how to click the profile image in the upper right hand corner of GitHub. Upload a photo of yourself or you will continue to use the automatically generated pixel art. Then fill in the remaining form fields and click submit.')
|
||||
.caption
|
||||
p.large-p Try this: 
|
||||
| Click the pixel art in the upper right hand corner of GitHub, then choose settings. Upload a picture of yourself. A picture of your face works best. This is how your fellow campers will see you in our chat rooms, so put your best foot forward. You can add your city and your name if you want.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/OXL3G3n.gif' alt="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.")
|
||||
.caption
|
||||
p.large-p Try this: 
|
||||
a(href='//github.com/freecodecamp/freecodecamp' target='_blank') Go to Free Code Camp's open-source repository
|
||||
|  and "star" it. "Starring" is the GitHub equivalent of "liking" something.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/EZHzKCV.gif' alt='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.')
|
||||
.caption
|
||||
p.large-p Try this: 
|
||||
| Now that you have a GitHub account, you can 
|
||||
a(href='https://gitter.im/FreeCodeCamp/FreeCodeCamp' target='_blank') 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.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/Ecs5XAd.gif' alt='A gif showing you how you can click the settings button in the upper right hand corner and modify your notification settings.')
|
||||
.caption
|
||||
p.large-p Try this: 
|
||||
| Our chat rooms are extremely active. You should change your settings so you're only notified if someone mentions you.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/T0bGJPe.gif' alt='A gif showing how you can click on a user profile image to initiate a private message with that user.')
|
||||
.caption
|
||||
p.large-p Please note that all of our chat rooms are visible to the public. If you need to share sensitive information, such as an email address or phone number, do it in a private message.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/vDTMJSh.gif' alt='A gif showing that you can tab back and forth between challenges and our chat rooms.')
|
||||
.caption
|
||||
p.large-p Keep our chat room open while you work through our challenges. That way, you can ask for help if you get stuck. You can also socialize with other campers when you feel like taking a break.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/SLQ27Gr.gif' alt='A gif showing how you can click the link below to download a native chat room app for your computer.')
|
||||
.caption
|
||||
p.large-p You can also 
|
||||
a(href='https://gitter.im/apps' target='_blank') download the chat room app
|
||||
|  to your computer or phone.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/DoOqkNW.gif' alt='A gif showing how you can click the "Wiki" button in your upper-right corner to access the wiki.')
|
||||
.caption
|
||||
p.large-p Try this: Click the "Wiki" button in your upper right hand corner. Our community has contributed lots of useful information to this searchable wiki.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/FkEzbto.gif' alt='A gif showing how you can click your profile image in your upper right hand corner to access the account page and connect GitHub.')
|
||||
.caption
|
||||
p.large-p Try this: Check out your portfolio page. Click your picture your upper right hand corner. To activate your portfolio page, you'll need to link your GitHub account with Free Code Camp.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/WKzEr1q.gif' alt='A gif showing how you can access your profile page and hover over different days to see how many brownie points you got on those days.')
|
||||
.caption
|
||||
p.large-p Your portfolio page 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.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/nmSiMy1.gif' alt='A gif showing how you can access our Camper News page and click the "upvote" button to upvote a story.')
|
||||
.caption
|
||||
p.large-p Try this: 
|
||||
| Click the "News" button in your upper right hand corner. You can browse links on Camper News and upvote ones that you enjoy.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/Elb3dfj.jpg' alt='A picture of some of our campers meeting in a local cafe. 3 men and 3 women are sitting around a table with laptops out, and are smiling and coding.')
|
||||
.caption
|
||||
p.large-p Our Campsites help you code with campers in your city. You can coordinate study groups or attend local coding events together.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/EZHzKCV.gif' alt="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.")
|
||||
.caption
|
||||
p.large-p Try this: 
|
||||
a(href='https://github.com/FreeCodeCamp/freecodecamp/wiki/List-of-Free-Code-Camp-city-based-Campsites' target='_blank') Find your city on this list
|
||||
| . Click the "Join group" button to join your city's Facebook group. If your city isn't on this list, 
|
||||
a(href='https://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-create-a-Campsite-for-your-city' target='_blank') follow these directions to create a Facebook group for your city
|
||||
| .
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/3AgvJQg.gif' alt="A gif showing how click the link below, find your city, and click the \"Gitter\" button to join your city's Gitter chat room")
|
||||
.caption
|
||||
p.large-p Try this: 
|
||||
a(href='https://github.com/FreeCodeCamp/freecodecamp/wiki/List-of-Free-Code-Camp-city-based-Campsites' target='_blank') Go back to our list of Campsites 
|
||||
| and click "Gitter" to join your city's chat room.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/P7qfJXt.gif' alt='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.')
|
||||
.caption
|
||||
p.large-p You can 
|
||||
a(href='https://www.linkedin.com/profile/edit-education?school=Free+Code+Camp' target='_blank') 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".
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/EWWZBag.jpg' alt='An image with the text \"1. Read the error 2. Search Google 3. Ask for help.')
|
||||
.caption
|
||||
p.large-p Let's cover one last thing before you start working through our challenges: how to get help. Any time you get stuck or don't know what to do next: Read-Search-Ask.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/99BfAcK.jpg' alt='An image showing jQuery documentation')
|
||||
.caption
|
||||
p.large-p First, read the documentation or error message. A key skill that good coders have is the ability to interpret and then follow instructions.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/GxvrsFb.gif' alt="A gif showing you how to do an advanced Google search. First, we enter the query \"jquery doesn't run when my page loads\". Then we click search tools button and change the \"Any time\" select box to \"within the last year\". Then we click on a result and read through the article and find our answer.")
|
||||
.caption
|
||||
p.large-p If that didn't help, search Google. Good Google queries take a lot of practice. When you search Google, you usually want to include the language or framework you're using. You also want to limit the results to a recent period.
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/LZYU7p2.gif' alt="A gif showing us following the link below to go to the help chat room and ask \"jquery doesn't run when my page loads\".")
|
||||
.caption
|
||||
p.large-p If that didn't help, ask your friends. If you have trouble, you can ask your fellow campers in our 
|
||||
a(href='https://gitter.im/FreeCodeCamp/Help' target='_blank') help chat room
|
||||
| .
|
||||
|
||||
.big-spacer
|
||||
.thumbnail
|
||||
img.gif-block.img-center.img-responsive(src='http://i.imgur.com/WsfzvVo.gif' alt='A gif showing us clicking the \"map\" button in our upper right hand corner and browsing our challenge map.')
|
||||
.caption
|
||||
p.large-p Now you're ready to start coding! Click the "Map" button in your upper right hand corner. Our map shows all our coding challenges. We recommend that you complete these from top to bottom, at a sustainable pace.
|
@ -1,3 +0,0 @@
|
||||
extends ../layout
|
||||
block content
|
||||
iframe(src="https://docs.google.com/forms/d/1b8JYvQ5ibdwwC0owQ9e9EMRlg22O2wbJgqMvPjiILqs/viewform?embedded=true", frameborder="0", marginheight="0", marginwidth="0", width='102%', height=2100, scrolling="no") Loading...
|
@ -13,15 +13,6 @@
|
||||
.visible-xs
|
||||
.button-spacer
|
||||
|
||||
//.spacer
|
||||
//.row
|
||||
// .col-xs-12.col-sm-8.col-sm-offset-2.well
|
||||
// h4.text-center Which other free resources do you use?
|
||||
// img.img-responsive(src='https://www.evernote.com/l/AHRNhlwViM1Kh5qCm6iy7MSWrbdyxYbRkWkB/image.png')
|
||||
// p Link us to your favorite free coding resources.
|
||||
// p Use the headline: "Awesome Free Resource: (the name of the book, podcast, or video series)". We'll publish a list of the 25 most-upvoted resources (and the campers who submitted them) in Wednesday's blog post, and in an upcoming Field Guide article. Also - as always - you'll get 1 point every time someone upvotes your post.
|
||||
//.spacer
|
||||
|
||||
#search-results
|
||||
|
||||
.spacer
|
||||
@ -58,6 +49,9 @@ script.
|
||||
})
|
||||
.done(function (data, textStatus, xhr) {
|
||||
$('#search-results').empty();
|
||||
var spacer = document.createElement('div');
|
||||
$(spacer).html("<div class='spacer'></div>");
|
||||
$(spacer).appendTo($('#search-results'));
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var div = document.createElement('div');
|
||||
var linkedName = getLinkedName(data[i].storyLink);
|
||||
@ -117,7 +111,7 @@ script.
|
||||
$(div).appendTo($('#search-results'));
|
||||
}
|
||||
var hr = document.createElement("div");
|
||||
$(hr).html("<h3 class='negative-35 text-center text-success dotted-underline'><em>End search results</em></h3>")
|
||||
$(hr).html("<h3 class='text-center text-success dotted-underline'><em>End search results</em></h3>")
|
||||
$(hr).appendTo($('#search-results'));
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user