")
+ .prependTo($('#testSuite'))
+};
+var goodTests = 0;
+var testSuccess = function() {
+ goodTests++;
+ if (goodTests === tests.length) {
+ showCompletion();
+ }
+};
+var challengeSeed = challengeSeed || null;
+var tests = tests || [];
+var allSeeds = '';
+(function() {
+ challengeSeed.forEach(function(elem) {
+ allSeeds += elem.replace(/fccss/g, '') + '\n';
+ });
+ editor.setValue(allSeeds);
+ editor.setCursor(15);
+})();
+
+
+function doLinting () {
+ editor.operation(function () {
+ for (var i = 0; i < widgets.length; ++i)
+ editor.removeLineWidget(widgets[i]);
+ widgets.length = 0;
+ JSHINT(editor.getValue());
+ for (var i = 0; i < JSHINT.errors.length; ++i) {
+ var err = JSHINT.errors[i];
+ if (!err) continue;
+ var msg = document.createElement("div");
+ var icon = msg.appendChild(document.createElement("span"));
+ icon.innerHTML = "!!";
+ icon.className = "lint-error-icon";
+ msg.appendChild(document.createTextNode(err.reason));
+ msg.className = "lint-error";
+ widgets.push(editor.addLineWidget(err.line - 1, msg, {
+ coverGutter: false,
+ noHScroll: true
+ }));
+ }
+ });
+};
+
+//$('#testSuite').empty();
+function showCompletion() {
+ var time = Math.floor(Date.now()) - started;
+ ga('send', 'event', 'Challenge', 'solved', challenge_Name + ', Time: ' + time);
+ $('#next-courseware-button').removeAttr('disabled');
+ $('#next-courseware-button').addClass('animated tada');
+ if (!userLoggedIn) {
+ $('#complete-courseware-dialog').modal('show');
+ }
+ $('body').keydown(function(e) {
+ if (e.ctrlKey && e.keyCode == 13) {
+ $('#next-courseware-button').click();
+ $('#next-courseware-button').unbind('click');
+ }
+ });
+}
diff --git a/seed_data/challenges/basic-bonfires.json b/seed_data/challenges/basic-bonfires.json
index 240e64fe15..9053cde115 100644
--- a/seed_data/challenges/basic-bonfires.json
+++ b/seed_data/challenges/basic-bonfires.json
@@ -19,8 +19,7 @@
"Add them as a new contact in Screen Hero, then click the monitor-looking button to attempt to share your screen with them.",
"Once the Screen Hero session starts, your screen's margins will glow orange. You are now sharing your screen.",
"Your pair will have their own cursor, and will be able to type text on his or her and keyboard.",
- "Now it's time to tackle our Bonfires.",
- "Go to http://freecodecamp.com/bonfires and start working through our Bonfire challenges.",
+ "Now it's time to tackle our Bonfires. You can begin them by advancing to the next challenge.",
"Once you you finish pair programming, end the session in Screen Hero session.",
"Congratulations! You have completed your first pair programming session.",
"Pair program as much as possible with different campers until you've completed all the Bonfire challenges. This is a big time investment, but the JavaScript practice you get will be well worth it!",
@@ -447,6 +446,7 @@
"tests": [
"assert.deepEqual(chunk(['a', 'b', 'c', 'd'], 2), [['a', 'b'], ['c', 'd']], 'should return chunked arrays');",
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'should return chunked arrays');",
+ "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], 'should return chunked arrays');",
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'should return the last chunk as remaining elements');"
],
"MDNlinks": [
diff --git a/seed_data/challenges/basic-html5-and-css.json b/seed_data/challenges/basic-html5-and-css.json
index 5407d93507..38cbb15e25 100644
--- a/seed_data/challenges/basic-html5-and-css.json
+++ b/seed_data/challenges/basic-html5-and-css.json
@@ -133,9 +133,9 @@
"You can start a comment with <!-- and end a comment with -->."
],
"tests": [
- "assert(($('h1').length > 0), 'The h1 element should not commented. It should be visible in the browser.')",
- "assert(($('h2').length > 0), 'The h2 element should not commented. It should be visible in the browser.')",
- "assert(($('p').length > 0), 'The paragraph element should not commented. It should be visible in the browser.')"
+ "assert($('h1').length > 0, 'The h1 element should not be commented. It should be visible in the browser.')",
+ "assert($('h2').length > 0, 'The h2 element should not be commented. It should be visible in the browser.')",
+ "assert($('p').length > 0, 'The paragraph element should not be commented. It should be visible in the browser.')"
],
"challengeSeed": [
"