ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSoapSCORMAdministration Class Reference
+ Inheritance diagram for ilSoapSCORMAdministration:
+ Collaboration diagram for ilSoapSCORMAdministration:

Public Member Functions

 getIMSManifestXML ($sid, $ref_id)
 get ims manifest xml More...
 
 hasSCORMCertificate ($sid, $ref_id, $usr_id)
 
 getSCORMCompletionStatus ($sid, $a_usr_id, $a_ref_id)
 
- Public Member Functions inherited from ilSoapAdministration
 __construct ($use_nusoap=true)
 Constructor. More...
 
 initErrorWriter ()
 Overwrite error handler. More...
 
 __explodeSid ($sid)
 
 __setMessage ($a_str)
 
 __getMessage ()
 
 __appendMessage ($a_str)
 
 __setMessageCode ($a_code)
 
 __getMessageCode ()
 
 initAuth ($sid)
 Init authentication. More...
 
 initIlias ()
 
 __initAuthenticationObject ($a_auth_mode=AUTH_LOCAL)
 
 __raiseError ($a_message, $a_code)
 
 getNIC ($sid)
 get client information from current as xml result set More...
 
 isFault ($object)
 
 checkObjectAccess ($ref_id, $expected_type, $permission, $returnObject=false)
 check access for ref id: expected type, permission, return object instance if returnobject is true More...
 
 getInstallationInfoXML ()
 
 getClientInfoXML ($clientid)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilSoapAdministration
static return_bytes ($val)
 calculate bytes from K,M,G modifiers e.g: 8M = 8 * 1024 * 1024 bytes More...
 
- Data Fields inherited from ilSoapAdministration
 $sauth = null
 
 $error_method = null
 
- Protected Attributes inherited from ilSoapAdministration
 $soap_check = true
 

Detailed Description

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

Member Function Documentation

◆ getIMSManifestXML()

ilSoapSCORMAdministration::getIMSManifestXML (   $sid,
  $ref_id 
)

get ims manifest xml

Parameters
string$sid
int$ref_id
Returns
xml following scorm.dtd

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

References $ilLog, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObject\_getAllReferences(), ilObject\_isInTrash(), ilObject\_lookupObjectId(), ilObjectFactory\getInstanceByObjId(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().

48  {
49  $this->initAuth($sid);
50  $this->initIlias();
51 
52  if (!$this->__checkSession($sid)) {
53  return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
54  }
55  if (!strlen($ref_id)) {
56  return $this->__raiseError(
57  'No ref id given. Aborting!',
58  'Client'
59  );
60  }
61  global $rbacsystem, $tree, $ilLog;
62 
63  // get obj_id
64  if (!$obj_id = ilObject::_lookupObjectId($ref_id)) {
65  return $this->__raiseError(
66  'No exercise found for id: ' . $ref_id,
67  'Client'
68  );
69  }
70 
71  if (ilObject::_isInTrash($ref_id)) {
72  return $this->__raiseError("Parent with ID $ref_id has been deleted.", 'Client');
73  }
74 
75  // Check access
76  $permission_ok = false;
77  foreach ($ref_ids = ilObject::_getAllReferences($obj_id) as $ref_id) {
78  if ($rbacsystem->checkAccess('read', $ref_id)) {
79  $permission_ok = true;
80  break;
81  }
82  }
83 
84  if (!$permission_ok) {
85  return $this->__raiseError(
86  'No permission to read the object with id: ' . $ref_id,
87  'Server'
88  );
89  }
90 
91  $lm_obj = ilObjectFactory::getInstanceByObjId($obj_id, false);
92  if (!is_object($lm_obj) || $lm_obj->getType()!= "sahs") {
93  return $this->__raiseError(
94  'Wrong obj id or type for scorm object with id ' . $ref_id,
95  'Server'
96  );
97  }
98  // get scorm xml
99  require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMObject.php");
100  require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
101 
102  $imsFilename = $lm_obj->getDataDirectory() . DIRECTORY_SEPARATOR . "imsmanifest.xml";
103 
104  if (!file_exists($imsFilename)) {
105  return $this->__raiseError(
106  'Could not find manifest file for object with ref id ' . $ref_id,
107  'Server'
108  );
109  }
110  return file_get_contents($imsFilename);
111  }
static _isInTrash($a_ref_id)
checks wether object is in trash
static _getAllReferences($a_id)
get all reference ids of object
static _lookupObjectId($a_ref_id)
lookup object id
__raiseError($a_message, $a_code)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
initAuth($sid)
Init authentication.
+ Here is the call graph for this function:

◆ getSCORMCompletionStatus()

ilSoapSCORMAdministration::getSCORMCompletionStatus (   $sid,
  $a_usr_id,
  $a_ref_id 
)

Definition at line 148 of file class.ilSoapSCORMAdministration.php.

References ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObjUserTracking\_enabledLearningProgress(), ilObject\_lookupObjectId(), ilLPStatus\_lookupStatus(), ilSoapAdministration\initAuth(), ilSoapAdministration\initIlias(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED_NUM, and ilLPStatus\LP_STATUS_IN_PROGRESS_NUM.

149  {
150  $this->initAuth($sid);
151  $this->initIlias();
152 
153  if (!$this->__checkSession($sid)) {
154  return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
155  }
156 
157  if (!strlen($a_ref_id)) {
158  return $this->__raiseError('No ref_id given. Aborting!', 'Client');
159  }
160 
161  include_once 'include/inc.header.php';
162 
163  // get obj_id
164  if (!$obj_id = ilObject::_lookupObjectId($a_ref_id)) {
165  return $this->__raiseError(
166  'No scorm module found for id: ' . $a_ref_id,
167  'Client'
168  );
169  }
170 
171  include_once 'Services/Tracking/classes/class.ilLPStatus.php';
172  include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
173 
175  return $this->__raiseError('Learning progress not enabled in this installation. Aborting!', 'Server');
176  }
177 
178  $status = ilLPStatus::_lookupStatus($obj_id, $a_usr_id);
179  if ($status == ilLPStatus::LP_STATUS_COMPLETED_NUM) {
180  return 'completed';
181  } elseif ($status == ilLPStatus::LP_STATUS_FAILED_NUM) {
182  return 'failed';
183  } elseif ($status == ilLPStatus::LP_STATUS_IN_PROGRESS_NUM) {
184  return 'in_progress';
185  } else {
186  return 'not_attempted';
187  }
188  }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
static _lookupObjectId($a_ref_id)
lookup object id
static _enabledLearningProgress()
check wether learing progress is enabled or not
__raiseError($a_message, $a_code)
initAuth($sid)
Init authentication.
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.
const LP_STATUS_FAILED_NUM
+ Here is the call graph for this function:

◆ hasSCORMCertificate()

ilSoapSCORMAdministration::hasSCORMCertificate (   $sid,
  $ref_id,
  $usr_id 
)

Definition at line 113 of file class.ilSoapSCORMAdministration.php.

References $ilLog, $result, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObject\_isInTrash(), ilObject\_lookupObjectId(), ilObjSAHSLearningModuleAccess\_lookupUserCertificate(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().

114  {
115  $this->initAuth($sid);
116  $this->initIlias();
117 
118  if (!$this->__checkSession($sid)) {
119  return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
120  }
121  if (!strlen($ref_id)) {
122  return $this->__raiseError(
123  'No ref id given. Aborting!',
124  'Client'
125  );
126  }
127  global $rbacsystem, $tree, $ilLog;
128 
129  // get obj_id
130  if (!$obj_id = ilObject::_lookupObjectId($ref_id)) {
131  return $this->__raiseError(
132  'No exercise found for id: ' . $ref_id,
133  'Client'
134  );
135  }
136 
137  if (ilObject::_isInTrash($ref_id)) {
138  return $this->__raiseError("Parent with ID $ref_id has been deleted.", 'Client');
139  }
140 
141  $result = false;
142  include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
144 
145  return $result;
146  }
$result
static _isInTrash($a_ref_id)
checks wether object is in trash
static _lookupObjectId($a_ref_id)
lookup object id
__raiseError($a_message, $a_code)
initAuth($sid)
Init authentication.
static _lookupUserCertificate($obj_id, $usr_id=0)
Checks whether a certificate exists for the active user or not.
+ Here is the call graph for this function:

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