Mahila Supervisor Exam Quiz


.quiz-container {
max-width: 600px;
margin: auto;
background: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.question {
margin-bottom: 20px;
}
.options label {
display: block;
margin: 8px 0;
}
.btn {
display: inline-block;
padding: 10px 15px;
font-size: 16px;
color: #fff;
background-color: #007BFF;
border: none;
border-radius: 5px;
cursor: pointer;
}
.btn:hover {
background-color: #0056b3;
}
.result {
margin-top: 20px;
padding: 15px;
background: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
border-radius: 5px;
display: none;
}
.correct {
color: green;
}
.wrong {
color: red;
}

MP Mahila Supervisor Exam Quiz

1. What is the capital of Madhya Pradesh?




2. Who is known as the “Nightingale of India”?




const answers = {
q1: “Bhopal”,
q2: “Sarojini Naidu”
};

function submitQuiz() {
const form = document.getElementById(‘quizForm’);
let score = 0;
let totalQuestions = Object.keys(answers).length;
let resultHTML = “

Quiz Results:

“;

for (let key in answers) {
const selectedOption = form[key].value;
if (selectedOption) {
if (selectedOption === answers[key]) {
score++;
resultHTML += `

Question ${key[1]}: Correct

`;
} else {
resultHTML += `

Question ${key[1]}: Wrong (Correct answer: ${answers[key]})

`;
}
} else {
resultHTML += `

Question ${key[1]}: Not Answered

`;
}
}

resultHTML += `

Total Score: ${score} / ${totalQuestions}

`;
const resultDiv = document.getElementById(‘result’);
resultDiv.innerHTML = resultHTML;
resultDiv.style.display = ‘block’;
}


Leave a Comment

Your email address will not be published. Required fields are marked *