some typos and bugs, though didn't seem to fix anything

This commit is contained in:
Tyler Renelle
2012-08-08 20:28:01 -04:00
parent b2cd9c0d0f
commit 29acf91e03
4 changed files with 22 additions and 24 deletions
+7 -7
View File
@@ -302,17 +302,17 @@ ready(function(model) {
daysPassed = helpers.daysBetween(lastCron, today);
if (daysPassed > 0) {
model.set('_user.lastCron', today);
return _.times(daysPassed, (function() {
return scoring.tally(model);
}));
return _(daysPassed).times(function() {
return scoring.tally(model.at('_user'));
});
}
};
setTimeout((function() {
setTimeout(function() {
return poormanscron();
}), 2000);
setInterval((function() {
}, 2000);
setInterval(function() {
return poormanscron();
}), 3600000);
}, 3600000);
exports.endOfDayTally = function(e, el) {
return scoring.tally(model);
};
+4 -5
View File
@@ -108,9 +108,8 @@ module.exports.score = score = function(spec) {
return delta;
};
module.exports.tally = function(model) {
var expTally, lvl, todoTally, user;
user = model.at('_user');
module.exports.tally = function(user) {
var expTally, lvl, todoTally;
todoTally = 0;
_.each(user.get('tasks'), function(taskObj, taskId, list) {
var absVal, completed, task, type, value, _ref;
@@ -144,7 +143,7 @@ module.exports.tally = function(model) {
}
}
});
model.push('_user.history.todos', {
user.push('history.todos', {
date: new Date(),
value: todoTally
});
@@ -154,7 +153,7 @@ module.exports.tally = function(model) {
lvl++;
expTally += 50 * Math.pow(lvl, 2) - 150 * lvl + 200;
}
return model.push('_user.history.exp', {
return user.push('history.exp', {
date: new Date(),
value: expTally
});