35 define(
"LP_MODE_DEACTIVATED",0);
36 define(
"LP_MODE_TLT",1);
37 define(
"LP_MODE_VISITS",2);
38 define(
"LP_MODE_MANUAL",3);
39 define(
"LP_MODE_OBJECTIVES",4);
40 define(
"LP_MODE_COLLECTION",5);
41 define(
"LP_MODE_SCORM",6);
42 define(
"LP_MODE_TEST_FINISHED",7);
43 define(
"LP_MODE_TEST_PASSED",8);
44 define(
"LP_MODE_EXERCISE_RETURNED",9);
45 define(
"LP_MODE_EVENT",10);
46 define(
"LP_MODE_MANUAL_BY_TUTOR",11);
47 define(
"LP_MODE_SCORM_PACKAGE",12);
48 define(
"LP_MODE_UNDEFINED",13);
49 define(
"LP_MODE_PLUGIN",14);
51 define(
"LP_DEFAULT_VISITS",30);
69 global $ilObjDataCache,$ilDB;
73 $this->obj_id = $a_obj_id;
77 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
93 $query =
"INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
95 $this->db->quote($a_new_obj_id ,
'integer').
", ".
96 $this->db->quote($this->
getObjType() ,
'text').
", ".
97 $this->db->quote($this->
getMode() ,
'integer').
", ".
98 $this->db->quote($this->
getVisits() ,
'integer').
111 $this->visits = $a_visits;
116 self::$mode_by_obj_id[$this->
getObjId()] = $a_mode;
118 $this->obj_mode = $a_mode;
138 if(!$this->is_stored)
142 $query =
"UPDATE ut_lp_settings SET u_mode = ".$ilDB->quote($this->
getMode() ,
'integer').
", ".
143 "visits = ".$ilDB->quote($this->
getVisits() ,
'integer').
" ".
144 "WHERE obj_id = ".$ilDB->quote($this->
getObjId() ,
'integer');
149 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
161 $query =
"INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
163 $ilDB->quote($this->
getObjId() ,
'integer').
", ".
164 $ilDB->quote($this->
getObjType(),
'text').
", ".
165 $ilDB->quote($this->
getMode(),
'integer').
", ".
166 $ilDB->quote($this->
getVisits(),
'integer').
172 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
184 $query =
"SELECT visits FROM ut_lp_settings ".
185 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
208 $query =
"DELETE FROM ut_lp_settings WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
216 global $ilDB,$ilObjDataCache;
218 if (isset(self::$mode_by_obj_id[$a_obj_id]))
220 return self::$mode_by_obj_id[$a_obj_id];
234 $query =
"SELECT u_mode FROM ut_lp_settings ".
235 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
240 self::$mode_by_obj_id[$a_obj_id] =
$row->u_mode;
246 self::$mode_by_obj_id[$a_obj_id] = $def_mode;
255 switch($this->obj_type)
272 LP_MODE_DEACTIVATE => $lng->txt(
'trac_mode_deactivated')
285 include_once
'./Services/Tracking/classes/class.ilLPCollections.php';
286 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
289 if ($subtype !=
"scorm2004")
293 return array(
LP_MODE_SCORM => $lng->txt(
'trac_mode_scorm_aicc'));
306 return array(
LP_MODE_SCORM => $lng->txt(
'trac_mode_scorm_aicc'),
339 return array(
LP_MODE_EVENT => $this->lng->txt(
'trac_mode_event'));
353 return $lng->txt(
'trac_mode_deactivated');
356 return $lng->txt(
'trac_mode_tlt');
359 return $lng->txt(
'trac_mode_visits');
362 return $lng->txt(
'trac_mode_manual');
365 return $lng->txt(
'trac_mode_manual_by_tutor');
368 return $lng->txt(
'trac_mode_objectives');
371 return $lng->txt(
'trac_mode_collection');
374 return $lng->txt(
'trac_mode_scorm');
377 return $lng->txt(
'trac_mode_test_finished');
380 return $lng->txt(
'trac_mode_test_passed');
383 return $lng->txt(
'trac_mode_exercise_returned');
386 return $lng->txt(
'trac_mode_scorm_package');
389 return $lng->txt(
'trac_mode_event');
392 return $lng->txt(
'trac_mode_plugin');
411 return $lng->txt(
'trac_mode_deactivated_info_new');
418 return $lng->txt(
'trac_mode_visits_info');
421 return $lng->txt(
'trac_mode_manual_info');
424 return $lng->txt(
'trac_mode_manual_by_tutor_info');
427 return $lng->txt(
'trac_mode_objectives_info');
430 return $lng->txt(
'trac_mode_collection_info');
433 return $lng->txt(
'trac_mode_scorm_info');
436 return $lng->txt(
'trac_mode_test_finished_info');
439 return $lng->txt(
'trac_mode_test_passed_info');
442 return $lng->txt(
'trac_mode_exercise_returned_info');
445 return $lng->txt(
'trac_mode_scorm_package_info');
448 return $lng->txt(
'trac_mode_event_info');
459 global $ilDB,$ilObjDataCache;
462 if($ilObjDataCache->lookupType($a_obj_id) ==
'crs')
464 include_once
'Modules/Course/classes/class.ilObjCourse.php';
476 global $ilObjDataCache;
478 if($ilObjDataCache->lookupType($a_obj_id) !=
'sahs')
482 include_once(
'./Services/AccessControl/classes/class.ilConditionHandler.php');
494 $res = $this->db->query(
"SELECT * FROM ut_lp_settings WHERE obj_id = ".
495 $this->db->quote($this->obj_id ,
'integer'));
498 $this->is_stored =
true;
499 $this->obj_type =
$row->obj_type;
500 $this->obj_mode =
$row->u_mode;
501 $this->visits =
$row->visits;
520 global $ilDB, $objDefinition;
522 #$type = strlen($a_type) ? $a_type : $this->obj_type;