ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilLPObjSettings Class Reference
+ Collaboration diagram for ilLPObjSettings:

Public Member Functions

 __construct ($a_obj_id)
 ilLPObjSettings constructor. More...
 
 cloneSettings ($a_new_obj_id)
 Clone settings. More...
 
 getVisits ()
 
 setVisits ($a_visits)
 
 setMode ($a_mode)
 
 getMode ()
 
 getObjId ()
 
 getObjType ()
 
 __read ()
 
 update ($a_refresh_lp=true)
 
 insert ()
 

Static Public Member Functions

static _delete ($a_obj_id)
 
static _lookupVisits ($a_obj_id)
 
static _lookupDBModeForObjects (array $a_obj_ids)
 
static _lookupDBMode ($a_obj_id)
 
static _mode2Text ($a_mode)
 
static _mode2InfoText ($a_mode)
 
static getClassMap ()
 
static _deleteByObjId ($a_obj_id)
 

Data Fields

 $db = null
 
 $obj_id = null
 
 $obj_type = null
 
 $obj_mode = null
 
 $visits = null
 
 $is_stored = false
 
const LP_MODE_DEACTIVATED = 0
 
const LP_MODE_TLT = 1
 
const LP_MODE_VISITS = 2
 
const LP_MODE_MANUAL = 3
 
const LP_MODE_OBJECTIVES = 4
 
const LP_MODE_COLLECTION = 5
 
const LP_MODE_SCORM = 6
 
const LP_MODE_TEST_FINISHED = 7
 
const LP_MODE_TEST_PASSED = 8
 
const LP_MODE_EXERCISE_RETURNED = 9
 
const LP_MODE_EVENT = 10
 
const LP_MODE_MANUAL_BY_TUTOR = 11
 
const LP_MODE_SCORM_PACKAGE = 12
 
const LP_MODE_UNDEFINED = 13
 
const LP_MODE_PLUGIN = 14
 
const LP_MODE_COLLECTION_TLT = 15
 
const LP_MODE_COLLECTION_MANUAL = 16
 
const LP_MODE_QUESTIONS = 17
 
const LP_MODE_SURVEY_FINISHED = 18
 
const LP_MODE_VISITED_PAGES = 19
 
const LP_MODE_CONTENT_VISITED = 20
 
const LP_MODE_COLLECTION_MOBS = 21
 
const LP_MODE_STUDY_PROGRAMME = 22
 
const LP_MODE_INDIVIDUAL_ASSESSMENT = 23
 
const LP_MODE_CMIX_COMPLETED = 24
 
const LP_MODE_CMIX_COMPL_WITH_FAILED = 25
 
const LP_MODE_CMIX_PASSED = 26
 
const LP_MODE_CMIX_PASSED_WITH_FAILED = 27
 
const LP_MODE_CMIX_COMPLETED_OR_PASSED = 28
 
const LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED = 29
 
const LP_DEFAULT_VISITS = 30
 
const LP_MODE_LTI_OUTCOME = 31
 
const LP_MODE_COURSE_REFERENCE = 32
 

Protected Member Functions

 doLPRefresh ()
 

Static Protected Attributes

static $map
 

Detailed Description

Definition at line 14 of file class.ilLPObjSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilLPObjSettings::__construct (   $a_obj_id)

ilLPObjSettings constructor.

Parameters
int$a_obj_id

Definition at line 167 of file class.ilLPObjSettings.php.

168 {
169 global $DIC;
170
171 $ilObjDataCache = $DIC['ilObjDataCache'];
172 $ilDB = $DIC['ilDB'];
173
174 $this->db = $ilDB;
175 $this->obj_id = $a_obj_id;
176
177 if (!$this->__read()) {
178 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
179
180 include_once "Services/Object/classes/class.ilObjectLP.php";
181 $olp = ilObjectLP::getInstance($this->obj_id);
182 $this->obj_mode = $olp->getDefaultMode();
183 }
184 }
static getInstance($a_obj_id)
global $ilDB
$DIC
Definition: xapitoken.php:46

References $DIC, $ilDB, __read(), and ilObjectLP\getInstance().

+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilLPObjSettings::__read ( )

Definition at line 240 of file class.ilLPObjSettings.php.

241 {
242 $res = $this->db->query("SELECT * FROM ut_lp_settings WHERE obj_id = " .
243 $this->db->quote($this->obj_id, 'integer'));
244 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
245 $this->is_stored = true;
246 $this->obj_type = $row->obj_type;
247 $this->obj_mode = $row->u_mode;
248 $this->visits = $row->visits;
249
250 return true;
251 }
252
253 return false;
254 }
foreach($_POST as $key=> $value) $res

