``` --- **Explanation of Choices:** * **``:** Clearly identifies the exam, year, set, question number, and the specific content (Hima Das grammar) for search engines and users. It also includes the brand name for recognition. * **`<meta name="description">`:** Provides a concise summary, including primary keywords (GATE 2019 Civil Engineering, Question 5) and secondary keywords (Hima Das, grammar, articles, solution). It encourages clicks by offering the "solution." * **`<meta name="keywords">`:** A comprehensive list covering the exam specifics, the content within the question, and general terms related to exam preparation. * **`<link rel="canonical">`:** Important for SEO to indicate the preferred URL, preventing duplicate content issues if this page is accessible via multiple URLs. * **Open Graph (`og:`) Tags:** Crucial for how the content appears when shared on social media platforms like Facebook, LinkedIn, etc. * `og:type`: "article" is suitable for a specific question/solution page. * `og:url`: The direct URL to the content. * `og:title` & `og:description`: Optimized for social sharing, often slightly more engaging than the meta description. * `og:image`: **Highly recommended.** A visually appealing image (e.g., a thumbnail of the question, a GATE logo, or a branded image for ExamPrev) significantly boosts engagement on social media. I've provided a placeholder suggestion. * `og:site_name`: The website's name. * **Twitter Card (`twitter:`) Tags:** Similar to Open Graph, but specifically for Twitter. * `twitter:card`: `summary_large_image` is generally preferred as it displays a larger image, making the tweet stand out. * `twitter:creator`: If ExamPrev has a Twitter handle, include it here for attribution. * **`<meta name="robots">`:** Explicitly tells search engine crawlers to index this page and follow links on it (this is the default behavior if omitted, but good for clarity). <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="/css/ques.css"> <meta name="csrf-token" content="lnnDCKxcyy3UHdwhqVLWmdpWHrWaD8v0KwppIWW9"> <link rel="icon" href="/image/logo.jpg" type="image/x-icon" alt="logo of ExamPrev"> <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script> <link href="https://examprev.com/css/contribute.css" rel="stylesheet" type="text/css"> </head> <body> <nav class="navbar navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href="/"><img src="https://examprev.com/image/examprev.png" class="examprev-logo" alt="ExamPrev Logo"></a> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarNav"> <ul class="navbar-nav"> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fas fa-graduation-cap me-1"></i> <span class="heading">Exams</span> </a> <ul class="dropdown-menu" aria-labelledby="navbarDropdown"> <li><a class="dropdown-item" href="/gate-exam"><i class="fas fa-cogs"></i>Gate Exam</a></li> <li><a class="dropdown-item" href="/ssc-exam'"><i class="fas fa-landmark"></i>SSC Exam</a></li> <li><a class="dropdown-item" href="/ies-ese-exam"><i class="fas fa-microchip"></i>IES/ESE Exam</a></li> <li><a class="dropdown-item" href="/upse-exam"><i class="fas fa-balance-scale"></i>UPSE Exam</a></li> <li><a class="dropdown-item" href="https://examprev.com/exams"><i class="fas fa-ellipsis-h"></i>See More Exams</a></li> </ul> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"> <i class="fas fa-hands-helping me-1"></i>Contribute </a> <ul class="dropdown-menu"> <li><a class="dropdown-item" href="/contribute-question-with-examprev"><i class="fas fa-question-circle me-2"></i>Contribute Questions</a></li> <li><a class="dropdown-item" href="/contribute-answer-with-examprev"><i class="fas fa-lightbulb me-2"></i>Contribute Answers</a></li> <li><a class="dropdown-item" href="/correct-the-question-answer-contribute-with-examprev"><i class="fas fa-edit me-2"></i>Contribute Corrections</a></li> </ul> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="aptitudeDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fas fa-brain me-1"></i> <span class="heading">Aptitude</span> </a> <ul class="dropdown-menu" aria-labelledby="aptitudeDropdown"> <li><a class="dropdown-item" href="/quantitative-aptitude"><i class="fas fa-calculator"></i>Quantitative Aptitude</a></li> <li><a class="dropdown-item" href="/logical-reasoning"><i class="fas fa-puzzle-piece"></i>Logical Reasoning</a></li> <li><a class="dropdown-item" href="/verbal-ability"><i class="fas fa-comment-alt"></i>Verbal Ability</a></li> </ul> </li> <!-- New Sections Menu --> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="sectionsDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fas fa-th-large me-1"></i> <span class="heading">Sections</span> </a> <ul class="dropdown-menu" aria-labelledby="sectionsDropdown"> <li><a href="/practice-tests"><i class="fas fa-clipboard-list"></i>Practice Tests</a></li> <li><a href="/mock-exams"><i class="fas fa-file-alt"></i>Mock Exams</a></li> <li><a href="/study-materials"><i class="fas fa-book"></i>Study Materials</a></li> <li><a href="/video-lectures"><i class="fas fa-play-circle"></i>Video Lectures</a></li> <li><a href="/current-affairs"><i class="fas fa-newspaper"></i>Current Affairs</a></li> </ul> </li> <li class="nav-item"> <a class="nav-link" href="/contact"> <i class="fas fa-envelope me-1"></i> <strong>Contact Us</strong> </a> </li> </ul> <!-- Profile Section --> <div class="profile-section"> <!-- Search Box --> <div class="search-container"> <i class="fas fa-search search-icon"></i> <input type="text" class="search-input" placeholder="Search questions, topics..."> </div> <!-- Notifications --> <div class="notification-dropdown"> <button class="notification-btn" id="notificationBtn"> <i class="fas fa-bell"></i> <span class="notification-badge" id="notificationBadge" style="display: none;">0</span> </button> <div class="notification-menu" id="notificationMenu"> <!-- Content will be populated by JavaScript --> </div> </div> <!-- Profile Dropdown --> <div class="profile-dropdown"> <button class="profile-btn" id="profileBtn"> <i class="fas fa-user"></i> </button> <div class="profile-menu" id="profileMenu"> </div> </div> </div> </div> </nav> <div class="main-body"> <div class="background-overlay"></div> <main class="main-content"> <div class="row"> <!-- LEFT ADS (LG+) --> <div class="col-lg-2 d-none d-lg-block"> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4999327676889242" crossorigin="anonymous"></script> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4999327676889242" data-ad-slot="8094660280" data-ad-format="auto" data-full-width-responsive="true"></ins> <script>(adsbygoogle = window.adsbygoogle || []).push({});</script> </div> <!-- MAIN CONTENT --> <div class="col-12 col-lg-8"> <section class="question-card"> <div class="question-badge-container"> <div class="question-type-badge"> <i class="fas fa-route"></i> Civil Engineering > GATE 2019 SET-2 > Sentence Completion </div> <div class="menu-container"> <button type="button" class="menu-button" onclick="openQuestionModal(526, 'Vikas')" id="menuBtn-526"> <i class="fas fa-ellipsis-v"></i> </button> </div> </div> <div class="question-text">Hima Das was _______ only Indian athlete to win _______ gold for India.</div> <div class="mcq-options"> <div class="option" onclick="selectOption(this,'A')"><div class="option-label">A</div><div class="option-value">the, many</div></div> <div class="option" onclick="selectOption(this,'B')"><div class="option-label">B</div><div class="option-value">the, a</div></div> <div class="option" onclick="selectOption(this,'C')"><div class="option-label">C</div><div class="option-value">an, a</div></div> <div class="option" onclick="selectOption(this,'D')"><div class="option-label">D</div><div class="option-value">an, the</div></div> </div> <div class="actions"> <button class="btn btn-primary" onclick="checkAnswer()"> <i class="fas fa-check"></i> Check Answer </button> </div> <div class="explanation" id="explanation"> <p><b>Correct :</b> b</p> <p></p> </div> </section> <section class="similar-section"> <h2 class="section-title"><i class="fas fa-link"></i> Similar Questions</h2> <div class="similar-questions-grid"> <div class="similar-question" onclick="window.location.href='https://examprev.com/question/computer-sciences-gate-2017-set-2-question-32'"> <div class="similar-question-text"> It is a common criticism that most of the academicians live in their _______, so they are not aware of the real-life challenges. </div> <div class="similar-question-meta"> <span>#587</span> <span>MCQ</span> </div> </div> <div class="similar-question" onclick="window.location.href='https://examprev.com/question/mechanical-engineering-gate-2014-set-4-question-27'"> <div class="similar-question-text"> It is a common criticism that most of the academicians live in their _______, so they are not aware of the real-life challenges. </div> <div class="similar-question-meta"> <span>#587</span> <span>MCQ</span> </div> </div> <div class="similar-question" onclick="window.location.href='https://examprev.com/question/civil-engineering-gate-2020-set-1-question-1'"> <div class="similar-question-text"> It is a common criticism that most of the academicians live in their _______, so they are not aware of the real-life challenges. </div> <div class="similar-question-meta"> <span>#587</span> <span>MCQ</span> </div> </div> </div> </section> <section class="tags-section"> <h2 class="section-title"> <i class="fas fa-tags"></i> Related Topics </h2> <div class="tags-grid"> <span class="no-tags">No tags found</span> </div> </section> <br> <div align="center"> <div class="visitor-card"> <img src="http://examprev.com/images/uniqueVisitorCount.png" alt="Unique Visitor Count" class="visitor-image"> <p class="visitor-label">Total Unique Visitors</p> <div class="visitor-count" id="visitorCount">Loading......</div> </div> </div> </div> <!-- RIGHT ADS (LG+) --> <div class="col-lg-2 d-none d-lg-block"> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4999327676889242" crossorigin="anonymous"></script> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4999327676889242" data-ad-slot="8094660280" data-ad-format="auto" data-full-width-responsive="true"></ins> <script>(adsbygoogle = window.adsbygoogle || []).push({});</script> </div> </div> <!-- Custom Modal --> <div class="custom-modal" id="questionModal"> <div class="modal-content"> <div class="modal-header"> <h5>Question Options</h5> <button type="button" class="modal-close" onclick="closeModal()"> <i class="fas fa-times"></i> </button> </div> <div class="modal-body"> <div class="nav-tabs"> <button class="nav-link active" onclick="showTab('details', this)">Question Details</button> <button class="nav-link" onclick="showTab('report', this)">Report Correction</button> <button class="nav-link" onclick="showTab('copyright', this)">Copyright Claim</button> </div> <div class="tab-content active" id="details"> <div class="contributor-info"> <p> <i class="fas fa-user me-2"></i> Contributed by: <span class="contributor-name" id="modalContributorName"></span> </p> </div> </div> <div class="tab-content" id="report"> <form id="reportForm"> <input type="hidden" id="reportQuesId" name='quesid' value="526"> <div class="mb-3"> <label for="reportName" class="form-label">Name</label> <input type="text" class="form-control" id="reportName" name="name" placeholder="Enter your name" required> </div> <div class="mb-3"> <label for="reportEmail" class="form-label">Email</label> <input type="email" class="form-control" id="reportEmail" name="email" placeholder="Enter your email address" required> </div> <div class="mb-3"> <label for="correctionDetails" class="form-label">Correction Details</label> <textarea class="form-control" id="correctionDetails" name="details" rows="4" placeholder="Describe the correction needed..." required></textarea> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" onclick="closeModal()">Cancel</button> <button type="submit" class="btn btn-primary">Submit Report</button> </div> </form> </div> <div class="tab-content" id="copyright"> <form id="copyrightForm"> <input type="hidden" name="type" value='Sentence Completion'> <input type="hidden" id="copyrightQuesId" name="quesid"> <div class="mb-3"> <label for="copyrightName" class="form-label">Name</label> <input type="text" class="form-control" id="copyrightName" name="name" placeholder="Enter your name" required> </div> <div class="mb-3"> <label for="copyrightEmail" class="form-label">Email</label> <input type="email" class="form-control" id="copyrightEmail" name="email" placeholder="Enter your email address" required> </div> <div class="mb-3"> <label for="copyrightDetails" class="form-label">Copyright Claim Details</label> <textarea class="form-control" id="copyrightDetails" name="details" rows="4" placeholder="Provide details about your copyright claim..." required></textarea> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" onclick="closeModal()">Cancel</button> <button type="submit" class="btn btn-primary">Submit Claim</button> </div> </form> </div> </div> </div> </div> </main> <div class="dropdown-overlay" id="dropdownOverlay" onclick="closeDropdown()"></div> <script> // Question data const questionData = { id: 10, type: 'mcq', correct_answers: ['B'], explanation: 'In a balanced binary search tree, the search operation has O(log n) time complexity.' }; let selectedOptions = []; let answered = false; let dropdownOpen = false; // Dropdown functionality function toggleDropdown() { const menu = document.getElementById('dropdownMenu'); const overlay = document.getElementById('dropdownOverlay'); const button = document.getElementById('menuButton'); if (dropdownOpen) { closeDropdown(); } else { openDropdown(); } } function openDropdown() { const menu = document.getElementById('dropdownMenu'); const overlay = document.getElementById('dropdownOverlay'); const button = document.getElementById('menuButton'); menu.classList.add('show'); overlay.classList.add('show'); button.classList.add('active'); dropdownOpen = true; } function closeDropdown() { const menu = document.getElementById('dropdownMenu'); const overlay = document.getElementById('dropdownOverlay'); const button = document.getElementById('menuButton'); menu.classList.remove('show'); overlay.classList.remove('show'); button.classList.remove('active'); dropdownOpen = false; } function reportCorrect() { closeDropdown(); showToast('Thank you for reporting. We will review this question.', 'info'); } function copyrightClaim() { closeDropdown(); showToast('Copyright claim submitted. Our team will investigate.', 'warning'); } function selectOption(element, option) { if (answered) return; // Clear previous selections for single choice document.querySelectorAll('.option').forEach(opt => opt.classList.remove('selected')); // Select current option element.classList.add('selected'); selectedOptions = [option]; } function checkAnswer() { answered = true; // Update button with loading state const btn = document.querySelector('.btn-primary'); btn.innerHTML = '<div class="loading"></div> Checking...'; btn.disabled = true; setTimeout(() => { checkMCQAnswer(); document.getElementById('explanation').classList.add('show'); // Update button btn.innerHTML = '<i class="fas fa-arrow-right"></i> Next Question'; btn.onclick = nextQuestion; btn.disabled = false; }, 1000); } function checkMCQAnswer() { document.querySelectorAll('.option').forEach(opt => { const optionLetter = opt.querySelector('.option-label').textContent; if (questionData.correct_answers.includes(optionLetter)) { opt.classList.add('correct'); } else if (selectedOptions.includes(optionLetter)) { opt.classList.add('incorrect'); } }); // Show appropriate message based on user's selection if (selectedOptions.length === 0) { showToast('No answer selected. Correct answer is highlighted!', 'info'); } else if (selectedOptions.some(option => questionData.correct_answers.includes(option))) { showToast('Correct! Well done!', 'success'); } else { showToast('Incorrect. The correct answer is highlighted.', 'error'); } } function nextQuestion() { document.body.style.opacity = '0.5'; setTimeout(() => { const firstSimilarQuestion = document.querySelector('.similar-question'); if (firstSimilarQuestion) { const onclickAttr = firstSimilarQuestion.getAttribute('onclick'); const match = onclickAttr.match(/'(.*?)'/); if (match && match[1]) { window.location.href = match[1]; } } }, 300); } function loadQuestion(questionId) { window.location.href = `/questions/${questionId}`; } function filterByTag(tag) { window.location.href = `/questions?tag=${encodeURIComponent(tag)}`; } function showToast(message, type) { // Create toast notification const toast = document.createElement('div'); toast.style.cssText = ` position: fixed; top: 20px; right: 20px; padding: 12px 20px; border-radius: 8px; color: white; font-weight: 600; z-index: 1000; transform: translateX(100%); transition: transform 0.3s ease; ${type === 'success' ? 'background: #10b981;' : type === 'error' ? 'background: #ef4444;' : type === 'info' ? 'background: #3b82f6;' : 'background: #f59e0b;'} `; toast.textContent = message; document.body.appendChild(toast); // Animate in setTimeout(() => { toast.style.transform = 'translateX(0)'; }, 100); // Remove after 3 seconds setTimeout(() => { toast.style.transform = 'translateX(100%)'; setTimeout(() => { document.body.removeChild(toast); }, 300); }, 3000); } // Close dropdown when clicking outside document.addEventListener('click', function(event) { const menu = document.getElementById('dropdownMenu'); const button = document.getElementById('menuButton'); if (!menu.contains(event.target) && !button.contains(event.target)) { closeDropdown(); } }); // Initialize document.addEventListener('DOMContentLoaded', function() { // Any initialization code can go here }); function openQuestionModal(quesid, contributorName) { document.getElementById('reportQuesId').value = quesid; document.getElementById('copyrightQuesId').value = quesid; document.getElementById('correctionDetails').value = ''; document.getElementById('copyrightDetails').value = ''; document.getElementById('modalContributorName').textContent = contributorName; document.getElementById('questionModal').classList.add('show'); showTab('details', document.querySelector('.nav-tabs .nav-link')); // Show first tab by default } function closeModal() { document.getElementById('questionModal').classList.remove('show'); } function showTab(tabId, element) { document.querySelectorAll('.tab-content').forEach(tab => tab.classList.remove('active')); document.querySelectorAll('.nav-link').forEach(link => link.classList.remove('active')); document.getElementById(tabId).classList.add('active'); element.classList.add('active'); } function toggleCollapse(id) { const element = document.getElementById(id); element.classList.toggle('collapse'); if (!element.classList.contains('collapse')) { element.style.display = 'block'; } else { element.style.display = 'none'; } } document.getElementById('reportForm').addEventListener('submit', async function(e) { e.preventDefault(); const formData = new FormData(this); const submitButton = this.querySelector('button[type="submit"]'); submitButton.disabled = true; submitButton.textContent = 'Submitting...'; try { const response = await fetch('/reports/correction', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]')?.content || '', 'Accept': 'application/json' }, body: JSON.stringify({ quesid: formData.get('quesid'), name: formData.get('name'), email: formData.get('email'), details: formData.get('details') }) }); const result = await response.json(); if (result.success) { showToast(result.message, 'success'); this.reset(); closeModal(); } else { showToast(result.message || 'Failed to submit report', 'error'); } } catch (error) { console.error('Error:', error); showToast('Network error. Please try again.', 'error'); } finally { submitButton.disabled = false; submitButton.textContent = 'Submit Report'; } }); document.getElementById('copyrightForm').addEventListener('submit', async function(e) { e.preventDefault(); const formData = new FormData(this); const submitButton = this.querySelector('button[type="submit"]'); submitButton.disabled = true; submitButton.textContent = 'Submitting...'; try { const response = await fetch('/reports/copyright', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]')?.content || '', 'Accept': 'application/json' }, body: JSON.stringify({ quesid: formData.get('quesid'), name: formData.get('name'), email: formData.get('email'), details: formData.get('details'), type: formData.get('type') }) }); const result = await response.json(); if (result.success) { showToast(result.message, 'warning'); this.reset(); closeModal(); } else { showToast(result.message || 'Failed to submit claim', 'error'); } } catch (error) { console.error('Error:', error); showToast('Network error. Please try again.', 'error'); } finally { submitButton.disabled = false; submitButton.textContent = 'Submit Claim'; } }); // Close modal when clicking outside document.getElementById('questionModal').addEventListener('click', function(e) { if (e.target === this) { closeModal(); } }); </script> <div class="login-modal-overlay" id="loginModalOverlay"> <div class="login-modal" id="loginModal"> <div class="login-modal-header"> <h5>Sign in to ExamPrev</h5> <button class="close-btn" id="closeLoginModal"> <i class="fas fa-times"></i> </button> </div> <div class="login-modal-body"> <div class="social-container small"> <!-- Google Icon --> <div class="social-circle"> <a href="https://examprev.com/auth/google"> <svg class="social-icon" viewBox="0 0 24 24"> <path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/> <path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/> <path fill="#FBBC05" d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"/> <path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"/> </svg> </a> </div> <!-- Facebook Icon --> <div class="social-circle"> <svg class="social-icon" viewBox="0 0 24 24"> <path fill="#1877F2" d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/> <path fill="#FFFFFF" d="M16.671 15.543l.532-3.47h-3.328v-2.25c0-.949.465-1.874 1.956-1.874h1.513V5.996s-1.374-.235-2.686-.235c-2.741 0-4.533 1.662-4.533 4.669v2.632H7.078v3.47h3.047v8.385a12.118 12.118 0 003.75 0v-8.385h2.796z"/> </svg> </div> </div> <div class="login-options"> <form action="/login-post" method="POST"> <input type="hidden" name="_token" value="lnnDCKxcyy3UHdwhqVLWmdpWHrWaD8v0KwppIWW9"> <div class="mb-3"> <input type="email" class="form-control" placeholder="Enter email" id="login_email" name="email" value="" required> </div> <div class="mb-3"> <input type="password" class="form-control" placeholder="Enter password" id="login_password" name="password" required> </div> <div class="text-center mt-3"> <button class="login-option-btn primary"> <i class="fas fa-sign-in-alt"></i>   Login</button> </div> </form> <div class="text-center mt-3"> <a href="/login?Register">Create Account</a> | <a href="/login?Forgot">Forgot Password?</a> </div> </div> </div> </div> </div> </div> </div> <footer class="footer-section"> <div class="footer-content pt-5 pb-5"> <div class="row"> <div class="col-xl-4 col-lg-4 mb-50"> <div class="footer-widget"> <div class="footer-logo"> <img src="https://examprev.com/image/examprev.png" loading="lazy" style="border-radius: 15%;" width="160" height="70" class="d-inline-block align-text-top" alt="ExamPrev Logo"> </div> <div class="footer-text"> <p>ExamPrev : Best Source for Prevoius Year Question</p> </div> <div class="footer-icon-text"> <span id="spanh3">Follow us</span> </div> <div class="footer-social-icon"> <a href="https://www.facebook.com/smallcode023/"><img src="/image/facebook.svg" loading="lazy" style="width:35px; height:35px;" alt="ExamPrev Facebook"></a> <a href="https://twitter.com/_SmallCode?s=08"><img src="/image/twitter.svg" loading="lazy" style="width:35px; height:35px;" alt="ExamPrev Twitter"></a> <a href="https://www.instagram.com/_smallcode_/"><img src="/image/instagram.svg" loading="lazy" style="width:35px; height:35px;" alt="ExamPrev Instagram"></a> <a href="https://www.linkedin.com/company/small-code/"><img src="/image/linkedin.svg" loading="lazy" style="width:35px; height:35px;" alt="ExamPrev Linkedin"></a> <a href="https://www.youtube.com/channel/UC7qbMbMZ-pFRUJZq8UlvEfQ"><img src="/image/youtube.svg" loading="lazy" style="width:35px; height:35px;" alt="ExamPrev Youtube"></a> </div> <br> </div> </div> <div class="col-xl-4 col-lg-4 col-md-6 mb-30"> <div class="footer-widget"> <div class="footer-widget-heading"> <span id="spanh3">Useful Links</span><br><br> </div> <ul id="foolter-ul"> <li><a href="https://examprev.com">Home</a></li> <li><a href="https://examprev.com/gate-exam">Gate Exam</a></li> <li><a href="https://examprev.com/ssc-exam">SSC Exam</a></li> <li><a href="https://examprev.com/ies-ese-exam">IES/ESE Exam</a></li> <li><a href="https://examprev.com/upse-exam">UPSE Exam</a></li> <li><a href="https://examprev.com/gate-computer-science-and-it">Gate CS/IT</a></li> </ul> </div> </div> <div class="col-xl-4 col-lg-4 col-md-6 mb-50"> <div class="footer-widget"> <div class="footer-widget-heading"> <span id="spanh3">Get Latest Tech. News</span><br><br> </div> <div class="footer-text mb-25"> <p>Donโ€™t miss to subscribe for new News of Technologies.</p> </div> <div class="subscribe-form"> <form action="/subscribe-examprev" method="post"> <input type="hidden" name="_token" value="lnnDCKxcyy3UHdwhqVLWmdpWHrWaD8v0KwppIWW9"> <input type="email" name='email' placeholder="Email Address" required> <input hidden type="text" name='type' value="Subscribe" placeholder="Email Address" required> <button>Send</button> </form> </div> </div> </div> </div> </div> <div class="copyright-area"> <div class="row"> <div class="col-xl-5 col-lg-5 text-center text-lg-left"> <div class="copyright-text"> <p>Copyright © 2024, All Right Reserved ExamPrev</p> </div> </div> <div class="col-xl-7 col-lg-7 d-lg-block text-right"> <div class="footer-menu"> <ul> <li><a href="https://examprev.com/terms-and-condition">Terms & Condition</a></li> <li><a href="https://examprev.com/privacy">Privacy</a></li> <li><a href="https://examprev.com/disclaimer">Disclaimer</a></li> <li><a href="https://examprev.com/contact">Contact Us</a></li> <li><a href="https://examprev.com/about">About Us</a></li> </ul> </div> </div> </div> </div> </footer> </body> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script> // Get data from Laravel controller const user = null; const sampleNotifications = []; // Global variables to store menu elements let notificationBtn, notificationMenu, notificationOverlay, notificationBadge; // Generate notification content function function generateNotificationContent() { if (!user) { return ` <div class="login-prompt"> <i class="fas fa-user-lock"></i> <h6>Sign in to View Notifications</h6> <p>Login to access your personalized notifications and stay updated with your exam progress.</p> <a href="/login" class="login-btn"> <i class="fas fa-sign-in-alt me-2"></i> Login Now </a> </div> `; } const notifications = sampleNotifications || []; const unreadCount = notifications.filter(n => n.unread).length; let content = ` <div class="notification-header"> <h6 class="notification-title"> <i class="fas fa-bell me-2"></i> Notifications ${unreadCount > 0 ? `<span class="notification-count">${unreadCount} new</span>` : ''} </h6> </div> `; if (notifications.length === 0) { content += ` <div class="notification-empty"> <i class="fas fa-bell-slash"></i> <h6>No Notifications</h6> <p>You're all caught up! New notifications will appear here.</p> </div> `; } else { content += '<div class="notification-body">'; notifications.forEach(notification => { content += ` <div class="notification-item ${notification.unread ? 'unread' : ''}" onclick="markAsRead(${notification.id})"> <div class="notification-icon ${notification.type}"> <i class="${notification.icon}"></i> </div> <div class="notification-content"> <p class="notification-text">${notification.text}</p> <small class="notification-time">${notification.time}</small> </div> </div> `; }); content += '</div>'; } if (notifications.length > 0) { content += ` <div class="notification-footer"> <a href="/notifications">View All Notifications</a> </div> `; } return content; } // Close notification menu function function closeNotificationMenu() { if (notificationMenu) notificationMenu.classList.remove('show'); if (notificationOverlay) notificationOverlay.classList.remove('show'); } // Open notification menu function function openNotificationMenu() { if (typeof closeLoginModal === 'function') { closeLoginModal(); } if (notificationMenu) notificationMenu.classList.add('show'); if (notificationOverlay) notificationOverlay.classList.add('show'); } function initializeNotifications() { // Get DOM elements notificationBtn = document.getElementById('notificationBtn'); notificationMenu = document.getElementById('notificationMenu'); notificationOverlay = document.getElementById('notificationOverlay'); notificationBadge = document.getElementById('notificationBadge'); if (!notificationBtn || !notificationMenu) { console.error('Notification elements not found'); return; } // Populate notification menu notificationMenu.innerHTML = generateNotificationContent(); // Toggle notification dropdown notificationBtn.addEventListener('click', function(e) { e.preventDefault(); e.stopPropagation(); const isOpen = notificationMenu.classList.contains('show'); console.log('Notification button clicked, isOpen:', isOpen); if (isOpen) { closeNotificationMenu(); } else { openNotificationMenu(); } }); // Close notification menu when clicking outside document.addEventListener('click', function(e) { if (!notificationBtn.contains(e.target) && !notificationMenu.contains(e.target)) { closeNotificationMenu(); } }); // Close notification menu when clicking overlay if (notificationOverlay) { notificationOverlay.addEventListener('click', closeNotificationMenu); } // Close notification menu on escape key document.addEventListener('keydown', function(e) { if (e.key === 'Escape') { closeNotificationMenu(); if (typeof closeLoginModal === 'function') { closeLoginModal(); } } }); // Prevent notification menu from closing when clicking inside it notificationMenu.addEventListener('click', function(e) { e.stopPropagation(); }); } // Profile dropdown functionality function initializeProfile() { const profileBtn = document.getElementById('profileBtn'); const profileMenu = document.getElementById('profileMenu'); if (!profileBtn) return; if (!user) { // For unauthenticated users, show login modal profileBtn.addEventListener('click', function(e) { e.stopPropagation(); if (typeof openLoginModal === 'function') { openLoginModal(); } }); } else { // For authenticated users, use hover behavior (handled by CSS) // Additional click handling for mobile profileBtn.addEventListener('click', function(e) { e.stopPropagation(); if (profileMenu) { const isVisible = profileMenu.style.opacity === '1' || window.getComputedStyle(profileMenu).opacity === '1'; if (isVisible) { profileMenu.style.opacity = '0'; profileMenu.style.visibility = 'hidden'; profileMenu.style.transform = 'translateY(10px)'; } else { closeNotificationMenu(); if (typeof closeLoginModal === 'function') { closeLoginModal(); } profileMenu.style.opacity = '1'; profileMenu.style.visibility = 'visible'; profileMenu.style.transform = 'translateY(0)'; } } }); // Close profile menu when clicking outside (mobile) document.addEventListener('click', function(e) { if (window.innerWidth <= 768 && profileMenu && !profileBtn.contains(e.target) && !profileMenu.contains(e.target)) { profileMenu.style.opacity = '0'; profileMenu.style.visibility = 'hidden'; profileMenu.style.transform = 'translateY(10px)'; } }); } } // Login modal functionality function initializeLoginModal() { const loginModalOverlay = document.getElementById('loginModalOverlay'); const loginModal = document.getElementById('loginModal'); const closeLoginBtn = document.getElementById('closeLoginModal'); if (!loginModalOverlay) return; // Only for unauthenticated users // Close login modal window.closeLoginModal = function() { loginModalOverlay.classList.remove('show'); }; // Open login modal window.openLoginModal = function() { closeNotificationMenu(); loginModalOverlay.classList.add('show'); }; // Close button if (closeLoginBtn) { closeLoginBtn.addEventListener('click', window.closeLoginModal); } // Close when clicking overlay loginModalOverlay.addEventListener('click', function(e) { if (e.target === loginModalOverlay) { window.closeLoginModal(); } }); // Prevent modal from closing when clicking inside if (loginModal) { loginModal.addEventListener('click', function(e) { e.stopPropagation(); }); } } // Mark notification as read function markAsRead(notificationId) { if (!user || !sampleNotifications) return; const notification = sampleNotifications.find(n => n.id === notificationId); if (notification && notification.unread) { notification.unread = false; // Update badge count const unreadCount = sampleNotifications.filter(n => n.unread).length; if (notificationBadge) { notificationBadge.textContent = unreadCount; notificationBadge.style.display = unreadCount > 0 ? 'block' : 'none'; } // Refresh notification content if (notificationMenu) { notificationMenu.innerHTML = generateNotificationContent(); } // Send AJAX request to mark notification as read fetch('/notifications/mark-read', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute('content') }, body: JSON.stringify({ notification_id: notificationId }) }) .then(response => response.json()) .then(data => { if (data.success) { console.log('Notification marked as read'); } }) .catch(error => { console.error('Error marking notification as read:', error); // Revert the change if request failed notification.unread = true; const unreadCount = sampleNotifications.filter(n => n.unread).length; if (notificationBadge) { notificationBadge.textContent = unreadCount; notificationBadge.style.display = unreadCount > 0 ? 'block' : 'none'; } if (notificationMenu) { notificationMenu.innerHTML = generateNotificationContent(); } }); } } // Initialize when DOM is loaded document.addEventListener('DOMContentLoaded', function() { console.log('DOM loaded, initializing...'); initializeNotifications(); initializeProfile(); initializeLoginModal(); }); // Function to add new notification (for testing or real-time updates) function addNewNotification(notification) { if (user && sampleNotifications) { sampleNotifications.unshift(notification); // Update badge and content if (notificationBadge) { const unreadCount = sampleNotifications.filter(n => n.unread).length; notificationBadge.textContent = unreadCount; notificationBadge.style.display = unreadCount > 0 ? 'block' : 'none'; } if (notificationMenu) { notificationMenu.innerHTML = generateNotificationContent(); } } } // Function to refresh notifications from server function refreshNotifications() { if (!user) return; fetch('/notifications/get', { method: 'GET', headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute('content') } }) .then(response => response.json()) .then(data => { if (data.success && data.notifications) { // Update notifications array sampleNotifications.length = 0; sampleNotifications.push(...data.notifications); // Update UI if (notificationBadge) { const unreadCount = sampleNotifications.filter(n => n.unread).length; notificationBadge.textContent = unreadCount; notificationBadge.style.display = unreadCount > 0 ? 'block' : 'none'; } if (notificationMenu) { notificationMenu.innerHTML = generateNotificationContent(); } } }) .catch(error => { console.error('Error refreshing notifications:', error); }); } // Auto-refresh notifications every 30 seconds if user is logged in if (user) { setInterval(refreshNotifications, 30000); } window.onload = function() { try { const currentUrl = window.location.href; if (currentUrl === "https://examprev.com/contribute-answer-with-examprev") { const branchSelect = document.getElementById('branchSelect'); const selectedBranch = branchSelect.value; fetchQuestions(selectedBranch); } console.log("Page loaded successfully without errors."); } catch(error) { console.error("An error occurred:", error.message); } const csrfToken = document.querySelector('input[name="_token"]')?.value; if (!csrfToken) { console.error('CSRF token not found'); return; } const currentURL = window.location.href; const formData = new FormData(); // Assuming csrf() is a function that returns the CSRF token. formData.append('currentUrl', currentURL); }; function scrollPagination(direction) { const container = document.getElementById("paginationContainer"); const scrollAmount = 100; // Adjust scroll distance container.scrollBy({ left: direction * scrollAmount, behavior: "smooth" }); } function ensureActivePageVisible() { const container = document.getElementById("paginationContainer"); const activePage = document.querySelector(".custom-pagination-button.active"); if (activePage) { const containerRect = container.getBoundingClientRect(); const activePageRect = activePage.getBoundingClientRect(); // Check if the active page is outside the visible scroll area if (activePageRect.left < containerRect.left || activePageRect.right > containerRect.right) { container.scrollLeft += (activePageRect.left - containerRect.left) - (container.offsetWidth / 2) + (activePage.offsetWidth / 2); } } } // Ensure current page is visible when the page loads document.addEventListener("DOMContentLoaded", ensureActivePageVisible); document.querySelectorAll(".option").forEach(fieldset => { fieldset.addEventListener("click", function () { let questionId = this.getAttribute("data-question-id"); let messageElement = document.getElementById("message-" + questionId); // Prevent multiple attempts per question if (document.querySelector(`[data-question-id='${questionId}'].correct`) || document.querySelector(`[data-question-id='${questionId}'].incorrect`)) { return; } let legend = this.querySelector("legend"); legend.style.visibility = "visible"; legend.style.fontFamily = "'Poppins', sans-serif"; if (this.getAttribute("data-correct") === "true") { this.classList.add("correct"); legend.innerText = "Correct"; legend.classList.add("correct-text"); messageElement.innerText = "Correct! ๐ŸŽ‰"; messageElement.style.color = "green"; } else { this.classList.add("incorrect"); legend.innerText = "Incorrect"; legend.classList.add("incorrect-text"); messageElement.innerText = "Incorrect! โŒ Try again."; messageElement.style.color = "red"; // Highlight correct answers within the same question document.querySelectorAll(`[data-question-id='${questionId}'][data-correct='true']`).forEach(correctOption => { correctOption.classList.add("correct"); let correctLegend = correctOption.querySelector("legend"); correctLegend.style.visibility = "visible"; correctLegend.innerText = "Correct"; correctLegend.classList.add("correct-text"); }); } }); }); (function () { let adsLoaded = false; function loadAdSense() { if (adsLoaded) return; adsLoaded = true; var s = document.createElement("script"); s.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4999327676889242"; s.async = true; s.crossOrigin = "anonymous"; document.head.appendChild(s); } // Load after page is fully loaded + 2 seconds window.addEventListener("load", function () { setTimeout(loadAdSense, 5000); }); })(); (function () { function updateVisitorCount(count) { const el = document.getElementById("visitorCount"); if (!el) return; el.innerHTML = ""; count.toString().split("").forEach(d => { const s = document.createElement("span"); s.className = "digit"; s.textContent = d; el.appendChild(s); }); } function loadVisitorCount() { const csrf = document.querySelector('meta[name="csrf-token"]')?.content || document.querySelector('input[name="_token"]')?.value; if (!csrf) return; const fd = new FormData(); fd.append("currentUrl", location.href); fetch("/getVisitorCount", { method: "POST", headers: { "X-CSRF-TOKEN": csrf }, body: fd, keepalive: true }) .then(r => r.json()) .then(d => d?.count && updateVisitorCount(d.count)) .catch(() => {}); } window.addEventListener("load", () => { setTimeout(loadVisitorCount, 3000); }); })(); </script></html>