From: Vincent Vanwaelscappel Date: Tue, 28 Jun 2022 07:27:18 +0000 (+0200) Subject: wip #5319 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7b89b122187600b589ee26f428e0553420c47d9e;p=cubist_scorm.git wip #5319 @0.5 --- diff --git a/.gitignore b/.gitignore index d85eee5..5658e22 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ Homestead.json /.vagrant .phpunit.result.cache +.idea \ No newline at end of file diff --git a/src/Manifest.php b/src/Manifest.php index 17fd2ab..519bd9b 100644 --- a/src/Manifest.php +++ b/src/Manifest.php @@ -4,10 +4,7 @@ namespace Cubist\Scorm; class Manifest { - const SCORM_1_2 = "1.2"; - const SCORM_2004 = "2004"; - - protected $version = self::SCORM_2004; + protected $version = Version::SCORM_2004; /** * @var string @@ -29,7 +26,7 @@ class Manifest */ protected $start = 'index.html'; - public function __construct($title, $version = self::SCORM_2004, $organization = null, $reference = null, $start = 'index.html') + public function __construct($title, $version = Version::SCORM_2004, $organization = null, $reference = null, $start = 'index.html') { $this->setVersion($version); $this->setTitle($title); @@ -44,7 +41,7 @@ class Manifest public function __toString() { - if ($this->getVersion() === self::SCORM_1_2) { + if ($this->getVersion() === Version::SCORM_1_2) { return $this->_render12(); } else { return $this->_render2004(); @@ -60,6 +57,12 @@ class Manifest protected function _render2004() { + if ($this->version === Version::SCORM_2004) { + $v = '4th'; + } else if ($this->version === Version::SCORM_2004_3) { + $v = '3rd'; + } + return ' ADL SCORM - 2004 4th Edition + 2004 ' . $v . ' Edition diff --git a/src/Version.php b/src/Version.php new file mode 100644 index 0000000..c72ecb9 --- /dev/null +++ b/src/Version.php @@ -0,0 +1,10 @@ +