ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 31 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 36 of file class.ilSoapSCORMAdministration.php.

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

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

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

144  {
145  $this->initAuth($sid);
146  $this->initIlias();
147 
148  if (!$this->checkSession($sid)) {
149  return $this->raiseError($this->getMessage(), $this->getMessageCode());
150  }
151 
152  if (!($a_ref_id > 0)) {
153  return $this->raiseError('No ref_id given. Aborting!', 'Client');
154  }
155 
157 
158  if (!$obj_id = ilObject::_lookupObjectId($a_ref_id)) {
159  return $this->raiseError(
160  'No scorm module found for id: ' . $a_ref_id,
161  'Client'
162  );
163  }
164 
166  return $this->raiseError('Learning progress not enabled in this installation. Aborting!', 'Server');
167  }
168 
169  $status = ilLPStatus::_lookupStatus($obj_id, $a_usr_id);
170  if ($status === ilLPStatus::LP_STATUS_COMPLETED_NUM) {
171  return 'completed';
172  } elseif ($status === ilLPStatus::LP_STATUS_FAILED_NUM) {
173  return 'failed';
174  } elseif ($status === ilLPStatus::LP_STATUS_IN_PROGRESS_NUM) {
175  return 'in_progress';
176  } else {
177  return 'not_attempted';
178  }
179  }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
raiseError(string $a_message, $a_code)
static initILIAS()
ilias initialisation
static _lookupObjectId(int $ref_id)
static _lookupStatus(int $a_obj_id, int $a_user_id, bool $a_create=true)
Lookup status.
const LP_STATUS_FAILED_NUM
+ 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 104 of file class.ilSoapSCORMAdministration.php.

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

105  {
106  $this->initAuth($sid);
107  $this->initIlias();
108 
109  if (!$this->checkSession($sid)) {
110  return $this->raiseError($this->getMessage(), $this->getMessageCode());
111  }
112  if (!($ref_id > 0)) {
113  return $this->raiseError(
114  'No ref id given. Aborting!',
115  'Client'
116  );
117  }
118  global $DIC;
119 
120  $rbacsystem = $DIC['rbacsystem'];
121  $tree = $DIC['tree'];
122  $ilLog = $DIC['ilLog'];
123 
124  if (!$obj_id = ilObject::_lookupObjectId($ref_id)) {
125  return $this->raiseError(
126  'No exercise found for id: ' . $ref_id,
127  'Client'
128  );
129  }
130 
132  return $this->raiseError("Parent with ID $ref_id has been deleted.", 'Client');
133  }
134 
135  $certValidator = new ilCertificateUserCertificateAccessValidator();
136 
137  return $certValidator->validate($usr_id, $obj_id);
138  }
raiseError(string $a_message, $a_code)
$ref_id
Definition: ltiauth.php:66
static _isInTrash(int $ref_id)
global $DIC
Definition: shib_login.php:25
static _lookupObjectId(int $ref_id)
+ Here is the call graph for this function:

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