From e4381b7c9d1c943fe32018c76a807bf5ed24789b Mon Sep 17 00:00:00 2001 From: Pasayadaan Date: Thu, 9 Jun 2016 21:59:30 -0500 Subject: [PATCH] Fix for access array data with indices This is a buggy challange (#8843) Updated description in seed/challenges/01-front-end-development-certification/html5-and-css.json to instruct "Create second

element after the existing

element" fix for access array data with indices use deep not-equal in first assertion --- .../basic-javascript.json | 5 +++-- .../html5-and-css.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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 c09141ee967..2159e406e21 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -1673,7 +1673,7 @@ "Example", "

var array = [1,2,3];
array[0]; // equals 1
var data = array[1]; // equals 2
", "

Instructions

", - "Create a variable called myData and set it to equal the first value of myArray." + "Create a variable called myData and set it to equal the first value of myArray using bracket notation." ], "challengeSeed": [ "// Example", @@ -1693,7 +1693,8 @@ "var myArray = [1,2,3];\nvar myData = myArray[0];" ], "tests": [ - "assert((function(){if(typeof myArray != 'undefined' && typeof myData != 'undefined' && myArray[0] === myData){return true;}else{return false;}})(), 'message: The variable myData should equal the first value of myArray.');" + "assert((function(){if(typeof myArray !== 'undefined' && typeof myData !== 'undefined' && myArray[0] === myData){return true;}else{return false;}})(), 'message: The variable myData should equal the first value of myArray.');", + "assert((function(){if(code.match(/\\s*=\\s*myArray\\[0\\]/g)){return true;}else{return false;}})(), 'message: The data in variable myArray should be accessed using bracket notation.');" ], "type": "waypoint", "challengeType": 1, 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 0f8bfdec445..b51b6a8d5cb 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 @@ -713,7 +713,7 @@ "description": [ "Font size is controlled by the font-size CSS property, like this:", "
h1 {
  font-size: 30px;
}
", - "Create a second p element with the following kitty ipsum text: Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.", + "Create a second p element after the existing p element with the following kitty ipsum text: Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.", "Inside the same <style> tag that contains your red-text class, create an entry for p elements and set the font-size to 16 pixels (16px).", "Note
Due to browser implementation differences, you may need to be at 100% zoom to pass the tests on this challenge.", "Also, please do not add a class attribute to your new p element."