Updated JS for 'Begin Assessment' button
This commit is contained in:
parent
471453eab8
commit
ac1712f906
1 changed files with 10 additions and 0 deletions
|
|
@ -6,9 +6,11 @@
|
||||||
*/
|
*/
|
||||||
(function($) {
|
(function($) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
console.log('assessment.js loaded'); // Added for debugging
|
||||||
|
|
||||||
$(function() { // Document Ready
|
$(function() { // Document Ready
|
||||||
console.log('Assessment script loaded.');
|
console.log('Assessment script loaded.');
|
||||||
|
console.log('Localized Vars Check:', typeof quiztech_assessment_vars); // Added for debugging
|
||||||
|
|
||||||
// Check if localized data is available
|
// Check if localized data is available
|
||||||
if (typeof quiztech_assessment_vars === 'undefined') {
|
if (typeof quiztech_assessment_vars === 'undefined') {
|
||||||
|
|
@ -86,6 +88,7 @@
|
||||||
* Transitions the UI from the landing/pre-screening view to the assessment view.
|
* Transitions the UI from the landing/pre-screening view to the assessment view.
|
||||||
*/
|
*/
|
||||||
function startAssessmentUI() {
|
function startAssessmentUI() {
|
||||||
|
console.log('startAssessmentUI() function entered.'); // Added for debugging
|
||||||
$landingSection.slideUp();
|
$landingSection.slideUp();
|
||||||
$assessmentSection.slideDown();
|
$assessmentSection.slideDown();
|
||||||
if (totalQuestions > 0) {
|
if (totalQuestions > 0) {
|
||||||
|
|
@ -106,12 +109,17 @@
|
||||||
// --- Event Handlers ---
|
// --- Event Handlers ---
|
||||||
|
|
||||||
// Handle "Begin Assessment" button click
|
// Handle "Begin Assessment" button click
|
||||||
|
console.log('Attaching click handler to #quiztech-begin-assessment'); // Added for debugging
|
||||||
$beginAssessmentButton.on('click', function() {
|
$beginAssessmentButton.on('click', function() {
|
||||||
|
console.log('Begin Assessment button clicked.'); // Added for debugging
|
||||||
|
console.log('Localized Vars Content:', quiztech_assessment_vars); // Added for debugging
|
||||||
var $button = $(this);
|
var $button = $(this);
|
||||||
clearMessage($landingMessages); // Clear previous messages
|
clearMessage($landingMessages); // Clear previous messages
|
||||||
|
|
||||||
// Check if pre-screening form exists and is visible
|
// Check if pre-screening form exists and is visible
|
||||||
|
console.log('Checking pre-screening needed...'); // Added for debugging
|
||||||
var needsPreScreening = $prescreeningForm.length > 0 && $prescreeningSection.is(':visible');
|
var needsPreScreening = $prescreeningForm.length > 0 && $prescreeningSection.is(':visible');
|
||||||
|
console.log('Pre-screening check result:', needsPreScreening); // Added for debugging
|
||||||
|
|
||||||
if (needsPreScreening) {
|
if (needsPreScreening) {
|
||||||
// Validate pre-screening form before submitting
|
// Validate pre-screening form before submitting
|
||||||
|
|
@ -167,7 +175,9 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
console.log('Entering direct assessment start logic (else block)...'); // Added for debugging
|
||||||
// No pre-screening needed, directly start the assessment UI
|
// No pre-screening needed, directly start the assessment UI
|
||||||
|
console.log('Attempting to call startAssessmentUI() from else block...'); // Added for debugging
|
||||||
startAssessmentUI();
|
startAssessmentUI();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue