Index: openacs-4/packages/proctoring-support/www/resources/proctored-page.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/proctoring-support/www/resources/proctored-page.js,v diff -u -r1.1.2.25 -r1.1.2.26 --- openacs-4/packages/proctoring-support/www/resources/proctored-page.js 15 Dec 2022 11:18:39 -0000 1.1.2.25 +++ openacs-4/packages/proctoring-support/www/resources/proctored-page.js 15 Dec 2022 11:32:03 -0000 1.1.2.26 @@ -348,7 +348,7 @@ } if (hasExaminationStatement) { handlers.push(function () { - const acceptButton = document.getElementById('nextBtn'); + const acceptButton = document.querySelector('#nextBtn'); acceptButton.innerHTML = acceptLabel; const clickHandler = function(e) { approveStartExam(); @@ -360,21 +360,21 @@ function showTab(n) { // This function will display the specified tab of the form... - const x = document.getElementsByClassName('tab'); + const x = document.querySelectorAll('.tab'); if (x.length === 0) { return; } x[n].style.display = 'block'; //... and fix the Previous/Next buttons: if (n === 0) { - document.getElementById('prevBtn').style.display = 'none'; + document.querySelector('#prevBtn').style.display = 'none'; } else { - document.getElementById('prevBtn').style.display = 'inline'; + document.querySelector('#prevBtn').style.display = 'inline'; } if (n === (x.length - 1)) { - document.getElementById('nextBtn').innerHTML = submitLabel; + document.querySelector('#nextBtn').innerHTML = submitLabel; } else { - document.getElementById('nextBtn').innerHTML = nextLabel; + document.querySelector('#nextBtn').innerHTML = nextLabel; } //... and run a function that will display the correct step indicator: fixStepIndicator(n); @@ -405,7 +405,7 @@ function nextPrev(n) { // This function will figure out which tab to display - const x = document.getElementsByClassName('tab'); + const x = document.querySelectorAll('.tab'); // Exit the function if any field in the current tab is invalid: if (n === 1 && !validateForm()) return false; // Hide the current tab: @@ -415,8 +415,6 @@ // if you have reached the end of the form... if (currentTab >= x.length) { // ... the form gets submitted: - // location.href = ''; - //document.getElementById('regForm').submit(); startExam(); return false; } @@ -429,19 +427,19 @@ function validateForm() { // If the valid status is true, mark the step as finished and valid: if (valid) { - document.getElementsByClassName('step')[currentTab].className += ' finish'; + document.querySelectorAll('.step')[currentTab].classList.add('finish'); } return valid; // return the valid status } function fixStepIndicator(n) { // This function removes the "active" class of all steps... - const steps = document.getElementsByClassName('step'); + const steps = document.querySelectorAll('.step'); for (const step of steps) { - step.className = step.className.replace(' active', ''); + step.classList.remove('active'); } //... and adds the "active" class on the current step: - steps[n].className += ' active'; + steps[n].classList.add('active'); } const cameraConstraints = {