References $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by __construct(), insert(), and update().

+ Here is the caller graph for this function:

◆ _delete()

static ilLPObjSettings::_delete (   $a_obj_id)
static

Definition at line 306 of file class.ilLPObjSettings.php.

307 {
308 global $DIC;
309
310 $ilDB = $DIC['ilDB'];
311
312 $query = "DELETE FROM ut_lp_settings WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer');
313 $res = $ilDB->manipulate($query);
314
315 return true;
316 }
$query

References $DIC, $ilDB, $query, and $res.

◆ _deleteByObjId()

static ilLPObjSettings::_deleteByObjId (   $a_obj_id)
static

Definition at line 415 of file class.ilLPObjSettings.php.

416 {
417 global $DIC;
418
419 $ilDB = $DIC['ilDB'];
420
421 // we are only removing settings for now
422 // invalid ut_lp_collections-entries are filtered
423 // ut_lp_marks is deemed private user data
424
425 $ilDB->manipulate("DELETE FROM ut_lp_settings" .
426 " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer"));
427 }

References $DIC, and $ilDB.

◆ _lookupDBMode()

static ilLPObjSettings::_lookupDBMode (   $a_obj_id)
static

Definition at line 357 of file class.ilLPObjSettings.php.

358 {
359 global $DIC;
360
361 $ilDB = $DIC['ilDB'];
362
363 // this does NOT handle default mode!
364
365 $query = "SELECT u_mode FROM ut_lp_settings" .
366 " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer");
367 $set = $ilDB->query($query);
368 $row = $ilDB->fetchAssoc($set);
369 if (is_array($row)) {
370 return $row['u_mode'];
371 }
372 }

References $DIC, $ilDB, and $query.

Referenced by ilObjectLP\getCurrentMode(), and ilObjLTIConsumerGUI\infoScreenForward().

+ Here is the caller graph for this function:

◆ _lookupDBModeForObjects()

static ilLPObjSettings::_lookupDBModeForObjects ( array  $a_obj_ids)
static

Definition at line 337 of file class.ilLPObjSettings.php.

338 {
339 global $DIC;
340
341 $ilDB = $DIC['ilDB'];
342
343 // this does NOT handle default mode!
344
345 $res = array();
346
347 $query = "SELECT obj_id, u_mode FROM ut_lp_settings" .
348 " WHERE " . $ilDB->in("obj_id", $a_obj_ids, "", "integer");
349 $set = $ilDB->query($query);
350 while ($row = $set->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
351 $res[$row->obj_id] = $row->u_mode;
352 }
353
354 return $res;
355 }

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilLPStatus\checkLPModesForObjects(), and ilTimingsUser\getObjectsWithInactiveLP().

+ Here is the caller graph for this function:

◆ _lookupVisits()

static ilLPObjSettings::_lookupVisits (   $a_obj_id)
static

Definition at line 321 of file class.ilLPObjSettings.php.

322 {
323 global $DIC;
324
325 $ilDB = $DIC['ilDB'];
326
327 $query = "SELECT visits FROM ut_lp_settings " .
328 "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer');
329
330 $res = $ilDB->query($query);
331 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
332 return $row->visits;
333 }
335 }

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, and LP_DEFAULT_VISITS.

Referenced by ilLearningProgressBaseGUI\__readItemStatusInfo(), ilLearningProgressBaseGUI\__showObjectDetails(), ilLPStatusVisits\_getStatusInfo(), and ilLPStatusVisits\determinePercentage().

+ Here is the caller graph for this function:

◆ _mode2InfoText()

static ilLPObjSettings::_mode2InfoText (   $a_mode)
static

Definition at line 386 of file class.ilLPObjSettings.php.

387 {
388 global $DIC;
389
390 $lng = $DIC['lng'];
391
392 if (array_key_exists($a_mode, self::$map) &&
393 is_array(self::$map[$a_mode])) {
394 $info = $lng->txt(self::$map[$a_mode][2]);
395
396 if ($a_mode == self::LP_MODE_TLT) {
397 // dynamic content
398 include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
399 $info = sprintf($info, ilObjUserTracking::_getValidTimeSpan());
400 }
401
402 return $info;
403 }
404 }
$lng

References $DIC, $lng, and ilObjUserTracking\_getValidTimeSpan().

