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);
50 define(
"LP_DEFAULT_VISITS",30);
66 global $ilObjDataCache,
$ilDB;
70 $this->obj_id = $a_obj_id;
74 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
90 $query =
"INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
92 $this->db->quote($a_new_obj_id ,
'integer').
", ".
93 $this->db->quote($this->
getObjType() ,
'text').
", ".
94 $this->db->quote($this->
getMode() ,
'integer').
", ".
95 $this->db->quote($this->
getVisits() ,
'integer').
108 $this->visits = $a_visits;
113 $this->obj_mode = $a_mode;
133 if(!$this->is_stored)
137 $query =
"UPDATE ut_lp_settings SET u_mode = ".$ilDB->quote($this->
getMode() ,
'integer').
", ".
138 "visits = ".$ilDB->quote($this->
getVisits() ,
'integer').
" ".
139 "WHERE obj_id = ".$ilDB->quote($this->
getObjId() ,
'integer');
144 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
156 $query =
"INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
158 $ilDB->quote($this->
getObjId() ,
'integer').
", ".
159 $ilDB->quote($this->
getObjType(),
'text').
", ".
160 $ilDB->quote($this->
getMode(),
'integer').
", ".
161 $ilDB->quote(0,
'integer').
167 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
179 $query =
"SELECT visits FROM ut_lp_settings ".
180 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
203 $query =
"DELETE FROM ut_lp_settings WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
211 global
$ilDB,$ilObjDataCache;
222 $query =
"SELECT u_mode FROM ut_lp_settings ".
223 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
239 switch($this->obj_type)
256 LP_MODE_DEACTIVATE => $lng->txt(
'trac_mode_deactivated')
269 include_once
'./Services/Tracking/classes/class.ilLPCollections.php';
270 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
273 if ($subtype !=
"scorm2004")
277 return array(
LP_MODE_SCORM => $lng->txt(
'trac_mode_scorm_aicc'));
290 return array(
LP_MODE_SCORM => $lng->txt(
'trac_mode_scorm_aicc'),
323 return array(
LP_MODE_EVENT => $this->lng->txt(
'trac_mode_event'));
337 return $lng->txt(
'trac_mode_deactivated');
340 return $lng->txt(
'trac_mode_tlt');
343 return $lng->txt(
'trac_mode_visits');
346 return $lng->txt(
'trac_mode_manual');
349 return $lng->txt(
'trac_mode_manual_by_tutor');
352 return $lng->txt(
'trac_mode_objectives');
355 return $lng->txt(
'trac_mode_collection');
358 return $lng->txt(
'trac_mode_scorm');
361 return $lng->txt(
'trac_mode_test_finished');
364 return $lng->txt(
'trac_mode_test_passed');
367 return $lng->txt(
'trac_mode_exercise_returned');
370 return $lng->txt(
'trac_mode_scorm_package');
373 return $lng->txt(
'trac_mode_event');
394 return $lng->txt(
'trac_mode_deactivated_info_new');
397 return $lng->txt(
'trac_mode_tlt_info');
400 return $lng->txt(
'trac_mode_visits_info');
403 return $lng->txt(
'trac_mode_manual_info');
406 return $lng->txt(
'trac_mode_manual_by_tutor_info');
409 return $lng->txt(
'trac_mode_objectives_info');
412 return $lng->txt(
'trac_mode_collection_info');
415 return $lng->txt(
'trac_mode_scorm_info');
418 return $lng->txt(
'trac_mode_test_finished_info');
421 return $lng->txt(
'trac_mode_test_passed_info');
424 return $lng->txt(
'trac_mode_exercise_returned_info');
427 return $lng->txt(
'trac_mode_scorm_package_info');
430 return $lng->txt(
'trac_mode_event_info');
441 global
$ilDB,$ilObjDataCache;
444 if($ilObjDataCache->lookupType($a_obj_id) ==
'crs')
446 include_once
'Modules/Course/classes/class.ilObjCourse.php';
458 global $ilObjDataCache;
460 if($ilObjDataCache->lookupType($a_obj_id) !=
'sahs')
464 include_once(
'classes/class.ilConditionHandler.php');
476 $res = $this->db->query(
"SELECT * FROM ut_lp_settings WHERE obj_id = ".
477 $this->db->quote($this->obj_id ,
'integer'));
480 $this->is_stored =
true;
481 $this->obj_type =
$row->obj_type;
482 $this->obj_mode =
$row->u_mode;
483 $this->visits =
$row->visits;
504 #$type = strlen($a_type) ? $a_type : $this->obj_type;