ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilSoapSCORMAdministration Class Reference
+ Inheritance diagram for ilSoapSCORMAdministration:
+ Collaboration diagram for ilSoapSCORMAdministration:

Public Member Functions

 ilSoapExerciseAdministration ()
 
 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
 ilSoapAdministration ($use_nusoap=true)
 
 initErrorWriter ()
 Overwrite error handler. More...
 
 __explodeSid ($sid)
 
 __setMessage ($a_str)
 
 __getMessage ()
 
 __appendMessage ($a_str)
 
 __setMessageCode ($a_code)
 
 __getMessageCode ()
 
 initAuth ($sid)
 
 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 51 of file class.ilSoapSCORMAdministration.php.

52 {
53 $this->initAuth($sid);
54 $this->initIlias();
55
56 if(!$this->__checkSession($sid))
57 {
58 return $this->__raiseError($this->__getMessage(),$this->__getMessageCode());
59 }
60 if(!strlen($ref_id))
61 {
62 return $this->__raiseError('No ref id given. Aborting!',
63 'Client');
64 }
65 global $rbacsystem, $tree, $ilLog;
66
67 // get obj_id
69 {
70 return $this->__raiseError('No exercise found for id: '.$ref_id,
71 'Client');
72 }
73
75 {
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 {
83 if($rbacsystem->checkAccess('read',$ref_id))
84 {
85 $permission_ok = true;
86 break;
87 }
88 }
89
90 if(!$permission_ok)
91 {
92 return $this->__raiseError('No permission to read the object with id: '.$ref_id,
93 'Server');
94 }
95
96 $lm_obj = ilObjectFactory::getInstanceByObjId($obj_id, false);
97 if (!is_object($lm_obj) || $lm_obj->getType()!= "sahs")
98 {
99 return $this->__raiseError('Wrong obj id or type for scorm object with id '.$ref_id,
100 'Server');
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('Could not find manifest file for object with ref id '.$ref_id,
110 'Server');
111
112 }
113 return file_get_contents($imsFilename);
114 }
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
_isInTrash($a_ref_id)
checks wether object is in trash
static _lookupObjectId($a_ref_id)
lookup object id
static _getAllReferences($a_id)
get all reference ids of object
__raiseError($a_message, $a_code)
$ref_id
Definition: sahs_server.php:39

References $ilLog, $ref_id, 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 151 of file class.ilSoapSCORMAdministration.php.

152 {
153 $this->initAuth($sid);
154 $this->initIlias();
155
156 if(!$this->__checkSession($sid))
157 {
158 return $this->__raiseError($this->__getMessage(),$this->__getMessageCode());
159 }
160
161 if(!strlen($a_ref_id))
162 {
163 return $this->__raiseError('No ref_id given. Aborting!', 'Client');
164 }
165
166 include_once 'include/inc.header.php';
167
168 // get obj_id
169 if(!$obj_id = ilObject::_lookupObjectId($a_ref_id))
170 {
171 return $this->__raiseError('No scorm module found for id: '.$a_ref_id,
172 'Client');
173 }
174
175 include_once 'Services/Tracking/classes/class.ilLPStatus.php';
176 include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
177
179 {
180 return $this->__raiseError('Learning progress not enabled in this installation. Aborting!', 'Server');
181 }
182
183 $status = ilLPStatus::_lookupStatus($obj_id, $a_usr_id);
185 {
186 return 'completed';
187 }
188 else if($status == ilLPStatus::LP_STATUS_FAILED_NUM)
189 {
190 return 'failed';
191 }
192 else if($status == ilLPStatus::LP_STATUS_IN_PROGRESS_NUM)
193 {
194 return 'in_progress';
195 }
196 else
197 {
198 return 'not_attempted';
199 }
200 }
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 116 of file class.ilSoapSCORMAdministration.php.

117 {
118 $this->initAuth($sid);
119 $this->initIlias();
120
121 if(!$this->__checkSession($sid))
122 {
123 return $this->__raiseError($this->__getMessage(),$this->__getMessageCode());
124 }
125 if(!strlen($ref_id))
126 {
127 return $this->__raiseError('No ref id given. Aborting!',
128 'Client');
129 }
130 global $rbacsystem, $tree, $ilLog;
131
132 // get obj_id
133 if(!$obj_id = ilObject::_lookupObjectId($ref_id))
134 {
135 return $this->__raiseError('No exercise found for id: '.$ref_id,
136 'Client');
137 }
138
140 {
141 return $this->__raiseError("Parent with ID $ref_id has been deleted.", 'Client');
142 }
143
144 $result = false;
145 include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php");
147
148 return $result;
149 }
$result
static _lookupUserCertificate($obj_id, $usr_id=0)
Checks whether a certificate exists for the active user or not.

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

+ Here is the call graph for this function:

◆ ilSoapExerciseAdministration()

ilSoapSCORMAdministration::ilSoapExerciseAdministration ( )

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

38 {
39 parent::ilSoapAdministration();
40 }

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