49 global $ilObjDataCache,
$ilDB;
52 $this->obj_id = $a_obj_id;
56 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
58 include_once
"Services/Object/classes/class.ilObjectLP.php";
60 $this->obj_mode = $olp->getDefaultMode();
75 $query =
"INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
77 $this->db->quote($a_new_obj_id ,
'integer').
", ".
78 $this->db->quote($this->
getObjType() ,
'text').
", ".
79 $this->db->quote($this->
getMode() ,
'integer').
", ".
80 $this->db->quote($this->
getVisits() ,
'integer').
93 $this->visits = $a_visits;
98 $this->obj_mode = $a_mode;
118 $res = $this->db->query(
"SELECT * FROM ut_lp_settings WHERE obj_id = ".
119 $this->db->quote($this->obj_id ,
'integer'));
122 $this->is_stored =
true;
123 $this->obj_type =
$row->obj_type;
124 $this->obj_mode =
$row->u_mode;
125 $this->visits =
$row->visits;
137 if(!$this->is_stored)
141 $query =
"UPDATE ut_lp_settings SET u_mode = ".$ilDB->quote($this->
getMode() ,
'integer').
", ".
142 "visits = ".$ilDB->quote($this->
getVisits() ,
'integer').
" ".
143 "WHERE obj_id = ".$ilDB->quote($this->
getObjId() ,
'integer');
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').
179 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
187 $query =
"DELETE FROM ut_lp_settings WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
200 $query =
"SELECT visits FROM ut_lp_settings ".
201 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
219 $query =
"SELECT obj_id, u_mode FROM ut_lp_settings".
220 " WHERE ".$ilDB->in(
"obj_id", $a_obj_ids,
"",
"integer");
221 $set = $ilDB->query(
$query);
236 $query =
"SELECT u_mode FROM ut_lp_settings".
237 " WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer");
238 $set = $ilDB->query(
$query);
239 $row = $ilDB->fetchAssoc($set);
242 return $row[
'u_mode'];
252 case self::LP_MODE_DEACTIVATED:
253 return $lng->txt(
'trac_mode_deactivated');
255 case self::LP_MODE_TLT:
256 return $lng->txt(
'trac_mode_tlt');
258 case self::LP_MODE_VISITS:
259 return $lng->txt(
'trac_mode_visits');
261 case self::LP_MODE_MANUAL:
262 return $lng->txt(
'trac_mode_manual');
264 case self::LP_MODE_MANUAL_BY_TUTOR:
265 return $lng->txt(
'trac_mode_manual_by_tutor');
267 case self::LP_MODE_OBJECTIVES:
268 return $lng->txt(
'trac_mode_objectives');
270 case self::LP_MODE_COLLECTION:
271 return $lng->txt(
'trac_mode_collection');
273 case self::LP_MODE_SCORM:
274 return $lng->txt(
'trac_mode_scorm');
276 case self::LP_MODE_TEST_FINISHED:
277 return $lng->txt(
'trac_mode_test_finished');
279 case self::LP_MODE_TEST_PASSED:
280 return $lng->txt(
'trac_mode_test_passed');
282 case self::LP_MODE_EXERCISE_RETURNED:
283 return $lng->txt(
'trac_mode_exercise_returned');
285 case self::LP_MODE_SCORM_PACKAGE:
286 return $lng->txt(
'trac_mode_scorm_package');
288 case self::LP_MODE_EVENT:
289 return $lng->txt(
'trac_mode_event');
291 case self::LP_MODE_PLUGIN:
292 return $lng->txt(
'trac_mode_plugin');
294 case self::LP_MODE_COLLECTION_MANUAL:
295 return $lng->txt(
'trac_mode_collection_manual');
297 case self::LP_MODE_COLLECTION_TLT:
298 return $lng->txt(
'trac_mode_collection_tlt');
300 case self::LP_MODE_QUESTIONS:
301 return $lng->txt(
'trac_mode_questions');
311 case self::LP_MODE_DEACTIVATED:
312 return $lng->txt(
'trac_mode_deactivated_info_new');
314 case self::LP_MODE_TLT:
315 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
318 case self::LP_MODE_VISITS:
319 return $lng->txt(
'trac_mode_visits_info');
321 case self::LP_MODE_MANUAL:
322 return $lng->txt(
'trac_mode_manual_info');
324 case self::LP_MODE_MANUAL_BY_TUTOR:
325 return $lng->txt(
'trac_mode_manual_by_tutor_info');
327 case self::LP_MODE_OBJECTIVES:
328 return $lng->txt(
'trac_mode_objectives_info');
330 case self::LP_MODE_COLLECTION:
331 return $lng->txt(
'trac_mode_collection_info');
333 case self::LP_MODE_SCORM:
334 return $lng->txt(
'trac_mode_scorm_info');
336 case self::LP_MODE_TEST_FINISHED:
337 return $lng->txt(
'trac_mode_test_finished_info');
339 case self::LP_MODE_TEST_PASSED:
340 return $lng->txt(
'trac_mode_test_passed_info');
342 case self::LP_MODE_EXERCISE_RETURNED:
343 return $lng->txt(
'trac_mode_exercise_returned_info');
345 case self::LP_MODE_SCORM_PACKAGE:
346 return $lng->txt(
'trac_mode_scorm_package_info');
348 case self::LP_MODE_EVENT:
349 return $lng->txt(
'trac_mode_event_info');
351 case self::LP_MODE_COLLECTION_MANUAL:
352 return $lng->txt(
'trac_mode_collection_manual_info');
354 case self::LP_MODE_COLLECTION_TLT:
355 return $lng->txt(
'trac_mode_collection_tlt_info');
357 case self::LP_MODE_QUESTIONS:
358 return $lng->txt(
'trac_mode_questions_info');