ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

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

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

+ Here is the call graph for this function:

◆ getSCORMCompletionStatus()

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

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

156 {
157 $this->initAuth($sid);
158 $this->initIlias();
159
160 if (!$this->__checkSession($sid)) {
161 return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
162 }
163
164 if (!strlen($a_ref_id)) {
165 return $this->__raiseError('No ref_id given. Aborting!', 'Client');
166 }
167
168 include_once 'include/inc.header.php';
169
170 // get obj_id
171 if (!$obj_id = ilObject::_lookupObjectId($a_ref_id)) {
172 return $this->__raiseError(
173 'No scorm module found for id: ' . $a_ref_id,
174 'Client'
175 );
176 }
177
178 include_once 'Services/Tracking/classes/class.ilLPStatus.php';
179 include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
180
182 return $this->__raiseError('Learning progress not enabled in this installation. Aborting!', 'Server');
183 }
184
185 $status = ilLPStatus::_lookupStatus($obj_id, $a_usr_id);
187 return 'completed';
188 } elseif ($status == ilLPStatus::LP_STATUS_FAILED_NUM) {
189 return 'failed';
190 } elseif ($status == ilLPStatus::LP_STATUS_IN_PROGRESS_NUM) {
191 return 'in_progress';
192 } else {
193 return 'not_attempted';
194 }
195 }
const LP_STATUS_COMPLETED_NUM
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_FAILED_NUM
static _enabledLearningProgress()
check wether learing progress is enabled or not

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.

+ Here is the call graph for this function:

◆ hasSCORMCertificate()

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

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

118 {
119 $this->initAuth($sid);
120 $this->initIlias();
121
122 if (!$this->__checkSession($sid)) {
123 return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
124 }
125 if (!strlen($ref_id)) {
126 return $this->__raiseError(
127 'No ref id given. Aborting!',
128 'Client'
129 );
130 }
131 global $DIC;
132
133 $rbacsystem = $DIC['rbacsystem'];
134 $tree = $DIC['tree'];
135 $ilLog = $DIC['ilLog'];
136
137 // get obj_id
138 if (!$obj_id = ilObject::_lookupObjectId($ref_id)) {
139 return $this->__raiseError(
140 'No exercise found for id: ' . $ref_id,
141 'Client'
142 );
143 }
144
145 if (ilObject::_isInTrash($ref_id)) {
146 return $this->__raiseError("Parent with ID $ref_id has been deleted.", 'Client');
147 }
148
149 $certValidator = new ilCertificateUserCertificateAccessValidator();
150 $result = $certValidator->validate($usr_id, $obj_id);
151
152 return $result;
153 }
$result

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

+ Here is the call graph for this function:

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