ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLPObjSettings Class Reference
+ Collaboration diagram for ilLPObjSettings:

Public Member Functions

 __construct (int $a_obj_id)
 
 cloneSettings (int $a_new_obj_id)
 Clone settings @access public. More...
 
 getVisits ()
 
 setVisits (int $a_visits)
 
 setMode (int $a_mode)
 
 getMode ()
 
 getObjId ()
 
 getObjType ()
 
 read ()
 
 update (bool $a_refresh_lp=true)
 
 insert ()
 

Static Public Member Functions

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

Data Fields

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_MODE_LTI_OUTCOME = 31
 
const LP_MODE_COURSE_REFERENCE = 32
 
const LP_MODE_CONTRIBUTION_TO_DISCUSSION = 33
 
const LP_DEFAULT_VISITS = 30
 

Protected Member Functions

 doLPRefresh ()
 

Protected Attributes

int $obj_id
 
string $obj_type
 
int $obj_mode
 
int $visits = self::LP_DEFAULT_VISITS
 
bool $is_stored = false
 
ilDBInterface $db
 
ilObjectDataCache $objectDataCache
 

Static Protected Attributes

static array $map
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilLPObjSettings::__construct ( int  $a_obj_id)

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

273 {
274 global $DIC;
275
276 $this->db = $DIC->database();
277 $this->objectDataCache = $DIC['ilObjDataCache'];
278
279 $this->obj_id = $a_obj_id;
280
281 if (!$this->read()) {
282 $this->obj_type = $this->objectDataCache->lookupType($this->obj_id);
283
284 $olp = ilObjectLP::getInstance($this->obj_id);
285 $this->obj_mode = $olp->getDefaultMode();
286 }
287 }
static getInstance(int $obj_id)
global $DIC
Definition: shib_login.php:26

References $DIC, ilObjectLP\getInstance(), ILIAS\Repository\objectDataCache(), and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ _delete()

static ilLPObjSettings::_delete ( int  $a_obj_id)
static

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

401 : bool
402 {
403 global $DIC;
404
405 $ilDB = $DIC['ilDB'];
406 $query = "DELETE FROM ut_lp_settings WHERE obj_id = " . $ilDB->quote(
407 $a_obj_id,
408 'integer'
409 );
410 $res = $ilDB->manipulate($query);
411 return true;
412 }
$res
Definition: ltiservices.php:69

References $DIC, $ilDB, and $res.

◆ _deleteByObjId()

static ilLPObjSettings::_deleteByObjId ( int  $a_obj_id)
static

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

500 : void
501 {
502 global $DIC;
503
504 $ilDB = $DIC['ilDB'];
505 // we are only removing settings for now
506 // invalid ut_lp_collections-entries are filtered
507 // ut_lp_marks is deemed private user data
508
509 $ilDB->manipulate(
510 "DELETE FROM ut_lp_settings" .
511 " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer")
512 );
513 }

References $DIC, and $ilDB.

Referenced by ilObject\delete().

+ Here is the caller graph for this function:

◆ _lookupDBMode()

static ilLPObjSettings::_lookupDBMode ( int  $a_obj_id)
static

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

445 : ?int
446 {
447 global $DIC;
448
449 $ilDB = $DIC['ilDB'];
450 // this does NOT handle default mode!
451 $query = "SELECT u_mode FROM ut_lp_settings" .
452 " WHERE obj_id = " . $ilDB->quote($a_obj_id, "integer");
453 $res = $ilDB->query($query);
454 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
455 return (int) $row->u_mode;
456 }
457 return null;
458 }

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

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

+ Here is the caller graph for this function:

◆ _lookupDBModeForObjects()

static ilLPObjSettings::_lookupDBModeForObjects ( array  $a_obj_ids)
static

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

429 : array
430 {
431 global $DIC;
432
433 $ilDB = $DIC['ilDB'];
434 // this does NOT handle default mode!
435 $res = array();
436 $query = "SELECT obj_id, u_mode FROM ut_lp_settings" .
437 " WHERE " . $ilDB->in("obj_id", $a_obj_ids, "", "integer");
438 $set = $ilDB->query($query);
439 while ($row = $set->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
440 $res[(int) $row->obj_id] = (int) $row->u_mode;
441 }
442 return $res;
443 }

References $DIC, $ilDB, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

Referenced by ilTimingsUser\getObjectsWithInactiveLP().

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

◆ _lookupVisits()

static ilLPObjSettings::_lookupVisits ( int  $a_obj_id)
static

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

414 : int
415 {
416 global $DIC;
417
418 $ilDB = $DIC['ilDB'];
419 $query = "SELECT visits FROM ut_lp_settings " .
420 "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer');
421
422 $res = $ilDB->query($query);
423 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
424 return $row->visits;
425 }
427 }

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

Referenced by ilLPStatusVisits\_getStatusInfo().

+ Here is the caller graph for this function:

◆ _mode2InfoText()

static ilLPObjSettings::_mode2InfoText ( int  $a_mode)
static

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

