Fix bug where users could get points for completing the same challenge.
This commit is contained in:
@ -258,7 +258,7 @@ exports.completedCourseware = function (req, res, next) {
|
||||
});
|
||||
var index = req.user.completedCoursewares.indexOf(coursewareHash);
|
||||
|
||||
if (index === -1) {
|
||||
if (index > -1) {
|
||||
req.user.progressTimestamps.push(Date.now() || 0);
|
||||
req.user.uncompletedCoursewares.splice(index, 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user