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