wire in points for courseware and bonfire
This commit is contained in:
@ -225,15 +225,17 @@ exports.completedBonfire = function (req, res) {
|
||||
return err;
|
||||
} else {
|
||||
var index = req.user.uncompletedBonfires.indexOf(bonfireHash);
|
||||
|
||||
if (index > -1) {
|
||||
req.user.points++;
|
||||
req.user.uncompletedBonfires.splice(index, 1)
|
||||
}
|
||||
pairedWith = pairedWith.pop();
|
||||
|
||||
index = pairedWith.uncompletedBonfires.indexOf(bonfireHash);
|
||||
if (index > -1) {
|
||||
pairedWith.uncompletedBonfires.splice(index, 1)
|
||||
pairedWith.points++;
|
||||
pairedWith.uncompletedBonfires.splice(index, 1);
|
||||
|
||||
}
|
||||
|
||||
pairedWith.completedBonfires.push({
|
||||
@ -241,7 +243,7 @@ exports.completedBonfire = function (req, res) {
|
||||
completedWith: req.user._id,
|
||||
completedDate: isCompletedDate,
|
||||
solution: isSolution
|
||||
})
|
||||
});
|
||||
|
||||
req.user.completedBonfires.push({
|
||||
_id: bonfireHash,
|
||||
@ -273,6 +275,7 @@ exports.completedBonfire = function (req, res) {
|
||||
|
||||
var index = req.user.uncompletedBonfires.indexOf(bonfireHash);
|
||||
if (index > -1) {
|
||||
req.user.points++;
|
||||
req.user.uncompletedBonfires.splice(index, 1)
|
||||
}
|
||||
|
||||
|
@ -161,6 +161,7 @@ exports.completedCourseware = function (req, res) {
|
||||
|
||||
var index = req.user.uncompletedCoursewares.indexOf(coursewareHash);
|
||||
if (index > -1) {
|
||||
req.user.points++;
|
||||
req.user.uncompletedCoursewares.splice(index, 1)
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
[
|
||||
{
|
||||
"_id" : "ad7123c8c441eddfaeb5bdef",
|
||||
"name": "Meet Bonfire!",
|
||||
"name": "Meet Bonfire",
|
||||
"difficulty": "0",
|
||||
"description": [
|
||||
"Click the button below for further instructions.",
|
||||
|
Reference in New Issue
Block a user