diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ba4e245107..9511ab33cc 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,2 +1,12 @@
We're getting a lot of duplicate issues and bug reports that just aren't reporting actual bugs.
So, before you submit your issue, please read the [Help I've Found a Bug](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Help-I've-Found-a-Bug) wiki page.
+
+We welcome pull requests from Free Code Camp campers (our students) and seasoned JavaScript developers alike! Follow these steps to contribute:
+
+1. Check our [public Waffle Board](https://waffle.io/freecodecamp/freecodecamp).
+2. Pick an issue that nobody has claimed and start working on it. If your issue isn't on the board, open an issue. If you think you can fix it yourself, start working on it. Feel free to ask for help in our [Gitter](https://gitter.im/FreeCodeCamp/FreeCodeCamp).
+3. Fork the project ([Need help with forking a project?](https://help.github.com/articles/fork-a-repo/)). You'll do all of your work on your forked copy.
+4. Create a branch specific to the issue or feature you are working on. Push your work to that branch. ([Need help with branching?](https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches))
+5. Name the branch something like `fix/xxx` or `feature/xxx` where `xxx` is a short description of the changes or feature you are attempting to add. For example `fix/email-login` whould be a branch where I fix something specific to email login.
+6. You should have [ESLint running in your editor](http://eslint.org/docs/user-guide/integrations.html), and it will highlight anything doesn't conform to [Free Code Camp's JavaScript Style Guide](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Free-Code-Camp-JavaScript-Style-Guide) (you can find a summory of those rules [here](https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/.eslintrc). Please do not ignore any linting errors, as they are meant to **help** you and to ensure a clean and simple code base. Make sure none of your JavaScript is longer than 80 characters per line.
+7. Once your code is ready, submit a pull request from your branch to Free Code Camp's `staging` branch. We'll do a quick code review and give you feedback, then iterate from there. It may also be helpful to read about git [rebasing](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/git-rebase).
diff --git a/README.md b/README.md
index dba5013540..7590eccafe 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-
+
[](https://waffle.io/freecodecamp/freecodecamp/metrics)
@@ -35,10 +35,9 @@ We welcome pull requests from Free Code Camp campers (our students) and seasoned
2. Pick an issue that nobody has claimed and start working on it. If your issue isn't on the board, open an issue. If you think you can fix it yourself, start working on it. Feel free to ask for help in our [Gitter](https://gitter.im/FreeCodeCamp/FreeCodeCamp).
3. Fork the project ([Need help with forking a project?](https://help.github.com/articles/fork-a-repo/)). You'll do all of your work on your forked copy.
4. Create a branch specific to the issue or feature you are working on. Push your work to that branch. ([Need help with branching?](https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches))
-5. Name the branch something like `user-xxx` where user is your username and xxx is the issue number you are addressing.
-6. You should have [ESLint running in your editor](http://eslint.org/docs/user-guide/integrations.html), and it will highlight anything doesn't conform to [AirBnB's JavaScript Style Guide](https://github.com/airbnb/javascript). Please do not ignore any linting errors, as they are meant to **help** you. Make sure none of your JavaScript is longer than 80 characters per line.
-7. Once your code is ready, submit a pull request from your branch to Free Code Camp's `staging` branch. We'll do a quick code review and give you feedback, then iterate from there.
-8. Once we accept one of your pull requests, one of the project owners (currently @quincylarson, @terakilobyte, and @berkeleytrue) will add you to our camper contributor group.
+5. Name the branch something like `fix/xxx` or `feature/xxx` where `xxx` is a short description of the changes or feature you are attempting to add. For example `fix/email-login` whould be a branch where I fix something specific to email login.
+6. You should have [ESLint running in your editor](http://eslint.org/docs/user-guide/integrations.html), and it will highlight anything doesn't conform to [Free Code Camp's JavaScript Style Guide](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Free-Code-Camp-JavaScript-Style-Guide) (you can find a summory of those rules [here](https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/.eslintrc). Please do not ignore any linting errors, as they are meant to **help** you and to ensure a clean and simple code base. Make sure none of your JavaScript is longer than 80 characters per line.
+7. Once your code is ready, submit a pull request from your branch to Free Code Camp's `staging` branch. We'll do a quick code review and give you feedback, then iterate from there. It may also be helpful to read about git [rebasing](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/git-rebase).
Prerequisites
-------------
@@ -70,10 +69,9 @@ touch .env
npm install -g gulp
```
-Edit your .env file with the following API keys accordingly (if you only use email login, only the MONGOHQ_URL, SESSION_SECRET, MANDRILL_USER and MANDRILL_PASSWORD fields are necessary. Keep in mind if you want to use more services you'll have to get your own API keys for those services.
+Edit your `.env` file with the following API keys accordingly (if you only use email login, only the `MONGOHQ_URL`, `SESSION_SECRET`, `MANDRILL_USER` and `MANDRILL_PASSWORD` fields are necessary. Keep in mind if you want to use more services you'll have to get your own API keys for those services.
```
-
MONGOHQ_URL='mongodb://localhost:27017/freecodecamp'
FACEBOOK_ID=stuff
@@ -106,11 +104,9 @@ COOKIE_SECRET='this is a secret'
PEER=stuff
DEBUG=true
-
```
```bash
-
# Start the mongo server
mongod
@@ -124,7 +120,6 @@ node seed/
# start the application
gulp
-
```
License
diff --git a/client/commonFramework.js b/client/commonFramework.js
index 45589df873..be5be4533c 100644
--- a/client/commonFramework.js
+++ b/client/commonFramework.js
@@ -200,7 +200,7 @@ var myCodeMirror = editor;
editor.on('keyup', function() {
clearTimeout(codeStorage.updateTimeoutId);
codeStorage.updateTimeoutId = setTimeout(
- codeStorage.updateStorage,
+ codeStorage.updateStorage.bind(codeStorage),
codeStorage.updateWait
);
});
@@ -421,7 +421,8 @@ function showCompletion() {
);
var bonfireSolution = myCodeMirror.getValue();
var didCompleteWith = $('#completed-with').val() || null;
- $('#complete-courseware-dialog').modal('show').focus();
+ $('#complete-courseware-dialog').modal('show');
+ $('#complete-courseware-dialog .modal-header').click();
$('#submit-challenge').click(function(e) {
e.preventDefault();
diff --git a/client/main.js b/client/main.js
index 8a72664bbf..bbd69857d0 100644
--- a/client/main.js
+++ b/client/main.js
@@ -66,10 +66,26 @@ $(document).ready(function() {
}, 200);
});
+ $('#search-issue').unbind('click');
+ $('#search-issue').on('click', function() {
+ var queryIssue = window.location.href.toString();
+ window.open('https://github.com/FreeCodeCamp/FreeCodeCamp/issues?q=is:issue is:all '+ queryIssue.substr(queryIssue.lastIndexOf('challenges/') + 11).replace('/', ''), '_blank');
+ });
+
+ $('#help-ive-found-a-bug-wiki-article').unbind('click');
+ $('#help-ive-found-a-bug-wiki-article').on('click', function() {
+ var queryIssue = window.location.href.toString();
+ window.open("https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Help-I've-Found-a-Bug", '_blank');
+ });
+
$('#report-issue').unbind('click');
$('#report-issue').on('click', function() {
+ var textMessage = 'https://github.com/freecodecamp/freecodecamp/issues/new?&body=Challenge ' + window.location.href + ' has an issue.';
+ textMessage += ' User Agent is:
' + navigator.userAgent + '
.';
+ textMessage += ' Please describe how to reproduce this issue, and include links to screenshots if possible.%0A%0A';
+ textMessage = textMessage.replace(';', ','); //GitHub cuts User Agent text because of ';' symbol so I just replace it with ','
$('#issue-modal').modal('hide');
- window.open('https://github.com/freecodecamp/freecodecamp/issues/new?&body=Challenge '+ window.location.href +' has an issue. Please describe how to reproduce it, and include links to screenshots if possible.', '_blank')
+ window.open(textMessage, '_blank');
});
$('#completed-courseware').unbind('click');
diff --git a/package.json b/package.json
index d35a1c4cf9..44833cc65d 100644
--- a/package.json
+++ b/package.json
@@ -14,16 +14,6 @@
"test": "mocha --compilers js:babel/register"
},
"license": "(BSD-3-Clause AND CC-BY-SA-4.0)",
- "contributors": [
- {
- "name": "Quincy Larson",
- "url": "https://github.com/QuincyLarson"
- },
- {
- "name": "Nathan Leniz",
- "url": "https://github.com/terakilobyte"
- }
- ],
"dependencies": {
"accepts": "~1.2.5",
"async": "~0.9.0",
diff --git a/seed/challenges/advanced-bonfires.json b/seed/challenges/advanced-bonfires.json
index 62a5f2cd3c..b20b350c9b 100644
--- a/seed/challenges/advanced-bonfires.json
+++ b/seed/challenges/advanced-bonfires.json
@@ -80,10 +80,10 @@
"sym([1, 2, 3], [5, 2, 1, 4]);"
],
"tests": [
- "assert.deepEqual(sym([1, 2, 3], [5, 2, 1, 4]), [3, 5, 4], 'should return an array of unique values');",
- "assert.deepEqual(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'should return the symmetric difference of the given arrays');",
- "assert.deepEqual(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], 'should return an array of unique values');",
- "assert.deepEqual(sym([1, 1]), [1], 'should return an array of unique values');"
+ "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');"
],
"MDNlinks": [
"Array.reduce()",
diff --git a/seed/challenges/automated-testing-and-debugging.json b/seed/challenges/automated-testing-and-debugging.json
index 9cf677a024..2fbb5352d7 100644
--- a/seed/challenges/automated-testing-and-debugging.json
+++ b/seed/challenges/automated-testing-and-debugging.json
@@ -28,9 +28,9 @@
"title":"Using typeof",
"difficulty":0,
"description":[
- "typeof
is a useful method that we can use to check the type of a variable.",
- "One thing to be careful of is that an array has the type objects.",
- "Try using each of these to see the types they have.",
+ "You can use typeof
to check the data structure
, or type, of a variable.",
+ "Note that in JavaScript, arrays are technically a type of object.",
+ "Try using typeof
on each of the following to see which types they have.",
"console.log(typeof(\"\"));
",
"console.log(typeof(0));
",
"console.log(typeof([]));
",
diff --git a/seed/challenges/basejumps.json b/seed/challenges/basejumps.json
index c5d3e871c5..bf872054bf 100644
--- a/seed/challenges/basejumps.json
+++ b/seed/challenges/basejumps.json
@@ -54,7 +54,7 @@
"Run the following command in a Cloud9 terminal prompt tab: npm install grunt-contrib-imagemin --save-dev && npm install --save-dev && heroku login
. At this point, the terminal will prompt you to log in to Heroku from the command line.",
"Now run yo angular-fullstack:heroku
. You can choose a name for your Heroku project, or Heroku will create a random one for you. You can choose whether you want to deploy to servers the US or the EU.",
"Set the config flag for your Heroku environment and add MongoLab for your MongoDB instance by running the following command: cd ~/workspace/dist && heroku config:set NODE_ENV=production && heroku addons:create mongolab
.",
- "As you build your app, you should frequently commit changes to your codebase. Make sure you're in the ~/workspace
directory by running cd ~/workspace
. Then you can this code to stage the changes to your changes and commit them: git commit -am \"your commit message\"
. Note that you should replace \"your commit message\" with a short summary of the changes you made to your code, such as \"added a records controller and corresponding routes\".",
+ "As you build your app, you should frequently commit changes to your codebase. Make sure you're in the ~/workspace
directory by running cd ~/workspace
. Then you can use this code to stage the changes to your changes and commit them: git commit -am \"your commit message\"
. Note that you should replace \"your commit message\" with a short summary of the changes you made to your code, such as \"added a records controller and corresponding routes\".",
"You can push these new commits to GitHub by running git push origin master
, and to Heroku by running grunt --force && grunt buildcontrol:heroku
.",
"If you need further guidance on using Yeoman Angular-Fullstack Generator, check out: https://github.com/clnhll/guidetobasejumps.",
"Now you're ready to move on to your first Basejump. Click the \"I've completed this challenge\" and move on."
diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json
index 1161baa984..250e4a9a2a 100644
--- a/seed/challenges/basic-bonfires.json
+++ b/seed/challenges/basic-bonfires.json
@@ -90,7 +90,8 @@
"expect(factorialize(5)).to.be.a(\"Number\");",
"expect(factorialize(5)).to.equal(120);",
"expect(factorialize(10)).to.equal(3628800);",
- "expect(factorialize(20)).to.equal(2432902008176640000);"
+ "expect(factorialize(20)).to.equal(2432902008176640000);",
+ "expect(factorialize(0)).to.equal(1);"
],
"difficulty": "1.02",
"description": [
@@ -530,11 +531,11 @@
},
{
"id": "adf08ec01beb4f99fc7a68f2",
- "title": "Falsey Bouncer",
+ "title": "Falsy Bouncer",
"difficulty": "1.50",
"description": [
- "Remove all falsey values from an array.",
- "Falsey values in javascript are false, null, 0, \"\", undefined, and NaN.",
+ "Remove all falsy values from an array.",
+ "Falsy values in javascript are false, null, 0, \"\", undefined, and NaN.",
"Remember to use Read-Search-Ask if you get stuck. Write your own code."
],
"challengeSeed": [
@@ -546,9 +547,9 @@
"bouncer([7, 'ate', '', false, 9]);"
],
"tests": [
- "assert.deepEqual(bouncer([7, 'ate', '', false, 9]), [7, 'ate', 9], 'should remove falsey values');",
- "assert.deepEqual(bouncer(['a', 'b', 'c']), ['a', 'b', 'c'], 'should return full array if no falsey elements');",
- "assert.deepEqual(bouncer([false, null, 0]), [], 'should return empty array if all elements are falsey');"
+ "assert.deepEqual(bouncer([7, 'ate', '', false, 9]), [7, 'ate', 9], 'should remove falsy values');",
+ "assert.deepEqual(bouncer(['a', 'b', 'c']), ['a', 'b', 'c'], 'should return full array if no falsy elements');",
+ "assert.deepEqual(bouncer([false, null, 0, NaN, undefined, '']), [], 'should return empty array if all elements are falsy');"
],
"MDNlinks": [
"Boolean Objects",
@@ -572,8 +573,8 @@
"title": "Where art thou",
"difficulty": "1.55",
"description": [
- "Make a function that looks through an array (first argument) and returns an array of all objects that have equivalent property and value pair (second argument).",
- "For example, if the first argument is [{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }]
, and the second argument is { last: 'Capulet' }
, then you must return the 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.",
+ "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 [{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }]
, and the second argument is { last: 'Capulet' }
, 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 Read-Search-Ask if you get stuck. Write your own code."
],
"challengeSeed": [
diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json
index eec991ed7c..b42dcf7db4 100644
--- a/seed/challenges/basic-javascript.json
+++ b/seed/challenges/basic-javascript.json
@@ -221,7 +221,7 @@
],
"tests": [
"assert(lastLetterOfLastName === \"e\", 'lastLetterOfLastName should be \"e\"');",
- "assert(editor.getValue().match(/\\.length/g), 'You have to use .length
to get the last letter');"
+ "assert(editor.getValue().match(/\\.length/g).length === 2, 'You have to use .length
to get the last letter');"
],
"challengeSeed": [
"var firstName = \"Ada\";",
@@ -249,11 +249,11 @@
"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 var firstName = \"Charles\"
string by using firstName[firstName.length - 3]
.",
"Use bracket notation
to find the second-to-last character in the lastName
string.",
- "Try looking at the lastLetterOfLastName
variable declaration if you get stuck."
+ "Try looking at the thirdToLastLetterOfFirstName
variable declaration if you get stuck."
],
"tests": [
"assert(secondToLastLetterOfLastName === 'c', 'secondToLastLetterOfLastName should be \"c\".');",
- "assert(editor.getValue().match(/\\.length/g), 'You have to use .length to get the third last letter.');"
+ "assert(editor.getValue().match(/\\.length/g).length === 2, 'You have to use .length to get the second last letter.');"
],
"challengeSeed": [
"var firstName = \"Ada\";",
@@ -283,7 +283,7 @@
"Replace the 0
with the correct number so you can get the result mentioned in the comment."
],
"tests": [
- "assert((function(){if(sum === 20 && editor.getValue().match(/\\+/g)){return true;}else{return false;}})(), 'Make the variable sum
equal 20');"
+ "assert((function(){if(sum === 20 && editor.getValue().match(/\\+/g).length >= 2){return true;}else{return false;}})(), 'Make the variable sum
equal 20.');"
],
"challengeSeed": [
"var sum = 10 + 0; //make this equal to 20 by changing the 0 into the appropriate number.",
@@ -352,7 +352,7 @@
"Replace the 0
with the correct number so you can get the result mentioned in the comment."
],
"tests": [
- "assert((function(){if(quotient === 2 && editor.getValue().match(/\\//g)){return true;}else{return false;}})(), 'Make the variable quotient
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;}})(), 'Make the variable quotient
equal 2.');"
],
"challengeSeed": [
"var quotient = 66 / 0; //make this equal to 2 by changing the 0 into the appropriate number.",
@@ -422,7 +422,7 @@
"description": [
"With JavaScript array
variables, we can store several pieces of data in one place.",
"You start an array declaration with an opening bracket, end it with a closing bracket, and put a comma between each entry, like this: var sandwich = [\"peanut butter\", \"jelly\", \"bread\"]
.",
- "Now let's create a new array called myArray
that contains both a string
and a number
.",
+ "Now let's create a new array called myArray
that contains both a string
and a number
(in that order).",
"Refer to the comments if you get stuck."
],
"tests": [
@@ -604,7 +604,7 @@
"difficulty": "9.9817",
"description": [
"pop()
always removes the last element of an array. What if you want to remove the first? That's where .shift()
comes in.",
- "Take the myArray array and shift()
the first value off of it."
+ "Take the myArray array and shift()
the first value off of it. Set myRemoved
to the first value of myArray
using shift()
."
],
"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), 'myArray should only have the last two values left([23, [\"dog\", 3]])');",
@@ -638,7 +638,7 @@
"Let's take the code we had last time and unshift
this value to the start: \"Paul\"
"
],
"tests": [
- "assert((function(d){if(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), 'myArray 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), 'myArray
should now have [\"Paul\", 23, [\"dog\", 3]]).');"
],
"challengeSeed": [
"var ourArray = [\"Stimpson\", \"J\", [\"cat\"]];",
@@ -824,8 +824,15 @@
" ourArray.push(i);",
"}",
"var myArray = [];",
- "//Push the numbers zero through four to myArray using a \"for loop\" like above.",
"",
+ "// Only change code below this line.",
+ "",
+ "// Push the numbers zero through four to myArray using a \"for loop\" like above.",
+ "",
+ "// Only change code above this line.",
+ "// We use this function to show you the value of your variable in your output box.",
+ "// You'll learn about functions soon.",
+ "if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}",
""
],
"type": "waypoint",
@@ -852,8 +859,14 @@
],
"challengeSeed":[
"var myArray = [];",
- "//Push the numbers zero through four to myArray",
+ "// Only change code below this line.",
"",
+ "// Push the numbers zero through four to myArray using a \"while loop\".",
+ "",
+ "// Only change code above this line.",
+ "// We use this function to show you the value of your variable in your output box.",
+ "// You'll learn about functions soon.",
+ "if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}",
""
],
"type": "waypoint",
@@ -936,6 +949,7 @@
"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');"
],
"challengeSeed":[
@@ -973,23 +987,25 @@
"Create an if-else statement
to return heads
if the flip var is zero, or else return tails
if it's not."
],
"tests":[
- "assert((function(){if(myFunction() === \"heads\" || myFunction() === \"tails\"){return true;}else{return false;}})(), 'myFunction should either return heads or tails');",
- "assert(editor.getValue().match(/if/g).length >= 3, '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;}})(), 'myFunction
should either return heads
or tails
.');",
+ "assert((function(){var result = myFunction();if(result === 'heads' && flip === 0 || result === 'tails' && flip !== 0){return true;} else {return false;}})(), 'myFunction
should return heads
when flip equals 0 and tails
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.');"
],
"challengeSeed":[
+ "var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;",
"function myFunction(){",
- " var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;",
" // Create an if-else statement here to return \"heads\" if flip is 0. Otherwise return \"tails\".",
"",
" // Only change code below this line.",
"",
"",
+ "",
+ " // Only change code above this line.",
"}",
"",
- "// Only change code above this line.",
"// We use this function to show you the value of your variable in your output box.",
- "(function(){return myFunction();})();"
+ "var result = myFunction();if(typeof(flip) !== \"undefined\" && typeof(flip) === \"number\" && typeof(result) !== \"undefined\" && typeof(result) === \"string\"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}"
],
"type": "waypoint",
"challengeType": 1
@@ -1006,7 +1022,7 @@
"g
means that we want to search the entire string for this pattern instead of just the first match.",
"i
means that we want to ignore the case (uppercase or lowercase) when searching for the pattern.",
"Regular expressions
are written by surrounding the pattern with a /
symbol.",
- "Let's try selecting all the occurrences of the word and
in the string George Boole and Alan Turing went to the shop and got some milk
. We can do this by replacing the ...
part of our regular expression with the current regular expression
with the word and
."
+ "Let's try selecting all the occurrences of the word and
in the string George Boole and Alan Turing went to the shop and got some milk
. We can do this by replacing the .
part of our regular expression with the current regular expression
with the word and
."
],
"tests":[
"assert(test==2, 'Your regular expression
should find two occurrences of the word and
');",
@@ -1093,7 +1109,7 @@
"title": "Invert Regular Expression Matches with JavaScript",
"difficulty":"9.987",
"description":[
- "Use /\\S/gi;
to match everything that isn't a space in the string.",
+ "Use /\\S/gi
to match everything that isn't a space in the string.",
"You can invert any match by using the uppercase version of the selector \\s
versus \\S
for example."
],
"tests":[
diff --git a/seed/challenges/bootstrap.json b/seed/challenges/bootstrap.json
index 58fc65c721..196ecb08c4 100644
--- a/seed/challenges/bootstrap.json
+++ b/seed/challenges/bootstrap.json
@@ -909,19 +909,11 @@
"challengeSeed": [
"",
"",
"",
"
Click here for cat photos.
", - "", - "left-well
. Give the well on the right the id
of right-well
."
],
"tests": [
- "assert($(\"#left-well\") && $(\"#left-well\").length > 0, 'Give your left well
the id of left-well
.')",
- "assert($(\"#right-well\") && $(\"#right-well\").length > 0, 'Give your right well
the id of right-well
.')"
+ "assert($(\".col-xs-6\").children(\"#left-well\") && $(\".col-xs-6\").children(\"#left-well\").length > 0, 'Give your left well
the id of left-well
.')",
+ "assert($(\".col-xs-6\").children(\"#right-well\") && $(\".col-xs-6\").children(\"#right-well\").length > 0, 'Give your right well
the id of right-well
.')"
],
"challengeSeed": [
"target1
and ending with target6
."
],
"tests": [
- "assert($(\"#target1\") && $(\"#target1\").length > 0, 'One button
element should have the id target1
.')",
- "assert($(\"#target2\") && $(\"#target2\").length > 0, 'One button
element should have the id target2
.')",
- "assert($(\"#target3\") && $(\"#target3\").length > 0, 'One button
element should have the id target3
.')",
- "assert($(\"#target4\") && $(\"#target4\").length > 0, 'One button
element should have the id target4
.')",
- "assert($(\"#target5\") && $(\"#target5\").length > 0, 'One button
element should have the id target5
.')",
- "assert($(\"#target6\") && $(\"#target6\").length > 0, 'One button
element should have the id target6
.')"
+ "assert($(\"#left-well\").children(\"#target1\") && $(\"#left-well\").children(\"#target1\").length > 0, 'One button
element should have the id target1
.')",
+ "assert($(\"#left-well\").children(\"#target2\") && $(\"#left-well\").children(\"#target2\").length > 0, 'One button
element should have the id target2
.')",
+ "assert($(\"#left-well\").children(\"#target3\") && $(\"#left-well\").children(\"#target3\").length > 0, 'One button
element should have the id target3
.')",
+ "assert($(\"#right-well\").children(\"#target4\") && $(\"#right-well\").children(\"#target4\").length > 0, 'One button
element should have the id target4
.')",
+ "assert($(\"#right-well\").children(\"#target5\") && $(\"#right-well\").children(\"#target5\").length > 0, 'One button
element should have the id target5
.')",
+ "assert($(\"#right-well\").children(\"#target6\") && $(\"#right-well\").children(\"#target6\").length > 0, 'One button
element should have the id target6
.')"
],
"challengeSeed": [
"img
element should have the class smaller-image
.')",
"assert($(\"img\").hasClass(\"thick-green-border\"), 'Your img
element should have the class thick-green-border
.')",
- "assert($(\"img\").hasClass(\"thick-green-border\") && parseInt($(\"img\").css(\"border-top-width\")), 'Give your image a border width of 10px
.')",
- "assert(new RegExp(\"solid\", \"gi\").test(editor), 'Give your image a border style of solid
.')",
+ "assert($(\"img\").hasClass(\"thick-green-border\") && parseInt($(\"img\").css(\"border-top-width\"), 10) === 10, 'Give your image a border width of 10px
.')",
+ "assert($(\"img\").css(\"border-right-style\") === \"solid\", 'Give your image a border style of solid
.')",
"assert($(\"img\").css(\"border-left-color\") === \"rgb(0, 128, 0)\", 'The border around your img
element should be green.')"
],
"challengeSeed": [
@@ -1747,9 +1747,8 @@
],
"tests": [
"assert($(\"form\") && $(\"form\").children(\"input\") && $(\"form\").children(\"input\").length > 0, 'Nest your text input element within a form
element.')",
- "assert($(\"form\").attr(\"action\"), 'Your form
element should have an action
attribute.')",
- "assert(editor.match(/<\\/form>/g) && editor.match(/