From 333c195b328af247215f8439440e230eaffadcd8 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 4 Aug 2015 11:04:40 -0500 Subject: [PATCH 1/5] Update bootstrap.json fixed line 1886, changed col-xs-12 to col-xs-6 "assert($('.col-xs-6').children('h4') && $('.col-xs-6').children('h4').length > 1, 'Add an h4 element to each of your <div class=\\'col-xs-6\\'> elements.');", --- challenges/bootstrap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/bootstrap.json b/challenges/bootstrap.json index c0b4014f93..68d6c70fc9 100644 --- a/challenges/bootstrap.json +++ b/challenges/bootstrap.json @@ -1883,7 +1883,7 @@ "Above your right-well, inside its \"col-xs-6\" div element, add a h4 element with the text \"#right-well\"." ], "tests": [ - "assert($('.col-xs-12').children('h4') && $('.col-xs-12').children('h4').length > 1, 'Add an h4 element to each of your <div class=\\'col-xs-6\\'> elements.');", + "assert($('.col-xs-6').children('h4') && $('.col-xs-6').children('h4').length > 1, 'Add an h4 element to each of your <div class=\\'col-xs-6\\'> elements.');", "assert(new RegExp('#left-well','gi').test($('h4').text()), 'One h4 element should have the text \"#left-well\".');", "assert(new RegExp('#right-well','gi').test($('h4').text()), 'One h4 element should have the text \"#right-well\".');" ], From e7f1f12a6ff8d8efd06fc2b55343d13c8656a34f Mon Sep 17 00:00:00 2001 From: sonorangirl Date: Mon, 10 Aug 2015 18:05:07 -0700 Subject: [PATCH 2/5] Fixed typos in 1st slot machine challenge --- challenges/basic-javascript.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/challenges/basic-javascript.json b/challenges/basic-javascript.json index c8cd7046a9..04fd44d166 100644 --- a/challenges/basic-javascript.json +++ b/challenges/basic-javascript.json @@ -1071,16 +1071,16 @@ "title": "Create a JavaScript Slot Machine", "difficulty":"9.988", "description":[ - "We are now going to try and combine some of the stuff we've just learnt abd create the logic for a slot machine game", + "We are now going to try and combine some of the stuff we've just learned and create the logic for a slot machine game", "For this we will need to generate three random numbers between 1 and 5 to represent the possible values of each individual slot", "Store the three random numbers in slotOne, slotTwo and slotThree", "Generate the random numbers by using the system we used earlier in /challenges/random-whole-numbers-in-a-range", "Math.floor(Math.random() * (5 - 1 + 1)) + 1; " ], "tests":[ - "assert(typeof(runSlots($('.slot'))[0]) == 'number', 'SlotOne should be a random number');", - "assert(typeof(runSlots($('.slot'))[1]) == 'number', 'SlotTwo should be a random number');", - "assert(typeof(runSlots($('.slot'))[2]) == 'number', 'SlotThree should be a random number');", + "assert(typeof(runSlots($('.slot'))[0]) == 'number', 'slotOne should be a random number');", + "assert(typeof(runSlots($('.slot'))[1]) == 'number', 'slotTwo should be a random number');", + "assert(typeof(runSlots($('.slot'))[2]) == 'number', 'slotThree should be a random number');", "assert((function(){if(editor.match(/Math.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi) !== null){return(editor.match(/Math.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi).length >= 3);}else{return(false);}})(), 'You should have used Math.floor(Math.random() * (5 - 1 + 1)) + 1; three times to generate your random numbers');" ], "challengeSeed":[ From f8c63c9dbad14cd4f4438fad1e2574e2f6b1af05 Mon Sep 17 00:00:00 2001 From: sonorangirl Date: Mon, 10 Aug 2015 19:22:18 -0700 Subject: [PATCH 3/5] Fixed RegEx so that 4th test would pass --- challenges/basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/basic-javascript.json b/challenges/basic-javascript.json index 04fd44d166..7834110ea0 100644 --- a/challenges/basic-javascript.json +++ b/challenges/basic-javascript.json @@ -1081,7 +1081,7 @@ "assert(typeof(runSlots($('.slot'))[0]) == 'number', 'slotOne should be a random number');", "assert(typeof(runSlots($('.slot'))[1]) == 'number', 'slotTwo should be a random number');", "assert(typeof(runSlots($('.slot'))[2]) == 'number', 'slotThree should be a random number');", - "assert((function(){if(editor.match(/Math.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi) !== null){return(editor.match(/Math.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi).length >= 3);}else{return(false);}})(), 'You should have used Math.floor(Math.random() * (5 - 1 + 1)) + 1; three times to generate your random numbers');" + "assert((function(){if(editor.match(/Math\\.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi) !== null){return(editor.match(/Math\\.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi).length >= 3);}else{return(false);}})(), 'You should have used Math.floor(Math.random() * (5 - 1 + 1)) + 1; three times to generate your random numbers');" ], "challengeSeed":[ "fccss", From 0670f73b6d67c81d5d7c564a40bb5de4ec3ac663 Mon Sep 17 00:00:00 2001 From: sonorangirl Date: Mon, 10 Aug 2015 19:32:52 -0700 Subject: [PATCH 4/5] Made some spaces optional for 4th test --- challenges/basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/basic-javascript.json b/challenges/basic-javascript.json index 7834110ea0..0aa6f4f02f 100644 --- a/challenges/basic-javascript.json +++ b/challenges/basic-javascript.json @@ -1081,7 +1081,7 @@ "assert(typeof(runSlots($('.slot'))[0]) == 'number', 'slotOne should be a random number');", "assert(typeof(runSlots($('.slot'))[1]) == 'number', 'slotTwo should be a random number');", "assert(typeof(runSlots($('.slot'))[2]) == 'number', 'slotThree should be a random number');", - "assert((function(){if(editor.match(/Math\\.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi) !== null){return(editor.match(/Math\\.floor\\(Math\\.random\\(\\)\\s\\*\\s\\(5\\s\\-\\s1\\s\\+\\s1\\)\\)\\s\\+\\s1;/gi).length >= 3);}else{return(false);}})(), 'You should have used Math.floor(Math.random() * (5 - 1 + 1)) + 1; three times to generate your random numbers');" + "assert((function(){if(editor.match(/Math\\.floor\\(\\s?Math\\.random\\(\\)\\s?\\*\\s?\\(\\s?5\\s?\\-\\s?1\\s?\\+\\s?1\\s?\\)\\s?\\)\\s?\\+\\s?1;/gi) !== null){return(editor.match(/Math\\.floor\\(\\s?Math\\.random\\(\\)\\s?\\*\\s?\\(\\s?5\\s?\\-\\s?1\\s?\\+\\s?1\\s?\\)\\s?\\)\\s?\\+\\s?1;/gi).length >= 3);}else{return(false);}})(), 'You should have used Math.floor(Math.random() * (5 - 1 + 1)) + 1; three times to generate your random numbers');" ], "challengeSeed":[ "fccss", From 382393e1f2adbd8db9390930a66d3a422505bc2a Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Mon, 10 Aug 2015 23:29:32 -0700 Subject: [PATCH 5/5] fix challenge ordering Now challenges are ordered on map first by top order value of json file second by index of array --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 38305428a2..334a11d3dc 100644 --- a/index.js +++ b/index.js @@ -63,7 +63,8 @@ Challenge.destroyAll(function(err, info) { .toLowerCase() .replace(/\:/g, '') .replace(/\s/g, '-'); - challenge.order = +('' + order + (index + 1)); + challenge.order = order; + challenge.suborder = index + 1; challenge.block = block; return challenge;