MDL-76801 mod_assign: grader ux fixes on "requires grading"

- refresh list when the user is graded hence no longer in the list
- hide the CTA buttons when no user is selected
This commit is contained in:
Andrew Gosali
2025-03-07 15:53:46 +08:00
parent 688478cfa4
commit 844b0c0dbd
6 changed files with 19 additions and 4 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8
View File
@@ -61,6 +61,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
this._region.find('[data-region="user-resettable"]').on('click', this._toggleResetTable.bind());
$(document).on('user-changed', this._refreshSelector.bind(this));
$(document).on('reset-table', this._toggleResetTable.bind(this));
$(document).on('done-saving-show-next', this._handleNextUser.bind(this));
// Position the configure filters panel under the link that expands it.
@@ -158,6 +159,9 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
var configPanel = $(document.getElementById(toggleLink.attr('aria-controls')));
configPanel.find('select[name="filter"]').trigger('change');
$('[data-region="grade-panel"]').show();
$('[data-region="grade-actions-panel"]').show();
} else {
this._selectNoUser();
}
@@ -289,6 +293,10 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',
if (this._isLoading) {
return;
}
$('[data-region="grade-panel"]').hide();
$('[data-region="grade-actions-panel"]').hide();
if (checker.checkFormForChanges('[data-region="grade-panel"] .gradeform')) {
// Form has changes, so we need to confirm before switching users.
str.get_strings([
+7
View File
@@ -327,6 +327,13 @@ define([
// Reload the grading form "fragment" for this user.
var params = {userid: userid, attemptnumber: attemptnumber, jsonformdata: JSON.stringify(submissiondata)};
fragment.loadFragment('mod_assign', 'gradingpanel', contextid, params).done(function(html, js) {
// Reset whole grading page when there is a failure in retrieving the html
// i.e. user no longer under "requires grading" filter when graded
if (html === '') {
$(document).trigger('reset-table', true);
}
this._niceReplaceNodeContents(this._region, html, js)
.done(function() {
checker.saveFormState('[data-region="grade-panel"] .gradeform');