diff --git a/public/css/main.less b/public/css/main.less index bc060791d5..82dec41a83 100644 --- a/public/css/main.less +++ b/public/css/main.less @@ -1163,6 +1163,10 @@ hr { font: normal normal normal 14px/1 FontAwesome !important; } +#testSuite > div >.row { + margin: 0!important; +} + //uncomment this to see the dimensions of all elements outlined in red //* { // border-color: red; diff --git a/public/js/lib/coursewares/coursewaresHCJQFramework_0.1.9.js b/public/js/lib/coursewares/coursewaresHCJQFramework_0.1.9.js index 94d8bb7e93..6b004bafe6 100644 --- a/public/js/lib/coursewares/coursewaresHCJQFramework_0.1.9.js +++ b/public/js/lib/coursewares/coursewaresHCJQFramework_0.1.9.js @@ -71,6 +71,17 @@ editor.on("keyup", function () { var nodeEnv = prodOrDev === 'production' ? 'http://www.freecodecamp.com' : 'http://localhost:3001'; function updatePreview() { editorValueForIFrame = editor.getValue(); + var failedCommentTest = false; + if(editorValueForIFrame.match(/\<\!\-\-/gi) && editorValueForIFrame.match(/\-\-\>/gi) == null){ + failedCommentTest = true; + } + else if(editorValueForIFrame.match(/\<\!\-\-/gi) && editorValueForIFrame.match(/\<\!\-\-/gi).length > editorValueForIFrame.match(/\-\-\>/gi).length){ + failedCommentTest = true; + } + if(failedCommentTest){ + editor.setValue(editor.getValue()+ "-->"); + editorValueForIFrame = editorValueForIFrame + "-->"; + } goodTests = 0; var previewFrame = document.getElementById('preview'); var preview = previewFrame.contentDocument || previewFrame.contentWindow.document; diff --git a/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js b/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js index 564b9decae..712811c9c1 100644 --- a/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js +++ b/public/js/lib/coursewares/coursewaresJSFramework_0.0.6.js @@ -100,12 +100,25 @@ function bonfireExecute() { userTests = null; $('#codeOutput').empty(); var userJavaScript = myCodeMirror.getValue(); + var failedCommentTest = false; + if(userJavaScript.match(/\/\*/gi) && userJavaScript.match(/\*\//gi) == null){ + failedCommentTest = true; + } + else if(!failedCommentTest && userJavaScript.match(/\/\*/gi) && userJavaScript.match(/\/\*/gi).length > userJavaScript.match(/\*\//gi).length){ + failedCommentTest = true; + } userJavaScript = removeComments(userJavaScript); userJavaScript = scrapeTests(userJavaScript); // simple fix in case the user forgets to invoke their function submit(userJavaScript, function(cls, message) { - if (cls) { + if(failedCommentTest){ + myCodeMirror.setValue(myCodeMirror.getValue() + "*/"); + console.log('Caught Unfinished Comment'); + codeOutput.setValue("Unfinished mulit-line comment"); + failedCommentTest = false; + } + else if (cls) { codeOutput.setValue(message.error); runTests('Error', null); } else { diff --git a/seed/challenges/advanced-bonfires.json b/seed/challenges/advanced-bonfires.json index f71370c238..62a5f2cd3c 100644 --- a/seed/challenges/advanced-bonfires.json +++ b/seed/challenges/advanced-bonfires.json @@ -80,7 +80,7 @@ "sym([1, 2, 3], [5, 2, 1, 4]);" ], "tests": [ - "expect(sym([1, 2, 3], [5, 2, 1, 4])).to.equal([3, 5, 4]);", + "assert.deepEqual(sym([1, 2, 3], [5, 2, 1, 4]), [3, 5, 4], 'should return an array of unique values');", "assert.deepEqual(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'should return the symmetric difference of the given arrays');", "assert.deepEqual(sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]), [1, 4, 5], 'should return an array of unique values');", "assert.deepEqual(sym([1, 1]), [1], 'should return an array of unique values');" diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index fa59afe650..1096e02868 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -157,7 +157,7 @@ "assert((function(){if(typeof(firstLetterOfLastName) !== \"undefined\" && editor.getValue().match(/\\[0\\]/gi) && typeof(firstLetterOfLastName) === \"string\" && firstLetterOfLastName === \"L\"){return(true);}else{return(false);}})(), 'The first letter of firstLetterOfLastName should be a L');" ], "challengeSeed": [ - "var firstLetterOfLastName = \"\";", + "var firstLetterOfFirstName = \"\";", "var firstLetterOfLastName = \"\";", "", "var firstName = \"Ada\";", @@ -336,7 +336,7 @@ "// Only change code above this line.", "// We use this function to show you the value of your variable in your output box.", "// You'll learn about functions soon.", - "(function(z){return('product='+z);})(product)" + "(function(z){return('product='+z);})(product);" ], "type": "waypoint", "challengeType": 1 @@ -398,7 +398,8 @@ "Replace the 0.0 with the correct number so that you get the result mentioned in the comments." ], "tests": [ - "assert((function(){if(product === 5.0 && editor.getValue().match(/\\*/g)){return(true);}else{return(false);}})(), 'Make the variable product equal 5.0.');" + "assert((function(){if(product === 5.0 && editor.getValue().match(/\\*/g)){return(true);}else{return(false);}})(), 'Make the variable product equal 5.0.');", + "assert((function(){if(quotient === 2.2 && editor.getValue().match(/\\//g)){return(true);}else{return(false);}})(), 'Make the variable quotient equal 2.2.');" ], "challengeSeed": [ "var quotient = 4.4 / 2.0; // equals 2.2", @@ -553,9 +554,9 @@ "//console.log(removed); // logs 3", "", "var myArray = [\"John\", 23, [\"cat\", 2]];", - "var removed = myArray; // This should be [\"cat\", 2] and myArray should now be [\"John\", 23]", "// Only change code below this line.", "", + "var removed = myArray; // This should be [\"cat\", 2] and myArray should now be [\"John\", 23]", "", "// Only change code above this line.", "// We use this function to show you the value of your variable in your output box.", @@ -614,11 +615,12 @@ "// ourArray now equals [\"J\", [\"cat\"]]", "", "var myArray = [\"John\", 23, [\"dog\", 3]];", - "var myRemoved = myArray; // This should be [\"John\"] and myArray should now be [23, [\"dog\", 3]]", "// Only change code below this line.", "", + "var myRemoved = myArray; // This should be [\"John\"] and myArray should now be [23, [\"dog\", 3]]", "", "// Only change code above this line.", + "", "// We use this function to show you the value of your variable in your output box.", "// You'll learn about functions soon.", "(function(y, z){return('myArray = ' + JSON.stringify(y) + ' & myRemoved = ' + JSON.stringify(z));})(myArray, myRemoved);" @@ -726,9 +728,9 @@ ], "challengeSeed":[ "//var ourDog = {", - "// \"name\": \"Camper\"", - "// \"legs\": 4", - "// \"tails\": 1", + "// \"name\": \"Camper\",", + "// \"legs\": 4,", + "// \"tails\": 1,", "// \"friends\": [\"everything!\"]", "//};", "", @@ -766,9 +768,9 @@ ], "challengeSeed":[ "// var ourDog = {", - "// \"name\": \"Camper\"", - "// \"legs\": 4", - "// \"tails\": 1", + "// \"name\": \"Camper\",", + "// \"legs\": 4,", + "// \"tails\": 1,", "// \"friends\": [\"everything!\"]", "// };", "", @@ -902,7 +904,7 @@ ], "challengeSeed":[ "function myFunction(){", - " // Make myFunction return a random number between zero and nine instead of a decimal", + " // Make myFunction return a random number betweenzero and nine> instead of a decimal", "", " // Only change code below this line.", "", @@ -922,7 +924,7 @@ "title": "Generate Random Whole Numbers within a Range", "difficulty":"9.9829", "description":[ - "We can use a certain mathematical expression to get a random number between between two numbers.", + "We can use a certain mathematical expression to get a random number between two numbers.", "Math.floor(Math.random() * (max - min + 1)) + min", "By using this we can control the output of a random number." ], @@ -956,7 +958,7 @@ "We can use if statements in JavaScript to only execute code if a certain condition is met.", "if statements require some sort of boolean condition evaluate.", "Example:", - " if (1 == 2) {", + " if (1 == 2) {", "  return(true);", "}", "else {", @@ -992,7 +994,7 @@ "title": "Sift through Text with Regular Expressions", "difficulty":"9.984", "description":[ - "Regular expressions are way to find certain words or patterns inside of strings.", + "Regular expressions are used to find certain words or patterns inside of strings.", "For example, if we wanted to find the number of times the word the occurred in the string The dog chased the cat, we could use the following regular expression: \/the+\/gi", "Let's break this down a bit:", "the is the pattern we want to match.", @@ -1092,7 +1094,7 @@ ], "tests":[ "assert(test === 36, 'Your RegEx should have found seven spaces in the testString.');", - "assert(editor.getValue().match(/\\/\\\\S\\/gi/gi), 'You should be using the following expression /\\S+/gi to find the spaces in the testString.');" + "assert(editor.getValue().match(/\\/\\\\S\\/gi/gi), 'You should be using the following expression /\\+S/gi to find the spaces in the testString.');" ], "challengeSeed":[ "var test = (function(){", diff --git a/seed/challenges/bootstrap.json b/seed/challenges/bootstrap.json index 8d1ed23a7f..a58be9f38b 100644 --- a/seed/challenges/bootstrap.json +++ b/seed/challenges/bootstrap.json @@ -898,7 +898,7 @@ "\"An", "By using the span element, you can put several elements together, and even style different parts of the same element differently.", "Nest the word \"love\" in your \"Things cats love\" element below within a span element. Then give that span the class text-danger to make the text red.", - "Here's how you would do this with the \"Top 3 things cats hate\" element: <p>Top 3 things cats <span class\"text-danger\">hate</span></p>" + "Here's how you would do this with the \"Top 3 things cats hate\" element: <p>Top 3 things cats <span class = \"text-danger\">hate</span></p>" ], "tests": [ "assert($(\"p span\") && $(\"p span\").length > 0, 'Your span element should be inside your p element.')", diff --git a/seed/challenges/html5-and-css.json b/seed/challenges/html5-and-css.json index ab8efd79ca..1539cd45b9 100644 --- a/seed/challenges/html5-and-css.json +++ b/seed/challenges/html5-and-css.json @@ -491,7 +491,7 @@ "description": [ "Apply the red-text class to your h2 and p elements.", "Remember that you can attach classes to HTML elements by using class=\"your-class-here\" within the relevant element's opening tag.", - "Remember that CSS selectors require a period at the beginning like this: .blue-text { color: blue; }, but that class declarations don't use a period, like this: <h2 class=\"blue-text\">CatPhotoApp<h2>." + "Remember that CSS class selectors require a period at the beginning like this: .blue-text { color: blue; }, but that class declarations don't use a period, like this: <h2 class=\"blue-text\">CatPhotoApp<h2>." ], "tests": [ "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your h2 element should be red.')", @@ -2530,14 +2530,14 @@ "difficulty": 1.392, "description": [ "One cool thing about id attributes is that, like classes, you can style them using CSS.", - "Here's an example of how you can take your element with the id attribute of cat-photo-element and give it the background color of green. In your style element: #cat-photo-element { background-color: green; }>", + "Here's an example of how you can take your element with the id attribute of cat-photo-element and give it the background color of green. In your style element: #cat-photo-element { background-color: green; }", "Note that inside your style element, you always reference classes by putting a . in front of their names. You always reference ids by putting a # in front of their names.", "Try giving your form, which now has the id attribute of cat-photo-form, a green background." ], "tests": [ "assert($(\"form\").attr(\"id\") === \"cat-photo-form\", 'Give your form element the id of cat-photo-form.')", "assert($(\"#cat-photo-form\").css(\"background-color\") === \"rgb(0, 128, 0)\", 'Your form element should have the background-color of green.')", - "assert(editor.match(//gi) && editor.match(//gi).length > 0, 'Make sure your form element has both an id attribute.')", + "assert(editor.match(//gi) && editor.match(//gi).length > 0, 'Make sure your form element has an id attribute.')", "assert(!editor.match(//gi) && !editor.match(//gi), 'Do not give your form any class or style attributes.')" ], "challengeSeed": [ diff --git a/seed/challenges/intermediate-bonfires.json b/seed/challenges/intermediate-bonfires.json index 10c1c35bcf..e4811bcb1c 100644 --- a/seed/challenges/intermediate-bonfires.json +++ b/seed/challenges/intermediate-bonfires.json @@ -71,10 +71,10 @@ ], "MDNlinks": [ "Comparison Operators", - "String.slice()", + "Array.slice()", "Array.filter()", "Array.indexOf()", - "String.concat()" + "Array.concat()" ], "type": "bonfire", "challengeType": 5, diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index f2dfcb08e1..d6a6fa0fb0 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -624,7 +624,7 @@ "Here's an example of how you would use the parent() function: $(\"#left-well\").parent().css(\"background-color\", \"blue\")" ], "tests": [ - "assert($(\"#left-well\").css(\"background-color\") === 'rgb(255, 0, 0)', 'Your left-well element should have a red background.')", + "assert($(\"#left-well\").css(\"background-color\") === 'red' || $(\"#left-well\").css(\"background-color\") === 'rgb(255, 0, 0)' || $(\"#left-well\").css(\"background-color\").toLowerCase() === '#ff0000' || $(\"#left-well\").css(\"background-color\").toLowerCase() === '#f00', 'Your left-well element should have a red background.')", "assert(editor.match(/\\.parent\\(\\)\\.css/g), 'You should use the parent() function to modify this element.')", "assert(editor.match(/
/g), 'Only use jQuery to add these classes to the element.')" ], @@ -730,7 +730,7 @@ "description": [ "You've seen why id attributes are so convenient for targeting with jQuery selectors. But you won't always have such neat ids to work with.", "Fortunately, jQuery has some other tricks for targeting the right elements.", - "jQuery has a function called :nth-child() that will allow you select the nth element of a certain class or element type.", + "jQuery uses CSS Selectors to target elements. target:nth-child(n) css selector allows you to select all the nth element with the target class or element type.", "Make the second child in each of your well elements bounce.", "Here's how you would give the third element in each well bounce: $(\".target:nth-child(3)\").addClass(\"animated bounce\");" ], diff --git a/seed/challenges/object-oriented-and-functional-programming.json b/seed/challenges/object-oriented-and-functional-programming.json index 5a4587dca5..307563795b 100644 --- a/seed/challenges/object-oriented-and-functional-programming.json +++ b/seed/challenges/object-oriented-and-functional-programming.json @@ -233,13 +233,13 @@ "difficulty":0, "description":[ "filter is a useful method that can filter out values that don't match a certain criteria", - "Let's remove all the values greater than six", + "Let's remove all the values greater than five", "array = array.filter(function(val) {", "  return(val<4);", "});" ], "tests":[ - "assert.deepEqual(array, [1,2,3,4,5], 'You should have removed all the values from the array that are less than six');", + "assert.deepEqual(array, [1,2,3,4,5], 'You should have removed all the values from the array that are greater than five');", "assert(editor.getValue().match(/array\\.filter\\(/gi), 'You should be using the filter method to remove the values from the array');", "assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\,6\\,7\\,8\\,9\\,10\\]/gi), 'You should only be using .filter to modify the contents of the array');" ], diff --git a/server/middlewares/error-handlers.js b/server/middlewares/error-handlers.js index 2563852653..359d713272 100644 --- a/server/middlewares/error-handlers.js +++ b/server/middlewares/error-handlers.js @@ -22,7 +22,7 @@ export default function prodErrorHandler() { var accept = accepts(req); var type = accept.type('html', 'json', 'text'); - var message = 'opps! Something went wrong. Please try again later'; + var message = 'Oops! Something went wrong. Please try again later'; if (type === 'html') { if (typeof req.flash === 'function') { req.flash('errors', { diff --git a/server/views/account/signin.jade b/server/views/account/signin.jade index fb1b7bd962..548f1151f8 100644 --- a/server/views/account/signin.jade +++ b/server/views/account/signin.jade @@ -18,7 +18,7 @@ block content i.fa.fa-linkedin | Sign in with LinkedIn br - p Email sign in is temporarily disabled - we are working to fix this ASAP. Try logging in with an above service that uses the same email address as you normally use to sign in with (other than Twitter). + p Email sign in is temporarily disabled - we are working to fix this ASAP. //p // a(href="/email-signup") Or sign up using your email address here. //p diff --git a/server/views/challengeMap/show.jade b/server/views/challengeMap/show.jade index 0853a44f82..ec33939ae7 100644 --- a/server/views/challengeMap/show.jade +++ b/server/views/challengeMap/show.jade @@ -30,7 +30,6 @@ block content .col-xs-12.col-sm-9.col-md-10 li.large-p.faded.negative-10 a(href='#' + challengeBlock.dashedName)= challengeBlock.name - h3= challengeBlock else .hidden-xs.col-sm-3.col-md-2 .progress.progress-bar-padding.text-center.thin-progress-bar diff --git a/server/views/coursewares/showHTML.jade b/server/views/coursewares/showHTML.jade index 9b703804a0..a1e0770a8d 100644 --- a/server/views/coursewares/showHTML.jade +++ b/server/views/coursewares/showHTML.jade @@ -73,7 +73,7 @@ block content textarea#codeEditor(autofocus=true, style='display: none;') .col-md-4.col-lg-3 .hidden-xs.hidden-sm - img.iphone-position.iframe-scroll(src="https://s3.amazonaws.com/freecodecamp/iphone6-frame.png") + img.iphone-position.iframe-scroll(src="https://s3.amazonaws.com/freecodecamp/iphone6-frame.png", style = "z-index: -2;") iframe.iphone.iframe-scroll#preview .spacer #complete-courseware-dialog.modal(tabindex='-1')