# 🌟 30 Questions to Pass the 2024 Road Code - Free & Fast Test | 2ROUE

Test your driving license knowledge with this interactive quiz. 30 true or false questions to review your road code.

---

import ArticleScript from '@/components/ArticleScript';
import ArticleStyle from '@/components/ArticleStyle';


{/* Hero Section Premium */}
<div className="article-container" style={{textAlign: 'center', padding: '40px 20px'}}>
    <div style={{display: 'inline-block', background: 'linear-gradient(135deg, #3498db 0%, #2980b9 100%)', padding: '8px 20px', borderRadius: '20px', marginBottom: '20px'}}>
        <span style={{color: 'white', fontWeight: '700', fontSize: '0.9em'}}>✨ CODE 2024</span>
    </div>
    
    <h1 style={{fontSize: '2.5em', lineHeight: '1.2', marginBottom: '20px', background: 'linear-gradient(135deg, #ffffff 0%, #94a3b8 100%)', WebkitBackgroundClip: 'text', WebkitTextFillColor: 'transparent', backgroundClip: 'text'}}>
        30 Road Code Questions
    </h1>
    
    <p style={{fontSize: '1.2em', color: '#cbd5e1', maxWidth: '700px', margin: '0 auto 30px', lineHeight: '1.6'}}>
        Test your knowledge with <strong style={{color: '#3498db'}}>30 True/False questions</strong>, instant feedback, and a personalized profile based on your results.
    </p>
    
    {/* Image removed: broken link (wp-content) */}
    
    <div className="hero-info-grid">
        <div className="hero-info-card">
            <div style={{fontSize: '2em', marginBottom: '5px'}}>⚡</div>
            <div className="hero-info-text">3 min chrono</div>
        </div>
        <div className="hero-info-card">
            <div style={{fontSize: '2em', marginBottom: '5px'}}>📚</div>
            <div className="hero-info-text">30 questions</div>
        </div>
        <div className="hero-info-card">
            <div style={{fontSize: '2em', marginBottom: '5px'}}>🏆</div>
            <div className="hero-info-text">Pilot Profile</div>
        </div>
    </div>
    
    <button id="start-quiz30" style={{background: 'linear-gradient(135deg, #3498db, #2980b9)', color: 'white', border: 'none', padding: '18px 50px', borderRadius: '50px', fontSize: '1.3em', fontWeight: '700', cursor: 'pointer', boxShadow: '0 10px 30px rgba(52, 152, 219, 0.4)', marginTop: '40px', transition: 'all 0.3s'}}>
        🚀 START TEST
    </button>
</div>

{/* Progress Bar */}
<div id="quiz30-progress-container" style={{position: 'sticky', top: '0', zIndex: '100', background: 'rgba(2, 6, 23, 0.95)', backdropFilter: 'blur(10px)', padding: '15px 20px', borderBottom: '1px solid rgba(255,255,255,0.1)', display: 'none'}}>
    <div style={{maxWidth: '800px', margin: '0 auto'}}>
        <div style={{display: 'flex', justifyContent: 'space-between', marginBottom: '8px'}}>
            <span style={{fontSize: '0.9em', color: '#94a3b8'}} id="quiz30-progress-text">Question 1/30</span>
            <span style={{fontSize: '0.9em', color: '#3498db', fontWeight: '600'}} id="quiz30-timer">0:00</span>
        </div>
        <div style={{height: '6px', background: 'rgba(255,255,255,0.1)', borderRadius: '10px', overflow: 'hidden'}}>
            <div id="quiz30-progress-bar" style={{height: '100%', width: '3.33%', background: 'linear-gradient(90deg, #3498db, #2980b9)', transition: 'width 0.3s ease', borderRadius: '10px'}}></div>
        </div>
    </div>
</div>

