186 {
187 $type_id = null;
188 $lrs = null;
190 $query = "SELECT {$this->table_prefix}_settings.lrs_type_id,
191 {$this->table_prefix}_settings.only_moveon,
192 {$this->table_prefix}_settings.achieved,
193 {$this->table_prefix}_settings.answered,
194 {$this->table_prefix}_settings.completed,
195 {$this->table_prefix}_settings.failed,
196 {$this->table_prefix}_settings.initialized,
197 {$this->table_prefix}_settings.passed,
198 {$this->table_prefix}_settings.progressed,
199 {$this->table_prefix}_settings.satisfied,
200 {$this->table_prefix}_settings.c_terminated,
201 {$this->table_prefix}_settings.hide_data,
202 {$this->table_prefix}_settings.c_timestamp,
203 {$this->table_prefix}_settings.duration,
204 {$this->table_prefix}_settings.no_substatements,
205 {$this->table_prefix}_settings.privacy_ident
206 FROM {$this->table_prefix}_settings, {$this->table_prefix}_token
207 WHERE {$this->table_prefix}_settings.obj_id = {$this->table_prefix}_token.obj_id AND {$this->table_prefix}_token.token = " . $db->quote($this->token, 'text');
208
209 $res = $db->query($query);
210 while ($row = $db->fetchObject(
$res)) {
211 $type_id = (
int) $row->lrs_type_id;
213
214 $lrs = new \ilCmiXapiLrsType($type_id);
215 }
216
217 $sarr = [];
218 if ((bool) $row->only_moveon) {
219 if ((bool) $row->achieved) {
220 $sarr[] = "https://w3id.org/xapi/dod-isd/verbs/achieved";
221 }
222 if ((bool) $row->answered) {
223 $sarr[] = "http://adlnet.gov/expapi/verbs/answered";
224 $sarr[] = "https://w3id.org/xapi/dod-isd/verbs/answered";
225 }
226 if ((bool) $row->completed) {
227 $sarr[] = "http://adlnet.gov/expapi/verbs/completed";
228 $sarr[] = "https://w3id.org/xapi/dod-isd/verbs/completed";
229 }
230 if ((bool) $row->failed) {
231 $sarr[] = "http://adlnet.gov/expapi/verbs/failed";
232 }
233 if ((bool) $row->initialized) {
234 $sarr[] = "http://adlnet.gov/expapi/verbs/initialized";
235 $sarr[] = "https://w3id.org/xapi/dod-isd/verbs/initialized";
236 }
237 if ((bool) $row->passed) {
238 $sarr[] = "http://adlnet.gov/expapi/verbs/passed";
239 }
240 if ((bool) $row->progressed) {
241 $sarr[] = "http://adlnet.gov/expapi/verbs/progressed";
242 }
243 if ((bool) $row->satisfied) {
244 $sarr[] = "https://w3id.org/xapi/adl/verbs/satisfied";
245 }
246 if ((bool) $row->c_terminated) {
247 $sarr[] = "http://adlnet.gov/expapi/verbs/terminated";
248 }
249 if (count($sarr) > 0) {
250 $this->specificAllowedStatements = $sarr;
251 $this->
log()->debug($this->
msg(
'getSpecificAllowedStatements: ' . var_export($this->specificAllowedStatements,
true)));
252 }
253 }
254 if ((bool) $row->hide_data) {
255 $rarr = array();
256 if ((bool) $row->c_timestamp) {
257 $rarr['timestamp'] = '1970-01-01T00:00:00.000Z';
258 }
259 if ((bool) $row->duration) {
260 $rarr['result.duration'] = 'PT00.000S';
261 }
262 if (count($rarr) > 0) {
263 $this->replacedValues = $rarr;
264 $this->
log()->debug($this->
msg(
'getReplacedValues: ' . var_export($this->replacedValues,
true)));
265 }
266 }
267 if ((bool) $row->no_substatements) {
268 $this->blockSubStatements = true;
269 $this->
log()->debug($this->
msg(
'getBlockSubStatements: ' . $this->blockSubStatements));
270 }
271 $lrs->setPrivacyIdent((int) $row->privacy_ident);
272 }
273 return $lrs;
274 }
if(!file_exists('../ilias.ini.php'))