49 $assessmentSetting =
new ilSetting(
"assessment");
50 $user_criteria = $assessmentSetting->get(
"user_criteria");
51 if (!$user_criteria || $user_criteria ===
'') {
52 $user_criteria =
'usr_id';
55 if ($this->anonymized) {
56 $result =
$ilDB->queryF(
57 "SELECT * FROM tst_active WHERE test_fi = %s",
62 $result =
$ilDB->queryF(
63 "SELECT tst_active.*, usr_data." . $user_criteria .
" FROM tst_active, usr_data WHERE tst_active.test_fi = %s AND tst_active.user_fi = usr_data.usr_id",
69 while ($row =
$ilDB->fetchAssoc($result)) {
71 'active_id' => $row[
'active_id'],
72 'user_fi' => $row[
'user_fi'] ??
'',
73 'anonymous_id' => $row[
'anonymous_id'] ??
'',
74 'test_fi' => $row[
'test_fi'],
75 'lastindex' => $row[
'lastindex'] ??
'',
76 'tries' => $row[
'tries'] ??
'',
77 'last_started_pass' => $row[
'last_started_pass'] ??
'',
78 'last_finished_pass' => $row[
'last_finished_pass'] ??
'',
79 'submitted' => $row[
'submitted'] ??
'',
80 'submittimestamp' => $row[
'submittimestamp'] ??
'',
81 'tstamp' => $row[
'tstamp'] ??
'' 84 if (!$this->anonymized) {
85 $attrs[
'user_criteria'] = $user_criteria;
86 $attrs[$user_criteria] = $row[$user_criteria];
88 array_push($this->active_ids, $row[
'active_id']);
99 $query =
"SELECT * FROM tst_pass_result WHERE " .
$ilDB->in(
'active_fi', $this->active_ids,
false,
'integer') .
" ORDER BY active_fi, pass";
102 while ($row =
$ilDB->fetchAssoc($result)) {
104 'active_fi' => $row[
'active_fi'],
105 'pass' => $row[
'pass'] ??
'',
106 'points' => $row[
'points'] ??
'',
107 'maxpoints' => $row[
'maxpoints'] ??
'',
108 'questioncount' => $row[
'questioncount'] ??
'',
109 'answeredquestions' => $row[
'answeredquestions'] ??
'',
110 'workingtime' => $row[
'workingtime'] ??
'',
111 'tstamp' => $row[
'tstamp'] ??
'' 121 $ilDB = $DIC[
'ilDB'];
123 $query =
"SELECT * FROM tst_result_cache WHERE " .
$ilDB->in(
'active_fi', $this->active_ids,
false,
'integer') .
" ORDER BY active_fi";
126 while ($row =
$ilDB->fetchAssoc($result)) {
128 'active_fi' => $row[
'active_fi'],
129 'pass' => $row[
'pass'],
130 'max_points' => $row[
'max_points'],
131 'reached_points' => $row[
'reached_points'],
132 'mark_short' => $row[
'mark_short'],
133 'mark_official' => $row[
'mark_official'],
134 'passed' => $row[
'passed'],
135 'failed' => $row[
'failed'],
136 'tstamp' => $row[
'tstamp']
146 $ilDB = $DIC[
'ilDB'];
148 $query =
"SELECT * FROM tst_sequence WHERE " .
$ilDB->in(
'active_fi', $this->active_ids,
false,
'integer') .
" ORDER BY active_fi, pass";
151 while ($row =
$ilDB->fetchAssoc($result)) {
153 'active_fi' => $row[
'active_fi'],
154 'pass' => $row[
'pass'] ??
'',
155 'sequence' => $row[
'sequence'] ??
'',
156 'postponed' => $row[
'postponed'] ??
'',
157 'hidden' => $row[
'hidden'] ??
'',
158 'tstamp' => $row[
'tstamp'] ??
'' 168 $ilDB = $DIC[
'ilDB'];
170 $query =
"SELECT * FROM tst_solutions WHERE " .
$ilDB->in(
'active_fi', $this->active_ids,
false,
'integer') .
" ORDER BY solution_id";
173 while ($row =
$ilDB->fetchAssoc($result)) {
175 'solution_id' => $row[
'solution_id'],
176 'active_fi' => $row[
'active_fi'],
177 'question_fi' => $row[
'question_fi'],
178 'points' => $row[
'points'] ??
'',
179 'pass' => $row[
'pass'] ??
'',
180 'value1' => $row[
'value1'] ??
'',
181 'value2' => $row[
'value2'] ??
'',
182 'tstamp' => $row[
'tstamp'] ??
'' 192 $ilDB = $DIC[
'ilDB'];
194 $result =
$ilDB->query(
" 195 SELECT * FROM tst_test_rnd_qst 196 WHERE {$ilDB->in('active_fi', $this->active_ids, false, 'integer')} 197 ORDER BY test_random_question_id 201 while ($row =
$ilDB->fetchAssoc($result)) {
204 foreach ($row as $field => $value) {
205 $attrs[$field] = $value;
217 $ilDB = $DIC[
'ilDB'];
219 $query =
"SELECT * FROM tst_test_result WHERE " .
$ilDB->in(
'active_fi', $this->active_ids,
false,
'integer') .
" ORDER BY active_fi";
222 while ($row =
$ilDB->fetchAssoc($result)) {
224 'test_result_id' => $row[
'test_result_id'],
225 'active_fi' => $row[
'active_fi'],
226 'question_fi' => $row[
'question_fi'],
227 'points' => $row[
'points'] ??
'',
228 'pass' => $row[
'pass'] ??
'',
229 'manual' => $row[
'manual'] ??
'',
230 'tstamp' => $row[
'tstamp'] ??
'' 240 $ilDB = $DIC[
'ilDB'];
242 $query =
"SELECT * FROM tst_times WHERE " .
$ilDB->in(
'active_fi', $this->active_ids,
false,
'integer') .
" ORDER BY active_fi";
245 while ($row =
$ilDB->fetchAssoc($result)) {
247 'times_id' => $row[
'times_id'],
248 'active_fi' => $row[
'active_fi'],
249 'started' => $row[
'started'],
250 'finished' => $row[
'finished'],
251 'pass' => $row[
'pass'],
252 'tstamp' => $row[
'tstamp']
261 $this->active_ids = array();
263 $attrs = array(
"version" =>
"4.1.0");
283 return parent::xmlDumpMem(
$format);
289 parent::xmlDumpFile($file,
$format);
__construct($test_id, $anonymized=false)
static _getParticipantData($active_id)
Retrieves a participant name from active id.
bool $includeRandomTestQuestionsEnabled
xmlDumpFile(string $file, bool $format=true)
setIncludeRandomTestQuestionsEnabled(bool $includeRandomTestQuestionsEnabled)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
xmlDumpMem(bool $format=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isIncludeRandomTestQuestionsEnabled()
xmlEndTag(string $tag)
Writes an endtag.
xmlHeader()
Writes xml header.
__construct(Container $dic, ilPlugin $plugin)
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
exportRandomTestQuestions()