5 require_once
"./Services/Object/classes/class.ilObject.php";
6 require_once
"./Modules/ScormAicc/classes/class.ilObjSCORMValidator.php";
7 require_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
30 parent::ilObject($a_id,$a_call_by_reference);
43 $returnValue = $this->validator->validate();
49 if(is_object($this->validator))
51 return $this->validator->getSummary();
68 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMTree.php");
70 $root_id = $tree->readRootId();
73 $childs = $tree->getSubTree($tree->getNodeData($root_id));
75 foreach($childs as $child)
77 if($child[
"c_type"] ==
"sit")
79 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
81 if ($sc_item->getIdentifierRef() !=
"")
83 $items[count($items)] =& $sc_item;
99 $needs_convert =
false;
106 $check_for_manifest_file = is_file($manifest_file);
109 if (!$check_for_manifest_file)
111 $this->
ilias->raiseError($this->lng->txt(
"Manifestfile $manifest_file not found!"), $this->
ilias->error_obj->MESSAGE);
115 if ($check_for_manifest_file)
117 $manifest_file_array = file($manifest_file);
118 foreach($manifest_file_array as $mfa)
121 if (@iconv(
'UTF-8',
'UTF-8', $mfa) != $mfa)
123 $needs_convert =
true;
129 $estimated_manifest_filesize = filesize($manifest_file) * 2;
133 $check_disc_free = 2;
140 if ($check_for_manifest_file && ($check_disc_free > 1))
144 if (!copy($manifest_file, $manifest_file.
".old"))
146 echo
"Failed to copy $manifest_file...<br>\n";
151 $f_write_handler = fopen($manifest_file.
".new",
"w");
152 $f_read_handler = fopen($manifest_file.
".old",
"r");
153 while (!feof($f_read_handler))
155 $zeile = fgets($f_read_handler);
157 fputs($f_write_handler, utf8_encode($zeile));
159 fclose($f_read_handler);
160 fclose($f_write_handler);
163 if (!copy($manifest_file.
".new", $manifest_file))
165 echo
"Failed to copy $manifest_file...<br>\n";
168 if (!@is_file($manifest_file))
170 $this->
ilias->raiseError($this->lng->txt(
"cont_no_manifest"),
171 $this->
ilias->error_obj->WARNING);
178 if (!($check_disc_free > 1))
179 $this->
ilias->raiseError($this->lng->txt(
"Not enough space left on device!"),$this->
ilias->error_obj->MESSAGE);
187 $hmani = fopen($manifest_file,
"r");
188 $start = fread($hmani, 3);
189 if (strtolower(bin2hex($start)) ==
"efbbbf")
191 $f_write_handler = fopen($manifest_file.
".new",
"w");
192 while (!feof($hmani))
194 $n = fread($hmani, 900);
195 fputs($f_write_handler,
$n);
197 fclose($f_write_handler);
201 if (!copy($manifest_file.
".new", $manifest_file))
203 echo
"Failed to copy $manifest_file...<br>\n";
213 if (
$_POST[
"validate"] ==
"y")
217 $ilErr->raiseError(
"<b>Validation Error(s):</b><br>".$this->
getValidationSummary(),$ilErr->MESSAGE);
222 include_once (
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMPackageParser.php");
225 $slmParser->startParsing();
226 return $slmParser->getPackageTitle();
237 $sco_set = $ilDB->queryF(
' 238 SELECT DISTINCT sco_id FROM scorm_tracking WHERE obj_id = %s',
239 array(
'integer'),array($this->
getId()));
242 while($sco_rec = $ilDB->fetchAssoc($sco_set))
244 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
246 if ($sc_item->getIdentifierRef() !=
"")
248 $items[count($items)] =& $sc_item;
267 SELECT last_access FROM sahs_user 270 array(
'integer',
'integer'), array($a_obj_id,$a_usr_id));
275 return $row[
"last_access"];
285 $query =
'SELECT user_id, last_access, lastname, firstname FROM sahs_user st ' .
286 'JOIN usr_data ud ON st.user_id = ud.usr_id ' .
287 'WHERE obj_id = ' . $ilDB->quote($this->
getId(),
'integer');
290 $query .=
' AND ' . $ilDB->like(
'lastname',
'text',
'%' . $a_search .
'%');
292 $query .=
' GROUP BY user_id, lastname, firstname';
293 $sco_set = $ilDB->query(
$query);
296 while($sco_rec = $ilDB->fetchAssoc($sco_set))
312 $query =
'SELECT user_id, package_attempts FROM sahs_user WHERE obj_id = ' . $ilDB->quote($this->
getId(),
'integer') .
' ';
318 $attempts[
$row[
'user_id']] = (int) $row[
'package_attempts'];
329 $val_set = $ilDB->queryF(
'SELECT package_attempts FROM sahs_user WHERE obj_id = %s AND user_id = %s',
330 array(
'integer',
'integer'),
331 array($this->
getId(),$a_user_id,0));
333 $val_rec = $ilDB->fetchAssoc($val_set);
335 if ($val_rec[
"package_attempts"] == null) {
336 $val_rec[
"package_attempts"]=
"";
338 return $val_rec[
"package_attempts"];
349 $query =
'SELECT user_id, module_version FROM sahs_user WHERE obj_id = ' . $ilDB->quote($this->
getId(),
'integer') .
' ';
355 $versions[
$row[
'user_id']] = (int) $row[
'module_version'];
366 $val_set = $ilDB->queryF(
'SELECT module_version FROM sahs_user WHERE obj_id = %s AND user_id = %s',
367 array(
'integer',
'integer'),
368 array($this->
getId(),$a_user_id,0));
370 $val_rec = $ilDB->fetchAssoc($val_set);
372 if ($val_rec[
"module_version"] == null) {
373 $val_rec[
"module_version"]=
"";
375 return $val_rec[
"module_version"];
389 $data_set = $ilDB->queryF(
' 390 SELECT * FROM scorm_tracking 395 array(
'integer',
'integer',
'integer'),
396 array($a_user_id,$a_sco_id,$this->
getId()));
399 while($data_rec = $ilDB->fetchAssoc($data_set)) {
411 $sco_set = $ilDB->queryF(
' 412 SELECT DISTINCT sco_id FROM scorm_tracking 416 array(
'integer',
'integer',
'integer'),
417 array($this->
getId(),$a_user_id,0));
420 while($sco_rec = $ilDB->fetchAssoc($sco_set))
422 $data_set = $ilDB->queryF(
' 423 SELECT * FROM scorm_tracking 431 array(
'integer',
'integer',
'integer',
'text',
'text',
'text',
'text'),
432 array($this->
getId(),
436 "cmi.core.lesson_status",
437 "cmi.core.total_time",
438 "cmi.core.score.raw")
441 $score = $time = $status =
"";
443 while($data_rec = $ilDB->fetchAssoc($data_set))
445 switch($data_rec[
"lvalue"])
447 case "cmi.core.lesson_status":
448 $status = $data_rec[
"rvalue"];
451 case "cmi.core.total_time":
452 $time = $data_rec[
"rvalue"];
455 case "cmi.core.score.raw":
456 $score = $data_rec[
"rvalue"];
461 include_once
'./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php';
463 $data[] = array(
"sco_id"=>$sco_rec[
"sco_id"],
"title" => $sc_item->getTitle(),
464 "score" => $score,
"time" => $time,
"status" => $status);
467 return (array)
$data;
475 $user_set = $ilDB->queryF(
' 476 SELECT DISTINCT user_id FROM scorm_tracking 479 array(
'integer',
'integer'),
480 array($this->
getId(),$a_sco_id));
483 while($user_rec = $ilDB->fetchAssoc($user_set))
486 $data_set = $ilDB->queryF(
' 487 SELECT * FROM scorm_tracking 494 array(
'integer',
'integer',
'integer',
'text',
'text',
'text'),
495 array($this->
getId(),
497 $user_rec[
"user_id"],
498 "cmi.core.lesson_status",
499 "cmi.core.total_time",
500 "cmi.core.score.raw")
503 $score = $time = $status =
"";
505 while($data_rec = $ilDB->fetchAssoc($data_set))
507 switch($data_rec[
"lvalue"])
509 case "cmi.core.lesson_status":
510 $status = $data_rec[
"rvalue"];
513 case "cmi.core.total_time":
514 $time = $data_rec[
"rvalue"];
517 case "cmi.core.score.raw":
518 $score = $data_rec[
"rvalue"];
523 $data[] = array(
"user_id" => $user_rec[
"user_id"],
524 "score" => $score,
"time" => $time,
"status" => $status);
542 $inst_id = $ilSetting->get(
'inst_id',0);
544 include_once
'./Services/Utilities/classes/class.ilCSVWriter.php';
546 $csv->setSeparator(
';');
547 $csv->addColumn(
'Scoid');
548 $csv->addColumn(
'Key');
549 $csv->addColumn(
'Value');
550 $csv->addColumn(
'Email');
551 $csv->addColumn(
'Timestamp');
552 $csv->addColumn(
'Userid');
555 $user_array = array();
558 $res = $ilDB->queryF(
559 'SELECT user_id FROM scorm_tracking WHERE obj_id = %s GROUP BY user_id',
561 array($this->
getId())
563 while(
$row = $ilDB->fetchAssoc(
$res))
565 $user_array[] =
$row[
'user_id'];
570 $user_array = $a_user;
574 $query =
"SELECT usr_id,email FROM usr_data ".
575 "WHERE ".$ilDB->in(
'usr_id', $user_array, FALSE,
'integer');
580 $emails[
$row->usr_id] =
$row->email;
583 foreach($user_array as $user_id)
586 $query =
'SELECT rvalue, lvalue, identifierref, c_timestamp FROM scorm_tracking st '.
587 'JOIN sc_item si ON st.sco_id = si.obj_id '.
588 'WHERE user_id = '.$ilDB->quote($user_id,
'integer').
' '.
589 'AND st.obj_id = '.$ilDB->quote($this->
getId(),
'integer');
594 $csv->addColumn(
$row->identifierref);
595 $csv->addColumn(
$row->lvalue);
596 $csv->addColumn(
$row->rvalue);
597 $csv->addColumn(isset($emails[$user_id]) ? (
string) $emails[$user_id] :
'');
598 $csv->addColumn(
$row->c_timestamp);
599 $csv->addColumn(
'il_usr_'.$inst_id.
'_'.$user_id);
602 $query =
'SELECT package_attempts,module_version,last_visited,last_access FROM sahs_user '.
603 'WHERE user_id = '.$ilDB->quote($user_id,
'integer').
' '.
604 'AND obj_id = '.$ilDB->quote($this->
getId(),
'integer');
608 if (
$row->package_attempts != null) {
611 $csv->addColumn(
"package_attempts");
612 $csv->addColumn(
$row->package_attempts);
613 $csv->addColumn(isset($emails[$user_id]) ? (
string) $emails[$user_id] :
'');
614 $csv->addColumn(
$row->last_access);
615 $csv->addColumn(
'il_usr_'.$inst_id.
'_'.$user_id);
617 if (
$row->last_visited != null) {
620 $csv->addColumn(
"last_visited");
621 $csv->addColumn(
$row->last_visited);
622 $csv->addColumn(isset($emails[$user_id]) ? (
string) $emails[$user_id] :
'');
623 $csv->addColumn(
$row->last_access);
624 $csv->addColumn(
'il_usr_'.$inst_id.
'_'.$user_id);
626 if (
$row->module_version != null) {
629 $csv->addColumn(
"module_version");
630 $csv->addColumn(
$row->module_version);
631 $csv->addColumn(isset($emails[$user_id]) ? (
string) $emails[$user_id] :
'');
632 $csv->addColumn(
$row->last_access);
633 $csv->addColumn(
'il_usr_'.$inst_id.
'_'.$user_id);
654 $csv->getCSVString(),
655 'scorm_tracking_raw_' . $this->
getRefId() .
'_' . time() .
'.csv' 673 $inst_id = $ilSetting->get(
'inst_id',0);
679 $query =
'SELECT scorm_object.obj_id, scorm_object.title, ' 680 .
'scorm_object.c_type, scorm_object.slm_id, scorm_object.obj_id scoid ' 681 .
'FROM scorm_object, sc_item, sc_resource ' 682 .
'WHERE (scorm_object.slm_id = %s ' 683 .
'AND scorm_object.obj_id = sc_item.obj_id ' 684 .
'AND sc_item.identifierref = sc_resource.import_id ' 685 .
'AND sc_resource.scormtype = %s) ' 686 .
'GROUP BY scorm_object.obj_id, scorm_object.title, scorm_object.c_type, ' 687 .
'scorm_object.slm_id, scorm_object.obj_id ';
688 $res = $ilDB->queryF(
690 array(
'integer',
'text'),
691 array($this->
getId(),
'sco')
693 while(
$row = $ilDB->fetchAssoc(
$res))
695 $scos[] =
$row[
'scoid'];
702 $query =
'SELECT user_id FROM scorm_tracking ' .
703 'WHERE obj_id = ' . $ilDB->quote($this->
getId(),
'integer') .
' ' .
706 while(
$row = $ilDB->fetchAssoc(
$res))
708 $users[] =
$row[
'user_id'];
717 include_once
'./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php';
721 include_once
'./Services/Utilities/classes/class.ilCSVWriter.php';
723 $csv->setSeparator(
';');
724 foreach(array(
'Department',
'Login',
'Lastname',
'Firstname',
'Email',
'Date',
'Status') as $col)
726 $csv->addColumn($col);
730 $query =
'SELECT usr_id,login,firstname,lastname,department,email ' .
732 'WHERE ' . $ilDB->in(
'usr_id', $users,
false,
'integer');
738 $csv->addColumn((
string)
$row->department);
739 $csv->addColumn((
string)
$row->login);
740 $csv->addColumn((
string)
$row->lastname);
741 $csv->addColumn((
string)
$row->firstname);
742 $csv->addColumn((
string)
$row->email);
743 if(isset($last[
$row->usr_id]))
752 $csv->addColumn(in_array(
$row->usr_id, $completed) ? 1 : 0);
757 $csv->getCSVString(),
758 'scorm_tracking_' . $this->
getRefId() .
'_' . time() .
'.csv' 772 $fhandle = fopen($a_file,
"r");
775 $fields = fgetcsv($fhandle, pow(2, 16),
';');
801 $val_set = $ilDB->queryF(
' 802 SELECT scorm_object.obj_id, 806 scorm_object.obj_id scoid 807 FROM scorm_object,sc_item,sc_resource 808 WHERE(scorm_object.slm_id = %s 809 AND scorm_object.obj_id=sc_item.obj_id 810 AND sc_item.identifierref = sc_resource.import_id 811 AND sc_resource.scormtype = %s) 812 GROUP BY scorm_object.obj_id, 816 scorm_object.obj_id ',
817 array(
'integer',
'text'),
818 array($this->
getId(),
'sco')
821 if (count($val_set)<1)
825 while($rows_sco = $ilDB->fetchAssoc($val_set))
827 array_push($scos,$rows_sco[
'scoid']);
830 $fhandle = fopen($a_file,
"r");
832 $obj_id = $this->getID();
834 $fields = fgetcsv($fhandle, pow(2, 16),
';');
836 while(($csv_rows = fgetcsv($fhandle, pow(2, 16),
";")) !== FALSE)
838 $data = array_combine($fields, $csv_rows);
841 if (count($csv_rows) == 6) {$statuscheck = 1;}
847 $import =
$data[
"Status"];
848 if ($import ==
"") {$import = 1;}
851 foreach ($scos as $sco)
855 $date_ex = explode(
'.',
$data[
'Date']);
856 $date = implode(
'-', array($date_ex[2], $date_ex[1], $date_ex[0]));
858 $statement = $ilDB->queryF(
' 859 SELECT * FROM scorm_tracking 864 array(
'integer',
'integer',
'text',
'integer'),
865 array($user_id, $sco_id,
'cmi.core.lesson_status',$obj_id)
867 if($ilDB->numRows($statement) > 0)
869 $ilDB->update(
'scorm_tracking',
871 'rvalue' => array(
'clob',
'completed'),
872 'c_timestamp' => array(
'timestamp', $date)
875 'user_id' => array(
'integer', $user_id),
876 'sco_id' => array(
'integer', $sco_id),
877 'lvalue' => array(
'text',
'cmi.core.lesson_status'),
878 'obj_id' => array(
'integer', $obj_id)
884 $ilDB->insert(
'scorm_tracking', array(
885 'obj_id' => array(
'integer', $obj_id),
886 'user_id' => array(
'integer', $user_id),
887 'sco_id' => array(
'integer', $sco_id),
888 'lvalue' => array(
'text',
'cmi.core.lesson_status'),
889 'rvalue' => array(
'clob',
'completed'),
890 'c_timestamp' => array(
'timestamp', $date)
894 $statement = $ilDB->queryF(
' 895 SELECT * FROM scorm_tracking 900 array(
'integer',
'integer',
'text',
'integer'),
901 array($user_id, $sco_id,
'cmi.core.entry',$obj_id)
903 if($ilDB->numRows($statement) > 0)
905 $ilDB->update(
'scorm_tracking',
907 'rvalue' => array(
'clob',
'completed'),
908 'c_timestamp' => array(
'timestamp', $date)
911 'user_id' => array(
'integer', $user_id),
912 'sco_id' => array(
'integer', $sco_id),
913 'lvalue' => array(
'text',
'cmi.core.entry'),
914 'obj_id' => array(
'integer', $obj_id)
920 $ilDB->insert(
'scorm_tracking', array(
921 'obj_id' => array(
'integer', $obj_id),
922 'user_id' => array(
'integer', $user_id),
923 'sco_id' => array(
'integer', $sco_id),
924 'lvalue' => array(
'text',
'cmi.core.entry'),
925 'rvalue' => array(
'clob',
'completed'),
926 'c_timestamp' => array(
'timestamp', $date)
936 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
951 $parts = explode(
'_', $il_id);
953 if(!count((array) $parts))
957 if(!isset($parts[2]) or !isset($parts[3]))
961 if($parts[2] != $ilSetting->get(
'inst_id',$parts[2]))
980 $fhandle = fopen($a_file,
"r");
982 $fields = fgetcsv($fhandle, pow(2, 16),
';');
984 while(($csv_rows = fgetcsv($fhandle, pow(2, 16),
";")) !== FALSE)
986 $data = array_combine($fields, $csv_rows);
999 $statement = $ilDB->queryF(
' 1000 SELECT * FROM scorm_tracking 1005 array(
'integer',
'integer',
'text',
'integer'),
1006 array($user_id, $il_sco_id,
$data[
'Key'], $this->getID())
1008 if($ilDB->numRows($statement) > 0)
1010 $ilDB->update(
'scorm_tracking',
1012 'rvalue' => array(
'clob',
$data[
'Value']),
1013 'c_timestamp' => array(
'timestamp',
$data[
'Timestamp'])
1016 'user_id' => array(
'integer', $user_id),
1017 'sco_id' => array(
'integer', $il_sco_id),
1018 'lvalue' => array(
'text',
$data[
'Key']),
1019 'obj_id' => array(
'integer', $this->
getId())
1025 $ilDB->insert(
'scorm_tracking', array(
1026 'obj_id' => array(
'integer', $this->
getId()),
1027 'user_id' => array(
'integer', $user_id),
1028 'sco_id' => array(
'integer', $il_sco_id),
1029 'lvalue' => array(
'text',
$data[
'Key']),
1030 'rvalue' => array(
'clob',
$data[
'Value']),
1031 'c_timestamp' => array(
'timestamp',
$data[
'Timestamp'])
1038 include_once
'./Services/Tracking/classes/class.ilLPStatusWrapper.php';
1048 $val_set = $ilDB->queryF(
'SELECT * FROM usr_data WHERE(login=%s)',
1049 array(
'text'),array($a_login));
1050 $val_rec = $ilDB->fetchAssoc($val_set);
1052 if (count($val_rec)>0) {
1053 return $val_rec[
'usr_id'];
1067 if ($a_referrer==
"0") {
1071 $val_set = $ilDB->queryF(
' 1072 SELECT obj_id FROM sc_item,scorm_tree 1073 WHERE (obj_id = child 1074 AND identifierref = %s 1076 array(
'text',
'integer'), array($a_referrer,$this->getID()));
1077 $val_rec = $ilDB->fetchAssoc($val_set);
1079 return $val_rec[
"obj_id"];
1089 $val_set = $ilDB->queryF(
'SELECT usr_id FROM usr_data WHERE(email=%s)',
1090 array(
'text'),array($a_mail));
1091 $val_rec = $ilDB->fetchAssoc($val_set);
1094 return $val_rec[
"usr_id"];
1107 header(
"Expires: 0");
1108 header(
"Cache-control: private");
1109 header(
"Cache-Control: must-revalidate, post-check=0, pre-check=0");
1110 header(
"Content-Description: File Transfer");
1111 header(
"Content-Type: application/octet-stream");
1112 header(
"Content-disposition: attachment; filename=$filename");
1113 echo $a_header.$a_content;
1128 $val_set = $ilDB->queryF(
' 1129 SELECT scorm_object.obj_id, 1131 scorm_object.c_type, 1132 scorm_object.slm_id, 1133 scorm_object.obj_id scoid 1134 FROM scorm_object,sc_item,sc_resource 1135 WHERE(scorm_object.slm_id = %s 1136 AND scorm_object.obj_id = sc_item.obj_id 1137 AND sc_item.identifierref = sc_resource.import_id 1138 AND sc_resource.scormtype = %s) 1139 GROUP BY scorm_object.obj_id, 1141 scorm_object.c_type, 1142 scorm_object.slm_id, 1143 scorm_object.obj_id ',
1144 array(
'integer',
'text'),
1145 array($a_id,
'sco'));
1147 while ($val_rec = $ilDB->fetchAssoc($val_set))
1149 array_push($scos,$val_rec[
'scoid']);
1166 $scos = $a_allScoIds;
1168 $scos_c = implode(
',',$scos);
1170 $val_set = $ilDB->queryF(
' 1171 SELECT * FROM scorm_tracking 1174 AND '.$ilDB->in(
'sco_id', $scos,
false,
'integer').
' 1175 AND ((lvalue = %s AND '.$ilDB->like(
'rvalue',
'clob',
'completed').
') 1176 OR (lvalue = %s AND '.$ilDB->like(
'rvalue',
'clob',
'passed').
')))',
1177 array(
'integer',
'integer',
'text',
'text'),
1178 array($a_user,$a_id,
'cmi.core.lesson_status',
'cmi.core.lesson_status'));
1179 while ($val_rec = $ilDB->fetchAssoc($val_set))
1181 $key = array_search($val_rec[
'sco_id'], $scos);
1182 unset ($scos[$key]);
1185 if (count($scos) == 0) {
1186 $completion = ($a_numerical===
true) ?
true: $lng->txt(
"cont_complete");
1188 if (count($scos) > 0) {
1189 $completion = ($a_numerical===
true) ?
false: $lng->txt(
"cont_incomplete");
1210 $val_set = $ilDB->queryF(
' 1211 SELECT scorm_object.obj_id, 1213 scorm_object.c_type, 1214 scorm_object.slm_id, 1215 scorm_object.obj_id scoid 1216 FROM scorm_object, sc_item,sc_resource 1217 WHERE(scorm_object.slm_id = %s 1218 AND scorm_object.obj_id = sc_item.obj_id 1219 AND sc_item.identifierref = sc_resource.import_id 1220 AND sc_resource.scormtype = %s ) 1221 GROUP BY scorm_object.obj_id, 1223 scorm_object.c_type, 1224 scorm_object.slm_id, 1225 scorm_object.obj_id',
1226 array(
'integer',
'text'),
1227 array($this->
getId(),
'sco'));
1229 while ($val_rec = $ilDB->fetchAssoc($val_set))
1231 array_push($scos,$val_rec[
'scoid']);
1238 $scos = $a_allScoIds;
1241 $scos_c = implode(
',',$scos);
1243 $val_set = $ilDB->queryF(
' 1244 SELECT sco_id FROM scorm_tracking 1247 AND '.$ilDB->in(
'sco_id', $scos,
false,
'integer').
' 1248 AND ((lvalue = %s AND '.$ilDB->like(
'rvalue',
'clob',
'completed').
') OR (lvalue = %s AND '.$ilDB->like(
'rvalue',
'clob',
'passed').
') ) )',
1249 array(
'integer',
'integer',
'text',
'text',),
1250 array($a_user,$this->getID(),
'cmi.core.lesson_status',
'cmi.core.lesson_status'));
1251 while ($val_rec = $ilDB->fetchAssoc($val_set))
1253 $key = array_search($val_rec[
'sco_id'], $scos);
1254 unset ($scos[$key]);
1257 if (count($scos) == 0) {
1258 $completion = ($a_numerical===
true) ?
true: $this->lng->txt(
"cont_complete");
1260 if (count($scos) > 0) {
1261 $completion = ($a_numerical===
true) ?
false: $this->lng->txt(
"cont_incomplete");
1275 'DELETE FROM scorm_tracking WHERE user_id = %s',
1280 'DELETE FROM sahs_user WHERE user_id = %s',
1290 $retAr = array(
"raw" => null,
"max" => null,
"scaled" => null);
1291 $val_set = $ilDB->queryF(
" 1292 SELECT lvalue, rvalue FROM scorm_tracking 1295 AND (lvalue = 'cmi.core.score.raw' OR lvalue = 'cmi.core.score.max')",
1296 array(
'integer',
'integer'),
1297 array($a_item_id, $a_user_id)
1299 while ($val_rec = $ilDB->fetchAssoc($val_set))
1301 if ($val_rec[
'lvalue'] ==
"cmi.core.score.raw") $retAr[
"raw"] = $val_rec[
"rvalue"];
1302 if ($val_rec[
'lvalue'] ==
"cmi.core.score.max") $retAr[
"max"] = $val_rec[
"rvalue"];
1304 if ($retAr[
"raw"] != null && $retAr[
"max"] != null) $retAr[
"scaled"] = ($retAr[
"raw"] / $retAr[
"max"]);
1313 $val_set = $ilDB->queryF(
'SELECT last_visited FROM sahs_user WHERE obj_id = %s AND user_id = %s',
1314 array(
'integer',
'integer'),
1315 array($this->getID(),$user_id)
1317 while ($val_rec = $ilDB->fetchAssoc($val_set))
1319 if ($val_rec[
"last_visited"] != null)
return "".$val_rec[
"last_visited"];
static _getAllScoIds($a_id)
Get an array of id's for all Sco's in the module.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
importRaw($a_file)
Import raw data ilDB $ilDB ilObjUser $ilUser.
_getTrackingItems($a_obj_id)
get all tracking items of scorm object static
parseUserId($il_id)
Parse il_usr_123_6 id.
getAttemptsForUsers()
Get attempts for all users ilDB $ilDB.
Helper class to generate CSV files.
importTrackingData($a_file)
static _getCourseCompletionForUser($a_id, $a_user)
Get the completion of a SCORM module for a given user.
static _getCompleted($scorm_item_id, $a_obj_id)
like necessary because of Oracle
getTrackedItems()
get all tracked items of current user
exportSelectedRaw($a_exportall, $a_user=array())
Export ilDB $ilDB ilObjUser $ilUser.
sendExportFile($a_header, $a_content)
send export file to browser
_getScoresForUser($a_item_id, $a_user_id)
ilObjSCORMLearningModule($a_id=0, $a_call_by_reference=true)
Constructor public.
getUserIdEmail($a_mail)
assumes that only one account exists for a mailadress
getAttemptsForUser($a_user_id)
get number of atttempts for a certain user and package
static _lookupLastAccess($a_obj_id, $a_usr_id)
Return the last access timestamp for a given user.
const DB_FETCHMODE_OBJECT
getTrackingDataPerUser($a_sco_id, $a_user_id)
Get tracking data per user ilDB $ilDB.
validate($directory)
Validate all XML-Files in a SCOM-Directory.
static _removeTrackingDataForUser($user_id)
getDataDirectory($mode="filesystem")
get data directory of lm
getId()
get object id public
redirection script todo: (a better solution should control the processing via a xml file) ...
getModuleVersionForUser($a_user_id)
get module version that tracking data for a user was recorded on
Validation of SCORM-XML Files.
getTrackedUsers($a_search)
getTrackingDataAgg($a_user_id)
exportSelected($a_all, $a_users=array())
Export selected user tracking data ilDB $ilDB ilObjUser $ilUser.
getModuleVersionForUsers()
Get module version for users.
lookupSCOId($a_referrer)
resolves manifest SCOID to internal ILIAS SCO ID
getStatusForUser($a_user, $a_allScoIds, $a_numerical=false)
static lookupLastAccessTimes($a_obj_id)
Lookup last acccess time for all users of a scorm module ilDB $ilDB.
foreach($mandatory_scripts as $file) $timestamp
static _getStatusForUser($a_id, $a_user, $a_allScoIds, $a_numerical=false)
Get the status of a SCORM module for a given user.
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
_refreshStatus($a_obj_id, $a_users=null)
Set dirty.
readObject()
read manifest file public
getRefId()
get reference id public
Class ilObjSCORMLearningModule.
Class ilObjSCORMLearningModule.
getCourseCompletionForUser($a_user)
getTrackingDataAggSco($a_sco_id)