{"id":5325,"date":"2026-10-31T14:02:03","date_gmt":"2026-10-31T14:02:03","guid":{"rendered":"https:\/\/apicalclasses.com\/?p=5325"},"modified":"2026-10-31T14:06:03","modified_gmt":"2026-10-31T14:06:03","slug":"class-8thsubject-science-ch1","status":"publish","type":"post","link":"https:\/\/apicalclasses.com\/?p=5325","title":{"rendered":"Class 8th,subject science, ch1"},"content":{"rendered":"\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\n<title>\ud83e\udde0 Science Quiz \u2013 Exploring the Investigative World of Science<\/title>\n\n<style>\nbody {\n    font-family: Arial, sans-serif;\n    background: linear-gradient(135deg, #a1c4fd, #c2e9fb);\n    display: flex;\n    justify-content: center;\n    align-items: flex-start;\n    padding: 30px;\n    min-height: 100vh;\n    margin: 0;\n}\n\n.quiz-container {\n    background: #fff;\n    padding: 25px;\n    border-radius: 12px;\n    box-shadow: 0 4px 10px rgba(0,0,0,0.2);\n    width: 90%;\n    max-width: 800px;\n}\n\nh2 {\n    text-align: center;\n    color: #1e3c72;\n}\n\n.question {\n    font-weight: bold;\n    margin: 15px 0;\n    line-height: 1.6;\n}\n\n.options label {\n    display: block;\n    margin: 8px 0;\n    padding: 12px;\n    border-radius: 6px;\n    border: 1px solid #ccc;\n    cursor: pointer;\n    transition: 0.3s;\n}\n\n.options label:hover {\n    background: #f0f0f0;\n}\n\n.options input {\n    margin-right: 8px;\n}\n\n.correct {\n    background-color: #c8f7c5 !important;\n    border-color: #28a745 !important;\n}\n\n.wrong {\n    background-color: #f8d7da !important;\n    border-color: #dc3545 !important;\n}\n\n.explanation {\n    background: #e9ecef;\n    padding: 12px;\n    margin-top: 10px;\n    margin-bottom: 20px;\n    border-left: 5px solid #2a5298;\n    border-radius: 4px;\n    display: none;\n    line-height: 1.6;\n}\n\n.controls {\n    text-align: center;\n    margin-top: 20px;\n}\n\nbutton {\n    background-color: #2a5298;\n    color: white;\n    border: none;\n    padding: 10px 20px;\n    border-radius: 6px;\n    cursor: pointer;\n    margin: 5px;\n    font-size: 15px;\n}\n\nbutton:hover {\n    background-color: #1e3c72;\n}\n\n#scoreboard {\n    margin-top: 25px;\n    background: #eef3f7;\n    padding: 15px;\n    border-radius: 8px;\n}\n\n#scoreboard h3 {\n    text-align: center;\n}\n\nol {\n    padding-left: 20px;\n}\n\n#result {\n    text-align: center;\n    margin-top: 20px;\n    color: #1e3c72;\n    font-size: 18px;\n}\n\n#userName {\n    padding: 10px;\n    width: 90%;\n    max-width: 300px;\n    border: 1px solid #ccc;\n    border-radius: 6px;\n    margin-bottom: 10px;\n}\n\n@media (max-width: 600px) {\n    body {\n        padding: 10px;\n    }\n\n    .quiz-container {\n        width: 100%;\n        padding: 15px;\n    }\n}\n<\/style>\n\n\n\n\n<div class=\"quiz-container\">\n\n    <h2>\ud83e\udde0 Exploring the Investigative World of Science<\/h2>\n\n    <div id=\"nameSection\">\n        <p><strong>Enter your name to start:<\/strong><\/p>\n        <input type=\"text\" id=\"userName\" placeholder=\"Your Name\">\n        <br>\n        <button onclick=\"startQuiz()\">Start Quiz<\/button>\n    <\/div>\n\n    <div id=\"quizSection\" style=\"display:none;\">\n\n        <div id=\"questionContainer\"><\/div>\n\n        <div class=\"controls\">\n            <button onclick=\"prevQuestion()\" id=\"prevBtn\">Previous<\/button>\n            <button onclick=\"nextQuestion()\" id=\"nextBtn\">Next<\/button>\n            <button onclick=\"submitQuiz()\" id=\"submitBtn\" style=\"display:none;\">\n                Submit\n            <\/button>\n        <\/div>\n\n        <div id=\"result\"><\/div>\n\n        <div id=\"scoreboard\">\n            <h3>\ud83c\udfc6 Scoreboard<\/h3>\n            <ol id=\"scoreList\"><\/ol>\n        <\/div>\n\n    <\/div>\n<\/div>\n\n<script>\n\nconst questions = [\n\n{\n    question: \"1. Science mein hypothesis ka kya meaning hota hai?\",\n    options: [\n        \"A. Ek testable possible explanation\",\n        \"B. Ek final answer jo kabhi change nahi hota\",\n        \"C. Ek scientific instrument\",\n        \"D. Ek observation ko ignore karna\"\n    ],\n    correct: 0,\n    explanation: \"Hypothesis ek possible explanation hoti hai jise observation ya experiment ke through test kiya ja sakta hai.\"\n},\n\n{\n    question: \"2. Ek student jaan-na chahta hai ki sunlight plant growth ko affect karti hai ya nahi. Fair test ke liye kya karna chahiye?\",\n    options: [\n        \"A. Har plant ko alag soil aur alag water dena\",\n        \"B. Plants ko bina record ke rakhna\",\n        \"C. Plants ko same conditions mein rakhkar sirf light exposure change karna\",\n        \"D. Sirf ek plant dekhkar conclusion nikalna\"\n    ],\n    correct: 2,\n    explanation: \"Fair test mein ek main factor change kiya jata hai aur baaki conditions same rakhi jaati hain, taaki us factor ka effect samajh sakein.\"\n},\n\n{\n    question: \"3. Experiment ke dauran observations ko record karna kyun zaroori hai?\",\n    options: [\n        \"A. Result ko pehle se decide karne ke liye\",\n        \"B. Evidence ko accurately compare aur analyse karne ke liye\",\n        \"C. Experiment ko difficult banane ke liye\",\n        \"D. Hypothesis ko bina test kiye accept karne ke liye\"\n    ],\n    correct: 1,\n    explanation: \"Recorded observations evidence provide karti hain, jinki help se results compare karke scientific conclusions nikale ja sakte hain.\"\n},\n\n{\n    question: \"4. Agar experiment ka result hypothesis se match nahi karta, toh scientist ko kya karna chahiye?\",\n    options: [\n        \"A. Data ko badal dena\",\n        \"B. Result ko chhupa dena\",\n        \"C. Experiment ko hamesha ke liye chhod dena\",\n        \"D. Hypothesis aur method ko dobara examine karna\"\n    ],\n    correct: 3,\n    explanation: \"Science mein ideas evidence ke according change ho sakte hain. Unexpected results ko honestly investigate karke understanding improve karni chahiye.\"\n},\n\n{\n    question: \"5. Bread dough rise hone mein aam taur par kaunsa organism important role play karta hai?\",\n    options: [\n        \"A. Yeast\",\n        \"B. Earthworm\",\n        \"C. Mosquito\",\n        \"D. Fern\"\n    ],\n    correct: 0,\n    explanation: \"Yeast fermentation ke dauran carbon dioxide gas produce karta hai. Gas dough mein bubbles banati hai, jisse dough phoolta hai.\"\n},\n\n{\n    question: \"6. Earth ke warming trend ko investigate karne ke liye sabse useful evidence kya hoga?\",\n    options: [\n        \"A. Ek din ka temperature\",\n        \"B. Ek person ka guess\",\n        \"C. Kai saalon ke reliable temperature records\",\n        \"D. Sirf ek afternoon ki cloud cover\"\n    ],\n    correct: 2,\n    explanation: \"Long-term temperature records se scientists temperature ke patterns aur changes ko samajh sakte hain.\"\n},\n\n{\n    question: \"7. Science ki book mein root ka symbol kya represent karta hai?\",\n    options: [\n        \"A. Sirf fast movement\",\n        \"B. Knowledge ki strong foundation aur environment se connection\",\n        \"C. Scientific evidence ki absence\",\n        \"D. Sirf space exploration\"\n    ],\n    correct: 1,\n    explanation: \"Root knowledge ki strong foundation aur environment, traditions, cultural aur natural heritage se connection ko symbolise karta hai.\"\n},\n\n{\n    question: \"8. Kite ka symbol kis idea ko represent karta hai?\",\n    options: [\n        \"A. Questions poochna band karna\",\n        \"B. Sirf old facts yaad karna\",\n        \"C. Observations ko ignore karna\",\n        \"D. Curiosity aur ideas ke through unknown ko explore karna\"\n    ],\n    correct: 3,\n    explanation: \"Kite curiosity aur creative thinking ko represent karti hai, jo humein unknown possibilities explore karne ke liye inspire karti hai.\"\n},\n\n{\n    question: \"9. Ek student claim karta hai ki ek plant doosre se zyada grow hua kyunki use zyada sunlight mili. Is claim ko test karne ke liye kya karna chahiye?\",\n    options: [\n        \"A. Growth measure karke light exposure aur baaki conditions record karna\",\n        \"B. Sirf plant ka colour dekhna\",\n        \"C. Bina measurements ke conclusion likhna\",\n        \"D. Plants ko bina record kiye alag jagah rakhna\"\n    ],\n    correct: 0,\n    explanation: \"Growth measure karna aur conditions record karna evidence provide karta hai, jisse pata lagaya ja sakta hai ki sunlight ka effect tha ya nahi.\"\n},\n\n{\n    question: \"10. Scientific investigation mein observation aur creative thinking ka sahi relationship kya hai?\",\n    options: [\n        \"A. Creative thinking evidence ko replace karti hai\",\n        \"B. Observation ki koi zaroorat nahi hoti\",\n        \"C. Observation evidence deti hai aur creative thinking naye explanations suggest kar sakti hai\",\n        \"D. Har creative idea automatically correct hota hai\"\n    ],\n    correct: 2,\n    explanation: \"Observation evidence provide karti hai, jabki creative thinking naye questions aur possible explanations develop karne mein help karti hai. Dono scientific investigation ke important parts hain.\"\n}\n\n];\n\nlet currentQuestion = 0;\nlet score = 0;\nlet userAnswers = [];\nlet userName = \"\";\n\nfunction startQuiz() {\n\n    userName = document.getElementById(\"userName\").value.trim();\n\n    if (!userName) {\n        alert(\"Please enter your name.\");\n        return;\n    }\n\n    document.getElementById(\"nameSection\").style.display = \"none\";\n    document.getElementById(\"quizSection\").style.display = \"block\";\n\n    showQuestion();\n    loadScoreboard();\n}\n\nfunction showQuestion() {\n\n    const q = questions[currentQuestion];\n    const container = document.getElementById(\"questionContainer\");\n\n    container.innerHTML = `\n        <div class=\"question\">${q.question}<\/div>\n\n        <div class=\"options\">\n            ${q.options.map((opt, i) => `\n                <label>\n                    <input\n                        type=\"radio\"\n                        name=\"option\"\n                        value=\"${i}\"\n                        ${userAnswers[currentQuestion] === i ? \"checked\" : \"\"}\n                    >\n                    ${opt}\n                <\/label>\n            `).join(\"\")}\n        <\/div>\n    `;\n\n    document.getElementById(\"prevBtn\").style.display =\n        currentQuestion === 0 ? \"none\" : \"inline-block\";\n\n    document.getElementById(\"nextBtn\").style.display =\n        currentQuestion === questions.length - 1 ? \"none\" : \"inline-block\";\n\n    document.getElementById(\"submitBtn\").style.display =\n        currentQuestion === questions.length - 1 ? \"inline-block\" : \"none\";\n}\n\nfunction saveAnswer() {\n\n    const selected = document.querySelector(\n        'input[name=\"option\"]:checked'\n    );\n\n    userAnswers[currentQuestion] =\n        selected ? parseInt(selected.value) : null;\n}\n\nfunction nextQuestion() {\n\n    saveAnswer();\n\n    if (currentQuestion < questions.length - 1) {\n        currentQuestion++;\n        showQuestion();\n    }\n}\n\nfunction prevQuestion() {\n\n    saveAnswer();\n\n    if (currentQuestion > 0) {\n        currentQuestion--;\n        showQuestion();\n    }\n}\n\nfunction submitQuiz() {\n\n    saveAnswer();\n\n    score = 0;\n\n    questions.forEach((q, index) => {\n        if (userAnswers[index] === q.correct) {\n            score++;\n        }\n    });\n\n    showResults();\n\n    saveScore(userName, score);\n\n    loadScoreboard();\n}\n\nfunction showResults() {\n\n    const container = document.getElementById(\"questionContainer\");\n\n    container.innerHTML = \"\";\n\n    questions.forEach((q, index) => {\n\n        const selected = userAnswers[index];\n        const correct = q.correct;\n\n        let optsHTML = q.options.map((opt, i) => {\n\n            let cls = \"\";\n\n            if (i === correct) {\n                cls = \"correct\";\n            }\n\n            if (selected === i && selected !== correct) {\n                cls = \"wrong\";\n            }\n\n            return `<label class=\"${cls}\">${opt}<\/label>`;\n\n        }).join(\"\");\n\n        container.innerHTML += `\n            <div class=\"question\">${q.question}<\/div>\n\n            <div class=\"options\">\n                ${optsHTML}\n            <\/div>\n\n            <div class=\"explanation\" style=\"display:block;\">\n                <strong>Explanation:<\/strong> ${q.explanation}\n            <\/div>\n\n            <hr>\n        `;\n    });\n\n    document.querySelector(\".controls\").style.display = \"none\";\n\n    document.getElementById(\"result\").innerHTML = `\n        <h3>Your Score: ${score} \/ ${questions.length}<\/h3>\n        <p>${score >= 8 ? \"Excellent Work! \ud83c\udf89\" :\n             score >= 5 ? \"Good Attempt! \ud83d\udc4d\" :\n             \"Keep Practising! \ud83d\udcda\"}<\/p>\n    `;\n}\n\nfunction saveScore(name, score) {\n\n    let scores = JSON.parse(localStorage.getItem(\"quizScores\")) || [];\n\n    scores.push({\n        name: name,\n        score: score,\n        date: new Date().toLocaleString()\n    });\n\n    localStorage.setItem(\"quizScores\", JSON.stringify(scores));\n}\n\nfunction loadScoreboard() {\n\n    let scores = JSON.parse(localStorage.getItem(\"quizScores\")) || [];\n\n    scores.sort((a, b) => b.score - a.score);\n\n    document.getElementById(\"scoreList\").innerHTML =\n        scores.map(s => `\n            <li>${escapeHTML(s.name)} - ${s.score}\/10 (${escapeHTML(s.date)})<\/li>\n        `).join(\"\");\n}\n\nfunction escapeHTML(value) {\n    return String(value).replace(\/[&<>\"']\/g, char => ({\n        \"&\": \"&amp;\",\n        \"<\": \"&lt;\",\n        \">\": \"&gt;\",\n        '\"': \"&quot;\",\n        \"'\": \"&#39;\"\n    })[char]);\n}\n\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<!--nextpage-->\n\n\n\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\n<title>\ud83e\udde0 Science Quiz \u2013 Exploring the Investigative World of Science<\/title>\n\n<style>\nbody {\n    font-family: Arial, sans-serif;\n    background: linear-gradient(135deg, #a1c4fd, #c2e9fb);\n    display: flex;\n    justify-content: center;\n    align-items: flex-start;\n    padding: 30px;\n    min-height: 100vh;\n    margin: 0;\n}\n\n.quiz-container {\n    background: #fff;\n    padding: 25px;\n    border-radius: 12px;\n    box-shadow: 0 4px 10px rgba(0,0,0,0.2);\n    width: 90%;\n    max-width: 800px;\n}\n\nh2 {\n    text-align: center;\n    color: #1e3c72;\n}\n\n.question {\n    font-weight: bold;\n    margin: 15px 0;\n    line-height: 1.6;\n}\n\n.options label {\n    display: block;\n    margin: 8px 0;\n    padding: 12px;\n    border-radius: 6px;\n    border: 1px solid #ccc;\n    cursor: pointer;\n    transition: 0.3s;\n}\n\n.options label:hover {\n    background: #f0f0f0;\n}\n\n.options input {\n    margin-right: 8px;\n}\n\n.correct {\n    background-color: #c8f7c5 !important;\n    border-color: #28a745 !important;\n}\n\n.wrong {\n    background-color: #f8d7da !important;\n    border-color: #dc3545 !important;\n}\n\n.explanation {\n    background: #e9ecef;\n    padding: 12px;\n    margin-top: 10px;\n    margin-bottom: 20px;\n    border-left: 5px solid #2a5298;\n    border-radius: 4px;\n    display: none;\n    line-height: 1.6;\n}\n\n.controls {\n    text-align: center;\n    margin-top: 20px;\n}\n\nbutton {\n    background-color: #2a5298;\n    color: white;\n    border: none;\n    padding: 10px 20px;\n    border-radius: 6px;\n    cursor: pointer;\n    margin: 5px;\n    font-size: 15px;\n}\n\nbutton:hover {\n    background-color: #1e3c72;\n}\n\n#scoreboard {\n    margin-top: 25px;\n    background: #eef3f7;\n    padding: 15px;\n    border-radius: 8px;\n}\n\n#scoreboard h3 {\n    text-align: center;\n}\n\nol {\n    padding-left: 20px;\n}\n\n#result {\n    text-align: center;\n    margin-top: 20px;\n    color: #1e3c72;\n    font-size: 18px;\n}\n\n#userName {\n    padding: 10px;\n    width: 90%;\n    max-width: 300px;\n    border: 1px solid #ccc;\n    border-radius: 6px;\n    margin-bottom: 10px;\n}\n\n@media (max-width: 600px) {\n    body {\n        padding: 10px;\n    }\n\n    .quiz-container {\n        width: 100%;\n        padding: 15px;\n    }\n}\n<\/style>\n<\/head>\n\n<body>\n\n<div class=\"quiz-container\">\n\n    <h2>\ud83e\udde0 Exploring the Investigative World of Science<\/h2>\n\n    <div id=\"nameSection\">\n        <p><strong>Enter your name to start:<\/strong><\/p>\n        <input type=\"text\" id=\"userName\" placeholder=\"Your Name\">\n        <br>\n        <button onclick=\"startQuiz()\">Start Quiz<\/button>\n    <\/div>\n\n    <div id=\"quizSection\" style=\"display:none;\">\n\n        <div id=\"questionContainer\"><\/div>\n\n        <div class=\"controls\">\n            <button onclick=\"prevQuestion()\" id=\"prevBtn\">Previous<\/button>\n            <button onclick=\"nextQuestion()\" id=\"nextBtn\">Next<\/button>\n            <button onclick=\"submitQuiz()\" id=\"submitBtn\" style=\"display:none;\">\n                Submit\n            <\/button>\n        <\/div>\n\n        <div id=\"result\"><\/div>\n\n        <div id=\"scoreboard\">\n            <h3>\ud83c\udfc6 Scoreboard<\/h3>\n            <ol id=\"scoreList\"><\/ol>\n        <\/div>\n\n    <\/div>\n<\/div>\n\n<script>\n\nconst questions = [\n\n{\n    question: \"1. Science mein hypothesis ka kya meaning hota hai?\",\n    options: [\n        \"A. Ek testable possible explanation\",\n        \"B. Ek final answer jo kabhi change nahi hota\",\n        \"C. Ek scientific instrument\",\n        \"D. Ek observation ko ignore karna\"\n    ],\n    correct: 0,\n    explanation: \"Hypothesis ek possible explanation hoti hai jise observation ya experiment ke through test kiya ja sakta hai.\"\n},\n\n{\n    question: \"2. Ek student jaan-na chahta hai ki sunlight plant growth ko affect karti hai ya nahi. Fair test ke liye kya karna chahiye?\",\n    options: [\n        \"A. Har plant ko alag soil aur alag water dena\",\n        \"B. Plants ko bina record ke rakhna\",\n        \"C. Plants ko same conditions mein rakhkar sirf light exposure change karna\",\n        \"D. Sirf ek plant dekhkar conclusion nikalna\"\n    ],\n    correct: 2,\n    explanation: \"Fair test mein ek main factor change kiya jata hai aur baaki conditions same rakhi jaati hain, taaki us factor ka effect samajh sakein.\"\n},\n\n{\n    question: \"3. Experiment ke dauran observations ko record karna kyun zaroori hai?\",\n    options: [\n        \"A. Result ko pehle se decide karne ke liye\",\n        \"B. Evidence ko accurately compare aur analyse karne ke liye\",\n        \"C. Experiment ko difficult banane ke liye\",\n        \"D. Hypothesis ko bina test kiye accept karne ke liye\"\n    ],\n    correct: 1,\n    explanation: \"Recorded observations evidence provide karti hain, jinki help se results compare karke scientific conclusions nikale ja sakte hain.\"\n},\n\n{\n    question: \"4. Agar experiment ka result hypothesis se match nahi karta, toh scientist ko kya karna chahiye?\",\n    options: [\n        \"A. Data ko badal dena\",\n        \"B. Result ko chhupa dena\",\n        \"C. Experiment ko hamesha ke liye chhod dena\",\n        \"D. Hypothesis aur method ko dobara examine karna\"\n    ],\n    correct: 3,\n    explanation: \"Science mein ideas evidence ke according change ho sakte hain. Unexpected results ko honestly investigate karke understanding improve karni chahiye.\"\n},\n\n{\n    question: \"5. Bread dough rise hone mein aam taur par kaunsa organism important role play karta hai?\",\n    options: [\n        \"A. Yeast\",\n        \"B. Earthworm\",\n        \"C. Mosquito\",\n        \"D. Fern\"\n    ],\n    correct: 0,\n    explanation: \"Yeast fermentation ke dauran carbon dioxide gas produce karta hai. Gas dough mein bubbles banati hai, jisse dough phoolta hai.\"\n},\n\n{\n    question: \"6. Earth ke warming trend ko investigate karne ke liye sabse useful evidence kya hoga?\",\n    options: [\n        \"A. Ek din ka temperature\",\n        \"B. Ek person ka guess\",\n        \"C. Kai saalon ke reliable temperature records\",\n        \"D. Sirf ek afternoon ki cloud cover\"\n    ],\n    correct: 2,\n    explanation: \"Long-term temperature records se scientists temperature ke patterns aur changes ko samajh sakte hain.\"\n},\n\n{\n    question: \"7. Science ki book mein root ka symbol kya represent karta hai?\",\n    options: [\n        \"A. Sirf fast movement\",\n        \"B. Knowledge ki strong foundation aur environment se connection\",\n        \"C. Scientific evidence ki absence\",\n        \"D. Sirf space exploration\"\n    ],\n    correct: 1,\n    explanation: \"Root knowledge ki strong foundation aur environment, traditions, cultural aur natural heritage se connection ko symbolise karta hai.\"\n},\n\n{\n    question: \"8. Kite ka symbol kis idea ko represent karta hai?\",\n    options: [\n        \"A. Questions poochna band karna\",\n        \"B. Sirf old facts yaad karna\",\n        \"C. Observations ko ignore karna\",\n        \"D. Curiosity aur ideas ke through unknown ko explore karna\"\n    ],\n    correct: 3,\n    explanation: \"Kite curiosity aur creative thinking ko represent karti hai, jo humein unknown possibilities explore karne ke liye inspire karti hai.\"\n},\n\n{\n    question: \"9. Ek student claim karta hai ki ek plant doosre se zyada grow hua kyunki use zyada sunlight mili. Is claim ko test karne ke liye kya karna chahiye?\",\n    options: [\n        \"A. Growth measure karke light exposure aur baaki conditions record karna\",\n        \"B. Sirf plant ka colour dekhna\",\n        \"C. Bina measurements ke conclusion likhna\",\n        \"D. Plants ko bina record kiye alag jagah rakhna\"\n    ],\n    correct: 0,\n    explanation: \"Growth measure karna aur conditions record karna evidence provide karta hai, jisse pata lagaya ja sakta hai ki sunlight ka effect tha ya nahi.\"\n},\n\n{\n    question: \"10. Scientific investigation mein observation aur creative thinking ka sahi relationship kya hai?\",\n    options: [\n        \"A. Creative thinking evidence ko replace karti hai\",\n        \"B. Observation ki koi zaroorat nahi hoti\",\n        \"C. Observation evidence deti hai aur creative thinking naye explanations suggest kar sakti hai\",\n        \"D. Har creative idea automatically correct hota hai\"\n    ],\n    correct: 2,\n    explanation: \"Observation evidence provide karti hai, jabki creative thinking naye questions aur possible explanations develop karne mein help karti hai. Dono scientific investigation ke important parts hain.\"\n}\n\n];\n\nlet currentQuestion = 0;\nlet score = 0;\nlet userAnswers = [];\nlet userName = \"\";\n\nfunction startQuiz() {\n\n    userName = document.getElementById(\"userName\").value.trim();\n\n    if (!userName) {\n        alert(\"Please enter your name.\");\n        return;\n    }\n\n    document.getElementById(\"nameSection\").style.display = \"none\";\n    document.getElementById(\"quizSection\").style.display = \"block\";\n\n    showQuestion();\n    loadScoreboard();\n}\n\nfunction showQuestion() {\n\n    const q = questions[currentQuestion];\n    const container = document.getElementById(\"questionContainer\");\n\n    container.innerHTML = `\n        <div class=\"question\">${q.question}<\/div>\n\n        <div class=\"options\">\n            ${q.options.map((opt, i) => `\n                <label>\n                    <input\n                        type=\"radio\"\n                        name=\"option\"\n                        value=\"${i}\"\n                        ${userAnswers[currentQuestion] === i ? \"checked\" : \"\"}\n                    >\n                    ${opt}\n                <\/label>\n            `).join(\"\")}\n        <\/div>\n    `;\n\n    document.getElementById(\"prevBtn\").style.display =\n        currentQuestion === 0 ? \"none\" : \"inline-block\";\n\n    document.getElementById(\"nextBtn\").style.display =\n        currentQuestion === questions.length - 1 ? \"none\" : \"inline-block\";\n\n    document.getElementById(\"submitBtn\").style.display =\n        currentQuestion === questions.length - 1 ? \"inline-block\" : \"none\";\n}\n\nfunction saveAnswer() {\n\n    const selected = document.querySelector(\n        'input[name=\"option\"]:checked'\n    );\n\n    userAnswers[currentQuestion] =\n        selected ? parseInt(selected.value) : null;\n}\n\nfunction nextQuestion() {\n\n    saveAnswer();\n\n    if (currentQuestion < questions.length - 1) {\n        currentQuestion++;\n        showQuestion();\n    }\n}\n\nfunction prevQuestion() {\n\n    saveAnswer();\n\n    if (currentQuestion > 0) {\n        currentQuestion--;\n        showQuestion();\n    }\n}\n\nfunction submitQuiz() {\n\n    saveAnswer();\n\n    score = 0;\n\n    questions.forEach((q, index) => {\n        if (userAnswers[index] === q.correct) {\n            score++;\n        }\n    });\n\n    showResults();\n\n    saveScore(userName, score);\n\n    loadScoreboard();\n}\n\nfunction showResults() {\n\n    const container = document.getElementById(\"questionContainer\");\n\n    container.innerHTML = \"\";\n\n    questions.forEach((q, index) => {\n\n        const selected = userAnswers[index];\n        const correct = q.correct;\n\n        let optsHTML = q.options.map((opt, i) => {\n\n            let cls = \"\";\n\n            if (i === correct) {\n                cls = \"correct\";\n            }\n\n            if (selected === i && selected !== correct) {\n                cls = \"wrong\";\n            }\n\n            return `<label class=\"${cls}\">${opt}<\/label>`;\n\n        }).join(\"\");\n\n        container.innerHTML += `\n            <div class=\"question\">${q.question}<\/div>\n\n            <div class=\"options\">\n                ${optsHTML}\n            <\/div>\n\n            <div class=\"explanation\" style=\"display:block;\">\n                <strong>Explanation:<\/strong> ${q.explanation}\n            <\/div>\n\n            <hr>\n        `;\n    });\n\n    document.querySelector(\".controls\").style.display = \"none\";\n\n    document.getElementById(\"result\").innerHTML = `\n        <h3>Your Score: ${score} \/ ${questions.length}<\/h3>\n        <p>${score >= 8 ? \"Excellent Work! \ud83c\udf89\" :\n             score >= 5 ? \"Good Attempt! \ud83d\udc4d\" :\n             \"Keep Practising! \ud83d\udcda\"}<\/p>\n    `;\n}\n\nfunction saveScore(name, score) {\n\n    let scores = JSON.parse(localStorage.getItem(\"quizScores\")) || [];\n\n    scores.push({\n        name: name,\n        score: score,\n        date: new Date().toLocaleString()\n    });\n\n    localStorage.setItem(\"quizScores\", JSON.stringify(scores));\n}\n\nfunction loadScoreboard() {\n\n    let scores = JSON.parse(localStorage.getItem(\"quizScores\")) || [];\n\n    scores.sort((a, b) => b.score - a.score);\n\n    document.getElementById(\"scoreList\").innerHTML =\n        scores.map(s => `\n            <li>${escapeHTML(s.name)} - ${s.score}\/10 (${escapeHTML(s.date)})<\/li>\n        `).join(\"\");\n}\n\nfunction escapeHTML(value) {\n    return String(value).replace(\/[&<>\"']\/g, char => ({\n        \"&\": \"&amp;\",\n        \"<\": \"&lt;\",\n        \">\": \"&gt;\",\n        '\"': \"&quot;\",\n        \"'\": \"&#39;\"\n    })[char]);\n}\n\n<\/script>\n\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>\ud83e\udde0 Science Quiz \u2013 Exploring the Investigative World of Science \ud83e\udde0 Exploring the Investigative World of Science Enter your name to start: Start Quiz Previous Next Submit \ud83c\udfc6 Scoreboard<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5325","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/apicalclasses.com\/index.php?rest_route=\/wp\/v2\/posts\/5325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/apicalclasses.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/apicalclasses.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/apicalclasses.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/apicalclasses.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5325"}],"version-history":[{"count":3,"href":"https:\/\/apicalclasses.com\/index.php?rest_route=\/wp\/v2\/posts\/5325\/revisions"}],"predecessor-version":[{"id":5330,"href":"https:\/\/apicalclasses.com\/index.php?rest_route=\/wp\/v2\/posts\/5325\/revisions\/5330"}],"wp:attachment":[{"href":"https:\/\/apicalclasses.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/apicalclasses.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/apicalclasses.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}