<!-- wp:html --> <!DOCTYPE html> <html lang="hi"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>Quiz </title> <style> /* Basic CSS resets */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: Arial, sans-serif; background-color: #f1f8e9; color: #33691e; } .content-container { background-color: #dcedc8; padding: 5px; border-radius: 5px; max-width: auto; margin: 20px auto; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1); position: relative; } .header { background-color: #7cb342; color: #ffffff; text-align: center; padding: 20px; border-radius: 10px; margin-bottom: 20px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); position: relative; } .header h1 { margin: 0; font-size: 28px; } /* Hamburger Menu Icon */ .hamburger { position: absolute; top: 8px; left: 8px; z-index: 1000; width: 20px; height: 15px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; } .hamburger-line { height: 3px; background-color: #fff; border-radius: 2px; } /* Sidebar (Question Nav) */ #questionNavOverlay { position: fixed; top: 0; left: -250px; /* hidden by default */ width: 250px; height: 100%; background-color: #fff; transition: left 0.3s ease-in-out; z-index: 2000; box-shadow: 2px 0 6px rgba(0,0,0,0.3); padding: 20px; overflow-y: auto; } #questionNavOverlay.show { left: 0; /* slide in */ } #questionNavTitle { margin-bottom: 10px; font-weight: bold; font-size: 1.1rem; } .question-nav { display: flex; flex-wrap: wrap; gap: 5px; } .circle-number { width: 35px; height: 35px; border-radius: 50%; background-color: #ccc; color: #000; display: flex; justify-content: center; align-items: center; cursor: pointer; user-select: none; /* Prevent text selection */ transition: background-color 0.2s; } .circle-number:hover { background-color: #aaa; } .circle-number.active { background-color: #4CAF50; color: #fff; } /* Quiz Container */ .quiz-container { background-color: #fff; border-radius: 10px; padding: 5px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); max-width: auto; width: 100%; margin: 0 auto; text-align: center; position: relative; } .question-counter { font-weight: bold; padding: 5px 10px; border-radius: 5px; background-color: #d9edf7; position: absolute; top: 10px; left: 10px; } /* Timer display */ .timer { font-weight: bold; padding: 5px 10px; border-radius: 5px; background-color: #ffcccb; position: absolute; top: 10px; right: 10px; } .question { font-size: 1.2rem; margin-top: 40px; margin-bottom: 20px; text-align: left; } .choices { display: flex; flex-direction: column; gap: 10px; } .choice { padding: 10px; background-color: #f0f0f0; border: 1px solid #ddd; border-radius: 5px; cursor: pointer; transition: background-color 0.3s, box-shadow 0.3s; } .choice:hover { background-color: #e0e0e0; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); } .choice.selected { background-color: #28a745; /* More vivid green */ color: #fff; } .choice.correct { background-color: #28a745; /* More vivid green */ border-color: #28a745; color: #fff; } .choice.incorrect { background-color: #dc3545; /* More vivid red */ border-color: #dc3545; color: #fff; } .choice.disabled { cursor: not-allowed; pointer-events: none; opacity: 0.6; } .explanation { margin-top: 20px; text-align: left; background-color: #e7f3fe; padding: 15px; border-left: 5px solid #2196F3; border-radius: 5px; } .buttons { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; } .btn { flex: 1 1 auto; padding: 8px 12px; background-color: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 0.9rem; text-align: center; min-width: 100px; max-width: 150px; transition: none; } .btn.disabled { background-color: #cccccc; cursor: not-allowed; } .hidden { display: none; } /* Result Section */ #resultContent { text-align: center; margin-top: 20px; } .congrats { font-size: 1.5rem; color: #4CAF50; } .sad { font-size: 1.5rem; color: #d32f2f; } /* Popup Message (Optional) */ #popupMessage { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); color: white; padding: 10px 20px; border-radius: 5px; font-size: 1rem; z-index: 5000; display: none; } #popupMessage.show { display: block; } #popupMessage.correct { background-color: #28a745; } #popupMessage.incorrect { background-color: #dc3545; } .circle-number.correct { background-color: green; color: white; } .circle-number.incorrect { background-color: red; color: white; } </style> </head> <body> <div class="content-container"> <div class="header"> <!-- Hamburger menu button --> <div class="hamburger" id="hamburgerBtn"> <div class="hamburger-line"></div> <div class="hamburger-line"></div> <div class="hamburger-line"></div> </div> <h1 style="color: #ffffff;">Environment and its Components</h1> </div> <!-- Sidebar (Question Nav) --> <div id="questionNavOverlay"> <div id="questionNavTitle">Questions</div> <div class="question-nav" id="questionNav"></div> </div> <!-- Quiz Container --> <div class="quiz-container" id="quizContent"> <div class="question-counter" id="questionCounter">1/3</div> <!-- Timer display here --> <div class="timer" id="timer">Time: 00:00</div> <div class="question" id="question">Loading question...</div> <div class="choices" id="choices"></div> <!-- Explanation and feedback --> <div class="explanation hidden" id="explanation"></div> <!-- Buttons for navigation and submission --> <div class="buttons"> <button class="btn" id="prevButton">Previous</button> <button class="btn" id="submitAnswerButton">Submit</button> <button class="btn hidden" id="nextButton">Next</button> </div> </div> <!-- Result Section --> <div id="resultContent" class="hidden"> <h2>Quiz Completed</h2> <div id="resultMessage"></div> <p id="scoreMessage"></p> </div> </div> <!-- Optional Popup Message --> <div id="popupMessage" class="hidden"></div> <script> /***** JavaScript Code *****/ // Quiz data (sample) const quizData = [ { "question": "पर्यावरण शब्द की उत्पत्ति किस भाषा से हुई है?", "options": ["ग्रीक", "लैटिन", "फ्रेंच", "संस्कृत"], "correct": 2, "explanation": "पर्यावरण शब्द की उत्पत्ति फ्रेंच भाषा के शब्द 'Environner' से हुई है, जिसका अर्थ है 'घेरना' या 'चारों ओर'। यह हमारे आसपास के सभी जैविक और अजैविक घटकों को संदर्भित करता है।" }, { "question": "निम्नलिखित में से कौन सा अजैविक घटक का उदाहरण है?", "options": ["पौधे", "जानवर", "तापमान", "सूक्ष्मजीव"], "correct": 2, "explanation": "तापमान एक अजैविक घटक है। अजैविक घटक निर्जीव होते हैं, जैसे तापमान, प्रकाश, हवा, पानी, मिट्टी आदि। जैविक घटक जीवित होते हैं, जैसे पौधे, जानवर, सूक्ष्मजीव।" }, { "question": "पारिस्थितिकी (Ecology) शब्द किसने दिया?", "options": ["चार्ल्स डार्विन", "अर्नेस्ट हेकल", "ए.जी. टांसले", "रेमंड लिंडमैन"], "correct": 1, "explanation": "पारिस्थितिकी शब्द जर्मन जीवविज्ञानी अर्नेस्ट हेकल ने दिया था। यह जीव विज्ञान की वह शाखा है जो जीवों और उनके पर्यावरण के बीच संबंधों का अध्ययन करती है।" }, { "question": "खाद्य श्रृंखला में, प्राथमिक उपभोक्ता कौन होते हैं?", "options": ["मांसाहारी", "सर्वाहारी", "शाकाहारी", "अपघटक"], "correct": 2, "explanation": "खाद्य श्रृंखला में प्राथमिक उपभोक्ता शाकाहारी होते हैं, जो पौधों या अन्य उत्पादकों पर निर्भर रहते हैं। मांसाहारी जानवरों का मांस खाते हैं, सर्वाहारी पौधे और जानवर दोनों खाते हैं, और अपघटक मृत जीवों को खाते हैं।" }, { "question": "पारितंत्र में ऊर्जा का प्रवाह कैसा होता है?", "options": ["एकदिशीय", "बहुदिशीय", "चक्रीय", "अनिश्चित"], "correct": 0, "explanation": "पारितंत्र में ऊर्जा का प्रवाह एकदिशीय होता है, यानी यह उत्पादकों से उपभोक्ताओं और फिर अपघटकों की ओर एक ही दिशा में बहता है।" }, { "question": "निम्नलिखित में से कौन सा पारिस्थितिकी तंत्र का एक उदाहरण है?", "options": ["एक खेत", "एक तालाब", "एक जंगल", "उपरोक्त सभी"], "correct": 3, "explanation": "एक खेत, एक तालाब और एक जंगल सभी पारिस्थितिकी तंत्र के उदाहरण हैं। पारिस्थितिकी तंत्र जैविक और अजैविक घटकों का एक समुदाय है जो एक साथ कार्य करते हैं।" }, { "question": "बायोमास क्या है?", "options": ["कुल जीवित पदार्थ का वजन", "कुल निर्जीव पदार्थ का वजन", "पर्यावरण में मौजूद गैसों का मिश्रण", "मिट्टी में मौजूद खनिजों की मात्रा"], "correct": 0, "explanation": "बायोमास किसी पारिस्थितिकी तंत्र में मौजूद कुल जीवित पदार्थ (पौधों, जानवरों, सूक्ष्मजीवों) के वजन को दर्शाता है।" }, { "question": "अपघटक (Decomposers) का कार्य क्या है?", "options": ["उत्पादकों के रूप में ऊर्जा उत्पन्न करना", "उपभोक्ताओं के रूप में भोजन ग्रहण करना", "मृत जैविक पदार्थों को सरल पदार्थों में बदलना", "शिकारियों के रूप में अन्य जीवों का शिकार करना"], "correct": 2, "explanation": "अपघटक, जैसे बैक्टीरिया और कवक, मृत जैविक पदार्थों (पौधों और जानवरों के अवशेष) को सरल अकार्बनिक पदार्थों में बदलते हैं, जिन्हें उत्पादक फिर से उपयोग कर सकते हैं।" }, { "question": "खाद्य जाल (Food Web) क्या दर्शाता है?", "options": ["एकल खाद्य श्रृंखला", "विभिन्न खाद्य श्रृंखलाओं का नेटवर्क", "ऊर्जा का प्रवाह", "पोषक तत्वों का चक्रण"], "correct": 1, "explanation": "खाद्य जाल विभिन्न खाद्य श्रृंखलाओं के नेटवर्क को दर्शाता है, जो एक पारिस्थितिकी तंत्र में जीवों के बीच जटिल खाद्य संबंधों को दर्शाता है।" }, { "question": "पारिस्थितिकी तंत्र की स्थिरता के लिए क्या आवश्यक है?", "options": ["जैविक विविधता", "पोषक तत्वों का चक्रण", "ऊर्जा का प्रवाह", "उपरोक्त सभी"], "correct": 3, "explanation": "पारिस्थितिकी तंत्र की स्थिरता के लिए जैविक विविधता, पोषक तत्वों का चक्रण और ऊर्जा का प्रवाह, ये सभी आवश्यक हैं। ये घटक पारिस्थितिकी तंत्र को संतुलित और स्वस्थ रखने में मदद करते हैं।" }, { "question": "पारितंत्र में ऊर्जा का पिरामिड कैसा होता है?", "options": ["सीधा", "उल्टा", "अनियमित", "दोनों सीधा और उल्टा"], "correct": 0, "explanation": "पारितंत्र में ऊर्जा का पिरामिड हमेशा सीधा होता है, क्योंकि ऊर्जा का प्रवाह उत्पादकों से उपभोक्ताओं की ओर घटता जाता है।" }, { "question": "पारितंत्र की गतिकी में कौन से कारक शामिल होते हैं?", "options": ["ऊर्जा का प्रवाह", "पोषक तत्वों का चक्रण", "जैविक विविधता", "उपरोक्त सभी"], "correct": 3, "explanation": "पारितंत्र की गतिकी में ऊर्जा का प्रवाह, पोषक तत्वों का चक्रण और जैविक विविधता, ये सभी कारक शामिल होते हैं। ये कारक पारिस्थितिकी तंत्र के कामकाज और संतुलन को प्रभावित करते हैं।" }, { "question": "खाद्य श्रृंखला की शुरुआत किससे होती है?", "options": ["उपभोक्ता", "उत्पादक", "अपघटक", "परजीवी"], "correct": 1, "explanation": "खाद्य श्रृंखला की शुरुआत उत्पादकों (हरे पौधों) से होती है, जो सूर्य के प्रकाश का उपयोग करके अपना भोजन बनाते हैं।" }, { "question": "पारितंत्र में पोषक तत्वों का प्रवाह कैसा होता है?", "options": ["एकदिशीय", "चक्रीय", "अनिश्चित", "दोनों एकदिशीय और चक्रीय"], "correct": 1, "explanation": "पारितंत्र में पोषक तत्वों का प्रवाह चक्रीय होता है, यानी ये उत्पादकों से उपभोक्ताओं और फिर अपघटकों के माध्यम से घूमते रहते हैं।" }, { "question": "निम्नलिखित में से कौन सा एक जलीय पारितंत्र का उदाहरण है?", "options": ["घास का मैदान", "जंगल", "प्रवाल भित्ति", "रेगिस्तान"], "correct": 2, "explanation": "प्रवाल भित्ति एक जलीय पारितंत्र का उदाहरण है। घास का मैदान, जंगल और रेगिस्तान स्थलीय पारितंत्र के उदाहरण हैं।" }, { "question": "पारितंत्र में स्थिरता बनाए रखने में कौन मदद करता है?", "options": ["शिकारी", "शिकार", "अपघटक", "उपरोक्त सभी"], "correct": 3, "explanation": "शिकारी, शिकार और अपघटक, ये सभी पारितंत्र में स्थिरता बनाए रखने में महत्वपूर्ण भूमिका निभाते हैं। शिकारियों की संख्या को नियंत्रित करके, शिकार पौधों की वृद्धि को नियंत्रित करके, और अपघटक मृत पदार्थों को रीसायकल करके पारिस्थितिकी तंत्र को संतुलित रखते हैं।" }, { "question": "पारितंत्र में ऊर्जा का स्रोत क्या है?", "options": ["चंद्रमा", "सूर्य", "तारे", "पृथ्वी की गर्मी"], "correct": 1, "explanation": "पारितंत्र में ऊर्जा का मुख्य स्रोत सूर्य है। सूर्य के प्रकाश का उपयोग करके ही उत्पादक अपना भोजन बनाते हैं और ऊर्जा को पारितंत्र में प्रवाहित करते हैं।" }, { "question": "खाद्य जाल में शीर्ष उपभोक्ता कौन होता है?", "options": ["शाकाहारी", "मांसाहारी", "सर्वाहारी", "अपघटक"], "correct": 1, "explanation": "खाद्य जाल में शीर्ष उपभोक्ता मांसाहारी होते हैं, जो खाद्य श्रृंखला में सबसे ऊपर होते हैं और अन्य जानवरों का शिकार करते हैं।" }, { "question": "पारितंत्र का कौन सा घटक अजैविक और जैविक घटकों को जोड़ता है?", "options": ["उत्पादक", "उपभोक्ता", "अपघटक", "जलवायु"], "correct": 2, "explanation": "अपघटक अजैविक और जैविक घटकों को जोड़ते हैं। वे मृत जैविक पदार्थों को सरल पदार्थों में बदलकर मिट्टी में मिलाते हैं, जिन्हें उत्पादक फिर से उपयोग करते हैं।" }, { "question": "पारितंत्र में विभिन्न जीवों के बीच संबंध क्या कहलाते हैं?", "options": ["सहजीवन", "परजीविता", "शिकार", "उपरोक्त सभी"], "correct": 3, "explanation": "पारितंत्र में विभिन्न जीवों के बीच सहजीवन, परजीविता और शिकार जैसे कई प्रकार के संबंध पाए जाते हैं। ये संबंध जीवों के अस्तित्व और पारितंत्र के संतुलन को प्रभावित करते हैं।" }, { "question": "पारितंत्र में 'सहजीवन' (Symbiosis) किसका उदाहरण है?", "options": ["एक शेर और एक हिरण", "एक कवक और एक शैवाल (lichen)", "एक मच्छर और एक मनुष्य", "एक बाज और एक सांप"], "correct": 1, "explanation": "एक कवक और एक शैवाल (lichen) के बीच का संबंध सहजीवन का एक उदाहरण है। सहजीवन में दो अलग-अलग जीव एक साथ रहते हैं और एक दूसरे को लाभ पहुंचाते हैं।" }, { "question": "निम्नलिखित में से कौन सा एक स्थलीय पारितंत्र का उदाहरण है?", "options": ["समुद्र", "नदी", "जंगल", "झील"], "correct": 2, "explanation": "जंगल एक स्थलीय पारितंत्र का उदाहरण है। समुद्र, नदी और झील जलीय पारितंत्र के उदाहरण हैं।" }, { "question": "पारितंत्र में 'परजीविता' (Parasitism) क्या है?", "options": ["एक जीव दूसरे जीव को लाभ पहुंचाता है", "एक जीव दूसरे जीव को हानि पहुंचाता है", "दोनों जीव एक दूसरे को लाभ पहुंचाते हैं", "दोनों जीव एक दूसरे को हानि पहुंचाते हैं"], "correct": 1, "explanation": "परजीविता में एक जीव (परजीवी) दूसरे जीव (मेजबान) से भोजन या आश्रय प्राप्त करता है और उसे हानि पहुंचाता है।" }, { "question": "पारितंत्र में 'शिकार' (Predation) क्या है?", "options": ["एक जीव दूसरे जीव का शिकार करता है", "एक जीव दूसरे जीव से भोजन प्राप्त करता है", "दोनों जीव एक दूसरे के साथ सहयोग करते हैं", "दोनों जीव एक दूसरे के लिए हानिकारक होते हैं"], "correct": 0, "explanation": "शिकार में एक जीव (शिकारी) दूसरे जीव (शिकार) का शिकार करता है और उसे अपना भोजन बनाता है।" }, { "question": "पारितंत्र में 'अपघटन' (Decomposition) की प्रक्रिया में कौन शामिल होते हैं?", "options": ["उत्पादक", "उपभोक्ता", "अपघटक (जैसे बैक्टीरिया और कवक)", "उपरोक्त सभी"], "correct": 2, "explanation": "अपघटन की प्रक्रिया में अपघटक, जैसे बैक्टीरिया और कवक, शामिल होते हैं। वे मृत जैविक पदार्थों को सरल पदार्थों में बदलते हैं।" }, { "question": "पारितंत्र में 'ऊर्जा प्रवाह' (Energy Flow) कैसा होता है?", "options": ["चक्रीय", "एकदिशीय", "अनियमित", "दोनों चक्रीय और एकदिशीय"], "correct": 1, "explanation": "पारितंत्र में ऊर्जा प्रवाह एकदिशीय होता है, यानी यह उत्पादकों से उपभोक्ताओं और फिर अपघटकों की ओर एक ही दिशा में बहता है।" }, { "question": "पारितंत्र में 'पोषक चक्रण' (Nutrient Cycling) क्या दर्शाता है?", "options": ["ऊर्जा का प्रवाह", "पोषक तत्वों का प्रवाह और पुन: उपयोग", "जीवों के बीच संबंध", "उपरोक्त सभी"], "correct": 1, "explanation": "पोषक चक्रण दर्शाता है कि पोषक तत्व (जैसे नाइट्रोजन, फास्फोरस) पारितंत्र में कैसे प्रवाहित होते हैं और पुन: उपयोग किए जाते हैं।" }, { "question": "पारितंत्र में 'जैविक विविधता' (Biodiversity) का क्या महत्व है?", "options": ["यह पारितंत्र को स्थिर बनाता है", "यह पारितंत्र को लचीला बनाता है", "यह पारितंत्र को उत्पादक बनाता है", "उपरोक्त सभी"], "correct": 3, "explanation": "जैविक विविधता पारितंत्र को स्थिर, लचीला और उत्पादक बनाती है। यह विभिन्न जीवों के बीच संबंधों को मजबूत करती है और पारितंत्र को संतुलित रखने में मदद करती है।" }, { "question": "पारितंत्र में 'मानव हस्तक्षेप' (Human Interference) का क्या प्रभाव हो सकता है?", "options": ["यह पारितंत्र को स्थिर बना सकता है", "यह पारितंत्र को अस्थिर कर सकता है", "इसका कोई प्रभाव नहीं होता है", "उपरोक्त में से कोई नहीं"], "correct": 1, "explanation": "मानव हस्तक्षेप, जैसे वनों की कटाई, प्रदूषण, आदि, पारितंत्र को अस्थिर कर सकता है और जैव विविधता को नुकसान पहुंचा सकता है।" }, { "question": "पारितंत्र में 'जलवायु परिवर्तन' (Climate Change) का क्या प्रभाव हो सकता है?", "options": ["यह पारितंत्र को अनुकूल बना सकता है", "यह पारितंत्र को प्रतिकूल बना सकता है", "इसका कोई प्रभाव नहीं होता है", "उपरोक्त में से कोई नहीं"], "correct": 1, "explanation": "जलवायु परिवर्तन, जैसे तापमान में वृद्धि, वर्षा में बदलाव, आदि, पारितंत्र को प्रतिकूल बना सकता है और जीवों के वितरण और अस्तित्व को प्रभावित कर सकता है।" }, { "question": "विश्व का सबसे बड़ा पारितंत्र कौन सा है?", "options": ["जंगल", "समुद्र", "घास का मैदान", "रेगिस्तान"], "correct": 1, "explanation": "समुद्र, पृथ्वी का सबसे बड़ा पारितंत्र है, जो पृथ्वी के सतह के लगभग 70% भाग को कवर करता है और जीवन के विभिन्न रूपों का समर्थन करता है।" }, { "question": "निम्नलिखित में से कौन सा एक मीठे पानी का पारितंत्र है?", "options": ["समुद्र", "नदी", "प्रवाल भित्ति", "दलदल"], "correct": 1, "explanation": "नदी एक मीठे पानी का पारितंत्र है। समुद्र खारा पानी का पारितंत्र है, प्रवाल भित्ति समुद्री पारितंत्र का हिस्सा है, और दलदल मीठे या खारे पानी का मिश्रण हो सकता है।" }, { "question": "जंगल किस प्रकार का पारितंत्र है?", "options": ["स्थलीय", "जलीय", "वायुमंडलीय", "उपरोक्त में से कोई नहीं"], "correct": 0, "explanation": "जंगल एक स्थलीय पारितंत्र है, जो भूमि पर स्थित होता है और पेड़ों और अन्य पौधों की विशेषता होती है।" }, { "question": "निम्नलिखित में से कौन सा एक रेगिस्तानी पारितंत्र का उदाहरण है?", "options": ["सहारा रेगिस्तान", "थार रेगिस्तान", "अटाकामा रेगिस्तान", "उपरोक्त सभी"], "correct": 3, "explanation": "सहारा रेगिस्तान, थार रेगिस्तान और अटाकामा रेगिस्तान सभी रेगिस्तानी पारितंत्र के उदाहरण हैं, जो शुष्क और गर्म जलवायु की विशेषता रखते हैं।" }, { "question": "प्रवाल भित्तियाँ किस प्रकार के पारितंत्र का हिस्सा हैं?", "options": ["स्थलीय", "जलीय (समुद्री)", "जलीय (मीठे पानी)", "उपरोक्त में से कोई नहीं"], "correct": 1, "explanation": "प्रवाल भित्तियाँ जलीय (समुद्री) पारितंत्र का हिस्सा हैं, जो उथले, गर्म और साफ पानी में पाई जाती हैं।" }, { "question": "विश्व का सबसे गहरा बिंदु कौन सा है, जो एक समुद्री पारितंत्र का हिस्सा है?", "options": ["माउंट एवरेस्ट", "मारियाना ट्रेंच", "टोंगा ट्रेंच", "उपरोक्त में से कोई नहीं"], "correct": 1, "explanation": "मारियाना ट्रेंच, प्रशांत महासागर में स्थित, विश्व का सबसे गहरा बिंदु है, जो एक समुद्री पारितंत्र का हिस्सा है।" }, { "question": "अमेज़ॅन वर्षावन किस प्रकार के पारितंत्र का उदाहरण है?", "options": ["उष्णकटिबंधीय वर्षावन", "शीतोष्ण पर्णपाती वन", "टैगा वन", "टुंड्रा वन"], "correct": 0, "explanation": "अमेज़ॅन वर्षावन एक उष्णकटिबंधीय वर्षावन पारितंत्र का उदाहरण है, जो गर्म और आर्द्र जलवायु की विशेषता रखता है और जैव विविधता का एक हॉटस्पॉट है।" }, { "question": "निम्नलिखित में से कौन सा एक टुंड्रा पारितंत्र का उदाहरण है?", "options": ["आर्कटिक टुंड्रा", "अल्पाइन टुंड्रा", "उपरोक्त दोनों", "उपरोक्त में से कोई नहीं"], "correct": 2, "explanation": "आर्कटिक टुंड्रा और अल्पाइन टुंड्रा दोनों टुंड्रा पारितंत्र के उदाहरण हैं, जो ठंडी और शुष्क जलवायु की विशेषता रखते हैं और कम वनस्पति का समर्थन करते हैं।" }, { "question": "विश्व में मैंग्रोव वन कहाँ पाए जाते हैं?", "options": ["नदी के किनारे", "समुद्र के किनारे", "दलदल में", "उपरोक्त सभी"], "correct": 3, "explanation": "मैंग्रोव वन नदी के किनारे, समुद्र के किनारे और दलदल में पाए जाते हैं। वे खारे पानी में उगने वाले विशेष प्रकार के पेड़ होते हैं और तटीय क्षेत्रों की रक्षा करते हैं।" }, { "question": "निम्नलिखित में से कौन सा एक मानव निर्मित पारितंत्र का उदाहरण है?", "options": ["खेत", "तालाब", "जंगल", "उपरोक्त में से कोई नहीं"], "correct": 0, "explanation": "खेत एक मानव निर्मित पारितंत्र का उदाहरण है, जिसे मनुष्य द्वारा अपनी आवश्यकताओं के लिए बनाया और प्रबंधित किया जाता है।" } // More questions as needed... ]; let currentQuestionIndex = 0; // Track current question let userAnswers = Array(quizData.length).fill(null); // Track user's answers // Timer variables let totalQuizTime = quizData.length * 30; // total seconds = 30 seconds * no. of questions let timeLeft = totalQuizTime; let timerInterval; // On page load, initialize quiz window.onload = function() { applyRandomTheme(); // Set random theme generateQuestionNav(); // Generate question navigation loadQuestion(); // Load the first question startTimer(); // Start the countdown timer }; // Start the countdown timer function startTimer() { updateTimerDisplay(timeLeft); timerInterval = setInterval(() => { timeLeft--; updateTimerDisplay(timeLeft); if (timeLeft <= 0) { clearInterval(timerInterval); showResults(); // Force show results if time is up } }, 1000); } // Update timer on the screen in mm:ss format function updateTimerDisplay(seconds) { const timerEl = document.getElementById("timer"); const mins = Math.floor(seconds / 60).toString().padStart(2, '0'); const secs = (seconds % 60).toString().padStart(2, '0'); timerEl.innerText = `Time: ${mins}:${secs}`; } // Toggle the question nav when hamburger is pressed const hamburgerBtn = document.getElementById('hamburgerBtn'); hamburgerBtn.addEventListener('click', () => { document.getElementById('questionNavOverlay').classList.toggle('show'); }); // Close hamburger menu if user clicks outside the nav and menu document.addEventListener('click', (e) => { const navOverlay = document.getElementById('questionNavOverlay'); const hamburger = document.getElementById('hamburgerBtn'); // If the menu is open, and the click is outside both the overlay and the hamburger, close it if ( navOverlay.classList.contains('show') && !navOverlay.contains(e.target) && !hamburger.contains(e.target) ) { navOverlay.classList.remove('show'); } }); // Create small clickable circles for each question function generateQuestionNav() { const navContainer = document.getElementById("questionNav"); navContainer.innerHTML = ""; // clear old items if any quizData.forEach((_, index) => { const circle = document.createElement("div"); circle.classList.add("circle-number"); circle.innerText = index + 1; // Show question number (1-based) circle.onclick = () => jumpToQuestion(index); // Highlight based on answer correctness if (userAnswers[index]!== null) { // If answered if (userAnswers[index] === quizData[index].correct) { circle.classList.add("correct"); // Green for correct } else { circle.classList.add("incorrect"); // Red for incorrect } } navContainer.appendChild(circle); }); } // Jump to a specific question function jumpToQuestion(qIndex) { currentQuestionIndex = qIndex; // Hide the nav on mobile after selection document.getElementById('questionNavOverlay').classList.remove('show'); // Reset submission/next button state document.getElementById("submitAnswerButton").classList.remove("hidden"); document.getElementById("nextButton").classList.add("hidden"); loadQuestion(); } // Load current question function loadQuestion() { highlightCurrentCircle(); // Hide explanation area and Next button initially document.getElementById("explanation").classList.add("hidden"); document.getElementById("nextButton").classList.add("hidden"); const questionData = quizData[currentQuestionIndex]; document.getElementById("question").innerText = questionData.question; document.getElementById("questionCounter").innerText = `${currentQuestionIndex + 1}/${quizData.length}`; // Clear old choices const choicesContainer = document.getElementById("choices"); choicesContainer.innerHTML = ""; // Populate choices questionData.options.forEach((option, index) => { const choiceElement = document.createElement("div"); choiceElement.className = "choice"; choiceElement.innerText = option; // If previously selected, mark it if (userAnswers[currentQuestionIndex] === index) { choiceElement.classList.add("selected"); } // On clicking a choice choiceElement.onclick = () => { // Clear all selections first document.querySelectorAll(".choice").forEach(c => c.classList.remove("selected")); // Mark this one as selected choiceElement.classList.add("selected"); userAnswers[currentQuestionIndex] = index; }; choicesContainer.appendChild(choiceElement); }); // Handle Previous button visibility document.getElementById("prevButton").style.display = currentQuestionIndex === 0? "none": "inline-block"; } // Highlight the current question circle function highlightCurrentCircle() { const circles = document.querySelectorAll(".circle-number"); circles.forEach((circle, idx) => { circle.classList.remove("active"); if (idx === currentQuestionIndex) { circle.classList.add("active"); } }); } // Submit the current question's answer function submitAnswer() { const questionData = quizData[currentQuestionIndex]; const userAnswer = userAnswers[currentQuestionIndex]; // Show the explanation div const explanationDiv = document.getElementById("explanation"); explanationDiv.classList.remove("hidden"); // Clear previous correctness classes and disable further selection document.querySelectorAll(".choice").forEach((c) => { c.classList.add("disabled"); c.onclick = null; }); // Determine correctness or skipping if (userAnswer === null) { explanationDiv.innerHTML = "You Skipped the question.<br/><br/>व्याख्या: " + questionData.explanation; showPopupMessage("You Skipped the question", false); } else if (userAnswer === questionData.correct) { explanationDiv.innerHTML = "You got it right!<br/><br/>व्याख्या: " + questionData.explanation; showPopupMessage("You got it right", true); // Highlight correct choice document.querySelectorAll(".choice")[userAnswer].classList.add("correct"); } else { explanationDiv.innerHTML = "You got it wrong.<br/><br/>व्याख्या: " + questionData.explanation; showPopupMessage("You got it wrong", false); // Highlight correct choice document.querySelectorAll(".choice")[questionData.correct].classList.add("correct"); // Mark the chosen one as incorrect document.querySelectorAll(".choice")[userAnswer].classList.add("incorrect"); } // Hide the submit button, show the next button document.getElementById("submitAnswerButton").classList.add("hidden"); document.getElementById("nextButton").classList.remove("hidden"); // Regenerate question navigation to update colors generateQuestionNav(); } // Go to the next question or show final results function nextQuestion() { currentQuestionIndex++; if (currentQuestionIndex >= quizData.length) { // Show results if no more questions showResults(); } else { // Reset buttons document.getElementById("submitAnswerButton").classList.remove("hidden"); document.getElementById("nextButton").classList.add("hidden"); loadQuestion(); } } // Go to the previous question function previousQuestion() { if (currentQuestionIndex > 0) { currentQuestionIndex--; document.getElementById("submitAnswerButton").classList.remove("hidden"); document.getElementById("nextButton").classList.add("hidden"); loadQuestion(); } } // Show final quiz results function showResults() { // Stop the timer if it's still running clearInterval(timerInterval); // Calculate correct answers const correctAnswersCount = userAnswers.filter( (ans, i) => ans === quizData[i].correct ).length; // Hide quiz content document.getElementById("quizContent").classList.add("hidden"); // Show results document.getElementById("resultContent").classList.remove("hidden"); const percentage = (correctAnswersCount / quizData.length) * 100; let resultHTML = ""; if (percentage >= 60) { resultHTML = `<div class="congrats">🎉 बधाई हो! आपने ${percentage.toFixed( 2 )}% स्कोर किया है!</div>`; } else { resultHTML = `<div class="sad">😢 आपने ${percentage.toFixed( 2 )}% स्कोर किया है। अगली बार के लिए शुभकामनाएं!</div>`; } document.getElementById("resultMessage").innerHTML = resultHTML; document.getElementById("scoreMessage").innerText = `आपने कुल ${quizData.length} में से ${correctAnswersCount} प्रश्न सही उत्तर दिए हैं।`; } // Optional popup message function showPopupMessage(message, isCorrect) { const popup = document.getElementById('popupMessage'); popup.innerText = message; popup.className = ''; popup.classList.add('show'); popup.classList.add(isCorrect? 'correct': 'incorrect'); setTimeout(() => { popup.classList.remove('show'); popup.classList.add('hidden'); }, 2000); } // Button event listeners document.getElementById('prevButton').addEventListener('click', previousQuestion); document.getElementById('submitAnswerButton').addEventListener('click', submitAnswer); document.getElementById('nextButton').addEventListener('click', nextQuestion); // Predefined Darker Color Themes const themes = [ { header: '#a31645', headerText: '#ffffff', container: '#e8c4d6', containerText: '#6e0c36', headings: '#6e0c36' }, // Berry Delight { header: '#00574b', headerText: '#ffffff', container: '#b3dfd7', containerText: '#00382e', headings: '#00382e' }, // Ocean Breeze { header: '#c95a00', headerText: '#ffffff', container: '#dca865', containerText: '#7a3400', headings: '#7a3400' }, // Sunset Glow { header: '#4a0f6f', headerText: '#ffffff', container: '#cdb5e3', containerText: '#320b4a', headings: '#320b4a' }, // Calming Lavender { header: '#1e4d2b', headerText: '#ffffff', container: '#98c1a3', containerText: '#122417', headings: '#122417' }, // Forest Retreat { header: '#c99800', headerText: '#ffffff', container: '#e8d18a', containerText: '#6c4f00', headings: '#6c4f00' }, // Golden Elegance { header: '#01477e', headerText: '#ffffff', container: '#86b9e4', containerText: '#00223d', headings: '#00223d' }, // Sky Calm { header: '#5a3b2e', headerText: '#ffffff', container: '#b8a89c', containerText: '#32211a', headings: '#32211a' }, // Retro Rust { header: '#b34727', headerText: '#ffffff', container: '#f2c29d', containerText: '#6a2915', headings: '#6a2915' }, // Warm Peach { header: '#0f4c43', headerText: '#ffffff', container: '#92c3b8', containerText: '#072822', headings: '#072822' }, // Cool Mint ]; // Apply Random Darker Theme function applyRandomTheme() { const header = document.querySelector('.header'); const container = document.querySelector('.content-container'); const headings = document.querySelectorAll('.content-container h2'); // Select a random theme const randomTheme = themes[Math.floor(Math.random() * themes.length)]; // Apply Header Colors header.style.backgroundColor = randomTheme.header; header.style.color = randomTheme.headerText; // Apply Container Colors container.style.backgroundColor = randomTheme.container; container.style.color = randomTheme.containerText; // Apply Heading Colors headings.forEach((heading) => { heading.style.color = randomTheme.headings; heading.style.borderBottom = `2px solid ${randomTheme.headings}`; }); } // Apply the theme on page load window.onload = function () { applyRandomTheme(); // Set random theme generateQuestionNav(); // Generate question navigation loadQuestion(); // Load the first question startTimer(); // Start the countdown timer }; </script> </body> </html> <!-- /wp:html -->