From ab159e5be3199edc3c51a880575c6f5b1cdb317c Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 25 May 2018 15:27:48 +0000 Subject: [PATCH] #2048 --- .../html5/master/class.ws.html5.compiler.php | 21 ++++++++++++++++++- .../scorm2004/class.ws.html5.compiler.php | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index ec8cb08c5..aa4a89825 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -714,7 +714,13 @@ class wsHTML5Compiler protected function writeScorm() { - $manifest = file_get_contents($this->assets . '/_imsmanifest.xml'); + if ($this->book->parametres->scorm_version == '1.2') { + $manifestfile = '_imsmanifest.12.xml'; + } elseif ($this->book->parametres->scorm_version = '2004') { + $manifestfile = '_imsmanifest.2004.xml'; + } + + $manifest = file_get_contents($this->assets . '/' . $manifestfile); if (!$this->book->parametres->scorm_title) { $this->book->parametres->scorm_title = $this->book->parametres->title; } @@ -741,6 +747,9 @@ class wsHTML5Compiler $variables[$f[0]] = $f[1]; } $this->config->scorm_variables = $this->book->parametres->scorm_variables = $variables; + if ($this->book->parametres->scorm_quizdata) { + $this->config->scorm_quizdata = wsUtil::excelToArray($this->wdir . '/' . $this->book->parametres->scorm_quizdata); + } } protected function writePrint() @@ -1844,6 +1853,16 @@ class wsHTML5Compiler $res['height'] = intval((string)$canvas->getAttribute('height')); } + $m = $xpath->query('//meta[@name="width"]'); + foreach ($m as $meta) { + $res['width'] = intval((string)$meta->getAttribute('content')); + } + + $m = $xpath->query('//meta[@name="height"]'); + foreach ($m as $meta) { + $res['height'] = intval((string)$meta->getAttribute('content')); + } + $r = array('html' => 'index.html', 'inject' => array(), 'injectcss' => array(), 'injectjs' => array()); } else { $r = array('html' => false, 'inject' => array(file_get_contents($d . '/init.js')), 'injectcss' => array('multimedia.css'), 'injectjs' => array('multimedia.js')); diff --git a/inc/ws/Util/html5/scorm2004/class.ws.html5.compiler.php b/inc/ws/Util/html5/scorm2004/class.ws.html5.compiler.php index b04ea9dd2..2a809f031 100644 --- a/inc/ws/Util/html5/scorm2004/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/scorm2004/class.ws.html5.compiler.php @@ -724,7 +724,7 @@ class wsHTML5Compiler if (!$this->book->parametres->scorm_title) { $this->book->parametres->scorm_title = $this->book->parametres->title; } - if (!$this->book->parametres->scorm_id) { + if (!$this->book->parametres->scorm_id || ($this->book->parametres->id > 16614 && $this->book->parametres->scorm_id == 'MFMCTE091mobile')) { $this->book->parametres->scorm_id = 'fb_' . $this->book->parametres->id; } if (!$this->book->parametres->scorm_org) { -- 2.39.5