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

Public Member Functions

 getIMSManifestXML (string $sid, int $requested_ref_id)
 
 hasSCORMCertificate (string $sid, int $ref_id, int $usr_id)
 
 getSCORMCompletionStatus (string $sid, int $a_usr_id, int $a_ref_id)
 
- Public Member Functions inherited from ilSoapAdministration
 __construct (bool $use_nusoap=true)
 
 getMessage ()
 
 appendMessage (string $a_str)
 
 setMessageCode (string $a_code)
 
 getMessageCode ()
 
 reInitUser ()
 
 isFault ($object)
 
 getInstallationInfoXML ()
 
 getClientInfoXML (string $clientid)
 

Additional Inherited Members

- Data Fields inherited from ilSoapAdministration
const NUSOAP = 1
 
const PHP5 = 2
 
int $error_method
 Defines type of error handling (PHP5 || NUSOAP) More...
 
- Protected Member Functions inherited from ilSoapAdministration
 checkSession (string $sid)
 
 explodeSid (string $sid)
 
 setMessage (string $a_str)
 
 initAuth (string $sid)
 
 initIlias ()
 
 initAuthenticationObject ()
 
 raiseError (string $a_message, $a_code)
 
 checkObjectAccess (int $ref_id, array $expected_type, string $permission, bool $returnObject=false)
 check access for ref id: expected type, permission, return object instance if returnobject is true More...
 
- Protected Attributes inherited from ilSoapAdministration
bool $soap_check = true
 
string $message = ''
 
string $message_code = ''
 

Detailed Description

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

Member Function Documentation

◆ getIMSManifestXML()

ilSoapSCORMAdministration::getIMSManifestXML ( string  $sid,
int  $requested_ref_id 
)
Returns
false|soap_fault|SoapFault|string|null

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

30 {
31 $this->initAuth($sid);
32 $this->initIlias();
33
34 if (!$this->checkSession($sid)) {
35 return $this->raiseError($this->getMessage(), $this->getMessageCode());
36 }
37 if (!($requested_ref_id > 0)) {
38 return $this->raiseError(
39 'No ref id given. Aborting!',
40 'Client'
41 );
42 }
43 global $DIC;
44
45 $rbacsystem = $DIC['rbacsystem'];
46 $tree = $DIC['tree'];
47 $ilLog = $DIC['ilLog'];
48
50 return $this->raiseError(
51 'No exercise found for id: ' . $requested_ref_id,
52 'Client'
53 );
54 }
55
57 return $this->raiseError("Parent with ID $requested_ref_id has been deleted.", 'Client');
58 }
59
60 $permission_ok = false;
61 foreach ($ref_ids = ilObject::_getAllReferences($obj_id) as $ref_id) {
62 if ($rbacsystem->checkAccess('read', $ref_id)) {
63 $permission_ok = true;
64 break;
65 }
66 }
67
68 if (!$permission_ok) {
69 return $this->raiseError(
70 'No permission to read the object with id: ' . $requested_ref_id,
71 'Server'
72 );
73 }
74
75 $lm_obj = ilObjectFactory::getInstanceByObjId($obj_id, false);
76 if (!is_object($lm_obj) || $lm_obj->getType() !== "sahs") {
77 return $this->raiseError(
78 'Wrong obj id or type for scorm object with id ' . $requested_ref_id,
79 'Server'
80 );
81 }
82
83 $imsFilename = $lm_obj->getDataDirectory() . DIRECTORY_SEPARATOR . "imsmanifest.xml";
84
85 if (!file_exists($imsFilename)) {
86 return $this->raiseError(
87 'Could not find manifest file for object with ref id ' . $requested_ref_id,
88 'Server'
89 );
90 }
91 return file_get_contents($imsFilename);
92 }
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupObjectId(int $ref_id)
static _getAllReferences(int $id)
get all reference ids for object ID
static _isInTrash(int $ref_id)
raiseError(string $a_message, $a_code)
$requested_ref_id
Definition: feed.php:40
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:26

