Illuminate your career path with Solar Photovoltaic Installation and Maintenance! Intrigued by the power of sunlight to generate clean and renewable electricity? Explore the principles of solar photovoltaic (PV) technology, system design, and installation practices. Our model questions will guide you through the essentials of PV module mounting, electrical wiring, and system troubleshooting. Gain practical skills in assessing site suitability, sizing PV systems, and ensuring safe and efficient operation. Whether you dream of becoming a solar installer, maintenance technician, or renewable energy consultant, there's a world of opportunities waiting for you in this growing field. Let's harness the power of the sun and empower you to shine bright in Solar Photovoltaic Installation and Maintenance!


    
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Essential meta tags for responsive design and cross-browser embedding -->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Allow embedding in LMS pages (Moodle, WordPress LMS, etc.) -->
    <meta http-equiv="X-Frame-Options" content="ALLOWALL" />
    <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' 'unsafe-eval';">
    <title>Combined Quiz Variants</title>
    <style>
        @keyframes gradientBackground {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        @keyframes flashing {
            0% { opacity: 1; }
            50% { opacity: 0.5; }
            100% { opacity: 1; }
        }
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
            background-size: 400% 400%;
            animation: gradientBackground 15s ease infinite;
            margin: 0;
            padding: 0;
            max-width: 100%;
            width: 100%;
            box-sizing: border-box;
        }
        .global-nav {
            text-align: center;
            background-color: #2f3e46;
            padding: 10px;
        }
        .global-nav button {
            padding: 10px 20px;
            margin: 0 5px;
            border: none;
            background-color: #4285F4;
            color: white;
            cursor: pointer;
            border-radius: 4px;
            font-size: 1em;
        }
        .global-nav button:disabled {
            background-color: #aaa;
            cursor: not-allowed;
        }
        .global-nav a {
            padding: 10px 20px;
            margin: 0 5px;
            border: none;
            background-color: #34A853;
            color: white;
            cursor: pointer;
            border-radius: 4px;
            text-decoration: none;
            font-size: 1em;
        }
        /* Unique full-screen frame with glowing border */
        .page {
            display: none;
            padding: 20px;
            margin: 10px;
            background-color: rgba(255, 255, 255, 0.9);
            border: 5px solid #00ffff;
            border-radius: 15px;
            box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
        }
        .instructions {
            text-align: center;
            padding: 15px;
            border: 2px dashed #333;
            margin: 10px;
            background-color: #fff;
            border-radius: 8px;
        }
        h1 {
            font-size: 2em;
            text-align: center;
            color: #fff;
        }
        h2 {
            font-size: 1.75em;
            margin-bottom: 10px;
            color: #333;
        }
        h3 {
            font-size: 1.5em;
        }
        .options label {
            font-size: 1.2em;
            padding: 12px;
        }
        .feedback {
            font-size: 1.3em;
            margin-top: 10px;
            padding: 10px;
            border-radius: 5px;
        }
        .feedback.correct {
            background-color: #d4edda;
        }
        .feedback.incorrect {
            background-color: #f8d7da;
        }
        .feedback.timeout {
            background-color: #fff3cd;
        }
        /* Timer styled as a circular blue frame placed within each question panel */
        .timer {
            font-size: 1.5em;
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background-color: blue;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 10px auto 20px auto;
        }
        .final-message {
            text-align: center;
            padding: 20px;
            margin: 20px;
            border-radius: 10px;
            font-size: 1.3em;
        }
    </style>
