Skip to content

Commit

Permalink
So not save solution if solved
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Feb 22, 2019
1 parent 000295f commit 0c157a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/controllers/AssignmentController.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ module.exports = class AssignmentController extends classMixin(OrderedDataContro
}
)

await solutionModel.update({ data: solution })
if (!parameterizedAssignment.dataValues.solved) {
await solutionModel.update({ data: solution })
}
} catch (e) {
logger.error(`${e.constructor.name}: ${e.message}`)
const errorType = e.constructor.name
Expand All @@ -118,7 +120,7 @@ module.exports = class AssignmentController extends classMixin(OrderedDataContro
)
}

if (judgement.grade > 0) {
if (judgement.grade > 0 && !parameterizedAssignment.dataValues.solved) {
await parameterizedAssignment.update({ solved: true })
}

Expand Down

0 comments on commit 0c157a4

Please sign in to comment.