class 9 science chapter 5

ch5part4

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Science Quiz – Concentration and Solubility</title>

<style>
body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px;
    min-height: 100vh;
}

.quiz-container {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 800px;
}

h2 {
    text-align: center;
    color: #1e3c72;
}

.question {
    font-weight: bold;
    margin: 10px 0;
    line-height: 1.6;
}

.options label {
    display: block;
    margin: 8px 0;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    cursor: pointer;
    transition: 0.3s;
}

.options label:hover {
    background: #f0f0f0;
}

.correct {
    background-color: #c8f7c5 !important;
    border-color: #28a745 !important;
}

.wrong {
    background-color: #f8d7da !important;
    border-color: #dc3545 !important;
}

.explanation {
    background: #e9ecef;
    padding: 10px;
    margin-top: 10px;
    border-left: 5px solid #2a5298;
    display: none;
    line-height: 1.6;
}

.controls {
    text-align: center;
    margin-top: 15px;
}

button {
    background-color: #2a5298;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    margin: 5px;
}

button:hover {
    background-color: #1e3c72;
}

#scoreboard {
    margin-top: 25px;
    background: #eef3f7;
    padding: 15px;
    border-radius: 8px;
}

#scoreboard h3 {
    text-align: center;
}

ol {
    padding-left: 20px;
}

#userName {
    padding: 10px;
    width: 90%;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 10px;
}
</style>
</head>

<body>

<div class="quiz-container">

<h2>🧠 Science Quiz – Concentration and Solubility</h2>

<div id="nameSection">
    <p><strong>Enter your name to start:</strong></p>
    <input type="text" id="userName" placeholder="Your Name">
    <button onclick="startQuiz()">Start Quiz</button>
</div>

<div id="quizSection" style="display:none;">

    <div id="questionContainer"></div>

    <div class="controls">
        <button onclick="prevQuestion()" id="prevBtn">Previous</button>
        <button onclick="nextQuestion()" id="nextBtn">Next</button>
        <button onclick="submitQuiz()" id="submitBtn" style="display:none;">Submit</button>
    </div>

    <div id="result" style="text-align:center; margin-top:20px;"></div>

    <div id="scoreboard">
        <h3>🏆 Scoreboard</h3>
        <ol id="scoreList"></ol>
    </div>

</div>
</div>

<script>

const questions = [

{
question: "1. 1 mL liquid pesticide ko sufficient water ke saath mix karke 100 mL pesticide spray banaya gaya. Is spray ki volume by volume percentage kya hogi?",
options: [
"A. 0.1%",
"B. 1%",
"C. 10%",
"D. 100%"
],
correct: 1,
explanation: "Formula: % v/v = (Volume of solute / Volume of solution) × 100.<br><br>= (1/100) × 100 = <b>1%</b>.<br><br>Isliye correct answer B hai."
},

{
question: "2. Industries mein % w/w ko commonly use kiya jaata hai. % w/w aur % m/m ke numerical values ke baare mein kya correct hai?",
options: [
"A. Dono hamesha different hote hain",
"B. % w/w ka value hamesha double hota hai",
"C. Dono numerically equal hote hain",
"D. % w/w sirf liquids ke liye hota hai"
],
correct: 2,
explanation: "Industry mein weight aur mass ko generally interchangeably use kiya jaata hai. Isliye <b>% w/w aur % m/m numerically equal</b> hote hain."
},

{
question: "3. Talcum powder mein 4% m/m zinc oxide hai. 300 g talcum powder mein zinc oxide ki mass kitni hogi?",
options: [
"A. 4 g",
"B. 8 g",
"C. 12 g",
"D. 16 g"
],
correct: 2,
explanation: "Zinc oxide = 4% of 300 g.<br><br>= (4/100) × 300<br><br>= <b>12 g</b>.<br><br>Isliye correct answer C hai."
},

{
question: "4. Orange juice concentrate ki ek tablespoon 15 mL ki hai. Agar 2 tablespoons concentrate ko water ke saath mix karke total 150 mL juice banaya gaya, to % v/v concentrate kitna hoga?",
options: [
"A. 10%",
"B. 15%",
"C. 20%",
"D. 30%"
],
correct: 2,
explanation: "Concentrate ka volume = 2 × 15 = 30 mL.<br><br>Formula: % v/v = (Volume of solute / Volume of solution) × 100.<br><br>= (30/150) × 100 = <b>20%</b>."
},

{
question: "5. Vinegar mein 5% v/v acetic acid hai. 100 mL vinegar banane ke liye kitna glacial acetic acid required hoga, agar glacial acetic acid 100% acetic acid hai?",
options: [
"A. 2 mL",
"B. 5 mL",
"C. 10 mL",
"D. 20 mL"
],
correct: 1,
explanation: "5% v/v ka matlab hai 100 mL solution mein 5 mL acetic acid present hai.<br><br>Isliye 5 mL glacial acetic acid lekar water add karke total volume 100 mL kiya jaayega.<br><br>Correct answer = <b>5 mL</b>."
},

{
question: "6. Kisi fixed quantity of solvent mein given temperature par maximum amount of solute jo dissolve ho sakta hai, use kya kehte hain?",
options: [
"A. Concentration",
"B. Density",
"C. Solubility",
"D. Saturation point"
],
correct: 2,
explanation: "Given temperature par fixed quantity of solvent mein dissolve hone wale <b>maximum amount of solute</b> ko solubility kehte hain."
},

{
question: "7. Ek solution mein given temperature par aur solute dissolve nahi ho sakta. Aise solution ko kya kehte hain?",
options: [
"A. Dilute solution",
"B. Unsaturated solution",
"C. Saturated solution",
"D. Heterogeneous solution"
],
correct: 2,
explanation: "Jab given temperature par solution aur solute dissolve nahi kar sakta, to use <b>Saturated Solution</b> kehte hain."
},

{
question: "8. Solid solute ki liquid solvent mein solubility generally temperature badhne par kya hoti hai?",
options: [
"A. Increase hoti hai",
"B. Decrease hoti hai",
"C. Hamesha zero ho jaati hai",
"D. Change nahi hoti"
],
correct: 0,
explanation: "Generally, temperature increase karne par <b>solid solutes ki liquids mein solubility increase</b> hoti hai. However, kuch exceptions bhi hote hain."
},

{
question: "9. Gases ki liquids mein solubility generally temperature badhne par kya hoti hai?",
options: [
"A. Increase hoti hai",
"B. Decrease hoti hai",
"C. Hamesha same rehti hai",
"D. Double ho jaati hai"
],
correct: 1,
explanation: "Gases ke case mein generally temperature increase hone par liquid mein gas ki solubility <b>decrease</b> hoti hai."
},

{
question: "10. Solubility ko mixture separation mein important property kyun maana jaata hai?",
options: [
"A. Kyunki sabhi substances ki solubility same hoti hai",
"B. Kyunki different substances ki solubility ka difference separation mein help kar sakta hai",
"C. Kyunki solubility sirf gases ke liye hoti hai",
"D. Kyunki temperature ka solubility par koi effect nahi hota"
],
correct: 1,
explanation: "Different substances ki solubility different ho sakti hai. Isi difference ka use <b>mixtures se substances ko separate</b> karne mein kiya ja sakta hai."
}

];

