<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title id="page-title">IRIS</title>
    <style>
        /* General Reset */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Arial', sans-serif;
            background-color: #121212;
            color: #ffffff;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            overflow: hidden;
        }

        .container {
            width: 100%;
            max-width: 800px;
            padding: 20px;
            background-color: #1e1e1e;
            border-radius: 12px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
            text-align: center;
        }

        h1 {
            font-size: 2rem;
            margin-bottom: 20px;
            color: #00ffcc;
        }

        .timer {
            font-size: 1.5rem;
            color: #00ffcc;
            margin: 10px 0;
        }

        .timer.warning {
            color: #ff4081;
            animation: pulse 1s infinite;
        }

        @keyframes pulse {
            0% { opacity: 1; }
            50% { opacity: 0.5; }
            100% { opacity: 1; }
        }

    
    
    
    #loadingScreen {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #1a1a1a;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 9999;
        color: white;
        font-family: Arial, sans-serif;
    }

    #loadingBar {
        width: 300px;
        height: 20px;
        background: #333;
        border-radius: 10px;
        margin-top: 20px;
        overflow: hidden;
    }

    #loadingProgress {
        width: 0%;
        height: 100%;
        background: #4CAF50;
        transition: width 0.3s ease;
    }

    #loadingText {
        margin-top: 10px;
        font-size: 18px;
    }


   .question {
    font-size: 1rem;
    margin-bottom: 20px;
}

.question img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid #333;
    margin-bottom: 20px;
}

        .answers {
            margin: 0 auto;
            max-width: 1200px;
        }

        .answers.grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
        }

        .input-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100%;
            margin: 20px auto;
            gap: 15px;
        }

        .answer-input {
            background-color: #333;
            border: 2px solid #444;
            border-radius: 8px;
            color: #00ffcc;
            padding: 12px 15px;
            font-size: 1rem;
            width: 200px;
            text-align: center;
        }

        .answer-input:focus {
            outline: none;
            border-color: #00ffcc;
        }

        .answer {
            padding: 12px 15px;
            background-color: #333;
            border: 2px solid #444;
            border-radius: 8px;
            color: #00ffcc;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
        }

        .answer img {
            width: 150px;
            height: 150px;
            margin-bottom: 4px;
            border-radius: 8px;
            border: 1px solid #222;
        }

        .answer:hover {
            background-color: #00ffcc;
            color: #1e1e1e;
            border-color: #00ffcc;
        }

        .error-message {
            color: #ff4081;
            font-size: 0.9rem;
            margin-top: 10px;
            display: none;
            text-align: center;
        }

        .result {
            margin-top: 20px;
            font-size: 1.5rem;
            color: #ff4081;
        }

        .submit-button {
            margin-top: 20px;
            padding: 10px 20px;
            background-color: #00ffcc;
            color: #1e1e1e;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
        }

        .submit-button:hover {
            background-color: #00d1b2;
        }

        .subtest-results {
            display: flex;
	                flex-direction: column;
            gap: 20px;
            margin-top: 20px;
        }

        .subtest-result {
            background-color: #333;
            padding: 20px;
            border-radius: 8px;
            border: 2px solid #444;
        }

        .subtest-result h3 {
            color: #00ffcc;
            margin-bottom: 10px;
        }

.instructions {
    padding: 25px;
    background-color: #2a2a2a;
    border-radius: 12px;
    margin: 1px 0;
    border: 1px solid #00ffcc;
    box-shadow: 0 2px 5px rgba(0, 255, 204, 0.1);
}

.instructions h2 {
    color: #00ffcc;
    font-size: 1.8rem;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.instructions p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 105px;
    color: #e0e0e0;
}

.instructions .submit-button {
    margin-top: 25px;
    padding: 12px 30px;
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.instructions .submit-button:hover {
    transform: translateY(-2px);
}

       #preScreen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100vh;
            background-color: #121212;
            color: white;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            overflow-y: auto;
            padding: 20px;
        }

        #preScreenForm {
            background-color: #1e1e1e;
            padding: 30px;
            border-radius: 12px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
            text-align: left;
            max-width: 800px;
            width: 100%;
            height: auto;
            overflow-y: auto; 
        }

        .questionnaire {
            text-align: left;
            padding: 20px; 
        }

        .input-group {
            margin: 10px 0; 
            padding: 5px; 
        }

        .input-group label {
            display: inline-block; 
            width: 200px; 
            margin-right: 10px; 
            color: #00; 
            font-size: 1rem; 
        }

        .input-group input,
        .input-group select {
            background-color: #333; 
            border: 1px solid #444; 
            color: #00ffcc; 
            padding: 8px 10px; 
            border-radius: 4px; 
            width: calc(100% - 220px - 20px);
            font-size: 1rem; 
        }

        .input-group input:focus,
        .input-group select:focus {
            outline: none;
            border-color: #00; 
        }

        .input-group.required label:after {
            content: " *"; 
            color: #ff4081; 
        }

        .test-section {
            margin: 10px 0; 
            padding: 10px; 
            border: 1px solid #333; 
            border-radius: 4px;
        }

        #startTestButton {
            padding: 12px 20px;
            background-color: #00ffcc;
            color: #1e1e1e;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
            transition: background-color 0.3s ease;
            margin-top: 20px;
        }

        #startTestButton:hover {
            background-color: #00d1b2;
        }

        h1 {
            font-size: 2rem;
            margin-bottom: 20px;
            color: #00;
        }

        h2 {
            color: #00;
            margin: 20px 0 10px 0; /* From example */
            font-size: 1.5rem; 
        }

        h3 {
            color: #00ffcc;
            margin: 15px 0 10px 0; /* From example */
            font-size: 1.2rem; 
        }


    </style>
</head>
<body>

<div id="preScreen">
    <div id="preScreenForm">
        <div id="pre-test-screen" class="container">
            <h1>Pre-Test Questionnaire</h1>
            <div class="questionnaire">
                <h2>Required Information</h2>
                <div class="input-group required">
                    <label for="age">Age</label>
                    <input type="number" id="age" name="age" required min="5" max="120">
                </div>
                <div class="input-group required">
                    <label for="nativeEnglish">Are you a native English speaker?</label>
                    <select id="nativeEnglish" name="nativeEnglish" required>
                        <option value="">Select...</option>
                        <option value="yes">Yes</option>
                        <option value="no">No</option>
                    </select>
                </div>
                <div class="input-group required">
                    <label for="testTakenBefore">Have you taken this test before?</label>
                    <select id="testTakenBefore" name="testTakenBefore" required>
                        <option value="">Select...</option>
                        <option value="yes">Yes</option>
                        <option value="no">No</option>
                    </select>
                </div>

                <h2>Self-Estimates</h2>
                <div class="input-group">
                    <label for="estFSIQ">IQ Estimate</label>
                    <input type="number" id="estFSIQ" name="estFSIQ" min="40" max="190">
                </div>
                <div class="input-group">
                    <label for="estGAI">GAI Estimate</label>
                    <input type="number" id="estGAI" name="estGAI" min="40" max="190">
                </div>
                <div class="input-group">
                    <label for="estFRI">FRI Estimate</label>
                    <input type="number" id="estFRI" name="estFRI" min="40" max="190">
                </div>
                <div class="input-group">
                    <label for="estVCI">VCI Estimate</label>
                    <input type="number" id="estVCI" name="estVCI" min="40" max="190">
                </div>

                <h2>Previous Scaled and Composite Scores (Optional)</h2>

                <h3>WAIS Scores</h3>
                <div class="test-section">
                    <div class="input-group">
                        <label for="waisMR">Matrix Reasoning</label>
                        <input type="number" id="waisMR" name="waisMR" min="1" max="19">
                    </div>
                    <div class="input-group">
                        <label for="waisSI">Similarities</label>
                        <input type="number" id="waisSI" name="waisSI" min="1" max="19">
                    </div>
                    <div class="input-group">
                        <label for="waisFW">Figure Weights</label>
                        <input type="number" id="waisFW" name="waisFW" min="1" max="19">
                    </div>
                    <div class="input-group">
                        <label for="waisVC">Vocabulary</label>
                        <input type="number" id="waisVC" name="waisVC" min="1" max="19">
                    </div>
			<div class="input-group">
                        <label for="waisDS">Digit Span</label>
                        <input type="number" id="waisDS" name="waisDS" min="1" max="19">
                    </div>
                    <div class="input-group">
                        <label for="waisFSIQ">FSIQ</label>
                        <input type="number" id="waisFSIQ" name="waisFSIQ" min="40" max="160">
                    </div>
                </div>

                <h3>WISC Scores</h3>
                <div class="test-section">
                    <div class="input-group">
                        <label for="wiscMR">Matrix Reasoning</label>
                        <input type="number" id="wiscMR" name="wiscMR" min="1" max="28">
                    </div>
                    <div class="input-group">
                        <label for="wiscSI">Similarities</label>
                        <input type="number" id="wiscSI" name="wiscSI" min="1" max="28">
                    </div>
                    <div class="input-group">
                        <label for="wiscFW">Figure Weights</label>
                        <input type="number" id="wiscFW" name="wiscFW" min="1" max="28">
                    </div>
                    <div class="input-group">
                        <label for="wiscVC">Vocabulary</label>
                        <input type="number" id="wiscVC" name="wiscVC" min="1" max="28">
                    </div>
			<div class="input-group">
                        <label for="wiscDS">Digit Span</label>
                        <input type="number" id="wiscDS" name="wiscDS" min="1" max="28">
                    </div>
                    <div class="input-group">
                        <label for="wiscFSIQ">FSIQ</label>
                        <input type="number" id="wiscFSIQ" name="wiscFSIQ" min="40" max="210">
                    </div>
                </div>

                <h3>SB-5 Scores</h3>
                <div class="test-section">
                    <div class="input-group">
                        <label for="sb5NVFR">NVFR</label>
                            <input type="number" id="sb5NVFR" name="sb5NVFR" min="1" max="19">
                        </div>
                        <div class="input-group">
                            <label for="sb5VFR">VFR</label>
                            <input type="number" id="sb5VFR" name="sb5VFR" min="1" max="19">
                        </div>
                        <div class="input-group">
                            <label for="sb5VK">VK</label>
                            <input type="number" id="sb5VK" name="sb5VK" min="1" max="19">
                        </div>
                        <div class="input-group">
                            <label for="sb5NVQR">NVQR</label>
                            <input type="number" id="sb5NVQR" name="sb5NVQR" min="1" max="19">
                        </div>
                        <div class="input-group">
                            <label for="sb5VQR">VQR</label>
                            <input type="number" id="sb5VQR" name="sb5VQR" min="1" max="19">
                        </div>
                        <div class="input-group">
                            <label for="sb5FSIQ">FSIQ</label>
                            <input type="number" id="sb5FSIQ" name="sb5FSIQ" min="40" max="225">
                        </div>
                    </div>

                    <h3>CAIT Scores</h3>
                    <div class="test-section">
                        <div class="input-group">
                            <label for="caitFW">Figure Weights</label>
                            <input type="number" id="caitFW" name="caitFW" min="1" max="25">
                        </div>
                        <div class="input-group">
                            <label for="caitVC">Vocabulary</label>
                            <input type="number" id="caitVC" name="caitVC" min="1" max="25">
                        </div>
                        <div class="input-group">
                            <label for="caitVP">Visual Puzzles</label>
                            <input type="number" id="caitVP" name="caitVP" min="1" max="25">
                        </div>
			<div class="input-group">
                            <label for="caitDS">Digit Span</label>
                            <input type="number" id="caitDS" name="caitDS" min="1" max="19">
                        </div>
			<div class="input-group">
                            <label for="caitSS">Symbol Search</label>
                            <input type="number" id="caitSS" name="caitSS" min="1" max="19">
                        </div>
                        <div class="input-group">
                            <label for="caitGAI">GAI</label>
                            <input type="number" id="caitGAI" name="caitGAI" min="40" max="180">
                        </div>
			<div class="input-group">
                            <label for="caitFSIQ">FSIQ</label>
                            <input type="number" id="caitFSIQ" name="caitFSIQ" min="40" max="180">
                        </div>
                    </div>

                    <h3>SAT Scores</h3>
                    <div class="test-section">
                        <div class="input-group">
                            <label for="satV">SAT-V</label>
                            <input type="number" id="satV" name="satV" min="200" max="800">
                        </div>
                        <div class="input-group">
                            <label for="satM">SAT-M</label>
                            <input type="number" id="satM" name="satM"min="200" max="800">
                        </div>
                        <div class="input-group">
                            <label for="satTotal">SAT</label>
                            <input type="number" id="satTotal" name="satTotal"min="400" max="1600">
                        </div>
                    </div>

                    <h3>GRE Scores</h3>
                    <div class="test-section">
                        <div class="input-group">
                            <label for="greV">GRE-V</label>
                            <input type="number" id="greV" name="greV"min="200" max="800">
                        </div>
                        <div class="input-group">
                            <label for="greQ">GRE-Q</label>
                            <input type="number" id="greQ" name="greQ"min="200" max="800">
                        </div>
                        <div class="input-group">
                            <label for="greA">GRE-A</label>
                            <input type="number" id="greA" name="greA"min="200" max="800">
                        </div>
                        <div class="input-group">
                            <label for="greTotal">GRE (out of 2400)</label>
                            <input type="number" id="greTotal" name="greTotal"min="600" max="2400">
                        </div>
                    </div>

                    <h3>AGCT Score</h3>
                    <div class="test-section">
                        <div class="input-group">
                            <label for="agctScore">AGCT</label>
                            <input type="number" id="agctScore" name="agctScore"min="50" max="150">
                        </div>
                    </div>

                    <button type="button" id="startTestButton" class="submit-button">Start Test</button>
                </div>
            </div>
        </div>
    </div>


       </div>
   </div>
