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);