function loadScript(url, integrity, crossorigin) { return new Promise((resolve, reject) => { const script = document.createElement("script"); script.src = url; script.integrity = integrity; script.crossOrigin = crossorigin; script.onload = () => resolve(script); script.onerror = () => reject(new Error(`Failed to load script: ${url}`)); document.head.appendChild(script); }); } function getFeedbackLinks() { // Select all elements with the class "stretched-link" const links = document.querySelectorAll("a.stretched-link"); // Initialize an array to store the href attributes const feedbackLinks = []; // Iterate through the selected links links.forEach((link) => { const href = link.getAttribute("href"); // Check if the href includes "/feedback/" if (href) { if (href.includes("/feedback/")) { feedbackLinks.push(href); } else if (href.includes("/quiz/")) { feedbackLinks.push(href); } } }); return feedbackLinks; } var currentScript = document.currentScript; var myModal = document.getElementById("fullScreenModal"); myModal.addEventListener("shown.bs.modal", function () { var modalContent = myModal.querySelector(".modal-content"); var modalWidth = modalContent.offsetWidth; var modalHeight = modalContent.offsetHeight; const modalIframe = window.$("#modal-iframe"); modalIframe.css("width", "100%"); modalIframe.css("height", "100%"); modalIframe.css("border", "none"); }); loadScript( "https://code.jquery.com/jquery-3.7.1.min.js", "sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=", "anonymous" ) .then(() => { console.log("jQuery loaded successfully"); window.$ = jQuery; return loadScript( "https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js", "sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz", "anonymous" ); }) .then(() => { console.log("Bootstrap loaded successfully"); var scriptId = "script-" + Math.random().toString(36).substring(2, 9); currentScript.id = scriptId; contentUrl = $(currentScript).attr("data-content-url"); function openInModal(url, block) { $("#modal-iframe").attr("src", url); if (block) { $("#fullScreenModal").attr("data-block", block); } else { $("#fullScreenModal").removeAttr("data-block"); } } function showContent(url, block) { bootstrap.Modal.getOrCreateInstance( document.getElementById("fullScreenModal") ).show(); if (url) { openInModal(url, block); } } function hideContent() { bootstrap.Modal.getOrCreateInstance( document.getElementById("fullScreenModal") ).hide(); openInModal("about:blank"); } async function nextContent() { // Get the currently executing