Commit e758460a by Andy Armstrong

Fix staff grading

parent b11bb68d
{% load i18n %} {% load i18n %}
{% load tz %} {% load tz %}
<div class="openassessment__student-info staff-info__student__report"> <div class="openassessment__student-info staff-info__student__report"
data-submission-uuid="{{ submission.uuid }}">
{% if submission %} {% if submission %}
<h2 class="title"> <h2 class="title">
<span class="label"> <span class="label">
......
...@@ -76,10 +76,9 @@ ...@@ -76,10 +76,9 @@
// Install key handler for cancel submission button. // Install key handler for cancel submission button.
$staffTools.on('click', '.action--submit-cancel-submission', function (eventObject) { $staffTools.on('click', '.action--submit-cancel-submission', function (eventObject) {
eventObject.preventDefault(); eventObject.preventDefault();
view.cancelSubmission($(this).data('submission-uuid')); view.cancelSubmission($(this).data('submission-uuid'));
} });
);
// Install change handler for textarea (to enable cancel submission button) // Install change handler for textarea (to enable cancel submission button)
var handleChange = function(eventData) { view.handleCommentChanged(eventData); }; var handleChange = function(eventData) { view.handleCommentChanged(eventData); };
...@@ -99,8 +98,12 @@ ...@@ -99,8 +98,12 @@
// Install a click handler for the submit button // Install a click handler for the submit button
$('.wrapper--staff-assessment .action--submit', view.element).click( $('.wrapper--staff-assessment .action--submit', view.element).click(
function(eventObject) { function(eventObject) {
var target = $(eventObject.currentTarget),
rootElement = target.closest('.openassessment__student-info'),
submissionID = rootElement.data('submission-uuid');
eventObject.preventDefault(); eventObject.preventDefault();
view.submitStaffAssessment(rubric); view.submitStaffAssessment(submissionID, rubric);
} }
); );
} }
...@@ -320,16 +323,18 @@ ...@@ -320,16 +323,18 @@
* *
* @param rubric The rubric being assessed. * @param rubric The rubric being assessed.
*/ */
submitStaffAssessment: function(rubric) { submitStaffAssessment: function(submissionID, rubric) {
// Send the assessment to the server // Send the assessment to the server
var view = this; var view = this;
var baseView = this.baseView; var baseView = this.baseView;
baseView.toggleActionError('staff', null); baseView.toggleActionError('staff', null);
view.staffSubmitEnabled(false); view.staffSubmitEnabled(false);
this.server.staffAssess(rubric.optionsSelected(), rubric.criterionFeedback(), rubric.overallFeedback()) this.server.staffAssess(
rubric.optionsSelected(), rubric.criterionFeedback(), rubric.overallFeedback(), submissionID
)
.done(function() { .done(function() {
view.loadStudentInfo({expanded_view: 'staff-override'}); view.loadStudentInfo({expanded_view: 'final-grade'});
}) })
.fail(function(errorMessage) { .fail(function(errorMessage) {
baseView.toggleActionError('staff', errorMessage); baseView.toggleActionError('staff', errorMessage);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment