From 03600f129aa1f3015fc8712929d0c9a2af6d69ad Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Wed, 15 Jun 2016 13:38:23 -0700 Subject: [PATCH 1/9] add mongo install step to challenge --- .../03-back-end-development-certification/api-projects.json | 6 +++--- .../03-back-end-development-certification/mongodb.json | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/seed/challenges/03-back-end-development-certification/api-projects.json b/seed/challenges/03-back-end-development-certification/api-projects.json index deedb1f931..4fa1314ced 100644 --- a/seed/challenges/03-back-end-development-certification/api-projects.json +++ b/seed/challenges/03-back-end-development-certification/api-projects.json @@ -58,8 +58,8 @@ ], [ "//i.imgur.com/2a20Vah.gif", - "A gif showing you how to start mongoDB in c9.io's terminal.", - "In your terminal, start MongoDB by entering:

mongod --smallfiles", + "A gif showing you how to install MongoDB and start it in c9.io's terminal.", + "In your terminal, install MongoDB by entering:

sudo apt-get install mongodb-org

then start MongoDB by entering:

mongod --smallfiles", "" ], [ @@ -151,7 +151,7 @@ [ "//i.imgur.com/2a20Vah.gif", "Una imagen gif que te muestra cómo iniciar mongoDB en la terminal de c9.io.", - "En tu terminal, inicia MongoDB con el siguiente comando: mongod --smallfiles", + "En tu terminal, instala MongoDB usando el siguiente comando:

sudo apt-get install mongodb-org

. Inicia MongoDB con el siguiente comando: mongod --smallfiles", "" ], [ diff --git a/seed/challenges/03-back-end-development-certification/mongodb.json b/seed/challenges/03-back-end-development-certification/mongodb.json index 21b5eee22b..453b310605 100644 --- a/seed/challenges/03-back-end-development-certification/mongodb.json +++ b/seed/challenges/03-back-end-development-certification/mongodb.json @@ -17,6 +17,7 @@ "Click the \"Create workspace\" button.", "Once C9 builds and loads your workspace, you should see a terminal window in the lower right hand corner. In this window use the following commands. You don't need to know what these mean at this point.", "Install learnyoumongo with this command: npm install learnyoumongo -g", + "Install MongoDB with this command: sudo apt-get install mongodb-org", "Set up your mongod alias by following the directions at https://community.c9.io/t/setting-up-mongodb/1717.", "Now start the tutorial by running learnyoumongo.", "Whenever you run a command that includes mongod on c9.io, use ./mongod instead.", @@ -51,6 +52,7 @@ "Haz click en el botón que dice \"Create workspace\".", "Una vez C9 termine de cargar tu espacio de trabajo, verás una terminal en la ventana de la esquina inferior derecha. Introduce los comandos siguientes en esa ventana (no te preocupes si no entiendes por ahora qué es lo que hacen):", "Instala learnyoumongo usando el siguiente comando: npm install learnyoumongo -g", + "Instala MongoDB usando el siguiente comando: sudo apt-get install mongodb-org", "Ahora inicia el tutorial ejecutando learnyoumongo", "Siempre que ejecutes un comando que incluya mongod en c9.io, asegúrate de usar la bandera --nojournal. Por ejemplo: mongod --nojournal.", "Puedes modificar el tamaño de las ventanas en c9.io arrastrándolas por el borde.", From ecd1f628e23871cc4b902a4bc36f75e532a07fec Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sat, 18 Jun 2016 18:57:36 +0100 Subject: [PATCH 2/9] Added Bio from GitHub to freecodecamp portfolios - Removed unneeded code --- client/less/main.less | 5 +++++ server/utils/auth.js | 2 ++ server/views/account/show.jade | 1 + 3 files changed, 8 insertions(+) diff --git a/client/less/main.less b/client/less/main.less index a42153283b..0d2614133f 100644 --- a/client/less/main.less +++ b/client/less/main.less @@ -1161,6 +1161,11 @@ code { background-color: @brand-primary; } +// user bio +.bio { + font-size: 17px; +} + @import "chat.less"; @import "jobs.less"; @import "challenge.less"; diff --git a/server/utils/auth.js b/server/utils/auth.js index da282b7022..38b480f0b4 100644 --- a/server/utils/auth.js +++ b/server/utils/auth.js @@ -27,6 +27,7 @@ export function setProfileFromGithub( created_at: joinedGithubOn, blog: website, location, + bio, name } ) { @@ -37,6 +38,7 @@ export function setProfileFromGithub( email: user.email || githubEmail, username: username.toLowerCase(), location, + bio, joinedGithubOn, website, isGithubCool: true, diff --git a/server/views/account/show.jade b/server/views/account/show.jade index 53375e3d2b..6f21a63196 100644 --- a/server/views/account/show.jade +++ b/server/views/account/show.jade @@ -37,6 +37,7 @@ block content a.fa.fa-linkedin-square.text-primary(title="@#{username}'s LinkedIn Profile", href=linkedin, target='_blank') h1.flat-top.wrappable= name h1.flat-top.wrappable= location + p.flat-top.bio= bio h1.flat-top.text-primary= "[ " + (progressTimestamps.length) + " ]" if pledge .spacer From ad01518204e8c1732f5a4585f6b3a14df7c7588a Mon Sep 17 00:00:00 2001 From: Akinseye Olawale Date: Tue, 21 Jun 2016 15:24:32 +0100 Subject: [PATCH 3/9] Update basic-bonfires.json Removed unnecessary repetition --- .../01-front-end-development-certification/basic-bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-bonfires.json b/seed/challenges/01-front-end-development-certification/basic-bonfires.json index c1e26aaa33..b5ddf66b77 100644 --- a/seed/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/basic-bonfires.json @@ -362,7 +362,7 @@ }, { "id": "afcc8d540bea9ea2669306b6", - "title": "Repeat a string repeat a string", + "title": "Repeat a string", "description": [ "Repeat a given string (first argument) num times (second argument). Return an empty string if num is not a positive number.", "Remember to use Read-Search-Ask if you get stuck. Write your own code." From e0ace83573a8cacdf62f4be81754a8037e0b427b Mon Sep 17 00:00:00 2001 From: BKinahan Date: Tue, 21 Jun 2016 16:04:35 +0000 Subject: [PATCH 4/9] Correct stringify to JSON.stringify --- .../basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-javascript.json b/seed/challenges/01-front-end-development-certification/basic-javascript.json index 2cb9c20b33..5791dc7e21 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -4559,7 +4559,7 @@ " }", "};", "// Keep a copy of the collection for tests", - "var collectionCopy = JSON.parse(stringify(collection));", + "var collectionCopy = JSON.parse(JSON.stringify(collection));", "", "// Only change code below this line", "function updateRecords(id, prop, value) {", From e6542fa00ef2b471a6a5eb43f0314cf8628b410a Mon Sep 17 00:00:00 2001 From: HelderSepu Date: Mon, 20 Jun 2016 22:05:15 -0400 Subject: [PATCH 5/9] Prevent scrolling on initial challenge run - Add additional parameter to function displayTestResults Correction to errors: Line exceeds the maximum line length of 80 max-len Do not scroll on JS challenges --- client/commonFramework/display-test-results.js | 8 ++++++-- client/commonFramework/end.js | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/client/commonFramework/display-test-results.js b/client/commonFramework/display-test-results.js index a925b3b213..0647384c87 100644 --- a/client/commonFramework/display-test-results.js +++ b/client/commonFramework/display-test-results.js @@ -1,6 +1,6 @@ window.common = (function({ $, common = { init: [] }}) { - common.displayTestResults = function displayTestResults(data = []) { + common.displayTestResults = function displayTestResults(data = [], down) { $('#testSuite').children().remove(); $('#testSuite').fadeIn('slow'); data.forEach(({ err = false, text = '' }) => { @@ -21,7 +21,11 @@ window.common = (function({ $, common = { init: [] }}) { `) .appendTo($('#testSuite')); }); - $('#scroll-locker').animate({ scrollTop: $(document).height() }, 'slow'); + if (down) { + $('#scroll-locker').animate( + { scrollTop: $(document).height() }, 'slow' + ); + } return data; }; diff --git a/client/commonFramework/end.js b/client/commonFramework/end.js index 1a841de50c..1a8ae7be86 100644 --- a/client/commonFramework/end.js +++ b/client/commonFramework/end.js @@ -110,7 +110,7 @@ $(document).ready(function() { return common.updateOutputDisplay('' + err); } common.updateOutputDisplay(output); - common.displayTestResults(tests); + common.displayTestResults(tests, true); if (solved) { common.showCompletion(); } @@ -140,7 +140,7 @@ $(document).ready(function() { } return common.updateOutputDisplay('' + err); } - common.displayTestResults(tests); + common.displayTestResults(tests, false); return null; }, ({ err }) => { @@ -164,7 +164,7 @@ $(document).ready(function() { return common.updateOutputDisplay('' + err); } common.codeStorage.updateStorage(challengeName, originalCode); - common.displayTestResults(tests); + common.displayTestResults(tests, false); return null; }, (err) => { From a599f5d1027b3e46c21fcd9ccb01f6dc41b4c2e3 Mon Sep 17 00:00:00 2001 From: Manish-Giri Date: Mon, 20 Jun 2016 20:10:46 -0400 Subject: [PATCH 6/9] Fixed naming in Where Art Thou --- .../intermediate-bonfires.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/seed/challenges/01-front-end-development-certification/intermediate-bonfires.json b/seed/challenges/01-front-end-development-certification/intermediate-bonfires.json index c5adcaedcc..c1e11bd3b4 100644 --- a/seed/challenges/01-front-end-development-certification/intermediate-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/intermediate-bonfires.json @@ -169,14 +169,14 @@ }, { "id": "a8e512fbe388ac2f9198f0fa", - "title": "Where art thou", + "title": "Wherefore art thou", "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 [{ 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 its value, that was passed on as the second argument.", "Remember to use Read-Search-Ask if you get stuck. Write your own code." ], "challengeSeed": [ - "function whereAreYou(collection, source) {", + "function whatIsInAName(collection, source) {", " // What's in a name?", " var arr = [];", " // Only change code below this line", @@ -186,16 +186,16 @@ " return arr;", "}", "", - "whereAreYou([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" });" + "whatIsInAName([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" });" ], "solutions": [ - "function whereAreYou(collection, source) {\n var arr = [];\n var keys = Object.keys(source);\n collection.forEach(function(e) {\n if(keys.every(function(key) {return e[key] === source[key];})) {\n arr.push(e); \n }\n });\n return arr;\n}" + "function whatIsInAName(collection, source) {\n var arr = [];\n var keys = Object.keys(source);\n collection.forEach(function(e) {\n if(keys.every(function(key) {return e[key] === source[key];})) {\n arr.push(e); \n }\n });\n return arr;\n}" ], "tests": [ - "assert.deepEqual(whereAreYou([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" }), [{ first: \"Tybalt\", last: \"Capulet\" }], 'message: whereAreYou([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" }) should return [{ first: \"Tybalt\", last: \"Capulet\" }].');", - "assert.deepEqual(whereAreYou([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 }), [{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], 'message: whereAreYou([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 }) should return [{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }].');", - "assert.deepEqual(whereAreYou([{ \"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: whereAreYou([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"b\": 2 }) should return [{ \"a\": 1, \"b\": 2 }, { \"a\": 1, \"b\": 2, \"c\": 2 }].');", - "assert.deepEqual(whereAreYou([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"c\": 2 }), [{ \"a\": 1, \"b\": 2, \"c\": 2 }], 'message: whereAreYou([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"c\": 2 }) should return [{ \"a\": 1, \"b\": 2, \"c\": 2 }].');" + "assert.deepEqual(whatIsInAName([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" }), [{ first: \"Tybalt\", last: \"Capulet\" }], 'message: whatIsInAName([{ first: \"Romeo\", last: \"Montague\" }, { first: \"Mercutio\", last: null }, { first: \"Tybalt\", last: \"Capulet\" }], { last: \"Capulet\" }) should return [{ first: \"Tybalt\", last: \"Capulet\" }].');", + "assert.deepEqual(whatIsInAName([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 }), [{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], 'message: whatIsInAName([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 }) should return [{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }].');", + "assert.deepEqual(whatIsInAName([{ \"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: whatIsInAName([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"b\": 2 }) should return [{ \"a\": 1, \"b\": 2 }, { \"a\": 1, \"b\": 2, \"c\": 2 }].');", + "assert.deepEqual(whatIsInAName([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"c\": 2 }), [{ \"a\": 1, \"b\": 2, \"c\": 2 }], 'message: whatIsInAName([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"c\": 2 }) should return [{ \"a\": 1, \"b\": 2, \"c\": 2 }].');" ], "type": "bonfire", "MDNlinks": [ From 224495ae87c250fd7106bfba368d73b39dc8132d Mon Sep 17 00:00:00 2001 From: Oscar Date: Tue, 21 Jun 2016 07:10:55 +0000 Subject: [PATCH 7/9] Edited basic-javscript.json to improve camelCase task description Edited clarification statement with consideration to 'DRY' --- .../basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-javascript.json b/seed/challenges/01-front-end-development-certification/basic-javascript.json index 7ac5e11aca..9c0b407377 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -235,7 +235,7 @@ "Examples:", "
var someVariable;
var anotherVariableName;
var thisVariableNameIsTooLong;
", "

Instructions

", - "Fix the variable declarations and assignments so their names use camelCase." + "Modify the existing declarations and assignments so their names use camelCase.
Do not create any new variables." ], "releasedOn": "January 1, 2016", "challengeSeed": [ From a99261b42e784a48b098cf09913409f08dfe0ad1 Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Tue, 31 May 2016 23:36:00 -0700 Subject: [PATCH 8/9] Add test to check .endsWith() in Confirm Ending --- .../basic-bonfires.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-bonfires.json b/seed/challenges/01-front-end-development-certification/basic-bonfires.json index b5ddf66b77..6c3d8e13b4 100644 --- a/seed/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/basic-bonfires.json @@ -325,6 +325,7 @@ "title": "Confirm the Ending", "description": [ "Check if a string (first argument, str) ends with the given target string (second argument, target).", + "This challenge can be solved with the .endsWith() method, which was introduced in ES2015. But for the purpose of this challenge, we would like you to use one of the JavaScript substring methods instead.", "Remember to use Read-Search-Ask if you get stuck. Write your own code." ], "challengeSeed": [ @@ -343,7 +344,8 @@ "assert(confirmEnding(\"He has to give me a new name\", \"name\") === true, 'message: confirmEnding(\"He has to give me a new name\", \"name\") should return true.');", "assert(confirmEnding(\"He has to give me a new name\", \"me\") === true, 'message: confirmEnding(\"He has to give me a new name\", \"me\") should return true.');", "assert(confirmEnding(\"He has to give me a new name\", \"na\") === false, 'message: confirmEnding(\"He has to give me a new name\", \"na\") should return false.');", - "assert(confirmEnding(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") === false, 'message: confirmEnding(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") should return false.');" + "assert(confirmEnding(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") === false, 'message: confirmEnding(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") should return false.');", + "assert(!/\\.endsWith\\(.*?\\)\\s*?;/.test(code), 'message: Do not use the built-in method .endsWith() to solve the challenge.');" ], "type": "bonfire", "isRequired": true, @@ -351,7 +353,8 @@ "function confirmEnding(str, target) {\n return str.substring(str.length-target.length) === target;\n};\n" ], "MDNlinks": [ - "String.prototype.substr()" + "String.prototype.substr()", + "String.prototype.substring()" ], "challengeType": 5, "titleEs": "Confirma la terminación", From 0ab01fc7d1b6576e58f65b1fad76e0d14db958d1 Mon Sep 17 00:00:00 2001 From: Jonathan Wong <18wongj@gmail.com> Date: Wed, 22 Jun 2016 09:09:18 -0400 Subject: [PATCH 9/9] Fix/rewrite-instructions (#8944) Clarify Where Do I Belong to return positive val --- .../01-front-end-development-certification/basic-bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-bonfires.json b/seed/challenges/01-front-end-development-certification/basic-bonfires.json index 6c3d8e13b4..006cd80bdc 100644 --- a/seed/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/basic-bonfires.json @@ -651,7 +651,7 @@ "id": "a24c1a4622e3c05097f71d67", "title": "Where do I belong", "description": [ - "Return the lowest index at which a value (second argument) should be inserted into an array (first argument) once it has been sorted.", + "Return the lowest index at which a value (second argument) should be inserted into an array (first argument) once it has been sorted. The returned value should be a number.", "For example, getIndexToIns([1,2,3,4], 1.5) should return 1 because it is greater than 1 (index 0), but less than 2 (index 1).", "Likewise, getIndexToIns([20,3,5], 19) should return 2 because once the array has been sorted it will look like [3,5,20] and 19 is less than 20 (index 2) and greater than 5 (index 1).", "Remember to use Read-Search-Ask if you get stuck. Write your own code."