Willer Select | NEET Chemistry Test

NEET Chemistry Test Series

Chapter 1: Basic Concepts of Chemistry
Set 1 of 5
Time: 90 Minutes
100 Questions

Basic Concepts of Chemistry - Test Set 1

Multiple Choice Question (Single Correct)
Question 1 of 100

Explanation & Solution

Test Performance Summary

0
Correct Answers
0
Incorrect Answers
0
Attempted
00:00
Time Taken
]; // Initialize variables let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let marked = new Array(questions.length).fill(false); let startTime = Date.now(); let timerInterval; // Initialize the test function initTest() { // Create question dots const grid = document.getElementById('question-grid'); questions.forEach((q, index) => { const dot = document.createElement('div'); dot.className = 'question-dot'; dot.textContent = index + 1; dot.addEventListener('click', () => showQuestion(index)); grid.appendChild(dot); }); // Start timer startTimer(); // Show first question showQuestion(0); } // Show a specific question function showQuestion(index) { currentQuestion = index; // Update UI document.getElementById('current-q').textContent = index + 1; document.getElementById('question-text').innerHTML = `

${questions[index].text}

`; // Update options const optionsContainer = document.getElementById('options-container'); optionsContainer.innerHTML = ''; questions[index].options.forEach((option, optIndex) => { const optionEl = document.createElement('div'); optionEl.className = 'option'; if (answers[index] === optIndex) { optionEl.classList.add('selected'); } optionEl.innerHTML = ` ${String.fromCharCode(65 + optIndex)}
${option}
`; optionEl.addEventListener('click', () => selectOption(optIndex)); optionsContainer.appendChild(optionEl); }); // Update explanation document.getElementById('explanation-content').textContent = questions[index].explanation; document.getElementById('explanation').classList.toggle('show', answers[index] !== null); // Update question dots updateQuestionDots(); // Update counts updateCounts(); // Update progress bar updateProgressBar(); } // Select an option function selectOption(optionIndex) { answers[currentQuestion] = optionIndex; // Update UI const options = document.querySelectorAll('#options-container .option'); options.forEach((opt, idx) => { opt.classList.toggle('selected', idx === optionIndex); }); // Show explanation document.getElementById('explanation').classList.add('show'); // Update question dots updateQuestionDots(); // Update counts updateCounts(); // Update progress bar updateProgressBar(); } // Mark current question for review function markForReview() { marked[currentQuestion] = !marked[currentQuestion]; updateQuestionDots(); updateCounts(); // Update button text document.getElementById('mark-btn').innerHTML = marked[currentQuestion] ? ' Marked' : ' Mark for Review'; } // Update question dots function updateQuestionDots() { const dots = document.querySelectorAll('.question-dot'); dots.forEach((dot, index) => { dot.classList.remove('current', 'answered', 'marked'); if (index === currentQuestion) { dot.classList.add('current'); } if (answers[index] !== null) { dot.classList.add('answered'); } if (marked[index]) { dot.classList.add('marked'); } }); } // Update counts in summary function updateCounts() { const answeredCount = answers.filter(a => a !== null).length; const markedCount = marked.filter(m => m).length; const correctCount = answers.reduce((count, ans, idx) => { return ans === questions[idx].correct ? count + 1 : count; }, 0); document.getElementById('answered-count').textContent = answeredCount; document.getElementById('marked-count').textContent = markedCount; document.getElementById('score-display').textContent = (correctCount * 4) - ((answeredCount - correctCount) * 1); } // Update progress bar function updateProgressBar() { const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; } // Start timer function startTimer() { const totalMinutes = 90; let seconds = totalMinutes * 60; timerInterval = setInterval(() => { seconds--; const minutes = Math.floor(seconds / 60); const secs = seconds % 60; document.getElementById('timer-display').textContent = `${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`; if (seconds <= 0) { clearInterval(timerInterval); submitTest(); } }, 1000); } // Submit test function submitTest() { clearInterval(timerInterval); // Calculate results const answeredCount = answers.filter(a => a !== null).length; const correctCount = answers.reduce((count, ans, idx) => { return ans === questions[idx].correct ? count + 1 : count; }, 0); const incorrectCount = answeredCount - correctCount; const score = (correctCount * 4) - (incorrectCount * 1); // Calculate time taken const endTime = Date.now(); const timeTaken = Math.floor((endTime - startTime) / 1000); const minutes = Math.floor(timeTaken / 60); const seconds = timeTaken % 60; // Show results document.getElementById('correct-count').textContent = correctCount; document.getElementById('incorrect-count').textContent = incorrectCount; document.getElementById('attempted-count').textContent = answeredCount; document.getElementById('time-taken').textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`; document.getElementById('performance-preview').style.display = 'block'; // Disable submit button document.getElementById('submit-btn').innerHTML = ' Test Submitted'; document.getElementById('submit-btn').style.backgroundColor = '#64748b'; document.getElementById('submit-btn').style.pointerEvents = 'none'; } // Navigation document.getElementById('prev-btn').addEventListener('click', () => { if (currentQuestion > 0) { showQuestion(currentQuestion - 1); } }); document.getElementById('next-btn').addEventListener('click', () => { if (currentQuestion < questions.length - 1) { showQuestion(currentQuestion + 1); } }); document.getElementById('mark-btn').addEventListener('click', markForReview); document.getElementById('submit-btn').addEventListener('click', submitTest); // Initialize the test window.onload = initTest;

Comments

subscribe

Popular posts from this blog