Referenced by ilObjectLP\getModeInfoText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _mode2Text()

static ilLPObjSettings::_mode2Text (   $a_mode)
static

Definition at line 374 of file class.ilLPObjSettings.php.

375 {
376 global $DIC;
377
378 $lng = $DIC['lng'];
379
380 if (array_key_exists($a_mode, self::$map) &&
381 is_array(self::$map[$a_mode])) {
382 return $lng->txt(self::$map[$a_mode][1]);
383 }
384 }

References $DIC, and $lng.

Referenced by ilLPProgressTableGUI\fillRowCSV(), ilLPProgressTableGUI\fillRowExcel(), ilObjectLP\getModeText(), ilObjUserTrackingGUI\initLPDefaultsForm(), and ilConditionHandlerGUI\translateOperator().

+ Here is the caller graph for this function:

◆ cloneSettings()

ilLPObjSettings::cloneSettings (   $a_new_obj_id)

Clone settings.

@access public

Parameters
intnew obj id

Definition at line 193 of file class.ilLPObjSettings.php.

194 {
195 global $DIC;
196
197 $ilDB = $DIC['ilDB'];
198
199 $query = "INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) " .
200 "VALUES( " .
201 $this->db->quote($a_new_obj_id, 'integer') . ", " .
202 $this->db->quote($this->getObjType(), 'text') . ", " .
203 $this->db->quote($this->getMode(), 'integer') . ", " .
204 $this->db->quote($this->getVisits(), 'integer') .
205 ")";
206 $res = $ilDB->manipulate($query);
207 return true;
208 }

References $DIC, $ilDB, $query, $res, getMode(), getObjType(), and getVisits().

+ Here is the call graph for this function:

◆ doLPRefresh()

ilLPObjSettings::doLPRefresh ( )
protected

Definition at line 299 of file class.ilLPObjSettings.php.

300 {
301 // refresh learning progress
302 include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
304 }
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.

References ilLPStatusWrapper\_refreshStatus(), and getObjId().

Referenced by insert(), and update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getClassMap()

static ilLPObjSettings::getClassMap ( )
static

Definition at line 406 of file class.ilLPObjSettings.php.

407 {
408 $res = array();
409 foreach (self::$map as $mode => $item) {
410 $res[$mode] = $item[0];
411 }
412 return $res;
413 }

References $res.

Referenced by ilLPStatusFactory\_getClassById(), and ilLPStatusFactory\_getInstance().

+ Here is the caller graph for this function:

◆ getMode()

ilLPObjSettings::getMode ( )

Definition at line 225 of file class.ilLPObjSettings.php.

226 {
227 return $this->obj_mode;
228 }

References $obj_mode.

Referenced by cloneSettings(), insert(), and update().

+ Here is the caller graph for this function:

◆ getObjId()

ilLPObjSettings::getObjId ( )

Definition at line 230 of file class.ilLPObjSettings.php.

231 {
232 return (int) $this->obj_id;
233 }

References $obj_id.

Referenced by doLPRefresh(), insert(), and update().

+ Here is the caller graph for this function:

◆ getObjType()

ilLPObjSettings::getObjType ( )

Definition at line 235 of file class.ilLPObjSettings.php.

236 {
237 return $this->obj_type;
238 }

References $obj_type.

Referenced by cloneSettings(), and insert().

+ Here is the caller graph for this function:

◆ getVisits()

ilLPObjSettings::getVisits ( )

Definition at line 210 of file class.ilLPObjSettings.php.

211 {
212 return (int) $this->visits ? $this->visits : self::LP_DEFAULT_VISITS;
213 }

References LP_DEFAULT_VISITS.

Referenced by cloneSettings(), insert(), and update().

+ Here is the caller graph for this function:

◆ insert()

ilLPObjSettings::insert ( )

Definition at line 278 of file class.ilLPObjSettings.php.

279 {
280 global $DIC;
281
282 $ilDB = $DIC['ilDB'];
283
284 $query = "INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) " .
285 "VALUES(" .
286 $ilDB->quote($this->getObjId(), 'integer') . ", " .
287 $ilDB->quote($this->getObjType(), 'text') . ", " .
288 $ilDB->quote($this->getMode(), 'integer') . ", " .
289 $ilDB->quote($this->getVisits(), 'integer') . // #12482
290 ")";
291 $res = $ilDB->manipulate($query);
292 $this->__read();
293
294 $this->doLPRefresh();
295
296 return true;
297 }

