ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilScormLP Class Reference
+ Inheritance diagram for ilScormLP:
+ Collaboration diagram for ilScormLP:

Public Member Functions

 getDefaultMode ()
 
 getValidModes ()
 
 getCurrentMode ()
 
 getMailTemplateId ()
 
- Public Member Functions inherited from ilObjectLP
 resetCaches ()
 
 isAnonymized ()
 
 getDefaultMode ()
 
 getValidModes ()
 
 getCurrentMode ()
 
 isActive ()
 
 getModeText ($a_mode)
 
 getModeInfoText ($a_mode)
 
 getSettingsInfo ()
 
 getCollectionInstance ()
 
 getMembers ($a_search=true)
 
 resetLPDataForCompleteObject ($a_recursive=true)
 
 resetLPDataForUserIds (array $a_user_ids, $a_recursive=true)
 
 handleToTrash ()
 
 handleDelete ()
 
 getMailTemplateId ()
 

Static Public Member Functions

static getDefaultModes ($a_lp_active)
 
- Static Public Member Functions inherited from ilObjectLP
static getInstance ($a_obj_id)
 
static getTypeClass ($a_type)
 
static isSupportedObjectType ($a_type)
 
static handleMove ($a_source_ref_id)
 
static getLPMemberships ($a_usr_id, array $a_obj_ids, $a_parent_ref_id=null, $a_mapped_ref_ids=false)
 Get all objects where given user is member (from LP POV) More...
 
static supportsSpentSeconds ($a_obj_type)
 
static supportsMark ($a_obj_type)
 
static supportsMatrixView ($a_obj_type)
 
static getDefaultModes ($a_lp_active)
 Get available type-specific default modes (no administration needed) More...
 
static saveTypeDefaults (array $a_data)
 
static getTypeDefault ($a_type)
 Get current type default. More...
 

Protected Member Functions

 checkSCORMPreconditions ()
 
- Protected Member Functions inherited from ilObjectLP
 __construct ($a_obj_id)
 
 resetCustomLPDataForUserIds (array $a_user_ids, $a_recursive=true)
 
 gatherLPUsers ()
 
 updateParentCollections ()
 

Static Protected Member Functions

static isLPMember (array &$a_res, $a_usr_id, $a_obj_ids)
 
- Static Protected Member Functions inherited from ilObjectLP
static isLPMember (array &$a_res, $a_usr_id, $a_obj_ids)
 Find (lp-relevant) members for given object ids. More...
 
static findMembershipsByPath (array &$a_res, $a_usr_id, $a_parent_ref_id, array $a_obj_ids, $a_mapped_ref_ids=false)
 Find (lp-relevant) memberships by path. More...
 
static getTypeDefaultFromDB ($a_type)
 

Protected Attributes

 $precondition_cache = null
 
- Protected Attributes inherited from ilObjectLP
 $tree
 
 $db
 
 $obj_id
 
 $collection_instance
 
 $mode
 

Additional Inherited Members

- Static Protected Attributes inherited from ilObjectLP
static $type_defaults
 

Detailed Description

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

Member Function Documentation

◆ checkSCORMPreconditions()

ilScormLP::checkSCORMPreconditions ( )
protected
Returns
bool
Exceptions
ilDatabaseException

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

References $precondition_cache, and ilConditionHandler\getNumberOfConditionsOfTrigger().

Referenced by getCurrentMode(), and getValidModes().

82  {
83  if (!is_null($this->precondition_cache)) {
85  }
86 
87  $this->precondition_cache =
88  ilConditionHandler::getNumberOfConditionsOfTrigger('sahs', $this->obj_id) > 0 ?
89  true :
90  false;
92  }
static getNumberOfConditionsOfTrigger($a_trigger_obj_type, $a_trigger_id)
get all conditions of trigger object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentMode()

ilScormLP::getCurrentMode ( )

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

References checkSCORMPreconditions(), and ilLPObjSettings\LP_MODE_SCORM.

