Internal: Fix button positioning below image in hotspot exercise - refs BT#22145

pull/5908/head
christianbeeznst 3 weeks ago
parent c22fd7b30c
commit 5abb3d4148
  1. 42
      public/main/inc/lib/exercise.lib.php

@ -1431,10 +1431,10 @@ HTML;
$hotspotColor = 0; $hotspotColor = 0;
if (HOT_SPOT_DELINEATION != $answerType) { if (HOT_SPOT_DELINEATION != $answerType) {
$answerList = ' $answerList = '
<div class="bg-tertiary p-4 rounded-md border border-gray-25"> <div class="p-4 rounded-md border border-gray-25">
<h5 class="font-bold text-lg mb-2 text-primary">'.get_lang('Image zones').'</h5> <h5 class="font-bold text-lg mb-2 text-primary">'.get_lang('Image zones').'</h5>
<ol class="list-decimal ml-6 space-y-2 text-primary"> <ol class="list-decimal ml-6 space-y-2 text-primary">
'; ';
if (!empty($answers_hotspot)) { if (!empty($answers_hotspot)) {
Session::write("hotspot_ordered$questionId", array_keys($answers_hotspot)); Session::write("hotspot_ordered$questionId", array_keys($answers_hotspot));
@ -1459,7 +1459,7 @@ HTML;
echo " echo "
<div class=\"flex space-x-4\"> <div class=\"flex space-x-4\">
<div class=\"w-3/4\"> <div class=\"w-3/4\">
<div id=\"hotspot-preview-$questionId\" class=\"bg-gray-10 h-[500px] w-full bg-center bg-no-repeat bg-contain border border-gray-25\"></div> <div id=\"hotspot-preview-$questionId\" class=\"bg-gray-10 w-full bg-center bg-no-repeat bg-contain border border-gray-25\"></div>
</div> </div>
<div class=\"w-1/4\"> <div class=\"w-1/4\">
$answerList $answerList
@ -1498,24 +1498,24 @@ HOTSPOT;
$relPath = api_get_path(WEB_CODE_PATH); $relPath = api_get_path(WEB_CODE_PATH);
$s .= "<div class=\"w-3/4\"> $s .= "<div class=\"w-3/4\">
<div class=\"hotspot-image h-[500px] bg-gray-10 border border-gray-25 bg-center bg-no-repeat bg-contain\"></div> <div class=\"hotspot-image bg-gray-10 border border-gray-25 bg-center bg-no-repeat bg-contain\"></div>
<script> <script>
$(function() { $(function() {
new ".(HOT_SPOT_DELINEATION == $answerType ? 'DelineationQuestion' : 'HotspotQuestion')."({ new ".(HOT_SPOT_DELINEATION == $answerType ? 'DelineationQuestion' : 'HotspotQuestion')."({
questionId: $questionId, questionId: $questionId,
exerciseId: $exerciseId, exerciseId: $exerciseId,
exeId: 0, exeId: 0,
selector: '#question_div_' + $questionId + ' .hotspot-image', selector: '#question_div_' + $questionId + ' .hotspot-image',
for: 'user', for: 'user',
relPath: '$relPath' relPath: '$relPath'
}); });
}); });
</script> </script>
</div> </div>
<div class=\"w-1/4\"> <div class=\"w-1/4\">
$answerList $answerList
</div> </div>
"; ";
echo <<<HOTSPOT echo <<<HOTSPOT
$s $s

Loading…
Cancel
Save