├── README.md
├── index.php
├── 12.php
└── 2004.html
/README.md:
--------------------------------------------------------------------------------
1 | Scorm Test Environment
2 | ----------------------
3 |
4 | Say you have a bunch of SCORM packages which are zip files and you regularly need to test them but don't want to have to put them into your LMS. You might need to try them using a Scorm 1.2 or a Scorm 2004 runtime, or both.
5 |
6 | This utilty scans the current folder for zip files and extracts them. It looks inside each folder for an imsmanifest.xml file. It looks inside that file to find the course homepage and gives you links to this file using a scorm runtime wrapper link for both 1.2 and 2004.
7 |
8 | The scorm 1.2 harness is based on Moodle 2.6(ish, with hax) and has buttons to simulate unloading and loading.
9 |
10 | The scorm 2004 harness is Claude Ostyn's handy all-in-one debugger (© 2007 Ostyn Consulting, www.ostyn.com/standards/scorm/samples/scorm2004testwrap.htm)
11 |
12 | ##Setup
13 |
14 | Put this in a folder that your web server can write to (as it extracts files).
15 |
16 | If you're running PHP7.0 you might need to
17 |
18 | sudo apt-get install php7.0-xml
19 | sudo apt-get install php7.0-zip
20 |
21 | You can run a PHP web server like this
22 |
23 | cd (the-folder)
24 | php -S localhost:8080
25 |
26 | ... and now hit up http://localhost:8080 and you can see the files
27 |
28 | ##License(s)
29 |
30 | GPL2 for moodle hacked wrapper
31 | CC Attribution-ShareAlike2.5 License for scorm2004 wrapper
32 | MIT for index.php
33 |
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 |
33 |
34 |
35 |
62 |
63 |
64 | Course Scorm Debug
65 |
66 | | Folder | Scorm 1.2 | Scorm 2004 | Remove? |
67 |
68 | open($file);
79 | if ($result === TRUE) {
80 | $zipArchive->extractTo($path . "/" . basename($file, ".zip"));
81 | $zipArchive->close();
82 | // unlink($file);
83 | }
84 | }
85 | }
86 |
87 | // list all packages that have scorm
88 | //TODO: fix - read manifest to get start page
89 | $directories = array_diff(scandir($target), array('..', '.', '.git','2012','2013','2014','2015','2016','2017','2018','2019','2020')); // cheaty but works
90 | natcasesort($directories);
91 | foreach ($directories as $value) {
92 | if (is_dir($target . '/' . $value)) {
93 | $t = preg_replace("/[^a-zA-Z]/", "", $value);
94 |
95 | if (file_exists("$value/imsmanifest.xml")) {
96 |
97 | $manifest = file_get_contents("$value/imsmanifest.xml");
98 | $manifest = str_replace("adlcp:", "", $manifest); // imscp packages may have un-namespaced prefixes
99 | $xmlDoc = simplexml_load_string ($manifest);
100 | $i = $value . "/" . $xmlDoc->resources[0]->resource[0]->attributes()->href;
101 |
102 | // $xmlDoc = new SimpleXmlElement($manifest);
103 | // foreach($xmlDoc->getDocNamespaces() as $strPrefix => $strNamespace) {
104 | // if(strlen($strPrefix)==0) {
105 | // $strPrefix="a"; //Assign an arbitrary namespace prefix.
106 | // }
107 | // $xmlDoc->registerXPathNamespace($strPrefix,$strNamespace);
108 | // }
109 |
110 | } else {
111 |
112 | if (file_exists($value . "/SCO1/index.html")) {
113 | $i = $value . "/SCO1/index.html";
114 | } else if (file_exists($value . "/SCO1/en-us/Content.html")) {
115 | $i = $value . "/SCO1/en-us/Content.html";
116 | } else if (file_exists($value . "/index.html")) {
117 | $i = $value . "/index.html";
118 | } else if (file_exists($value . "/launch.html")) {
119 | $i = $value . "/launch.html";
120 | } else {
121 | $i = $value . "/";
122 | }
123 |
124 | }
125 | echo "| $value | ";
126 | echo "Launch | ";
127 | echo "Launch | ";
128 | echo "Delete (+ Zip) | ";
129 | echo "
";
130 | }
131 | }
132 | ?>
133 |
134 |
135 |
--------------------------------------------------------------------------------
/12.php:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 | courses.dev : 1.2
18 |
19 |
23 |
99 |
100 |
830 |
831 |
832 |
833 |
834 |
835 |
Scorm 1.2 Tester
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 |
845 |
867 |
868 |
871 |
872 |
874 |
875 |
876 |
--------------------------------------------------------------------------------
/2004.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
10 |
12 |
13 |
14 |
16 |
18 |
19 | Claude's SCORM 2004 Test Wrapper
20 |
3380 |
3381 |
3382 |
3383 |
3410 |
3411 |
3412 |
3413 |
--------------------------------------------------------------------------------