No title

// ... (keep timer logic same) ... document.addEventListener('DOMContentLoaded', function() { const options = document.querySelectorAll('.option'); const submitBtn = document.getElementById('submitBtn'); const resultContainer = document.getElementById('resultContainer'); // Total 45 Questions Correct Answer Map const correctAnswers = { 1: 'A', 2: 'C', 3: 'A', 4: 'BD', 5: 'A', 6: 'B', 7: 'D', 8: 'A', 9: 'C', 10: 'B', 11: 'A', 12: 'D', 13: 'D', 14: 'ABC', 15: 'B', 16: 'C', 17: 'B', 18: 'C', 19: 'A', 20: 'A', 21: 'A', 22: 'A', 23: 'B', 24: 'ABC', 25: 'B', 26: 'B', 27: 'A', 28: 'B', 29: 'D', 30: 'C', 31: 'A', 32: 'A', 33: 'C', 34: 'AB', 35: 'B', 36: 'C', 37: 'D', 38: 'A', 39: 'B', 40: 'C', 41: 'A', 42: 'A', 43: 'B', 44: 'ACD', 45: 'A' }; let userAnswers = new Array(46).fill(""); // 1-indexed for easier mapping options.forEach(option => { option.addEventListener('click', function() { if (window.isSubmitted) return; const card = this.closest('.question-card'); const qNum = parseInt(card.querySelector('.question-number').textContent); const val = this.getAttribute('data-value'); if (card.classList.contains('multiple-correct')) { this.classList.toggle('selected'); let selected = Array.from(card.querySelectorAll('.option.selected')) .map(el => el.getAttribute('data-value')) .sort().join(''); userAnswers[qNum] = selected; } else { card.querySelectorAll('.option').forEach(opt => opt.classList.remove('selected')); this.classList.add('selected'); userAnswers[qNum] = val; } }); }); submitBtn.addEventListener('click', function() { window.isSubmitted = true; clearInterval(timerInterval); let score = 0; for (let i = 1; i <= 45; i++) { if (userAnswers[i] === correctAnswers[i]) score++; } document.getElementById('scoreNumber').textContent = score; document.getElementById('resultContainer').classList.add('show'); // Logic to generate the Assamese Review UI below generateAssameseReview(userAnswers, correctAnswers); }); });

*

Post a Comment (0)
Previous Post Next Post