{/* Quiz Container (Premium Design) */}
<div id="quiz30-container" style={{display: 'none', maxWidth: '800px', margin: '40px auto', padding: '0 20px'}}>
    <div style={{background: 'rgba(255,255,255,0.02)', border: '1px solid rgba(255,255,255,0.1)', borderRadius: '20px', padding: '40px', marginBottom: '20px'}}>
        <div style={{display: 'flex', alignItems: 'center', gap: '15px', marginBottom: '15px'}}>
            <div id="quiz30-badge" style={{background: 'linear-gradient(135deg, #3498db, #2980b9)', minWidth: '50px', height: '50px', borderRadius: '12px', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '1.5em', fontWeight: '800', color: 'white', flexShrink: '0'}}>1</div>
            <div id="quiz30-category" style={{textTransform: 'uppercase', fontSize: '0.85em', letterSpacing: '1.5px', color: '#3498db', background: 'rgba(52, 152, 219, 0.1)', padding: '6px 15px', borderRadius: '20px'}}></div>
        </div>
        
        <h3 id="quiz30-quest" style={{fontSize: '1.4em', margin: '25px 0', lineHeight: '1.5', color: '#e2e8f0'}}></h3>
        
        <div style={{display: 'grid', gap: '15px', marginTop: '30px'}}>
            <button id="answer-true-30" style={{display: 'flex', alignItems: 'center', justifyContent: 'center', gap: '15px', padding: '20px', background: 'rgba(46, 204, 113, 0.1)', border: '2px solid rgba(46, 204, 113, 0.3)', borderRadius: '12px', cursor: 'pointer', transition: 'all 0.3s', color: '#2ecc71', fontSize: '1.1em', fontWeight: '600'}}>
                <span style={{fontSize: '1.8em'}}>✓</span>
                <span>TRUE</span>
            </button>
            <button id="answer-false-30" style={{display: 'flex', alignItems: 'center', justifyContent: 'center', gap: '15px', padding: '20px', background: 'rgba(231, 76, 60, 0.1)', border: '2px solid rgba(231, 76, 60, 0.3)', borderRadius: '12px', cursor: 'pointer', transition: 'all 0.3s', color: '#e74c3c', fontSize: '1.1em', fontWeight: '600'}}>
                <span style={{fontSize: '1.8em'}}>✗</span>
                <span>FALSE</span>
            </button>
        </div>
        
        <div style={{textAlign: 'center', marginTop: '30px', paddingTop: '20px', borderTop: '1px solid rgba(255,255,255,0.1)'}}>
            <span style={{fontSize: '1.1em', color: '#94a3b8'}}>Score : </span>
            <span id="quiz30-points" style={{fontSize: '1.3em', fontWeight: '700', color: '#3498db'}}>0</span>
        </div>
    </div>

    {/* Ad Interstitials */}
    <div id="quiz30-ad-2" className="quiz-ad-interstitial" style={{display: 'none', background: 'rgba(255,255,255,0.02)', border: '1px solid rgba(255,255,255,0.1)', borderRadius: '20px', padding: '40px', textAlign: 'center'}}>
        <div style={{fontSize: '0.75em', color: '#64748b', marginBottom: '8px'}}>Advertisement</div>
        <ins className="adsbygoogle" data-ad-client="ca-pub-7586675070258543" data-ad-slot="4357278838" data-ad-format="rectangle"></ins>
        <button className="continue-btn-30">Continue Series →</button>
    </div>
    <div id="quiz30-ad-4" className="quiz-ad-interstitial" style={{display: 'none', background: 'rgba(255,255,255,0.02)', border: '1px solid rgba(255,255,255,0.1)', borderRadius: '20px', padding: '40px', textAlign: 'center'}}>
        <div style={{fontSize: '0.75em', color: '#64748b', marginBottom: '8px'}}>Advertisement</div>
        <ins className="adsbygoogle" data-ad-client="ca-pub-7586675070258543" data-ad-slot="4357278838" data-ad-format="rectangle"></ins>
         <button className="continue-btn-30">Continue Series →</button>
    </div>
    <div id="quiz30-ad-6" className="quiz-ad-interstitial" style={{display: 'none', background: 'rgba(255,255,255,0.02)', border: '1px solid rgba(255,255,255,0.1)', borderRadius: '20px', padding: '40px', textAlign: 'center'}}>
        <div style={{fontSize: '0.75em', color: '#64748b', marginBottom: '8px'}}>Advertisement</div>
        <ins className="adsbygoogle" data-ad-client="ca-pub-7586675070258543" data-ad-slot="4357278838" data-ad-format="rectangle"></ins>
         <button className="continue-btn-30">Continue Series →</button>
    </div>
</div>

