170 {
171 $type_id = null;
172 $lrs = null;
174 $query =
"SELECT {$this->table_prefix}_settings.lrs_type_id,
175 {$this->table_prefix}_settings.only_moveon,
176 {$this->table_prefix}_settings.achieved,
177 {$this->table_prefix}_settings.answered,
178 {$this->table_prefix}_settings.completed,
179 {$this->table_prefix}_settings.failed,
180 {$this->table_prefix}_settings.initialized,
181 {$this->table_prefix}_settings.passed,
182 {$this->table_prefix}_settings.progressed,
183 {$this->table_prefix}_settings.satisfied,
184 {$this->table_prefix}_settings.c_terminated,
185 {$this->table_prefix}_settings.hide_data,
186 {$this->table_prefix}_settings.c_timestamp,
187 {$this->table_prefix}_settings.duration,
188 {$this->table_prefix}_settings.no_substatements,
189 {$this->table_prefix}_settings.privacy_ident
190 FROM {$this->table_prefix}_settings, {$this->table_prefix}_token
191 WHERE {$this->table_prefix}_settings.obj_id = {$this->table_prefix}_token.obj_id AND {$this->table_prefix}_token.token = " . $db->quote($this->token, 'text');
192
194 while ($row = $db->fetchObject(
$res)) {
195 $type_id = $row->lrs_type_id;
196 if ($type_id) {
197 $lrs = (
$this->plugin) ?
new \ilXapiCmi5LrsType($type_id) : new \ilCmiXapiLrsType($type_id);
198 }
199
200 $sarr = [];
201 if ((bool) $row->only_moveon) {
202 if ((bool) $row->achieved) {
203 $sarr[] = "https://w3id.org/xapi/dod-isd/verbs/achieved";
204 }
205 if ((bool) $row->answered) {
206 $sarr[] = "http://adlnet.gov/expapi/verbs/answered";
207 $sarr[] = "https://w3id.org/xapi/dod-isd/verbs/answered";
208 }
209 if ((bool) $row->completed) {
210 $sarr[] = "http://adlnet.gov/expapi/verbs/completed";
211 $sarr[] = "https://w3id.org/xapi/dod-isd/verbs/completed";
212 }
213 if ((bool) $row->failed) {
214 $sarr[] = "http://adlnet.gov/expapi/verbs/failed";
215 }
216 if ((bool) $row->initialized) {
217 $sarr[] = "http://adlnet.gov/expapi/verbs/initialized";
218 $sarr[] = "https://w3id.org/xapi/dod-isd/verbs/initialized";
219 }
220 if ((bool) $row->passed) {
221 $sarr[] = "http://adlnet.gov/expapi/verbs/passed";
222 }
223 if ((bool) $row->progressed) {
224 $sarr[] = "http://adlnet.gov/expapi/verbs/progressed";
225 }
226 if ((bool) $row->satisfied) {
227 $sarr[] = "https://w3id.org/xapi/adl/verbs/satisfied";
228 }
229 if ((bool) $row->c_terminated) {
230 $sarr[] = "http://adlnet.gov/expapi/verbs/terminated";
231 }
232 if (count($sarr) > 0) {
233 $this->specificAllowedStatements = $sarr;
234 $this->
log()->debug($this->
msg(
'getSpecificAllowedStatements: ' . var_export($this->specificAllowedStatements,
true)));
235 }
236 }
237 if ((bool) $row->hide_data) {
238 $rarr = array();
239 if ((bool) $row->c_timestamp) {
240 $rarr['timestamp'] = '1970-01-01T00:00:00.000Z';
241 }
242 if ((bool) $row->duration) {
243 $rarr['result.duration'] = 'PT00.000S';
244 }
245 if (count($rarr) > 0) {
246 $this->replacedValues = $rarr;
247 $this->
log()->debug($this->
msg(
'getReplacedValues: ' . var_export($this->replacedValues,
true)));
248 }
249 }
250 if ((bool) $row->no_substatements) {
251 $this->blockSubStatements = true;
252 $this->
log()->debug($this->
msg(
'getBlockSubStatements: ' . $this->blockSubStatements));
253 }
254 $lrs->setPrivacyIdent((int) $row->privacy_ident);
255 }
256 return $lrs;
257 }
foreach($_POST as $key=> $value) $res