This commit is contained in:
Michael Q Larson
2015-02-08 23:46:23 -08:00
12 changed files with 22 additions and 10 deletions

2
app.js
View File

@ -319,7 +319,7 @@ app.post('/completed-challenge', function (req, res) {
var timestamp = req.user.challengesHash; var timestamp = req.user.challengesHash;
var points = 0; var points = 0;
for (var key in timestamp) { for (var key in timestamp) {
if (timestamp[key] > 0) { if (timestamp[key] > 0 && req.body.challengeNumber < 54) {
points += 1; points += 1;
} }
} }

View File

@ -11,7 +11,12 @@ var highestChallengeNumber = 53;
exports.returnChallenge = function(req, res, next) { exports.returnChallenge = function(req, res, next) {
var challengeNumber = parseInt(req.params.challengeNumber) || 0; var challengeNumber = parseInt(req.params.challengeNumber) || 0;
if (challengeNumber > highestChallengeNumber) { challengeNumber = 0; } if (challengeNumber > highestChallengeNumber) {
req.flash('errors', {
msg: "It looks like you've either completed all the challenges we have available or requested a challenge we don't have."
});
return res.redirect('../challenges/0');
}
Challenge.find({}, null, { sort: { challengeNumber: 1 } }, function(err, c) { Challenge.find({}, null, { sort: { challengeNumber: 1 } }, function(err, c) {
if (err) { if (err) {
debug('Challenge err: ', err); debug('Challenge err: ', err);

View File

@ -16,7 +16,7 @@ exports.coursewareNames = function(req, res) {
exports.returnNextCourseware = function(req, res) { exports.returnNextCourseware = function(req, res) {
if (!req.user) { if (!req.user) {
return res.redirect('coursewares/intro'); return res.redirect('coursewares/start-our-challenges');
} }
var completed = req.user.completedCoursewares.map(function (elem) { var completed = req.user.completedCoursewares.map(function (elem) {
return elem._id; return elem._id;
@ -41,7 +41,7 @@ exports.returnNextCourseware = function(req, res) {
req.flash('errors', { req.flash('errors', {
msg: "It looks like you've completed all the courses we have available. Good job!" msg: "It looks like you've completed all the courses we have available. Good job!"
}) })
return res.redirect('../coursewares/intro'); return res.redirect('../coursewares/start-our-challenges');
} }
nameString = courseware.name.toLowerCase().replace(/\s/g, '-'); nameString = courseware.name.toLowerCase().replace(/\s/g, '-');
return res.redirect('../coursewares/' + nameString); return res.redirect('../coursewares/' + nameString);

View File

@ -34,7 +34,6 @@ editor.setOption("extraKeys", {
editor.setSize("100%", "auto"); editor.setSize("100%", "auto");
var libraryIncludes = "<script src='//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>" + var libraryIncludes = "<script src='//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>" +
"<script>document.domain = 'localhost'</script>" +
"<script src='/js/lib/chai/chai.js'></script>" + "<script src='/js/lib/chai/chai.js'></script>" +
"<script src='/js/lib/chai/chai-jquery.js'></script>" + "<script src='/js/lib/chai/chai-jquery.js'></script>" +
"<script src='//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js'></script>" + "<script src='//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js'></script>" +

View File

@ -42,4 +42,4 @@ block content
br br
ul#testSuite.list-group ul#testSuite.list-group
br br
script(src='/js/lib/bonfire/bonfireFramework.js') script(src='/js/lib/bonfire/bonfireFramework_v0.1.0.js')

View File

@ -96,7 +96,7 @@ block content
form.code form.code
.form-group.codeMirrorView .form-group.codeMirrorView
textarea#codeEditor(autofocus=true) textarea#codeEditor(autofocus=true)
script(src='/js/lib/bonfire/bonfireFramework.js') script(src='/js/lib/bonfire/bonfireFramework_v0.1.0.js')

View File

@ -45,3 +45,5 @@ block content
button.btn.btn-primary(type='submit', ng-disabled='nonprofitForm.$invalid') button.btn.btn-primary(type='submit', ng-disabled='nonprofitForm.$invalid')
span.ion-paper-airplane span.ion-paper-airplane
| Submit | Submit
script.
var challengeName = 'Non-profit Interest'

View File

@ -60,7 +60,7 @@ block content
form.code form.code
.form-group.codeMirrorView .form-group.codeMirrorView
textarea#codeEditor(autofocus=true) textarea#codeEditor(autofocus=true)
script(src='/js/lib/coursewares/coursewaresFramework.js') script(src='/js/lib/coursewares/coursewaresFramework_v0.1.0.js')
.col-md-4.col-lg-3 .col-md-4.col-lg-3
.hidden-xs.hidden-sm .hidden-xs.hidden-sm
img.iphone-position(src="https://s3.amazonaws.com/freecodecamp/iphone6-frame.png") img.iphone-position(src="https://s3.amazonaws.com/freecodecamp/iphone6-frame.png")

View File

@ -85,3 +85,5 @@ block content
li.ion-code &nbsp; We all share one common goal: to boost our careers with code li.ion-code &nbsp; We all share one common goal: to boost our careers with code
.big-break .big-break
a.btn.btn-cta.signup-btn(href="/login") Learn to code today (it's free) a.btn.btn-cta.signup-btn(href="/login") Learn to code today (it's free)
script.
challengeName = 'Home'

View File

@ -1,5 +1,7 @@
extends ../layout extends ../layout
block content block content
script.
var challengeName = 'Learn to code'
include ../partials/stats include ../partials/stats
include ../partials/blog include ../partials/blog
include ../partials/about include ../partials/about

View File

@ -36,3 +36,5 @@ block content
<h3>Acceptance of Privacy Policy Terms and Conditions</h3> <h3>Acceptance of Privacy Policy Terms and Conditions</h3>
<p>By using this site, you signify your agreement to the terms and conditions of this FreeCodeCamp.com Privacy Policy. If you do not agree to these terms, please do not use this site. We reserve the right, at our sole discretion, to change, modify, add, or remove portions of this policy at any time. All amended terms automatically take effect 30 days after they are initially posted on the site. Please check this page periodically for any modifications. Your continued use of FreeCodeCamp.com following the posting of any changes to these terms shall mean that you have accepted those changes.</p> <p>By using this site, you signify your agreement to the terms and conditions of this FreeCodeCamp.com Privacy Policy. If you do not agree to these terms, please do not use this site. We reserve the right, at our sole discretion, to change, modify, add, or remove portions of this policy at any time. All amended terms automatically take effect 30 days after they are initially posted on the site. Please check this page periodically for any modifications. Your continued use of FreeCodeCamp.com following the posting of any changes to these terms shall mean that you have accepted those changes.</p>
<p>If you have any questions or concerns, please send an e-mail to <a href="mailto:team@freecodecamp.com" target="_blank">team@freecodecamp.com</a>.</p> <p>If you have any questions or concerns, please send an e-mail to <a href="mailto:team@freecodecamp.com" target="_blank">team@freecodecamp.com</a>.</p>
script.
var challengeName = 'Privacy';