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";
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 MAX(c_timestamp) last_access FROM scorm_tracking
270 array(
'integer',
'integer'), array($a_obj_id,$a_usr_id));
275 return $row[
"last_access"];
284 $query =
'SELECT user_id,MAX(c_timestamp) last_access, lastname, firstname FROM scorm_tracking st ' .
285 'JOIN usr_data ud ON st.user_id = ud.usr_id ' .
286 'WHERE obj_id = ' . $ilDB->quote($this->
getId(),
'integer');
289 $query .=
' AND ' . $ilDB->like(
'lastname',
'text',
'%' . $a_search .
'%');
291 $query .=
' GROUP BY user_id, lastname, firstname';
292 $sco_set = $ilDB->query(
$query);
295 while($sco_rec = $ilDB->fetchAssoc($sco_set))
312 $query =
'SELECT user_id,rvalue FROM scorm_tracking ' .
313 'WHERE lvalue = ' . $ilDB->quote(
'package_attempts',
'text') .
' ' .
314 'AND obj_id = ' . $ilDB->quote($this->
getId(),
'integer') .
' ';
320 $attempts[
$row[
'user_id']] = (int) $row[
'rvalue'];
332 $val_set = $ilDB->queryF(
'
333 SELECT * FROM scorm_tracking
338 array(
'integer',
'integer',
'text',
'integer'),
339 array($a_user_id,0,
'package_attempts',$this->
getId()));
341 $val_rec = $ilDB->fetchAssoc($val_set);
343 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
344 if ($val_rec[
"rvalue"] == null) {
345 $val_rec[
"rvalue"]=
"";
347 return $val_rec[
"rvalue"];
359 $query =
'SELECT user_id,rvalue FROM scorm_tracking ' .
360 'WHERE lvalue = ' . $ilDB->quote(
'module_version',
'text') .
' ' .
361 'AND obj_id = ' . $ilDB->quote($this->
getId(),
'integer') .
' ';
367 $versions[
$row[
'user_id']] = (int) $row[
'rvalue'];
379 $val_set = $ilDB->queryF(
'
380 SELECT * FROM scorm_tracking
385 array(
'integer',
'integer',
'text',
'integer'),
386 array($a_user_id,0,
'module_version',$this->
getId()));
388 $val_rec = $ilDB->fetchAssoc($val_set);
391 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
392 if ($val_rec[
"rvalue"] == null) {
393 $val_rec[
"rvalue"]=
"";
395 return $val_rec[
"rvalue"];
409 $data_set = $ilDB->queryF(
'
410 SELECT * FROM scorm_tracking
415 array(
'integer',
'integer',
'integer'),
416 array($a_user_id,$a_sco_id,$this->
getId()));
419 while($data_rec = $ilDB->fetchAssoc($data_set)) {
431 $sco_set = $ilDB->queryF(
'
432 SELECT DISTINCT sco_id FROM scorm_tracking
436 array(
'integer',
'integer',
'integer'),
437 array($this->
getId(),$a_user_id,0));
440 while($sco_rec = $ilDB->fetchAssoc($sco_set))
442 $data_set = $ilDB->queryF(
'
443 SELECT * FROM scorm_tracking
451 array(
'integer',
'integer',
'integer',
'text',
'text',
'text',
'text'),
452 array($this->
getId(),
456 "cmi.core.lesson_status",
457 "cmi.core.total_time",
458 "cmi.core.score.raw")
461 $score = $time = $status =
"";
463 while($data_rec = $ilDB->fetchAssoc($data_set))
465 switch($data_rec[
"lvalue"])
467 case "cmi.core.lesson_status":
468 $status = $data_rec[
"rvalue"];
471 case "cmi.core.total_time":
472 $time = $data_rec[
"rvalue"];
475 case "cmi.core.score.raw":
476 $score = $data_rec[
"rvalue"];
481 include_once
'./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php';
483 $data[] = array(
"sco_id"=>$sco_rec[
"sco_id"],
"title" => $sc_item->getTitle(),
484 "score" => $score,
"time" => $time,
"status" => $status);
487 return (array)
$data;
495 $user_set = $ilDB->queryF(
'
496 SELECT DISTINCT user_id FROM scorm_tracking
499 array(
'integer',
'integer'),
500 array($this->
getId(),$a_sco_id));
503 while($user_rec = $ilDB->fetchAssoc($user_set))
506 $data_set = $ilDB->queryF(
'
507 SELECT * FROM scorm_tracking
514 array(
'integer',
'integer',
'integer',
'text',
'text',
'text'),
515 array($this->
getId(),
517 $user_rec[
"user_id"],
518 "cmi.core.lesson_status",
519 "cmi.core.total_time",
520 "cmi.core.score.raw")
523 $score = $time = $status =
"";
525 while($data_rec = $ilDB->fetchAssoc($data_set))
527 switch($data_rec[
"lvalue"])
529 case "cmi.core.lesson_status":
530 $status = $data_rec[
"rvalue"];
533 case "cmi.core.total_time":
534 $time = $data_rec[
"rvalue"];
537 case "cmi.core.score.raw":
538 $score = $data_rec[
"rvalue"];
543 $data[] = array(
"user_id" => $user_rec[
"user_id"],
544 "score" => $score,
"time" => $time,
"status" => $status);
562 $inst_id = $ilSetting->get(
'inst_id',0);
564 include_once
'./Services/Utilities/classes/class.ilCSVWriter.php';
566 $csv->setSeparator(
';');
567 $csv->addColumn(
'Scoid');
568 $csv->addColumn(
'Key');
569 $csv->addColumn(
'Value');
570 $csv->addColumn(
'Email');
571 $csv->addColumn(
'Timestamp');
572 $csv->addColumn(
'Userid');
575 $user_array = array();
578 $res = $ilDB->queryF(
579 'SELECT user_id FROM scorm_tracking WHERE obj_id = %s GROUP BY user_id',
581 array($this->
getId())
583 while(
$row = $ilDB->fetchAssoc(
$res))
585 $user_array[] =
$row[
'user_id'];
590 $user_array = $a_user;
594 $query =
"SELECT usr_id,email FROM usr_data ".
595 "WHERE ".$ilDB->in(
'usr_id', $user_array, FALSE,
'integer');
600 $emails[
$row->usr_id] =
$row->email;
603 foreach($user_array as $user_id)
606 $query =
'SELECT rvalue, lvalue, identifierref, c_timestamp FROM scorm_tracking st '.
607 'JOIN sc_item si ON st.sco_id = si.obj_id '.
608 'WHERE user_id = '.$ilDB->quote($user_id,
'integer').
' '.
609 'AND st.obj_id = '.$ilDB->quote($this->
getId(),
'integer');
614 $csv->addColumn(
$row->identifierref);
615 $csv->addColumn(
$row->lvalue);
616 $csv->addColumn(
$row->rvalue);
617 $csv->addColumn(isset($emails[$user_id]) ? (
string) $emails[$user_id] :
'');
618 $csv->addColumn(
$row->c_timestamp);
619 $csv->addColumn(
'il_usr_'.$inst_id.
'_'.$user_id);
622 $query =
'SELECT rvalue, lvalue, c_timestamp FROM scorm_tracking '.
623 'WHERE sco_id = 0 AND user_id = '.$ilDB->quote($user_id,
'integer').
' '.
624 'AND obj_id = '.$ilDB->quote($this->
getId(),
'integer');
630 $csv->addColumn(
$row->lvalue);
631 $csv->addColumn(
$row->rvalue);
632 $csv->addColumn(isset($emails[$user_id]) ? (
string) $emails[$user_id] :
'');
633 $csv->addColumn(
$row->c_timestamp);
634 $csv->addColumn(
'il_usr_'.$inst_id.
'_'.$user_id);
639 $csv->getCSVString(),
640 'scorm_tracking_raw_' . $this->
getRefId() .
'_' . time() .
'.csv'
658 $inst_id = $ilSetting->get(
'inst_id',0);
664 $query =
'SELECT scorm_object.obj_id, scorm_object.title, '
665 .
'scorm_object.c_type, scorm_object.slm_id, scorm_object.obj_id scoid '
666 .
'FROM scorm_object, sc_item, sc_resource '
667 .
'WHERE (scorm_object.slm_id = %s '
668 .
'AND scorm_object.obj_id = sc_item.obj_id '
669 .
'AND sc_item.identifierref = sc_resource.import_id '
670 .
'AND sc_resource.scormtype = %s) '
671 .
'GROUP BY scorm_object.obj_id, scorm_object.title, scorm_object.c_type, '
672 .
'scorm_object.slm_id, scorm_object.obj_id ';
673 $res = $ilDB->queryF(
675 array(
'integer',
'text'),
676 array($this->
getId(),
'sco')
678 while(
$row = $ilDB->fetchAssoc(
$res))
680 $scos[] =
$row[
'scoid'];
687 $query =
'SELECT user_id FROM scorm_tracking ' .
688 'WHERE obj_id = ' . $ilDB->quote($this->
getId(),
'integer') .
' ' .
691 while(
$row = $ilDB->fetchAssoc(
$res))
693 $users[] =
$row[
'user_id'];
702 include_once
'./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php';
706 include_once
'./Services/Utilities/classes/class.ilCSVWriter.php';
708 $csv->setSeparator(
';');
709 foreach(array(
'Department',
'Login',
'Lastname',
'Firstname',
'Email',
'Date',
'Status') as $col)
711 $csv->addColumn($col);
715 $query =
'SELECT usr_id,login,firstname,lastname,department,email ' .
717 'WHERE ' . $ilDB->in(
'usr_id', $users,
false,
'integer');
723 $csv->addColumn((
string)
$row->department);
724 $csv->addColumn((
string)
$row->login);
725 $csv->addColumn((
string)
$row->lastname);
726 $csv->addColumn((
string)
$row->firstname);
727 $csv->addColumn((
string)
$row->email);
728 if(isset($last[
$row->usr_id]))
737 $csv->addColumn(in_array(
$row->usr_id, $completed) ? 1 : 0);
742 $csv->getCSVString(),
743 'scorm_tracking_' . $this->
getRefId() .
'_' . time() .
'.csv'
757 $fhandle = fopen($a_file,
"r");
760 $fields = fgetcsv($fhandle, pow(2, 16),
';');
786 $val_set = $ilDB->queryF(
'
787 SELECT scorm_object.obj_id,
791 scorm_object.obj_id scoid
792 FROM scorm_object,sc_item,sc_resource
793 WHERE(scorm_object.slm_id = %s
794 AND scorm_object.obj_id=sc_item.obj_id
795 AND sc_item.identifierref = sc_resource.import_id
796 AND sc_resource.scormtype = %s)
797 GROUP BY scorm_object.obj_id,
801 scorm_object.obj_id ',
802 array(
'integer',
'text'),
803 array($this->
getId(),
'sco')
806 if (count($val_set)<1)
810 while($rows_sco = $ilDB->fetchAssoc($val_set))
812 array_push($scos,$rows_sco[
'scoid']);
815 $fhandle = fopen($a_file,
"r");
817 $obj_id = $this->getID();
819 $fields = fgetcsv($fhandle, pow(2, 16),
';');
821 while(($csv_rows = fgetcsv($fhandle, pow(2, 16),
";")) !== FALSE)
823 $data = array_combine($fields, $csv_rows);
826 if (count($csv_rows) == 6) {$statuscheck = 1;}
832 $import =
$data[
"Status"];
833 if ($import ==
"") {$import = 1;}
836 foreach ($scos as $sco)
840 $date_ex = explode(
'.',
$data[
'Date']);
841 $date = implode(
'-', array($date_ex[2], $date_ex[1], $date_ex[0]));
843 $statement = $ilDB->queryF(
'
844 SELECT * FROM scorm_tracking
849 array(
'integer',
'integer',
'text',
'integer'),
850 array($user_id, $sco_id,
'cmi.core.lesson_status',$obj_id)
852 if($ilDB->numRows($statement) > 0)
854 $ilDB->update(
'scorm_tracking',
856 'rvalue' => array(
'clob',
'completed'),
857 'c_timestamp' => array(
'timestamp', $date)
860 'user_id' => array(
'integer', $user_id),
861 'sco_id' => array(
'integer', $sco_id),
862 'lvalue' => array(
'text',
'cmi.core.lesson_status'),
863 'obj_id' => array(
'integer', $obj_id)
869 $ilDB->insert(
'scorm_tracking', array(
870 'obj_id' => array(
'integer', $obj_id),
871 'user_id' => array(
'integer', $user_id),
872 'sco_id' => array(
'integer', $sco_id),
873 'lvalue' => array(
'text',
'cmi.core.lesson_status'),
874 'rvalue' => array(
'clob',
'completed'),
875 'c_timestamp' => array(
'timestamp', $date)
879 $statement = $ilDB->queryF(
'
880 SELECT * FROM scorm_tracking
885 array(
'integer',
'integer',
'text',
'integer'),
886 array($user_id, $sco_id,
'cmi.core.entry',$obj_id)
888 if($ilDB->numRows($statement) > 0)
890 $ilDB->update(
'scorm_tracking',
892 'rvalue' => array(
'clob',
'completed'),
893 'c_timestamp' => array(
'timestamp', $date)
896 'user_id' => array(
'integer', $user_id),
897 'sco_id' => array(
'integer', $sco_id),
898 'lvalue' => array(
'text',
'cmi.core.entry'),
899 'obj_id' => array(
'integer', $obj_id)
905 $ilDB->insert(
'scorm_tracking', array(
906 'obj_id' => array(
'integer', $obj_id),
907 'user_id' => array(
'integer', $user_id),
908 'sco_id' => array(
'integer', $sco_id),
909 'lvalue' => array(
'text',
'cmi.core.entry'),
910 'rvalue' => array(
'clob',
'completed'),
911 'c_timestamp' => array(
'timestamp', $date)
921 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
936 $parts = explode(
'_', $il_id);
938 if(!count((array) $parts))
942 if(!isset($parts[2]) or !isset($parts[3]))
946 if($parts[2] != $ilSetting->get(
'inst_id',$parts[2]))
964 $fhandle = fopen($a_file,
"r");
966 $fields = fgetcsv($fhandle, pow(2, 16),
';');
968 while(($csv_rows = fgetcsv($fhandle, pow(2, 16),
";")) !== FALSE)
970 $data = array_combine($fields, $csv_rows);
983 $statement = $ilDB->queryF(
'
984 SELECT * FROM scorm_tracking
989 array(
'integer',
'integer',
'text',
'integer'),
990 array($user_id, $il_sco_id,
$data[
'Key'], $this->getID())
992 if($ilDB->numRows($statement) > 0)
994 $ilDB->update(
'scorm_tracking',
996 'rvalue' => array(
'clob',
$data[
'Value']),
997 'c_timestamp' => array(
'timestamp',
$data[
'Timestamp'])
1000 'user_id' => array(
'integer', $user_id),
1001 'sco_id' => array(
'integer', $il_sco_id),
1002 'lvalue' => array(
'text',
$data[
'Key']),
1003 'obj_id' => array(
'integer', $this->
getId())
1009 $ilDB->insert(
'scorm_tracking', array(
1010 'obj_id' => array(
'integer', $this->
getId()),
1011 'user_id' => array(
'integer', $user_id),
1012 'sco_id' => array(
'integer', $il_sco_id),
1013 'lvalue' => array(
'text',
$data[
'Key']),
1014 'rvalue' => array(
'clob',
$data[
'Value']),
1015 'c_timestamp' => array(
'timestamp',
$data[
'Timestamp'])
1022 include_once
'./Services/Tracking/classes/class.ilLPStatusWrapper.php';
1032 $val_set = $ilDB->queryF(
'SELECT * FROM usr_data WHERE(login=%s)',
1033 array(
'text'),array($a_login));
1034 $val_rec = $ilDB->fetchAssoc($val_set);
1036 if (count($val_rec)>0) {
1037 return $val_rec[
'usr_id'];
1051 if ($a_referrer==
"0") {
1055 $val_set = $ilDB->queryF(
'
1056 SELECT obj_id FROM sc_item,scorm_tree
1057 WHERE (obj_id = child
1058 AND identifierref = %s
1060 array(
'text',
'integer'), array($a_referrer,$this->getID()));
1061 $val_rec = $ilDB->fetchAssoc($val_set);
1063 return $val_rec[
"obj_id"];
1073 $val_set = $ilDB->queryF(
'SELECT usr_id FROM usr_data WHERE(email=%s)',
1074 array(
'text'),array($a_mail));
1075 $val_rec = $ilDB->fetchAssoc($val_set);
1078 return $val_rec[
"usr_id"];
1091 header(
"Expires: 0");
1092 header(
"Cache-control: private");
1093 header(
"Cache-Control: must-revalidate, post-check=0, pre-check=0");
1094 header(
"Content-Description: File Transfer");
1095 header(
"Content-Type: application/octet-stream");
1096 header(
"Content-disposition: attachment; filename=$filename");
1097 echo $a_header.$a_content;
1112 $val_set = $ilDB->queryF(
'
1113 SELECT scorm_object.obj_id,
1115 scorm_object.c_type,
1116 scorm_object.slm_id,
1117 scorm_object.obj_id scoid
1118 FROM scorm_object,sc_item,sc_resource
1119 WHERE(scorm_object.slm_id = %s
1120 AND scorm_object.obj_id = sc_item.obj_id
1121 AND sc_item.identifierref = sc_resource.import_id
1122 AND sc_resource.scormtype = %s)
1123 GROUP BY scorm_object.obj_id,
1125 scorm_object.c_type,
1126 scorm_object.slm_id,
1127 scorm_object.obj_id ',
1128 array(
'integer',
'text'),
1129 array($a_id,
'sco'));
1131 while ($val_rec = $ilDB->fetchAssoc($val_set))
1133 array_push($scos,$val_rec[
'scoid']);
1150 $scos = $a_allScoIds;
1152 $scos_c = implode(
',',$scos);
1154 $val_set = $ilDB->queryF(
'
1155 SELECT * FROM scorm_tracking
1158 AND '.$ilDB->in(
'sco_id', $scos,
false,
'integer').
'
1159 AND ((lvalue = %s AND '.$ilDB->like(
'rvalue',
'clob',
'completed').
')
1160 OR (lvalue = %s AND '.$ilDB->like(
'rvalue',
'clob',
'passed').
')))',
1161 array(
'integer',
'integer',
'text',
'text'),
1162 array($a_user,$a_id,
'cmi.core.lesson_status',
'cmi.core.lesson_status'));
1163 while ($val_rec = $ilDB->fetchAssoc($val_set))
1165 $key = array_search($val_rec[
'sco_id'], $scos);
1166 unset ($scos[$key]);
1169 if (count($scos) == 0) {
1170 $completion = ($a_numerical===
true) ?
true: $lng->txt(
"cont_complete");
1172 if (count($scos) > 0) {
1173 $completion = ($a_numerical===
true) ?
false: $lng->txt(
"cont_incomplete");
1194 $val_set = $ilDB->queryF(
'
1195 SELECT scorm_object.obj_id,
1197 scorm_object.c_type,
1198 scorm_object.slm_id,
1199 scorm_object.obj_id scoid
1200 FROM scorm_object, sc_item,sc_resource
1201 WHERE(scorm_object.slm_id = %s
1202 AND scorm_object.obj_id = sc_item.obj_id
1203 AND sc_item.identifierref = sc_resource.import_id
1204 AND sc_resource.scormtype = %s )
1205 GROUP BY scorm_object.obj_id,
1207 scorm_object.c_type,
1208 scorm_object.slm_id,
1209 scorm_object.obj_id',
1210 array(
'integer',
'text'),
1211 array($this->
getId(),
'sco'));
1213 while ($val_rec = $ilDB->fetchAssoc($val_set))
1215 array_push($scos,$val_rec[
'scoid']);
1222 $scos = $a_allScoIds;
1225 $scos_c = implode(
',',$scos);
1227 $val_set = $ilDB->queryF(
'
1228 SELECT sco_id FROM scorm_tracking
1231 AND '.$ilDB->in(
'sco_id', $scos,
false,
'integer').
'
1232 AND ((lvalue = %s AND '.$ilDB->like(
'rvalue',
'clob',
'completed').
') OR (lvalue = %s AND '.$ilDB->like(
'rvalue',
'clob',
'passed').
') ) )',
1233 array(
'integer',
'integer',
'text',
'text',),
1234 array($a_user,$this->getID(),
'cmi.core.lesson_status',
'cmi.core.lesson_status'));
1235 while ($val_rec = $ilDB->fetchAssoc($val_set))
1237 $key = array_search($val_rec[
'sco_id'], $scos);
1238 unset ($scos[$key]);
1241 if (count($scos) == 0) {
1242 $completion = ($a_numerical===
true) ?
true: $this->lng->txt(
"cont_complete");
1244 if (count($scos) > 0) {
1245 $completion = ($a_numerical===
true) ?
false: $this->lng->txt(
"cont_incomplete");
1259 'DELETE FROM scorm_tracking WHERE user_id = %s',
1269 $retAr = array(
"raw" => null,
"max" => null,
"scaled" => null);
1270 $val_set = $ilDB->queryF(
"
1271 SELECT lvalue, rvalue FROM scorm_tracking
1274 AND (lvalue = 'cmi.core.score.raw' OR lvalue = 'cmi.core.score.max')",
1275 array(
'integer',
'integer'),
1276 array($a_item_id, $a_user_id)
1278 while ($val_rec = $ilDB->fetchAssoc($val_set))
1280 if ($val_rec[
'lvalue'] ==
"cmi.core.score.raw") $retAr[
"raw"] = $val_rec[
"rvalue"];
1281 if ($val_rec[
'lvalue'] ==
"cmi.core.score.max") $retAr[
"max"] = $val_rec[
"rvalue"];
1283 if ($retAr[
"raw"] != null && $retAr[
"max"] != null) $retAr[
"scaled"] = ($retAr[
"raw"] / $retAr[
"max"]);
1292 $val_set = $ilDB->queryF(
'
1293 SELECT rvalue FROM scorm_tracking
1298 array(
'integer',
'integer',
'text',
'integer'),
1299 array($user_id,0,
'last_visited',$this->getID())
1301 while ($val_rec = $ilDB->fetchAssoc($val_set))
1303 return "".$val_rec[
"rvalue"];