References $DIC, $ref_id, $requested_ref_id, ilObject\_getAllReferences(), ilObject\_isInTrash(), ilObject\_lookupObjectId(), ilSoapAdministration\checkSession(), ilObjectFactory\getInstanceByObjId(), ilSoapAdministration\getMessage(), ilSoapAdministration\getMessageCode(), ilSoapAdministration\initAuth(), ilSoapAdministration\initIlias(), and ilSoapAdministration\raiseError().

+ Here is the call graph for this function:

◆ getSCORMCompletionStatus()

ilSoapSCORMAdministration::getSCORMCompletionStatus ( string  $sid,
int  $a_usr_id,
int  $a_ref_id 
)
Returns
soap_fault|SoapFault|string|null

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

137 {
138 $this->initAuth($sid);
139 $this->initIlias();
140
141 if (!$this->checkSession($sid)) {
142 return $this->raiseError($this->getMessage(), $this->getMessageCode());
143 }
144
145 if (!($a_ref_id > 0)) {
146 return $this->raiseError('No ref_id given. Aborting!', 'Client');
147 }
148
150
151 if (!$obj_id = ilObject::_lookupObjectId($a_ref_id)) {
152 return $this->raiseError(
153 'No scorm module found for id: ' . $a_ref_id,
154 'Client'
155 );
156 }
157
159 return $this->raiseError('Learning progress not enabled in this installation. Aborting!', 'Server');
160 }
161
162 $status = ilLPStatus::_lookupStatus($obj_id, $a_usr_id);
163 if ($status === ilLPStatus::LP_STATUS_COMPLETED_NUM) {
164 return 'completed';
165 } elseif ($status === ilLPStatus::LP_STATUS_FAILED_NUM) {
166 return 'failed';
167 } elseif ($status === ilLPStatus::LP_STATUS_IN_PROGRESS_NUM) {
168 return 'in_progress';
169 } else {
170 return 'not_attempted';
171 }
172 }
static initILIAS()
ilias initialisation
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
static _lookupStatus(int $a_obj_id, int $a_user_id, bool $a_create=true)
Lookup status.
const LP_STATUS_FAILED_NUM

References ilObjUserTracking\_enabledLearningProgress(), ilObject\_lookupObjectId(), ilLPStatus\_lookupStatus(), ilSoapAdministration\checkSession(), ilSoapAdministration\getMessage(), ilSoapAdministration\getMessageCode(), ilSoapAdministration\initAuth(), ilInitialisation\initILIAS(), ilSoapAdministration\initIlias(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, and ilSoapAdministration\raiseError().

+ Here is the call graph for this function:

◆ hasSCORMCertificate()

ilSoapSCORMAdministration::hasSCORMCertificate ( string  $sid,
int  $ref_id,
int  $usr_id 
)
Returns
bool|soap_fault|SoapFault|null

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

98 {
99 $this->initAuth($sid);
100 $this->initIlias();
101
102 if (!$this->checkSession($sid)) {
103 return $this->raiseError($this->getMessage(), $this->getMessageCode());
104 }
105 if (!($ref_id > 0)) {
106 return $this->raiseError(
107 'No ref id given. Aborting!',
108 'Client'
109 );
110 }
111 global $DIC;
112
113 $rbacsystem = $DIC['rbacsystem'];
114 $tree = $DIC['tree'];
115 $ilLog = $DIC['ilLog'];
116
117 if (!$obj_id = ilObject::_lookupObjectId($ref_id)) {
118 return $this->raiseError(
119 'No exercise found for id: ' . $ref_id,
120 'Client'
121 );
122 }
123
125 return $this->raiseError("Parent with ID $ref_id has been deleted.", 'Client');
126 }
127
128 $certValidator = new ilCertificateUserCertificateAccessValidator();
129
130 return $certValidator->validate($usr_id, $obj_id);
131 }

References $DIC, $ref_id, ilObject\_isInTrash(), ilObject\_lookupObjectId(), ilSoapAdministration\checkSession(), ilSoapAdministration\getMessage(), ilSoapAdministration\getMessageCode(), ilSoapAdministration\initAuth(), ilSoapAdministration\initIlias(), and ilSoapAdministration\raiseError().

+ Here is the call graph for this function:

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