ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.ilObjSCORM2004LearningModule.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5require_once "./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php";
6
16{
18// var $meta_data;
19
20 const CONVERT_XSL = './Modules/Scorm2004/templates/xsl/op/scorm12To2004.xsl';
21 const WRAPPER_HTML = './Modules/Scorm2004/scripts/converter/GenericRunTimeWrapper1.0_aadlc/GenericRunTimeWrapper.htm';
22 const WRAPPER_JS = './Modules/Scorm2004/scripts/converter/GenericRunTimeWrapper1.0_aadlc/SCOPlayerWrapper.js';
23
30 function ilObjSCORM2004LearningModule($a_id = 0, $a_call_by_reference = true)
31 {
32 $this->type = "sahs";
33 parent::ilObject($a_id,$a_call_by_reference);
34 }
35
41 function setImportSequencing($a_val)
42 {
43 $this->import_sequencing = $a_val;
44 }
45
52 {
53 return $this->import_sequencing;
54 }
55
62 function validate($directory)
63 {
64 //$this->validator =& new ilObjSCORMValidator($directory);
65 //$returnValue = $this->validator->validate();
66 return true;
67 }
68
73 function readObject()
74 {
75 global $ilias, $lng ,$ilDB;
76
77 //check for MYSQL 4.1 and json_encode,json_decode
78 if (!function_exists('json_encode') || !function_exists('json_decode') || ($ilDB->getDBType() == 'mysql' && !$ilDB->isMysql4_1OrHigher())) {
79 $ilias->raiseError($lng->txt('scplayer_phpmysqlcheck'),$ilias->error_obj->WARNING);
80 }
81
82 $needs_convert = false;
83
84 // convert imsmanifest.xml file in iso to utf8 if needed
85
86 $manifest_file = $this->getDataDirectory()."/imsmanifest.xml";
87
88 // check if manifestfile exists and space left on device...
89 $check_for_manifest_file = is_file($manifest_file);
90
91
92
93 // if no manifestfile
94 if (!$check_for_manifest_file)
95 {
96 $this->ilias->raiseError($this->lng->txt("Manifestfile $manifest_file not found!"), $this->ilias->error_obj->MESSAGE);
97 return;
98 }
99
100
101 if ($check_for_manifest_file)
102 {
103 $manifest_file_array = file($manifest_file);
104
105 foreach($manifest_file_array as $mfa)
106 {
107 // if (seems_not_utf8($mfa))
108 if (@iconv('UTF-8', 'UTF-8', $mfa) != $mfa)
109 {
110 $needs_convert = true;
111 break;
112 }
113 }
114
115
116
117 // to copy the file we need some extraspace, counted in bytes *2 ... we need 2 copies....
118 $estimated_manifest_filesize = filesize($manifest_file) * 2;
119
120 // i deactivated this, because it seems to fail on some windows systems (see bug #1795)
121 //$check_disc_free = disk_free_space($this->getDataDirectory()) - $estimated_manifest_filesize;
122 $check_disc_free = 2;
123 }
124
125
126 // if $manifest_file needs to be converted to UTF8
127 if ($needs_convert)
128 {
129 // if file exists and enough space left on device
130 if ($check_for_manifest_file && ($check_disc_free > 1))
131 {
132
133 // create backup from original
134 if (!copy($manifest_file, $manifest_file.".old"))
135 {
136 echo "Failed to copy $manifest_file...<br>\n";
137 }
138
139 // read backupfile, convert each line to utf8, write line to new file
140 // php < 4.3 style
141 $f_write_handler = fopen($manifest_file.".new", "w");
142 $f_read_handler = fopen($manifest_file.".old", "r");
143 while (!feof($f_read_handler))
144 {
145 $zeile = fgets($f_read_handler);
146 //echo mb_detect_encoding($zeile);
147 fputs($f_write_handler, utf8_encode($zeile));
148 }
149 fclose($f_read_handler);
150 fclose($f_write_handler);
151
152 // copy new utf8-file to imsmanifest.xml
153 if (!copy($manifest_file.".new", $manifest_file))
154 {
155 echo "Failed to copy $manifest_file...<br>\n";
156 }
157
158 if (!@is_file($manifest_file))
159 {
160 $this->ilias->raiseError($this->lng->txt("cont_no_manifest"),
161 $this->ilias->error_obj->WARNING);
162 }
163 }
164 else
165 {
166 // gives out the specific error
167
168 if (!($check_disc_free > 1))
169 $this->ilias->raiseError($this->lng->txt("Not enough space left on device!"),$this->ilias->error_obj->MESSAGE);
170 return;
171 }
172
173 }
174 else
175 {
176 // check whether file starts with BOM (that confuses some sax parsers, see bug #1795)
177 $hmani = fopen($manifest_file, "r");
178 $start = fread($hmani, 3);
179 if (strtolower(bin2hex($start)) == "efbbbf")
180 {
181 $f_write_handler = fopen($manifest_file.".new", "w");
182 while (!feof($hmani))
183 {
184 $n = fread($hmani, 900);
185 fputs($f_write_handler, $n);
186 }
187 fclose($f_write_handler);
188 fclose($hmani);
189
190 // copy new utf8-file to imsmanifest.xml
191 if (!copy($manifest_file.".new", $manifest_file))
192 {
193 echo "Failed to copy $manifest_file...<br>\n";
194 }
195 }
196 else
197 {
198 fclose($hmani);
199 }
200 }
201
202 //validate the XML-Files in the SCORM-Package
203 if ($_POST["validate"] == "y")
204 {
205 if (!$this->validate($this->getDataDirectory()))
206 {
207 $this->ilias->raiseError("<b>Validation Error(s):</b><br>".$this->getValidationSummary(),
208 $this->ilias->error_obj->WARNING);
209 }
210 }
211
212
213 //check for SCORM 1.2
214 $this->convert_1_2_to_2004($manifest_file);
215
216 // start SCORM 2004 package parser/importer
217 include_once ("./Modules/Scorm2004/classes/ilSCORM13Package.php");
218 $newPack = new ilSCORM13Package();
219 if ($this->getEditable())
220 {
221 return $newPack->il_importLM($this,$this->getDataDirectory(),
222 $this->getImportSequencing());
223 }
224 else
225 {
226 return $newPack->il_import($this->getDataDirectory(),$this->getId(),$this->ilias,$_POST["validate"]);
227 }
228 }
229
230
231 public function fixReload() {
232 $out = file_get_contents($this->imsmanifestFile);
233 $check ='/xmlns="http:\/\/www.imsglobal.org\/xsd\/imscp_v1p1"/';
234 $replace="xmlns=\"http://www.imsproject.org/xsd/imscp_rootv1p1p2\"";
235 $out=preg_replace($check, $replace, $out);
236 file_put_contents($this->imsmanifestFile, $out);
237 }
238
239
240 public function convert_1_2_to_2004($manifest) {
241 global $ilDB, $ilLog;
242
243 ##check manifest-file for version. Check for schemaversion as this is a required element for SCORM 2004
244 ##accept 2004 3rd Edition an CAM 1.3 as valid schemas
245
246 //set variables
247 $this->packageFolder=$this->getDataDirectory();
248 $this->imsmanifestFile=$manifest;
249 $doc = new DomDocument();
250
251 //fix reload errors before loading
252 $this->fixReload();
253 $doc->load($this->imsmanifestFile);
254 $elements = $doc->getElementsByTagName("schemaversion");
255 $schema=$elements->item(0)->nodeValue;
256 if (strtolower(trim($schema))=="cam 1.3" || strtolower(trim($schema))=="2004 3rd edition" || strtolower(trim($schema))=="2004 4th edition") {
257 //no conversion
258 $this->converted=false;
259 return true;
260
261 } else {
262 $this->converted=true;
263 //convert to SCORM 2004
264
265 //check for broken SCORM 1.2 manifest file (missing organization default-common error in a lot of manifest files)
266 $organizations = $doc->getElementsByTagName("organizations");
267 //first check if organizations is in manifest
268 if ($organizations->item(0)==null) die("organizations missing in manifest");
269 $default=$organizations->item(0)->getAttribute("default");
270 if ($default=="" || $default==null) {
271 //lookup identifier
272 $organization = $doc->getElementsByTagName("organization");
273 $ident=$organization->item(0)->getAttribute("identifier");
274 $organizations->item(0)->setAttribute("default",$ident);
275 }
276
277 //validate the fixed mainfest. If it's still not valid, don't transform an throw error
278
279
280 //first copy wrappers
281 $wrapperdir=$this->packageFolder."/GenericRunTimeWrapper1.0_aadlc";
282 mkdir($wrapperdir);
283 copy(self::WRAPPER_HTML,$wrapperdir."/GenericRunTimeWrapper.htm");
284 copy(self::WRAPPER_JS,$wrapperdir."/SCOPlayerWrapper.js");
285
286 //backup manifestfile
287 $this->backupManifest=$this->packageFolder."/imsmanifest.xml.back";
288 $ret=copy($this->imsmanifestFile,$this->backupManifest);
289
290 //transform manifest file
291 $this->totransform = $doc;
292 $ilLog->write("SCORM: about to transform to SCORM 2004");
293
294 $xsl = new DOMDocument;
295 $xsl->async = false;
296 $xsl->load(self::CONVERT_XSL);
297 $prc = new XSLTProcessor;
298 $r = @$prc->importStyleSheet($xsl);
299
300 file_put_contents($this->imsmanifestFile, $prc->transformToXML($this->totransform));
301
302 $ilLog->write("SCORM: Transformation completed");
303 return true;
304 }
305
306 }
307
315 public static function _lookupLastAccess($a_obj_id, $a_usr_id)
316 {
317 global $ilDB;
318
319 $result = $ilDB->queryF('
320 SELECT MAX(c_timestamp) last_access
321 FROM cmi_node, cp_node
322 WHERE cmi_node.cp_node_id = cp_node.cp_node_id
323 AND cp_node.slm_id = %s
324 AND user_id = %s
325 GROUP BY c_timestamp',
326 array('integer', 'integer'),
327 array($a_obj_id, $a_usr_id));
328 if ($ilDB->numRows($result))
329 {
330 $row = $ilDB->fetchAssoc($result);
331 return $row["last_access"];
332 }
333
334 return "";
335 }
336
340 // function getTrackedUsers($a_search)
341 // {
342 // global $ilUser, $ilDB, $ilUser;
343
344 // $sco_set = $ilDB->queryF('
345 // SELECT DISTINCT user_id,MAX(c_timestamp) last_access
346 // FROM cmi_node, cp_node
347 // WHERE cmi_node.cp_node_id = cp_node.cp_node_id
348 // AND cp_node.slm_id = %s
349 // GROUP BY user_id',
350 // array('integer'),
351 // array($this->getId()));
352
353 // $items = array();
354 // $temp = array();
355
356 // while($sco_rec = $ilDB->fetchAssoc($sco_set))
357 // {
358 // $name = ilObjUser::_lookupName($sco_rec["user_id"]);
359 // if ($sco_rec['last_access'] != 0) {
360// // $sco_rec['last_access'] = $sco_rec['last_access'];
361 // } else {
362 // $sco_rec['last_access'] = "";
363 // }
364 // if (ilObject::_exists($sco_rec['user_id']) && ilObject::_lookUpType($sco_rec['user_id'])=="usr" ) {
365 // $user = new ilObjUser($sco_rec['user_id']);
366 // $temp = array("user_full_name" => $name["lastname"].", ".
367 // $name["firstname"]." [".ilObjUser::_lookupLogin($sco_rec["user_id"])."]",
368 // "user_id" => $sco_rec["user_id"],"last_access" => $sco_rec['last_access'],
369 // "version"=> $this->getModuleVersionForUser($sco_rec["user_id"]),
370 // "attempts" => $this->getAttemptsForUser($sco_rec["user_id"]),
371 // "username" => $user->getLastname().", ".$user->getFirstname()
372 // );
373 // if ($a_search != "" && (strpos(strtolower($user->getLastname()), strtolower($a_search)) !== false || strpos(strtolower($user->getFirstname()), strtolower($a_search)) !== false ) ) {
374 // $items[] = $temp;
375 // } else if ($a_search == "") {
376 // $items[] = $temp;
377 // }
378 // }
379 // }
380
381 // return $items;
382 // }
383
384 function deleteTrackingDataOfUsers($a_users)
385 {
386 global $ilDB;
387 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004DeleteData.php");
388 include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
389
390 foreach($a_users as $user)
391 {
394 }
395 }
396
397
402 {
403 global $ilUser, $ilDB, $ilUser;
404
405 $sco_set = $ilDB->queryF('
406 SELECT DISTINCT cmi_node.cp_node_id id
407 FROM cp_node, cmi_node
408 WHERE slm_id = %s
409 AND cp_node.cp_node_id = cmi_node.cp_node_id
410 ORDER BY cp_node.cp_node_id ',
411 array('integer'),
412 array($this->getId()));
413
414 $items = array();
415
416 while($sco_rec = $ilDB->fetchAssoc($sco_set))
417 {
418 $item['id']=$sco_rec["id"];
419 $item['title']=self::_lookupItemTitle($sco_rec["id"]);
420 $items[count($items)] =$item;
421
422 }
423 return $items;
424 }
425
426
427 function getTrackingDataAgg($a_user_id, $raw = false)
428 {
429 global $ilDB;
430
431 $scos = array();
432 $data = array();
433 //get all SCO's of this object
434
435 $val_set = $ilDB->queryF(
436 'SELECT cp_node_id FROM cp_node
437 WHERE nodename = %s
438 AND cp_node.slm_id = %s',
439 array('text', 'integer'),
440 array('item',$this->getId())
441 );
442 while($val_rec = $ilDB->fetchAssoc($val_set))
443 {
444 array_push($scos,$val_rec['cp_node_id']);
445 }
446
447 foreach ($scos as $sco)
448 {
449 $data_set = $ilDB->queryF('
450 SELECT c_timestamp last_access, total_time, success_status, completion_status,
451 c_raw, scaled, cp_node_id
452 FROM cmi_node
453 WHERE cp_node_id = %s
454 AND user_id = %s',
455 array('integer','integer'),
456 array($sco,$a_user_id)
457 );
458
459 while($data_rec = $ilDB->fetchAssoc($data_set))
460 {
461 if ($data_rec["success_status"]!="" && $data_rec["success_status"]!="unknown") {
462 $status = $data_rec["success_status"];
463 } else {
464 if ($data_rec["completion_status"]=="") {
465 $status="unknown";
466 } else {
467 $status = $data_rec["completion_status"];
468 }
469 }
470 if(!$raw)
471 {
472 $time = ilFormat::_secondsToString(self::_ISODurationToCentisec($data_rec["total_time"])/100);
473 $score = "";
474 if ($data_rec["c_raw"] != null) {
475 $score = $data_rec["c_raw"];
476 if ($data_rec["scaled"] != null) $score .= " = ";
477 }
478 if ($data_rec["scaled"] != null) $score .= ($data_rec["scaled"]*100)."%";
479 $title = self::_lookupItemTitle($data_rec["cp_node_id"]);
480 $last_access=ilDatePresentation::formatDate(new ilDateTime($data_rec['last_access'],IL_CAL_UNIX));
481 $data[] = array("user_id" => $data_rec["user_id"], "sco_id"=>$data_rec["cp_node_id"],
482 "score" => $score, "time" => $time, "status" => $status,"last_access"=>$last_access,"title"=>$title);
483 }
484 else
485 {
486 $data_rec["total_time"] = self::_ISODurationToCentisec($data_rec["total_time"])/100;
487 $data[$data_rec["cp_node_id"]] = $data_rec;
488 }
489 }
490 }
491
492
493 return $data;
494 }
495
499 function getAttemptsForUser($a_user_id){
500 global $ilDB;
501 $val_set = $ilDB->queryF('SELECT package_attempts FROM sahs_user WHERE user_id = %s AND obj_id = %s',
502 array('integer','integer'),
503 array($a_user_id, $this->getId()));
504
505 $val_rec = $ilDB->fetchAssoc($val_set);
506
507 if ($val_rec["package_attempts"] == null) {
508 $val_rec["package_attempts"]="";
509 }
510
511 return $val_rec["package_attempts"];
512 }
513
514
518 function getModuleVersionForUser($a_user_id){
519 global $ilDB;
520 $val_set = $ilDB->queryF('SELECT module_version FROM sahs_user WHERE user_id = %s AND obj_id = %s',
521 array('integer','integer'),
522 array($a_user_id, $this->getId()));
523
524 $val_rec = $ilDB->fetchAssoc($val_set);
525
526 if ($val_rec["module_version"] == null) {
527 $val_rec["module_version"]="";
528 }
529 return $val_rec["module_version"];
530 }
531
532
533 // function exportSelected($a_exportall = 0, $a_user = array())
534 // {
535 // include_once("./Modules/Scorm2004/classes/class.ilSCORM2004TrackingItemsExport.php");
536 // ilSCORM2004TrackingItemsExport::exportSelected($a_exportall = 0, $a_user = array());
537 // }
538
539
540
541 function importSuccess($a_file) {
542 global $ilDB, $ilUser;
543 include_once("./Services/Tracking/classes/class.ilLPStatus.php");
544 $scos = array();
545 //get all SCO's of this object ONLY RELEVANT!
546 include_once './Services/Object/classes/class.ilObjectLP.php';
547 $olp = ilObjectLP::getInstance($this->getId());
548 $collection = $olp->getCollectionInstance();
549 if($collection)
550 {
551 $scos = $collection->getItems();
552 }
553
554 $fhandle = fopen($a_file, "r");
555
556 $obj_id = $this->getID();
557 $users = array();
558
559 $fields = fgetcsv($fhandle, 4096, ';');
560 while(($csv_rows = fgetcsv($fhandle, 4096, ";")) !== FALSE) {
561 $data = array_combine($fields, $csv_rows);
562 //no check the format - sufficient to import users
563 if ($data["Login"]) $user_id = $this->get_user_id($data["Login"]);
564 if ($data["login"]) $user_id = $this->get_user_id($data["login"]);
565 //add mail in future
566 if ($data["user"] && is_int($data["user"])) $user_id = $data["user"];
567 if ($user_id>0) {
568 $last_access = ilUtil::now();
569 if ($data['Date']) {
570 $date_ex = explode('.', $data['Date']);
571 $last_access = implode('-', array($date_ex[2], $date_ex[1], $date_ex[0]));
572 }
573 if ($data['LastAccess']) {
574 $last_access = $data['LastAccess'];
575 }
576
578 // $users[] = $user_id;
579 if ($data["Status"]) {
580 if (is_int($data["Status"])) $status = $data["Status"];
584 }
585 $attempts = null;
586 if($data["Attempts"]) $attempts = $data["Attempts"];
587
588 $percentage_completed = 0;
589 if ($status == ilLPStatus::LP_STATUS_COMPLETED_NUM) $percentage_completed = 100;
590 if ($data['percentageCompletedSCOs']) $percentage_completed = $data['percentageCompletedSCOs'];
591
592 $sco_total_time_sec = null;
593 if ($data['SumTotal_timeSeconds']) $sco_total_time_sec = $data['SumTotal_timeSeconds'];
594
595 $this->importSuccessForSahsUser($user_id, $last_access, $status, $attempts, $percentage_completed, $sco_total_time_sec);
596
598 foreach ($scos as $sco_id)
599 {
600 $res = $ilDB->queryF('
601 SELECT * FROM cmi_node WHERE cp_node_id = %s AND user_id = %s AND (completion_status = %s OR success_status = %s)',
602 array('integer','integer','text','text'),
603 array($sco_id,$user_id,'completed','passed'));
604
605 if(!$ilDB->numRows($res))
606 {
607 $nextId = $ilDB->nextId('cmi_node');
608 $val_set = $ilDB->manipulateF('INSERT INTO cmi_node
609 (cp_node_id,user_id,completion_status,c_timestamp,cmi_node_id)
610 VALUES(%s,%s,%s,%s,%s)',
611 array('integer','integer','text','timestamp','integer'),
612 array($sco_id,$user_id,'completed',$last_access,$nextId));
613 } else {
614 $ilDB->update('cmi_node',
615 array(
616 'completion_status' => array('text', 'completed'),
617 'success_status' => array('text', ''),
618 'c_timestamp' => array('timestamp', $last_access)
619 ),
620 array(
621 'user_id' => array('integer', $user_id),
622 'cp_node_id' => array('integer', $sco_id)
623 )
624 );
625 }
626 }
627
628 }
629 } else {
630 //echo "Warning! User $csv_rows[0] does not exist in ILIAS. Data for this user was skipped.\n";
631 }
632 }
633
634 // update learning progress
635 include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
637
638 return 0;
639 }
640
647 function _ISODurationToCentisec($str) {
648 $aV = array(0, 0, 0, 0, 0, 0);
649 $bErr = false;
650 $bTFound = false;
651 if (strpos($str,"P") != 0) {
652 $bErr = true;
653 }
654 if (!$bErr) {
655 $aT = array("Y", "M", "D", "H", "M", "S");
656 $p = 0;
657 $i = 0;
658 $str = substr($str,1);
659 for ($i = 0; $i < count($aT); $i++) {
660 if (strpos($str,"T")===0) {
661 $str = substr($str,1);
662 $i = max($i, 3);
663 $bTFound = true;
664 }
665 $p = strpos($str,$aT[$i]);
666
667 if ($p > -1) {
668 if ($i == 1 && strpos($str,"T") > -1 && strpos($str,"T") < $p) {
669 continue;
670 }
671 if ($aT[$i] == "S") {
672 $aV[$i] = substr($str,0, $p);
673
674 } else {
675 $aV[$i] = intval(substr($str,0, $p));
676 }
677 if (!is_numeric($aV[$i])) {
678 $bErr = true;
679 break;
680 } else if ($i > 2 && !$bTFound) {
681 $bErr = true;
682 break;
683 }
684 $str = substr($str,$p + 1);
685
686 }
687 }
688 if (!$bErr && strlen($str) != 0) {
689 $bErr = true;
690
691 }
692 }
693
694 if ($bErr) {
695 return;
696 }
697 return $aV[0] * 3155760000 + $aV[1] * 262980000 + $aV[2] * 8640000 + $aV[3] * 360000 + $aV[4] * 6000 + round($aV[5] * 100);
698 }
699
700 function getCourseCompletionForUser($a_user)
701 {
702 global $ilDB, $ilUser;
703
704 $scos = array();
705 //get all SCO's of this object
706
707 $val_set = $ilDB->queryF('
708 SELECT cp_node.cp_node_id FROM cp_node,cp_resource,cp_item
709 WHERE cp_item.cp_node_id = cp_node.cp_node_id
710 AND cp_item.resourceid = cp_resource.id
711 AND scormtype = %s
712 AND nodename = %s
713 AND cp_node.slm_id = %s ',
714 array('text','text','integer'),
715 array('sco','item',$this->getId()));
716
717 while ($val_rec = $ilDB->fetchAssoc($val_set))
718 {
719 array_push($scos,$val_rec['cp_node_id']);
720 }
721
722
723 $scos_c = $scos;
724 //copy SCO_array
725 //check if all SCO's are completed
726 for ($i=0;$i<count($scos);$i++)
727 {
728
729 $val_set = $ilDB->queryF('
730 SELECT * FROM cmi_node
731 WHERE (user_id= %s
732 AND cp_node_id= %s
733 AND (completion_status=%s OR success_status=%s))',
734 array('integer','integer','text', 'text'),
735 array($a_user,$scos[$i],'completed','passed')
736 );
737
738 if ($ilDB->numRows($val_set) > 0) {
739 //delete from array
740 $key = array_search($scos[$i], $scos_c);
741 unset ($scos_c[$key]);
742 }
743
744 }
745 //check for completion
746 if (count($scos_c) == 0) {
747 $completion = true;
748 } else {
749 $completion = false;
750 }
751 return $completion;
752 }
753
760 public static function _getCourseCompletionForUser($a_id, $a_user)
761 {
762 global $ilDB, $ilUser;
763 $scos = array();
764 //get all SCO's of the object
765
766 $val_set = $ilDB->queryF('
767 SELECT cp_node.cp_node_id FROM cp_node,cp_resource,cp_item
768 WHERE cp_item.cp_node_id = cp_node.cp_node_id
769 AND cp_item.resourceid = cp_resource.id
770 AND scormtype = %s
771 AND nodename = %s
772 AND cp_node.slm_id = %s',
773 array('text','text','integer'), array('sco' ,'item',$a_id));
774 while ($val_rec = $ilDB->fetchAssoc($val_set))
775 {
776 array_push($scos,$val_rec['cp_node_id']);
777 }
778
779 $scos_c = $scos;
780 //copy SCO_array
781 //check if all SCO's are completed
782 for ($i=0;$i<count($scos);$i++)
783 {
784
785 $val_set = $ilDB->queryF('
786 SELECT * FROM cmi_node
787 WHERE (user_id= %s
788 AND cp_node_id= %s
789 AND (completion_status = %s OR success_status = %s))',
790 array('integer','integer','text','text'),
791 array($a_user,$scos[$i],'completed','passed'));
792
793 if ($ilDB->numRows($val_set) > 0)
794 {
795 //delete from array
796 $key = array_search($scos[$i], $scos_c);
797 unset ($scos_c[$key]);
798 }
799
800 }
801 //check for completion
802 if (count($scos_c) == 0) {
803 $completion = true;
804 } else {
805 $completion = false;
806 }
807 return $completion;
808 }
809
817 public static function _getUniqueScaledScoreForUser($a_id, $a_user)
818 {
819 global $ilDB, $ilUser;
820 $scos = array();
821
822 $val_set = $ilDB->queryF("SELECT cp_node.cp_node_id FROM cp_node,cp_resource,cp_item WHERE".
823 " cp_item.cp_node_id=cp_node.cp_node_id AND cp_item.resourceId = cp_resource.id AND scormType='sco' AND nodeName='item' AND cp_node.slm_id = %s GROUP BY cp_node.cp_node_id",
824 array('integer'),
825 array($a_id)
826 );
827 while ($val_rec = $ilDB->fetchAssoc($val_set))
828 {
829 array_push($scos,$val_rec['cp_node_id']);
830 }
831 $set = 0; //numbers of SCO that set cmi.score.scaled
832 $scaled = null;
833 for ($i=0;$i<count($scos);$i++)
834 {
835 $val_set = $ilDB->queryF("SELECT scaled FROM cmi_node WHERE (user_id = %s AND cp_node_id = %s)",
836 array('integer', 'integer'),
837 array($a_user, $scos[$i])
838 );
839 if ($val_set->numRows()>0)
840 {
841 $val_rec = $ilDB->fetchAssoc($val_set);
842 if ($val_rec['scaled']!=NULL) {
843 $set++;
844 $scaled = $val_rec['scaled'];
845 }
846 }
847 }
848 $retVal = ($set == 1) ? $scaled : null ;
849 return $retVal;
850 }
851
860 function _getTrackingItems($a_obj_id)
861 {
862 global $ilDB;
863
864
865 $item_set = $ilDB->queryF('
866 SELECT cp_item.* FROM cp_node, cp_item WHERE slm_id = %s
867 AND cp_node.cp_node_id = cp_item.cp_node_id
868 ORDER BY cp_node.cp_node_id ',
869 array('integer'),
870 array($a_obj_id)
871 );
872
873 $items = array();
874 while ($item_rec = $ilDB->fetchAssoc($item_set))
875 {
876
877 $s2 = $ilDB->queryF('
878 SELECT cp_resource.* FROM cp_node, cp_resource
879 WHERE slm_id = %s
880 AND cp_node.cp_node_id = cp_resource.cp_node_id
881 AND cp_resource.id = %s ',
882 array('integer','text'),
883 array($a_obj_id,$item_rec["resourceid"])
884 );
885
886
887 if ($res = $ilDB->fetchAssoc($s2))
888
889 {
890 if ($res["scormtype"] == "sco")
891 {
892 $items[] = array("id" => $item_rec["cp_node_id"],
893 "title" => $item_rec["title"]);
894 }
895 }
896 }
897
898 return $items;
899 }
900
901 static function _getStatus($a_obj_id, $a_user_id)
902 {
903 global $ilDB;
904
905 $status_set = $ilDB->queryF('
906 SELECT * FROM cmi_gobjective
907 WHERE scope_id = %s
908 AND objective_id = %s
909 AND user_id = %s',
910 array('integer','text','integer'),
911 array($a_obj_id,'course_overall_status',$a_user_id)
912 );
913
914 if ($status_rec = $ilDB->fetchAssoc($status_set))
915 {
916 return $status_rec["status"];
917 }
918
919 return false;
920 }
921
922 static function _getSatisfied($a_obj_id, $a_user_id)
923 {
924 global $ilDB;
925
926
927 $status_set = $ilDB->queryF('
928 SELECT * FROM cmi_gobjective
929 WHERE scope_id = %s
930 AND objective_id = %s
931 AND user_id = %s',
932 array('integer','text','integer'),
933 array($a_obj_id,'course_overall_status',$a_user_id)
934 );
935
936 if ($status_rec = $ilDB->fetchAssoc($status_set))
937 {
938 return $status_rec["satisfied"];
939 }
940
941 return false;
942 }
943
944 static function _getMeasure($a_obj_id, $a_user_id)
945 {
946 global $ilDB;
947
948 $status_set = $ilDB->queryF('
949 SELECT * FROM cmi_gobjective
950 WHERE scope_id = %s
951 AND objective_id = %s
952 AND user_id = %s',
953 array('integer','text','integer'),
954 array($a_obj_id,'course_overall_status',$a_user_id)
955 );
956
957 if ($status_rec = $ilDB->fetchAssoc($status_set))
958 {
959 return $status_rec["measure"];
960 }
961
962 return false;
963 }
964
965 static function _lookupItemTitle($a_node_id)
966 {
967 global $ilDB;
968
969 $r = $ilDB->queryF('
970 SELECT * FROM cp_item
971 WHERE cp_node_id = %s',
972 array('integer'),
973 array($a_node_id)
974 );
975
976 if ($i = $ilDB->fetchAssoc($r))
977 {
978 return $i["title"];
979 }
980 return "";
981 }
982
987 {
988 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Tree.php");
989 $this->slm_tree = new ilSCORM2004Tree($this->getId());
990
991 //$this->slm_tree =& new ilTree($this->getId());
992 //$this->slm_tree->setTreeTablePK("slm_id");
993 //$this->slm_tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
994 $this->slm_tree->addTree($this->getId(), 1);
995
996 //add seqinfo for rootNode
997 include_once ("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Sequencing.php");
998 $seq_info = new ilSCORM2004Sequencing($this->getId(),true);
999 $seq_info->insert();
1000 }
1001
1002 function getTree()
1003 {
1004 $this->slm_tree = new ilTree($this->getId());
1005 $this->slm_tree->setTreeTablePK("slm_id");
1006 $this->slm_tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
1007 return $this->slm_tree;
1008 }
1009
1011
1012 global $ilTabs;
1013 $ilTabs->setTabActive("sequencing");
1014
1015 include_once ("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Sequencing.php");
1016 $control_settings = new ilSCORM2004Sequencing($this->getId(),true);
1017
1018 return $control_settings;
1019 }
1020
1022 include_once ("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Sequencing.php");
1023
1024 $control_settings = new ilSCORM2004Sequencing($this->getId(),true);
1025 $control_settings->setChoice(ilUtil::yn2tf($_POST["choice"]));
1026 $control_settings->setFlow(ilUtil::yn2tf($_POST["flow"]));
1027 $control_settings->setForwardOnly(ilUtil::yn2tf($_POST["forwardonly"]));
1028 $control_settings->insert();
1029
1030 return true;
1031 }
1032
1041 function executeDragDrop($source_id, $target_id, $first_child, $as_subitem = false, $movecopy = "move")
1042 {
1043 $this->slm_tree = new ilTree($this->getId());
1044 $this->slm_tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
1045 $this->slm_tree->setTreeTablePK("slm_id");
1046
1047 require_once("./Modules/Scorm2004/classes/class.ilSCORM2004NodeFactory.php");
1048
1049 $source_obj = ilSCORM2004NodeFactory::getInstance($this, $source_id, true);
1050 //$source_obj->setLMId($this->getId());
1051
1052 if (!$first_child)
1053 {
1054 $target_obj = ilSCORM2004NodeFactory::getInstance($this, $target_id, true);
1055 //$target_obj->setLMId($this->getId());
1056 $target_parent = $this->slm_tree->getParentId($target_id);
1057 }
1058//echo "-".$source_obj->getType()."-";
1059 // handle pages
1060 if ($source_obj->getType() == "page")
1061 {
1062 if ($this->slm_tree->isInTree($source_obj->getId()))
1063 {
1064 $node_data = $this->slm_tree->getNodeData($source_obj->getId());
1065
1066 // cut on move
1067 if ($movecopy == "move")
1068 {
1069 $parent_id = $this->slm_tree->getParentId($source_obj->getId());
1070 $this->slm_tree->deleteTree($node_data);
1071
1072 // write history entry
1073/* require_once("./Services/History/classes/class.ilHistory.php");
1074 ilHistory::_createEntry($source_obj->getId(), "cut",
1075 array(ilLMObject::_lookupTitle($parent_id), $parent_id),
1076 $this->getType().":pg");
1077 ilHistory::_createEntry($parent_id, "cut_page",
1078 array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
1079 $this->getType().":st");
1080*/
1081 }
1082/* else // this is not implemented here
1083 {
1084 // copy page
1085 $new_page =& $source_obj->copy();
1086 $source_id = $new_page->getId();
1087 $source_obj =& $new_page;
1088 }
1089*/
1090
1091 // paste page
1092 if(!$this->slm_tree->isInTree($source_obj->getId()))
1093 {
1094 if ($first_child) // as first child
1095 {
1096 $target_pos = IL_FIRST_NODE;
1097 $parent = $target_id;
1098 }
1099 else if ($as_subitem) // as last child
1100 {
1101 $parent = $target_id;
1102 $target_pos = IL_FIRST_NODE;
1103 $pg_childs = $this->slm_tree->getChildsByType($parent, "page");
1104 if (count($pg_childs) != 0)
1105 {
1106 $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
1107 }
1108 }
1109 else // at position
1110 {
1111 $target_pos = $target_id;
1112 $parent = $target_parent;
1113 }
1114
1115 // insert page into tree
1116 $this->slm_tree->insertNode($source_obj->getId(),
1117 $parent, $target_pos);
1118
1119 // write history entry
1120/* if ($movecopy == "move")
1121 {
1122 // write history comments
1123 include_once("./Services/History/classes/class.ilHistory.php");
1124 ilHistory::_createEntry($source_obj->getId(), "paste",
1125 array(ilLMObject::_lookupTitle($parent), $parent),
1126 $this->getType().":pg");
1127 ilHistory::_createEntry($parent, "paste_page",
1128 array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
1129 $this->getType().":st");
1130 }
1131*/
1132
1133 }
1134 }
1135 }
1136
1137 // handle scos
1138 if ($source_obj->getType() == "sco" || $source_obj->getType() == "ass")
1139 {
1140//echo "2";
1141 $source_node = $this->slm_tree->getNodeData($source_id);
1142 $subnodes = $this->slm_tree->getSubtree($source_node);
1143
1144 // check, if target is within subtree
1145 foreach ($subnodes as $subnode)
1146 {
1147 if($subnode["obj_id"] == $target_id)
1148 {
1149 return;
1150 }
1151 }
1152
1153 $target_pos = $target_id;
1154
1155 if ($first_child) // as first sco
1156 {
1157 $target_pos = IL_FIRST_NODE;
1158 $target_parent = $target_id;
1159
1160 $pg_childs = $this->slm_tree->getChildsByType($target_parent, "page");
1161 if (count($pg_childs) != 0)
1162 {
1163 $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
1164 }
1165 }
1166 else if ($as_subitem) // as last sco
1167 {
1168 $target_parent = $target_id;
1169 $target_pos = IL_FIRST_NODE;
1170 $childs = $this->slm_tree->getChilds($target_parent);
1171 if (count($childs) != 0)
1172 {
1173 $target_pos = $childs[count($childs) - 1]["obj_id"];
1174 }
1175 }
1176
1177 // delete source tree
1178 if ($movecopy == "move")
1179 {
1180 $this->slm_tree->deleteTree($source_node);
1181 }
1182/* else
1183 {
1184 // copy chapter (incl. subcontents)
1185 $new_chapter =& $source_obj->copy($this->slm_tree, $target_parent, $target_pos);
1186 }
1187*/
1188
1189 if (!$this->slm_tree->isInTree($source_id))
1190 {
1191 $this->slm_tree->insertNode($source_id, $target_parent, $target_pos);
1192
1193 // insert moved tree
1194 if ($movecopy == "move")
1195 {
1196 foreach ($subnodes as $node)
1197 {
1198 if($node["obj_id"] != $source_id)
1199 {
1200 $this->slm_tree->insertNode($node["obj_id"], $node["parent"]);
1201 }
1202 }
1203 }
1204 }
1205
1206 // check the tree
1207// $this->checkTree();
1208 }
1209
1210 // handle chapters
1211 if ($source_obj->getType() == "chap")
1212 {
1213//echo "2";
1214 $source_node = $this->slm_tree->getNodeData($source_id);
1215 $subnodes = $this->slm_tree->getSubtree($source_node);
1216
1217 // check, if target is within subtree
1218 foreach ($subnodes as $subnode)
1219 {
1220 if($subnode["obj_id"] == $target_id)
1221 {
1222 return;
1223 }
1224 }
1225
1226 $target_pos = $target_id;
1227
1228 if ($first_child) // as first chapter
1229 {
1230 $target_pos = IL_FIRST_NODE;
1231 $target_parent = $target_id;
1232
1233 //$sco_childs = $this->slm_tree->getChildsByType($target_parent, "sco");
1234 //if (count($sco_childs) != 0)
1235 //{
1236 // $target_pos = $sco_childs[count($sco_childs) - 1]["obj_id"];
1237 //}
1238 }
1239 else if ($as_subitem) // as last chapter
1240 {
1241 $target_parent = $target_id;
1242 $target_pos = IL_FIRST_NODE;
1243 $childs = $this->slm_tree->getChilds($target_parent);
1244 if (count($childs) != 0)
1245 {
1246 $target_pos = $childs[count($childs) - 1]["obj_id"];
1247 }
1248 }
1249
1250 // delete source tree
1251 if ($movecopy == "move")
1252 {
1253 $this->slm_tree->deleteTree($source_node);
1254 }
1255/* else
1256 {
1257 // copy chapter (incl. subcontents)
1258 $new_chapter =& $source_obj->copy($this->slm_tree, $target_parent, $target_pos);
1259 }
1260*/
1261
1262 if (!$this->slm_tree->isInTree($source_id))
1263 {
1264 $this->slm_tree->insertNode($source_id, $target_parent, $target_pos);
1265
1266 // insert moved tree
1267 if ($movecopy == "move")
1268 {
1269 foreach ($subnodes as $node)
1270 {
1271 if($node["obj_id"] != $source_id)
1272 {
1273 $this->slm_tree->insertNode($node["obj_id"], $node["parent"]);
1274 }
1275 }
1276 }
1277 }
1278
1279 // check the tree
1280// $this->checkTree();
1281 }
1282
1283// $this->checkTree();
1284 }
1285
1287 {
1288 $file = array();
1289
1290 require_once("./Modules/Scorm2004/classes/class.ilSCORM2004Export.php");
1291
1292 $export = new ilSCORM2004Export($this);
1293 foreach ($export->getSupportedExportTypes() as $type)
1294 {
1295 $dir = $export->getExportDirectoryForType($type);
1296 // quit if import dir not available
1297 if (!@is_dir($dir) or !is_writeable($dir))
1298 {
1299 continue;
1300 }
1301 // open directory
1302 $cdir = dir($dir);
1303
1304 // get files and save the in the array
1305 while ($entry = $cdir->read())
1306 {
1307 if ($entry != "." and
1308 $entry != ".." and
1309 (
1310 ereg("^[0-9]{10}_{2}[0-9]+_{2}(".$this->getType()."_)*[0-9]+\.zip\$", $entry) or
1311 ereg("^[0-9]{10}_{2}[0-9]+_{2}(".$this->getType()."_)*[0-9]+\.pdf\$", $entry) or
1312 ereg("^[0-9]{10}_{2}[0-9]+_{2}(".$this->getType()."_)*[0-9]+\.iso\$", $entry)
1313 ))
1314 {
1315 $file[$entry.$type] = array("type" => $type, "file" => $entry,
1316 "size" => filesize($dir."/".$entry));
1317 }
1318 }
1319
1320 // close import directory
1321 $cdir->close();
1322 }
1323
1324 // sort files
1325 ksort ($file);
1326 reset ($file);
1327 return $file;
1328 }
1329
1333 function exportScorm($a_inst, $a_target_dir, $ver, &$expLog)
1334 {
1335
1336 $a_xml_writer = new ilXmlWriter;
1337
1338 // export metadata
1339 $this->exportXMLMetaData($a_xml_writer);
1340 $metadata_xml = $a_xml_writer->xmlDumpMem(false);
1341 $a_xml_writer->_XmlWriter;
1342
1343 $xsl = file_get_contents("./Modules/Scorm2004/templates/xsl/metadata.xsl");
1344 $args = array( '/_xml' => $metadata_xml , '/_xsl' => $xsl );
1345 $xh = xslt_create();
1346 $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args,NULL);
1347 xslt_free($xh);
1348 file_put_contents($a_target_dir.'/indexMD.xml',$output);
1349
1350 // export glossary
1351 if($this->getAssignedGlossary()!=0)
1352 {
1353 ilUtil::makeDir($a_target_dir."/glossary");
1354 include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
1355 include_once("./Modules/Glossary/classes/class.ilGlossaryExport.php");
1356 $glo_xml_writer = new ilXmlWriter();
1357
1358 $glo_xml_writer->xmlSetDtdDef("<!DOCTYPE ContentObject SYSTEM \"http://www.ilias.de/download/dtd/ilias_co_3_7.dtd\">");
1359 // set xml header
1360 $glo_xml_writer->xmlHeader();
1361 $glos = new ilObjGlossary($this->getAssignedGlossary(), false);
1362 //$glos->exportHTML($a_target_dir."/glossary", $expLog);
1363 $glos_export = new ilGlossaryExport($glos,"xml");
1364 $glos->exportXML($glo_xml_writer,$glos_export->getInstId(), $a_target_dir."/glossary", $expLog);
1365 $glo_xml_writer->xmlDumpFile($a_target_dir."/glossary/glossary.xml");
1366 $glo_xml_writer->_XmlWriter;
1367 }
1368
1369 $a_xml_writer = new ilXmlWriter;
1370 // set dtd definition
1371 $a_xml_writer->xmlSetDtdDef("<!DOCTYPE ContentObject SYSTEM \"http://www.ilias.de/download/dtd/ilias_co_3_7.dtd\">");
1372
1373 // set generated comment
1374 $a_xml_writer->xmlSetGenCmt("Export of ILIAS Content Module ". $this->getId()." of installation ".$a_inst.".");
1375
1376 // set xml header
1377 $a_xml_writer->xmlHeader();
1378
1379 global $ilBench;
1380
1381 $a_xml_writer->xmlStartTag("ContentObject", array("Type"=>"SCORM2004LearningModule"));
1382
1383 // MetaData
1384 $this->exportXMLMetaData($a_xml_writer);
1385
1386 $this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
1387
1388 // SCO Objects
1389 $expLog->write(date("[y-m-d H:i:s] ")."Start Export Sco Objects");
1390 $this->exportXMLScoObjects($a_inst, $a_target_dir, $ver, $expLog);
1391 $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Sco Objects");
1392
1393 $a_xml_writer->xmlEndTag("ContentObject");
1394 $a_xml_writer->xmlDumpFile($a_target_dir.'/index.xml', false);
1395
1396 if ($ver == "2004 4th") {
1397 $revision ="4th";
1398 $ver = "2004";
1399 }
1400
1401 if ($ver == "2004 3rd") {
1402 $revision ="3rd";
1403 $ver = "2004";
1404 }
1405
1406 // add content css (note: this is also done per item)
1407 $css_dir = $a_target_dir."/ilias_css_4_2";
1408 ilUtil::makeDir($css_dir);
1409 include_once("./Modules/Scorm2004/classes/class.ilScormExportUtil.php");
1410 ilScormExportUtil::exportContentCSS($this, $css_dir);
1411
1412 // add manifest
1413 include_once("./Modules/Scorm2004/classes/class.ilContObjectManifestBuilder.php");
1414 $manifestBuilder = new ilContObjectManifestBuilder($this);
1415 $manifestBuilder->buildManifest($ver,$revision);
1416 $manifestBuilder->dump($a_target_dir);
1417
1418 $xsl = file_get_contents("./Modules/Scorm2004/templates/xsl/module.xsl");
1419 $args = array( '/_xml' => file_get_contents($a_target_dir."/imsmanifest.xml"), '/_xsl' => $xsl );
1420 $xh = xslt_create();
1421 $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args,NULL);
1422 xslt_free($xh);
1423 fputs(fopen($a_target_dir.'/index.html','w+'),$output);
1424 // copy xsd files to target
1425 switch ($ver)
1426 {
1427 case "2004":
1428 if ($revision == "3rd") {
1429 ilUtil::rCopy('./Modules/Scorm2004/templates/xsd/adlcp_130_export_2004',$a_target_dir,false);
1430 }
1431
1432 if ($revision == "4th") {
1433 ilUtil::rCopy('./Modules/Scorm2004/templates/xsd/adlcp_130_export_2004_4th',$a_target_dir,false);
1434 }
1435 break;
1436 case "12":
1437 ilUtil::rCopy('./Modules/Scorm2004/templates/xsd/adlcp_120_export_12',$a_target_dir,false);
1438 break;
1439 }
1440
1441 $a_xml_writer->_XmlWriter;
1442 }
1443
1444
1445 function exportHTML4PDF($a_inst, $a_target_dir, &$expLog)
1446 {
1447 global $ilBench;
1448 $tree = new ilTree($this->getId());
1449 $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
1450 $tree->setTreeTablePK("slm_id");
1451 foreach($tree->getSubTree($tree->getNodeData($tree->getRootId()),true,'sco') as $sco)
1452 {
1453 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Sco.php");
1454 $sco_folder = $a_target_dir."/".$sco['obj_id'];
1455 ilUtil::makeDir($sco_folder);
1456 $node = new ilSCORM2004Sco($this,$sco['obj_id']);
1457 $node->exportHTML4PDF($a_inst, $sco_folder, $expLog);
1458 }
1459 }
1460
1461 function exportPDF($a_inst, $a_target_dir, &$expLog)
1462 {
1463 global $ilBench;
1464 $a_xml_writer = new ilXmlWriter;
1465 $a_xml_writer->xmlStartTag("ContentObject", array("Type"=>"SCORM2004SCO"));
1466 $this->exportXMLMetaData($a_xml_writer);
1467 $tree = new ilTree($this->getId());
1468 $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
1469 $tree->setTreeTablePK("slm_id");
1470 foreach($tree->getSubTree($tree->getNodeData($tree->getRootId()),true,'sco') as $sco)
1471 {
1472 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Sco.php");
1473 $sco_folder = $a_target_dir."/".$sco['obj_id'];
1474 ilUtil::makeDir($sco_folder);
1475 $node = new ilSCORM2004Sco($this,$sco['obj_id']);
1476 $node->exportPDFPrepareXmlNFiles($a_inst, $a_target_dir, $expLog, $a_xml_writer);
1477 }
1478 if($this->getAssignedGlossary()!=0)
1479 {
1480 ilUtil::makeDir($a_target_dir."/glossary");
1481 include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
1482 include_once("./Modules/Glossary/classes/class.ilGlossaryExport.php");
1483 $glos = new ilObjGlossary($this->getAssignedGlossary(), false);
1484 $glos_export = new ilGlossaryExport($glos,"xml");
1485 $glos->exportXML($a_xml_writer,$glos_export->getInstId(), $a_target_dir."/glossary", $expLog);
1486 }
1487 $a_xml_writer->xmlEndTag("ContentObject");
1488 include_once 'Services/Transformation/classes/class.ilXML2FO.php';
1489 $xml2FO = new ilXML2FO();
1490 $xml2FO->setXSLTLocation('./Modules/Scorm2004/templates/xsl/contentobject2fo.xsl');
1491 $xml2FO->setXMLString($a_xml_writer->xmlDumpMem());
1492 $xml2FO->setXSLTParams(array ('target_dir' => $a_target_dir));
1493 $xml2FO->transform();
1494 $fo_string = $xml2FO->getFOString();
1495 $fo_xml = simplexml_load_string($fo_string);
1496 $fo_ext = $fo_xml->xpath("//fo:declarations");
1497 $fo_ext = $fo_ext[0];
1498 $results = array();
1499 include_once "./Services/Utilities/classes/class.ilFileUtils.php";
1500 ilFileUtils::recursive_dirscan($a_target_dir."/objects", $results);
1501 if (is_array($results["file"]))
1502 {
1503 foreach ($results["file"] as $key => $value)
1504 {
1505 $e = $fo_ext->addChild("fox:embedded-file","","http://xml.apache.org/fop/extensions");
1506 $e->addAttribute("src",$results[path][$key].$value);
1507 $e->addAttribute("name",$value);
1508 $e->addAttribute("desc","");
1509 }
1510 }
1511 $fo_string = $fo_xml->asXML();
1512 $a_xml_writer->_XmlWriter;
1513 return $fo_string;
1514 }
1515
1516 function exportHTMLOne($a_inst, $a_target_dir, &$expLog)
1517 {
1518 $one_file = fopen($a_target_dir.'/index.html','w+');
1519 $this->exportHTML($a_inst, $a_target_dir, $expLog, $one_file);
1520 fclose($one_file);
1521 }
1522
1526 function exportHTML($a_inst, $a_target_dir, &$expLog, $a_one_file = "")
1527 {
1528
1529// $a_xml_writer = new ilXmlWriter;
1530 // set dtd definition
1531// $a_xml_writer->xmlSetDtdDef("<!DOCTYPE ContentObject SYSTEM \"http://www.ilias.de/download/dtd/ilias_co_3_7.dtd\">");
1532
1533 // set generated comment
1534// $a_xml_writer->xmlSetGenCmt("Export of ILIAS Content Module ". $this->getId()." of installation ".$a_inst.".");
1535
1536 // set xml header
1537// $a_xml_writer->xmlHeader();
1538
1539// global $ilBench;
1540
1541// $a_xml_writer->xmlStartTag("ContentObject", array("Type"=>"SCORM2004LearningModule"));
1542
1543// $expLog->write(date("[y-m-d H:i:s] ")."Start Export Sco Objects");
1544 $this->exportHTMLScoObjects($a_inst, $a_target_dir, $expLog, $a_one_file);
1545// $expLog->write(date("[y-m-d H:i:s] ")."Finished Export Sco Objects");
1546
1547// $a_xml_writer->xmlEndTag("ContentObject");
1548
1549
1550 /*$toc_tpl = new ilTemplate("tpl.main.html", true, true, false);
1551 $style_name = $ilUser->prefs["style"].".css";
1552 $tpl->setCurrentBlock("css_file");
1553 $tpl->setVariable("CSS_FILE", $style_name);
1554 $tpl->parseCurrentBlock();*/
1555
1556 if ($a_one_file == "")
1557 {
1558 include_once("./Modules/Scorm2004/classes/class.ilContObjectManifestBuilder.php");
1559 $manifestBuilder = new ilContObjectManifestBuilder($this);
1560 $manifestBuilder->buildManifest('12');
1561
1562 include_once("Services/Frameset/classes/class.ilFramesetGUI.php");
1563 $fs_gui = new ilFramesetGUI();
1564 $fs_gui->setFramesetTitle($this->getTitle());
1565 $fs_gui->setMainFrameSource("");
1566 $fs_gui->setSideFrameSource("toc.html");
1567 $fs_gui->setMainFrameName("content");
1568 $fs_gui->setSideFrameName("toc");
1569 $output = $fs_gui->get();
1570 fputs(fopen($a_target_dir.'/index.html','w+'),$output);
1571
1572 $xsl = file_get_contents("./Modules/Scorm2004/templates/xsl/module.xsl");
1573 $xml = simplexml_load_string($manifestBuilder->writer->xmlDumpMem());
1574 $args = array( '/_xml' => $xml->organizations->organization->asXml(), '/_xsl' => $xsl );
1575 $xh = xslt_create();
1576 $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args,NULL);
1577 xslt_free($xh);
1578 fputs(fopen($a_target_dir.'/toc.html','w+'),$output);
1579 }
1580// $a_xml_writer->_XmlWriter;
1581 }
1582
1589 function exportXMLMetaData(&$a_xml_writer)
1590 {
1591 include_once("Services/MetaData/classes/class.ilMD2XML.php");
1592 $md2xml = new ilMD2XML($this->getId(), 0, $this->getType());
1593 $md2xml->setExportMode(true);
1594 $md2xml->startExport();
1595 $a_xml_writer->appendXML($md2xml->getXML());
1596 }
1597
1604 function exportXMLStructureObjects(&$a_xml_writer, $a_inst, &$expLog)
1605 {
1606 include_once("Services/MetaData/classes/class.ilMD2XML.php");
1607 $tree = new ilTree($this->getId());
1608 $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
1609 $tree->setTreeTablePK("slm_id");
1610 $a_xml_writer->xmlStartTag("StructureObject");
1611 foreach($tree->getFilteredSubTree($tree->getRootId(),Array('page')) as $obj)
1612 {
1613 if($obj['type']=='') continue;
1614
1615 //$md2xml = new ilMD2XML($obj['obj_id'], 0, $obj['type']);
1616 $md2xml = new ilMD2XML($this->getId(), $obj['obj_id'], $obj['type']);
1617 $md2xml->setExportMode(true);
1618 $md2xml->startExport();
1619 $a_xml_writer->appendXML($md2xml->getXML());
1620 }
1621 $a_xml_writer->xmlEndTag("StructureObject");
1622 }
1623
1624
1631 function exportXMLScoObjects($a_inst, $a_target_dir, $ver, &$expLog)
1632 {
1633 global $ilBench;
1634 $tree = new ilTree($this->getId());
1635 $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
1636 $tree->setTreeTablePK("slm_id");
1637 foreach($tree->getSubTree($tree->getNodeData($tree->getRootId()),true,array('sco','ass')) as $sco)
1638 {
1639 if ($sco['type'] == "sco")
1640 {
1641 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Sco.php");
1642 $sco_folder = $a_target_dir."/".$sco['obj_id'];
1643 ilUtil::makeDir($sco_folder);
1644 $node = new ilSCORM2004Sco($this,$sco['obj_id']);
1645 $node->exportScorm($a_inst, $sco_folder, $ver, $expLog);
1646 }
1647 if ($sco['type'] == "ass")
1648 {
1649 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Asset.php");
1650 $sco_folder = $a_target_dir."/".$sco['obj_id'];
1651 ilUtil::makeDir($sco_folder);
1652 $node = new ilSCORM2004Asset($this,$sco['obj_id']);
1653 $node->exportScorm($a_inst, $sco_folder, $ver, $expLog);
1654 }
1655
1656 }
1657 }
1658
1659 /* export page objects to xml (see ilias_co.dtd)
1660 *
1661 * @param object $a_xml_writer ilXmlWriter object that receives the
1662 * xml data
1663 */
1664 function exportHTMLScoObjects($a_inst, $a_target_dir, &$expLog, $a_one_file = "")
1665 {
1666 global $ilBench;
1667
1668 $tree = new ilTree($this->getId());
1669 $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
1670 $tree->setTreeTablePK("slm_id");
1671
1672 // copy all necessary files now
1673 if ($a_one_file != "")
1674 {
1675 $this->prepareHTMLExporter($a_target_dir);
1676
1677 // put header into file
1678 $sco_tpl = new ilTemplate("tpl.sco.html", true, true, "Modules/Scorm2004");
1679 include_once("./Services/COPage/classes/class.ilCOPageHTMLExport.php");
1681
1682 $sco_tpl->setCurrentBlock("js_file");
1683 $sco_tpl->setVariable("JS_FILE", "./js/pure.js");
1684 $sco_tpl->parseCurrentBlock();
1685 $sco_tpl->setCurrentBlock("js_file");
1686 $sco_tpl->setVariable("JS_FILE", "./js/question_handling.js");
1687 $sco_tpl->parseCurrentBlock();
1688
1689
1690 $sco_tpl->setCurrentBlock("head");
1691 $sco_tpl->parseCurrentBlock();
1692 fputs($a_one_file, $sco_tpl->get("head"));
1693
1694 // toc
1695 include_once("./Modules/Scorm2004/classes/class.ilContObjectManifestBuilder.php");
1696 $manifestBuilder = new ilContObjectManifestBuilder($this);
1697 $manifestBuilder->buildManifest('12');
1698 $xsl = file_get_contents("./Modules/Scorm2004/templates/xsl/module.xsl");
1699 $xml = simplexml_load_string($manifestBuilder->writer->xmlDumpMem());
1700 $args = array( '/_xml' => $xml->organizations->organization->asXml(), '/_xsl' => $xsl );
1701 $xh = xslt_create();
1702 $params = array("one_page" => "y");
1703 $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args,$params);
1704 xslt_free($xh);
1705 fputs($a_one_file, $output);
1706
1707 }
1708
1709 foreach($tree->getSubTree($tree->getNodeData($tree->getRootId()),true,'sco') as $sco)
1710 {
1711 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Sco.php");
1712 $sco_folder = $a_target_dir."/".$sco['obj_id'];
1713 ilUtil::makeDir($sco_folder);
1714 $node = new ilSCORM2004Sco($this,$sco['obj_id']);
1715
1716 if ($a_one_file == "")
1717 {
1718 $node->exportHTML($a_inst, $sco_folder, $expLog, $a_one_file);
1719 }
1720 else
1721 {
1722 $node->exportHTMLPageObjects($a_inst, $a_target_dir, $expLog, 'full',
1723 "sco", $a_one_file, $sco_tpl);
1724 }
1725 if($this->getAssignedGlossary()!=0)
1726 {
1727 include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
1728 $glos = new ilObjGlossary($this->getAssignedGlossary(),false);
1729 //$glos->exportHTML($sco_folder."/glossary", $expLog);
1730 }
1731 }
1732
1733 // copy all necessary files now
1734 if ($a_one_file != "")
1735 {
1736 // put tail into file
1737 fputs($a_one_file, $sco_tpl->get("tail"));
1738 }
1739
1740 }
1741
1748 function prepareHTMLExporter($a_target_dir)
1749 {
1750 // system style html exporter
1751 include_once("./Services/Style/classes/class.ilSystemStyleHTMLExport.php");
1752 $this->sys_style_html_export = new ilSystemStyleHTMLExport($a_target_dir);
1753 $this->sys_style_html_export->export();
1754
1755 // init co page html exporter
1756 include_once("./Services/COPage/classes/class.ilCOPageHTMLExport.php");
1757 $this->co_page_html_export = new ilCOPageHTMLExport($a_target_dir);
1758 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1759 $this->co_page_html_export->setContentStyleId(
1761 $this->co_page_html_export->createDirectories();
1762 $this->co_page_html_export->exportStyles();
1763 $this->co_page_html_export->exportSupportScripts();
1764
1765 include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
1766 $this->flv_dir = $a_target_dir."/".ilPlayerUtil::getFlashVideoPlayerDirectory();
1767
1768 ilUtil::makeDir($a_target_dir.'/css/yahoo');
1769 ilUtil::makeDir($a_target_dir.'/objects');
1770 ilUtil::makeDir($a_target_dir.'/players');
1771 ilUtil::makeDir($this->flv_dir);
1772
1773 include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
1774// copy(ilPlayerUtil::getFlashVideoPlayerFilename(true),
1775// $a_target_dir.'/js/'.ilPlayerUtil::getFlashVideoPlayerFilename());
1777
1778 copy('./Modules/Scorm2004/scripts/scorm_2004.js',$a_target_dir.'/js/scorm.js');
1779 copy('./Modules/Scorm2004/scripts/pager.js',$a_target_dir.'/js/pager.js');
1780 copy('./Modules/Scorm2004/scripts/questions/pure.js',$a_target_dir.'/js/pure.js');
1781 copy('./Modules/Scorm2004/scripts/questions/question_handling.js',
1782 $a_target_dir.'/js/question_handling.js');
1783
1784 }
1785
1793 function getPublicExportFile($a_type)
1794 {
1795 return $this->public_export_file[$a_type];
1796 }
1797
1802 function exportFileItems($a_target_dir, &$expLog)
1803 {
1804 include_once("./Modules/File/classes/class.ilObjFile.php");
1805
1806 foreach ($this->file_ids as $file_id)
1807 {
1808 $expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
1809 $file_obj = new ilObjFile($file_id, false);
1810 $file_obj->export($a_target_dir);
1811 unset($file_obj);
1812 }
1813 }
1814
1818 function setPublicExportFile($a_type, $a_file)
1819 {
1820 $this->public_export_file[$a_type] = $a_file;
1821 }
1822
1833 public static function _getMaxScoreForUser($a_id, $a_user)
1834 {
1835 global $ilDB;
1836
1837 $scos = array();
1838
1839 $result = $ilDB->query(
1840 'SELECT cp_node.cp_node_id '
1841 .'FROM cp_node, cp_resource, cp_item '
1842 .'WHERE cp_item.cp_node_id = cp_node.cp_node_id '
1843 .'AND cp_item.resourceId = cp_resource.id '
1844 .'AND scormType = '.$ilDB->quote('sco', 'text').' '
1845 .'AND nodeName = '.$ilDB->quote('item', 'text').' '
1846 .'AND cp_node.slm_id = '.$ilDB->quote($a_id, 'integer').' '
1847 .'GROUP BY cp_node.cp_node_id'
1848 );
1849
1850 while($row = $ilDB->fetchAssoc($result))
1851 {
1852 array_push($scos, $row['cp_node_id']);
1853 }
1854
1855 $set = 0; //numbers of SCO that set cmi.score.scaled
1856 $max = null;
1857 for($i = 0; $i < count($scos); $i++)
1858 {
1859 $res = $ilDB->queryF(
1860 'SELECT c_max FROM cmi_node WHERE (user_id = %s AND cp_node_id = %s)',
1861 array('integer', 'integer'),
1862 array($a_user, $scos[$i])
1863 );
1864
1865 if($ilDB->numRows($res) > 0)
1866 {
1867 $row = $ilDB->fetchAssoc($res);
1868 if($row['c_max'] != null)
1869 {
1870 $set++;
1871 $max = $row['c_max'];
1872 }
1873 }
1874 }
1875 $retVal = ($set == 1) ? $max : null;
1876
1877 return $retVal;
1878 }
1879
1880 public static function _getScores2004ForUser($a_cp_node_id, $a_user) {
1881 global $ilDB;
1882 $retAr = array("raw" => null, "max" => null, "scaled" => null);
1883 $val_set = $ilDB->queryF("SELECT c_raw, c_max, scaled FROM cmi_node WHERE (user_id = %s AND cp_node_id = %s)",
1884 array('integer', 'integer'),
1885 array($a_user, $a_cp_node_id)
1886 );
1887 if ($val_set->numRows()>0)
1888 {
1889 $val_rec = $ilDB->fetchAssoc($val_set);
1890 $retAr["raw"] = $val_rec['c_raw'];
1891 $retAr["max"] = $val_rec['c_max'];
1892 $retAr["scaled"] = $val_rec['scaled'];
1893 if ($val_rec['scaled']==null && $val_rec['c_raw']!=null && $val_rec['c_max']!=null) {
1894 $retAr["scaled"] = ($val_rec['c_raw'] / $val_rec['c_max']);
1895 }
1896 }
1897 return $retAr;
1898 }
1899
1906 function copyAuthoredContent($a_new_obj)
1907 {
1908 global $ilias;
1909
1910 // set/copy stylesheet
1911 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1912 $style_id = $this->getStyleSheetId();
1913 if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id))
1914 {
1915 $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
1916 $new_id = $style_obj->ilClone();
1917 $a_new_obj->setStyleSheetId($new_id);
1918 $a_new_obj->update();
1919 }
1920
1921 $a_new_obj->createScorm2004Tree();
1922 $source_tree = $this->getTree();
1923 $target_tree_root_id = $a_new_obj->getTree()->readRootId();
1924 $childs = $source_tree->getChilds($source_tree->readRootId());
1925 $a_copied_nodes = array();
1926 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
1927 foreach ($childs as $c)
1928 {
1929 ilSCORM2004Node::pasteTree($a_new_obj, $c["child"], $target_tree_root_id,
1930 IL_LAST_NODE, "", $a_copied_nodes, true, false);
1931 }
1932 }
1933
1934}
1935?>
$result
print $file
$n
Definition: RandomTest.php:80
const IL_CAL_UNIX
const IL_LAST_NODE
Definition: class.ilTree.php:4
const IL_FIRST_NODE
Definition: class.ilTree.php:5
HTML export class for pages.
getPreparedMainTemplate($a_tpl="")
Get prepared main template.
Content Object (ILIAS native learning module / digilib book) Manifest export class.
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
recursive_dirscan($dir, &$arr)
Recursively scans a given directory and writes path and filename into referenced array.
_secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
Class ilFramesetGUI.
Export class for content objects.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_no_raise=false, $a_force_raise=false)
Update status.
_refreshStatus($a_obj_id, $a_users=null)
Set dirty.
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_FAILED
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS
Class ilObjFile.
Class ilObjGlossary.
getAssignedGlossary()
get assigned glossary
getStyleSheetId()
get ID of assigned style sheet object
getDataDirectory($mode="filesystem")
get data directory of lm
Class ilObjSCORM2004LearningModule.
exportXMLStructureObjects(&$a_xml_writer, $a_inst, &$expLog)
export structure objects to xml (see ilias_co.dtd)
deleteTrackingDataOfUsers($a_users)
get all tracked items of current user
validate($directory)
Validate all XML-Files in a SCOM-Directory.
setImportSequencing($a_val)
Set import sequencing.
exportXMLScoObjects($a_inst, $a_target_dir, $ver, &$expLog)
export page objects to xml (see ilias_co.dtd)
exportPDF($a_inst, $a_target_dir, &$expLog)
exportHTML($a_inst, $a_target_dir, &$expLog, $a_one_file="")
Export SCORM package to HTML.
copyAuthoredContent($a_new_obj)
Copy authored content (everything done with the editor.
exportXMLMetaData(&$a_xml_writer)
export content objects meta data to xml (see ilias_co.dtd)
executeDragDrop($source_id, $target_id, $first_child, $as_subitem=false, $movecopy="move")
Execute Drag Drop Action.
static _getMaxScoreForUser($a_id, $a_user)
Returns score.max for the learning module, refered to the last sco where score.max is set.
exportHTML4PDF($a_inst, $a_target_dir, &$expLog)
exportHTMLScoObjects($a_inst, $a_target_dir, &$expLog, $a_one_file="")
getAttemptsForUser($a_user_id)
get number of atttempts for a certain user and package
static _getUniqueScaledScoreForUser($a_id, $a_user)
Get the Unique Scaled Score of a course Conditions: Only one SCO may set cmi.score....
exportHTMLOne($a_inst, $a_target_dir, &$expLog)
static _lookupLastAccess($a_obj_id, $a_usr_id)
Return the last access timestamp for a given user.
getTrackedItems()
get all tracked items of current user
readObject()
read manifest file @access public
getPublicExportFile($a_type)
get public export file
createScorm2004Tree()
Create Scorm 2004 Tree used by Editor.
exportFileItems($a_target_dir, &$expLog)
export files of file itmes
getModuleVersionForUser($a_user_id)
get module version that tracking data for a user was recorded on
_getTrackingItems($a_obj_id)
get all tracking items of scorm object
static _getScores2004ForUser($a_cp_node_id, $a_user)
ilObjSCORM2004LearningModule($a_id=0, $a_call_by_reference=true)
Constructor @access public.
prepareHTMLExporter($a_target_dir)
Prepare HTML exporter.
_ISODurationToCentisec($str)
convert ISO 8601 Timeperiods to centiseconds ta
exportScorm($a_inst, $a_target_dir, $ver, &$expLog)
Export (authoring) scorm package.
static _getCourseCompletionForUser($a_id, $a_user)
Get the completion of a SCORM module for a given user.
Class ilObjSCORMLearningModule.
importSuccessForSahsUser($user_id, $last_access, $status, $attempts=null, $percentage_completed=null, $sco_total_time_sec=null)
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
_lookupStandard($a_id)
Lookup standard flag.
static getInstance($a_obj_id)
getType()
get object type @access public
getId()
get object id @access public
getTitle()
get object title @access public
static getFlashVideoPlayerDirectory()
Get flash video player directory.
copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
Class ilSCORM2004Asset.
removeCMIDataForUserAndPackage($user_id, $packageId)
static getInstance($a_slm_object, $a_id=0, $a_halt=true)
static pasteTree($a_target_slm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_from_clipboard=true)
Paste item (tree) from clipboard or other learning module to target scorm learning module.
Class ilSCORM2004Sco.
Class ilSCORM2004Sequencing.
SCORM 2004 Editing tree.
static exportContentCSS($a_slm_object, $a_target_dir)
Export lm content css to a directory.
HTML export class for system styles.
special template class to simplify handling of ITX/PEAR
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static now()
Return current timestamp in Y-m-d H:i:s format.
static yn2tf($a_yn)
convert "y"/"n" to true/false
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
XML writer class.
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
xmlSetDtdDef($dtdDef)
Sets dtd definition.
$_POST['username']
Definition: cron.php:12
$target_id
Definition: goto.php:88
global $ilBench
Definition: ilias.php:18
xslt_free(&$proc)
xslt_create()
redirection script todo: (a better solution should control the processing via a xml file)
$results
global $ilDB
global $ilUser
Definition: imgupload.php:15