Exercise: Update audio question with translatable help link and modal - refs BT#21319

pull/5083/head
christianbeeznest 2 years ago committed by GitHub
parent 1e2b0f4282
commit e1ae3fec09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      assets/js/legacy/exercise.js
  2. 11
      public/main/inc/ajax/exercise.ajax.php

@ -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());
}
});
});

@ -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 = '
<div class="audio-recorder-info">
<i class="mdi mdi-microphone" style="font-size: 24px;"></i>
<p>' . htmlspecialchars($content) . '</p>
</div>';
echo $html;
break;
default:
echo '';
}

Loading…
Cancel
Save