Fix jsplumb graph when loading images BT#16602

pull/3090/head
Julio Montoya 6 years ago
parent 9e5be4b20c
commit 009ea8e827
  1. 11
      main/exercise/answer.class.php
  2. 2
      main/inc/lib/exercise.lib.php

@ -1029,12 +1029,13 @@ class Answer
*/
public function getJs()
{
//if ($this->questionId == 2)
return "<script>
jsPlumb.ready(function() {
if ($('#drag{$this->questionId}_question').length > 0) {
MatchingDraggable.init('{$this->questionId}');
}
$(window).on('load', function() {
jsPlumb.ready(function() {
if ($('#drag{$this->questionId}_question').length > 0) {
MatchingDraggable.init('{$this->questionId}');
}
});
});
</script>";
}

@ -1277,7 +1277,7 @@ HTML;
$s .= "
<script>
$(function() {
jsPlumb.ready(function() {
$(window).on('load', function() {
jsPlumb.connect({
source: 'window_$windowId',
target: 'window_{$questionId}_{$selectedIndex}_answer',

Loading…
Cancel
Save