<div class="container">
        <h1 id="test-title">IRIS</h1>
        <div id="timer" class="timer"></div>
        <div id="quiz">
            <div id="question-container" class="question">
                <!-- Question content will be dynamically inserted here -->
            </div>
            <div id="answers-container" class="answers">
                <!-- Answer choices will be dynamically inserted here -->
            </div>
        </div>
        <div id="result" class="result" style="display: none;"></div>

        <div id="loadingScreen">
    <div id="loadingBar">
        <div id="loadingProgress"></div>
    </div>
    <div id="loadingText">Loading... <span id="progress">0</span>%</div>
</div>
    </div>

<script>
// Pre-screen input variables
let userAge;
let isNativeEnglishSpeaker;
let hasTakenTestBefore;
let estFSIQ;
let estGAI;
let estFRI;
let estVCI;
let waisMR;
let waisSI;
let waisFW;
let waisVC;
let waisDS;
let waisFSIQ;
let wiscMR;
let wiscSI;
let wiscFW;
let wiscVC;
let wiscDS;
let wiscFSIQ;
let sb5NVFR;
let sb5VFR;
let sb5VK;
let sb5NVQR;
let sb5VQR;
let sb5FSIQ;
let caitFW;
let caitVC;
let caitVP;
let caitDS;
let caitSS;
let caitGAI;
let caitFSIQ;
let satV;
let satM;
let satTotal;
let greV;
let greQ;
let greA;
let greTotal;
let agctScore;


const form = document.getElementById('preScreenForm'); // Get the form element
    const startTestButton = document.getElementById('startTestButton'); // Get the submit button
    const preScreen = document.getElementById('preScreen'); // Get the preScreen div

    startTestButton.addEventListener('click', function(event) {
        let isValid = true; // Flag to track form validity

        // --- Validate Required Fields ---
        const requiredFields = form.querySelectorAll('.input-group.required input, .input-group.required select');
        requiredFields.forEach(field => {
            if (!field.value.trim()) { // Check if the value is empty after trimming whitespace
                isValid = false;
                field.classList.add('error'); // Add error class for styling (if you have CSS for .error)
                alert(`Please fill in the required field: ${field.previousElementSibling.textContent.trim()}`);
            } else {
                field.classList.remove('error'); // Remove error class if field is filled
            }
        });

        if (!isValid) {
            event.preventDefault(); // Prevent further action if form is not valid
            return; // Stop execution here if form is invalid
        }

        // --- Validate Number Ranges ---
        const numberFields = form.querySelectorAll('input[type="number"]');
        numberFields.forEach(field => {
            const value = field.value.trim();
            if (value !== "") { // Only validate if a value is entered
                const numValue = Number(value); // Convert to number for comparison
                const min = Number(field.getAttribute('min')); // Get min attribute as number
                const max = Number(field.getAttribute('max')); // Get max attribute as number

                if (isNaN(numValue)) { // Check if it's NOT a number
                    isValid = false;
                    field.classList.add('error');
                    alert(`${field.previousElementSibling.textContent.trim()} must be a number.`);
                } else {
                    if (min !== null && numValue < min) {
                        isValid = false;
                        field.classList.add('error');
                        alert(`Value for ${field.previousElementSibling.textContent.trim()} must be at least ${min}`);
                    } else if (max !== null && numValue > max) {
                        isValid = false;
                        field.classList.add('error');
                        alert(`Value for ${field.previousElementSibling.textContent.trim()} must be at most ${max}`);
                    } else {
                        field.classList.remove('error'); // Valid range, remove error class
                    }
                }
            } else {
                field.classList.remove('error'); // If field is empty, remove error class (important for optional fields)
            }
        });


        if (!isValid) {
            event.preventDefault(); // Prevent further action if form is not valid
            return; // Stop execution here if form is invalid
        }

        // --- If form is valid, proceed to get form data and start quiz ---

        // Get required information
        userAge = document.getElementById('age').value;
        isNativeEnglishSpeaker = document.getElementById('nativeEnglish').value;
        hasTakenTestBefore = document.getElementById('testTakenBefore').value;

        // Get optional self-estimates
        estFSIQ = document.getElementById('estFSIQ').value;
        estGAI = document.getElementById('estGAI').value;
        estFRI = document.getElementById('estFRI').value;
        estVCI = document.getElementById('estVCI').value;

        // Get optional WAIS scores
        waisMR = document.getElementById('waisMR').value;
        waisSI = document.getElementById('waisSI').value;
        waisFW = document.getElementById('waisFW').value;
        waisVC = document.getElementById('waisVC').value;
            waisDS = document.getElementById('waisDS').value;
        waisFSIQ = document.getElementById('waisFSIQ').value;

        // Get optional WISC scores
        wiscMR = document.getElementById('wiscMR').value;
        wiscSI = document.getElementById('wiscSI').value;
        wiscFW = document.getElementById('wiscFW').value;
        wiscVC = document.getElementById('wiscVC').value;
            wiscDS = document.getElementById('wiscDS').value;
        wiscFSIQ = document.getElementById('wiscFSIQ').value;

        // Get optional SB-5 scores
        sb5NVFR = document.getElementById('sb5NVFR').value;
        sb5VFR = document.getElementById('sb5VFR').value;
        sb5VK = document.getElementById('sb5VK').value;
        sb5NVQR = document.getElementById('sb5NVQR').value;
        sb5VQR = document.getElementById('sb5VQR').value;
        sb5FSIQ = document.getElementById('sb5FSIQ').value;

        // Get optional CAIT scores
        caitFW = document.getElementById('caitFW').value;
        caitVC = document.getElementById('caitVC').value;
        caitVP = document.getElementById('caitVP').value;
            caitDS = document.getElementById('caitDS').value;
            caitSS = document.getElementById('caitSS').value;
        caitFSIQ = document.getElementById('caitFSIQ').value;
        caitGAI = document.getElementById('caitGAI').value;

        // Get optional SAT scores
        satV = document.getElementById('satV').value;
        satM = document.getElementById('satM').value;
        satTotal = document.getElementById('satTotal').value;

        // Get optional GRE scores
        greV = document.getElementById('greV').value;
        greQ = document.getElementById('greQ').value;
        greA = document.getElementById('greA').value;
        greTotal = document.getElementById('greTotal').value;

        // Get optional AGCT score
        agctScore = document.getElementById('agctScore').value;

            preScreen.style.display = 'none'; // Hide pre-screen
            startQuiz(); // Call function to start the quiz (if it exists)
});


let userIP = "";
let userCookie = getOrCreateCookie();

// Function to get or create a unique cookie
function getOrCreateCookie() {
    let cookieName = "userIdentifier=";
    let decodedCookie = decodeURIComponent(document.cookie);
    let ca = decodedCookie.split(';');
    for(let i = 0; i <ca.length; i++) {
        let c = ca[i];
        while (c.charAt(0) == ' ') {
            c = c.substring(1);
        }
        if (c.indexOf(cookieName) == 0) {
            return c.substring(cookieName.length, c.length);
        }
    }
    // If cookie doesn't exist, create a new one
    let newCookie = generateUUID();
    document.cookie = cookieName + newCookie + ";path=/";
    return newCookie;
}

// Function to generate a UUID (for the cookie)
function generateUUID() {
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
        var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
        return v.toString(16);
    });
}

// Get user's IP address on page load
fetch('https://api.ipify.org?format=json')
    .then(response => response.json())
    .then(data => {
        userIP = data.ip;
    })
    .catch(error => console.error('Error fetching IP:', error));




// Configuration
const CONFIG = {
    pageTitle: "IRIS",
    testTitle: "Matrices"
};

