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)}}
Sorry, you have not been chosen for grading this. First select this for grading, go to the 'Select for grading' menu.
{{else}} - + {{#unless selectedDeliverable.finalized}} + + {{/unless}}
Event name and deliverable description:
{{selectedEvent.EventTemplate.name}} {{selectedDeliverable.DeliverableTemplate.description}}
Student
@@ -96,13 +98,16 @@
Not uploaded.
{{/if}}
Grade
- {{input type=nubmer value=selectedDeliverable.grade placeholder="grade"}} + {{input type=nubmer value=selectedDeliverable.grade placeholder="grade" disabled=selectedDeliverable.finalized}}
Comment
- {{textarea value=selectedDeliverable.comment cols="9" rows="9" placeholder="comment" }} + {{textarea value=selectedDeliverable.comment cols="9" rows="9" placeholder="comment" disabled=selectedDeliverable.finalized}}
Imsc
- {{input type=nubmer value=selectedDeliverable.imsc placeholder="imsc"}} -
- + {{input type=nubmer value=selectedDeliverable.imsc placeholder="imsc" disabled=selectedDeliverable.finalized}} + {{#if selectedDeliverable.finalized}} +
Finalized. If you want to change ask the administrator.
+ {{else}} + + {{/if}} {{#if success}}
Saved successfully.