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);
68 global $ilObjDataCache,
$ilDB;
72 $this->obj_id = $a_obj_id;
76 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
92 $query =
"INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
94 $this->db->quote($a_new_obj_id ,
'integer').
", ".
95 $this->db->quote($this->
getObjType() ,
'text').
", ".
96 $this->db->quote($this->
getMode() ,
'integer').
", ".
97 $this->db->quote($this->
getVisits() ,
'integer').
110 $this->visits = $a_visits;
115 $this->obj_mode = $a_mode;
135 if(!$this->is_stored)
139 $query =
"UPDATE ut_lp_settings SET u_mode = ".$ilDB->quote($this->
getMode() ,
'integer').
", ".
140 "visits = ".$ilDB->quote($this->
getVisits() ,
'integer').
" ".
141 "WHERE obj_id = ".$ilDB->quote($this->
getObjId() ,
'integer');
146 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
158 $query =
"INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
160 $ilDB->quote($this->
getObjId() ,
'integer').
", ".
161 $ilDB->quote($this->
getObjType(),
'text').
", ".
162 $ilDB->quote($this->
getMode(),
'integer').
", ".
163 $ilDB->quote(0,
'integer').
169 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
181 $query =
"SELECT visits FROM ut_lp_settings ".
182 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
205 $query =
"DELETE FROM ut_lp_settings WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
213 global
$ilDB,$ilObjDataCache;
215 if (isset(self::$mode_by_obj_id[$a_obj_id]))
217 return self::$mode_by_obj_id[$a_obj_id];
231 $query =
"SELECT u_mode FROM ut_lp_settings ".
232 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
237 self::$mode_by_obj_id[$a_obj_id] =
$row->u_mode;
243 self::$mode_by_obj_id[$a_obj_id] = $def_mode;
252 switch($this->obj_type)
269 LP_MODE_DEACTIVATE => $lng->txt(
'trac_mode_deactivated')
282 include_once
'./Services/Tracking/classes/class.ilLPCollections.php';
283 include_once
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
286 if ($subtype !=
"scorm2004")
290 return array(
LP_MODE_SCORM => $lng->txt(
'trac_mode_scorm_aicc'));
303 return array(
LP_MODE_SCORM => $lng->txt(
'trac_mode_scorm_aicc'),
336 return array(
LP_MODE_EVENT => $this->lng->txt(
'trac_mode_event'));
350 return $lng->txt(
'trac_mode_deactivated');
353 return $lng->txt(
'trac_mode_tlt');
356 return $lng->txt(
'trac_mode_visits');
359 return $lng->txt(
'trac_mode_manual');
362 return $lng->txt(
'trac_mode_manual_by_tutor');
365 return $lng->txt(
'trac_mode_objectives');
368 return $lng->txt(
'trac_mode_collection');
371 return $lng->txt(
'trac_mode_scorm');
374 return $lng->txt(
'trac_mode_test_finished');
377 return $lng->txt(
'trac_mode_test_passed');
380 return $lng->txt(
'trac_mode_exercise_returned');
383 return $lng->txt(
'trac_mode_scorm_package');
386 return $lng->txt(
'trac_mode_event');
407 return $lng->txt(
'trac_mode_deactivated_info_new');
410 return $lng->txt(
'trac_mode_tlt_info');
413 return $lng->txt(
'trac_mode_visits_info');
416 return $lng->txt(
'trac_mode_manual_info');
419 return $lng->txt(
'trac_mode_manual_by_tutor_info');
422 return $lng->txt(
'trac_mode_objectives_info');
425 return $lng->txt(
'trac_mode_collection_info');
428 return $lng->txt(
'trac_mode_scorm_info');
431 return $lng->txt(
'trac_mode_test_finished_info');
434 return $lng->txt(
'trac_mode_test_passed_info');
437 return $lng->txt(
'trac_mode_exercise_returned_info');
440 return $lng->txt(
'trac_mode_scorm_package_info');
443 return $lng->txt(
'trac_mode_event_info');
454 global
$ilDB,$ilObjDataCache;
457 if($ilObjDataCache->lookupType($a_obj_id) ==
'crs')
459 include_once
'Modules/Course/classes/class.ilObjCourse.php';
471 global $ilObjDataCache;
473 if($ilObjDataCache->lookupType($a_obj_id) !=
'sahs')
477 include_once(
'classes/class.ilConditionHandler.php');
489 $res = $this->db->query(
"SELECT * FROM ut_lp_settings WHERE obj_id = ".
490 $this->db->quote($this->obj_id ,
'integer'));
493 $this->is_stored =
true;
494 $this->obj_type =
$row->obj_type;
495 $this->obj_mode =
$row->u_mode;
496 $this->visits =
$row->visits;
517 #$type = strlen($a_type) ? $a_type : $this->obj_type;