From e54e83494f689cebdf1b289fd6421e6e976b1931 Mon Sep 17 00:00:00 2001 From: Andre Alonzo Date: Mon, 14 Mar 2016 22:50:24 -0700 Subject: [PATCH 1/8] Updated example code fo r Accessing Nested Arrays in JSON --- .../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 fac504ca85..e87af0fec3 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -4419,7 +4419,7 @@ "description": [ "As we have seen in earlier examples, JSON objects can contain both nested objects and nested arrays. Similar to accessing nested objects, Array bracket notation can be chained to access nested arrays.", "Here is an example of how to access a nested array:", - "
var ourPets = {
\"cats\": [
\"Meowzer\",
\"Fluffy\",
\"Kit-Cat\"
],
\"dogs\": [
\"Spot\",
\"Bowser\",
\"Frankie\"
]
};
ourPets.cats[1]; // \"Fluffy\"
ourPets.dogs[0]; // \"Spot\"
", + "
var ourPets = [
{
animalType: \"cat\",
names: [
\"Meowzer\",
\"Fluffy\",
\"Kit-Cat\"
]
},
{
animalType: \"dog\",
names: [
\"Spot\",
\"Bowser\",
\"Frankie\"
]
}
];
ourPets[0].names[1]; // \"Fluffy\"
ourPets[1].names[0]; // \"Spot\"
", "

Instructions

