<!-- wp:html --> <!DOCTYPE html> <html lang="hi"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>Current Affairs 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: 30px; height: 30px; 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; } </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;">Current Affairs Quiz </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">check</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": "अनिल अग्रवाल डायलॉग द्वारा जारी 'State of States' रिपोर्ट के अनुसार, भारत 16 में से कितने सतत विकास लक्ष्यों (SDG) में वैश्विक औसत से पीछे है?", "options": [ "5", "7", "9", "11" ], "correct": 2, "explanation": "State of States रिपोर्ट के अनुसार, भारत 16 में से 9 सतत विकास लक्ष्यों (SDG) में वैश्विक औसत से पीछे है। रिपोर्ट में यह भी बताया गया है कि उत्तराखंड और तमिलनाडु में सबसे कम पिछड़ापन है, जबकि यूपी, गुजरात और राजस्थान जैसे राज्य कई संकेतकों में लक्ष्य से पीछे हैं।" }, { "question": "पंचायतीराज मंत्रालय द्वारा महिला पंचायत प्रतिनिधियों के नेतृत्व कौशल को विकसित करने के लिए कौन सा अभियान शुरू किया गया है?", "options": [ "महिला शक्ति अभियान", "ग्राम स्वामिनी अभियान", "सशक्त पंचायत नेत्री अभियान", "नारी नेतृत्व अभियान" ], "correct": 2, "explanation": "पंचायतीराज मंत्रालय ने 'सशक्त पंचायत नेत्री' अभियान शुरू करने की घोषणा की है। इसका उद्देश्य निर्वाचित महिला प्रतिनिधियों को वास्तविक नेतृत्व में सक्षम बनाना और 'प्रधान पति' जैसी कुप्रथाओं को समाप्त करना है।" }, { "question": "सरकार ने मार्च 2027 तक देश में कितने नए जनऔषधि केंद्र खोलने का लक्ष्य रखा है?", "options": [ "15,000", "20,000", "25,000", "30,000" ], "correct": 2, "explanation": "सरकार ने 31 मार्च 2027 तक देश में जनऔषधि केंद्रों की संख्या बढ़ाकर 25,000 करने का लक्ष्य रखा है। वर्तमान में 15,000 से अधिक केंद्र संचालित हैं और 7 मार्च को हर साल जनऔषधि दिवस मनाया जाता है।" }, { "question": "18वीं सदी के किस इतालवी यात्री की कब्र आगरा में मिली है, जिसने अपने लेखन में अयोध्या और राम जन्मभूमि का उल्लेख किया था?", "options": [ "मार्को पोलो", "निकोलो डी कोंटी", "जोसेफ टेफेन्थैलर", "पिएत्रो डेला वैले" ], "correct": 2, "explanation": "इटली के खगोलशास्त्री और जेसुइट मिशनरी, जोसेफ टेफेन्थैलर की कब्र आगरा के अकबरी चर्च के पास मिली है। उन्होंने 1766-1771 के बीच अवध क्षेत्र का भ्रमण किया और अपने लेखन में राम जन्मभूमि का विस्तृत वर्णन किया था, जिसका जिक्र राम मंदिर पर आए फैसले में भी है।" }, { "question": "राष्ट्रीय वन्यजीव बोर्ड की बैठक के दौरान, वन्यजीव उत्कृष्टता केंद्र (Wildlife Excellence Center) कहाँ स्थापित करने का निर्णय लिया गया?", "options": [ "गिर राष्ट्रीय उद्यान, गुजरात", "सलीम अली पक्षी विज्ञान केंद्र, कोयंबटूर", "भारतीय वन्यजीव संस्थान, देहरादून", "कॉर्बेट टाइगर रिजर्व, उत्तराखंड" ], "correct": 1, "explanation": "प्रधानमंत्री नरेंद्र मोदी की अध्यक्षता में हुई राष्ट्रीय वन्यजीव बोर्ड की बैठक में तमिलनाडु के कोयंबटूर स्थित सलीम अली पक्षी विज्ञान केंद्र में एक 'वन्यजीव उत्कृष्टता केंद्र' बनाने का निर्णय लिया गया।" }, { "question": "प्रधानमंत्री श्रम योगी मानधन योजना (PM-SYM) के तहत, 60 वर्ष की आयु के बाद असंगठित क्षेत्र के श्रमिकों को न्यूनतम कितनी मासिक पेंशन दी जाती है?", "options": [ "₹1,000", "₹2,000", "₹3,000", "₹5,000" ], "correct": 2, "explanation": "2019 में लॉन्च की गई प्रधानमंत्री श्रम योगी मानधन योजना के तहत, 18 से 40 वर्ष की आयु के असंगठित क्षेत्र के श्रमिकों को 60 वर्ष की आयु पूरी करने के बाद प्रति माह न्यूनतम ₹3,000 की पेंशन प्रदान की जाती है।" }, { "question": "प्रधानमंत्री नरेंद्र मोदी ने गुजरात के जामनगर में किस नाम से एक विशाल पशु बचाव और पुनर्वास केंद्र का उद्घाटन किया?", "options": [ "करुणा", "जीवदया", "वनतारा", "आश्रय" ], "correct": 2, "explanation": "प्रधानमंत्री नरेंद्र मोदी ने गुजरात के जामनगर में रिलायंस रिफाइनरी परिसर में स्थित 'वनतारा' नामक एक विशाल पशु बचाव, संरक्षण और पुनर्वास केंद्र का उद्घाटन किया। यह केंद्र तीन हजार एकड़ में फैला है।" }, { "question": "पशु स्वास्थ्य एवं रोग नियंत्रण कार्यक्रम (LHDCP) में संशोधन के तहत, कौन सी नई योजना जोड़ी गई है?", "options": [ "पशु बीमा", "पशु पोषण", "पशु औषधि (Pashu Aushadhi)", "पशु आश्रय" ], "correct": 2, "explanation": "प्रधानमंत्री नरेंद्र मोदी की अध्यक्षता में केंद्रीय कैबिनेट ने पशु स्वास्थ्य एवं रोग नियंत्रण कार्यक्रम (LHDCP) में संशोधन को मंजूरी दी है, जिसके तहत 'पशु औषधि' (Pashu Aushadhi) नामक एक नई योजना जोड़ी गई है।" }, { "question": "भारतीय रेलवे के विद्युतीकरण के 100 वर्ष पूरे होने पर कितने रुपये का विशेष स्मारक सिक्का जारी किया जाएगा?", "options": [ "₹75", "₹100", "₹150", "₹200" ], "correct": 1, "explanation": "वित्त मंत्रालय ने भारतीय रेलवे के विद्युतीकरण के शताब्दी वर्ष को चिह्नित करने के लिए ₹100 मूल्य का एक विशेष स्मारक सिक्का जारी करने के लिए गजट जारी किया है। भारत में पहली इलेक्ट्रिक ट्रेन 3 फरवरी 1925 को चली थी।" }, { "question": "किस मंत्रालय ने AI इनोवेशन को बढ़ावा देने के लिए एक सुरक्षित डेटा रिपॉजिटरी 'AIKosha' और एक कंप्यूट पोर्टल 'IndiaAI Compute Portal' लॉन्च किया है?", "options": [ "विज्ञान और प्रौद्योगिकी मंत्रालय", "इलेक्ट्रॉनिक्स एवं आईटी मंत्रालय (MeitY)", "शिक्षा मंत्रालय", "वाणिज्य और उद्योग मंत्रालय" ], "correct": 1, "explanation": "इलेक्ट्रॉनिक्स एवं आईटी मंत्रालय (MeitY) ने 'AIKosha' और 'IndiaAI Compute Portal' लॉन्च किया है। AIKosha एक डेटा रिपॉजिटरी है जबकि Compute Portal स्टार्टअप्स और शोधकर्ताओं को 40% तक की सब्सिडी पर कंप्यूटिंग शक्ति प्रदान करेगा।" }, { "question": "अंतर्राष्ट्रीय महिला दिवस 2025 की थीम क्या है?", "options": [ "Invest in Women: Accelerate Progress", "Gender equality today for a sustainable tomorrow", "For ALL Women and Girls: Rights. Equality. Empowerment.", "DigitALL: Innovation and technology for gender equality" ], "correct": 2, "explanation": "8 मार्च को मनाए जाने वाले अंतर्राष्ट्रीय महिला दिवस 2025 की थीम \"For ALL Women and Girls: Rights. Equality. Empowerment.\" है। यह वर्ष बीजिंग घोषणा पत्र और कार्ययोजना (1995) की 30वीं वर्षगांठ भी है।" }, { "question": "1996 की गंगा जल संधि, जो 2026 में समाप्त हो रही है, के नवीनीकरण पर चर्चा के लिए भारत ने किस देश के साथ तकनीकी बैठक की?", "options": [ "नेपाल", "चीन", "भूटान", "बांग्लादेश" ], "correct": 3, "explanation": "भारत और बांग्लादेश ने कोलकाता में 1996 की गंगा जल संधि के नवीनीकरण पर चर्चा करने के लिए एक तकनीकी स्तर की बैठक की। यह संधि 2026 में समाप्त हो जाएगी। भारत और बांग्लादेश के बीच 54 नदियाँ साझा हैं।" }, { "question": "पहली बार वंदे भारत एक्सप्रेस ट्रेन का संचालन पूरी तरह से महिला कर्मचारियों द्वारा किस रूट पर किया गया?", "options": [ "दिल्ली से वाराणसी", "मुंबई (CSMT) से शिरडी", "चेन्नई से मैसूर", "दिल्ली से कटरा" ], "correct": 1, "explanation": "अंतर्राष्ट्रीय महिला दिवस (8 मार्च 2025) के अवसर पर, पहली बार छत्रपति शिवाजी महाराज टर्मिनस (CSMT), मुंबई से शिरडी तक वंदे भारत एक्सप्रेस का संचालन पूरी तरह से महिला कर्मचारियों द्वारा किया गया, जिसमें लोको पायलट और ट्रेन मैनेजर भी महिलाएं थीं।" }, { "question": "भारत की 6 नई संपत्तियों को यूनेस्को की अस्थायी सूची में शामिल किया गया है। इनमें से कौन सी संपत्ति छत्तीसगढ़ राज्य में स्थित है?", "options": [ "कांगेर घाटी राष्ट्रीय उद्यान", "मुटुमल मेगालिथिक मेनहिर", "चौसठ योगिनी मंदिर", "बुंदेलों के महलकिले" ], "correct": 0, "explanation": "यूनेस्को की अस्थायी सूची में जोड़ी गई 6 नई संपत्तियों में छत्तीसगढ़ में स्थित कांगेर घाटी राष्ट्रीय उद्यान शामिल है। इसके साथ, भारत के कुल 62 स्थल इस अस्थायी सूची में शामिल हो गए हैं।" }, { "question": "एक संसदीय समिति ने आयुष्मान भारत प्रधानमंत्री जन आरोग्य योजना (AB-PMJAY) का लाभ अधिक वरिष्ठ नागरिकों तक पहुँचाने के लिए न्यूनतम आयु सीमा 70 वर्ष से घटाकर कितनी करने की सिफारिश की है?", "options": [ "65 वर्ष", "62 वर्ष", "60 वर्ष", "58 वर्ष" ], "correct": 2, "explanation": "एक संसदीय समिति ने सिफारिश की है कि आयुष्मान भारत योजना के तहत वरिष्ठ नागरिकों के लिए न्यूनतम आयु सीमा को 70 वर्ष से घटाकर 60 वर्ष किया जाना चाहिए, ताकि अधिक बुजुर्गों को इस योजना का लाभ मिल सके।" }, { "question": "गृह मंत्रालय ने गैरकानूनी गतिविधियां रोकथाम अधिनियम (UAPA) के तहत कुल कितने संगठनों को प्रतिबंधित सूची में डाला है?", "options": [ "45", "55", "67", "75" ], "correct": 2, "explanation": "गृह मंत्रालय ने 67 संगठनों की एक सूची जारी की है जिन्हें गैरकानूनी गतिविधियां रोकथाम अधिनियम (UAPA) के तहत प्रतिबंधित किया गया है। इनमें से 45 को आतंकी संगठन और 22 को गैरकानूनी संगठन घोषित किया गया है।" }, { "question": "मतदाता सूची की शुद्धता सुनिश्चित करने के लिए चुनाव आयोग किस पहचान पत्र को मतदाता पहचान पत्र से लिंक करने की प्रक्रिया पर काम कर रहा है?", "options": [ "पैन कार्ड", "पासपोर्ट", "ड्राइविंग लाइसेंस", "आधार कार्ड" ], "correct": 3, "explanation": "चुनाव आयोग, UIDAI के सहयोग से मतदाता पहचान पत्र को आधार से लिंक करने की प्रक्रिया पर काम कर रहा है। इसका मुख्य उद्देश्य फर्जी मतदाताओं की पहचान करना और एक प्रमाणित व एकल मतदाता सूची तैयार करना है। 99 करोड़ मतदाताओं में से 66 करोड़ के आधार पहले से ही आयोग के पास हैं।" }, { "question": "कैबिनेट ने असम के नामरूप में ब्रह्मपुत्र वैली फर्टिलाइजर कॉर्पोरेशन लिमिटेड (BVFCL) परिसर में एक नया कौन सा संयंत्र लगाने को स्वीकृति दी है?", "options": [ "पेट्रोकेमिकल संयंत्र", "यूरिया संयंत्र", "फार्मास्यूटिकल संयंत्र", "इस्पात संयंत्र" ], "correct": 1, "explanation": "केंद्रीय कैबिनेट ने असम के नामरूप में स्थित BVFCL परिसर में एक नया यूरिया संयंत्र लगाने को मंजूरी दी है। इस परियोजना की लागत ₹10,601.40 करोड़ होगी और इससे बिहार, बंगाल और पूर्वोत्तर राज्यों को लाभ होगा।" }, { "question": "सुप्रीम कोर्ट ने छात्रों की आत्महत्या रोकने हेतु राष्ट्रीय टास्क फोर्स (NTF) का गठन किया है। इस टास्क फोर्स का अध्यक्ष किसे बनाया गया है?", "options": [ "जस्टिस यू.यू. ललित", "जस्टिस एन.वी. रमना", "सुप्रीम कोर्ट के पूर्व न्यायाधीश जस्टिस एस. रवींद्र भट", "जस्टिस डी.वाई. चंद्रचूड़" ], "correct": 2, "explanation": "सुप्रीम कोर्ट ने शैक्षणिक संस्थानों में छात्रों की आत्महत्याओं को रोकने के लिए एक राष्ट्रीय टास्क फोर्स (NTF) का गठन किया है। सुप्रीम कोर्ट के पूर्व न्यायाधीश जस्टिस एस. रवींद्र भट को इस टास्क फोर्स का अध्यक्ष नियुक्त किया गया है।" }, { "question": "प्रधानमंत्री मत्स्य संपदा योजना (PMMSY) के तहत, कितने तटीय मछुआरा ग्रामों को जलवायु अनुकूल बनाने की पहल शुरू की गई है?", "options": [ "50", "75", "100", "150" ], "correct": 2, "explanation": "प्रधानमंत्री मत्स्य संपदा योजना के तहत, देश के 100 तटीय मछुआरा ग्रामों को जलवायु अनुकूल बनाने की एक नई पहल शुरू की गई है। इसका उद्देश्य ब्लू इकोनॉमी को जलवायु परिवर्तन के प्रभावों से बचाना और मछुआरों की आजीविका को सुरक्षित करना है।" }, { "question": "सरकार ओला और उबर की तर्ज पर एक सहकारी आधारित राइड-हेलिंग सेवा शुरू करने जा रही है। इस टैक्सी सेवा का नाम क्या होगा?", "options": [ "जन-रथ", "सहकार", "सहयोगी", "अमृत कैब" ], "correct": 1, "explanation": "गृह एवं सहकारिता मंत्री अमित शाह ने लोकसभा में \"सहकार\" टैक्सी सेवा शुरू करने की घोषणा की है। यह ओला और उबर की तरह एक राइड-हेलिंग सेवा होगी, लेकिन यह सहकारी मॉडल पर आधारित होगी।" }, { "question": "संयुक्त राष्ट्र की रिपोर्ट के अनुसार, भारत ने पिछले दो दशकों में खसरे से होने वाली बाल मृत्यु दर में कितने प्रतिशत की कमी लाने में सफलता पाई है?", "options": [ "70%", "85%", "92%", "97%" ], "correct": 3, "explanation": "संयुक्त राष्ट्र की एक रिपोर्ट में भारत को बाल मृत्युदर में कमी लाने के लिए सराहा गया है। 'आयुष्मान भारत' जैसी योजनाओं के कारण, 2000 से 2023 के बीच खसरे से होने वाली बाल मृत्यु दर में 97% की भारी गिरावट आई है।" }, { "question": "अंतर्राष्ट्रीय योग दिवस 2025 की थीम क्या घोषित की गई है?", "options": [ "Yoga for Humanity", "Yoga for Wellness", "Yoga for One Earth, One Health", "Yoga for Self and Society" ], "correct": 2, "explanation": "प्रधानमंत्री नरेंद्र मोदी ने 11वें अंतर्राष्ट्रीय योग दिवस (21 जून 2025) के लिए थीम 'Yoga for One Earth, One Health' घोषित की है।" }, { "question": "एक संसदीय समिति ने किस समस्या को भ्रष्टाचार का कारण बताते हुए अधिकारियों के लिए एक रोटेशन नीति को पूरी तरह से लागू करने की अनुशंसा की है?", "options": [ "अधिकारियों का बार-बार तबादला होना", "अधिकारियों का एक ही पद पर लंबे समय तक बने रहना", "अधिकारियों की कमी", "प्रशिक्षण का अभाव" ], "correct": 1, "explanation": "कार्मिक, लोक शिकायत, विधि एवं न्याय पर संसदीय स्थायी समिति ने अपनी रिपोर्ट में कहा है कि अधिकारियों का एक ही पद पर लंबे समय तक बने रहना भ्रष्टाचार को बढ़ावा देता है, और इस पर रोक लगाने के लिए एक सख्त रोटेशन नीति लागू करने की सिफारिश की है।" } ]; 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() { generateQuestionNav(); // Generate the question navigation circles loadQuestion(); startTimer(); // Start the countdown }; // 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); 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"); } // 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 -->