Working on unifying coursewares view and logic

This commit is contained in:
Nathan Leniz
2015-03-21 13:42:02 +09:00
parent 6aaebbf34e
commit b35f5ca59c
4 changed files with 473 additions and 506 deletions

View File

@ -177,13 +177,13 @@ module.exports = {
req.user.save();
}
}
var date1 = new Date("10/15/2014");
var date1 = new Date('10/15/2014');
var date2 = new Date();
var progressTimestamps = req.user.progressTimestamps;
var now = Date.now() / 1000 | 0;
if (req.user.pointsNeedMigration) {
var challengesHash = req.user.challengesHash;
for(var key in challengesHash) {
for (var key in challengesHash) {
if (challengesHash[key] > 0) {
req.user.progressTimestamps.push(challengesHash[key]);
}
@ -270,6 +270,11 @@ module.exports = {
});
},
getAllCourses: function() {
"use strict";
return coursewares;
},
allCoursewareIds: function() {
return coursewares.map(function(elem) {
return {