", "Retrieve the second tree from the variable myPlants using object dot and array bracket notation." ], From 6d055723a8d7c8ed7f1a797e3539ac797e9b74e3 Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Wed, 16 Mar 2016 14:17:27 -0700 Subject: [PATCH 2/8] Make Repeat a String function name unique --- .../basic-bonfires.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 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 8a77de4f6d..7f7d1deb60 100644 --- a/seed/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/basic-bonfires.json @@ -365,25 +365,25 @@ "Remember to use Read-Search-Ask if you get stuck. Write your own code." ], "challengeSeed": [ - "function repeat(str, num) {", + "function repeatStringNumTimes(str, num) {", " // repeat after me", " return str;", "}", "", - "repeat(\"abc\", 3);" + "repeatStringNumTimes(\"abc\", 3);" ], "tests": [ - "assert(repeat(\"*\", 3) === \"***\", 'message: repeat(\"*\", 3) should return \"***\".');", - "assert(repeat(\"abc\", 3) === \"abcabcabc\", 'message: repeat(\"abc\", 3) should return \"abcabcabc\".');", - "assert(repeat(\"abc\", 4) === \"abcabcabcabc\", 'message: repeat(\"abc\", 4) should return \"abcabcabcabc\".');", - "assert(repeat(\"abc\", 1) === \"abc\", 'message: repeat(\"abc\", 1) should return \"abc\".');", - "assert(repeat(\"*\", 8) === \"********\", 'message: repeat(\"*\", 8) should return \"********\".');", - "assert(repeat(\"abc\", -2) === \"\", 'message: repeat(\"abc\", -2) should return \"\".');" + "assert(repeatStringNumTimes(\"*\", 3) === \"***\", 'message: repeatStringNumTimes(\"*\", 3) should return \"***\".');", + "assert(repeatStringNumTimes(\"abc\", 3) === \"abcabcabc\", 'message: repeatStringNumTimes(\"abc\", 3) should return \"abcabcabc\".');", + "assert(repeatStringNumTimes(\"abc\", 4) === \"abcabcabcabc\", 'message: repeatStringNumTimes(\"abc\", 4) should return \"abcabcabcabc\".');", + "assert(repeatStringNumTimes(\"abc\", 1) === \"abc\", 'message: repeatStringNumTimes(\"abc\", 1) should return \"abc\".');", + "assert(repeatStringNumTimes(\"*\", 8) === \"********\", 'message: repeatStringNumTimes(\"*\", 8) should return \"********\".');", + "assert(repeatStringNumTimes(\"abc\", -2) === \"\", 'message: repeatStringNumTimes(\"abc\", -2) should return \"\".');" ], "type": "bonfire", "isRequired": true, "solutions": [ - "function repeat(str, num) {\n if (num < 0) return '';\n return num === 1 ? str : str + repeat(str, num-1);\n}\n\nrepeat('abc', 3);\n" + "function repeatStringNumTimes(str, num) {\n if (num < 0) return '';\n return num === 1 ? str : str + repeatStringNumTimes(str, num-1);\n}\n\nrepeatStringNumTimes('abc', 3);\n" ], "MDNlinks": [ "Global String Object" From 41cd3dae5f4c80f2d892e63f8a03b0a02db6a1dc Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Thu, 17 Mar 2016 05:46:07 -0700 Subject: [PATCH 3/8] Make Truncate a String function unique & clarify - Change `truncate` function to `truncateString` - Update challenge description to clarify goals of challenge --- .../basic-bonfires.json | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 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 1cf13be43f..f182454db3 100644 --- a/seed/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/basic-bonfires.json @@ -399,31 +399,31 @@ "id": "ac6993d51946422351508a41", "title": "Truncate a string", "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.", - "If the num is less than or equal to 3, then the length of the three dots is not added to the string length.", + "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 inserting the three dots to the end will add to the string length.", + "However, if the given maximum string length num is less than or equal to 3, then the addition of the three dots does not add to the string length in determining the truncated string.", "Remember to use Read-Search-Ask if you get stuck. Write your own code." ], "challengeSeed": [ - "function truncate(str, num) {", + "function truncateString(str, num) {", " // Clear out that junk in your trunk", " return str;", "}", "", - "truncate(\"A-tisket a-tasket A green and yellow basket\", 11);" + "truncateString(\"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...\", 'message: truncate(\"A-tisket a-tasket A green and yellow basket\", 11) should return \"A-tisket...\".');", - "assert(truncate(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", 'message: truncate(\"Peter Piper picked a peck of pickled peppers\", 14) 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: truncate(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length) 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: truncate(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length + 2) should return \"A-tisket a-tasket A green and yellow basket\".');", - "assert(truncate(\"A-\", 1) === \"A...\", 'message: truncate(\"A-\", 1) should return \"A...\".');", - "assert(truncate(\"Absolutely Longer\", 2) === \"Ab...\", 'message: truncate(\"Absolutely Longer\", 2) should return \"Ab...\".');" + "assert(truncateString(\"A-tisket a-tasket A green and yellow basket\", 11) === \"A-tisket...\", 'message: truncateString(\"A-tisket a-tasket A green and yellow basket\", 11) should return \"A-tisket...\".');", + "assert(truncateString(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", 'message: truncateString(\"Peter Piper picked a peck of pickled peppers\", 14) should return \"Peter Piper...\".');", + "assert(truncateString(\"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: truncateString(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length) should return \"A-tisket a-tasket A green and yellow basket\".');", + "assert(truncateString('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: truncateString(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length + 2) should return \"A-tisket a-tasket A green and yellow basket\".');", + "assert(truncateString(\"A-\", 1) === \"A...\", 'message: truncateString(\"A-\", 1) should return \"A...\".');", + "assert(truncateString(\"Absolutely Longer\", 2) === \"Ab...\", 'message: truncateString(\"Absolutely Longer\", 2) should return \"Ab...\".');" ], "type": "bonfire", "isRequired": true, "solutions": [ - "function truncate(str, num) {\n if(str.length > num ) {\n if(num > 3) {\n return str.slice(0, num - 3) + '...';\n } else {\n return str.slice(0,num) + '...';\n }\n } \n return str;\n}" + "function truncateString(str, num) {\n if(str.length > num ) {\n if(num > 3) {\n return str.slice(0, num - 3) + '...';\n } else {\n return str.slice(0,num) + '...';\n }\n } \n return str;\n}" ], "MDNlinks": [ "String.slice()" From 5b75652fa6eb2c20e4f47fe783b6c76de8c9c73c Mon Sep 17 00:00:00 2001 From: drk7891 Date: Fri, 18 Mar 2016 10:35:28 -0400 Subject: [PATCH 4/8] Fixed challenge typo --- .../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 e633511e76..60f44ce0fe 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -2532,7 +2532,7 @@ "assert(queue([],1) === 1, 'message: queue([], 1) should return 1');", "assert(queue([2],1) === 2, 'message: queue([2], 1) should return 2');", "assert(queue([5,6,7,8,9],1) === 5, 'message: queue([5,6,7,8,9], 1) should return 5');", - "queue(testArr, 10); assert(testArr[4] === 10, 'message: After queue(testArr, 10), myArr[4] should be 10');" + "queue(testArr, 10); assert(testArr[4] === 10, 'message: After queue(testArr, 10), testArr[4] should be 10');" ], "type": "checkpoint", "challengeType": 1, From f8b8a29b9b9867b2d2a837262d1456540e0689cf Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Fri, 18 Mar 2016 09:40:57 -0700 Subject: [PATCH 5/8] Make Chunky Monkey function name unique --- .../basic-bonfires.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 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 1cf13be43f..c952c33d95 100644 --- a/seed/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/basic-bonfires.json @@ -445,25 +445,25 @@ "Remember to use Read-Search-Ask if you get stuck. Write your own code." ], "challengeSeed": [ - "function chunk(arr, size) {", + "function chunkArrayInGroups(arr, size) {", " // Break it up.", " return arr;", "}", "", - "chunk([\"a\", \"b\", \"c\", \"d\"], 2);" + "chunkArrayInGroups([\"a\", \"b\", \"c\", \"d\"], 2);" ], "tests": [ - "assert.deepEqual(chunk([\"a\", \"b\", \"c\", \"d\"], 2), [[\"a\", \"b\"], [\"c\", \"d\"]], 'message: chunk([\"a\", \"b\", \"c\", \"d\"], 2) should return [[\"a\", \"b\"], [\"c\", \"d\"]].');", - "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'message: chunk([0, 1, 2, 3, 4, 5], 3) should return [[0, 1, 2], [3, 4, 5]].');", - "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], 'message: chunk([0, 1, 2, 3, 4, 5], 2) should return [[0, 1], [2, 3], [4, 5]].');", - "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'message: chunk([0, 1, 2, 3, 4, 5], 4) should return [[0, 1, 2, 3], [4, 5]].');", - "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5, 6], 3), [[0, 1, 2], [3, 4, 5], [6]], 'message: chunk([0, 1, 2, 3, 4, 5, 6], 3) should return [[0, 1, 2], [3, 4, 5], [6]].');", - "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5, 6, 7, 8], 4), [[0, 1, 2, 3], [4, 5, 6, 7], [8]], 'message: chunk([0, 1, 2, 3, 4, 5, 6, 7, 8], 4) should return [[0, 1, 2, 3], [4, 5, 6, 7], [8]].');" + "assert.deepEqual(chunkArrayInGroups([\"a\", \"b\", \"c\", \"d\"], 2), [[\"a\", \"b\"], [\"c\", \"d\"]], 'message: chunkArrayInGroups([\"a\", \"b\", \"c\", \"d\"], 2) should return [[\"a\", \"b\"], [\"c\", \"d\"]].');", + "assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'message: chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3) should return [[0, 1, 2], [3, 4, 5]].');", + "assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], 'message: chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2) should return [[0, 1], [2, 3], [4, 5]].');", + "assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'message: chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4) should return [[0, 1, 2, 3], [4, 5]].');", + "assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3), [[0, 1, 2], [3, 4, 5], [6]], 'message: chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3) should return [[0, 1, 2], [3, 4, 5], [6]].');", + "assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4), [[0, 1, 2, 3], [4, 5, 6, 7], [8]], 'message: chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4) should return [[0, 1, 2, 3], [4, 5, 6, 7], [8]].');" ], "type": "bonfire", "isRequired": true, "solutions": [ - "function chunk(arr, size) {\n var out = [];\n for (var i = 0; i < arr.length; i+=size) {\n out.push(arr.slice(i,i+size));\n }\n return out;\n}\n\nchunk(['a', 'b', 'c', 'd'], 2);\n" + "function chunkArrayInGroups(arr, size) {\n var out = [];\n for (var i = 0; i < arr.length; i+=size) {\n out.push(arr.slice(i,i+size));\n }\n return out;\n}\n\nchunkArrayInGroups(['a', 'b', 'c', 'd'], 2);\n" ], "MDNlinks": [ "Array.push()", From d021574bc31d658a84318922875118aff5a0acb1 Mon Sep 17 00:00:00 2001 From: Ka Lun Lee Date: Fri, 18 Mar 2016 00:07:22 -0700 Subject: [PATCH 6/8] added links for clarification on Make Objects Properties Private challenge. fixed grammar from previous PR. This closes #7282. --- .../object-oriented-and-functional-programming.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/seed/challenges/01-front-end-development-certification/object-oriented-and-functional-programming.json b/seed/challenges/01-front-end-development-certification/object-oriented-and-functional-programming.json index 82d1db23d5..181d4dd082 100644 --- a/seed/challenges/01-front-end-development-certification/object-oriented-and-functional-programming.json +++ b/seed/challenges/01-front-end-development-certification/object-oriented-and-functional-programming.json @@ -234,13 +234,14 @@ "title": "Make Object Properties Private", "description": [ "Objects have their own attributes, called properties, and their own functions, called methods.", - "In the previous challenges, we used the this keyword to reference public properties of the current object.", + "In the previous challenges, we used the this keyword to reference public properties of the current object.", "We can also create private properties and private methods, which aren't accessible from outside the object.", "To do this, we create the variable inside the constructor using the var keyword we're familiar with, instead of creating it as a property of this.", "This is useful for when we need to store information about an object but we want to control how it is used by outside code.", "For example, what if we want to store the speed our car is traveling at but we only want outside code to be able to modify it by accelerating or decelerating, so the speed changes in a controlled way?", "In the editor you can see an example of a Car constructor that implements this pattern.", - "Now try it yourself! Modify the Bike constructor to have a private property called gear and two public methods called getGear and setGear to get and set that value." + "Now try it yourself! Modify the Bike constructor to have a private property called gear and two public methods called getGear and setGear to get and set that value.", + "Further explanation on this keyword" ], "challengeSeed": [ "var Car = function() {", From 668e47f97241f8e5818b422db7fbf625c67d21f9 Mon Sep 17 00:00:00 2001 From: Akira Laine Date: Fri, 18 Mar 2016 22:18:42 +1100 Subject: [PATCH 7/8] changed http to https in HTML5 & CSS3 reverted freecatphotoapp links to http reverted all freecatphotoapp links to http fixed more issues --- .../html5-and-css.json | 86 +++++++++---------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/seed/challenges/01-front-end-development-certification/html5-and-css.json b/seed/challenges/01-front-end-development-certification/html5-and-css.json index a88a20fee4..b63144005b 100644 --- a/seed/challenges/01-front-end-development-certification/html5-and-css.json +++ b/seed/challenges/01-front-end-development-certification/html5-and-css.json @@ -686,7 +686,7 @@ "Agora, vamos importar e aplicar um estilo de fonte por meio do Google Fonts.", "Primeiro, faça um chamado ao Google Fonts para poder utilizar a fonte chamada Lobster e carregá-la em seu HTML.", "Para fazer isso, copie o código abaixo e insira-o na parte superior de seu editor de texto:", - "<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">", + "<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">", "Agora, estableça Lobster como o valor para font-family em seu elemento h2." ], "namePtBR": "Importe uma Fonte a Partir do Google Fonts", @@ -694,7 +694,7 @@ "Füge dem h2 Element die Schriftart oder font-family \"Lobster\" hinzu.", "Zuerst musst du Google Fonts in dein HTML einbinden, um auf \"Lobster\" zugreifen zu können.", "Kopiere den folgenden Code und füge diesen in deinen Editor über dem style Element ein:", - "<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">", + "<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">", "Jetzt kannst du \"Lobster\" als font-family Attribut zu deinem h2 Element hinzufügen." ], "title": "Import a Google Font", @@ -702,7 +702,7 @@ "Now, let's import and apply a Google font (note that if Google is blocked in your country, you will need to skip this challenge).", "First, you'll need to make a call to Google to grab the Lobster font and load it into your HTML.", "Copy the following code snippet and paste it into the top of your code editor:", - "<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">", + "<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">", "Now you can set Lobster as a font-family value on your h2 element.", "Apply the font-family of Lobster to your h2 element." ], @@ -734,7 +734,7 @@ "Ahora, importemos y apliquemos un tipo de letra de Google (ten en cuenta que si Google está bloqueado en tu país, deberás saltarte este desafío).", "Primero, haz un llamado a Google para obtener el tipo de letra Lobster y para cargarlo en tu HTML.", "Copia la siguiente porción de código y pégala en la parte superior de tu editor de texto:", - "<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">", + "<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">", "Ahora puedes establecer Lobster como valor de font-family de tu elemento h2.", "Aplica el tipo de letra (font-family) Lobster a tu elemento h2." ], @@ -769,7 +769,7 @@ "Now comment out your call to Google Fonts, so that the Lobster font isn't available. Notice how it degrades to the Monospace font." ], "challengeSeed": [ - "", + "", "