diff --git a/assets/js/legacy/exercise.js b/assets/js/legacy/exercise.js index 357a7c792a..440796d0f9 100644 --- a/assets/js/legacy/exercise.js +++ b/assets/js/legacy/exercise.js @@ -9,3 +9,17 @@ import '../../../public/main/inc/lib/javascript/epiclock/renderers/minute/epiclo import './annotation' import '../../../public/main/inc/lib/javascript/hotspot/js/hotspot.js'; import '../../../public/main/inc/lib/javascript/d3/jquery.xcolor.js'; + +document.addEventListener("DOMContentLoaded", function() { + var links = document.querySelectorAll('a[href*="web"]'); + links.forEach(function(link) { + link.classList.add("ajax"); + var href = link.getAttribute("href"); + var pathSegments = href.split("/"); + if (pathSegments.length >= 3) { + var contentIdentifier = pathSegments[2]; + link.setAttribute("href", "/main/inc/ajax/exercise.ajax.php?a=" + contentIdentifier); + link.setAttribute("data-title", link.textContent.trim()); + } + }); +}); diff --git a/public/main/inc/ajax/exercise.ajax.php b/public/main/inc/ajax/exercise.ajax.php index 3ed7e6929a..dc8869d009 100644 --- a/public/main/inc/ajax/exercise.ajax.php +++ b/public/main/inc/ajax/exercise.ajax.php @@ -1065,6 +1065,17 @@ switch ($action) { } echo 0; break; + case 'enregistrement-audio': + $content = get_lang('While recording, you can pause whenever you want. If you are not satisfied, register again. This will overwrite the previous version. Satisfied ? To send the recording to your teacher, click on “Stop recording” then select “End exercise”. The teacher will be able to listen to your recording and give you feedback! All your transmitted recordings can be viewed on the exercise home page.'); + + $html = ' +
' . htmlspecialchars($content) . '
+