let currentQuestion = 0;
let score = 0;
let userAnswers = [];
let userName = "";

function startQuiz() {

    userName = document.getElementById("userName").value.trim();

    if (!userName) {
        alert("Please enter your name.");
        return;
    }

    document.getElementById("nameSection").style.display = "none";
    document.getElementById("quizSection").style.display = "block";

    showQuestion();
    loadScoreboard();
}

function showQuestion() {

    const q = questions[currentQuestion];
    const container = document.getElementById("questionContainer");

    container.innerHTML = `
        <div class="question">${q.question}</div>

        <div class="options">
            ${q.options.map((opt, i) => `
                <label>
                    <input type="radio" name="option" value="${i}"
                    ${userAnswers[currentQuestion] == i ? 'checked' : ''}>
                    ${opt}
                </label>
            `).join('')}
        </div>

        <div class="explanation" id="explain${currentQuestion}">
            ${q.explanation}
        </div>
    `;

    document.getElementById("prevBtn").style.display =
        currentQuestion === 0 ? "none" : "inline-block";

    document.getElementById("nextBtn").style.display =
        currentQuestion === questions.length - 1 ? "none" : "inline-block";

    document.getElementById("submitBtn").style.display =
        currentQuestion === questions.length - 1 ? "inline-block" : "none";
}

function nextQuestion() {

    saveAnswer();

    if (currentQuestion < questions.length - 1) {
        currentQuestion++;
        showQuestion();
    }
}

function prevQuestion() {

    saveAnswer();

    if (currentQuestion > 0) {
        currentQuestion--;
        showQuestion();
    }
}

function saveAnswer() {

    const selected = document.querySelector('input[name="option"]:checked');

    userAnswers[currentQuestion] = selected
        ? parseInt(selected.value)
        : null;
}

function submitQuiz() {

    saveAnswer();

    score = 0;

    questions.forEach((q, index) => {
        if (userAnswers[index] === q.correct) {
            score++;
        }
    });

    showResults();
    saveScore(userName, score);
    loadScoreboard();
}

function showResults() {

    const container = document.getElementById("questionContainer");

    container.innerHTML = "";

    questions.forEach((q, index) => {

        const selected = userAnswers[index];
        const correct = q.correct;

        let optsHTML = q.options.map((opt, i) => {

            let cls = "";

            if (i === correct) {
                cls = "correct";
            }

            if (selected === i && selected !== correct) {
                cls = "wrong";
            }

            return `<label class="${cls}">${opt}</label>`;

        }).join('');

        container.innerHTML += `
            <div class="question">${q.question}</div>

            <div class="options">
                ${optsHTML}
            </div>

            <div class="explanation" style="display:block;">
                <b>Explanation:</b><br>
                ${q.explanation}
            </div>

            <hr>
        `;
    });

    document.querySelector(".controls").style.display = "none";

    document.getElementById("result").innerHTML =
        `<h3>Your Score: ${score} / ${questions.length}</h3>`;
}

function saveScore(name, score) {

    let scores = JSON.parse(localStorage.getItem("quizScores")) || [];

    scores.push({
        name,
        score,
        date: new Date().toLocaleString()
    });

    localStorage.setItem("quizScores", JSON.stringify(scores));
}

function loadScoreboard() {

    let scores = JSON.parse(localStorage.getItem("quizScores")) || [];

    scores.sort((a, b) => b.score - a.score);

    document.getElementById("scoreList").innerHTML =
        scores.map(s => `
            <li>
                ${escapeHTML(s.name)} - ${s.score}/10 (${escapeHTML(s.date)})
            </li>
        `).join('');
}

function escapeHTML(value) {
    return String(value).replace(/[&<>"']/g, char => ({
        '&': '&amp;',
        '<': '&lt;',
        '>': '&gt;',
        '"': '&quot;',
        "'": '&#39;'
    })[char]);
}

</script>

</body>
</html>

Leave a Comment