References $DIC, $ilDB, $query, $res, __read(), doLPRefresh(), getMode(), getObjId(), getObjType(), and getVisits().

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMode()

ilLPObjSettings::setMode (   $a_mode)

Definition at line 220 of file class.ilLPObjSettings.php.

221 {
222 $this->obj_mode = $a_mode;
223 }

◆ setVisits()

ilLPObjSettings::setVisits (   $a_visits)

Definition at line 215 of file class.ilLPObjSettings.php.

216 {
217 $this->visits = $a_visits;
218 }

◆ update()

ilLPObjSettings::update (   $a_refresh_lp = true)

Definition at line 256 of file class.ilLPObjSettings.php.

257 {
258 global $DIC;
259
260 $ilDB = $DIC['ilDB'];
261
262 if (!$this->is_stored) {
263 return $this->insert();
264 }
265 $query = "UPDATE ut_lp_settings SET u_mode = " . $ilDB->quote($this->getMode(), 'integer') . ", " .
266 "visits = " . $ilDB->quote($this->getVisits(), 'integer') . " " .
267 "WHERE obj_id = " . $ilDB->quote($this->getObjId(), 'integer');
268 $res = $ilDB->manipulate($query);
269 $this->__read();
270
271 if ($a_refresh_lp) {
272 $this->doLPRefresh();
273 }
274
275 return true;
276 }

References $DIC, $ilDB, $query, $res, __read(), doLPRefresh(), getMode(), getObjId(), getVisits(), and insert().

+ Here is the call graph for this function:

Field Documentation

◆ $db

ilLPObjSettings::$db = null

Definition at line 16 of file class.ilLPObjSettings.php.

◆ $is_stored

ilLPObjSettings::$is_stored = false

Definition at line 23 of file class.ilLPObjSettings.php.

◆ $map

ilLPObjSettings::$map
staticprotected

Definition at line 62 of file class.ilLPObjSettings.php.

◆ $obj_id

ilLPObjSettings::$obj_id = null

Definition at line 18 of file class.ilLPObjSettings.php.

Referenced by getObjId().

◆ $obj_mode

ilLPObjSettings::$obj_mode = null

Definition at line 20 of file class.ilLPObjSettings.php.

Referenced by getMode().

◆ $obj_type

ilLPObjSettings::$obj_type = null

Definition at line 19 of file class.ilLPObjSettings.php.

Referenced by getObjType().

◆ $visits

ilLPObjSettings::$visits = null

Definition at line 21 of file class.ilLPObjSettings.php.

◆ LP_DEFAULT_VISITS

const ilLPObjSettings::LP_DEFAULT_VISITS = 30

Definition at line 56 of file class.ilLPObjSettings.php.

Referenced by _lookupVisits(), and getVisits().

◆ LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED

◆ LP_MODE_CMIX_COMPL_WITH_FAILED

◆ LP_MODE_CMIX_COMPLETED

◆ LP_MODE_CMIX_COMPLETED_OR_PASSED

◆ LP_MODE_CMIX_PASSED

◆ LP_MODE_CMIX_PASSED_WITH_FAILED

◆ LP_MODE_COLLECTION

◆ LP_MODE_COLLECTION_MANUAL

◆ LP_MODE_COLLECTION_MOBS

◆ LP_MODE_COLLECTION_TLT

◆ LP_MODE_CONTENT_VISITED

const ilLPObjSettings::LP_MODE_CONTENT_VISITED = 20

◆ LP_MODE_COURSE_REFERENCE

const ilLPObjSettings::LP_MODE_COURSE_REFERENCE = 32

Definition at line 60 of file class.ilLPObjSettings.php.

Referenced by ilCourseReferenceLP\getDefaultModes().

◆ LP_MODE_DEACTIVATED

const ilLPObjSettings::LP_MODE_DEACTIVATED = 0

Definition at line 25 of file class.ilLPObjSettings.php.