472 : string
473 {
474 global $DIC;
475
476 $lng = $DIC->language();
477 if (array_key_exists($a_mode, self::$map) &&
478 is_array(self::$map[$a_mode])) {
479 $info = $lng->txt(self::$map[$a_mode][2]);
480 if ($a_mode == self::LP_MODE_TLT) {
481 // dynamic content
483 }
484 return $info;
485 }
486 return '';
487 }
$info
Definition: entry_point.php:21
global $lng
Definition: privfeed.php:31

References $DIC, $info, $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 ( int  $a_mode)
static

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

460 : string
461 {
462 global $DIC;
463
464 $lng = $DIC->language();
465 if (array_key_exists($a_mode, self::$map) &&
466 is_array(self::$map[$a_mode])) {
467 return $lng->txt(self::$map[$a_mode][1]);
468 }
469 return '';
470 }

References $DIC, and $lng.

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

+ Here is the caller graph for this function:

◆ cloneSettings()

ilLPObjSettings::cloneSettings ( int  $a_new_obj_id)

Clone settings @access public.

Parameters
intnew obj id

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

294 : bool
295 {
296 global $DIC;
297
298 $ilDB = $DIC['ilDB'];
299
300 $query = "INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) " .
301 "VALUES( " .
302 $this->db->quote($a_new_obj_id, 'integer') . ", " .
303 $this->db->quote($this->getObjType(), 'text') . ", " .
304 $this->db->quote($this->getMode(), 'integer') . ", " .
305 $this->db->quote($this->getVisits(), 'integer') .
306 ")";
307 $res = $this->db->manipulate($query);
308 return true;
309 }

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

+ Here is the call graph for this function:

◆ doLPRefresh()

ilLPObjSettings::doLPRefresh ( )
protected

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

395 : void
396 {
397 // refresh learning progress
399 }
static _refreshStatus(int $a_obj_id, ?array $a_users=null)

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 489 of file class.ilLPObjSettings.php.

489 : array
490 {
491 $res = array();
492 foreach (self::$map as $mode => $item) {
493 if ($item) {
494 $res[$mode] = $item[0];
495 }
496 }
497 return $res;
498 }

References $res.

◆ getMode()

ilLPObjSettings::getMode ( )

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

326 : int
327 {
328 return $this->obj_mode;
329 }

References $obj_mode.

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

+ Here is the caller graph for this function:

◆ getObjId()

ilLPObjSettings::getObjId ( )

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

331 : int
332 {
333 return $this->obj_id;
334 }

References $obj_id.

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

+ Here is the caller graph for this function:

◆ getObjType()

ilLPObjSettings::getObjType ( )

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

336 : string
337 {
338 return $this->obj_type;
339 }

References $obj_type.

Referenced by cloneSettings(), and insert().

+ Here is the caller graph for this function:

◆ getVisits()

ilLPObjSettings::getVisits ( )

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

311 : int
312 {
313 return $this->visits;
314 }

References $visits.

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

+ Here is the caller graph for this function:

◆ insert()

ilLPObjSettings::insert ( )

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

380 : bool
381 {
382 $query = "INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) " .
383 "VALUES(" .
384 $this->db->quote($this->getObjId(), 'integer') . ", " .
385 $this->db->quote($this->getObjType(), 'text') . ", " .
386 $this->db->quote($this->getMode(), 'integer') . ", " .
387 $this->db->quote($this->getVisits(), 'integer') . // #12482
388 ")";
389 $res = $this->db->manipulate($query);
390 $this->read();
391 $this->doLPRefresh();
392 return true;
393 }

References $res, doLPRefresh(), getMode(), getObjId(), getObjType(), getVisits(), and read().

Referenced by update().

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

◆ read()

ilLPObjSettings::read ( )

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

341 : bool
342 {
343 $res = $this->db->query(
344 "SELECT * FROM ut_lp_settings WHERE obj_id = " .
345 $this->db->quote($this->obj_id, 'integer')
346 );
347 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
348 $this->is_stored = true;
349 $this->obj_type = (string) $row->obj_type;
350 $this->obj_mode = (int) $row->u_mode;
351 $this->visits = (int) $row->visits;
352 return true;
353 }
354 return false;
355 }

References $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

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

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

◆ setMode()

ilLPObjSettings::setMode ( int  $a_mode)

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

321 : void
322 {
323 $this->obj_mode = $a_mode;
324 }

◆ setVisits()

ilLPObjSettings::setVisits ( int  $a_visits)

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

316 : void
317 {
318 $this->visits = $a_visits;
319 }

◆ update()

ilLPObjSettings::update ( bool  $a_refresh_lp = true)

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

