ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 ()
 

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, array $a_obj_ids)
 
- Static Protected Member Functions inherited from ilObjectLP
static getTypeClass ($a_type)
 
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectLP
static getInstance ($a_obj_id)
 
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)
 
- Protected Attributes inherited from ilObjectLP
 $obj_id
 
 $collection_instance
 
 $mode
 

Detailed Description

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

Member Function Documentation

◆ checkSCORMPreconditions()

ilScormLP::checkSCORMPreconditions ( )
protected

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

References ilConditionHandler\_getConditionsOfTrigger().

Referenced by getCurrentMode(), and getValidModes().

73  {
74  include_once('./Services/AccessControl/classes/class.ilConditionHandler.php');
75  if(count(ilConditionHandler::_getConditionsOfTrigger('sahs', $this->obj_id)))
76  {
77  return true;
78  }
79  return false;
80  }
_getConditionsOfTrigger($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 63 of file class.ilScormLP.php.

References checkSCORMPreconditions(), and ilLPObjSettings\LP_MODE_SCORM.

64  {
65  if($this->checkSCORMPreconditions())
66  {
68  }
69  return parent::getCurrentMode();
70  }
checkSCORMPreconditions()
+ Here is the call graph for this function:

◆ getDefaultMode()

ilScormLP::getDefaultMode ( )

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

References ilLPObjSettings\LP_MODE_DEACTIVATED.

17  {
19  }

◆ getMailTemplateId()

ilScormLP::getMailTemplateId ( )

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

References ilScormMailTemplateLPContext\ID.

125  {
126  include_once './Modules/ScormAicc/classes/class.ilScormMailTemplateLPContext.php';
128  }

◆ getValidModes()

ilScormLP::getValidModes ( )

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

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

22  {
23  include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
24  $subtype = ilObjSAHSLearningModule::_lookupSubType($this->obj_id);
25  if($subtype != "scorm2004")
26  {
27  if($this->checkSCORMPreconditions())
28  {
29  return array(ilLPObjSettings::LP_MODE_SCORM);
30  }
31 
32  include_once "Services/Tracking/classes/collection/class.ilLPCollectionOfSCOs.php";
33  $collection = new ilLPCollectionOfSCOs($this->obj_id, ilLPObjSettings::LP_MODE_SCORM);
34  if(sizeof($collection->getPossibleItems()))
35  {
38  }
40  }
41  else
42  {
43  if($this->checkSCORMPreconditions())
44  {
45  return array(ilLPObjSettings::LP_MODE_SCORM,
47  }
48 
49  include_once "Services/Tracking/classes/collection/class.ilLPCollectionOfSCOs.php";
50  $collection = new ilLPCollectionOfSCOs($this->obj_id, ilLPObjSettings::LP_MODE_SCORM);
51  if(sizeof($collection->getPossibleItems()))
52  {
56  }
57 
60  }
61  }
_lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
checkSCORMPreconditions()
+ Here is the call graph for this function:

◆ isLPMember()

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

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

References $ilDB, and $row.

83  {
84  global $ilDB;
85 
86  // subtype
87  $types = array();
88  $set = $ilDB->query("SELECT id,c_type".
89  " FROM sahs_lm".
90  " WHERE ".$ilDB->in("id", $a_obj_ids, "", "integer"));
91  while($row = $ilDB->fetchAssoc($set))
92  {
93  $types[$row["c_type"]][] = $row["id"];
94  }
95 
96  // 2004
97  if(isset($types["scorm2004"]))
98  {
99  $set = $ilDB->query("SELECT obj_id".
100  " FROM sahs_user".
101  " WHERE ".$ilDB->in("obj_id", $types["scorm2004"], "", "integer").
102  " AND user_id = ".$ilDB->quote($a_usr_id, "integer"));
103  while($row = $ilDB->fetchAssoc($set))
104  {
105  $a_res[$row["obj_id"]] = true;
106  }
107  }
108 
109  // 1.2
110  if(isset($types["scorm"]))
111  {
112  $set = $ilDB->query("SELECT obj_id".
113  " FROM scorm_tracking".
114  " WHERE ".$ilDB->in("obj_id", $types["scorm"], "", "integer").
115  " AND user_id = ".$ilDB->quote($a_usr_id, "integer").
116  " AND lvalue = ".$ilDB->quote("cmi.core.lesson_status", "text"));
117  while($row = $ilDB->fetchAssoc($set))
118  {
119  $a_res[$row["obj_id"]] = true;
120  }
121  }
122  }
global $ilDB

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