score submit fix for spring semester
This commit is contained in:
@@ -32,9 +32,20 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
toggleCommentCheckbox(wrapper);
|
||||
});
|
||||
|
||||
let lastSubmitterId = null;
|
||||
form.addEventListener('click', function (event) {
|
||||
const target = event.target.closest('button, input[type="submit"]');
|
||||
if (!target || target.form !== form) return;
|
||||
lastSubmitterId = target.id || null;
|
||||
});
|
||||
|
||||
form.addEventListener('submit', function (event) {
|
||||
const submitter = event.submitter;
|
||||
if (!submitter || submitter.id !== 'submitScoresLockBtn') {
|
||||
const activeEl = document.activeElement;
|
||||
const submitterId = event.submitter
|
||||
? event.submitter.id
|
||||
: (activeEl && activeEl.form === form ? activeEl.id : lastSubmitterId);
|
||||
lastSubmitterId = null;
|
||||
if (submitterId !== 'submitScoresLockBtn') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user