357 : bool
358 {
359 if (!$this->is_stored) {
360 return $this->insert();
361 }
362 $query = "UPDATE ut_lp_settings SET u_mode = " . $this->db->quote(
363 $this->getMode(),
364 'integer'
365 ) . ", " .
366 "visits = " . $this->db->quote(
367 $this->getVisits(),
368 'integer'
369 ) . " " .
370 "WHERE obj_id = " . $this->db->quote($this->getObjId(), 'integer');
371 $res = $this->db->manipulate($query);
372 $this->read();
373
374 if ($a_refresh_lp) {
375 $this->doLPRefresh();
376 }
377 return true;
378 }

References $res, doLPRefresh(), getMode(), getObjId(), getVisits(), insert(), and read().

+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilLPObjSettings::$db
protected

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

◆ $is_stored

bool ilLPObjSettings::$is_stored = false
protected

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

◆ $map

array ilLPObjSettings::$map
staticprotected

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

◆ $obj_id

int ilLPObjSettings::$obj_id
protected

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

Referenced by getObjId().

◆ $obj_mode

int ilLPObjSettings::$obj_mode
protected

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

Referenced by getMode().

◆ $obj_type

string ilLPObjSettings::$obj_type
protected

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

Referenced by getObjType().

◆ $objectDataCache

ilObjectDataCache ilLPObjSettings::$objectDataCache
protected

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

◆ $visits

int ilLPObjSettings::$visits = self::LP_DEFAULT_VISITS
protected

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

Referenced by getVisits().

◆ LP_DEFAULT_VISITS

const ilLPObjSettings::LP_DEFAULT_VISITS = 30

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

Referenced by _lookupVisits().

◆ 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

◆ LP_MODE_CONTRIBUTION_TO_DISCUSSION

const ilLPObjSettings::LP_MODE_CONTRIBUTION_TO_DISCUSSION = 33

◆ LP_MODE_COURSE_REFERENCE

const ilLPObjSettings::LP_MODE_COURSE_REFERENCE = 32

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

Referenced by ilCourseReferenceLP\getValidModes().

◆ LP_MODE_DEACTIVATED

const ilLPObjSettings::LP_MODE_DEACTIVATED = 0

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

Referenced by ilCmiXapiLaunchGUI\CMI5preLaunch(), ILIAS\Tracking\View\DataRetrieval\DataRetrieval\collectLPDataWithIlTryQuery(), ILIAS\Course\Certificate\CertificateSettingsCourseFormRepository\createForm(), ilObjSessionGUI\createRecurringSessions(), ilCertificateTemplateDatabaseRepository\fetchActiveCertificateTemplatesForCoursesWithDisabledLearningProgress(), ilLPCollectionSettingsTableGUI\fillRow(), ilObjectLP\getCurrentMode(), ilCmiXapiLP\getDefaultMode(), ilFileLP\getDefaultMode(), ilFolderLP\getDefaultMode(), ilForumLP\getDefaultMode(), ilGroupLP\getDefaultMode(), ilLearningModuleLP\getDefaultMode(), ilLSLP\getDefaultMode(), ilLTIConsumerLP\getDefaultMode(), ilMediaCastLP\getDefaultMode(), ilScormLP\getDefaultMode(), ilSurveyLP\getDefaultMode(), ilCourseLP\getDefaultModes(), ilExerciseLP\getDefaultModes(), ilFileLP\getDefaultModes(), ilGroupLP\getDefaultModes(), ilLSLP\getDefaultModes(), ilLTIConsumerLP\getDefaultModes(), ilMediaCastLP\getDefaultModes(), ilScormLP\getDefaultModes(), ilSessionLP\getDefaultModes(), ilTestLP\getDefaultModes(), ilContentPageLP\getDefaultModes(), ilCourseReferenceLP\getDefaultModes(), ilFolderLP\getDefaultModes(), ilForumLP\getDefaultModes(), ilHTMLLearningModuleLP\getDefaultModes(), ilIndividualAssessmentLP\getDefaultModes(), ilLearningModuleLP\getDefaultModes(), ilStudyProgrammeLP\getDefaultModes(), ilSurveyLP\getDefaultModes(), ilTestLPTest\getDefaultModesDataProvider(), ilCourseLPBadgeGUI\getInvalidLPModes(), ILIAS\Course\Certificate\CertificateSettingsCourseFormRepository\getInvalidLPModes(), ilObjCmiXapi\getLMSMoveOn(), ilTimingsUser\getObjectsWithInactiveLP(), ilCmiXapiLP\getValidModes(), ilContentPageLP\getValidModes(), ilCourseLP\getValidModes(), ilCourseReferenceLP\getValidModes(), ilExerciseLP\getValidModes(), ilFileLP\getValidModes(), ilFolderLP\getValidModes(), ilForumLP\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(), ilObjSessionGUI\saveObject(), ilLSLPTest\testGetDefaultMode(), ilLSLPTest\testGetDefaultModes(), ilLSLPTest\testGetDefaultModesLPDeactive(), ilLSLPTest\testGetValidModes(), and ilTestLPTest\testGetValidModes().

◆ 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

const ilLPObjSettings::LP_MODE_LTI_OUTCOME = 31

◆ 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

◆ 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

◆ 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: