From: Vincent Vanwaelscappel Date: Fri, 4 Nov 2022 16:11:32 +0000 (+0100) Subject: wip #5566 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a8cd35bcf25950cb2d049652d159e7679c6386b4;p=fluidbook-toolbox.git wip #5566 @1 --- diff --git a/app/Models/ELearningMedia.php b/app/Models/ELearningMedia.php index 7a06b9450..a7e5fd124 100644 --- a/app/Models/ELearningMedia.php +++ b/app/Models/ELearningMedia.php @@ -11,7 +11,6 @@ use App\Models\Traits\SCORMVersionTrait; use Cubist\Backpack\Magic\Fields\Files; use Cubist\Backpack\Magic\Fields\Hidden; use Cubist\Backpack\Magic\Fields\Percent; -use Cubist\Backpack\Magic\Fields\StaticValue; use Cubist\Backpack\Magic\Fields\Text; use Cubist\Scorm\Manifest; use Cubist\Scorm\Version; @@ -87,7 +86,7 @@ class ELearningMedia extends ToolboxModel /** @var Media $file */ $file = $this->getMediaInField('file')->first()->getPath(); - self::compileFromFile($file, $dest, $this->title, $organization, 'MEDIA_' . $this->id, 75); + self::compileFromFile($file, $dest, $this->title, $organization, 'MEDIA_' . $this->id, $this->scorm_version, 75); } /** @@ -100,7 +99,7 @@ class ELearningMedia extends ToolboxModel * @return string * @throws \Exception */ - public static function compileFromFile($file, $dest, $title, $organization, $reference, $complete_pct = 75) + public static function compileFromFile($file, $dest, $title, $organization, $reference, $scorm_version = Version::SCORM_2004, $complete_pct = 75) { $spl = new \SplFileInfo($file); $ext = mb_strtolower($spl->getExtension()); @@ -111,7 +110,7 @@ class ELearningMedia extends ToolboxModel $type = self::getType($ext); $vdir = new VirtualDirectory($dest); - $vdir->file_put_contents('imsmanifest.xml', new Manifest($title, Version::SCORM_2004, $organization, $reference)); + $vdir->file_put_contents('imsmanifest.xml', new Manifest($title, $scorm_version, $organization, $reference)); $vdir->copyDirectory(resource_path('elearningmedia/dist/css'), 'css'); $vdir->copyDirectory(resource_path('elearningmedia/dist/js'), 'js'); if ($type === 'pdf') {