ILIAS  release_8 Revision v8.23
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 32 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 37 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().

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

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

148  {
149  $this->initAuth($sid);
150  $this->initIlias();
151 
152  if (!$this->checkSession($sid)) {
153  return $this->raiseError($this->getMessage(), $this->getMessageCode());
154  }
155 
156  if (!($a_ref_id > 0)) {
157  return $this->raiseError('No ref_id given. Aborting!', 'Client');
158  }
159 
160  include_once 'include/inc.header.php';
161 
162  if (!$obj_id = ilObject::_lookupObjectId($a_ref_id)) {
163  return $this->raiseError(
164  'No scorm module found for id: ' . $a_ref_id,
165  'Client'
166  );
167  }
168 
169  include_once 'Services/Tracking/classes/class.ilLPStatus.php';
170  include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
171 
173  return $this->raiseError('Learning progress not enabled in this installation. Aborting!', 'Server');
174  }
175 
176  $status = ilLPStatus::_lookupStatus($obj_id, $a_usr_id);
177  if ($status === ilLPStatus::LP_STATUS_COMPLETED_NUM) {
178  return 'completed';
179  } elseif ($status === ilLPStatus::LP_STATUS_FAILED_NUM) {
180  return 'failed';
181  } elseif ($status === ilLPStatus::LP_STATUS_IN_PROGRESS_NUM) {
182  return 'in_progress';
183  } else {
184  return 'not_attempted';
185  }
186  }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
raiseError(string $a_message, $a_code)
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 108 of file class.ilSoapSCORMAdministration.php.

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

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

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