// Subtest Configuration
const subtests = [
    {
        name: "Matrices",
        title: "Matrices",
        maxConsecutiveWrong: 100,
        instructions: "In this subtest, you will be presented with various matrices and sequences, each with a missing piece. Your task is to choose the option that best completes the matrix or sequence. As you progress, the questions will become more difficult, and the time limits will increase to give you more time to think. If unsure, simply make your best guess, as there is no penalty for wrong answers.",
        questions: [
  {
    question: "What goes in the empty box?",
    image: "questions/1.png",
    timeLimit: 30, 
    answers: [
      { text: null, image: "answers/1A.png", correct: false },
      { text: null, image: "answers/1B.png", correct: false },
      { text: null, image: "answers/1C.png", correct: true },
      { text: null, image: "answers/1D.png", correct: false },
      { text: null, image: "answers/1E.png", correct: false },
      { text: null, image: "answers/1F.png", correct: false } 
    ]
  },
    {
    question: "What goes in the empty box?",
    image: "questions/2.png",
    timeLimit: 30, 
    answers: [
      { text: null, image: "answers/2A.png", correct: false },
      { text: null, image: "answers/2B.png", correct: false },
      { text: null, image: "answers/2C.png", correct: false },
      { text: null, image: "answers/2D.png", correct: false },
      { text: null, image: "answers/2E.png", correct: false },
      { text: null, image: "answers/2F.png", correct: true }
    ]
  },
  {
    question: "What goes in the empty box?",
    image: "questions/3.png",
    timeLimit: 30, 
    answers: [
      { text: null, image: "answers/3A.png", correct: false },
      { text: null, image: "answers/3B.png", correct: false },
      { text: null, image: "answers/3C.png", correct: false},
      { text: null, image: "answers/3D.png", correct: true},
      { text: null, image: "answers/3E.png", correct: false },
      { text: null, image: "answers/3F.png", correct: false } 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/4.png",
    timeLimit: 30, 
    answers: [
      { text: null, image: "answers/4A.png", correct: false },
      { text: null, image: "answers/4B.png", correct: false },
      { text: null, image: "answers/4C.png", correct: false},
      { text: null, image: "answers/4D.png", correct: false},
      { text: null, image: "answers/4E.png", correct: true },
      { text: null, image: "answers/4F.png", correct: false } 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/5.png",
    timeLimit: 30, 
    answers: [
      { text: null, image: "answers/5A.png", correct: true },
      { text: null, image: "answers/5B.png", correct: false },
      { text: null, image: "answers/5C.png", correct: false},
      { text: null, image: "answers/5D.png", correct: false},
      { text: null, image: "answers/5E.png", correct: false },
      { text: null, image: "answers/5F.png", correct: false } 
    ]
  },
  {
    question: "What goes in the empty box?",
    image: "questions/6.png",
    timeLimit: 30, 
    answers: [
      { text: null, image: "answers/6A.png", correct: false },
      { text: null, image: "answers/6B.png", correct: false },
      { text: null, image: "answers/6C.png", correct: false},
      { text: null, image: "answers/6D.png", correct: false},
      { text: null, image: "answers/6E.png", correct: false },
      { text: null, image: "answers/6F.png", correct: true } 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/neweasy.png",
    timeLimit: 30, 
    answers: [
      { text: null, image: "answers/neweasyA.png", correct: false },
      { text: null, image: "answers/neweasyB.png", correct: true},
      { text: null, image: "answers/neweasyC.png", correct: false},
      { text: null, image: "answers/neweasyD.png", correct: false},
      { text: null, image: "answers/neweasyE.png", correct: false },
      { text: null, image: "answers/neweasyF.png", correct: false } 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/7.png",
    timeLimit: 30, 
    answers: [
      { text: null, image: "answers/7A.png", correct: true },
      { text: null, image: "answers/7B.png", correct: false },
      { text: null, image: "answers/7C.png", correct: false},
      { text: null, image: "answers/7D.png", correct: false},
      { text: null, image: "answers/7E.png", correct: false },
      { text: null, image: "answers/7F.png", correct: false } 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/8.png",
    timeLimit: 60, 
    answers: [
      { text: null, image: "answers/8A.png", correct: false },
      { text: null, image: "answers/8B.png", correct: true},
      { text: null, image: "answers/8C.png", correct: false},
      { text: null, image: "answers/8D.png", correct: false},
      { text: null, image: "answers/8E.png", correct: false },
      { text: null, image: "answers/8F.png", correct: false } 
    ]
  },
  {
    question: "What goes in the empty box?",
    image: "questions/newmed.png",
    timeLimit: 60, 
    answers: [
      { text: null, image: "answers/newmedA.png", correct: false },
      { text: null, image: "answers/newmedB.png", correct: false},
      { text: null, image: "answers/newmedC.png", correct: false},
      { text: null, image: "answers/newmedD.png", correct: true},
      { text: null, image: "answers/newmedE.png", correct: false },
      { text: null, image: "answers/newmedF.png", correct: false } 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/9.png",
    timeLimit: 60, 
    answers: [
      { text: null, image: "answers/9A.png", correct: false},
      { text: null, image: "answers/9B.png", correct: false},
      { text: null, image: "answers/9C.png", correct: false},
      { text: null, image: "answers/9D.png", correct: false},
      { text: null, image: "answers/9E.png", correct: true},
      { text: null, image: "answers/9F.png", correct: false} 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/10.png",
    timeLimit: 60, 
    answers: [
      { text: null, image: "answers/10A.png", correct: false},
      { text: null, image: "answers/10B.png", correct: false},
      { text: null, image: "answers/10C.png", correct: true},
      { text: null, image: "answers/10D.png", correct: false},
      { text: null, image: "answers/10E.png", correct: false},
      { text: null, image: "answers/10F.png", correct: false} 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/11.png",
    timeLimit: 60, 
    answers: [
      { text: null, image: "answers/11A.png", correct: false},
      { text: null, image: "answers/11B.png", correct: false},
      { text: null, image: "answers/11C.png", correct: false},
      { text: null, image: "answers/11D.png", correct: true},
      { text: null, image: "answers/11E.png", correct: false},
      { text: null, image: "answers/11F.png", correct: false} 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/12.png",
    timeLimit: 90, 
    answers: [
      { text: null, image: "answers/12A.png", correct: true},
      { text: null, image: "answers/12B.png", correct: false},
      { text: null, image: "answers/12C.png", correct: false},
      { text: null, image: "answers/12D.png", correct: false},
      { text: null, image: "answers/12E.png", correct: false},
      { text: null, image: "answers/12F.png", correct: false} 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/13.png",
    timeLimit: 90, 
    answers: [
      { text: null, image: "answers/13A.png", correct: true},
      { text: null, image: "answers/13B.png", correct: false},
      { text: null, image: "answers/13C.png", correct: false},
      { text: null, image: "answers/13D.png", correct: false},
      { text: null, image: "answers/13E.png", correct: false},
      { text: null, image: "answers/13F.png", correct: false} 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/14.png",
    timeLimit: 90, 
    answers: [
      { text: null, image: "answers/14A.png", correct: false},
      { text: null, image: "answers/14B.png", correct: false},
      { text: null, image: "answers/14C.png", correct: false},
      { text: null, image: "answers/14D.png", correct: false},
      { text: null, image: "answers/14E.png", correct: false},
      { text: null, image: "answers/14F.png", correct: true} 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/15.png",
    timeLimit: 90, 
    answers: [
      { text: null, image: "answers/15A.png", correct: false},
      { text: null, image: "answers/15B.png", correct: true},
      { text: null, image: "answers/15C.png", correct: false},
      { text: null, image: "answers/15D.png", correct: false},
      { text: null, image: "answers/15E.png", correct: false},
      { text: null, image: "answers/15F.png", correct: false} 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/16.png",
    timeLimit: 90, 
    answers: [
      { text: null, image: "answers/16A.png", correct: false},
      { text: null, image: "answers/16B.png", correct: true},
      { text: null, image: "answers/16C.png", correct: false},
      { text: null, image: "answers/16D.png", correct: false},
      { text: null, image: "answers/16E.png", correct: false},
      { text: null, image: "answers/16F.png", correct: false} 
    ]
  },
  {
    question: "What goes in the empty box?",
    image: "questions/17.png",
    timeLimit: 120, 
    answers: [
      { text: null, image: "answers/17A.png", correct: true},
      { text: null, image: "answers/17B.png", correct: false},
      { text: null, image: "answers/17C.png", correct: false},
      { text: null, image: "answers/17D.png", correct: false},
      { text: null, image: "answers/17E.png", correct: false},
      { text: null, image: "answers/17F.png", correct: false} 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/newhard.png",
    timeLimit: 120, 
    answers: [
      { text: null, image: "answers/newhardA.png", correct: false},
      { text: null, image: "answers/newhardB.png", correct: false},
      { text: null, image: "answers/newhardC.png", correct: true},
      { text: null, image: "answers/newhardD.png", correct: false},
      { text: null, image: "answers/newhardE.png", correct: false},
      { text: null, image: "answers/newhardF.png", correct: false} 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/18.png",
    timeLimit: 120, 
    answers: [
      { text: null, image: "answers/18A.png", correct: false},
      { text: null, image: "answers/18B.png", correct: false},
      { text: null, image: "answers/18C.png", correct: false},
      { text: null, image: "answers/18D.png", correct: true},
      { text: null, image: "answers/18E.png", correct: false},
      { text: null, image: "answers/18F.png", correct: false} 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/19.png",
    timeLimit: 120, 
    answers: [
      { text: null, image: "answers/19A.png", correct: false},
      { text: null, image: "answers/19B.png", correct: false},
      { text: null, image: "answers/19C.png", correct: false},
      { text: null, image: "answers/19D.png", correct: false},
      { text: null, image: "answers/19E.png", correct: false},
      { text: null, image: "answers/19F.png", correct: true} 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/20.png",
    timeLimit: 120, 
    answers: [
      { text: null, image: "answers/20A.png", correct: false},
      { text: null, image: "answers/20B.png", correct: false},
      { text: null, image: "answers/20C.png", correct: false},
      { text: null, image: "answers/20D.png", correct: true},
      { text: null, image: "answers/20E.png", correct: false},
      { text: null, image: "answers/20F.png", correct: false} 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/21.png",
    timeLimit: 120, 
    answers: [
      { text: null, image: "answers/21A.png", correct: false},
      { text: null, image: "answers/21B.png", correct: true},
      { text: null, image: "answers/21C.png", correct: false},
      { text: null, image: "answers/21D.png", correct: false},
      { text: null, image: "answers/21E.png", correct: false},
      { text: null, image: "answers/21F.png", correct: false} 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/22.png",
    timeLimit: 150, 
    answers: [
      { text: null, image: "answers/22A.png", correct: false},
      { text: null, image: "answers/22B.png", correct: false},	
      { text: null, image: "answers/22C.png", correct: false},
      { text: null, image: "answers/22D.png", correct: false},
      { text: null, image: "answers/22E.png", correct: true},
      { text: null, image: "answers/22F.png", correct: false} 
    ]
  },
  {
    question: "What goes in the empty box?",
    image: "questions/23.png",
    timeLimit: 150, 
    answers: [
      { text: null, image: "answers/23A.png", correct: false},
      { text: null, image: "answers/23B.png", correct: false},
      { text: null, image: "answers/23C.png", correct: false},
      { text: null, image: "answers/23D.png", correct: false},
      { text: null, image: "answers/23E.png", correct: true},
      { text: null, image: "answers/23F.png", correct: false} 
    ]
  },
{
    question: "What goes in the empty box?",
    image: "questions/24.png",
    timeLimit: 300, 
    answers: [
      { text: null, image: "answers/24A.png", correct: false},
      { text: null, image: "answers/24B.png", correct: false},
      { text: null, image: "answers/24C.png", correct: true},
      { text: null, image: "answers/24D.png", correct: false},
      { text: null, image: "answers/24E.png", correct: false},
      { text: null, image: "answers/24F.png", correct: false} 
    ]
  }

// more items...

        ]
    },
    {
        name: "Analogies",
        title: "Analogies",
        maxConsecutiveWrong: 100,
        instructions: "In this subtest, you will be asked to complete various analogies. Each analogy consists of a pair of words that have a specific relationship. Your task is to choose the word or phrase that best completes the second, incomplete analogy by matching the relationship between the words in the first pair. As you progress, the analogies will become increasingly complex, and the time limits will increase to give you more time to think. If you're unsure, simply make your best guess, as there is no penalty for wrong answers.",
        questions: [

                 {
        type: 'text-input',
        question: "RED is to BLUE as BLACK is to ___",
        correctAnswer: ["white"],
        timeLimit: 20
    },
   {
        type: 'text-input',
        question: "CEILING is to FLOOR as WARM is to ___",
        correctAnswer: ["cold"],
        timeLimit: 20
    },
   {
        type: 'text-input',
        question: "SUN is to MOON as DAY is to ___",
        correctAnswer: ["night"],
        timeLimit: 20
    },
   {
        type: 'text-input',
        question: "CAT is to KITTEN as DOG is to ___",
        correctAnswer: ["puppy", "whelp", "pup"],
        timeLimit: 20
    },
{
        type: 'text-input',
        question: "EYE is to SEE as EAR is to ___",
        correctAnswer: ["hear"],
        timeLimit: 20
    },
{
        type: 'text-input',
        question: "FISH is to WATER as BIRD is to ___",
        correctAnswer: ["air"],
        timeLimit: 20
    },
{
        type: 'text-input',
        question: "PENCIL is to WRITE as BRUSH is to ___",
        correctAnswer: ["paint"],
        timeLimit: 20
    },
{
        type: 'text-input',
        question: "PAINTING is to ARTIST as BOOK is to ___",
        correctAnswer: ["author"],
        timeLimit: 20
    },
{
        type: 'text-input',
        question: "SQUARE is to CUBE as CIRCLE is to ___",
        correctAnswer: ["sphere"],
        timeLimit: 20
    },
{
        type: 'text-input',
        question: "CHAIR is to SIT as LADDER is to ___",
        correctAnswer: ["climb"],
        timeLimit: 20
    },
{
        type: 'text-input',
        question: "FISH is to SWIM as BIRD is to ___",
        correctAnswer: ["fly"],
        timeLimit: 20
    },
{
        type: 'text-input',
        question: "RULER is to LENGTH as SCALE is to ___",
        correctAnswer: ["weight"],
        timeLimit: 20
    },
{
        type: 'text-input',
        question: "BUILDING is to FOUNDATION as TREE is to ___",
        correctAnswer: ["root", "roots"],
        timeLimit: 20
    },
{
        type: 'text-input',
        question: "NECK is to NECKLACE as FINGER is to ___",
        correctAnswer: ["ring"],
        timeLimit: 20
    },
{
        type: 'text-input',
        question: "TIME is to CLOCK as TEMPERATURE is to ___",
        correctAnswer: ["thermometer"],
        timeLimit: 20
    },
{
        type: 'text-input',
        question: "TEACHER is to KNOWLEDGE as DOCTOR is to ___",
        correctAnswer: ["health"],
        timeLimit: 30
    },
{
  type: 'text-input',
  question: "FLOWER is to FLOUR as SIGHT is to ___",
  correctAnswer: ["site"],
  timeLimit: 30
},
{
        type: 'text-input',
        question: "PAPER is to BOOK as BRICK is to ___",
        correctAnswer: ["wall"],
        timeLimit: 30
    }, 
{
        type: 'text-input',
        question: "TREE is to LEAF as FLOWER is to ___",
        correctAnswer: ["petal"],
        timeLimit: 30
    },
{
        type: 'text-input',
        question: "LIE is to DECEPTION as TRUTH is to ___",
        correctAnswer: ["honesty", "candor", "candour", "scrupulousness"],
        timeLimit: 30
    },
{
        type: 'text-input',
        question: "RESULT is to ACTION as EFFECT is to ___",
        correctAnswer: ["cause"],
        timeLimit: 30
    },
{
        type: 'text-input',
        question: "SUN is to LIGHT as CLOUD is to ___",
        correctAnswer: ["rain"],
        timeLimit: 30
    },
{
        type: 'text-input',
        question: "SALT is to SEASON as SOAP is to ___",
        correctAnswer: ["clean", "cleanse", "disinfect", "scrub", "wash", "polish", "wipe"],
        timeLimit: 30
    },
{
        type: 'text-input',
        question: "QUESTION is to ANSWER as WORK is to ___",
        correctAnswer: ["salary", "compensation", "remuneration", "pay", "wage", "wages"],
        timeLimit: 30
    },
{
  type: 'text-input',
  question: "HEART is to PUMP as GENERATOR is to ___",
  correctAnswer: ["produce", "generate", "create"],
  timeLimit: 30
},
{
        type: 'text-input',
        question: "TRUTH is to FALSITY as HOPE is to ___",
        correctAnswer: ["despair"],
        timeLimit: 30
    },
{
  type: 'text-input',
  question: "ANCHOR is to STABILITY as COMPASS is to ___",
  correctAnswer: ["direction", "guidance", "navigation"],
  timeLimit: 30
},
{
    	type: 'text-input',
    	question: "WOLF is to PACK as FISH is to ___",
    	correctAnswer: ["school"],
    	timeLimit: 30
	},
{
  type: 'text-input',
  question: "COLD is to FRIGID as HOT is to ___",
  correctAnswer: ["scorching", "blazing", "searing"],
  timeLimit: 30
},
{
    	type: 'text-input',
    	question: "SPONGE is to POROUS as DIAMOND is to ___",
   	    correctAnswer: ["crystalline", "crystal"], 
    	timeLimit: 30
	},
{
    	type: 'text-input',
    	question: "COMPOSER is to SHEET MUSIC as ARCHITECT is to ___",
    	correctAnswer: ["blueprint", "blueprints"],
    	timeLimit: 30
	},
{
  type: 'text-input',
  question: "MIRROR is to REFLECTION as PRISM is to ___",
  correctAnswer: ["spectrum", "refraction"],
  timeLimit: 30
},
{
        type: 'text-input',
        question: "HIGH is to LOW as FLOW is to ___",
        correctAnswer: ["ebb"],
        timeLimit: 30
    },
{
        type: 'text-input',
        question: "POSITIVE is to NEUTRAL as WISH is to ___",
        correctAnswer: ["anticipate", "expect"],
        timeLimit: 30
    },
{
        type: 'text-input',
        question: "STASIS is to CHANGE as ORDER is to ___",
        correctAnswer: ["chaos"],
        timeLimit: 30
    },
{
  type: 'text-input',
  question: "CATALYST is to REACTION as SPARK is to ___",
  correctAnswer: ["fire", "ignition", "blaze", "inferno"],
  timeLimit: 30
},
{
        type: 'text-input',
        question: "SPACE is to TIME as HEADS is to ___",
        correctAnswer: ["tails"],
        timeLimit: 30
    },
{
        type: 'text-input',
        question: "DIVIDE is to CONQUER as BLACK is to ___",
        correctAnswer: ["yellow"],
        timeLimit: 30
    },
{
        type: 'text-input',
        question: "EQUILIBRIUM is to IMBALANCE as REALITY is to ___",
        correctAnswer: ["fantasy", "illusion", "dream"],
        timeLimit: 30
    },
{
  type: 'text-input',
  question: "SYCOPHANT is to FLATTERY as PHILANTHROPIST is to ___",
  correctAnswer: ["generosity", "charity"],
  timeLimit: 30
},
{
        type: 'text-input',
        question: "PYRRHIC is to VICTORY as SISYPHEAN is to ___",
        correctAnswer: ["struggle", "labor", "task", "effort", "trial", "grind"],
        timeLimit: 30
    },
{
  type: 'text-input',
  question: "EPHEMERAL is to LASTING as SUPERFICIAL is to ___",
  correctAnswer: ["profound", "deep", "meaningful", "thorough"],
  timeLimit: 30
},
{
        type: 'text-input',
        question: "NIGHT is to NOCTURNAL as DAY is to ___",
        correctAnswer: ["diurnal"],
        timeLimit: 30
    },
{
  type: 'text-input',
  question: "OBLIVION is to MEMORY as VACUUM is to ___",
  correctAnswer: ["matter", "substance", "materia"],
  timeLimit: 30
},
{
  type: 'text-input',
  question: "EUDAEMONIC is to HAPPINESS as AEGIS is to ___",
  correctAnswer: ["safety", "protection", "comfort"],
  timeLimit: 30
},
{
        type: 'text-input',
        question: "GARRULOUS is to TALKATIVE as ONEROUS is to ___",
        correctAnswer: ["costly", "expensive"],
        timeLimit: 30
    },
{
        type: 'text-input',
        question: "IMMEMORIAL is to MEMORY as AMORPHOUS is to ___",
        correctAnswer: ["shape", "structure", "form"],
        timeLimit: 30
    },
{
  type: 'text-input',
  question: "EULOGY is to PRAISE as ELEGY is to ___",
  correctAnswer: ["mourn", "lament", "weep", "cry"],
  timeLimit: 30
},
{
        type: 'text-input',
        question: "PRIMORDIAL is to ANTEDILUVIAN as AGNOSTICISM is to ___",
        correctAnswer: ["theism", "faith", "belief", "christianity", "gospel", "ignoticism"],
        timeLimit: 40
    },
{
	type: 'text-input',
	question: "SOPHIST is to WISDOM as ICONOCLAST is to ___",
	correctAnswer: ["convention", "tradition", "custom", "institution", "belief", "beliefs", "icon", "icons", "conventions", "traditions", "altarpiece", "altarpieces", "institutions", "customs"],
    timeLimit: 40
    },
// more...

        ]
    },
    {
        name: "Figure Weights",
        title: "Figure Weights",
        maxConsecutiveWrong: 100,
        instructions: "In this subtest, you will be presented with a series of scales with weights. Your task is to choose the option that balances the scale with a missing weight. Pay attention to the shapes and colors of the weights; if two weights differ in either shape or color, they may not have the same value. As you progress, the questions will become more difficult, and the time limits will increase to give you more time to think. Look carefully at the relationships between the weights, and if you're unsure, make your best guess, as there is no penalty for wrong answers.",
        questions: [
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/1.png",
                timeLimit: 20,
                answers: [
                    { text: null, image: "fwanswers/1A.png", correct: true },
                    { text: null, image: "fwanswers/1B.png", correct: false },
                    { text: null, image: "fwanswers/1C.png", correct: false },
                    { text: null, image: "fwanswers/1D.png", correct: false },
                    { text: null, image: "fwanswers/1E.png", correct: false },
                    { text: null, image: "fwanswers/1F.png", correct: false },
                ]
            },
                        {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/2.png",
                timeLimit: 20,
                answers: [
                    { text: null, image: "fwanswers/2A.png", correct: false },
                    { text: null, image: "fwanswers/2B.png", correct: false },
                    { text: null, image: "fwanswers/2C.png", correct: false },
                    { text: null, image: "fwanswers/2D.png", correct: false },
                    { text: null, image: "fwanswers/2E.png", correct: true },
                    { text: null, image: "fwanswers/2F.png", correct: false },
                ]
            },
                        {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/3.png",
                timeLimit: 20,
                answers: [
                    { text: null, image: "fwanswers/3A.png", correct: false },
                    { text: null, image: "fwanswers/3B.png", correct: false },
                    { text: null, image: "fwanswers/3C.png", correct: false },
                    { text: null, image: "fwanswers/3D.png", correct: false },
                    { text: null, image: "fwanswers/3E.png", correct: false },
                    { text: null, image: "fwanswers/3F.png", correct: true },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/4.png",
                timeLimit: 20,
                answers: [
                    { text: null, image: "fwanswers/4A.png", correct: false },
                    { text: null, image: "fwanswers/4B.png", correct: false },
                    { text: null, image: "fwanswers/4C.png", correct: false },
                    { text: null, image: "fwanswers/4D.png", correct: true },
                    { text: null, image: "fwanswers/4E.png", correct: false },
                    { text: null, image: "fwanswers/4F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/5.png",
                timeLimit: 20,
                answers: [
                    { text: null, image: "fwanswers/5A.png", correct: false },
                    { text: null, image: "fwanswers/5B.png", correct: false },
                    { text: null, image: "fwanswers/5C.png", correct: true },
                    { text: null, image: "fwanswers/5D.png", correct: false },
                    { text: null, image: "fwanswers/5E.png", correct: false },
                    { text: null, image: "fwanswers/5F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/6.png",
                timeLimit: 20,
                answers: [
                    { text: null, image: "fwanswers/6A.png", correct: false },
                    { text: null, image: "fwanswers/6B.png", correct: false },
                    { text: null, image: "fwanswers/6C.png", correct: false },
                    { text: null, image: "fwanswers/6D.png", correct: true },
                    { text: null, image: "fwanswers/6E.png", correct: false },
                    { text: null, image: "fwanswers/6F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/7.png",
                timeLimit: 20,
                answers: [
                    { text: null, image: "fwanswers/7A.png", correct: false },
                    { text: null, image: "fwanswers/7B.png", correct: false },
                    { text: null, image: "fwanswers/7C.png", correct: false },
                    { text: null, image: "fwanswers/7D.png", correct: false },
                    { text: null, image: "fwanswers/7E.png", correct: false },
                    { text: null, image: "fwanswers/7F.png", correct: true },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/8.png",
                timeLimit: 20,
                answers: [
                    { text: null, image: "fwanswers/8A.png", correct: false },
                    { text: null, image: "fwanswers/8B.png", correct: false },
                    { text: null, image: "fwanswers/8C.png", correct: false },
                    { text: null, image: "fwanswers/8D.png", correct: false },
                    { text: null, image: "fwanswers/8E.png", correct: true },
                    { text: null, image: "fwanswers/8F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/9.png",
                timeLimit: 20,
                answers: [
                    { text: null, image: "fwanswers/9A.png", correct: false },
                    { text: null, image: "fwanswers/9B.png", correct: false },
                    { text: null, image: "fwanswers/9C.png", correct: false },
                    { text: null, image: "fwanswers/9D.png", correct: false },
                    { text: null, image: "fwanswers/9E.png", correct: true },
                    { text: null, image: "fwanswers/9F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/10.png",
                timeLimit: 20,
                answers: [
                    { text: null, image: "fwanswers/10A.png", correct: true },
                    { text: null, image: "fwanswers/10B.png", correct: false },
                    { text: null, image: "fwanswers/10C.png", correct: false },
                    { text: null, image: "fwanswers/10D.png", correct: false },
                    { text: null, image: "fwanswers/10E.png", correct: false },
                    { text: null, image: "fwanswers/10F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/11.png",
                timeLimit: 20,
                answers: [
                    { text: null, image: "fwanswers/11A.png", correct: false },
                    { text: null, image: "fwanswers/11B.png", correct: false },
                    { text: null, image: "fwanswers/11C.png", correct: false },
                    { text: null, image: "fwanswers/11D.png", correct: false },
                    { text: null, image: "fwanswers/11E.png", correct: false },
                    { text: null, image: "fwanswers/11F.png", correct: true },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/12.png",
                timeLimit: 20,
                answers: [
                    { text: null, image: "fwanswers/12A.png", correct: false },
                    { text: null, image: "fwanswers/12B.png", correct: true },
                    { text: null, image: "fwanswers/12C.png", correct: false },
                    { text: null, image: "fwanswers/12D.png", correct: false },
                    { text: null, image: "fwanswers/12E.png", correct: false },
                    { text: null, image: "fwanswers/12F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/13.png",
                timeLimit: 30,
                answers: [
                    { text: null, image: "fwanswers/13A.png", correct: false },
                    { text: null, image: "fwanswers/13B.png", correct: true },
                    { text: null, image: "fwanswers/13C.png", correct: false },
                    { text: null, image: "fwanswers/13D.png", correct: false },
                    { text: null, image: "fwanswers/13E.png", correct: false },
                    { text: null, image: "fwanswers/13F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/14.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/14A.png", correct: false },
                    { text: null, image: "fwanswers/14B.png", correct: false },
                    { text: null, image: "fwanswers/14C.png", correct: false },
                    { text: null, image: "fwanswers/14D.png", correct: true },
                    { text: null, image: "fwanswers/14E.png", correct: false },
                    { text: null, image: "fwanswers/14F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/15.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/15A.png", correct: false },
                    { text: null, image: "fwanswers/15B.png", correct: true },
                    { text: null, image: "fwanswers/15C.png", correct: false },
                    { text: null, image: "fwanswers/15D.png", correct: false },
                    { text: null, image: "fwanswers/15E.png", correct: false },
                    { text: null, image: "fwanswers/15F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/16.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/16A.png", correct: false },
                    { text: null, image: "fwanswers/16B.png", correct: false },
                    { text: null, image: "fwanswers/16C.png", correct: false },
                    { text: null, image: "fwanswers/16D.png", correct: true },
                    { text: null, image: "fwanswers/16E.png", correct: false },
                    { text: null, image: "fwanswers/16F.png", correct: false },
                ]
            },
            {
                question: "What should replace the question mark to balance the scale?",
                image: "fwquestions/17.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/17A.png", correct: false },
                    { text: null, image: "fwanswers/17B.png", correct: false },
                    { text: null, image: "fwanswers/17C.png", correct: false },
                    { text: null, image: "fwanswers/17D.png", correct: false },
                    { text: null, image: "fwanswers/17E.png", correct: false },
                    { text: null, image: "fwanswers/17F.png", correct: true },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/18.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/18A.png", correct: false },
                    { text: null, image: "fwanswers/18B.png", correct: false },
                    { text: null, image: "fwanswers/18C.png", correct: true },
                    { text: null, image: "fwanswers/18D.png", correct: false },
                    { text: null, image: "fwanswers/18E.png", correct: false },
                    { text: null, image: "fwanswers/18F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/19.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/19A.png", correct: false },
                    { text: null, image: "fwanswers/19B.png", correct: true },
                    { text: null, image: "fwanswers/19C.png", correct: false },
                    { text: null, image: "fwanswers/19D.png", correct: false },
                    { text: null, image: "fwanswers/19E.png", correct: false },
                    { text: null, image: "fwanswers/19F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/20.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/20A.png", correct: false },
                    { text: null, image: "fwanswers/20B.png", correct: false },
                    { text: null, image: "fwanswers/20C.png", correct: true },
                    { text: null, image: "fwanswers/20D.png", correct: false },
                    { text: null, image: "fwanswers/20E.png", correct: false },
                    { text: null, image: "fwanswers/20F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/21.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/21A.png", correct: true },
                    { text: null, image: "fwanswers/21B.png", correct: false },
                    { text: null, image: "fwanswers/21C.png", correct: false },
                    { text: null, image: "fwanswers/21D.png", correct: false },
                    { text: null, image: "fwanswers/21E.png", correct: false },
                    { text: null, image: "fwanswers/21F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/22.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/22A.png", correct: false },
                    { text: null, image: "fwanswers/22B.png", correct: false },
                    { text: null, image: "fwanswers/22C.png", correct: false },
                    { text: null, image: "fwanswers/22D.png", correct: false },
                    { text: null, image: "fwanswers/22E.png", correct: true },
                    { text: null, image: "fwanswers/22F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/23.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/23A.png", correct: false },
                    { text: null, image: "fwanswers/23B.png", correct: false },
                    { text: null, image: "fwanswers/23C.png", correct: false },
                    { text: null, image: "fwanswers/23D.png", correct: false },
                    { text: null, image: "fwanswers/23E.png", correct: false },
                    { text: null, image: "fwanswers/23F.png", correct: true },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/24.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/24A.png", correct: false },
                    { text: null, image: "fwanswers/24B.png", correct: false },
                    { text: null, image: "fwanswers/24C.png", correct: false },
                    { text: null, image: "fwanswers/24D.png", correct: false },
                    { text: null, image: "fwanswers/24E.png", correct: false },
                    { text: null, image: "fwanswers/24F.png", correct: true },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/25.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/25A.png", correct: true },
                    { text: null, image: "fwanswers/25B.png", correct: false },
                    { text: null, image: "fwanswers/25C.png", correct: false },
                    { text: null, image: "fwanswers/25D.png", correct: false },
                    { text: null, image: "fwanswers/25E.png", correct: false },
                    { text: null, image: "fwanswers/25F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/26.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/26A.png", correct: false },
                    { text: null, image: "fwanswers/26B.png", correct: false },
                    { text: null, image: "fwanswers/26C.png", correct: false },
                    { text: null, image: "fwanswers/26D.png", correct: false },
                    { text: null, image: "fwanswers/26E.png", correct: true },
                    { text: null, image: "fwanswers/26F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/27.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/27A.png", correct: false },
                    { text: null, image: "fwanswers/27B.png", correct: false },
                    { text: null, image: "fwanswers/27C.png", correct: true },
                    { text: null, image: "fwanswers/27D.png", correct: false },
                    { text: null, image: "fwanswers/27E.png", correct: false },
                    { text: null, image: "fwanswers/27F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/28.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/28A.png", correct: false },
                    { text: null, image: "fwanswers/28B.png", correct: false },
                    { text: null, image: "fwanswers/28C.png", correct: true },
                    { text: null, image: "fwanswers/28D.png", correct: false },
                    { text: null, image: "fwanswers/28E.png", correct: false },
                    { text: null, image: "fwanswers/28F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/29.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/29A.png", correct: true },
                    { text: null, image: "fwanswers/29B.png", correct: false },
                    { text: null, image: "fwanswers/29C.png", correct: false },
                    { text: null, image: "fwanswers/29D.png", correct: false },
                    { text: null, image: "fwanswers/29E.png", correct: false },
                    { text: null, image: "fwanswers/29F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/30.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/30A.png", correct: false },
                    { text: null, image: "fwanswers/30B.png", correct: false },
                    { text: null, image: "fwanswers/30C.png", correct: false },
                    { text: null, image: "fwanswers/30D.png", correct: false },
                    { text: null, image: "fwanswers/30E.png", correct: true },
                    { text: null, image: "fwanswers/30F.png", correct: false },
                ]
            },
            {
                question: "Which weight should replace the question mark to balance the scale?",
                image: "fwquestions/31.png",
                timeLimit: 40,
                answers: [
                    { text: null, image: "fwanswers/31A.png", correct: false },
                    { text: null, image: "fwanswers/31B.png", correct: false },
                    { text: null, image: "fwanswers/31C.png", correct: false },
                    { text: null, image: "fwanswers/31D.png", correct: true },
                    { text: null, image: "fwanswers/31E.png", correct: false },
                    { text: null, image: "fwanswers/31F.png", correct: false },
                ]
            },

// more...

        ]
    },
    {
    name: "Vocabulary",
    title: "Vocabulary",
    maxConsecutiveWrong: 100,
    instructions: "In this subtest, you will encounter two types of tasks. You will be asked to freely enter the synonyms of various words, and be given multiple-choice options and asked to select the meaning of various words. The time limit for each question is 25 seconds. Think carefully about the meaning of each word and make your best guess if unsure, as there is no penalty for wrong answers.",
    questions: [
{
        type: 'text-input',
        question: "BIG",
        correctAnswer: ["large", "huge", "massive", "colossal", "titanic", "enormous"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "QUICK",
        correctAnswer: ["fast", "swift", "rapid"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "HARD",
        correctAnswer: ["difficult", "tough", "challenging"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "SMART",
        correctAnswer: ["intelligent", "clever", "bright"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "RICH",
        correctAnswer: ["wealthy", "affluent", "prosperous"],
        timeLimit: 25
},
{
        question: "RAZE",
        timeLimit: 25,
        answers: [
                { text: "Enervate", correct: false },
                { text: "Construct", correct: false },
                { text: "Renovate", correct: false },
                { text: "Assemble", correct: false },
                { text: "Demolish", correct: true },
                { text: "Preserve", correct: false }
        ]
},
{
        question: "FAMINE",
        timeLimit: 25,
        answers: [
                { text: "Feast", correct: false },
                { text: "Harvest", correct: false },
                { text: "Animation", correct: false },
                { text: "Starvation", correct: true },
                { text: "Abolition", correct: false },
                { text: "Surplus", correct: false }
        ]
},
{
        question: "OBSCURE",
        timeLimit: 25,
        answers: [
                { text: "Lost", correct: false },
                { text: "Abject", correct: false },
                { text: "Known", correct: false },
                { text: "Unclear", correct: true },
                { text: "Obvious", correct: false },
                { text: "Prominent", correct: false }
        ]
},
{
        question: "EGREGIOUS",
        timeLimit: 25,
        answers: [
                { text: "Minor", correct: false },
                { text: "Blatant", correct: true },
                { text: "Boring", correct: false },
                { text: "Trivial", correct: false },
                { text: "Praiseworthy", correct: false },
                { text: "Acceptable", correct: false }
        ]
},
{
        type: 'text-input',
        question: "KILL",
        correctAnswer: ["slay", "murder", "execute"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "AMBIGUOUS",
        correctAnswer: ["unclear", "vague", "equivocal"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "MELANCHOLIC",
        correctAnswer: ["sad", "gloomy", "sorrowful", "down"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "PACIFIC",
        correctAnswer: ["peaceful", "calm", "nonviolent", "still", "mild", "gentle"],
        timeLimit: 25
},
{
        question: "EXASPERATION",
        timeLimit: 25,
        answers: [
                { text: "Anxiety", correct: false },
                { text: "Calm", correct: false },
                { text: "Relief", correct: false },
                { text: "Frustration", correct: true },
                { text: "Indolence", correct: false },
                { text: "Rage", correct: false }
        ]
},
{
        question: "SANCTIMONIOUS",
        timeLimit: 25,
        answers: [
                { text: "Humble", correct: false },
                { text: "Genuine", correct: false },
                { text: "Sincere", correct: false },
                { text: "Altruistic", correct: false },
                { text: "Modest", correct: false },
                { text: "Self-righteous", correct: true }
        ]
},
{
        question: "EXACERBATE",
        timeLimit: 25,
        answers: [
                { text: "Descend", correct: false },
                { text: "Alleviate", correct: false },
                { text: "Soothe", correct: false },
                { text: "Worship", correct: false },
                { text: "Worsen", correct: true },
                { text: "Mitigate", correct: false }
        ]
},
{
        question: "METICULOUS",
        timeLimit: 25,
        answers: [
                { text: "Careless", correct: false },
                { text: "Melancholic", correct: false },
                { text: "Prim", correct: false },
                { text: "Soothing", correct: false },
                { text: "Thorough", correct: true },
                { text: "Wondrous", correct: false }
        ]
},
{
        question: "EPHEMERAL",
        timeLimit: 25,
        answers: [
                { text: "Temporary", correct: true },
                { text: "Permanent", correct: false },
                { text: "Enduring", correct: false },
                { text: "Transparent", correct: false },
                { text: "Eternal", correct: false },
                { text: "Lasting", correct: false }
        ]
},
{
        question: "HEGEMONY",
        timeLimit: 25,
        answers: [
                { text: "Equality", correct: false },
                { text: "Dominance", correct: true },
                { text: "Monarchy", correct: false },
                { text: "Inferiority", correct: false },
                { text: "Collaboration", correct: false },
                { text: "Subordination", correct: false }
        ]
},
{
        question: "APOTHEOSIS",
        timeLimit: 25,
        answers: [
                { text: "Ascension", correct: true },
                { text: "Original sin", correct: false },
                { text: "Nadir", correct: false },
                { text: "Prime", correct: false },
                { text: "Theoretical framework", correct: false },
                { text: "Biblical study", correct: false }
        ]
},
{
        type: 'text-input',
        question: "AMICABLE",
        correctAnswer: ["friendly", "cordial", "harmonious", "polite", "courteuous", "civil", ],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "ENIGMA",
        correctAnswer: ["mystery", "puzzle", "riddle"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "RELIC",
        correctAnswer: ["artifact", "remnant", "vestige"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "METAMORPHOSIS",
        correctAnswer: ["transformation", "change", "evolution"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "NEBULOUS",
        correctAnswer: ["vague", "unclear", "hazy", "indistinct", "indefinite"],
        timeLimit: 25
},
{
        question: "SERENDIPITY",
        timeLimit: 25,
        answers: [
                { text: "Undeterred faith", correct: false },
                { text: "Wonder", correct: false },
                { text: "Misfortune", correct: false },
                { text: "Fortuitousness", correct: true },
                { text: "Predictability", correct: false },
                { text: "Unintentional act", correct: false }
        ]
},
{
        question: "INCONGRUOUS",
        timeLimit: 25,
        answers: [
                { text: "Harmonious", correct: false },
                { text: "Proper", correct: false },
                { text: "Liminal", correct: false },
                { text: "Far-reaching", correct: false },
                { text: "Out of place", correct: true },
                { text: "Apolitical", correct: false }
        ]
},
{
        question: "PERFUNCTORY",
        timeLimit: 25,
        answers: [
                { text: "Rapacious", correct: false },
                { text: "Similar", correct: false },
                { text: "Frugal", correct: false },
                { text: "Cursory", correct: true },
                { text: "Illusory", correct: false },
                { text: "Comprehensive", correct: false }
        ]
},
{
        question: "ONTOLOGICAL",
        timeLimit: 25,
        answers: [
                { text: "Trivial", correct: false },
                { text: "Deeply profound", correct: false },
                { text: "Irrelevant", correct: false },
                { text: "Nonessential", correct: false },
                { text: "Existential", correct: true },
                { text: "Paradoxical", correct: false }
        ]
},
{
        question: "PREVARICATION",
        timeLimit: 25,
        answers: [
                { text: "Confession", correct: false },
                { text: "Social navigation", correct: false },
                { text: "Ambulation", correct: false },
                { text: "Proclamation", correct: false },
                { text: "Equivocation", correct: true },
                { text: "Psychopathic behavior", correct: false }
        ]
},
{
        question: "RECALCITRANT",
        timeLimit: 25,
        answers: [
                { text: "Stubborn", correct: true },
                { text: "Worrying", correct: false },
                { text: "Dilatory", correct: false },
                { text: "Wondrous", correct: false },
                { text: "Obedient", correct: false },
                { text: "Sagacious", correct: false }
        ]
},
{
        question: "IGNOBLE",
        timeLimit: 25,
        answers: [
                { text: "Pathological", correct: false },
                { text: "Admirable", correct: false },
                { text: "Noble", correct: false },
                { text: "Dishonorable", correct: true },
                { text: "Ethical", correct: false },
                { text: "Discriminatory", correct: false }
        ]
},
{
        question: "ANHEDONIA",
        timeLimit: 25,
        answers: [
                { text: "Excessive hatred", correct: false },
                { text: "Disappointment", correct: false },
                { text: "Euphoria", correct: false },
                { text: "Anticipatory anxiety", correct: false },
                { text: "Inability to feel pleasure", correct: true },
                { text: "General mental illness", correct: false }
        ]
},
{
        question: "DILATORY",
        timeLimit: 25,
        answers: [
                { text: "Incapable", correct: false },
                { text: "Efficient", correct: false },
                { text: "Slow", correct: true },
                { text: "Eclectic", correct: false },
                { text: "Neutral", correct: false },
                { text: "Vengeful", correct: false }
        ]
},
{
        question: "MALFEASANCE",
        timeLimit: 25,
        answers: [
                { text: "Insubordination", correct: false },
                { text: "Wrongdoing", correct: true },
                { text: "Evil", correct: false },
                { text: "Deception", correct: false },
                { text: "Virtue", correct: false },
                { text: "Rectitude", correct: false }
        ]
},
{
        type: 'text-input',
        question: "SUPERFLUOUS",
        correctAnswer: ["unnecessary", "redundant", "excess", "excessive"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "IDIOSYNCRASY",
        correctAnswer: ["quirk", "peculiarity", "eccentricity", "characteristic", "trick"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "AMELIORATE",
        correctAnswer: ["improve", "enhance", "alleviate", "refine", "rectify"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "FLUMMOXED",
        correctAnswer: ["confused", "baffled", "perplexed", "flabbergasted", "bewildered", "disconcerted", "discombobulated"],
        timeLimit: 25
},
{
        question: "SOLIPSISTIC",
        timeLimit: 25,
        answers: [
                { text: "Garrulous", correct: false },
                { text: "Altruistic", correct: false },
                { text: "Apprehensive", correct: false },
                { text: "Self-centered", correct: true },
                { text: "Pretentious", correct: false },
                { text: "Omnipotent", correct: false }
        ]
},
{
        question: "QUIXOTIC",
        timeLimit: 25,
        answers: [
                { text: "Realistic", correct: false },
                { text: "Idealistic", correct: true },
                { text: "Practical", correct: false },
                { text: "Sensible", correct: false },
                { text: "Academic", correct: false },
                { text: "Logical", correct: false }
        ]
},
{
        question: "LUGUBRIOUS",
        timeLimit: 25,
        answers: [
                { text: "Mournful", correct: true },
                { text: "Verbose", correct: false },
                { text: "Convivial", correct: false },
                { text: "Lighthearted", correct: false },
                { text: "Morose", correct: false },
                { text: "In decline", correct: false }
        ]
},
{
        question: "PERNICIOUS",
        timeLimit: 25,
        answers: [
                { text: "Neglectful", correct: false },
                { text: "Wholesome", correct: false },
                { text: "Harmful", correct: true },
                { text: "Soothing", correct: false },
                { text: "Constructive", correct: false },
                { text: "Laconic", correct: false }
        ]
},
{
        question: "VOCIFEROUS",
        timeLimit: 25,
        answers: [
                { text: "Suspicious", correct: false },
                { text: "Awkward", correct: false },
                { text: "Subdued", correct: false },
                { text: "Forceful", correct: true },
                { text: "Muted", correct: false },
                { text: "Unworthy", correct: false }
        ]
},
{
        question: "PROFLIGACY",
        timeLimit: 25,
        answers: [
                { text: "Frugality", correct: false },
                { text: "Wastefulness", correct: true },
                { text: "Prodigiousness", correct: false },
                { text: "Luminosity", correct: false },
                { text: "Prudence", correct: false },
                { text: "Verbal difficulty", correct: false }
        ]
},
{
        question: "VELLEITY",
        timeLimit: 25,
        answers: [
                { text: "Strong will", correct: false },
                { text: "Promiscuity", correct: false },
                { text: "Resentment", correct: false },
                { text: "Weak desire", correct: true },
                { text: "Contentment", correct: false },
                { text: "Melancholy", correct: false }
        ]
},
{
        type: 'text-input',
        question: "INDOLENT",
        correctAnswer: ["lazy", "slothful", "idle", "inactive", "inert", "lethargic", "languid", "torpid"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "CLANDESTINE",
        correctAnswer: ["secret", "covert", "surreptitious", "stealthy", "furtive"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "SARDONIC",
        correctAnswer: ["cynical", "mocking", "sarcastic", "scornful", "derisive", "satirical", "contemptuous"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "SUPERCILIOUS",
        correctAnswer: ["arrogant", "haughty", "condescending", "conceited", "disdainful", "overbearing", "patronizing", "overbearing"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "QUINTESSENTIAL",
        correctAnswer: ["archetypal", "classic", "embodiment", "typical", "prototypical"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "ESOTERIC",
        correctAnswer: ["obscure", "abstruse", "arcane"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "CREPUSCULAR",
        correctAnswer: ["twilight", "dusk", "dawn", "dusky", "dawny", "dark", "cloudy", "murky", "somber"],
        timeLimit: 25
},
{
        type: 'text-input',
        question: "TENEBROUS",
        correctAnswer: ["dark", "gloomy", "shadowy", "murky"],
        timeLimit: 25
},
// more...
    ]
}

];


// Variables
let currentQuestionIndex = 0;
let currentSubtest = 0;
let score = 0;
let timer;
let timeLeft;
let consecutiveWrong = 0;
let MAX_CONSECUTIVE_WRONG = subtests[0].maxConsecutiveWrong;
let startTime;
let endTime;
let questionStartTimes = {};
let questionEndTimes = {};
let questionResponses = {};
let subtestScores = [];
let isShowingInstructions = true;
let questions = subtests[0].questions;

// DOM Elements
const questionContainer = document.getElementById("question-container");
const answersContainer = document.getElementById("answers-container");
const resultContainer = document.getElementById("result");
const timerDisplay = document.getElementById("timer");

// Set configurable titles
document.getElementById('page-title').textContent = CONFIG.pageTitle;
document.getElementById('test-title').textContent = CONFIG.testTitle;

// Helper Functions
function getISOTimestamp() {
    return new Date().toISOString();
}

function startTimer(duration) {
    clearInterval(timer);
    timerDisplay.classList.remove('warning');
    
    if (duration === 0) {
        timerDisplay.style.display = 'none';
        return;
    }

    timerDisplay.style.display = 'block';
    timeLeft = duration;
    updateTimerDisplay();

    timer = setInterval(() => {
        timeLeft--;
        updateTimerDisplay();

        if (timeLeft <= 5) {
            timerDisplay.classList.add('warning');
        }

        if (timeLeft <= 0) {
            clearInterval(timer);
            handleTimeUp();
        }
    }, 1000);
}

function updateTimerDisplay() {
    timerDisplay.textContent = `Time remaining: ${timeLeft}s`;
}

function handleTimeUp() {
    const currentQuestion = questions[currentQuestionIndex];

    if (currentQuestion.type === 'text-input') {
        // For text input, an empty answer is considered incorrect
        checkAnswer(''); 
    } else {
        // For multiple choice, simulate an incorrect answer selection
        // We'll pass a dummy object that mimics an answerDiv with incorrect data
        handleAnswer('', false); // Treat a timeout as an incorrect answer
    }
}


// Quiz Functions
function showInstructions() {
 document.getElementById('test-title').textContent = subtests[currentSubtest].title;
    const currentSubtestConfig = subtests[currentSubtest];
    questionContainer.innerHTML = `
        <div class="instructions">
            <p>${currentSubtestConfig.instructions}</p>
            <button class="submit-button" onclick="startSubtest()">Begin</button>
        </div>
    `;
    answersContainer.innerHTML = '';
    timerDisplay.style.display = 'none';
}

function startSubtest() {
    isShowingInstructions = false;
    document.getElementById('test-title').textContent = subtests[currentSubtest].title;
    MAX_CONSECUTIVE_WRONG = subtests[currentSubtest].maxConsecutiveWrong;
    questions = subtests[currentSubtest].questions;
    currentQuestionIndex = 0;
    score = 0;
    consecutiveWrong = 0;
    showQuestion();

    if (currentSubtest == 2){
	    document.getElementById('loadingScreen').style.display = 'flex';
        document.getElementById('loadingProgress').style.width = 0 + '%';
        let loadedImages2 = 0;
        const totalImages2 = imageSet2.length;

    // Preload
        imageSet2.forEach(path => {
            const img2 = new Image();
            img2.onload = () => {
                loadedImages2++;
                const percent = Math.round((loadedImages1 / totalImages1) * 100);
                document.getElementById('progress').textContent = percent;
                document.getElementById('loadingProgress').style.width = percent + '%';
                if(loadedImages2 === totalImages2) {
                    document.getElementById('loadingScreen').style.display = 'none';
                }
            };
            img2.src = path;
        });
    }
}

function startQuiz() {
    currentSubtest = 0;
    subtestScores = [];
    isShowingInstructions = true;
    startTime = getISOTimestamp();
    showInstructions();
}

function startQuestion() {
    const now = new Date().getTime();
    questionStartTimes[currentQuestionIndex] = now;

    // Initialize questionResponses for the current subtest if it doesn't exist
    if (!questionResponses[subtests[currentSubtest].name]) {
        questionResponses[subtests[currentSubtest].name] = {};
    }

    // Initialize response for the current question
    questionResponses[subtests[currentSubtest].name][currentQuestionIndex] = {
        correct: null,
        time: 0
    };
}

function showQuestion() {
    startQuestion();
    const currentQuestion = questions[currentQuestionIndex];
    
    questionContainer.innerHTML = `<h2>${currentQuestion.question}</h2>`;
    
    if (currentQuestion.image) {
        questionContainer.innerHTML += `<img src="${currentQuestion.image}" alt="Question Image">`;
    }

    if (currentQuestion.type === 'text-input') {
        showTextInput();
    } else {
        showMultipleChoice(currentQuestion);
    }

    startTimer(currentQuestion.timeLimit);
}

function showTextInput() {
    answersContainer.classList.remove('grid');
    answersContainer.innerHTML = `
        <div class="input-container">
            <input type="text" class="answer-input" placeholder="">
            <div class="error-message"></div>
            <button class="submit-button">Submit</button>
        </div>
    `;

    const input = answersContainer.querySelector('.answer-input');
    const submitButton = answersContainer.querySelector('.submit-button');
    
    input.focus();
    
    input.addEventListener('keypress', (e) => {
        if (!/^[a-zA-Z]$/.test(e.key) && e.key !== 'Enter') {
            e.preventDefault();
            return false;
        }
        
        if (e.key === 'Enter') {
            checkAnswer(input.value);
        }
    });

    input.addEventListener('paste', (e) => {
        e.preventDefault();
        const pastedText = (e.clipboardData || window.clipboardData).getData('text');
        const processedText = pastedText.toLowerCase().replace(/[^a-z]/g, '');
        input.value = processedText;
    });

    submitButton.addEventListener('click', () => {
        checkAnswer(input.value);
    });
}

function showMultipleChoice(question) {
    answersContainer.classList.add('grid');
    answersContainer.innerHTML = '';

    question.answers.forEach((answer, index) => {
        const answerDiv = document.createElement('div');
        answerDiv.className = 'answer';

        // Assign a letter (A-F) or number (1-6) to each answer choice
        const answerLabel = String.fromCharCode(65 + index); // 65 is 'A' in ASCII
        // OR: const answerLabel = index + 1; // For 1-6 numbering

        if (answer.image) {
            const img = document.createElement('img');
            img.src = answer.image;
            img.alt = 'Answer Option';
            answerDiv.appendChild(img);
        }

        if (answer.text) {
            const p = document.createElement('p');
            // Include the label in the displayed text
            p.textContent = `${answerLabel}. ${answer.text}`; 
            answerDiv.appendChild(p);
        }

        // Store the answer label and whether it's correct for later use
        answerDiv.dataset.label = answerLabel;
        answerDiv.dataset.correct = answer.correct; // Store as string

        answerDiv.addEventListener('click', () => selectAnswer(answerDiv));
        answersContainer.appendChild(answerDiv);
    });
}

function checkAnswer(userInput) {
    const currentQuestion = questions[currentQuestionIndex];
    const isCorrect = currentQuestion.correctAnswer.some(answer => 
        userInput.toLowerCase().trim() === answer.toLowerCase().trim()
    );

    handleAnswer(userInput, isCorrect);
}

function selectAnswer(answerDiv) {
    // Get the label and correctness from the clicked div's data attributes
    const selectedLabel = answerDiv.dataset.label;
    // Explicitly convert data-correct to a boolean
    const isCorrect = answerDiv.dataset.correct === 'true';

    // Pass the selected label to handleAnswer
    handleAnswer(selectedLabel, isCorrect);
}

function handleAnswer(userAnswer, isCorrect) {
    const now = new Date().getTime();
    const timeSpent = now - questionStartTimes[currentQuestionIndex];

    // Store whether the answer was correct, the time spent, and the user's answer
    questionResponses[subtests[currentSubtest].name][currentQuestionIndex] = {
        correct: isCorrect ? 1 : 0,
        time: timeSpent,
        userAnswer: userAnswer // Correctly uses the passed userAnswer
    };

    if (isCorrect) {
        score++;
        consecutiveWrong = 0;
    } else {
        consecutiveWrong++;
    }

    if (consecutiveWrong >= MAX_CONSECUTIVE_WRONG) {
        endSubtest();
        return;
    }

    currentQuestionIndex++;
    if (currentQuestionIndex < questions.length) {
        showQuestion();
    } else {
        endSubtest();
    }
}





function endSubtest() {
    subtestScores.push({
        name: subtests[currentSubtest].name,
        score: score,
        totalQuestions: questions.length
    });
    
    currentSubtest++;
    if (currentSubtest < subtests.length) {
        isShowingInstructions = true;
        showInstructions();
    } else {
        endQuiz();
    }
}

function showFinalResults() {
document.getElementById('test-title').textContent = "Test Results";
    let resultsHTML = '<div class="subtest-results">';
    
    subtestScores.forEach(result => {
        resultsHTML += `
            <div class="subtest-result">
                <p>${result.name}</p>
                <p>Score: ${result.score} out of ${result.totalQuestions}</p>
                <p></p>
            </div>
        `;
    });
    
    resultsHTML += '</div>';
    
    questionContainer.innerHTML = resultsHTML;
    answersContainer.innerHTML = '';
    timerDisplay.style.display = 'none';
}

function endQuiz() {
    endTime = getISOTimestamp();
    clearInterval(timer);
    showFinalResults();

    // Prepare data to send to server
    const dataToSend = {
        ip: userIP,
        cookie: userCookie,
        age: userAge,
        isNativeEnglishSpeaker: isNativeEnglishSpeaker,
        hasTakenTestBefore: hasTakenTestBefore,
        estFSIQ: estFSIQ,
        estGAI: estGAI,
        estFRI: estFRI,
        estVCI: estVCI,
        waisMR: waisMR,
        waisSI: waisSI,
        waisFW: waisFW,
        waisVC: waisVC,
        waisDS: waisDS,
        waisFSIQ: waisFSIQ,
        wiscMR: wiscMR,
        wiscSI: wiscSI,
        wiscFW: wiscFW,
        wiscVC: wiscVC,
        wiscDS: wiscDS,
        wiscFSIQ: wiscFSIQ,
        sb5NVFR: sb5NVFR,
        sb5VFR: sb5VFR,
        sb5VK: sb5VK,
        sb5NVQR: sb5NVQR,
        sb5VQR: sb5VQR,
        sb5FSIQ: sb5FSIQ,
        caitFW: caitFW,
        caitVC: caitVC,
        caitVP: caitVP,
        caitDS: caitDS,
        caitSS: caitSS,
        caitGAI: caitGAI,
        caitFSIQ: caitFSIQ,
        satV: satV,
        satM: satM,
        satTotal: satTotal,
        greV: greV,
        greQ: greQ,
        greA: greA,
        greTotal: greTotal,
        agctScore: agctScore,
        subtestScores: subtestScores,
        itemData: questionResponses,
        startTime: startTime,
        endTime: endTime
    };

    // Send data to PHP script
    fetch('save_data.php', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        body: JSON.stringify(dataToSend)
    })
    .then(response => response.text()) // You can change this to .json() if your PHP sends back JSON
    .then(data => {
        console.log('Server response:', data);
        // You can display a message to the user here, e.g., "Data saved successfully!"
    })
    .catch(error => {
        console.error('Error sending data:', error);
        // Handle errors, maybe display an error message to the user
    });
}


const imageSet1 = [
    'questions/1.png',
    'questions/2.png',
    'questions/3.png',
    'questions/4.png',
    'questions/5.png',
    'questions/6.png',
    'questions/7.png',
    'questions/8.png',
    'questions/9.png',
    'questions/10.png',
    'questions/11.png',
    'questions/12.png',
    'questions/13.png',
    'questions/14.png',
    'questions/15.png',
    'questions/16.png',
    'questions/17.png',
    'questions/18.png',
    'questions/19.png',
    'questions/20.png',
    'questions/21.png',
    'questions/22.png',
    'questions/23.png',
    'questions/24.png',
    'questions/neweasy.png',
    'questions/newmed.png',
    'questions/newhard.png',

    'answers/1A.png',
    'answers/1B.png',
    'answers/1C.png',
    'answers/1D.png',
    'answers/1E.png',
    'answers/1F.png',
    'answers/2A.png',
    'answers/2B.png',
    'answers/2C.png',
    'answers/2D.png',
    'answers/2E.png',
    'answers/2F.png',
    'answers/3A.png',
    'answers/3B.png',
    'answers/3C.png',
    'answers/3D.png',
    'answers/3E.png',
    'answers/3F.png',
    'answers/4A.png',
    'answers/4B.png',
    'answers/4C.png',
    'answers/4D.png',
    'answers/4E.png',
    'answers/4F.png',
    'answers/5A.png',
    'answers/5B.png',
    'answers/5C.png',
    'answers/5D.png',
    'answers/5E.png',
    'answers/5F.png',
    'answers/6A.png',
    'answers/6B.png',
    'answers/6C.png',
    'answers/6D.png',
    'answers/6E.png',
    'answers/6F.png',
    'answers/7A.png',
    'answers/7B.png',
    'answers/7C.png',
    'answers/7D.png',
    'answers/7E.png',
    'answers/7F.png',
    'answers/8A.png',
    'answers/8B.png',
    'answers/8C.png',
    'answers/8D.png',
    'answers/8E.png',
    'answers/8F.png',
    'answers/9A.png',
    'answers/9B.png',
    'answers/9C.png',
    'answers/9D.png',
    'answers/9E.png',
    'answers/9F.png',
    'answers/10A.png',
    'answers/10B.png',
    'answers/10C.png',
    'answers/10D.png',
    'answers/10E.png',
    'answers/10F.png',
    'answers/11A.png',
    'answers/11B.png',
    'answers/11C.png',
    'answers/11D.png',
    'answers/11E.png',
    'answers/11F.png',
    'answers/12A.png',
    'answers/12B.png',
    'answers/12C.png',
    'answers/12D.png',
    'answers/12E.png',
    'answers/12F.png',
    'answers/13A.png',
    'answers/13B.png',
    'answers/13C.png',
    'answers/13D.png',
    'answers/13E.png',
    'answers/13F.png',
    'answers/14A.png',
    'answers/14B.png',
    'answers/14C.png',
    'answers/14D.png',
    'answers/14E.png',
    'answers/14F.png',
    'answers/15A.png',
    'answers/15B.png',
    'answers/15C.png',
    'answers/15D.png',
    'answers/15E.png',
    'answers/15F.png',
    'answers/16A.png',
    'answers/16B.png',
    'answers/16C.png',
    'answers/16D.png',
    'answers/16E.png',
    'answers/16F.png',
    'answers/17A.png',
    'answers/17B.png',
    'answers/17C.png',
    'answers/17D.png',
    'answers/17E.png',
    'answers/17F.png',
    'answers/18A.png',
    'answers/18B.png',
    'answers/18C.png',
    'answers/18D.png',
    'answers/18E.png',
    'answers/18F.png',
    'answers/19A.png',
    'answers/19B.png',
    'answers/19C.png',
    'answers/19D.png',
    'answers/19E.png',
    'answers/19F.png',
    'answers/20A.png',
    'answers/20B.png',
    'answers/20C.png',
    'answers/20D.png',
    'answers/20E.png',
    'answers/20F.png',
    'answers/21A.png',
    'answers/21B.png',
    'answers/21C.png',
    'answers/21D.png',
    'answers/21E.png',
    'answers/21F.png',
    'answers/22A.png',
    'answers/22B.png',
    'answers/22C.png',
    'answers/22D.png',
    'answers/22E.png',
    'answers/22F.png',
    'answers/23A.png',
    'answers/23B.png',
    'answers/23C.png',
    'answers/23D.png',
    'answers/23E.png',
    'answers/23F.png',
    'answers/24A.png',
    'answers/24B.png',
    'answers/24C.png',
    'answers/24D.png',
    'answers/24E.png',
    'answers/24F.png',


];

const imageSet2 = [

    'fwquestions/1.png',
    'fwquestions/2.png',
    'fwquestions/3.png',
    'fwquestions/4.png',
    'fwquestions/5.png',
    'fwquestions/6.png',
    'fwquestions/7.png',
    'fwquestions/8.png',
    'fwquestions/9.png',
    'fwquestions/10.png',
    'fwquestions/11.png',
    'fwquestions/12.png',
    'fwquestions/13.png',
    'fwquestions/14.png',
    'fwquestions/15.png',
    'fwquestions/16.png',
    'fwquestions/17.png',
    'fwquestions/18.png',
    'fwquestions/19.png',
    'fwquestions/20.png',
    'fwquestions/21.png',
    'fwquestions/22.png',
    'fwquestions/23.png',
    'fwquestions/24.png',
    'fwquestions/25.png',
    'fwquestions/26.png',
    'fwquestions/27.png',
    'fwquestions/28.png',
    'fwquestions/29.png',
    'fwquestions/30.png',
    'fwquestions/31.png',

    'fwanswers/1A.png',
    'fwanswers/1B.png',
    'fwanswers/1C.png',
    'fwanswers/1D.png',
    'fwanswers/1E.png',
    'fwanswers/1F.png',
    'fwanswers/2A.png',
    'fwanswers/2B.png',
    'fwanswers/2C.png',
    'fwanswers/2D.png',
    'fwanswers/2E.png',
    'fwanswers/2F.png',
    'fwanswers/3A.png',
    'fwanswers/3B.png',
    'fwanswers/3C.png',
    'fwanswers/3D.png',
    'fwanswers/3E.png',
    'fwanswers/3F.png',
    'fwanswers/4A.png',
    'fwanswers/4B.png',
    'fwanswers/4C.png',
    'fwanswers/4D.png',
    'fwanswers/4E.png',
    'fwanswers/4F.png',
    'fwanswers/5A.png',
    'fwanswers/5B.png',
    'fwanswers/5C.png',
    'fwanswers/5D.png',
    'fwanswers/5E.png',
    'fwanswers/5F.png',
    'fwanswers/6A.png',
    'fwanswers/6B.png',
    'fwanswers/6C.png',
    'fwanswers/6D.png',
    'fwanswers/6E.png',
    'fwanswers/6F.png',
    'fwanswers/7A.png',
    'fwanswers/7B.png',
    'fwanswers/7C.png',
    'fwanswers/7D.png',
    'fwanswers/7E.png',
    'fwanswers/7F.png',
    'fwanswers/8A.png',
    'fwanswers/8B.png',
    'fwanswers/8C.png',
    'fwanswers/8D.png',
    'fwanswers/8E.png',
    'fwanswers/8F.png',
    'fwanswers/9A.png',
    'fwanswers/9B.png',
    'fwanswers/9C.png',
    'fwanswers/9D.png',
    'fwanswers/9E.png',
    'fwanswers/9F.png',
    'fwanswers/10A.png',
    'fwanswers/10B.png',
    'fwanswers/10C.png',
    'fwanswers/10D.png',
    'fwanswers/10E.png',
    'fwanswers/10F.png',
    'fwanswers/11A.png',
    'fwanswers/11B.png',
    'fwanswers/11C.png',
    'fwanswers/11D.png',
    'fwanswers/11E.png',
    'fwanswers/11F.png',
    'fwanswers/12A.png',
    'fwanswers/12B.png',
    'fwanswers/12C.png',
    'fwanswers/12D.png',
    'fwanswers/12E.png',
    'fwanswers/12F.png',
    'fwanswers/13A.png',
    'fwanswers/13B.png',
    'fwanswers/13C.png',
    'fwanswers/13D.png',
    'fwanswers/13E.png',
    'fwanswers/13F.png',
    'fwanswers/14A.png',
    'fwanswers/14B.png',
    'fwanswers/14C.png',
    'fwanswers/14D.png',
    'fwanswers/14E.png',
    'fwanswers/14F.png',
    'fwanswers/15A.png',
    'fwanswers/15B.png',
    'fwanswers/15C.png',
    'fwanswers/15D.png',
    'fwanswers/15E.png',
    'fwanswers/15F.png',
    'fwanswers/16A.png',
    'fwanswers/16B.png',
    'fwanswers/16C.png',
    'fwanswers/16D.png',
    'fwanswers/16E.png',
    'fwanswers/16F.png',
    'fwanswers/17A.png',
    'fwanswers/17B.png',
    'fwanswers/17C.png',
    'fwanswers/17D.png',
    'fwanswers/17E.png',
    'fwanswers/17F.png',
    'fwanswers/18A.png',
    'fwanswers/18B.png',
    'fwanswers/18C.png',
    'fwanswers/18D.png',
    'fwanswers/18E.png',
    'fwanswers/18F.png',
    'fwanswers/19A.png',
    'fwanswers/19B.png',
    'fwanswers/19C.png',
    'fwanswers/19D.png',
    'fwanswers/19E.png',
    'fwanswers/19F.png',
    'fwanswers/20A.png',
    'fwanswers/20B.png',
    'fwanswers/20C.png',
    'fwanswers/20D.png',
    'fwanswers/20E.png',
    'fwanswers/20F.png',
    'fwanswers/21A.png',
    'fwanswers/21B.png',
    'fwanswers/21C.png',
    'fwanswers/21D.png',
    'fwanswers/21E.png',
    'fwanswers/21F.png',
    'fwanswers/22A.png',
    'fwanswers/22B.png',
    'fwanswers/22C.png',
    'fwanswers/22D.png',
    'fwanswers/22E.png',
    'fwanswers/22F.png',
    'fwanswers/23A.png',
    'fwanswers/23B.png',
    'fwanswers/23C.png',
    'fwanswers/23D.png',
    'fwanswers/23E.png',
    'fwanswers/23F.png',
    'fwanswers/24A.png',
    'fwanswers/24B.png',
    'fwanswers/24C.png',
    'fwanswers/24D.png',
    'fwanswers/24E.png',
    'fwanswers/24F.png',
    'fwanswers/25A.png',
    'fwanswers/25B.png',
    'fwanswers/25C.png',
    'fwanswers/25D.png',
    'fwanswers/25E.png',
    'fwanswers/25F.png',
    'fwanswers/26A.png',
    'fwanswers/26B.png',
    'fwanswers/26C.png',
    'fwanswers/26D.png',
    'fwanswers/26E.png',
    'fwanswers/26F.png',
    'fwanswers/27A.png',
    'fwanswers/27B.png',
    'fwanswers/27C.png',
    'fwanswers/27D.png',
    'fwanswers/27E.png',
    'fwanswers/27F.png',
    'fwanswers/28A.png',
    'fwanswers/28B.png',
    'fwanswers/28C.png',
    'fwanswers/28D.png',
    'fwanswers/28E.png',
    'fwanswers/28F.png',
    'fwanswers/29A.png',
    'fwanswers/29B.png',
    'fwanswers/29C.png',
    'fwanswers/29D.png',
    'fwanswers/29E.png',
    'fwanswers/29F.png',
    'fwanswers/30A.png',
    'fwanswers/30B.png',
    'fwanswers/30C.png',
    'fwanswers/30D.png',
    'fwanswers/30E.png',
    'fwanswers/30F.png',
    'fwanswers/31A.png',
    'fwanswers/31B.png',
    'fwanswers/31C.png',
    'fwanswers/31D.png',
    'fwanswers/31E.png',
    'fwanswers/31F.png',


];

let loadedImages1 = 0;
let loadedImages2 = 0;
const totalImages1 = imageSet1.length;

// Preload
    imageSet1.forEach(path => {
        const img = new Image();
        img.onload = () => {
            loadedImages1++;
            const percent = Math.round((loadedImages1 / totalImages1) * 100);
            document.getElementById('progress').textContent = percent;
            document.getElementById('loadingProgress').style.width = percent + '%';
            if(loadedImages1 === totalImages1) {
                document.getElementById('loadingScreen').style.display = 'none';
            }
        };
        img.src = path;
    });

// Start the quiz when the page loads
window.onload = startQuiz;

</script>
</body>
</html>