diff --git a/controllers/bonfire.js b/controllers/bonfire.js index 837af5e722..57949efd8d 100644 --- a/controllers/bonfire.js +++ b/controllers/bonfire.js @@ -38,7 +38,7 @@ exports.index = function(req, res) { exports.returnNextBonfire = function(req, res) { if (!req.user) { - return res.redirect('bonfires/meet-bonfire'); + return res.redirect('../bonfires/meet-bonfire'); } var completed = req.user.completedBonfires.map(function (elem) { return elem._id; @@ -76,7 +76,7 @@ exports.returnIndividualBonfire = function(req, res, next) { bonfire = bonfire.pop() var dashedNameFull = bonfire.name.toLowerCase().replace(/\s/g, '-'); if (dashedNameFull != dashedName) { - return res.redirect('/bonfires/' + dashedNameFull); + return res.redirect('../bonfires/' + dashedNameFull); } if (bonfire.length < 1) { req.flash('errors', { diff --git a/public/fonts/glyphicons-halflings-regular.eot b/public/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 0000000000..b93a4953ff Binary files /dev/null and b/public/fonts/glyphicons-halflings-regular.eot differ diff --git a/public/js/lib/bonfire/bonfireFramework.js b/public/js/lib/bonfire/bonfireFramework.js index 965dca2968..95d8bada06 100644 --- a/public/js/lib/bonfire/bonfireFramework.js +++ b/public/js/lib/bonfire/bonfireFramework.js @@ -116,7 +116,6 @@ function bonfireExecute() { if (challengeEntryPoint && challengeSeed) { userJavaScript = challengeEntryPoint + ' ' + userJavaScript; } - console.log(userJavaScript); submit(userJavaScript, function(cls, message) { if (cls) { codeOutput.setValue(message.error); @@ -210,7 +209,6 @@ var runTests = function(err, data) { userTests.forEach(function(test, ix, arr){ try { if (test) { - console.log(); var output = eval(reassembleTest(test, data)); } } catch(error) { @@ -232,7 +230,8 @@ var runTests = function(err, data) { }; function showCompletion() { - - ga('send', 'event', 'Bonfire', 'solved', bonfireName + ', Time: ' + (Math.floor(Date.now() / 1000) - started) +', Attempts: ' + attempts); + var time = Math.floor(Date.now() / 1000) - started; + console.log(time); + ga('send', 'event', 'Bonfire', 'solved', bonfireName + ', Time: ' + time +', Attempts: ' + attempts); $('#complete-bonfire-dialog').modal('show'); } \ No newline at end of file diff --git a/public/js/main.js b/public/js/main.js index 08a8795975..e5352c30b5 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -1,5 +1,5 @@ $(document).ready(function() { - if (bonfireName !== undefined) { + if (bonfireName) { ga('send', 'event', 'Bonfire', 'load', bonfireName + ':' + Math.floor(Date.now() / 1000)); } diff --git a/seed_data/bonfires.json b/seed_data/bonfires.json index ee18c6eede..9fc3dacad9 100644 --- a/seed_data/bonfires.json +++ b/seed_data/bonfires.json @@ -149,22 +149,23 @@ "expect(sumAll([10, 5])).to.equal(45);" ] }, - { "_id": "a5229172f011153519423690", "name": "Sum All Odd Fibonacci Numbers", - "difficulty": "2.01", "description": [ - "Return the sum of all odd fibonacci numbers up to and including the passed number.", - "Starting from 1, the first few numbers of a Fibonacci sequence are 1, 2, 3, 5 and 8, and each subsequent number is the sum of the previous two numbers." + "Return the sum of all odd fibonacci numbers up to and including the passed number if it is a fibonacci number.", + "The first few numbers of the Fibonacci sequence are 1, 1, 2, 3, 5 and 8, and each subsequent number is the sum of the previous two numbers.", + "As an example, passing 4 to the function should return 5 because all the odd fibonacci numbers under 4 are 1, 1, and 3." ], - "challengeEntryPoint": "sumFibs(1000);", + "challengeEntryPoint": "sumFibs(4);", "challengeSeed": "function sumFibs(num) {\n return num;\r\n}", "tests": [ "expect(sumFibs(1)).to.be.a('number');", - "expect(sumFibs(1000)).to.equal(3382);", - "expect(sumFibs(4000000)).to.equal(10316619);", - "expect(sumFibs(4)).to.equal(10);" + "expect(sumFibs(1000)).to.equal(1785);", + "expect(sumFibs(4000000)).to.equal(4613732);", + "expect(sumFibs(4)).to.equal(5);", + "expect(sumFibs(75024)).to.equal(60696);", + "expect(sumFibs(75025)).to.equal(135721);" ] }, { diff --git a/views/challenges/show.jade b/views/challenges/show.jade index 19a4718cba..13dc136c08 100644 --- a/views/challenges/show.jade +++ b/views/challenges/show.jade @@ -4,6 +4,8 @@ block content .col-sm-12.col-md-12.col-xs-12 .panel.panel-primary .panel-heading.text-center #{name} (takes #{time} minutes) + script. + var bonfireName = null; .panel.panel-body .embed-responsive.embed-responsive-16by9 iframe.embed-responsive-item(src='//player.vimeo.com/video/#{video}')