add verified flag to challenges so we can tell which ziplines and basejumps have been verified

This commit is contained in:
Michael Q Larson
2015-04-02 14:07:00 -07:00
parent 36c43cc73a
commit 97e59d4568
4 changed files with 19 additions and 23 deletions

View File

@ -253,7 +253,8 @@ exports.completedCourseware = function (req, res, next) {
completedDate: isCompletedDate,
name: req.body.coursewareInfo.coursewareName,
solution: null,
githubLink: null
githubLink: null,
verified: true
});
var index = req.user.completedCoursewares.indexOf(coursewareHash);
@ -307,7 +308,8 @@ exports.completedZiplineOrBasejump = function (req, res, next) {
completedWith: pairedWith._id,
completedDate: isCompletedDate,
solution: solutionLink,
githubLink: githubLink
githubLink: githubLink,
verified: false
});
req.user.save(function (err, user) {
@ -333,7 +335,8 @@ exports.completedZiplineOrBasejump = function (req, res, next) {
completedWith: req.user._id,
completedDate: isCompletedDate,
solution: solutionLink,
githubLink: githubLink
githubLink: githubLink,
verified: false
});
pairedWith.save(function (err, paired) {
if (err) {
@ -353,7 +356,8 @@ exports.completedZiplineOrBasejump = function (req, res, next) {
completedWith: null,
completedDate: isCompletedDate,
solution: solutionLink,
githubLink: githubLink
githubLink: githubLink,
verified: false
});
var index = req.user.uncompletedCoursewares.indexOf(coursewareHash);

View File

@ -118,8 +118,7 @@ $(document).ready(function() {
{
coursewareInfo: {
coursewareHash: passedCoursewareHash,
coursewareName: passedCoursewareName,
verified: true
coursewareName: passedCoursewareName
}
}).success(
function(res) {
@ -140,8 +139,7 @@ $(document).ready(function() {
coursewareName: passedCoursewareName,
completedWith: didCompleteWith,
publicURL: publicURL,
challengeType: challengeType,
verified: false
challengeType: challengeType
}
}).success(
function() {

View File

@ -97,7 +97,7 @@ block content
| Try it out
.hidden-xs.col-sm-12
#cal-heatmap.img-center.hidden
#cal-heatmap.img-center
script(src="//d3js.org/d3.v3.min.js")
script(src="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.min.js")
link(rel="stylesheet", href="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.css")
@ -122,13 +122,5 @@ block content
.row
.hidden-xs.col-sm-12.text-center
.row
h3.col-sm-6.text-center
.center-block.
#{longestStreak}
.center-block.
Longest Streak
h3.col-sm-6.text-center
.center-block.
#{currentStreak}
.center-block.
Current Streak
h3.col-sm-6.text-right Longest Streak: #{longestStreak}
h3.col-sm-6.text-left Current Streak #{currentStreak}

View File

@ -1,6 +1,8 @@
script(src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js")
script(src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js")
script(src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.0/ui-bootstrap-tpls.min.js")
script(src="//d3js.org/d3.v3.min.js")
script(src="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.min.js")
include meta
title #{title} | Free Code Camp
meta(charset='utf-8')