From eecc8e4428d3be43a7d28e74fb801b554da7e862 Mon Sep 17 00:00:00 2001 From: Andre Alonzo Date: Mon, 14 Mar 2016 22:50:24 -0700 Subject: [PATCH 1/6] Updated example code fo r Accessing Nested Arrays in JSON --- .../basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/01-front-end-development-certification/basic-javascript.json b/challenges/01-front-end-development-certification/basic-javascript.json index fac504ca85..e87af0fec3 100644 --- a/challenges/01-front-end-development-certification/basic-javascript.json +++ b/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 d244fe4024bcfeedee696fc3691cf324e5160fe1 Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Wed, 16 Mar 2016 14:17:27 -0700 Subject: [PATCH 2/6] Make Repeat a String function name unique --- .../basic-bonfires.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/challenges/01-front-end-development-certification/basic-bonfires.json b/challenges/01-front-end-development-certification/basic-bonfires.json index 8a77de4f6d..7f7d1deb60 100644 --- a/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/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 88e5792b4b1b6326297d09bd783bd80325f136fc Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Thu, 17 Mar 2016 05:46:07 -0700 Subject: [PATCH 3/6] 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/challenges/01-front-end-development-certification/basic-bonfires.json b/challenges/01-front-end-development-certification/basic-bonfires.json index 1cf13be43f..f182454db3 100644 --- a/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/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 22fab8f92e28ea619790383dc521621c3a49f025 Mon Sep 17 00:00:00 2001 From: drk7891 Date: Fri, 18 Mar 2016 10:35:28 -0400 Subject: [PATCH 4/6] Fixed challenge typo --- .../basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/01-front-end-development-certification/basic-javascript.json b/challenges/01-front-end-development-certification/basic-javascript.json index e633511e76..60f44ce0fe 100644 --- a/challenges/01-front-end-development-certification/basic-javascript.json +++ b/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 367bd936020e529a41be803871b8ae74ad9013ef Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Fri, 18 Mar 2016 09:40:57 -0700 Subject: [PATCH 5/6] Make Chunky Monkey function name unique --- .../basic-bonfires.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/challenges/01-front-end-development-certification/basic-bonfires.json b/challenges/01-front-end-development-certification/basic-bonfires.json index 1cf13be43f..c952c33d95 100644 --- a/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/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 31d3b402aa7f5e51271d144047d142ab56d7cf94 Mon Sep 17 00:00:00 2001 From: Akira Laine Date: Fri, 18 Mar 2016 22:18:42 +1100 Subject: [PATCH 6/6] 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/challenges/01-front-end-development-certification/html5-and-css.json b/challenges/01-front-end-development-certification/html5-and-css.json index a88a20fee4..b63144005b 100644 --- a/challenges/01-front-end-development-certification/html5-and-css.json +++ b/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": [ - "", + "", "