Referenced by ilLPStatus\checkLPModesForObjects(), ilCmiXapiLaunchGUI\CMI5preLaunch(), ilCertificateSettingsCourseFormRepository\createForm(), ilObjSessionGUI\createRecurringSessions(), ilCertificateCourseLearningProgressEvaluation\evaluate(), ilLPCollectionSettingsTableGUI\fillRow(), ilObjectLP\getCurrentMode(), ilCmiXapiLP\getDefaultMode(), ilFileLP\getDefaultMode(), ilFolderLP\getDefaultMode(), ilGroupLP\getDefaultMode(), ilLSLP\getDefaultMode(), ilLTIConsumerLP\getDefaultMode(), ilMediaCastLP\getDefaultMode(), ilScormLP\getDefaultMode(), ilSurveyLP\getDefaultMode(), ilCmiXapiLP\getDefaultModes(), ilCourseLP\getDefaultModes(), ilCourseReferenceLP\getDefaultModes(), ilExerciseLP\getDefaultModes(), ilFileLP\getDefaultModes(), ilFolderLP\getDefaultModes(), ilGroupLP\getDefaultModes(), ilHTMLLearningModuleLP\getDefaultModes(), ilLearningModuleLP\getDefaultModes(), ilLSLP\getDefaultModes(), ilLTIConsumerLP\getDefaultModes(), ilMediaCastLP\getDefaultModes(), ilScormLP\getDefaultModes(), ilSessionLP\getDefaultModes(), ilStudyProgrammeLP\getDefaultModes(), ilSurveyLP\getDefaultModes(), ilTestLP\getDefaultModes(), ilCourseLPBadgeGUI\getInvalidLPModes(), ilCertificateSettingsCourseFormRepository\getInvalidLPModes(), ilObjCmiXapi\getLMSMoveOn(), ilTimingsUser\getObjectsWithInactiveLP(), ilCmiXapiLP\getValidModes(), ilContentPageLP\getValidModes(), ilCourseLP\getValidModes(), ilExerciseLP\getValidModes(), ilFileLP\getValidModes(), ilFolderLP\getValidModes(), ilGroupLP\getValidModes(), ilHTMLLearningModuleLP\getValidModes(), ilIndividualAssessmentLP\getValidModes(), ilLearningModuleLP\getValidModes(), ilLSLP\getValidModes(), ilLTIConsumerLP\getValidModes(), ilMediaCastLP\getValidModes(), ilScormLP\getValidModes(), ilSessionLP\getValidModes(), ilStudyProgrammeLP\getValidModes(), ilSurveyLP\getValidModes(), ilTestLP\getValidModes(), ilLTIAppEventListener\handleOutcomeWithoutLP(), ilObjUserTrackingGUI\initLPDefaultsForm(), ilCmiXapiLP\initModeOptions(), ilCmiXapiContentUploadImporter\initObjectFromCmi5Xml(), ilObjectLP\isActive(), ilXapiStatementEvaluation\isLpModeInterestedInResultStatus(), ilObjUserTrackingGUI\saveLPDefaultsObject(), and ilObjSessionGUI\saveObject().

◆ LP_MODE_EVENT

const ilLPObjSettings::LP_MODE_EVENT = 10

◆ LP_MODE_EXERCISE_RETURNED

const ilLPObjSettings::LP_MODE_EXERCISE_RETURNED = 9

◆ LP_MODE_INDIVIDUAL_ASSESSMENT

const ilLPObjSettings::LP_MODE_INDIVIDUAL_ASSESSMENT = 23

◆ LP_MODE_LTI_OUTCOME

◆ LP_MODE_MANUAL

◆ LP_MODE_MANUAL_BY_TUTOR

◆ LP_MODE_OBJECTIVES

◆ LP_MODE_PLUGIN

const ilLPObjSettings::LP_MODE_PLUGIN = 14

◆ LP_MODE_QUESTIONS

const ilLPObjSettings::LP_MODE_QUESTIONS = 17

◆ LP_MODE_SCORM

◆ LP_MODE_SCORM_PACKAGE

const ilLPObjSettings::LP_MODE_SCORM_PACKAGE = 12

Definition at line 37 of file class.ilLPObjSettings.php.

Referenced by ilScormLP\getDefaultModes(), and ilScormLP\getValidModes().

◆ LP_MODE_STUDY_PROGRAMME

const ilLPObjSettings::LP_MODE_STUDY_PROGRAMME = 22

◆ LP_MODE_SURVEY_FINISHED

const ilLPObjSettings::LP_MODE_SURVEY_FINISHED = 18

◆ LP_MODE_TEST_FINISHED

const ilLPObjSettings::LP_MODE_TEST_FINISHED = 7

◆ LP_MODE_TEST_PASSED

◆ LP_MODE_TLT

◆ LP_MODE_UNDEFINED

◆ LP_MODE_VISITED_PAGES

const ilLPObjSettings::LP_MODE_VISITED_PAGES = 19

◆ LP_MODE_VISITS


The documentation for this class was generated from the following file: