diff --git a/app/controllers/evaluator.js b/app/controllers/evaluator.js index bf2158f..f38cf76 100644 --- a/app/controllers/evaluator.js +++ b/app/controllers/evaluator.js @@ -151,14 +151,6 @@ export default Ember.Controller.extend({ this.actions.changeDeliverable.apply(this, [{ meta: deliverable }]); return false; }, - toggleFinalized() { - this.toggleProperty('selectedDeliverable.finalized'); - return false; - }, - toggleGrading() { - this.toggleProperty('selectedDeliverable.gradingCache'); - return false; - }, book() { this.set('success', false); this.set('error', ''); @@ -199,6 +191,15 @@ export default Ember.Controller.extend({ if (this.get('selectedDeliverable.imsc') === '') { this.set('selectedDeliverable.imsc', null); } + if (this.get('selectedDeliverable.grade') === null) { + this.set('error', 'No grade provided.'); + return; + } + if (this.get('selectedDeliverable.comment') === null) { + this.set('error', 'No comment provided.'); + return; + } + this.set('selectedDeliverable.finalized', true); this.get('selectedDeliverable').save().then(() => { this.set('success', true); }, (t) => { diff --git a/app/templates/evaluator.hbs b/app/templates/evaluator.hbs index 706ff13..5d2d3f2 100644 --- a/app/templates/evaluator.hbs +++ b/app/templates/evaluator.hbs @@ -80,7 +80,9 @@ {{#unless (eq selectedDeliverable.Corrector.id model.user.id)}}