FIX: Ensure assessment.js loads by uncommenting wp_footer() in assessment-shell.php
This commit is contained in:
parent
ac1712f906
commit
f84960326a
2 changed files with 1 additions and 11 deletions
|
|
@ -6,11 +6,9 @@
|
||||||
*/
|
*/
|
||||||
(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') {
|
||||||
|
|
@ -88,7 +86,6 @@
|
||||||
* 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) {
|
||||||
|
|
@ -109,17 +106,12 @@
|
||||||
// --- 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
|
||||||
|
|
@ -175,9 +167,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
} 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();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -234,6 +234,6 @@ $show_pre_screening = ! empty( $pre_screening_questions ) && is_array( $pre_scre
|
||||||
</div> <!-- #quiztech-assessment-section -->
|
</div> <!-- #quiztech-assessment-section -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?php // wp_footer(); // Consider if needed ?>
|
<?php wp_footer(); // Consider if needed ?>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
Add table
Reference in a new issue