The new edit page using QuickForm lib
[moodle.git] / mod / scorm / locallib.php
CommitLineData
e4aa175a 1<?php // $Id$
f69db63e 2
a30b6819 3/// Constants and settings for module scorm
b3659259 4define('SCO_ALL', 0);
5define('SCO_DATA', 1);
6define('SCO_ONLY', 2);
a30b6819 7
8define('GRADESCOES', '0');
9define('GRADEHIGHEST', '1');
10define('GRADEAVERAGE', '2');
11define('GRADESUM', '3');
12$SCORM_GRADE_METHOD = array (GRADESCOES => get_string('gradescoes', 'scorm'),
13 GRADEHIGHEST => get_string('gradehighest', 'scorm'),
14 GRADEAVERAGE => get_string('gradeaverage', 'scorm'),
15 GRADESUM => get_string('gradesum', 'scorm'));
16
17define('HIGHESTATTEMPT', '0');
18define('AVERAGEATTEMPT', '1');
19define('FIRSTATTEMPT', '2');
20define('LASTATTEMPT', '3');
21$SCORM_WHAT_GRADE = array (HIGHESTATTEMPT => get_string('highestattempt', 'scorm'),
22 AVERAGEATTEMPT => get_string('averageattempt', 'scorm'),
23 FIRSTATTEMPT => get_string('firstattempt', 'scorm'),
24 LASTATTEMPT => get_string('lastattempt', 'scorm'));
25
26$SCORM_POPUP_OPTIONS = array('resizable'=>1,
27 'scrollbars'=>1,
28 'directories'=>0,
29 'location'=>0,
30 'menubar'=>0,
31 'toolbar'=>0,
32 'status'=>0);
33$stdoptions = '';
34foreach ($SCORM_POPUP_OPTIONS as $popupopt => $value) {
35 $stdoptions .= $popupopt.'='.$value;
36 if ($popupopt != 'status') {
37 $stdoptions .= ',';
38 }
39}
40
41if (!isset($CFG->scorm_maxattempts)) {
42 set_config('scorm_maxattempts','6');
43}
44
45if (!isset($CFG->scorm_frameheight)) {
46 set_config('scorm_frameheight','500');
47}
48
49if (!isset($CFG->scorm_framewidth)) {
50 set_config('scorm_framewidth','100%');
51}
52
53if (!isset($CFG->scorm_advancedsettings)) {
54 set_config('scorm_advancedsettings','0');
55}
56
57if (!isset($CFG->scorm_windowsettings)) {
58 set_config('scorm_windowsettings','0');
59}
60
61//
62// Repository configurations
63//
64$repositoryconfigfile = $CFG->dirroot.'/mod/resource/type/ims/repository_config.php';
65$repositorybrowser = '/mod/resource/type/ims/finder.php';
66
2b3447c3 67/// Local Library of functions for module scorm
f69db63e 68
5c1ac70c 69/**
70* This function will permanently delete the given
71* directory and all files and subdirectories.
72*
73* @param string $directory The directory to remove
74* @return boolean
75*/
76function scorm_delete_files($directory) {
77 if (is_dir($directory)) {
78 $files=scorm_scandir($directory);
79 foreach($files as $file) {
80 if (($file != '.') && ($file != '..')) {
81 if (!is_dir($directory.'/'.$file)) {
82 unlink($directory.'/'.$file);
83 } else {
84 scorm_delete_files($directory.'/'.$file);
85 }
f69db63e 86 }
5c1ac70c 87 set_time_limit(5);
f69db63e 88 }
5c1ac70c 89 rmdir($directory);
90 return true;
f69db63e 91 }
5c1ac70c 92 return false;
f69db63e 93}
94
5c1ac70c 95/**
96* Given a diretory path returns the file list
97*
98* @param string $directory
99* @return array
100*/
101function scorm_scandir($directory) {
102 if (version_compare(phpversion(),'5.0.0','>=')) {
103 return scandir($directory);
f69db63e 104 } else {
5c1ac70c 105 $files = array();
106 if ($dh = opendir($directory)) {
107 while (($file = readdir($dh)) !== false) {
108 $files[] = $file;
109 }
110 closedir($dh);
111 }
112 return $files;
f69db63e 113 }
f69db63e 114}
115
e4aa175a 116/**
117* Create a new temporary subdirectory with a random name in the given path
118*
119* @param string $strpath The scorm data directory
120* @return string/boolean
121*/
122function scorm_datadir($strPath)
123{
124 global $CFG;
125
126 if (is_dir($strPath)) {
127 do {
128 // Create a random string of 8 chars
129 $randstring = NULL;
130 $lchar = '';
131 $len = 8;
132 for ($i=0; $i<$len; $i++) {
133 $char = chr(rand(48,122));
134 while (!ereg('[a-zA-Z0-9]', $char)){
135 if ($char == $lchar) continue;
136 $char = chr(rand(48,90));
137 }
138 $randstring .= $char;
139 $lchar = $char;
140 }
141 $datadir='/'.$randstring;
142 } while (file_exists($strPath.$datadir));
143 mkdir($strPath.$datadir, $CFG->directorypermissions);
144 @chmod($strPath.$datadir, $CFG->directorypermissions); // Just in case mkdir didn't do it
145 return $strPath.$datadir;
146 } else {
147 return false;
148 }
149}
150
2b3447c3 151function scorm_array_search($item, $needle, $haystacks, $strict=false) {
152 if (!empty($haystacks)) {
153 foreach ($haystacks as $key => $element) {
154 if ($strict) {
155 if ($element->{$item} === $needle) {
156 return $key;
157 }
158 } else {
159 if ($element->{$item} == $needle) {
160 return $key;
e4aa175a 161 }
162 }
e4aa175a 163 }
164 }
2b3447c3 165 return false;
e4aa175a 166}
167
2b3447c3 168function scorm_repeater($what, $times) {
169 if ($times <= 0) {
170 return null;
171 }
172 $return = '';
173 for ($i=0; $i<$times;$i++) {
174 $return .= $what;
175 }
176 return $return;
177}
e4aa175a 178
2b3447c3 179function scorm_external_link($link) {
180// check if a link is external
181 $result = false;
182 $link = strtolower($link);
183 if (substr($link,0,7) == 'http://') {
184 $result = true;
185 } else if (substr($link,0,8) == 'https://') {
186 $result = true;
187 } else if (substr($link,0,4) == 'www.') {
188 $result = true;
189 }
190 return $result;
e4aa175a 191}
192
2b3447c3 193/**
194* Given a package directory, this function will check if the package is valid
195*
196* @param string $packagedir The package directory
197* @return mixed
198*/
199function scorm_validate($packagedir) {
200 $validation = new stdClass();
201 if (is_file($packagedir.'/imsmanifest.xml')) {
202 $validation->result = 'found';
203 $validation->pkgtype = 'SCORM';
204 } else {
205 if ($handle = opendir($packagedir)) {
206 while (($file = readdir($handle)) !== false) {
207 $ext = substr($file,strrpos($file,'.'));
208 if (strtolower($ext) == '.cst') {
209 $validation->result = 'found';
210 $validation->pkgtype = 'AICC';
211 break;
e4aa175a 212 }
e4aa175a 213 }
2b3447c3 214 closedir($handle);
215 }
216 if (!isset($validation->result)) {
217 $validation->result = 'nomanifest';
218 $validation->pkgtype = 'SCORM';
e4aa175a 219 }
e4aa175a 220 }
2b3447c3 221 return $validation;
e4aa175a 222}
223
b3659259 224/**
225* Returns an object containing all datas relative to the given sco ID
226*
227* @param integer $id The sco ID
228* @return mixed (false if sco id does not exists)
229*/
230function scorm_get_sco($id,$what=SCO_ALL) {
231 if ($sco = get_record('scorm_scoes','id',$id)) {
232 $sco = ($what == SCO_DATA) ? new stdClass() : $sco;
233 if (($what != SCO_ONLY) && ($scodatas = get_records('scorm_scoes_data','scoid',$id))) {
234 foreach ($scodatas as $scodata) {
235 $sco->{$scodata->name} = $scodata->value;
236 }
237 }
238 return $sco;
239 } else {
240 return false;
241 }
242}
243
e4aa175a 244function scorm_insert_track($userid,$scormid,$scoid,$attempt,$element,$value) {
e4aa175a 245 $id = null;
246 if ($track = get_record_select('scorm_scoes_track',"userid='$userid' AND scormid='$scormid' AND scoid='$scoid' AND attempt='$attempt' AND element='$element'")) {
247 $track->value = $value;
248 $track->timemodified = time();
e4aa175a 249 $id = update_record('scorm_scoes_track',$track);
250 } else {
251 $track->userid = $userid;
252 $track->scormid = $scormid;
253 $track->scoid = $scoid;
254 $track->attempt = $attempt;
255 $track->element = $element;
256 $track->value = addslashes($value);
257 $track->timemodified = time();
e4aa175a 258 $id = insert_record('scorm_scoes_track',$track);
259 }
260 return $id;
261}
262
e4aa175a 263function scorm_get_tracks($scoid,$userid,$attempt='') {
e4aa175a 264/// Gets all tracks of specified sco and user
265 global $CFG;
266
267 if (empty($attempt)) {
268 if ($scormid = get_field('scorm_scoes','scorm','id',$scoid)) {
269 $attempt = scorm_get_last_attempt($scormid,$userid);
270 } else {
271 $attempt = 1;
272 }
273 }
274 $attemptsql = ' AND attempt=' . $attempt;
275 if ($tracks = get_records_select('scorm_scoes_track',"userid=$userid AND scoid=$scoid".$attemptsql,'element ASC')) {
276 $usertrack->userid = $userid;
277 $usertrack->scoid = $scoid;
a30b6819 278 // Defined in order to unify scorm1.2 and scorm2004
e4aa175a 279 $usertrack->score_raw = '';
e4aa175a 280 $usertrack->status = '';
e4aa175a 281 $usertrack->total_time = '00:00:00';
282 $usertrack->session_time = '00:00:00';
283 $usertrack->timemodified = 0;
284 foreach ($tracks as $track) {
285 $element = $track->element;
286 $usertrack->{$element} = $track->value;
287 switch ($element) {
f69db63e 288 case 'cmi.core.lesson_status':
289 case 'cmi.completion_status':
290 if ($track->value == 'not attempted') {
291 $track->value = 'notattempted';
292 }
293 $usertrack->status = $track->value;
294 break;
e4aa175a 295 case 'cmi.core.score.raw':
296 case 'cmi.score.raw':
297 $usertrack->score_raw = $track->value;
298 break;
e4aa175a 299 case 'cmi.core.session_time':
300 case 'cmi.session_time':
301 $usertrack->session_time = $track->value;
302 break;
303 case 'cmi.core.total_time':
304 case 'cmi.total_time':
305 $usertrack->total_time = $track->value;
306 break;
307 }
308 if (isset($track->timemodified) && ($track->timemodified > $usertrack->timemodified)) {
309 $usertrack->timemodified = $track->timemodified;
310 }
311 }
312 return $usertrack;
313 } else {
314 return false;
315 }
316}
317
2b3447c3 318function scorm_get_user_data($userid) {
319/// Gets user info required to display the table of scorm results
320/// for report.php
e4aa175a 321
2b3447c3 322 return get_record('user','id',$userid,'','','','','firstname, lastname, picture');
323}
e4aa175a 324
a30b6819 325function scorm_grade_user_attempt($scorm, $userid, $attempt=1, $time=false) {
326 $attemptscore = NULL;
327 $attemptscore->scoes = 0;
328 $attemptscore->values = 0;
329 $attemptscore->max = 0;
330 $attemptscore->sum = 0;
331 $attemptscore->lastmodify = 0;
332
333 if (!$scoes = get_records('scorm_scoes','scorm',$scorm->id)) {
334 return NULL;
e4aa175a 335 }
e4aa175a 336
a30b6819 337 $grademethod = $scorm->grademethod % 10;
338
2b3447c3 339 foreach ($scoes as $sco) {
340 if ($userdata=scorm_get_tracks($sco->id, $userid,$attempt)) {
341 if (($userdata->status == 'completed') || ($userdata->status == 'passed')) {
a30b6819 342 $attemptscore->scoes++;
2b3447c3 343 }
344 if (!empty($userdata->score_raw)) {
a30b6819 345 $attemptscore->values++;
346 $attemptscore->sum += $userdata->score_raw;
347 $attemptscore->max = ($userdata->score_raw > $attemptscore->max)?$userdata->score_raw:$attemptscore->max;
348 if (isset($userdata->timemodified) && ($userdata->timemodified > $attemptscore->lastmodify)) {
349 $attemptscore->lastmodify = $userdata->timemodified;
350 } else {
351 $attemptscore->lastmodify = 0;
352 }
2b3447c3 353 }
354 }
e4aa175a 355 }
2b3447c3 356 switch ($grademethod) {
a30b6819 357 case GRADEHIGHEST:
358 $score = $attemptscore->max;
2b3447c3 359 break;
a30b6819 360 case GRADEAVERAGE:
361 if ($attemptscore->values > 0) {
362 $score = $attemptscore->sum/$attemptscore->values;
5c1ac70c 363 } else {
a30b6819 364 $score = 0;
2b3447c3 365 }
366 break;
a30b6819 367 case GRADESUM:
368 $score = $attemptscore->sum;
2b3447c3 369 break;
a30b6819 370 case GRADESCOES:
371 $score = $attemptscore->scoes;
2b3447c3 372 break;
5c1ac70c 373 }
a30b6819 374
375 if ($time) {
376 $result = new stdClass();
377 $result->score = $score;
378 $result->time = $attemptscore->lastmodify;
379 } else {
380 $result = $score;
381 }
382
383 return $result;
384}
385
386function scorm_grade_user($scorm, $userid, $time=false) {
387
388 $whatgrade = intval($scorm->grademethod / 10);
389
390 switch ($whatgrade) {
391 case FIRSTATTEMPT:
392 return scorm_grade_user_attempt($scorm, $userid, 1, $time);
393 break;
394 case LASTATTEMPT:
395 return scorm_grade_user_attempt($scorm, $userid, scorm_get_last_attempt($scorm->id, $userid), $time);
396 break;
397 case HIGHESTATTEMPT:
398 $lastattempt = scorm_get_last_attempt($scorm->id, $userid);
399 $maxscore = 0;
400 $attempttime = 0;
401 for ($attempt = 1; $attempt <= $lastattempt; $attempt++) {
402 $attemptscore = scorm_grade_user_attempt($scorm, $userid, $attempt, $time);
403 if ($time) {
404 if ($attemptscore->score > $maxscore) {
405 $maxscore = $attemptscore->score;
406 $attempttime = $attemptscore->time;
407 }
408 } else {
409 $maxscore = $attemptscore > $maxscore ? $attemptscore: $maxscore;
410 }
411 }
412 if ($time) {
413 $result = new stdClass();
414 $result->score = $maxscore;
415 $result->time = $attempttime;
416 return $result;
417 } else {
418 return $maxscore;
419 }
420 break;
421 case AVERAGEATTEMPT:
422 $lastattempt = scorm_get_last_attempt($scorm->id, $userid);
423 $sumscore = 0;
424 for ($attempt = 1; $attempt <= $lastattempt; $attempt++) {
425 $attemptscore = scorm_grade_user_attempt($scorm, $userid, $attempt, $time);
426 if ($time) {
427 $sumscore += $attemptscore->score;
428 } else {
429 $sumscore += $attemptscore;
430 }
431 }
432
433 if ($lastattempt > 0) {
434 $score = $sumscore / $lastattempt;
435 } else {
436 $score = 0;
437 }
438
439 if ($time) {
440 $result = new stdClass();
441 $result->score = $score;
442 $result->time = $attemptscore->time;
443 return $result;
444 } else {
445 return $score;
446 }
447 break;
448 }
e4aa175a 449}
450
8e45ba45 451function scorm_count_launchable($scormid,$organization='') {
452 $strorganization = '';
453 if (!empty($organization)) {
454 $strorganization = " AND organization='$organization'";
455 }
456 return count_records_select('scorm_scoes',"scorm=$scormid$strorganization AND launch<>''");
e4aa175a 457}
458
2b3447c3 459function scorm_get_last_attempt($scormid, $userid) {
460/// Find the last attempt number for the given user id and scorm id
461 if ($lastattempt = get_record('scorm_scoes_track', 'userid', $userid, 'scormid', $scormid, '', '', 'max(attempt) as a')) {
462 if (empty($lastattempt->a)) {
463 return '1';
464 } else {
465 return $lastattempt->a;
e4aa175a 466 }
467 }
e4aa175a 468}
469
e4aa175a 470function scorm_course_format_display($user,$course) {
471 global $CFG;
472
473 $strupdate = get_string('update');
474 $strmodule = get_string('modulename','scorm');
77bf0c29 475 $context = get_context_instance(CONTEXT_COURSE,$course->id);
e4aa175a 476
477 echo '<div class="mod-scorm">';
478 if ($scorms = get_all_instances_in_course('scorm', $course)) {
479 // The module SCORM activity with the least id is the course
480 $scorm = current($scorms);
481 if (! $cm = get_coursemodule_from_instance('scorm', $scorm->id, $course->id)) {
482 error("Course Module ID was incorrect");
483 }
484 $colspan = '';
485 $headertext = '<table width="100%"><tr><td class="title">'.get_string('name').': <b>'.format_string($scorm->name).'</b>';
2b3447c3 486 if (has_capability('moodle/course:manageactivities', $context)) {
e4aa175a 487 if (isediting($course->id)) {
488 // Display update icon
489 $path = $CFG->wwwroot.'/course';
490 $headertext .= '<span class="commands">'.
491 '<a title="'.$strupdate.'" href="'.$path.'/mod.php?update='.$cm->id.'&amp;sesskey='.sesskey().'">'.
0d905d9f 492 '<img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'.$strupdate.'" /></a></span>';
e4aa175a 493 }
494 $headertext .= '</td>';
495 // Display report link
496 $trackedusers = get_record('scorm_scoes_track', 'scormid', $scorm->id, '', '', '', '', 'count(distinct(userid)) as c');
497 if ($trackedusers->c > 0) {
498 $headertext .= '<td class="reportlink">'.
fa738731 499 '<a '.$CFG->frametarget.'" href="'.$CFG->wwwroot.'/mod/scorm/report.php?id='.$cm->id.'">'.
e4aa175a 500 get_string('viewallreports','scorm',$trackedusers->c).'</a>';
501 } else {
502 $headertext .= '<td class="reportlink">'.get_string('noreports','scorm');
503 }
504 $colspan = ' colspan="2"';
505 }
506 $headertext .= '</td></tr><tr><td'.$colspan.'>'.format_text(get_string('summary').':<br />'.$scorm->summary).'</td></tr></table>';
507 print_simple_box($headertext,'','100%');
508 scorm_view_display($user, $scorm, 'view.php?id='.$course->id, $cm, '100%');
509 } else {
0d699c24 510 if (has_capability('moodle/course:update', $context)) {
e4aa175a 511 // Create a new activity
2b3447c3 512 redirect($CFG->wwwroot.'/course/mod.php?id='.$course->id.'&amp;section=0&sesskey='.sesskey().'&amp;add=scorm');
e4aa175a 513 } else {
514 notify('Could not find a scorm course here');
515 }
516 }
517 echo '</div>';
518}
519
2b3447c3 520function scorm_view_display ($user, $scorm, $action, $cm, $boxwidth='') {
e4aa175a 521 global $CFG;
5c1ac70c 522
e4aa175a 523 $organization = optional_param('organization', '', PARAM_INT);
524
2b3447c3 525 print_simple_box_start('center',$boxwidth);
e4aa175a 526?>
527 <div class="structurehead"><?php print_string('coursestruct','scorm') ?></div>
528<?php
529 if (empty($organization)) {
530 $organization = $scorm->launch;
531 }
532 if ($orgs = get_records_select_menu('scorm_scoes',"scorm='$scorm->id' AND organization='' AND launch=''",'id','id,title')) {
533 if (count($orgs) > 1) {
534 ?>
535 <div class='center'>
536 <?php print_string('organizations','scorm') ?>
b7dc2256 537 <form id='changeorg' method='post' action='<?php echo $action ?>'>
e4aa175a 538 <?php choose_from_menu($orgs, 'organization', "$organization", '','submit()') ?>
539 </form>
540 </div>
541<?php
542 }
543 }
544 $orgidentifier = '';
b3659259 545 if ($sco = scorm_get_sco($organization, SCO_ONLY)) {
546 if (($sco->organization == '') && ($sco->launch == '')) {
547 $orgidentifier = $sco->identifier;
e4aa175a 548 } else {
b3659259 549 $orgidentifier = $sco->organization;
e4aa175a 550 }
551 }
2b3447c3 552 $scorm->version = strtolower(clean_param($scorm->version, PARAM_SAFEDIR)); // Just to be safe
dbe7e6f6 553 if (!file_exists($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'lib.php')) {
554 $scorm->version = 'scorm_12';
555 }
2b3447c3 556 require_once($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'lib.php');
557
e4aa175a 558 $result = scorm_get_toc($user,$scorm,'structlist',$orgidentifier);
559 $incomplete = $result->incomplete;
e4aa175a 560 echo $result->toc;
e4aa175a 561 print_simple_box_end();
562?>
563 <div class="center">
b7dc2256 564 <form id="theform" method="post" action="<?php echo $CFG->wwwroot ?>/mod/scorm/player.php?id=<?php echo $cm->id ?>"<?php echo $scorm->popup == 1?' target="newwin"':'' ?>>
e4aa175a 565 <?php
e4aa175a 566 if ($scorm->hidebrowse == 0) {
567 print_string("mode","scorm");
568 echo ': <input type="radio" id="b" name="mode" value="browse" /><label for="b">'.get_string('browse','scorm').'</label>'."\n";
569 if ($incomplete === true) {
570 echo '<input type="radio" id="n" name="mode" value="normal" checked="checked" /><label for="n">'.get_string('normal','scorm')."</label>\n";
a30b6819 571 } else {
572 echo '<input type="radio" id="r" name="mode" value="review" checked="checked" /><label for="r">'.get_string('review','scorm')."</label>\n";
e4aa175a 573 }
574 } else {
575 if ($incomplete === true) {
576 echo '<input type="hidden" name="mode" value="normal" />'."\n";
577 } else {
578 echo '<input type="hidden" name="mode" value="review" />'."\n";
579 }
580 }
581 if (($incomplete === false) && (($result->attemptleft > 0)||($scorm->maxattempt == 0))) {
582?>
583 <br />
584 <input type="checkbox" id="a" name="newattempt" />
585 <label for="a"><?php print_string('newattempt','scorm') ?></label>
586<?php
587 }
588 ?>
589 <br />
590 <input type="hidden" name="scoid" />
591 <input type="hidden" name="currentorg" value="<?php echo $orgidentifier ?>" />
592 <input type="submit" value="<?php print_string('entercourse','scorm') ?>" />
593 </form>
594 </div>
595<?php
596}
597
8e45ba45 598function scorm_simple_play($scorm,$user) {
599 $result = false;
600 $scoes = get_records_select('scorm_scoes','scorm='.$scorm->id.' AND launch<>""');
601 if (count($scoes) == 1) {
602 if ($scorm->skipview >= 1) {
603 $sco = current($scoes);
604 if (scorm_get_tracks($sco->id,$user->id) === false) {
605 header('Location: player.php?a='.$scorm->id.'&scoid='.$sco->id);
606 $result = true;
607 } else if ($scorm->skipview == 2) {
608 header('Location: player.php?a='.$scorm->id.'&scoid='.$sco->id);
609 $result = true;
610 }
611 }
612 }
613 return $result;
614}
615
a30b6819 616function scorm_parse($scorm) {
617 global $CFG,$repositoryconfigfile;
618
619 // Parse scorm manifest
620 if ($scorm->pkgtype == 'AICC') {
621 require_once('datamodels/aicclib.php');
622 $scorm->launch = scorm_parse_aicc($scorm->dir.'/'.$scorm->id,$scorm->id);
623 } else {
624 require_once('datamodels/scormlib.php');
625 $reference = $scorm->reference;
626 if ($scorm->reference[0] == '#') {
627 require_once($repositoryconfigfile);
628 $reference = $CFG->repository.substr($scorm->reference,1).'/imsmanifest.xml';
629 } else if (substr($reference,0,7) != 'http://') {
630 $reference = $CFG->dataroot.'/'.$scorm->course.'/'.$scorm->reference;
631 }
632
633 if (basename($reference) != 'imsmanifest.xml') {
634 $scorm->launch = scorm_parse_scorm($scorm->dir.'/'.$scorm->id,$scorm->id);
635 } else {
636 $scorm->launch = scorm_parse_scorm(dirname($reference),$scorm->id);
637 }
638 }
639 return $scorm->launch;
640}
641
e4aa175a 642?>