11 include_once
'./Services/Xml/classes/class.ilXmlWriter.php';
23 parent::__construct();
50 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
51 $assessmentSetting =
new ilSetting(
"assessment");
52 $user_criteria = $assessmentSetting->get(
"user_criteria");
53 if (strlen($user_criteria) == 0) {
54 $user_criteria =
'usr_id';
57 if ($this->anonymized) {
59 "SELECT * FROM tst_active WHERE test_fi = %s",
65 "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",
73 'active_id' =>
$row[
'active_id'],
74 'user_fi' =>
$row[
'user_fi'],
75 'anonymous_id' =>
$row[
'anonymous_id'],
76 'test_fi' =>
$row[
'test_fi'],
77 'lastindex' =>
$row[
'lastindex'],
78 'tries' =>
$row[
'tries'],
79 'last_started_pass' =>
$row[
'last_started_pass'],
80 'last_finished_pass' =>
$row[
'last_finished_pass'],
81 'submitted' =>
$row[
'submitted'],
82 'submittimestamp' =>
$row[
'submittimestamp'],
83 'tstamp' =>
$row[
'tstamp']
86 if (!$this->anonymized) {
87 $attrs[
'user_criteria'] = $user_criteria;
88 $attrs[$user_criteria] =
$row[$user_criteria];
90 array_push($this->active_ids,
$row[
'active_id']);
101 $query =
"SELECT * FROM tst_pass_result WHERE " .
$ilDB->in(
'active_fi', $this->active_ids,
false,
'integer') .
" ORDER BY active_fi, pass";
106 'active_fi' =>
$row[
'active_fi'],
107 'pass' =>
$row[
'pass'],
108 'points' =>
$row[
'points'],
109 'maxpoints' =>
$row[
'maxpoints'],
110 'questioncount' =>
$row[
'questioncount'],
111 'answeredquestions' =>
$row[
'answeredquestions'],
112 'workingtime' =>
$row[
'workingtime'],
113 'tstamp' =>
$row[
'tstamp']
123 $ilDB = $DIC[
'ilDB'];
125 $query =
"SELECT * FROM tst_result_cache WHERE " .
$ilDB->in(
'active_fi', $this->active_ids,
false,
'integer') .
" ORDER BY active_fi";
130 'active_fi' =>
$row[
'active_fi'],
131 'pass' =>
$row[
'pass'],
132 'max_points' =>
$row[
'max_points'],
133 'reached_points' =>
$row[
'reached_points'],
134 'mark_short' =>
$row[
'mark_short'],
135 'mark_official' =>
$row[
'mark_official'],
136 'passed' =>
$row[
'passed'],
137 'failed' =>
$row[
'failed'],
138 'tstamp' =>
$row[
'tstamp']
148 $ilDB = $DIC[
'ilDB'];
150 $query =
"SELECT * FROM tst_sequence WHERE " .
$ilDB->in(
'active_fi', $this->active_ids,
false,
'integer') .
" ORDER BY active_fi, pass";
155 'active_fi' =>
$row[
'active_fi'],
156 'pass' =>
$row[
'pass'],
157 'sequence' =>
$row[
'sequence'],
158 'postponed' =>
$row[
'postponed'],
159 'hidden' =>
$row[
'hidden'],
160 'tstamp' =>
$row[
'tstamp']
170 $ilDB = $DIC[
'ilDB'];
172 $query =
"SELECT * FROM tst_solutions WHERE " .
$ilDB->in(
'active_fi', $this->active_ids,
false,
'integer') .
" ORDER BY solution_id";
177 'solution_id' =>
$row[
'solution_id'],
178 'active_fi' =>
$row[
'active_fi'],
179 'question_fi' =>
$row[
'question_fi'],
180 'points' =>
$row[
'points'],
181 'pass' =>
$row[
'pass'],
182 'value1' =>
$row[
'value1'],
183 'value2' =>
$row[
'value2'],
184 'tstamp' =>
$row[
'tstamp']
194 $ilDB = $DIC[
'ilDB'];
197 SELECT * FROM tst_test_rnd_qst 198 WHERE {$ilDB->in('active_fi', $this->active_ids, false, 'integer')} 199 ORDER BY test_random_question_id 206 foreach (
$row as $field => $value) {
207 $attrs[$field] = $value;
219 $ilDB = $DIC[
'ilDB'];
221 $query =
"SELECT * FROM tst_test_result WHERE " .
$ilDB->in(
'active_fi', $this->active_ids,
false,
'integer') .
" ORDER BY active_fi";
226 'test_result_id' =>
$row[
'test_result_id'],
227 'active_fi' =>
$row[
'active_fi'],
228 'question_fi' =>
$row[
'question_fi'],
229 'points' =>
$row[
'points'],
230 'pass' =>
$row[
'pass'],
231 'manual' =>
$row[
'manual'],
232 'tstamp' =>
$row[
'tstamp']
242 $ilDB = $DIC[
'ilDB'];
244 $query =
"SELECT * FROM tst_times WHERE " .
$ilDB->in(
'active_fi', $this->active_ids,
false,
'integer') .
" ORDER BY active_fi";
249 'times_id' =>
$row[
'times_id'],
250 'active_fi' =>
$row[
'active_fi'],
251 'started' =>
$row[
'started'],
252 'finished' =>
$row[
'finished'],
253 'pass' =>
$row[
'pass'],
254 'tstamp' =>
$row[
'tstamp']
263 $this->active_ids = array();
265 $attrs = array(
"version" =>
"4.1.0");
285 return parent::xmlDumpMem(
$format);
291 return parent::xmlDumpFile($file,
$format);
xmlDumpFile($file, $format=true)
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
setIncludeRandomTestQuestionsEnabled($includeRandomTestQuestionsEnabled)
__construct($test_id, $anonymized=false)
static _getParticipantData($active_id)
Retrieves a participant name from active id.
Test results to XML class.
isIncludeRandomTestQuestionsEnabled()
xmlEndTag($tag)
Writes an endtag.
$includeRandomTestQuestionsEnabled
xmlHeader()
Writes xml header public.
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
exportRandomTestQuestions()