Added submitDate to session schema

This commit is contained in:
Michael Schmatz 2014-02-17 09:23:49 -08:00
parent 9b53873414
commit 302a13b6e7
2 changed files with 10 additions and 7 deletions

View file

@ -105,9 +105,6 @@ _.extend LevelSessionSchema.properties,
code:
type: 'object'
submittedCode:
type: 'object'
teamSpells:
type: 'object'
additionalProperties:
@ -137,6 +134,12 @@ _.extend LevelSessionSchema.properties,
default: false
index:true
submitDate:
type: 'date'
submittedCode:
type: 'object'
matches:
type: 'array'
items:

View file

@ -174,7 +174,7 @@ module.exports.processTaskResult = (req, res) ->
if loggingError?
return errors.serverError res, "There as a problem logging the task computation: #{loggingError}"
updateScores clientResponseObject, (updatingScoresError, newScores) ->
updateSessions clientResponseObject, (updatingScoresError, newScores) ->
if updatingScoresError?
return errors.serverError res, "There was an error updating the scores.#{updatingScoresError}"
@ -204,10 +204,10 @@ logTaskComputation = (taskObject,taskLogObject, callback) ->
taskLogObject.save callback
updateScores = (taskObject,callback) ->
updateSessions = (taskObject,callback) ->
sessionIDs = _.pluck taskObject.sessions, 'sessionID'
async.map sessionIDs, retrieveOldScoreMetrics, (err, oldScores) ->
async.map sessionIDs, retrieveOldSessionData, (err, oldScores) ->
callback err, {"error": "There was an error retrieving the old scores"} if err?
oldScoreArray = _.toArray putRankingFromMetricsIntoScoreObject taskObject, oldScores
@ -245,7 +245,7 @@ putRankingFromMetricsIntoScoreObject = (taskObject,scoreObject) ->
scoreObject
retrieveOldScoreMetrics = (sessionID, callback) ->
retrieveOldSessionData = (sessionID, callback) ->
sessionQuery =
"_id":sessionID