{/* Results Panel */}
<div id="quiz30-result" style={{display: 'none', maxWidth: '800px', margin: '60px auto', padding: '0 20px'}}>
    <div style={{background: 'linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.1))', border: '2px solid rgba(52, 152, 219, 0.3)', borderRadius: '24px', padding: '50px 40px', textAlign: 'center'}}>
        <div style={{fontSize: '4em', marginBottom: '20px'}} id="quiz30-emoji">🎉</div>
        <h2 style={{fontSize: '2.2em', marginBottom: '15px'}}>Final Result</h2>
        <div id="quiz30-final-score" style={{fontSize: '3.5em', fontWeight: '800', background: 'linear-gradient(135deg, #3498db, #2980b9)', WebkitBackgroundClip: 'text', WebkitTextFillColor: 'transparent', backgroundClip: 'text', marginBottom: '20px'}}></div>
        <p id="quiz30-result-text" style={{fontSize: '1.2em', color: '#cbd5e1', marginBottom: '10px'}}></p>
        <div id="quiz30-profile" style={{display: 'inline-block', background: 'rgba(52, 152, 219, 0.2)', padding: '12px 30px', borderRadius: '20px', marginTop: '20px'}}>
            <span style={{color: '#3498db', fontWeight: '700', fontSize: '1.1em'}} id="quiz30-profile-badge"></span>
        </div>

        <div style={{display: 'flex', gap: '15px', justifyContent: 'center', marginTop: '40px', flexWrap: 'wrap'}}>
            <button id="reset-quiz30" style={{background: 'linear-gradient(135deg, #3498db, #2980b9)', color: 'white', border: 'none', padding: '16px 35px', borderRadius: '12px', fontSize: '1.05em', fontWeight: '700', cursor: 'pointer'}}>
                🔄 Restart
            </button>
            <a href="/dashboard" style={{background: 'rgba(255,255,255,0.05)', color: 'white', border: '2px solid rgba(255,255,255,0.2)', padding: '16px 35px', borderRadius: '12px', fontSize: '1.05em', fontWeight: '600', textDecoration: 'none', display: 'inline-block'}}>
                📊 View Profile
            </a>
        </div>
    </div>
</div>

{/* Content Section */}
<div className="article-container" style={{maxWidth: '800px', margin: '60px auto', padding: '0 20px'}}>
    <div style={{background: 'rgba(255,255,255,0.02)', border: '1px solid rgba(255,255,255,0.1)', borderRadius: '20px', padding: '40px', marginBottom: '30px'}}>
        <h2 style={{display: 'flex', alignItems: 'center', gap: '15px', marginBottom: '20px'}}>
            <span style={{fontSize: '2em'}}>❓</span>
            Why take this quiz?
        </h2>
        <ul style={{lineHeight: '1.8', color: '#cbd5e1'}}>
            <li><strong>Effective Review</strong>: Different question types (traffic, signs, priorities...)</li>
            <li><strong>Realistic Format</strong>: Questions similar to the official exam</li>
            <li><strong>Fun Learning</strong>: Test yourself while having fun</li>
        </ul>
    </div>
    
    <div style={{background: 'rgba(255,255,255,0.02)', border: '1px solid rgba(255,255,255,0.1)', borderRadius: '20px', padding: '40px'}}>
        <h2 style={{display: 'flex', alignItems: 'center', gap: '15px', marginBottom: '20px'}}>
            <span style={{fontSize: '2em'}}>📝</span>
            Tips for Success
        </h2>
        <ul style={{lineHeight: '1.8', color: '#cbd5e1'}}>
            <li><strong>Study Regularly</strong>: Review signs and rules daily</li>
            <li><strong>Use Tests</strong>: Practice with this quiz and other simulations</li>
            <li><strong>Analyze Mistakes</strong>: Understand why you got it wrong</li>
            <li><strong>Read Carefully</strong>: Take time to understand each question</li>
            <li><strong>Stay Calm</strong>: Keep your focus on the big day</li>
        </ul>
    </div>
</div>

{/* Social Sharing */}
<div className="action-buttons-grid" style={{maxWidth: '800px', margin: '40px auto', padding: '0 20px'}}>
    <a href="#" id="share-whatsapp-30" className="btn-share-whatsapp" style={{background: 'linear-gradient(135deg, #25D366, #128C7E)', color: 'white', padding: '20px', borderRadius: '16px', textDecoration: 'none', display: 'flex', alignItems: 'center', justifyContent: 'center', gap: '12px', fontWeight: '700', fontSize: '1.1em', transition: 'transform 0.2s'}}>
        📱 Share on WhatsApp
    </a>
