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

Public Member Functions

 getDefaultMode ()
 
 getValidModes ()
 
 getCurrentMode ()
 AK, 14Sep2018: This looks strange, the mode is auto-activated if this object is used as a precondition trigger? This is not implemented for any other object type. More...
 
 getMailTemplateId ()
 
- Public Member Functions inherited from ilObjectLP
 resetCaches ()
 
 isAnonymized ()
 
 getDefaultMode ()
 
 getValidModes ()
 
 getCurrentMode ()
 
 isActive ()
 
 getModeText (int $mode)
 
 getModeInfoText (int $mode)
 
 getSettingsInfo ()
 
 getCollectionInstance ()
 
 getMembers (bool $search=true)
 
 resetLPDataForCompleteObject (bool $recursive=true)
 
 resetLPDataForUserIds (array $user_ids, bool $recursive=true)
 
 handleToTrash ()
 
 handleDelete ()
 
 getMailTemplateId ()
 
 hasIndividualModeOptions ()
 
 initInvidualModeOptions ()
 Post vars for input groups is taken from array keys. More...
 
 shouldFetchIndividualModeFromFormSubmission ()
 
 fetchIndividualModeFromFormSubmission (string $selected_group, array $group_data)
 
 appendModeConfiguration (int $mode)
 
 saveModeConfiguration (string $selected_group, array $group_data, bool &$modeChanged)
 

Static Public Member Functions

static getDefaultModes (bool $a_lp_active)
 
- Static Public Member Functions inherited from ilObjectLP
static getInstance (int $obj_id)
 
static getTypeClass (string $type)
 
static getSupportedObjectTypes ()
 
static isSupportedObjectType (string $type)
 
static handleMove (int $source_ref_id)
 
static getLPMemberships (int $usr_id, array $obj_ids, ?int $parent_ref_id=null, bool $mapped_ref_ids=false)
 Get all objects where given user is member (from LP POV) More...
 
static supportsSpentSeconds (string $obj_type)
 
static supportsMark (string $obj_type)
 
static supportsMatrixView (string $obj_type)
 
static getDefaultModes (bool $lp_active)
 Get available type-specific default modes (no administration needed) More...
 
static saveTypeDefaults (array $data)
 
static getTypeDefault (string $type)
 

Protected Member Functions

 checkSCORMPreconditions ()
 
- Protected Member Functions inherited from ilObjectLP
 __construct (int $obj_id)
 
 resetCustomLPDataForUserIds (array $user_ids, bool $recursive=true)
 
 gatherLPUsers ()
 
 updateParentCollections ()
 

Static Protected Member Functions

static isLPMember (array &$a_res, int $a_usr_id, array $a_obj_ids)
 Find (lp-relevant) members for given object ids. More...
 
- Static Protected Member Functions inherited from ilObjectLP
static isLPMember (array &$res, int $usr_id, array $obj_ids)
 Find (lp-relevant) members for given object ids. More...
 
static findMembershipsByPath (array &$res, int $usr_id, int $parent_ref_id, array $obj_ids, bool $mapped_ref_ids=false)
 Find (lp-relevant) memberships by path. More...
 
static getTypeDefaultFromDB (string $type)
 

Protected Attributes

bool $precondition_cache = null
 
- Protected Attributes inherited from ilObjectLP
ilTree $tree
 
ilDBInterface $db
 
ilObjectDefinition $objectDefinition
 
int $obj_id
 
ilLPCollection $collection_instance = null
 
int $mode = null
 

Additional Inherited Members

- Static Protected Attributes inherited from ilObjectLP
static array $type_defaults = null
 

Detailed Description

Definition at line 27 of file class.ilScormLP.php.

Member Function Documentation

◆ checkSCORMPreconditions()

ilScormLP::checkSCORMPreconditions ( )
protected

Definition at line 100 of file class.ilScormLP.php.

100 : bool
101 {
102 if (is_bool($this->precondition_cache)) {
104 }
105
106 $this->precondition_cache = ilConditionHandler::getNumberOfConditionsOfTrigger(
107 'sahs',
108 $this->obj_id
109 ) > 0;
110
112 }
static getNumberOfConditionsOfTrigger(string $a_trigger_obj_type, int $a_trigger_id)
get all conditions of trigger object
bool $precondition_cache

References $precondition_cache, and ilConditionHandler\getNumberOfConditionsOfTrigger().

Referenced by getValidModes().

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

◆ getCurrentMode()

ilScormLP::getCurrentMode ( )

AK, 14Sep2018: This looks strange, the mode is auto-activated if this object is used as a precondition trigger? This is not implemented for any other object type.

Reimplemented from ilObjectLP.