70  {
71  if ($this->checkSCORMPreconditions()) {
73  }
74  return parent::getCurrentMode();
75  }
checkSCORMPreconditions()
+ Here is the call graph for this function:

◆ getDefaultMode()

ilScormLP::getDefaultMode ( )

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

References ilLPObjSettings\LP_MODE_DEACTIVATED.

30  {
32  }

◆ getDefaultModes()

static ilScormLP::getDefaultModes (   $a_lp_active)
static

◆ getMailTemplateId()

ilScormLP::getMailTemplateId ( )

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

References ilScormMailTemplateLPContext\ID.

133  {
134  include_once './Modules/ScormAicc/classes/class.ilScormMailTemplateLPContext.php';
136  }

◆ getValidModes()

ilScormLP::getValidModes ( )

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

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

35  {
36  include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
37  $subtype = ilObjSAHSLearningModule::_lookupSubType($this->obj_id);
38  if ($subtype != "scorm2004") {
39  if ($this->checkSCORMPreconditions()) {
40  return array(ilLPObjSettings::LP_MODE_SCORM);
41  }
42 
43  include_once "Services/Tracking/classes/collection/class.ilLPCollectionOfSCOs.php";
44  $collection = new ilLPCollectionOfSCOs($this->obj_id, ilLPObjSettings::LP_MODE_SCORM);
45  if (sizeof($collection->getPossibleItems())) {
48  }
50  } else {
51  if ($this->checkSCORMPreconditions()) {
52  return array(ilLPObjSettings::LP_MODE_SCORM,
54  }
55 
56  include_once "Services/Tracking/classes/collection/class.ilLPCollectionOfSCOs.php";
57  $collection = new ilLPCollectionOfSCOs($this->obj_id, ilLPObjSettings::LP_MODE_SCORM);
58  if (sizeof($collection->getPossibleItems())) {
62  }
63 
66  }
67  }
static _lookupSubType($a_obj_id)
lookup subtype id (scorm, )
checkSCORMPreconditions()
+ Here is the call graph for this function:

◆ isLPMember()

static ilScormLP::isLPMember ( array &  $a_res,
  $a_usr_id,
  $a_obj_ids 
)
staticprotected

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

References $DIC, $ilDB, and $row.

95  {
96  global $DIC;
97  $ilDB = $DIC['ilDB'];
98 
99  // subtype
100  $types = array();
101  $set = $ilDB->query("SELECT id,c_type" .
102  " FROM sahs_lm" .
103  " WHERE " . $ilDB->in("id", $a_obj_ids, "", "integer"));
104  while ($row = $ilDB->fetchAssoc($set)) {
105  $types[$row["c_type"]][] = $row["id"];
106  }
107 
108  // 2004
109  if (isset($types["scorm2004"])) {
110  $set = $ilDB->query("SELECT obj_id" .
111  " FROM sahs_user" .
112  " WHERE " . $ilDB->in("obj_id", $types["scorm2004"], "", "integer") .
113  " AND user_id = " . $ilDB->quote($a_usr_id, "integer"));
114  while ($row = $ilDB->fetchAssoc($set)) {
115  $a_res[$row["obj_id"]] = true;
116  }
117  }
118 
119  // 1.2
120  if (isset($types["scorm"])) {
121  $set = $ilDB->query("SELECT obj_id" .
122  " FROM scorm_tracking" .
123  " WHERE " . $ilDB->in("obj_id", $types["scorm"], "", "integer") .
124  " AND user_id = " . $ilDB->quote($a_usr_id, "integer") .
125  " AND lvalue = " . $ilDB->quote("cmi.core.lesson_status", "text"));
126  while ($row = $ilDB->fetchAssoc($set)) {
127  $a_res[$row["obj_id"]] = true;
128  }
129  }
130  }
global $DIC
Definition: saml.php:7
$row
global $ilDB

Field Documentation

◆ $precondition_cache

ilScormLP::$precondition_cache = null
protected

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

Referenced by checkSCORMPreconditions().


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