</div>


<ArticleStyle content={`

/* Fix text overflow in results */
#quiz30-result,
#quiz30-result p,
#quiz30-quest {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}
#quiz30-result li {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

/* Hero Info Cards */
.hero-info-grid { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.hero-info-card { background: rgba(255,255,255,0.05); padding: 12px 20px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); text-align: center; min-width: 120px; }
.hero-info-text { font-size: 0.9em; color: #94a3b8; }
.continue-btn-30 {
    display: block; width: 100%; margin-top: 20px; padding: 15px;
    background: linear-gradient(135deg, #3498db, #2980b9); color: white;
    border: none; border-radius: 12px; font-weight: 700; cursor: pointer;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .article-container { padding: 20px 10px; }
    h1 { font-size: 1.8em; }
    h2 { font-size: 1.5em; }
    p { font-size: 1em; }

    .hero-info-grid { gap: 8px; }
    .hero-info-card { padding: 8px 5px; flex: 1; min-width: 80px; }
    .hero-info-card div:first-child { font-size: 1.4em; margin-bottom: 2px; }
    .hero-info-text { font-size: 0.75em; line-height: 1.2; }
    
    #answer-true-30, #answer-false-30 {
        padding: 12px;
        font-size: 1em;
        width: 100%;
        box-sizing: border-box;
    }
    
    #start-quiz30, #reset-quiz30, a[href="/dashboard"] {
        width: 100%;
        padding: 15px 20px;
        box-sizing: border-box;
        margin-bottom: 10px;
        display: block;
        text-align: center;
    }
}

`} />