Definition at line 92 of file class.ilScormLP.php.

92 : int
93 {
94 // if ($this->checkSCORMPreconditions()) {
95 // return ilLPObjSettings::LP_MODE_SCORM;
96 // }
97 return parent::getCurrentMode();
98 }

◆ getDefaultMode()

ilScormLP::getDefaultMode ( )

Reimplemented from ilObjectLP.

Definition at line 42 of file class.ilScormLP.php.

42 : int
43 {
45 }

References ilLPObjSettings\LP_MODE_DEACTIVATED.

◆ getDefaultModes()

static ilScormLP::getDefaultModes ( bool  $a_lp_active)
static
Returns
int[]

Reimplemented from ilObjectLP.

Definition at line 34 of file class.ilScormLP.php.

34 : array
35 {
36 return array(
39 );
40 }

References ilLPObjSettings\LP_MODE_DEACTIVATED, and ilLPObjSettings\LP_MODE_SCORM_PACKAGE.

◆ getMailTemplateId()

ilScormLP::getMailTemplateId ( )

Reimplemented from ilObjectLP.

Definition at line 154 of file class.ilScormLP.php.

References ilScormMailTemplateLPContext\ID.

◆ getValidModes()

ilScormLP::getValidModes ( )
Returns
int[]

Reimplemented from ilObjectLP.

Definition at line 47 of file class.ilScormLP.php.

47 : array
48 {
49 $subtype = ilObjSAHSLearningModule::_lookupSubType($this->obj_id);
50 if ($subtype !== 'scorm2004') {
51 if ($this->checkSCORMPreconditions()) {
53 }
54
55 $collection = new ilLPCollectionOfSCOs($this->obj_id, ilLPObjSettings::LP_MODE_SCORM);
56 if (count($collection->getPossibleItems()) > 0) {
57 return [
60 ];
61 }
62
64 }
65
66 if ($this->checkSCORMPreconditions()) {
67 return [
70 ];
71 }
72
73 $collection = new ilLPCollectionOfSCOs($this->obj_id, ilLPObjSettings::LP_MODE_SCORM);
74 if (count($collection->getPossibleItems()) > 0) {
75 return [
79 ];
80 }
81
82 return [
85 ];
86 }
static _lookupSubType(int $a_obj_id)
lookup subtype id (scorm, )

References ilObjSAHSLearningModule\_lookupSubType(), checkSCORMPreconditions(), ilLPObjSettings\LP_MODE_DEACTIVATED, ilLPObjSettings\LP_MODE_SCORM, and ilLPObjSettings\LP_MODE_SCORM_PACKAGE.

+ Here is the call graph for this function:

◆ isLPMember()

static ilScormLP::isLPMember ( array &  $res,
int  $usr_id,
array  $obj_ids 
)
staticprotected

Find (lp-relevant) members for given object ids.

Reimplemented from ilObjectLP.

Definition at line 114 of file class.ilScormLP.php.

114 : bool
115 {
116 global $DIC;
117
118 $ilDB = $DIC->database();
119
120 // subtype
121 $types = array();
122 $set = $ilDB->query("SELECT id,c_type" .
123 " FROM sahs_lm" .
124 " WHERE " . $ilDB->in("id", $a_obj_ids, false, "integer"));
125 while ($row = $ilDB->fetchAssoc($set)) {
126 $types[$row["c_type"]][] = $row["id"];
127 }
128
129 // 2004
130 if (isset($types["scorm2004"])) {
131 $set = $ilDB->query("SELECT obj_id" .
132 " FROM sahs_user" .
133 " WHERE " . $ilDB->in("obj_id", $types["scorm2004"], false, "integer") .
134 " AND user_id = " . $ilDB->quote($a_usr_id, "integer"));
135 while ($row = $ilDB->fetchAssoc($set)) {
136 return true;
137 }
138 }
139
140 // 1.2
141 if (isset($types["scorm"])) {
142 $set = $ilDB->query("SELECT obj_id" .
143 " FROM scorm_tracking" .
144 " WHERE " . $ilDB->in("obj_id", $types["scorm"], false, "integer") .
145 " AND user_id = " . $ilDB->quote($a_usr_id, "integer") .
146 " AND lvalue = " . $ilDB->quote("cmi.core.lesson_status", "text"));
147 while ($row = $ilDB->fetchAssoc($set)) {
148 return true;
149 }
150 }
151 return false;
152 }
global $DIC
Definition: shib_login.php:26

References $DIC, and $ilDB.

Field Documentation

◆ $precondition_cache

bool ilScormLP::$precondition_cache = null
protected

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

Referenced by checkSCORMPreconditions().


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