       cb err, session._id
 
 retrieveAllOpponentSessionIDs = (sessionID, cb) ->
-  query = LevelSession.findOne({'_id': sessionID})
-  .select('matches.opponents.sessionID matches.date submitDate')
-  .lean()
+  query = LevelSession.findOne({_id: sessionID})
+    .select('matches.opponents.sessionID matches.date submitDate')
+    .lean()
   query.exec (err, session) ->
     if err? then return cb err, null
     opponentSessionIDs = (match.opponents[0].sessionID for match in session.matches when match.date > session.submitDate)

    callback 'The response to that query is required to be a JSON object.'
  else
    @clientResponseObject = responseObject

    #log.info 'Verified client response!'
    callback null, responseObject

fetchTaskLog = (responseObject, callback) ->
  query = TaskLog.findOne _id: responseObject.taskID
  query.exec (err, taskLog) =>
    return callback new Error("Couldn't find TaskLog for _id #{responseObject.taskID}!") unless taskLog
    @taskLog = taskLog
    #log.info 'Fetched task log!'
    callback err, taskLog.toObject()

checkTaskLog = (taskLog, callback) ->
  if taskLog.calculationTimeMS then return callback 'That computational task has already been performed'
  if hasTaskTimedOut taskLog.sentDate then return callback 'The task has timed out'
  #log.info 'Checked task log'
  callback null

deleteQueueMessage = (callback) ->
  scoringTaskQueue.deleteMessage @clientResponseObject.receiptHandle, (err) ->
    #log.info 'Deleted queue message'
    callback err

fetchLevelSession = (callback) ->
  findParameters =
    _id: @clientResponseObject.originalSessionID

  query = LevelSession
  .findOne(findParameters)
  .lean()
  query.exec (err, session) =>
    @levelSession = session
    #log.info 'Fetched level session'
    callback err

checkSubmissionDate = (callback) ->

  sessionID = @clientResponseObject.originalSessionID
  sessionRank = parseInt @clientResponseObject.originalSessionRank

  queryParameters = _id: sessionID
  updateParameters = '$inc': {}

  if sessionRank is 0
    updateParameters['$inc'] = {numberOfWinsAndTies: 1}
  else
    updateParameters['$inc'] = {numberOfLosses: 1}

  LevelSession.findOneAndUpdate queryParameters, updateParameters, {select: 'numberOfWinsAndTies numberOfLosses', lean: true}, (err, updatedSession) ->
    if err? then return cb err, updatedSession

    totalNumberOfGamesPlayed = updatedSession.numberOfWinsAndTies + updatedSession.numberOfLosses
    if totalNumberOfGamesPlayed < 10