<ArticleScript content={`
if (window.initCode2024QuizDone) {
    // Already initialized
} else {
    // Reset flag just in case
}

const questions30 = [
    { category: 'Traffic Rules', question: 'Overtaking a car approaching a level crossing is prohibited.', answer: true },
    { category: 'Traffic Rules', question: 'Rear fog lights can be used in light rain.', answer: false },
    { category: 'Signage', question: 'A round sign with a white background and red border indicates a prohibition.', answer: true },
    { category: 'Signage', question: 'A triangular sign with a bicycle indicates a mandatory cycle path.', answer: false },
    { category: 'Priorities', question: 'At an unmarked intersection, priority is to the right.', answer: true },
    { category: 'Priorities', question: 'An emergency vehicle on call must always respect red lights.', answer: false },
    { category: 'Speed', question: 'The maximum speed on a highway in France is 130 km/h.', answer: true },
    { category: 'Speed', question: 'In the city, speed is limited to 50 km/h even without signs.', answer: true },
    { category: 'Alcohol & Drugs', question: 'The allowed alcohol limit for a novice driver is 0.2 g/L of blood.', answer: true },
    { category: 'Alcohol & Drugs', question: 'Driving under the influence of drugs is allowed if the amount is small.', answer: false },
    { category: 'Lighting', question: 'Dipped headlights must be on during the day in poor visibility.', answer: true },
    { category: 'Lighting', question: 'Position lights are sufficient for driving at night in the city.', answer: false },
    { category: 'Parking', question: 'Parking within 5 meters of a pedestrian crossing is prohibited.', answer: true },
    { category: 'Parking', question: 'Parking is allowed on sidewalks if the car does not block pedestrians.', answer: false },
    { category: 'Eco-driving', question: 'Reducing speed helps decrease fuel consumption.', answer: true },
    { category: 'Eco-driving', question: 'Turning off the engine at a red light is prohibited.', answer: false },
    { category: 'Safety', question: 'Wearing a seatbelt is mandatory in the front and back.', answer: true },
    { category: 'Safety', question: 'Children under 10 can sit in the front without a car seat.', answer: false },
    { category: 'Tunnels', question: 'In a tunnel, it is mandatory to turn on dipped headlights.', answer: true },
    { category: 'Tunnels', question: 'In case of fire in a tunnel, stay in your car.', answer: false },
    { category: 'Pedestrians', question: 'Pedestrians always have priority on zebra crossings.', answer: true },
    { category: 'Pedestrians', question: 'A pedestrian crossing outside a zebra crossing never has priority.', answer: false },
    { category: 'Slow Vehicles', question: 'Slow vehicles must keep right to facilitate overtaking.', answer: true },
    { category: 'Slow Vehicles', question: 'An agricultural tractor can drive at 80 km/h on a national road.', answer: false },
    { category: 'Phone', question: 'Holding a phone while driving is prohibited.', answer: true },
    { category: 'Phone', question: 'Using a hands-free kit is prohibited while driving.', answer: false },
    { category: 'Points License', question: 'A probationary license starts with 6 points.', answer: true },
    { category: 'Points License', question: 'A 3-point deduction is applied for speeding by 20 km/h.', answer: false },
    { category: 'Accidents', question: 'In case of an accident, filling out an agreed statement is mandatory.', answer: true },
    { category: 'Accidents', question: 'If an accident involves a wild animal, it is not necessary to report it.', answer: false }
];

let currentQuestionIndex30 = 0;
let score30 = 0;
let startTime30 = Date.now();
let timerInterval30 = null;

function startTimer30() {
    if (timerInterval30) clearInterval(timerInterval30);
    startTime30 = Date.now();
    timerInterval30 = setInterval(updateTimer30, 1000);
}

function updateTimer30() {
    const elapsed = Math.floor((Date.now() - startTime30) / 1000);
    const minutes = Math.floor(elapsed / 60);
    const seconds = elapsed % 60;
    const timerEl = document.getElementById('quiz30-timer');
    if (timerEl) {
        timerEl.textContent = minutes + ':' + (seconds < 10 ? '0' : '') + seconds;
    }
}

function updateProgress30() {
    const progressText = document.getElementById('quiz30-progress-text');
    const progressBar = document.getElementById('quiz30-progress-bar');
    const progressContainer = document.getElementById('quiz30-progress-container');
    const badge = document.getElementById('quiz30-badge');
    
    if (progressText) progressText.textContent = 'Question ' + (currentQuestionIndex30 + 1) + '/30';
    if (progressBar) progressBar.style.width = ((currentQuestionIndex30 + 1) / 30 * 100) + '%';
    if (progressContainer) progressContainer.style.display = 'block';
    if (badge) badge.textContent = (currentQuestionIndex30 + 1);
}

function startQuiz30() {
    const startBtn = document.getElementById('start-quiz30');
    const quizContainer = document.getElementById('quiz30-container');
    
    if (startBtn) startBtn.style.display = 'none';
    if (quizContainer) quizContainer.style.display = 'block';
    
    currentQuestionIndex30 = 0;
    score30 = 0;
    startTimer30();
    showQuestion30();
    
    quizContainer.scrollIntoView({ behavior: 'smooth' });
}

function showQuestion30() {
    const question = questions30[currentQuestionIndex30];
    const categoryEl = document.getElementById('quiz30-category');
    const questEl = document.getElementById('quiz30-quest');
    const pointsEl = document.getElementById('quiz30-points');
    
    if (categoryEl) categoryEl.textContent = question.category;
    if (questEl) questEl.textContent = question.question;
    if (pointsEl) pointsEl.textContent = score30;
    
    updateProgress30();
}

function answerQuiz30(userAnswer) {
    const question = questions30[currentQuestionIndex30];
    if (userAnswer === question.answer) {
        score30++;
    }
    currentQuestionIndex30++;
    
    // Ad break at index 2, 4, 6
    if ([2, 4, 6].includes(currentQuestionIndex30)) {
        showAdBreak30(currentQuestionIndex30);
    } else if (currentQuestionIndex30 < questions30.length) {
        showQuestion30();
    } else {
        endQuiz30();
    }
}

function showAdBreak30(index) {
    const container = document.getElementById('quiz30-container');
    if(!container) return;
    
    const children = container.children;
    for(let i=0; i<children.length; i++) {
        children[i].style.display = 'none';
    }
    
    const adId = 'quiz30-ad-' + index;
    const adFn = document.getElementById(adId);
    if (adFn) {
        adFn.style.display = 'block';
        try { (window.adsbygoogle = window.adsbygoogle || []).push({}); } catch(e) {}
    } else {
        // Fallback if ad block missing
        proceedToNextQuestion30();
    }
}

function resumeQuiz30() {
    document.querySelectorAll('.quiz-ad-interstitial').forEach(ad => ad.style.display = 'none');
    
    const container = document.getElementById('quiz30-container');
    if(container && container.firstElementChild) {
        container.firstElementChild.style.display = 'block'; // Show question block
    }
    
    if (currentQuestionIndex30 < questions30.length) {
        showQuestion30();
    } else {
        endQuiz30();
    }
}

function proceedToNextQuestion30() {
    const container = document.getElementById('quiz30-container');
    if(container && container.firstElementChild) {
        container.firstElementChild.style.display = 'block';
    }
    if (currentQuestionIndex30 < questions30.length) {
        showQuestion30();
    } else {
        endQuiz30();
    }
}

function endQuiz30() {
    if (timerInterval30) clearInterval(timerInterval30);
    
    const quizContainer = document.getElementById('quiz30-container');
    const resultDiv = document.getElementById('quiz30-result');
    const scoreEl = document.getElementById('quiz30-final-score');
    const textEl = document.getElementById('quiz30-result-text');
    const profileEl = document.getElementById('quiz30-profile-badge');
    const emojiEl = document.getElementById('quiz30-emoji');
    const progressContainer = document.getElementById('quiz30-progress-container');
    
    if (quizContainer) quizContainer.style.display = 'none';
    if (progressContainer) progressContainer.style.display = 'none';
    
    // Profiling
    let pilotProfile = "Pedestrian";
    let emoji = "📚";
    let message = "";
    
    if (score30 === 30) {
        pilotProfile = "Code Master";
        emoji = "🏆";
        message = "Perfect! You fully master the road code!";
    } else if (score30 >= 25) {
        pilotProfile = "Ready Candidate";
        emoji = "🎯";
        message = "Excellent! You are truly ready for the exam!";
    } else if (score30 >= 20) {
        pilotProfile = "Apprentice";
        emoji = "📈";
        message = "Good start! Continue reviewing to perfect your knowledge!";
    } else {
        pilotProfile = "Pedestrian";
        emoji = "📚";
        message = "You need to review the basics. Take time to study!";
    }
    
    try {
        if (typeof window.save2RoueQuizResult === 'function') {
            window.save2RoueQuizResult(score30, 30, '30 Questions Code', pilotProfile);
        }
    } catch(e) { console.error(e); }
    
    if (scoreEl) scoreEl.textContent = score30 + '/30';
    if (textEl) textEl.textContent = message;
    if (profileEl) profileEl.textContent = '🎖️ ' + pilotProfile;
    if (emojiEl) emojiEl.textContent = emoji;
    
    // Update share link
    const shareBtn = document.getElementById('share-whatsapp-30');
    if (shareBtn) {
        const shareText = encodeURIComponent('I scored ' + score30 + '/30 on the road code quiz on 2roue.com! 🏍️');
        shareBtn.href = 'https://wa.me/?text=' + shareText;
    }
    
    if (resultDiv) {
        resultDiv.style.display = 'block';
        resultDiv.scrollIntoView({ behavior: 'smooth', block: 'center' });
    }
}

function restartQuiz30() {
    document.getElementById('quiz30-result').style.display = 'none';
    document.getElementById('start-quiz30').style.display = 'inline-block';
    
    // Reset internal state
    currentQuestionIndex30 = 0;
    score30 = 0;
    
    window.scrollTo({ top: 0, behavior: 'smooth' });
}

// Expose functions to window
window.startTimer30 = startTimer30;
window.startQuiz30 = startQuiz30;
window.restartQuiz30 = restartQuiz30;
window.resumeQuiz30 = resumeQuiz30;

window.initCode2024Quiz = function() {
    if (window.initCode2024QuizDone) return;
    window.initCode2024QuizDone = true;
    
    const startBtn = document.getElementById('start-quiz30');
    const trueBtn = document.getElementById('answer-true-30');
    const falseBtn = document.getElementById('answer-false-30');
    const resetBtn = document.getElementById('reset-quiz30');
    
    if (startBtn) startBtn.onclick = startQuiz30;
    if (trueBtn) trueBtn.onclick = function() { answerQuiz30(true); };
    if (falseBtn) falseBtn.onclick = function() { answerQuiz30(false); };
    if (resetBtn) resetBtn.onclick = restartQuiz30;
    
    document.querySelectorAll('.continue-btn-30').forEach(btn => {
        btn.onclick = resumeQuiz30;
    });
};

if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', window.initCode2024Quiz);
} else {
    window.initCode2024Quiz();
}
setTimeout(function() {
   if(!window.initCode2024QuizDone && window.initCode2024Quiz) window.initCode2024Quiz();
}, 500);
`} />