</head>
<body>
    <h2>Trivia Quiz</h2>
    
    <div class="instructions" style="margin-bottom: 40px; border-radius: 7px; box-shadow: 11px 15px 14px rgba(0,0,0,0.2); border: 8px ridge khaki;">
      <h2>Trivia Instructions</h2>
      <p>Welcome to our trivia quiz! You will be presented with a series of multiple-choice questions.
         Each question features its own 30-second timer displayed within a circular blue frame.
         The complete question pool is randomized and partitioned into 5 disjoint variants,
         ensuring that questions do not repeat between variants for the same user.
         Enjoy and good luck!</p>
    </div>
    
    <div class="global-nav">
        <button id="prev-variant" disabled>Previous Variant</button>
        <span id="variant-indicator" style="color:#fff; font-size:1.2em;">Variant 1 of 5</span>
        <button id="next-variant" disabled>Next Variant</button>
        <a id="fullscreen-btn" href="#" onclick="toggleFullScreen(); return false;">Full Screen</a>
    </div>
    
    <div class="page" id="page-1" style="display:none;">
      <div id="quiz-container-1" class="quiz-container"></div>
      <div style="text-align: center; margin-top:20px;">
          <button id="next-btn-1" class="next-btn" disabled>Next Trial</button>
      </div>
      <div id="final-message-1" class="final-message" style="display: none;"></div>
      <script>
          (function(){
              const quizData = [
    {
        "title": "Solar Photovoltaic Installation and Maintenance 90",
        "question": "What is \"a solar junction box\"?",
        "options": [
            {
                "text": "A solar junction box is the enclosure on the back of a solar panel where electrical connections are made and protected from environmental damage",
                "feedback": "Correct! Junction boxes provide a secure location for electrical connections.",
                "is_correct": true
            },
            {
                "text": "A solar junction box stores excess energy generated by the solar panels",
                "feedback": "Incorrect. Junction boxes manage connections, not energy storage.",
                "is_correct": false
            },
            {
                "text": "A solar junction box increases the voltage of electricity generated by solar panels",
                "feedback": "Incorrect. Junction boxes protect connections, they do not regulate voltage.",
                "is_correct": false
            },
            {
                "text": "A solar junction box tracks the sun's position to optimize panel output",
                "feedback": "Incorrect. Junction boxes secure connections, they do not track the sun.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 7",
        "question": "Why is tilt angle important in a solar panel installation?",
        "options": [
            {
                "text": "The tilt angle is important because it determines how directly sunlight hits the solar panels, which affects their efficiency and energy production",
                "feedback": "Correct! Optimal tilt angle maximizes sunlight exposure for better energy output.",
                "is_correct": true
            },
            {
                "text": "The tilt angle controls the electrical output of solar panels",
                "feedback": "Incorrect. Tilt angle affects sunlight exposure, not electrical output directly.",
                "is_correct": false
            },
            {
                "text": "The tilt angle is used to adjust the temperature of solar panels",
                "feedback": "Incorrect. The tilt angle is about positioning for sunlight, not temperature control.",
                "is_correct": false
            },
            {
                "text": "The tilt angle controls the voltage of the electricity generated by solar panels",
                "feedback": "Incorrect. The tilt angle affects sunlight exposure, not voltage.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 94",
        "question": "What is \"solar PV system derating\"?",
        "options": [
            {
                "text": "Solar PV system derating refers to the intentional reduction in a system's expected power output to account for real-world conditions like shading, temperature, and efficiency losses",
                "feedback": "Correct! Derating adjusts for conditions that reduce performance.",
                "is_correct": true
            },
            {
                "text": "Solar PV system derating refers to the amount of electricity stored in the batteries",
                "feedback": "Incorrect. Derating adjusts performance expectations, not storage.",
                "is_correct": false
            },
            {
                "text": "Solar PV system derating is the process of cleaning and maintaining the system",
                "feedback": "Incorrect. Derating adjusts for losses in efficiency, not maintenance.",
                "is_correct": false
            },
            {
                "text": "Solar PV system derating refers to the total number of hours a solar system operates each day",
                "feedback": "Incorrect. Derating adjusts for performance under real-world conditions, not operating hours.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 89",
        "question": "What is \"solar power oversupply\"?",
        "options": [
            {
                "text": "Solar power oversupply occurs when the generation of electricity from solar panels exceeds the demand, often leading to curtailment or sending excess energy back to the grid",
                "feedback": "Correct! Oversupply happens when solar production surpasses demand.",
                "is_correct": true
            },
            {
                "text": "Solar power oversupply refers to the total number of hours a solar system operates each day",
                "feedback": "Incorrect. Oversupply is about energy generation exceeding demand, not operating hours.",
                "is_correct": false
            },
            {
                "text": "Solar power oversupply stores excess energy in batteries for later use",
                "feedback": "Incorrect. Oversupply can lead to curtailment or sending energy to the grid, not necessarily storage.",
                "is_correct": false
            },
            {
                "text": "Solar power oversupply increases the efficiency of solar panels during peak sunlight hours",
                "feedback": "Incorrect. Oversupply relates to generation exceeding demand, not efficiency.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 55",
        "question": "What is \"solar panel degradation rate\"?",
        "options": [
            {
                "text": "Solar panel degradation rate refers to the annual reduction in the efficiency of solar panels, typically around 0.5% to 1% per year",
                "feedback": "Correct! Degradation rate measures how much efficiency is lost over time.",
                "is_correct": true
            },
            {
                "text": "Solar panel degradation rate is the amount of sunlight blocked by dust and debris",
                "feedback": "Incorrect. Degradation rate refers to efficiency loss over time, not due to dirt.",
                "is_correct": false
            },
            {
                "text": "Solar panel degradation rate measures the total amount of electricity generated by a panel over its lifetime",
                "feedback": "Incorrect. Degradation rate measures the efficiency loss, not total output.",
                "is_correct": false
            },
            {
                "text": "Solar panel degradation rate is the temperature at which a panel operates most efficiently",
                "feedback": "Incorrect. Degradation rate measures efficiency loss over time, not operating temperature.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 75",
        "question": "What is \"performance ratio\" (PR) in solar PV systems?",
        "options": [
            {
                "text": "Performance ratio (PR) is a measure of the overall efficiency of a solar PV system, accounting for losses in energy generation and conversion",
                "feedback": "Correct! PR measures how efficiently a solar system generates and converts energy.",
                "is_correct": true
            },
            {
                "text": "Performance ratio refers to the total amount of electricity produced by a solar panel",
                "feedback": "Incorrect. PR measures system efficiency, not total production.",
                "is_correct": false
            },
            {
                "text": "Performance ratio is the amount of sunlight received by the solar panels",
                "feedback": "Incorrect. PR accounts for energy losses, not sunlight received.",
                "is_correct": false
            },
            {
                "text": "Performance ratio refers to the storage capacity of the solar PV system",
                "feedback": "Incorrect. PR measures efficiency, not storage.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 66",
        "question": "What is the purpose of a \"solar disconnect switch\"?",
        "options": [
            {
                "text": "A solar disconnect switch allows the solar array or system to be safely disconnected from the electrical system for maintenance or in case of emergencies",
                "feedback": "Correct! The disconnect switch provides a way to safely isolate the solar system.",
                "is_correct": true
            },
            {
                "text": "A solar disconnect switch increases the voltage of the solar panels",
                "feedback": "Incorrect. Disconnect switches isolate the system for safety, they do not affect voltage.",
                "is_correct": false
            },
            {
                "text": "A solar disconnect switch stores excess energy generated by solar panels",
                "feedback": "Incorrect. Disconnect switches are for isolating the system, not storing energy.",
                "is_correct": false
            },
            {
                "text": "A solar disconnect switch monitors the performance of the solar panels",
                "feedback": "Incorrect. Disconnect switches are for safety, not monitoring.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 47",
        "question": "What is \"net energy metering\" (NEM)?",
        "options": [
            {
                "text": "Net energy metering is a billing mechanism that credits solar panel owners for the electricity they add to the grid, allowing them to offset their energy costs",
                "feedback": "Correct! NEM provides credits for excess solar energy sent to the grid.",
                "is_correct": true
            },
            {
                "text": "Net energy metering is the process of measuring the efficiency of a solar panel",
                "feedback": "Incorrect. NEM tracks energy sent to the grid, not efficiency.",
                "is_correct": false
            },
            {
                "text": "Net energy metering stores excess energy in a battery for later use",
                "feedback": "Incorrect. NEM involves sending excess energy to the grid, not storing it.",
                "is_correct": false
            },
            {
                "text": "Net energy metering refers to the total hours a solar panel can operate in a day",
                "feedback": "Incorrect. NEM is about grid credits, not operational hours.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 26",
        "question": "What is \"insolation\" in solar energy?",
        "options": [
            {
                "text": "Insolation refers to the amount of solar radiation received by a specific area over a period of time, usually measured in kilowatt-hours per square meter",
                "feedback": "Correct! Insolation measures solar energy received by a surface.",
                "is_correct": true
            },
            {
                "text": "Insolation is the process of insulating solar panels to prevent overheating",
                "feedback": "Incorrect. Insolation refers to solar radiation, not insulation.",
                "is_correct": false
            },
            {
                "text": "Insolation is the reflection of sunlight off the surface of solar panels",
                "feedback": "Incorrect. Insolation measures sunlight received, not reflected.",
                "is_correct": false
            },
            {
                "text": "Insolation is the amount of energy produced by a solar panel over its lifetime",
                "feedback": "Incorrect. Insolation is about solar radiation, not energy output.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 15",
        "question": "What is \"peak sun hours\" in solar energy?",
        "options": [
            {
                "text": "Peak sun hours refer to the number of hours per day when solar irradiance averages 1,000 watts per square meter, which is the optimal condition for solar panel energy production",
                "feedback": "Correct! Peak sun hours indicate the optimal sunlight conditions for solar energy production.",
                "is_correct": true
            },
            {
                "text": "Peak sun hours refer to the amount of time a solar panel is exposed to direct sunlight",
                "feedback": "Incorrect. Peak sun hours specifically measure the intensity of sunlight.",
                "is_correct": false
            },
            {
                "text": "Peak sun hours refer to the total hours of daylight in a day",
                "feedback": "Incorrect. Peak sun hours measure the intensity of sunlight, not just the hours of daylight.",
                "is_correct": false
            },
            {
                "text": "Peak sun hours refer to the temperature range in which solar panels operate best",
                "feedback": "Incorrect. Peak sun hours are about sunlight intensity, not temperature.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 25",
        "question": "What is the function of a \"solar tracker\"?",
        "options": [
            {
                "text": "A solar tracker moves solar panels to follow the sun's path across the sky, optimizing their angle to maximize energy production throughout the day",
                "feedback": "Correct! Solar trackers adjust the panel's position for better sunlight exposure.",
                "is_correct": true
            },
            {
                "text": "A solar tracker stores energy generated by solar panels",
                "feedback": "Incorrect. Solar trackers adjust panel angles, not store energy.",
                "is_correct": false
            },
            {
                "text": "A solar tracker monitors the performance of the solar panels",
                "feedback": "Incorrect. A solar tracker optimizes sunlight exposure, not performance monitoring.",
                "is_correct": false
            },
            {
                "text": "A solar tracker converts direct current (DC) to alternating current (AC)",
                "feedback": "Incorrect. Solar trackers adjust the angle of the panels, not convert current.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 93",
        "question": "What is \"solar panel degradation\"?",
        "options": [
            {
                "text": "Solar panel degradation refers to the gradual loss of a solar panel's efficiency over time, typically at a rate of about 0.5% to 1% per year",
                "feedback": "Correct! Degradation measures the loss of efficiency in solar panels over time.",
                "is_correct": true
            },
            {
                "text": "Solar panel degradation is the reduction in energy storage capacity in batteries",
                "feedback": "Incorrect. Degradation refers to the panel's efficiency, not battery capacity.",
                "is_correct": false
            },
            {
                "text": "Solar panel degradation is caused by dirt accumulation on the panel surface",
                "feedback": "Incorrect. While dirt affects performance, degradation is a long-term loss in efficiency.",
                "is_correct": false
            },
            {
                "text": "Solar panel degradation occurs when panels are exposed to sunlight for too many hours each day",
                "feedback": "Incorrect. Degradation is about long-term efficiency loss, not exposure time.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 33",
        "question": "What is \"net-zero energy\" in solar energy systems?",
        "options": [
            {
                "text": "A net-zero energy system is one in which the total amount of energy produced by solar panels matches or exceeds the amount of energy consumed by the building over a year",
                "feedback": "Correct! Net-zero means the building produces as much energy as it consumes.",
                "is_correct": true
            },
            {
                "text": "Net-zero energy refers to a system that generates no energy at all",
                "feedback": "Incorrect. Net-zero means generating enough energy to meet consumption needs.",
                "is_correct": false
            },
            {
                "text": "Net-zero energy refers to a system that stores excess solar energy for use at night",
                "feedback": "Incorrect. Net-zero energy refers to matching energy production with consumption, not storage.",
                "is_correct": false
            },
            {
                "text": "Net-zero energy refers to a system that only operates during peak sunlight hours",
                "feedback": "Incorrect. Net-zero energy systems balance energy use over an entire year.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 83",
        "question": "What is \"a solar power optimizer\"?",
        "options": [
            {
                "text": "A solar power optimizer is a device attached to individual solar panels to improve their energy output by tracking the maximum power point of each panel",
                "feedback": "Correct! Power optimizers enhance the output of individual panels.",
                "is_correct": true
            },
            {
                "text": "A solar power optimizer stores excess electricity generated by solar panels",
                "feedback": "Incorrect. Power optimizers increase panel output, they do not store electricity.",
                "is_correct": false
            },
            {
                "text": "A solar power optimizer converts direct current (DC) to alternating current (AC)",
                "feedback": "Incorrect. Inverters handle DC to AC conversion, not power optimizers.",
                "is_correct": false
            },
            {
                "text": "A solar power optimizer monitors the overall performance of a solar system",
                "feedback": "Incorrect. Power optimizers focus on individual panel output, not the entire system.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 74",
        "question": "What is \"solar panel orientation\" in installation?",
        "options": [
            {
                "text": "Solar panel orientation refers to the direction the panels face to maximize exposure to sunlight, usually south-facing in the northern hemisphere",
                "feedback": "Correct! Proper orientation ensures maximum sunlight exposure.",
                "is_correct": true
            },
            {
                "text": "Solar panel orientation is the angle at which the panels are tilted relative to the ground",
                "feedback": "Incorrect. Orientation refers to the direction the panels face, not the tilt angle.",
                "is_correct": false
            },
            {
                "text": "Solar panel orientation refers to the number of hours the panels are exposed to sunlight",
                "feedback": "Incorrect. Orientation is about the direction the panels face, not exposure hours.",
                "is_correct": false
            },
            {
                "text": "Solar panel orientation refers to the tracking system that moves the panels throughout the day",
                "feedback": "Incorrect. Orientation is about the direction the panels are installed, not movement.",
                "is_correct": false
            }
        ],
        "correct": 0
    }
];
              let currentQuestion = 0;
              let score = 0;
              let timerInterval;
              let timeRemaining = 30;
              let variantCompleted = false;
              
              // Starts a 30-second countdown for the given timer element.
              function startTimer(timerEl) {
                  timeRemaining = 30;
                  timerEl.textContent = timeRemaining;
                  // For variant 2, adjust the timer style (e.g. change border color)
                  if (1 === 2) {
                      timerEl.style.border = "3px solid red";
                  }
                  timerInterval = setInterval(() => {
                      timeRemaining--;
                      timerEl.textContent = timeRemaining;
                      if (timeRemaining <= 0) {
                          clearInterval(timerInterval);
                          document.getElementById("next-btn-1").disabled = false;
                          const inputs = document.querySelectorAll("input[name='question-" + currentQuestion + "']");
                          inputs.forEach(input => input.disabled = true);
                          const feedbackDiv = document.querySelector("#quiz-container-1 .feedback");
                          if (feedbackDiv) {
                              feedbackDiv.textContent = "Time's up!";
                              feedbackDiv.className = "feedback timeout";
                              feedbackDiv.style.display = "block";
                          }
                      }
                  }, 1000);
              }
              
              function displayQuestion(index) {
                  clearInterval(timerInterval);
                  const container = document.getElementById("quiz-container-1");
                  container.innerHTML = "";
                  if (index >= quizData.length) {
                      showFinalResults();
                      return;
                  }
                  const q = quizData[index];
                  const questionDiv = document.createElement("div");
                  questionDiv.className = "question-panel";
                  
                  // Create timer element and insert it at the top of the question panel.
                  const timerEl = document.createElement("div");
                  timerEl.className = "timer";
                  questionDiv.appendChild(timerEl);
                  startTimer(timerEl);
                  
                  const questionText = document.createElement("h3");
                  questionText.textContent = (index + 1) + ". " + q.question;
                  questionDiv.appendChild(questionText);
                  
                  // Create fieldset for options.
                  const fieldset = document.createElement("fieldset");
                  fieldset.className = "options-fieldset";
                  fieldset.style.backgroundColor = "#948644";
                  fieldset.style.color = "black";
                  fieldset.style.border = "none";
                  fieldset.style.padding = "10px";
                  
                  const shuffledOptions = q.options.slice().sort(() => Math.random() - 0.5);
                  shuffledOptions.forEach((option, oIndex) => {
                      const optionLabel = document.createElement("label");
                      optionLabel.style.display = "block";
                      const radioInput = document.createElement("input");
                      radioInput.type = "radio";
                      radioInput.name = "question-" + index;
                      radioInput.value = oIndex;
                      radioInput.style.transform = "scale(1.5)";
                      radioInput.style.marginRight = "15px";
                      radioInput.onclick = function() {
                          checkAnswer(index, oIndex, questionDiv, shuffledOptions);
                          document.getElementById("next-btn-1").disabled = false;
                          clearInterval(timerInterval);
                      };
                      optionLabel.appendChild(radioInput);
                      optionLabel.appendChild(document.createTextNode(option.text));
                      fieldset.appendChild(optionLabel);
                  });
                  questionDiv.appendChild(fieldset);
                  
                  const feedbackDiv = document.createElement("div");
                  feedbackDiv.className = "feedback";
                  questionDiv.appendChild(feedbackDiv);
                  
                  container.appendChild(questionDiv);
                  document.getElementById("next-btn-1").disabled = true;
              }
              
              function checkAnswer(questionIndex, selectedOption, questionDiv, shuffledOptions) {
                  const feedbackDiv = questionDiv.querySelector(".feedback");
                  const selected = shuffledOptions[selectedOption];
                  if (selected.is_correct) {
                      feedbackDiv.textContent = selected.feedback || "Correct!";
                      feedbackDiv.className = "feedback correct";
                      score++;
                  } else {
                      feedbackDiv.textContent = selected.feedback || "Incorrect!";
                      feedbackDiv.className = "feedback incorrect";
                  }
                  feedbackDiv.style.display = "block";
                  const inputs = questionDiv.querySelectorAll("input");
                  inputs.forEach(input => input.disabled = true);
              }
              
              function showFinalResults() {
                  clearInterval(timerInterval);
                  const container = document.getElementById("quiz-container-1");
                  container.innerHTML = "";
                  document.getElementById("next-btn-1").style.display = "none";
                  const finalMessageDiv = document.getElementById("final-message-1");
                  const total = quizData.length;
                  const percentage = Math.round((score / total) * 100);
                  let generalFeedback = "";
                  if (percentage < 30) {
                      generalFeedback = "Your score is below 30%. It looks like you need more practice, but don't be discouraged! Enroll in our course to build a strong foundation. Not only will you gain the skills to improve your performance, but you'll also have the opportunity to earn an internationally recognized graded certificate and detailed online report. Plus, our course connects you to a global network of scholarships and grants—imagine the possibility of financial rewards if you top your category!";
                  } else if (percentage < 50) {
                      generalFeedback = "Your score is below 50%, which means there’s significant room for improvement. Consider enrolling in our course to boost your skills and academic confidence. With our comprehensive curriculum, you can work towards an internationally accepted graded certificate, complete with a verifiable online report. Additionally, we offer access to international scholarships, grants, and even financial rewards for exceptional performance.";
                  } else if (percentage < 70) {
                      generalFeedback = "You scored below 70%. With a bit more guidance from our course, you could truly excel! Our program is designed to enhance your academic prowess and help you achieve an internationally recognized graded certificate with a detailed online report. Moreover, by joining, you'll tap into a vast network of resources including scholarships, grants, and the potential for financial rewards if you secure the top position in your category.";;
                  } else if (percentage < 90) {
                      generalFeedback = "Great job! You scored below 90%. You’re almost there—just a little more effort, and you can reach perfection. Our course not only refines your skills but also offers the chance to earn a verifiable, internationally accepted graded certificate and detailed graded report. Plus, you’ll gain access to an international network of scholarships, grants, and financial incentives for top-ranking students.";
                  } else {
                      generalFeedback = "Excellent! You scored above 90%, showcasing near mastery of the subject. For even more advanced insights, consider our premium course. By enrolling, you'll have the opportunity to earn an internationally recognized graded certificate along with a detailed online report. You will also be matched with valuable resources, including scholarships, grants, and the chance to receive financial rewards if you rank 1st in your category.";
                  }
                  finalMessageDiv.innerHTML = `
                      <p>Your Score: <strong>${score}</strong> out of <strong>${total}</strong> (${percentage}%).</p>
                      <p>${generalFeedback}</p>
                      <a id="enroll-btn-1" class="enroll-btn" href="#" onclick="alert('Redirecting to enrollment page...'); return false;">CLICK THE BLUE BUTTON BELOW</a>
                  `;
                  finalMessageDiv.style.display = "block";
                  finalMessageDiv.style.border = "3px solid #ff1493";
                  finalMessageDiv.style.background = "linear-gradient(45deg, #ff9a9e, #fad0c4)";
                  finalMessageDiv.style.animation = "flashing 1s infinite";
                  variantCompleted = true;
                  if (typeof window.setGlobalVariantCompleted === "function") {
                      window.setGlobalVariantCompleted();
                  }
              }
              
              document.getElementById("next-btn-1").onclick = function() {
                  currentQuestion++;
                  displayQuestion(currentQuestion);
              };
              
              window.addEventListener("load", function() {
                  displayQuestion(currentQuestion);
              });
          })();
      </script>
    </div>
    
    <div class="page" id="page-2" style="display:none;">
      <div id="quiz-container-2" class="quiz-container"></div>
      <div style="text-align: center; margin-top:20px;">
          <button id="next-btn-2" class="next-btn" disabled>Next Trial</button>
      </div>
      <div id="final-message-2" class="final-message" style="display: none;"></div>
      <script>
          (function(){
              const quizData = [
    {
        "title": "Solar Photovoltaic Installation and Maintenance 88",
        "question": "What is \"solar array tilt\"?",
        "options": [
            {
                "text": "Solar array tilt is the angle at which a solar array is installed relative to the ground, which affects the amount of sunlight received and the system's energy production",
                "feedback": "Correct! Proper tilt ensures optimal sunlight exposure.",
                "is_correct": true
            },
            {
                "text": "Solar array tilt refers to the direction the panels face to maximize sunlight exposure",
                "feedback": "Incorrect. Tilt is the angle of the panels, not the direction they face.",
                "is_correct": false
            },
            {
                "text": "Solar array tilt is the amount of electricity generated by the solar panels",
                "feedback": "Incorrect. Tilt affects sunlight exposure, not electricity generation.",
                "is_correct": false
            },
            {
                "text": "Solar array tilt refers to the total number of panels in an array",
                "feedback": "Incorrect. Tilt is about panel angle, not the number of panels.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 79",
        "question": "What is \"solar photovoltaic system uptime\"?",
        "options": [
            {
                "text": "Solar photovoltaic system uptime is the percentage of time that a solar system is operational and generating electricity",
                "feedback": "Correct! Uptime measures how long the system is actively generating energy.",
                "is_correct": true
            },
            {
                "text": "Solar photovoltaic system uptime refers to the amount of energy stored in the batteries",
                "feedback": "Incorrect. Uptime measures operational time, not energy storage.",
                "is_correct": false
            },
            {
                "text": "Solar photovoltaic system uptime is the total number of hours solar panels are exposed to sunlight",
                "feedback": "Incorrect. Uptime is about system operation, not sunlight exposure.",
                "is_correct": false
            },
            {
                "text": "Solar photovoltaic system uptime measures the efficiency of solar panels",
                "feedback": "Incorrect. Uptime measures operational time, not panel efficiency.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 41",
        "question": "What is \"solar panel efficiency\"?",
        "options": [
            {
                "text": "Solar panel efficiency refers to the percentage of sunlight that a solar panel can convert into usable electricity",
                "feedback": "Correct! Efficiency measures how much sunlight is converted into electrical energy.",
                "is_correct": true
            },
            {
                "text": "Solar panel efficiency is the amount of electricity a panel can store during the day",
                "feedback": "Incorrect. Efficiency is about energy conversion, not storage.",
                "is_correct": false
            },
            {
                "text": "Solar panel efficiency is the number of hours a panel can operate each day",
                "feedback": "Incorrect. Efficiency refers to energy conversion, not operating hours.",
                "is_correct": false
            },
            {
                "text": "Solar panel efficiency is how well a panel cools itself during operation",
                "feedback": "Incorrect. Efficiency is about electricity generation, not cooling.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 86",
        "question": "What is \"solar power curtailment\" in grid-connected systems?",
        "options": [
            {
                "text": "Solar power curtailment occurs when the output of a solar PV system is reduced or stopped to prevent overloading the grid when energy demand is low",
                "feedback": "Correct! Curtailment reduces output to balance supply with demand.",
                "is_correct": true
            },
            {
                "text": "Solar power curtailment stores excess energy in batteries when the grid is overloaded",
                "feedback": "Incorrect. Curtailment reduces generation, it does not store energy.",
                "is_correct": false
            },
            {
                "text": "Solar power curtailment increases the efficiency of solar panels during peak sunlight hours",
                "feedback": "Incorrect. Curtailment reduces output to balance grid load, not increase efficiency.",
                "is_correct": false
            },
            {
                "text": "Solar power curtailment refers to the total hours a solar system operates each day",
                "feedback": "Incorrect. Curtailment is about reducing output, not operating hours.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 59",
        "question": "What is \"solar panel orientation\"?",
        "options": [
            {
                "text": "Solar panel orientation refers to the direction that solar panels face to maximize exposure to sunlight, usually south in the northern hemisphere",
                "feedback": "Correct! Proper orientation ensures maximum sunlight exposure.",
                "is_correct": true
            },
            {
                "text": "Solar panel orientation refers to the angle at which solar panels are installed",
                "feedback": "Incorrect. Orientation refers to direction, not angle.",
                "is_correct": false
            },
            {
                "text": "Solar panel orientation refers to the efficiency of solar panels under different weather conditions",
                "feedback": "Incorrect. Orientation relates to panel direction, not efficiency under weather conditions.",
                "is_correct": false
            },
            {
                "text": "Solar panel orientation refers to the type of mounting system used for installation",
                "feedback": "Incorrect. Orientation is about panel direction, not the mounting system.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 46",
        "question": "What is the function of a \"solar battery inverter\"?",
        "options": [
            {
                "text": "A solar battery inverter converts the stored direct current (DC) in solar batteries into alternating current (AC) for use in homes and businesses",
                "feedback": "Correct! A battery inverter converts stored DC into usable AC power.",
                "is_correct": true
            },
            {
                "text": "A solar battery inverter stores excess energy generated by the solar panels",
                "feedback": "Incorrect. Inverters convert electricity, they do not store it.",
                "is_correct": false
            },
            {
                "text": "A solar battery inverter increases the voltage of the electricity stored in the battery",
                "feedback": "Incorrect. Inverters convert current types, not voltage levels.",
                "is_correct": false
            },
            {
                "text": "A solar battery inverter tracks the position of the sun to optimize solar panel output",
                "feedback": "Incorrect. Inverters convert electricity, they do not adjust panel angles.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 48",
        "question": "What is \"tiered solar panel pricing\"?",
        "options": [
            {
                "text": "Tiered solar panel pricing refers to a system where solar panel prices vary based on the panel\u2019s efficiency and performance, with higher tiers being more efficient and expensive",
                "feedback": "Correct! Tiered pricing is based on panel performance and efficiency.",
                "is_correct": true
            },
            {
                "text": "Tiered solar panel pricing refers to the amount of electricity stored in the panels",
                "feedback": "Incorrect. Tiered pricing relates to efficiency and cost, not energy storage.",
                "is_correct": false
            },
            {
                "text": "Tiered solar panel pricing refers to the number of panels installed in a system",
                "feedback": "Incorrect. Tiered pricing is about the performance and efficiency of individual panels.",
                "is_correct": false
            },
            {
                "text": "Tiered solar panel pricing refers to the hours a solar panel can operate in a day",
                "feedback": "Incorrect. Pricing is based on efficiency, not operational hours.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 70",
        "question": "What is \"solar net metering\"?",
        "options": [
            {
                "text": "Solar net metering is a billing mechanism that credits solar panel owners for the electricity they send back to the grid, allowing them to offset their utility bills",
                "feedback": "Correct! Net metering compensates solar panel owners for excess energy sent to the grid.",
                "is_correct": true
            },
            {
                "text": "Solar net metering is a system that tracks the amount of electricity stored in batteries",
                "feedback": "Incorrect. Net metering tracks energy sent to the grid, not stored in batteries.",
                "is_correct": false
            },
            {
                "text": "Solar net metering refers to the total amount of electricity generated by solar panels",
                "feedback": "Incorrect. Net metering is about credits for energy sent to the grid, not total generation.",
                "is_correct": false
            },
            {
                "text": "Solar net metering measures the efficiency of solar panels in converting sunlight to electricity",
                "feedback": "Incorrect. Net metering measures energy sent to the grid, not panel efficiency.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 6",
        "question": "What does \"solar irradiance\" refer to in a PV system?",
        "options": [
            {
                "text": "Solar irradiance refers to the amount of solar energy reaching a specific area at a given time, usually measured in watts per square meter",
                "feedback": "Correct! Solar irradiance measures the intensity of sunlight hitting a surface.",
                "is_correct": true
            },
            {
                "text": "Solar irradiance refers to the efficiency of a solar panel",
                "feedback": "Incorrect. Solar irradiance is about sunlight intensity, not panel efficiency.",
                "is_correct": false
            },
            {
                "text": "Solar irradiance is the amount of electricity generated by a solar panel",
                "feedback": "Incorrect. Solar irradiance is about sunlight, not electricity output.",
                "is_correct": false
            },
            {
                "text": "Solar irradiance refers to the temperature of solar panels",
                "feedback": "Incorrect. Solar irradiance measures sunlight energy, not panel temperature.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 28",
        "question": "What is a \"solar inverter\"?",
        "options": [
            {
                "text": "A solar inverter converts the direct current (DC) generated by solar panels into alternating current (AC) for use in homes and businesses",
                "feedback": "Correct! Inverters convert DC from panels to AC for everyday use.",
                "is_correct": true
            },
            {
                "text": "A solar inverter stores excess electricity generated by solar panels",
                "feedback": "Incorrect. Inverters convert electricity, not store it.",
                "is_correct": false
            },
            {
                "text": "A solar inverter increases the power output of solar panels",
                "feedback": "Incorrect. Inverters convert electricity, not increase power output.",
                "is_correct": false
            },
            {
                "text": "A solar inverter controls the angle of the solar panels to maximize sunlight exposure",
                "feedback": "Incorrect. Solar trackers adjust panel angles, not inverters.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 98",
        "question": "What is \"solar power conversion efficiency\"?",
        "options": [
            {
                "text": "Solar power conversion efficiency is the percentage of sunlight that a solar panel can convert into usable electricity",
                "feedback": "Correct! Conversion efficiency measures how well sunlight is converted into electricity.",
                "is_correct": true
            },
            {
                "text": "Solar power conversion efficiency refers to the amount of electricity stored in batteries",
                "feedback": "Incorrect. Conversion efficiency is about energy generation, not storage.",
                "is_correct": false
            },
            {
                "text": "Solar power conversion efficiency is the number of hours a solar panel can operate in a day",
                "feedback": "Incorrect. Conversion efficiency measures how much sunlight is converted into electricity, not operating hours.",
                "is_correct": false
            },
            {
                "text": "Solar power conversion efficiency is the total amount of sunlight received by the solar panels",
                "feedback": "Incorrect. Conversion efficiency measures the conversion of sunlight to electricity, not sunlight received.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 51",
        "question": "What does \"solar insolation\" measure?",
        "options": [
            {
                "text": "Solar insolation measures the amount of solar radiation received by a given area over a period of time, usually expressed in kilowatt-hours per square meter",
                "feedback": "Correct! Insolation quantifies solar energy received in a specific area.",
                "is_correct": true
            },
            {
                "text": "Solar insolation refers to the reflection of sunlight from solar panels",
                "feedback": "Incorrect. Insolation measures sunlight received, not reflected.",
                "is_correct": false
            },
            {
                "text": "Solar insolation refers to the amount of electricity produced by a solar panel",
                "feedback": "Incorrect. Insolation is about sunlight received, not electricity produced.",
                "is_correct": false
            },
            {
                "text": "Solar insolation measures the efficiency of solar panels",
                "feedback": "Incorrect. Insolation is about sunlight, not panel efficiency.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 18",
        "question": "Why is ventilation important for solar panels?",
        "options": [
            {
                "text": "Ventilation is important because it helps to keep the panels cool, preventing overheating, which can reduce their efficiency and lifespan",
                "feedback": "Correct! Proper ventilation prevents overheating and maintains efficiency.",
                "is_correct": true
            },
            {
                "text": "Ventilation is important because it increases the electrical output of solar panels",
                "feedback": "Incorrect. Ventilation prevents overheating but does not directly increase output.",
                "is_correct": false
            },
            {
                "text": "Ventilation is important because it helps store energy more efficiently",
                "feedback": "Incorrect. Ventilation helps keep the panels cool, not store energy.",
                "is_correct": false
            },
            {
                "text": "Ventilation is important because it reduces the glare from solar panels",
                "feedback": "Incorrect. Ventilation is about cooling the panels, not reducing glare.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 61",
        "question": "What is \"solar irradiance\"?",
        "options": [
            {
                "text": "Solar irradiance is the power per unit area produced by the sun's rays hitting a surface, typically measured in watts per square meter (W/m\u00b2)",
                "feedback": "Correct! Solar irradiance measures the intensity of sunlight received by a surface.",
                "is_correct": true
            },
            {
                "text": "Solar irradiance is the amount of sunlight reflected by solar panels",
                "feedback": "Incorrect. Solar irradiance is the sunlight hitting the surface, not reflected.",
                "is_correct": false
            },
            {
                "text": "Solar irradiance refers to the temperature of a solar panel",
                "feedback": "Incorrect. Solar irradiance measures the power of sunlight, not the temperature of the panel.",
                "is_correct": false
            },
            {
                "text": "Solar irradiance is the amount of electricity generated by a solar panel",
                "feedback": "Incorrect. Solar irradiance is the measure of sunlight, not electricity generation.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 69",
        "question": "What is \"tilt angle\" in solar panel installation?",
        "options": [
            {
                "text": "Tilt angle refers to the angle at which a solar panel is positioned relative to the ground to maximize its exposure to sunlight",
                "feedback": "Correct! Proper tilt angle ensures optimal sunlight exposure for better energy generation.",
                "is_correct": true
            },
            {
                "text": "Tilt angle refers to the direction a solar panel faces",
                "feedback": "Incorrect. Tilt angle is about positioning relative to the ground, not direction.",
                "is_correct": false
            },
            {
                "text": "Tilt angle is the angle at which the sun hits the solar panel during the day",
                "feedback": "Incorrect. Tilt angle is the fixed position of the panel, not the sun's position.",
                "is_correct": false
            },
            {
                "text": "Tilt angle refers to the number of hours a solar panel operates in a day",
                "feedback": "Incorrect. Tilt angle is about panel positioning, not operating hours.",
                "is_correct": false
            }
        ],
        "correct": 0
    }
];
              let currentQuestion = 0;
              let score = 0;
              let timerInterval;
              let timeRemaining = 30;
              let variantCompleted = false;
              
              // Starts a 30-second countdown for the given timer element.
              function startTimer(timerEl) {
                  timeRemaining = 30;
                  timerEl.textContent = timeRemaining;
                  // For variant 2, adjust the timer style (e.g. change border color)
                  if (2 === 2) {
                      timerEl.style.border = "3px solid red";
                  }
                  timerInterval = setInterval(() => {
                      timeRemaining--;
                      timerEl.textContent = timeRemaining;
                      if (timeRemaining <= 0) {
                          clearInterval(timerInterval);
                          document.getElementById("next-btn-2").disabled = false;
                          const inputs = document.querySelectorAll("input[name='question-" + currentQuestion + "']");
                          inputs.forEach(input => input.disabled = true);
                          const feedbackDiv = document.querySelector("#quiz-container-2 .feedback");
                          if (feedbackDiv) {
                              feedbackDiv.textContent = "Time's up!";
                              feedbackDiv.className = "feedback timeout";
                              feedbackDiv.style.display = "block";
                          }
                      }
                  }, 1000);
              }
              
              function displayQuestion(index) {
                  clearInterval(timerInterval);
                  const container = document.getElementById("quiz-container-2");
                  container.innerHTML = "";
                  if (index >= quizData.length) {
                      showFinalResults();
                      return;
                  }
                  const q = quizData[index];
                  const questionDiv = document.createElement("div");
                  questionDiv.className = "question-panel";
                  
                  // Create timer element and insert it at the top of the question panel.
                  const timerEl = document.createElement("div");
                  timerEl.className = "timer";
                  questionDiv.appendChild(timerEl);
                  startTimer(timerEl);
                  
                  const questionText = document.createElement("h3");
                  questionText.textContent = (index + 1) + ". " + q.question;
                  questionDiv.appendChild(questionText);
                  
                  // Create fieldset for options.
                  const fieldset = document.createElement("fieldset");
                  fieldset.className = "options-fieldset";
                  fieldset.style.backgroundColor = "#948644";
                  fieldset.style.color = "black";
                  fieldset.style.border = "none";
                  fieldset.style.padding = "10px";
                  
                  const shuffledOptions = q.options.slice().sort(() => Math.random() - 0.5);
                  shuffledOptions.forEach((option, oIndex) => {
                      const optionLabel = document.createElement("label");
                      optionLabel.style.display = "block";
                      const radioInput = document.createElement("input");
                      radioInput.type = "radio";
                      radioInput.name = "question-" + index;
                      radioInput.value = oIndex;
                      radioInput.style.transform = "scale(1.5)";
                      radioInput.style.marginRight = "15px";
                      radioInput.onclick = function() {
                          checkAnswer(index, oIndex, questionDiv, shuffledOptions);
                          document.getElementById("next-btn-2").disabled = false;
                          clearInterval(timerInterval);
                      };
                      optionLabel.appendChild(radioInput);
                      optionLabel.appendChild(document.createTextNode(option.text));
                      fieldset.appendChild(optionLabel);
                  });
                  questionDiv.appendChild(fieldset);
                  
                  const feedbackDiv = document.createElement("div");
                  feedbackDiv.className = "feedback";
                  questionDiv.appendChild(feedbackDiv);
                  
                  container.appendChild(questionDiv);
                  document.getElementById("next-btn-2").disabled = true;
              }
              
              function checkAnswer(questionIndex, selectedOption, questionDiv, shuffledOptions) {
                  const feedbackDiv = questionDiv.querySelector(".feedback");
                  const selected = shuffledOptions[selectedOption];
                  if (selected.is_correct) {
                      feedbackDiv.textContent = selected.feedback || "Correct!";
                      feedbackDiv.className = "feedback correct";
                      score++;
                  } else {
                      feedbackDiv.textContent = selected.feedback || "Incorrect!";
                      feedbackDiv.className = "feedback incorrect";
                  }
                  feedbackDiv.style.display = "block";
                  const inputs = questionDiv.querySelectorAll("input");
                  inputs.forEach(input => input.disabled = true);
              }
              
              function showFinalResults() {
                  clearInterval(timerInterval);
                  const container = document.getElementById("quiz-container-2");
                  container.innerHTML = "";
                  document.getElementById("next-btn-2").style.display = "none";
                  const finalMessageDiv = document.getElementById("final-message-2");
                  const total = quizData.length;
                  const percentage = Math.round((score / total) * 100);
                  let generalFeedback = "";
                  if (percentage < 30) {
                      generalFeedback = "Your score is below 30%. It looks like you need more practice, but don't be discouraged! Enroll in our course to build a strong foundation. Not only will you gain the skills to improve your performance, but you'll also have the opportunity to earn an internationally recognized graded certificate and detailed online report. Plus, our course connects you to a global network of scholarships and grants—imagine the possibility of financial rewards if you top your category!";
                  } else if (percentage < 50) {
                      generalFeedback = "Your score is below 50%, which means there’s significant room for improvement. Consider enrolling in our course to boost your skills and academic confidence. With our comprehensive curriculum, you can work towards an internationally accepted graded certificate, complete with a verifiable online report. Additionally, we offer access to international scholarships, grants, and even financial rewards for exceptional performance.";
                  } else if (percentage < 70) {
                      generalFeedback = "You scored below 70%. With a bit more guidance from our course, you could truly excel! Our program is designed to enhance your academic prowess and help you achieve an internationally recognized graded certificate with a detailed online report. Moreover, by joining, you'll tap into a vast network of resources including scholarships, grants, and the potential for financial rewards if you secure the top position in your category.";;
                  } else if (percentage < 90) {
                      generalFeedback = "Great job! You scored below 90%. You’re almost there—just a little more effort, and you can reach perfection. Our course not only refines your skills but also offers the chance to earn a verifiable, internationally accepted graded certificate and detailed graded report. Plus, you’ll gain access to an international network of scholarships, grants, and financial incentives for top-ranking students.";
                  } else {
                      generalFeedback = "Excellent! You scored above 90%, showcasing near mastery of the subject. For even more advanced insights, consider our premium course. By enrolling, you'll have the opportunity to earn an internationally recognized graded certificate along with a detailed online report. You will also be matched with valuable resources, including scholarships, grants, and the chance to receive financial rewards if you rank 1st in your category.";
                  }
                  finalMessageDiv.innerHTML = `
                      <p>Your Score: <strong>${score}</strong> out of <strong>${total}</strong> (${percentage}%).</p>
                      <p>${generalFeedback}</p>
                      <a id="enroll-btn-2" class="enroll-btn" href="#" onclick="alert('Redirecting to enrollment page...'); return false;">CLICK THE BLUE BUTTON BELOW</a>
                  `;
                  finalMessageDiv.style.display = "block";
                  finalMessageDiv.style.border = "3px solid #ff1493";
                  finalMessageDiv.style.background = "linear-gradient(45deg, #ff9a9e, #fad0c4)";
                  finalMessageDiv.style.animation = "flashing 1s infinite";
                  variantCompleted = true;
                  if (typeof window.setGlobalVariantCompleted === "function") {
                      window.setGlobalVariantCompleted();
                  }
              }
              
              document.getElementById("next-btn-2").onclick = function() {
                  currentQuestion++;
                  displayQuestion(currentQuestion);
              };
              
              window.addEventListener("load", function() {
                  displayQuestion(currentQuestion);
              });
          })();
      </script>
    </div>
    
    <div class="page" id="page-3" style="display:none;">
      <div id="quiz-container-3" class="quiz-container"></div>
      <div style="text-align: center; margin-top:20px;">
          <button id="next-btn-3" class="next-btn" disabled>Next Trial</button>
      </div>
      <div id="final-message-3" class="final-message" style="display: none;"></div>
      <script>
          (function(){
              const quizData = [
    {
        "title": "Solar Photovoltaic Installation and Maintenance 81",
        "question": "What is \"solar panel derating\"?",
        "options": [
            {
                "text": "Solar panel derating refers to the intentional reduction in a panel's power output to account for real-world conditions like temperature, shading, or dust",
                "feedback": "Correct! Derating adjusts for factors that reduce a panel's actual performance.",
                "is_correct": true
            },
            {
                "text": "Solar panel derating is the process of removing dust from the panel surface",
                "feedback": "Incorrect. Derating accounts for performance losses, it does not clean the panels.",
                "is_correct": false
            },
            {
                "text": "Solar panel derating refers to the total amount of electricity stored by the panels",
                "feedback": "Incorrect. Derating adjusts performance expectations, not storage.",
                "is_correct": false
            },
            {
                "text": "Solar panel derating is the amount of energy a panel produces at maximum efficiency",
                "feedback": "Incorrect. Derating adjusts for real-world conditions, not maximum efficiency.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 9",
        "question": "What is \"net metering\" in solar photovoltaic systems?",
        "options": [
            {
                "text": "Net metering is a billing system where excess electricity generated by solar panels is sent to the grid, and the homeowner receives credits or payments in return",
                "feedback": "Correct! Net metering compensates solar panel owners for sending excess electricity back to the grid.",
                "is_correct": true
            },
            {
                "text": "Net metering is a system that stores excess electricity in batteries",
                "feedback": "Incorrect. Net metering involves sending electricity to the grid, not storing it.",
                "is_correct": false
            },
            {
                "text": "Net metering measures the efficiency of solar panels",
                "feedback": "Incorrect. Net metering tracks electricity sent to the grid, not panel efficiency.",
                "is_correct": false
            },
            {
                "text": "Net metering refers to the installation of solar panels on a roof",
                "feedback": "Incorrect. Net metering is about grid interactions, not installation.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 57",
        "question": "What does \"solar PV system uptime\" refer to?",
        "options": [
            {
                "text": "Solar PV system uptime refers to the amount of time the solar system is operational and producing electricity",
                "feedback": "Correct! Uptime measures how long the system is running and generating energy.",
                "is_correct": true
            },
            {
                "text": "Solar PV system uptime is the amount of energy stored in the batteries",
                "feedback": "Incorrect. Uptime measures operational time, not stored energy.",
                "is_correct": false
            },
            {
                "text": "Solar PV system uptime is the number of hours a solar panel is exposed to direct sunlight",
                "feedback": "Incorrect. Uptime is about operational time, not sunlight exposure.",
                "is_correct": false
            },
            {
                "text": "Solar PV system uptime is the total amount of electricity generated by the system",
                "feedback": "Incorrect. Uptime measures operational time, not total electricity.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 13",
        "question": "What is the purpose of a solar array combiner box?",
        "options": [
            {
                "text": "A solar array combiner box combines the output of multiple solar panels and provides overcurrent protection before the electricity is sent to the inverter",
                "feedback": "Correct! The combiner box protects and organizes solar panel outputs.",
                "is_correct": true
            },
            {
                "text": "A solar array combiner box stores excess electricity generated by solar panels",
                "feedback": "Incorrect. A combiner box combines panel outputs and provides protection, not storage.",
                "is_correct": false
            },
            {
                "text": "A solar array combiner box converts direct current (DC) to alternating current (AC)",
                "feedback": "Incorrect. Inverters, not combiner boxes, perform DC to AC conversion.",
                "is_correct": false
            },
            {
                "text": "A solar array combiner box monitors the efficiency of solar panels",
                "feedback": "Incorrect. Combiner boxes combine and protect outputs, not monitor efficiency.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 21",
        "question": "What is \"solar panel degradation\"?",
        "options": [
            {
                "text": "Solar panel degradation refers to the gradual reduction in the efficiency and power output of a solar panel over time, typically around 0.5% to 1% per year",
                "feedback": "Correct! Solar panels lose efficiency slowly over their lifespan.",
                "is_correct": true
            },
            {
                "text": "Solar panel degradation is the process of overheating solar panels due to excessive sunlight exposure",
                "feedback": "Incorrect. Degradation is a natural efficiency loss over time, not just due to overheating.",
                "is_correct": false
            },
            {
                "text": "Solar panel degradation is the buildup of dust and dirt on the panel surface",
                "feedback": "Incorrect. Degradation refers to reduced efficiency over time, not dirt accumulation.",
                "is_correct": false
            },
            {
                "text": "Solar panel degradation is the breakdown of the mounting system over time",
                "feedback": "Incorrect. Degradation refers to the performance of the solar cells, not the mounting system.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 56",
        "question": "What is \"a solar power purchase agreement\" (PPA)?",
        "options": [
            {
                "text": "A solar power purchase agreement (PPA) is a financial agreement where a third-party company owns, operates, and maintains the solar panels, and the customer purchases the energy generated at a set rate",
                "feedback": "Correct! PPAs allow customers to buy solar energy without owning the panels.",
                "is_correct": true
            },
            {
                "text": "A solar power purchase agreement is a lease agreement for solar panels",
                "feedback": "Incorrect. PPAs are for purchasing energy, not leasing panels.",
                "is_correct": false
            },
            {
                "text": "A solar power purchase agreement refers to buying solar panels outright",
                "feedback": "Incorrect. PPAs involve buying the energy generated, not the panels themselves.",
                "is_correct": false
            },
            {
                "text": "A solar power purchase agreement is an agreement between two utilities to share solar energy",
                "feedback": "Incorrect. PPAs are agreements between a customer and a third-party solar provider.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 91",
        "question": "What is \"solar PV system maintenance\"?",
        "options": [
            {
                "text": "Solar PV system maintenance includes cleaning panels, inspecting connections, checking inverters, and ensuring the overall system is functioning efficiently",
                "feedback": "Correct! Maintenance helps ensure the system continues operating efficiently.",
                "is_correct": true
            },
            {
                "text": "Solar PV system maintenance refers to upgrading the system to increase its energy output",
                "feedback": "Incorrect. Maintenance keeps the system running properly, not upgrading it.",
                "is_correct": false
            },
            {
                "text": "Solar PV system maintenance includes tracking the sun's movement to adjust panel alignment",
                "feedback": "Incorrect. Maintenance involves system care, not sun tracking.",
                "is_correct": false
            },
            {
                "text": "Solar PV system maintenance stores excess energy generated by solar panels",
                "feedback": "Incorrect. Maintenance focuses on system upkeep, not energy storage.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 68",
        "question": "What is \"solar PV system degradation\"?",
        "options": [
            {
                "text": "Solar PV system degradation refers to the gradual reduction in the system's efficiency and power output over time, typically around 0.5% to 1% per year",
                "feedback": "Correct! Degradation measures the slow loss of efficiency over time.",
                "is_correct": true
            },
            {
                "text": "Solar PV system degradation is the buildup of dirt and debris on the panels",
                "feedback": "Incorrect. Degradation is about long-term performance loss, not dirt accumulation.",
                "is_correct": false
            },
            {
                "text": "Solar PV system degradation is the malfunction of the inverter over time",
                "feedback": "Incorrect. Degradation refers to the system's power output, not inverter malfunctions.",
                "is_correct": false
            },
            {
                "text": "Solar PV system degradation refers to the aging of the solar panel mounting system",
                "feedback": "Incorrect. Degradation is about the system's power output, not physical mounting systems.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 27",
        "question": "What is the role of \"solar cables\" in a PV system?",
        "options": [
            {
                "text": "Solar cables connect the solar panels to the inverter and other components, carrying the electricity generated by the panels",
                "feedback": "Correct! Solar cables carry electricity from the panels to the system's components.",
                "is_correct": true
            },
            {
                "text": "Solar cables are used to store electricity generated by solar panels",
                "feedback": "Incorrect. Solar cables transport electricity, they do not store it.",
                "is_correct": false
            },
            {
                "text": "Solar cables are used to monitor the efficiency of solar panels",
                "feedback": "Incorrect. Solar cables carry electricity, they do not monitor efficiency.",
                "is_correct": false
            },
            {
                "text": "Solar cables are used to reflect sunlight onto solar panels to increase efficiency",
                "feedback": "Incorrect. Solar cables transport electricity, not reflect sunlight.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 99",
        "question": "What is \"a solar power inverter\"?",
        "options": [
            {
                "text": "A solar power inverter converts direct current (DC) generated by solar panels into alternating current (AC) for use in homes and businesses",
                "feedback": "Correct! Inverters convert DC from panels to AC for use in appliances.",
                "is_correct": true
            },
            {
                "text": "A solar power inverter stores excess electricity generated by solar panels",
                "feedback": "Incorrect. Inverters convert electricity but do not store it.",
                "is_correct": false
            },
            {
                "text": "A solar power inverter monitors the performance of the solar panels",
                "feedback": "Incorrect. Inverters convert electricity but do not monitor performance.",
                "is_correct": false
            },
            {
                "text": "A solar power inverter tracks the position of the sun to optimize panel output",
                "feedback": "Incorrect. Inverters convert electricity but do not track the sun.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 8",
        "question": "What is the function of a solar battery in a photovoltaic system?",
        "options": [
            {
                "text": "A solar battery stores excess electricity generated by solar panels for use during periods when the sun is not shining, such as at night",
                "feedback": "Correct! Solar batteries store energy for later use.",
                "is_correct": true
            },
            {
                "text": "A solar battery converts direct current (DC) to alternating current (AC)",
                "feedback": "Incorrect. Inverters, not batteries, convert DC to AC.",
                "is_correct": false
            },
            {
                "text": "A solar battery increases the efficiency of solar panels",
                "feedback": "Incorrect. Solar batteries store energy, they do not affect panel efficiency.",
                "is_correct": false
            },
            {
                "text": "A solar battery monitors the performance of solar panels",
                "feedback": "Incorrect. Batteries store energy, they do not monitor panel performance.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 96",
        "question": "What is \"a solar tracking inverter\"?",
        "options": [
            {
                "text": "A solar tracking inverter adjusts the voltage and current from the solar panels to ensure they are operating at their maximum power point",
                "feedback": "Correct! Tracking inverters optimize power output from the panels.",
                "is_correct": true
            },
            {
                "text": "A solar tracking inverter stores energy generated by solar panels",
                "feedback": "Incorrect. Tracking inverters optimize output but do not store energy.",
                "is_correct": false
            },
            {
                "text": "A solar tracking inverter converts direct current (DC) to alternating current (AC)",
                "feedback": "Incorrect. Tracking inverters adjust voltage and current, but regular inverters handle DC to AC conversion.",
                "is_correct": false
            },
            {
                "text": "A solar tracking inverter monitors the sun's movement to adjust panel angles",
                "feedback": "Incorrect. Tracking inverters optimize output, not panel alignment.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 23",
        "question": "What is the role of \"bypass diodes\" in solar panels?",
        "options": [
            {
                "text": "Bypass diodes allow current to flow around shaded or malfunctioning cells, preventing the entire panel from losing output",
                "feedback": "Correct! Bypass diodes help maintain power output in partially shaded conditions.",
                "is_correct": true
            },
            {
                "text": "Bypass diodes store energy for later use",
                "feedback": "Incorrect. Bypass diodes allow current to bypass shaded cells, not store energy.",
                "is_correct": false
            },
            {
                "text": "Bypass diodes convert DC to AC power",
                "feedback": "Incorrect. Bypass diodes prevent current loss, while inverters convert DC to AC.",
                "is_correct": false
            },
            {
                "text": "Bypass diodes track the position of the sun to optimize panel output",
                "feedback": "Incorrect. Bypass diodes manage current flow, not sun tracking.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 73",
        "question": "What does \"photovoltaic\" mean in solar technology?",
        "options": [
            {
                "text": "Photovoltaic refers to the process of converting sunlight directly into electricity using semiconductor materials",
                "feedback": "Correct! The photovoltaic effect allows sunlight to be converted into electricity.",
                "is_correct": true
            },
            {
                "text": "Photovoltaic refers to the storage of electricity generated by solar panels",
                "feedback": "Incorrect. Photovoltaic systems generate electricity, not store it.",
                "is_correct": false
            },
            {
                "text": "Photovoltaic refers to the heating of water using solar energy",
                "feedback": "Incorrect. Photovoltaic refers to electricity generation, not heating.",
                "is_correct": false
            },
            {
                "text": "Photovoltaic refers to reflecting sunlight to increase the efficiency of solar panels",
                "feedback": "Incorrect. Photovoltaic systems convert sunlight into electricity, not reflect it.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 38",
        "question": "What is the purpose of a \"solar junction box\"?",
        "options": [
            {
                "text": "A solar junction box is where electrical connections are made for the solar panel, providing a secure location for wiring and protecting it from environmental factors",
                "feedback": "Correct! The junction box secures and protects electrical connections on a solar panel.",
                "is_correct": true
            },
            {
                "text": "A solar junction box stores excess electricity generated by the solar panels",
                "feedback": "Incorrect. The junction box manages connections, not energy storage.",
                "is_correct": false
            },
            {
                "text": "A solar junction box converts direct current (DC) to alternating current (AC)",
                "feedback": "Incorrect. Inverters, not junction boxes, convert DC to AC.",
                "is_correct": false
            },
            {
                "text": "A solar junction box adjusts the angle of the solar panels to optimize sunlight exposure",
                "feedback": "Incorrect. Junction boxes protect wiring, they do not adjust panel angles.",
                "is_correct": false
            }
        ],
        "correct": 0
    }
];
              let currentQuestion = 0;
              let score = 0;
              let timerInterval;
              let timeRemaining = 30;
              let variantCompleted = false;
              
              // Starts a 30-second countdown for the given timer element.
              function startTimer(timerEl) {
                  timeRemaining = 30;
                  timerEl.textContent = timeRemaining;
                  // For variant 2, adjust the timer style (e.g. change border color)
                  if (3 === 2) {
                      timerEl.style.border = "3px solid red";
                  }
                  timerInterval = setInterval(() => {
                      timeRemaining--;
                      timerEl.textContent = timeRemaining;
                      if (timeRemaining <= 0) {
                          clearInterval(timerInterval);
                          document.getElementById("next-btn-3").disabled = false;
                          const inputs = document.querySelectorAll("input[name='question-" + currentQuestion + "']");
                          inputs.forEach(input => input.disabled = true);
                          const feedbackDiv = document.querySelector("#quiz-container-3 .feedback");
                          if (feedbackDiv) {
                              feedbackDiv.textContent = "Time's up!";
                              feedbackDiv.className = "feedback timeout";
                              feedbackDiv.style.display = "block";
                          }
                      }
                  }, 1000);
              }
              
              function displayQuestion(index) {
                  clearInterval(timerInterval);
                  const container = document.getElementById("quiz-container-3");
                  container.innerHTML = "";
                  if (index >= quizData.length) {
                      showFinalResults();
                      return;
                  }
                  const q = quizData[index];
                  const questionDiv = document.createElement("div");
                  questionDiv.className = "question-panel";
                  
                  // Create timer element and insert it at the top of the question panel.
                  const timerEl = document.createElement("div");
                  timerEl.className = "timer";
                  questionDiv.appendChild(timerEl);
                  startTimer(timerEl);
                  
                  const questionText = document.createElement("h3");
                  questionText.textContent = (index + 1) + ". " + q.question;
                  questionDiv.appendChild(questionText);
                  
                  // Create fieldset for options.
                  const fieldset = document.createElement("fieldset");
                  fieldset.className = "options-fieldset";
                  fieldset.style.backgroundColor = "#948644";
                  fieldset.style.color = "black";
                  fieldset.style.border = "none";
                  fieldset.style.padding = "10px";
                  
                  const shuffledOptions = q.options.slice().sort(() => Math.random() - 0.5);
                  shuffledOptions.forEach((option, oIndex) => {
                      const optionLabel = document.createElement("label");
                      optionLabel.style.display = "block";
                      const radioInput = document.createElement("input");
                      radioInput.type = "radio";
                      radioInput.name = "question-" + index;
                      radioInput.value = oIndex;
                      radioInput.style.transform = "scale(1.5)";
                      radioInput.style.marginRight = "15px";
                      radioInput.onclick = function() {
                          checkAnswer(index, oIndex, questionDiv, shuffledOptions);
                          document.getElementById("next-btn-3").disabled = false;
                          clearInterval(timerInterval);
                      };
                      optionLabel.appendChild(radioInput);
                      optionLabel.appendChild(document.createTextNode(option.text));
                      fieldset.appendChild(optionLabel);
                  });
                  questionDiv.appendChild(fieldset);
                  
                  const feedbackDiv = document.createElement("div");
                  feedbackDiv.className = "feedback";
                  questionDiv.appendChild(feedbackDiv);
                  
                  container.appendChild(questionDiv);
                  document.getElementById("next-btn-3").disabled = true;
              }
              
              function checkAnswer(questionIndex, selectedOption, questionDiv, shuffledOptions) {
                  const feedbackDiv = questionDiv.querySelector(".feedback");
                  const selected = shuffledOptions[selectedOption];
                  if (selected.is_correct) {
                      feedbackDiv.textContent = selected.feedback || "Correct!";
                      feedbackDiv.className = "feedback correct";
                      score++;
                  } else {
                      feedbackDiv.textContent = selected.feedback || "Incorrect!";
                      feedbackDiv.className = "feedback incorrect";
                  }
                  feedbackDiv.style.display = "block";
                  const inputs = questionDiv.querySelectorAll("input");
                  inputs.forEach(input => input.disabled = true);
              }
              
              function showFinalResults() {
                  clearInterval(timerInterval);
                  const container = document.getElementById("quiz-container-3");
                  container.innerHTML = "";
                  document.getElementById("next-btn-3").style.display = "none";
                  const finalMessageDiv = document.getElementById("final-message-3");
                  const total = quizData.length;
                  const percentage = Math.round((score / total) * 100);
                  let generalFeedback = "";
                  if (percentage < 30) {
                      generalFeedback = "Your score is below 30%. It looks like you need more practice, but don't be discouraged! Enroll in our course to build a strong foundation. Not only will you gain the skills to improve your performance, but you'll also have the opportunity to earn an internationally recognized graded certificate and detailed online report. Plus, our course connects you to a global network of scholarships and grants—imagine the possibility of financial rewards if you top your category!";
                  } else if (percentage < 50) {
                      generalFeedback = "Your score is below 50%, which means there’s significant room for improvement. Consider enrolling in our course to boost your skills and academic confidence. With our comprehensive curriculum, you can work towards an internationally accepted graded certificate, complete with a verifiable online report. Additionally, we offer access to international scholarships, grants, and even financial rewards for exceptional performance.";
                  } else if (percentage < 70) {
                      generalFeedback = "You scored below 70%. With a bit more guidance from our course, you could truly excel! Our program is designed to enhance your academic prowess and help you achieve an internationally recognized graded certificate with a detailed online report. Moreover, by joining, you'll tap into a vast network of resources including scholarships, grants, and the potential for financial rewards if you secure the top position in your category.";;
                  } else if (percentage < 90) {
                      generalFeedback = "Great job! You scored below 90%. You’re almost there—just a little more effort, and you can reach perfection. Our course not only refines your skills but also offers the chance to earn a verifiable, internationally accepted graded certificate and detailed graded report. Plus, you’ll gain access to an international network of scholarships, grants, and financial incentives for top-ranking students.";
                  } else {
                      generalFeedback = "Excellent! You scored above 90%, showcasing near mastery of the subject. For even more advanced insights, consider our premium course. By enrolling, you'll have the opportunity to earn an internationally recognized graded certificate along with a detailed online report. You will also be matched with valuable resources, including scholarships, grants, and the chance to receive financial rewards if you rank 1st in your category.";
                  }
                  finalMessageDiv.innerHTML = `
                      <p>Your Score: <strong>${score}</strong> out of <strong>${total}</strong> (${percentage}%).</p>
                      <p>${generalFeedback}</p>
                      <a id="enroll-btn-3" class="enroll-btn" href="#" onclick="alert('Redirecting to enrollment page...'); return false;">CLICK THE BLUE BUTTON BELOW</a>
                  `;
                  finalMessageDiv.style.display = "block";
                  finalMessageDiv.style.border = "3px solid #ff1493";
                  finalMessageDiv.style.background = "linear-gradient(45deg, #ff9a9e, #fad0c4)";
                  finalMessageDiv.style.animation = "flashing 1s infinite";
                  variantCompleted = true;
                  if (typeof window.setGlobalVariantCompleted === "function") {
                      window.setGlobalVariantCompleted();
                  }
              }
              
              document.getElementById("next-btn-3").onclick = function() {
                  currentQuestion++;
                  displayQuestion(currentQuestion);
              };
              
              window.addEventListener("load", function() {
                  displayQuestion(currentQuestion);
              });
          })();
      </script>
    </div>
    
    <div class="page" id="page-4" style="display:none;">
      <div id="quiz-container-4" class="quiz-container"></div>
      <div style="text-align: center; margin-top:20px;">
          <button id="next-btn-4" class="next-btn" disabled>Next Trial</button>
      </div>
      <div id="final-message-4" class="final-message" style="display: none;"></div>
      <script>
          (function(){
              const quizData = [
    {
        "title": "Solar Photovoltaic Installation and Maintenance 2",
        "question": "What is the function of an inverter in a solar photovoltaic system?",
        "options": [
            {
                "text": "An inverter converts the direct current (DC) electricity generated by solar panels into alternating current (AC) electricity used by most electrical devices",
                "feedback": "Correct! The inverter converts DC to AC for use in homes and businesses.",
                "is_correct": true
            },
            {
                "text": "An inverter stores excess electricity generated by solar panels",
                "feedback": "Incorrect. Inverters convert electricity, not store it.",
                "is_correct": false
            },
            {
                "text": "An inverter increases the voltage of electricity generated by solar panels",
                "feedback": "Incorrect. An inverter converts current types, not voltage levels.",
                "is_correct": false
            },
            {
                "text": "An inverter reflects sunlight onto solar panels to increase efficiency",
                "feedback": "Incorrect. Inverters convert electricity, not reflect sunlight.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 19",
        "question": "What is the purpose of grounding in a solar photovoltaic system?",
        "options": [
            {
                "text": "Grounding provides a safe path for electrical currents in the event of a fault, protecting the system and preventing electrical shocks",
                "feedback": "Correct! Grounding enhances safety by providing a path for excess electricity.",
                "is_correct": true
            },
            {
                "text": "Grounding helps improve the efficiency of solar panels",
                "feedback": "Incorrect. Grounding is for safety, not efficiency.",
                "is_correct": false
            },
            {
                "text": "Grounding stores excess electricity in a safe location",
                "feedback": "Incorrect. Grounding protects the system from electrical faults, it does not store electricity.",
                "is_correct": false
            },
            {
                "text": "Grounding prevents shading on solar panels",
                "feedback": "Incorrect. Grounding is about electrical safety, not shading.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 62",
        "question": "What is \"net energy balance\" in solar systems?",
        "options": [
            {
                "text": "Net energy balance refers to the difference between the energy produced by solar panels and the energy consumed by a building over a given time period",
                "feedback": "Correct! Net energy balance measures the difference between energy produced and consumed.",
                "is_correct": true
            },
            {
                "text": "Net energy balance is the total amount of electricity stored in batteries",
                "feedback": "Incorrect. Net energy balance is about the difference between production and consumption, not storage.",
                "is_correct": false
            },
            {
                "text": "Net energy balance is the number of hours solar panels operate in a day",
                "feedback": "Incorrect. Net energy balance is about energy production versus consumption, not operating hours.",
                "is_correct": false
            },
            {
                "text": "Net energy balance refers to the temperature at which solar panels produce the most electricity",
                "feedback": "Incorrect. Net energy balance is about energy, not temperature.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 31",
        "question": "What is a \"solar power optimizer\"?",
        "options": [
            {
                "text": "A solar power optimizer is a device installed on solar panels to increase their energy output by tracking the maximum power point of each panel and reducing the effects of shading",
                "feedback": "Correct! Power optimizers help increase the efficiency of individual panels.",
                "is_correct": true
            },
            {
                "text": "A solar power optimizer stores excess electricity generated by solar panels",
                "feedback": "Incorrect. Power optimizers enhance panel output, they do not store electricity.",
                "is_correct": false
            },
            {
                "text": "A solar power optimizer monitors the performance of the entire solar system",
                "feedback": "Incorrect. Power optimizers focus on maximizing the output of each panel.",
                "is_correct": false
            },
            {
                "text": "A solar power optimizer converts direct current (DC) to alternating current (AC)",
                "feedback": "Incorrect. Inverters handle DC to AC conversion, not power optimizers.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 64",
        "question": "What does \"solar PV system yield\" mean?",
        "options": [
            {
                "text": "Solar PV system yield refers to the total amount of electricity generated by a solar PV system over a given period of time, typically measured in kilowatt-hours (kWh)",
                "feedback": "Correct! System yield measures the total electricity produced over time.",
                "is_correct": true
            },
            {
                "text": "Solar PV system yield is the efficiency of a solar panel in converting sunlight to electricity",
                "feedback": "Incorrect. Yield measures total electricity output, not efficiency.",
                "is_correct": false
            },
            {
                "text": "Solar PV system yield refers to the energy stored in batteries",
                "feedback": "Incorrect. Yield measures energy production, not storage.",
                "is_correct": false
            },
            {
                "text": "Solar PV system yield refers to the amount of sunlight received by the solar panels",
                "feedback": "Incorrect. Yield measures electricity produced, not sunlight received.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 77",
        "question": "What is \"solar grid-tied inverter\"?",
        "options": [
            {
                "text": "A solar grid-tied inverter converts the direct current (DC) generated by solar panels into alternating current (AC) and synchronizes with the grid for use in homes and businesses",
                "feedback": "Correct! Grid-tied inverters convert and synchronize energy with the grid.",
                "is_correct": true
            },
            {
                "text": "A solar grid-tied inverter stores excess electricity generated by solar panels",
                "feedback": "Incorrect. Grid-tied inverters convert and synchronize energy but do not store it.",
                "is_correct": false
            },
            {
                "text": "A solar grid-tied inverter increases the efficiency of solar panels",
                "feedback": "Incorrect. Grid-tied inverters convert electricity but do not affect panel efficiency.",
                "is_correct": false
            },
            {
                "text": "A solar grid-tied inverter tracks the sun's position to optimize panel output",
                "feedback": "Incorrect. Grid-tied inverters convert electricity, they do not track the sun.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 37",
        "question": "What is \"a hybrid solar PV system\"?",
        "options": [
            {
                "text": "A hybrid solar PV system combines solar panels with battery storage and grid connection, allowing the system to use solar energy, store excess energy, and draw from the grid if needed",
                "feedback": "Correct! Hybrid systems use both solar power and the grid, with battery backup.",
                "is_correct": true
            },
            {
                "text": "A hybrid solar PV system operates independently of the electrical grid",
                "feedback": "Incorrect. Hybrid systems are connected to the grid, unlike off-grid systems.",
                "is_correct": false
            },
            {
                "text": "A hybrid solar PV system only uses solar energy and cannot store excess energy",
                "feedback": "Incorrect. Hybrid systems can store energy in batteries.",
                "is_correct": false
            },
            {
                "text": "A hybrid solar PV system increases the efficiency of solar panels",
                "feedback": "Incorrect. Hybrid systems provide energy flexibility, not necessarily increase efficiency.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 82",
        "question": "What is \"a solar array combiner\"?",
        "options": [
            {
                "text": "A solar array combiner consolidates the electrical output of multiple solar panels into a single output that is sent to the inverter",
                "feedback": "Correct! The combiner combines power from multiple panels for further processing.",
                "is_correct": true
            },
            {
                "text": "A solar array combiner stores excess electricity generated by solar panels",
                "feedback": "Incorrect. Combiners combine outputs but do not store electricity.",
                "is_correct": false
            },
            {
                "text": "A solar array combiner increases the efficiency of solar panels",
                "feedback": "Incorrect. Combiners combine output but do not affect efficiency.",
                "is_correct": false
            },
            {
                "text": "A solar array combiner tracks the position of the sun to optimize panel output",
                "feedback": "Incorrect. Combiners handle electrical output, not sun tracking.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 92",
        "question": "What is \"a solar energy storage system\"?",
        "options": [
            {
                "text": "A solar energy storage system stores excess electricity generated by solar panels in batteries for use when sunlight is unavailable",
                "feedback": "Correct! Storage systems hold energy for later use.",
                "is_correct": true
            },
            {
                "text": "A solar energy storage system increases the efficiency of solar panels",
                "feedback": "Incorrect. Storage systems hold energy but do not affect panel efficiency.",
                "is_correct": false
            },
            {
                "text": "A solar energy storage system converts direct current (DC) to alternating current (AC)",
                "feedback": "Incorrect. Inverters handle DC to AC conversion, not storage systems.",
                "is_correct": false
            },
            {
                "text": "A solar energy storage system tracks the sun's position to optimize energy generation",
                "feedback": "Incorrect. Storage systems store energy, they do not track the sun.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 54",
        "question": "What is \"an energy storage system\" in a solar PV setup?",
        "options": [
            {
                "text": "An energy storage system stores excess electricity generated by solar panels for use when the sun is not shining, typically in batteries",
                "feedback": "Correct! Energy storage systems store electricity for later use.",
                "is_correct": true
            },
            {
                "text": "An energy storage system converts direct current (DC) to alternating current (AC)",
                "feedback": "Incorrect. Inverters convert DC to AC, not storage systems.",
                "is_correct": false
            },
            {
                "text": "An energy storage system increases the efficiency of solar panels",
                "feedback": "Incorrect. Storage systems hold energy but do not affect panel efficiency.",
                "is_correct": false
            },
            {
                "text": "An energy storage system tracks the movement of the sun",
                "feedback": "Incorrect. Storage systems store energy but do not track the sun.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 71",
        "question": "What is \"solar power degradation\"?",
        "options": [
            {
                "text": "Solar power degradation refers to the gradual reduction in a solar panel's ability to generate electricity over time, typically at a rate of 0.5% to 1% per year",
                "feedback": "Correct! Degradation reduces the panel's efficiency over its lifespan.",
                "is_correct": true
            },
            {
                "text": "Solar power degradation is the result of a solar panel overheating during operation",
                "feedback": "Incorrect. Degradation occurs naturally over time, not specifically from overheating.",
                "is_correct": false
            },
            {
                "text": "Solar power degradation refers to the amount of energy a solar panel stores",
                "feedback": "Incorrect. Degradation affects the panel's ability to generate electricity, not store it.",
                "is_correct": false
            },
            {
                "text": "Solar power degradation is the buildup of dust on the surface of the panel",
                "feedback": "Incorrect. Dust may reduce performance temporarily, but degradation is about long-term efficiency loss.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 76",
        "question": "What is \"peak sun hours\"?",
        "options": [
            {
                "text": "Peak sun hours are the number of hours per day when solar irradiance averages 1,000 watts per square meter, which is considered optimal for solar energy production",
                "feedback": "Correct! Peak sun hours represent the time when sunlight is strong enough for optimal energy generation.",
                "is_correct": true
            },
            {
                "text": "Peak sun hours refer to the total hours of daylight in a day",
                "feedback": "Incorrect. Peak sun hours measure sunlight intensity, not total daylight.",
                "is_correct": false
            },
            {
                "text": "Peak sun hours refer to the amount of energy stored in solar batteries",
                "feedback": "Incorrect. Peak sun hours measure sunlight intensity, not energy storage.",
                "is_correct": false
            },
            {
                "text": "Peak sun hours refer to the amount of electricity generated by solar panels",
                "feedback": "Incorrect. Peak sun hours represent sunlight intensity, not electricity generated.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 100",
        "question": "What is \"solar photovoltaic system degradation\"?",
        "options": [
            {
                "text": "Solar photovoltaic system degradation refers to the gradual reduction in system efficiency and power output over time due to factors like aging and environmental conditions",
                "feedback": "Correct! Degradation measures long-term performance loss in a solar system.",
                "is_correct": true
            },
            {
                "text": "Solar photovoltaic system degradation is caused by dirt accumulation on the panels",
                "feedback": "Incorrect. Degradation refers to long-term efficiency loss, not temporary issues like dirt.",
                "is_correct": false
            },
            {
                "text": "Solar photovoltaic system degradation is the process of reducing the energy stored in batteries",
                "feedback": "Incorrect. Degradation is about the efficiency of the panels and system, not batteries.",
                "is_correct": false
            },
            {
                "text": "Solar photovoltaic system degradation refers to the number of hours a solar system can operate each day",
                "feedback": "Incorrect. Degradation is about long-term efficiency loss, not daily operating hours.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 10",
        "question": "What is the primary advantage of using monocrystalline solar panels?",
        "options": [
            {
                "text": "Monocrystalline solar panels are known for their high efficiency and longer lifespan compared to other types of solar panels",
                "feedback": "Correct! Monocrystalline panels are more efficient and durable.",
                "is_correct": true
            },
            {
                "text": "Monocrystalline solar panels are the cheapest type of solar panels available",
                "feedback": "Incorrect. Monocrystalline panels are typically more expensive, but more efficient.",
                "is_correct": false
            },
            {
                "text": "Monocrystalline solar panels require less sunlight to generate electricity",
                "feedback": "Incorrect. All solar panels require sunlight, but monocrystalline panels are more efficient at converting it.",
                "is_correct": false
            },
            {
                "text": "Monocrystalline solar panels are easier to install than other types",
                "feedback": "Incorrect. The installation process is similar for all panel types, but monocrystalline panels are more efficient.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 60",
        "question": "What is \"solar panel tilt angle\"?",
        "options": [
            {
                "text": "Solar panel tilt angle refers to the angle at which solar panels are installed relative to the ground, which affects how much sunlight the panels receive and their overall efficiency",
                "feedback": "Correct! Tilt angle optimizes sunlight exposure and affects energy output.",
                "is_correct": true
            },
            {
                "text": "Solar panel tilt angle refers to the type of solar panel used in the installation",
                "feedback": "Incorrect. Tilt angle relates to the position of the panel, not the type of panel.",
                "is_correct": false
            },
            {
                "text": "Solar panel tilt angle refers to the temperature at which a solar panel operates most efficiently",
                "feedback": "Incorrect. Tilt angle optimizes sunlight exposure, not temperature.",
                "is_correct": false
            },
            {
                "text": "Solar panel tilt angle is the amount of energy a solar panel can store during the day",
                "feedback": "Incorrect. Tilt angle affects sunlight exposure and energy generation, not storage.",
                "is_correct": false
            }
        ],
        "correct": 0
    }
];
              let currentQuestion = 0;
              let score = 0;
              let timerInterval;
              let timeRemaining = 30;
              let variantCompleted = false;
              
              // Starts a 30-second countdown for the given timer element.
              function startTimer(timerEl) {
                  timeRemaining = 30;
                  timerEl.textContent = timeRemaining;
                  // For variant 2, adjust the timer style (e.g. change border color)
                  if (4 === 2) {
                      timerEl.style.border = "3px solid red";
                  }
                  timerInterval = setInterval(() => {
                      timeRemaining--;
                      timerEl.textContent = timeRemaining;
                      if (timeRemaining <= 0) {
                          clearInterval(timerInterval);
                          document.getElementById("next-btn-4").disabled = false;
                          const inputs = document.querySelectorAll("input[name='question-" + currentQuestion + "']");
                          inputs.forEach(input => input.disabled = true);
                          const feedbackDiv = document.querySelector("#quiz-container-4 .feedback");
                          if (feedbackDiv) {
                              feedbackDiv.textContent = "Time's up!";
                              feedbackDiv.className = "feedback timeout";
                              feedbackDiv.style.display = "block";
                          }
                      }
                  }, 1000);
              }
              
              function displayQuestion(index) {
                  clearInterval(timerInterval);
                  const container = document.getElementById("quiz-container-4");
                  container.innerHTML = "";
                  if (index >= quizData.length) {
                      showFinalResults();
                      return;
                  }
                  const q = quizData[index];
                  const questionDiv = document.createElement("div");
                  questionDiv.className = "question-panel";
                  
                  // Create timer element and insert it at the top of the question panel.
                  const timerEl = document.createElement("div");
                  timerEl.className = "timer";
                  questionDiv.appendChild(timerEl);
                  startTimer(timerEl);
                  
                  const questionText = document.createElement("h3");
                  questionText.textContent = (index + 1) + ". " + q.question;
                  questionDiv.appendChild(questionText);
                  
                  // Create fieldset for options.
                  const fieldset = document.createElement("fieldset");
                  fieldset.className = "options-fieldset";
                  fieldset.style.backgroundColor = "#948644";
                  fieldset.style.color = "black";
                  fieldset.style.border = "none";
                  fieldset.style.padding = "10px";
                  
                  const shuffledOptions = q.options.slice().sort(() => Math.random() - 0.5);
                  shuffledOptions.forEach((option, oIndex) => {
                      const optionLabel = document.createElement("label");
                      optionLabel.style.display = "block";
                      const radioInput = document.createElement("input");
                      radioInput.type = "radio";
                      radioInput.name = "question-" + index;
                      radioInput.value = oIndex;
                      radioInput.style.transform = "scale(1.5)";
                      radioInput.style.marginRight = "15px";
                      radioInput.onclick = function() {
                          checkAnswer(index, oIndex, questionDiv, shuffledOptions);
                          document.getElementById("next-btn-4").disabled = false;
                          clearInterval(timerInterval);
                      };
                      optionLabel.appendChild(radioInput);
                      optionLabel.appendChild(document.createTextNode(option.text));
                      fieldset.appendChild(optionLabel);
                  });
                  questionDiv.appendChild(fieldset);
                  
                  const feedbackDiv = document.createElement("div");
                  feedbackDiv.className = "feedback";
                  questionDiv.appendChild(feedbackDiv);
                  
                  container.appendChild(questionDiv);
                  document.getElementById("next-btn-4").disabled = true;
              }
              
              function checkAnswer(questionIndex, selectedOption, questionDiv, shuffledOptions) {
                  const feedbackDiv = questionDiv.querySelector(".feedback");
                  const selected = shuffledOptions[selectedOption];
                  if (selected.is_correct) {
                      feedbackDiv.textContent = selected.feedback || "Correct!";
                      feedbackDiv.className = "feedback correct";
                      score++;
                  } else {
                      feedbackDiv.textContent = selected.feedback || "Incorrect!";
                      feedbackDiv.className = "feedback incorrect";
                  }
                  feedbackDiv.style.display = "block";
                  const inputs = questionDiv.querySelectorAll("input");
                  inputs.forEach(input => input.disabled = true);
              }
              
              function showFinalResults() {
                  clearInterval(timerInterval);
                  const container = document.getElementById("quiz-container-4");
                  container.innerHTML = "";
                  document.getElementById("next-btn-4").style.display = "none";
                  const finalMessageDiv = document.getElementById("final-message-4");
                  const total = quizData.length;
                  const percentage = Math.round((score / total) * 100);
                  let generalFeedback = "";
                  if (percentage < 30) {
                      generalFeedback = "Your score is below 30%. It looks like you need more practice, but don't be discouraged! Enroll in our course to build a strong foundation. Not only will you gain the skills to improve your performance, but you'll also have the opportunity to earn an internationally recognized graded certificate and detailed online report. Plus, our course connects you to a global network of scholarships and grants—imagine the possibility of financial rewards if you top your category!";
                  } else if (percentage < 50) {
                      generalFeedback = "Your score is below 50%, which means there’s significant room for improvement. Consider enrolling in our course to boost your skills and academic confidence. With our comprehensive curriculum, you can work towards an internationally accepted graded certificate, complete with a verifiable online report. Additionally, we offer access to international scholarships, grants, and even financial rewards for exceptional performance.";
                  } else if (percentage < 70) {
                      generalFeedback = "You scored below 70%. With a bit more guidance from our course, you could truly excel! Our program is designed to enhance your academic prowess and help you achieve an internationally recognized graded certificate with a detailed online report. Moreover, by joining, you'll tap into a vast network of resources including scholarships, grants, and the potential for financial rewards if you secure the top position in your category.";;
                  } else if (percentage < 90) {
                      generalFeedback = "Great job! You scored below 90%. You’re almost there—just a little more effort, and you can reach perfection. Our course not only refines your skills but also offers the chance to earn a verifiable, internationally accepted graded certificate and detailed graded report. Plus, you’ll gain access to an international network of scholarships, grants, and financial incentives for top-ranking students.";
                  } else {
                      generalFeedback = "Excellent! You scored above 90%, showcasing near mastery of the subject. For even more advanced insights, consider our premium course. By enrolling, you'll have the opportunity to earn an internationally recognized graded certificate along with a detailed online report. You will also be matched with valuable resources, including scholarships, grants, and the chance to receive financial rewards if you rank 1st in your category.";
                  }
                  finalMessageDiv.innerHTML = `
                      <p>Your Score: <strong>${score}</strong> out of <strong>${total}</strong> (${percentage}%).</p>
                      <p>${generalFeedback}</p>
                      <a id="enroll-btn-4" class="enroll-btn" href="#" onclick="alert('Redirecting to enrollment page...'); return false;">CLICK THE BLUE BUTTON BELOW</a>
                  `;
                  finalMessageDiv.style.display = "block";
                  finalMessageDiv.style.border = "3px solid #ff1493";
                  finalMessageDiv.style.background = "linear-gradient(45deg, #ff9a9e, #fad0c4)";
                  finalMessageDiv.style.animation = "flashing 1s infinite";
                  variantCompleted = true;
                  if (typeof window.setGlobalVariantCompleted === "function") {
                      window.setGlobalVariantCompleted();
                  }
              }
              
              document.getElementById("next-btn-4").onclick = function() {
                  currentQuestion++;
                  displayQuestion(currentQuestion);
              };
              
              window.addEventListener("load", function() {
                  displayQuestion(currentQuestion);
              });
          })();
      </script>
    </div>
    
    <div class="page" id="page-5" style="display:none;">
      <div id="quiz-container-5" class="quiz-container"></div>
      <div style="text-align: center; margin-top:20px;">
          <button id="next-btn-5" class="next-btn" disabled>Next Trial</button>
      </div>
      <div id="final-message-5" class="final-message" style="display: none;"></div>
      <script>
          (function(){
              const quizData = [
    {
        "title": "Solar Photovoltaic Installation and Maintenance 40",
        "question": "What are \"peak power conditions\" for a solar panel?",
        "options": [
            {
                "text": "Peak power conditions occur when a solar panel operates at its maximum efficiency, typically during periods of strong sunlight with optimal panel alignment and temperature",
                "feedback": "Correct! Peak power occurs when the panel is most efficient, usually with clear skies and proper tilt.",
                "is_correct": true
            },
            {
                "text": "Peak power conditions refer to the number of hours a solar panel can operate per day",
                "feedback": "Incorrect. Peak power refers to maximum efficiency, not operating hours.",
                "is_correct": false
            },
            {
                "text": "Peak power conditions refer to the temperature at which solar panels generate the most electricity",
                "feedback": "Incorrect. While temperature affects efficiency, peak power depends on sunlight and alignment.",
                "is_correct": false
            },
            {
                "text": "Peak power conditions refer to the amount of electricity a panel stores during the day",
                "feedback": "Incorrect. Peak power measures efficiency, not storage capacity.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 22",
        "question": "What is \"polycrystalline\" solar panel technology?",
        "options": [
            {
                "text": "Polycrystalline solar panels are made from silicon crystals that are melted and poured into a mold, resulting in less efficiency but lower cost than monocrystalline panels",
                "feedback": "Correct! Polycrystalline panels are less efficient but more affordable.",
                "is_correct": true
            },
            {
                "text": "Polycrystalline solar panels are more efficient than monocrystalline panels",
                "feedback": "Incorrect. Polycrystalline panels are generally less efficient.",
                "is_correct": false
            },
            {
                "text": "Polycrystalline solar panels are used to store solar energy",
                "feedback": "Incorrect. Polycrystalline panels generate electricity, not store it.",
                "is_correct": false
            },
            {
                "text": "Polycrystalline solar panels capture sunlight from both sides of the panel",
                "feedback": "Incorrect. That describes bifacial panels, not polycrystalline.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 43",
        "question": "What is the purpose of a \"solar combiner box\"?",
        "options": [
            {
                "text": "A solar combiner box combines the output of multiple solar panels into one output, which is then sent to the inverter for further processing",
                "feedback": "Correct! The combiner box consolidates power from several panels into a single output.",
                "is_correct": true
            },
            {
                "text": "A solar combiner box stores excess electricity for later use",
                "feedback": "Incorrect. Combiner boxes combine electrical output, they do not store electricity.",
                "is_correct": false
            },
            {
                "text": "A solar combiner box increases the efficiency of solar panels",
                "feedback": "Incorrect. Combiner boxes consolidate power, they do not increase efficiency.",
                "is_correct": false
            },
            {
                "text": "A solar combiner box tracks the position of the sun for optimal panel alignment",
                "feedback": "Incorrect. Combiner boxes are for electrical connection, not sun tracking.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 35",
        "question": "What are the environmental benefits of solar PV systems?",
        "options": [
            {
                "text": "Solar PV systems reduce greenhouse gas emissions by generating electricity without burning fossil fuels, making them a clean and renewable energy source",
                "feedback": "Correct! Solar panels produce clean energy, reducing reliance on fossil fuels.",
                "is_correct": true
            },
            {
                "text": "Solar PV systems generate electricity more efficiently than wind or hydro power",
                "feedback": "Incorrect. Solar energy is a clean energy source, but efficiency comparisons vary by location and technology.",
                "is_correct": false
            },
            {
                "text": "Solar PV systems increase the use of fossil fuels in energy production",
                "feedback": "Incorrect. Solar energy reduces reliance on fossil fuels, not increases it.",
                "is_correct": false
            },
            {
                "text": "Solar PV systems create harmful emissions when generating electricity",
                "feedback": "Incorrect. Solar energy is emission-free during electricity generation.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 11",
        "question": "What does \"PV system efficiency\" refer to?",
        "options": [
            {
                "text": "PV system efficiency refers to the ratio of the electrical energy output from the solar panels to the solar energy input from the sun",
                "feedback": "Correct! Efficiency measures how much solar energy is converted into electricity.",
                "is_correct": true
            },
            {
                "text": "PV system efficiency is the ability of a solar panel to store energy",
                "feedback": "Incorrect. Efficiency refers to energy conversion, not storage.",
                "is_correct": false
            },
            {
                "text": "PV system efficiency is the amount of electricity generated by a solar panel over its lifetime",
                "feedback": "Incorrect. Efficiency is about the conversion rate, not the lifetime output.",
                "is_correct": false
            },
            {
                "text": "PV system efficiency is the number of solar panels needed to power a home",
                "feedback": "Incorrect. Efficiency is about energy conversion, not the number of panels required.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 97",
        "question": "What is \"solar PV system uptime\"?",
        "options": [
            {
                "text": "Solar PV system uptime refers to the percentage of time the system is operational and generating electricity",
                "feedback": "Correct! Uptime measures how long the system is active and producing energy.",
                "is_correct": true
            },
            {
                "text": "Solar PV system uptime is the total amount of electricity generated by the system",
                "feedback": "Incorrect. Uptime is about operational time, not total generation.",
                "is_correct": false
            },
            {
                "text": "Solar PV system uptime refers to the hours of sunlight the system receives each day",
                "feedback": "Incorrect. Uptime is about system operation, not sunlight hours.",
                "is_correct": false
            },
            {
                "text": "Solar PV system uptime is the number of hours the system can store energy in batteries",
                "feedback": "Incorrect. Uptime measures operational time, not storage capacity.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 45",
        "question": "What does \"short circuit current\" (Isc) refer to in a solar panel?",
        "options": [
            {
                "text": "Short circuit current (Isc) is the maximum current a solar panel can produce when its output terminals are shorted, meaning there is no resistance",
                "feedback": "Correct! Isc measures the maximum current produced by a solar panel without resistance.",
                "is_correct": true
            },
            {
                "text": "Short circuit current refers to the current produced under normal operating conditions",
                "feedback": "Incorrect. Isc is the current when there is no resistance, not normal operation.",
                "is_correct": false
            },
            {
                "text": "Short circuit current refers to the amount of electricity stored in a solar battery",
                "feedback": "Incorrect. Isc measures the current a panel produces, not stored electricity.",
                "is_correct": false
            },
            {
                "text": "Short circuit current refers to the current produced after the inverter has converted the electricity",
                "feedback": "Incorrect. Isc is measured before conversion and in the absence of resistance.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 5",
        "question": "What is the photovoltaic effect?",
        "options": [
            {
                "text": "The photovoltaic effect is the process by which a material converts sunlight directly into electricity at the atomic level",
                "feedback": "Correct! The photovoltaic effect is the key principle behind solar energy generation.",
                "is_correct": true
            },
            {
                "text": "The photovoltaic effect is the process of storing sunlight in solar batteries",
                "feedback": "Incorrect. The photovoltaic effect generates electricity, not stores sunlight.",
                "is_correct": false
            },
            {
                "text": "The photovoltaic effect is the process of heating water using solar energy",
                "feedback": "Incorrect. The photovoltaic effect generates electricity, not heat.",
                "is_correct": false
            },
            {
                "text": "The photovoltaic effect is the reflection of sunlight off solar panels to increase efficiency",
                "feedback": "Incorrect. The photovoltaic effect is about electricity generation, not reflection.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 20",
        "question": "What is the function of diodes in a solar panel?",
        "options": [
            {
                "text": "Diodes prevent reverse current from flowing through the solar panel, protecting it from damage and improving performance in low-light conditions",
                "feedback": "Correct! Diodes protect the panel from reverse current, especially in low-light situations.",
                "is_correct": true
            },
            {
                "text": "Diodes store excess electricity generated by the solar panel",
                "feedback": "Incorrect. Diodes prevent reverse current, they do not store electricity.",
                "is_correct": false
            },
            {
                "text": "Diodes convert direct current (DC) to alternating current (AC)",
                "feedback": "Incorrect. Inverters convert DC to AC, not diodes.",
                "is_correct": false
            },
            {
                "text": "Diodes are used to track the position of the sun",
                "feedback": "Incorrect. Diodes prevent reverse current, they do not track the sun.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 49",
        "question": "What is \"a string inverter\"?",
        "options": [
            {
                "text": "A string inverter is a type of inverter that converts the direct current (DC) from a series of solar panels, called a string, into alternating current (AC) for use in homes and businesses",
                "feedback": "Correct! String inverters convert DC to AC from multiple panels in a series.",
                "is_correct": true
            },
            {
                "text": "A string inverter stores excess energy generated by solar panels",
                "feedback": "Incorrect. String inverters convert electricity, they do not store it.",
                "is_correct": false
            },
            {
                "text": "A string inverter increases the efficiency of solar panels",
                "feedback": "Incorrect. String inverters convert electricity but do not directly increase panel efficiency.",
                "is_correct": false
            },
            {
                "text": "A string inverter tracks the position of the sun to optimize solar panel output",
                "feedback": "Incorrect. String inverters convert current, they do not track the sun.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 53",
        "question": "What is the function of a \"solar array\"?",
        "options": [
            {
                "text": "A solar array is a collection of multiple solar panels connected together to increase the total amount of electricity generated",
                "feedback": "Correct! A solar array increases electricity generation by connecting multiple panels.",
                "is_correct": true
            },
            {
                "text": "A solar array stores electricity generated by solar panels",
                "feedback": "Incorrect. Solar arrays generate electricity but do not store it.",
                "is_correct": false
            },
            {
                "text": "A solar array monitors the performance of solar panels",
                "feedback": "Incorrect. Solar arrays generate electricity, not monitor performance.",
                "is_correct": false
            },
            {
                "text": "A solar array tracks the movement of the sun to optimize panel output",
                "feedback": "Incorrect. Solar arrays generate electricity but do not track the sun.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 78",
        "question": "What is \"solar power curtailment\"?",
        "options": [
            {
                "text": "Solar power curtailment occurs when the generation of solar power is reduced or stopped to prevent overloading the electrical grid or when demand is low",
                "feedback": "Correct! Curtailment reduces power output to balance the grid supply.",
                "is_correct": true
            },
            {
                "text": "Solar power curtailment refers to the total amount of electricity generated by a solar system",
                "feedback": "Incorrect. Curtailment refers to reducing output, not total generation.",
                "is_correct": false
            },
            {
                "text": "Solar power curtailment is the process of storing excess solar energy in batteries",
                "feedback": "Incorrect. Curtailment is about reducing generation, not storing energy.",
                "is_correct": false
            },
            {
                "text": "Solar power curtailment refers to the hours when solar panels are exposed to sunlight",
                "feedback": "Incorrect. Curtailment refers to reducing power output, not sunlight exposure.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 29",
        "question": "What is the function of \"PV modules\" in a solar system?",
        "options": [
            {
                "text": "PV modules, also known as solar panels, are composed of multiple photovoltaic cells that generate electricity when exposed to sunlight",
                "feedback": "Correct! PV modules generate electricity by converting sunlight.",
                "is_correct": true
            },
            {
                "text": "PV modules store electricity generated by the solar panels",
                "feedback": "Incorrect. PV modules generate electricity but do not store it.",
                "is_correct": false
            },
            {
                "text": "PV modules are used to track the movement of the sun",
                "feedback": "Incorrect. PV modules generate electricity, they do not track the sun.",
                "is_correct": false
            },
            {
                "text": "PV modules increase the voltage of the electricity generated by solar panels",
                "feedback": "Incorrect. PV modules generate electricity, but voltage regulation is done by other components.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 65",
        "question": "What is \"module mismatch\" in a solar PV system?",
        "options": [
            {
                "text": "Module mismatch occurs when there are differences in the electrical performance of individual solar panels within an array, reducing overall system efficiency",
                "feedback": "Correct! Mismatched modules can reduce the efficiency of the entire array.",
                "is_correct": true
            },
            {
                "text": "Module mismatch refers to solar panels that are installed at different tilt angles",
                "feedback": "Incorrect. Mismatch is about electrical performance, not installation angles.",
                "is_correct": false
            },
            {
                "text": "Module mismatch refers to the differences in the size of solar panels in an array",
                "feedback": "Incorrect. Mismatch is about performance, not size.",
                "is_correct": false
            },
            {
                "text": "Module mismatch refers to the amount of sunlight received by each panel",
                "feedback": "Incorrect. Mismatch is about electrical performance differences, not sunlight.",
                "is_correct": false
            }
        ],
        "correct": 0
    },
    {
        "title": "Solar Photovoltaic Installation and Maintenance 30",
        "question": "What is \"thin-film\" solar technology?",
        "options": [
            {
                "text": "Thin-film solar technology uses layers of photovoltaic material that are much thinner than traditional silicon-based solar cells, making them lightweight and flexible but less efficient",
                "feedback": "Correct! Thin-film solar panels are lightweight and flexible but less efficient.",
                "is_correct": true
            },
            {
                "text": "Thin-film solar technology refers to a method of storing solar energy in small panels",
                "feedback": "Incorrect. Thin-film solar panels generate electricity, they do not store it.",
                "is_correct": false
            },
            {
                "text": "Thin-film solar technology is more efficient than monocrystalline solar panels",
                "feedback": "Incorrect. Thin-film panels are generally less efficient than monocrystalline panels.",
                "is_correct": false
            },
            {
                "text": "Thin-film solar technology refers to adding a reflective coating to solar panels",
                "feedback": "Incorrect. Thin-film technology is about the photovoltaic material, not a reflective coating.",
                "is_correct": false
            }
        ],
        "correct": 0
    }
];
              let currentQuestion = 0;
              let score = 0;
              let timerInterval;
              let timeRemaining = 30;
              let variantCompleted = false;
              
              // Starts a 30-second countdown for the given timer element.
              function startTimer(timerEl) {
                  timeRemaining = 30;
                  timerEl.textContent = timeRemaining;
                  // For variant 2, adjust the timer style (e.g. change border color)
                  if (5 === 2) {
                      timerEl.style.border = "3px solid red";
                  }
                  timerInterval = setInterval(() => {
                      timeRemaining--;
                      timerEl.textContent = timeRemaining;
                      if (timeRemaining <= 0) {
                          clearInterval(timerInterval);
                          document.getElementById("next-btn-5").disabled = false;
                          const inputs = document.querySelectorAll("input[name='question-" + currentQuestion + "']");
                          inputs.forEach(input => input.disabled = true);
                          const feedbackDiv = document.querySelector("#quiz-container-5 .feedback");
                          if (feedbackDiv) {
                              feedbackDiv.textContent = "Time's up!";
                              feedbackDiv.className = "feedback timeout";
                              feedbackDiv.style.display = "block";
                          }
                      }
                  }, 1000);
              }
              
              function displayQuestion(index) {
                  clearInterval(timerInterval);
                  const container = document.getElementById("quiz-container-5");
                  container.innerHTML = "";
                  if (index >= quizData.length) {
                      showFinalResults();
                      return;
                  }
                  const q = quizData[index];
                  const questionDiv = document.createElement("div");
                  questionDiv.className = "question-panel";
                  
                  // Create timer element and insert it at the top of the question panel.
                  const timerEl = document.createElement("div");
                  timerEl.className = "timer";
                  questionDiv.appendChild(timerEl);
                  startTimer(timerEl);
                  
                  const questionText = document.createElement("h3");
                  questionText.textContent = (index + 1) + ". " + q.question;
                  questionDiv.appendChild(questionText);
                  
                  // Create fieldset for options.
                  const fieldset = document.createElement("fieldset");
                  fieldset.className = "options-fieldset";
                  fieldset.style.backgroundColor = "#948644";
                  fieldset.style.color = "black";
                  fieldset.style.border = "none";
                  fieldset.style.padding = "10px";
                  
                  const shuffledOptions = q.options.slice().sort(() => Math.random() - 0.5);
                  shuffledOptions.forEach((option, oIndex) => {
                      const optionLabel = document.createElement("label");
                      optionLabel.style.display = "block";
                      const radioInput = document.createElement("input");
                      radioInput.type = "radio";
                      radioInput.name = "question-" + index;
                      radioInput.value = oIndex;
                      radioInput.style.transform = "scale(1.5)";
                      radioInput.style.marginRight = "15px";
                      radioInput.onclick = function() {
                          checkAnswer(index, oIndex, questionDiv, shuffledOptions);
                          document.getElementById("next-btn-5").disabled = false;
                          clearInterval(timerInterval);
                      };
                      optionLabel.appendChild(radioInput);
                      optionLabel.appendChild(document.createTextNode(option.text));
                      fieldset.appendChild(optionLabel);
                  });
                  questionDiv.appendChild(fieldset);
                  
                  const feedbackDiv = document.createElement("div");
                  feedbackDiv.className = "feedback";
                  questionDiv.appendChild(feedbackDiv);
                  
                  container.appendChild(questionDiv);
                  document.getElementById("next-btn-5").disabled = true;
              }
              
              function checkAnswer(questionIndex, selectedOption, questionDiv, shuffledOptions) {
                  const feedbackDiv = questionDiv.querySelector(".feedback");
                  const selected = shuffledOptions[selectedOption];
                  if (selected.is_correct) {
                      feedbackDiv.textContent = selected.feedback || "Correct!";
                      feedbackDiv.className = "feedback correct";
                      score++;
                  } else {
                      feedbackDiv.textContent = selected.feedback || "Incorrect!";
                      feedbackDiv.className = "feedback incorrect";
                  }
                  feedbackDiv.style.display = "block";
                  const inputs = questionDiv.querySelectorAll("input");
                  inputs.forEach(input => input.disabled = true);
              }
              
              function showFinalResults() {
                  clearInterval(timerInterval);
                  const container = document.getElementById("quiz-container-5");
                  container.innerHTML = "";
                  document.getElementById("next-btn-5").style.display = "none";
                  const finalMessageDiv = document.getElementById("final-message-5");
                  const total = quizData.length;
                  const percentage = Math.round((score / total) * 100);
                  let generalFeedback = "";
                  if (percentage < 30) {
                      generalFeedback = "Your score is below 30%. It looks like you need more practice, but don't be discouraged! Enroll in our course to build a strong foundation. Not only will you gain the skills to improve your performance, but you'll also have the opportunity to earn an internationally recognized graded certificate and detailed online report. Plus, our course connects you to a global network of scholarships and grants—imagine the possibility of financial rewards if you top your category!";
                  } else if (percentage < 50) {
                      generalFeedback = "Your score is below 50%, which means there’s significant room for improvement. Consider enrolling in our course to boost your skills and academic confidence. With our comprehensive curriculum, you can work towards an internationally accepted graded certificate, complete with a verifiable online report. Additionally, we offer access to international scholarships, grants, and even financial rewards for exceptional performance.";
                  } else if (percentage < 70) {
                      generalFeedback = "You scored below 70%. With a bit more guidance from our course, you could truly excel! Our program is designed to enhance your academic prowess and help you achieve an internationally recognized graded certificate with a detailed online report. Moreover, by joining, you'll tap into a vast network of resources including scholarships, grants, and the potential for financial rewards if you secure the top position in your category.";;
                  } else if (percentage < 90) {
                      generalFeedback = "Great job! You scored below 90%. You’re almost there—just a little more effort, and you can reach perfection. Our course not only refines your skills but also offers the chance to earn a verifiable, internationally accepted graded certificate and detailed graded report. Plus, you’ll gain access to an international network of scholarships, grants, and financial incentives for top-ranking students.";
                  } else {
                      generalFeedback = "Excellent! You scored above 90%, showcasing near mastery of the subject. For even more advanced insights, consider our premium course. By enrolling, you'll have the opportunity to earn an internationally recognized graded certificate along with a detailed online report. You will also be matched with valuable resources, including scholarships, grants, and the chance to receive financial rewards if you rank 1st in your category.";
                  }
                  finalMessageDiv.innerHTML = `
                      <p>Your Score: <strong>${score}</strong> out of <strong>${total}</strong> (${percentage}%).</p>
                      <p>${generalFeedback}</p>
                      <a id="enroll-btn-5" class="enroll-btn" href="#" onclick="alert('Redirecting to enrollment page...'); return false;">CLICK THE BLUE BUTTON BELOW</a>
                  `;
                  finalMessageDiv.style.display = "block";
                  finalMessageDiv.style.border = "3px solid #ff1493";
                  finalMessageDiv.style.background = "linear-gradient(45deg, #ff9a9e, #fad0c4)";
                  finalMessageDiv.style.animation = "flashing 1s infinite";
                  variantCompleted = true;
                  if (typeof window.setGlobalVariantCompleted === "function") {
                      window.setGlobalVariantCompleted();
                  }
              }
              
              document.getElementById("next-btn-5").onclick = function() {
                  currentQuestion++;
                  displayQuestion(currentQuestion);
              };
              
              window.addEventListener("load", function() {
                  displayQuestion(currentQuestion);
              });
          })();
      </script>
    </div>
    
    <script>
        let currentVariant = 1;
        const totalVariants = 5;
        let currentVariantFinalized = false;
        
        window.setGlobalVariantCompleted = function() {
            currentVariantFinalized = true;
            if (currentVariant < totalVariants) {
                document.getElementById("next-variant").disabled = false;
            }
        };
        
        function showVariantNo {
            for (let i = 1; i <= totalVariants; i++) {
                document.getElementById("page-" + i).style.display = "none";
            }
            document.getElementById("page-" + n).style.display = "block";
            document.getElementById("variant-indicator").textContent = "Variant " + n + " of " + totalVariants;
            document.getElementById("prev-variant").disabled = (n === 1);
            if(n === currentVariant && currentVariantFinalized) {
                document.getElementById("next-variant").disabled = false;
            } else {
                document.getElementById("next-variant").disabled = true;
            }
        }
        document.getElementById("prev-variant").onclick = function() {
            if (currentVariant > 1) {
                currentVariant--;
                currentVariantFinalized = true;
                showVariant(currentVariant);
            }
        };
        document.getElementById("next-variant").onclick = function() {
            if (!currentVariantFinalized) {
                alert("Please finalize the current variant before moving to the next.");
                return;
            }
            if (currentVariant < totalVariants) {
                currentVariant++;
                currentVariantFinalized = false;
                showVariant(currentVariant);
            }
        };
        function toggleFullScreen() {
            if (!document.fullscreenElement) {
                document.documentElement.requestFullscreen();
            } else {
                if (document.exitFullscreen) {
                    document.exitFullscreen();
                }
            }
        }
        window.onload = function() {
            showVariant(currentVariant);
        };
    </script>
</body>
</html>