79 return array(
'questionTitles',
'participants',
'statistics',
'arrFilter',
'datasets',
'test');
89 $this->participants = array();
90 $this->questionTitles = array();
100 unset($this->participants);
101 $this->participants = array();
102 unset($this->questionTitles);
103 $this->questionTitles = array();
105 unset($this->statistics);
110 $this->participants = array();
112 include_once
"./Modules/Test/classes/class.ilTestEvaluationPassData.php";
113 include_once
"./Modules/Test/classes/class.ilTestEvaluationUserData.php";
114 $result = $ilDB->queryF(
"SELECT usr_data.usr_id, usr_data.firstname, usr_data.lastname, usr_data.title, usr_data.login, " .
115 "tst_pass_result.* FROM tst_pass_result, tst_active " .
116 "LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id " .
117 "WHERE tst_active.active_id = tst_pass_result.active_fi " .
118 "AND tst_active.test_fi = %s " .
119 "ORDER BY usr_data.lastname, usr_data.firstname, tst_pass_result.active_fi, tst_pass_result.pass, tst_pass_result.tstamp",
121 array($this->
getTest()->getTestId())
126 while (
$row = $ilDB->fetchAssoc($result))
144 if (
$row[
"questioncount"] == 0)
162 unset($this->participants[$active_id]);
169 $result = $ilDB->queryF(
"SELECT tst_test_result.*, qpl_questions.original_id, qpl_questions.title questiontitle, " .
170 "qpl_questions.points maxpoints " .
171 "FROM tst_test_result, qpl_questions, tst_active " .
172 "WHERE tst_active.active_id = tst_test_result.active_fi " .
173 "AND qpl_questions.question_id = tst_test_result.question_fi " .
174 "AND tst_active.test_fi = %s AND tst_active.active_id = %s " .
175 "ORDER BY tst_active.active_id, tst_test_result.pass, tst_test_result.tstamp",
176 array(
'integer',
'integer'),
177 array($this->
getTest()->getTestId(), $active_id)
182 while (
$row = $ilDB->fetchAssoc($result))
187 if ($this->
getTest()->isRandomTest())
189 for ($testpass = 0; $testpass <= $this->
getParticipant($active_id)->getLastPass(); $testpass++)
191 $ilDB->setLimit($this->
getTest()->getQuestionCount(), 0);
192 $result = $ilDB->queryF(
"SELECT tst_test_rnd_qst.sequence, tst_test_rnd_qst.question_fi, qpl_questions.original_id, " .
193 "tst_test_rnd_qst.pass, qpl_questions.points, qpl_questions.title " .
194 "FROM tst_test_rnd_qst, qpl_questions " .
195 "WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id " .
196 "AND tst_test_rnd_qst.pass = %s " .
197 "AND tst_test_rnd_qst.active_fi = %s ORDER BY tst_test_rnd_qst.sequence",
198 array(
'integer',
'integer'),
199 array($testpass, $active_id)
201 if ($result->numRows())
203 while (
$row = $ilDB->fetchAssoc($result))
205 $tpass = array_key_exists(
"pass",
$row) ?
$row[
"pass"] : 0;
206 $this->
getParticipant($active_id)->addQuestion(
$row[
"original_id"] ?
$row[
"original_id"] :
$row[
"question_fi"], $row[
"question_fi"], $row[
"points"], $row[
"sequence"], $tpass);
214 $result = $ilDB->queryF(
"SELECT tst_test_question.sequence, tst_test_question.question_fi, " .
215 "qpl_questions.points, qpl_questions.title, qpl_questions.original_id " .
216 "FROM tst_test_question, tst_active, qpl_questions " .
217 "WHERE tst_test_question.question_fi = qpl_questions.question_id " .
218 "AND tst_active.active_id = %s AND tst_active.test_fi = tst_test_question.test_fi ORDER BY tst_test_question.sequence",
222 if ($result->numRows())
224 $questionsbysequence = array();
225 while (
$row = $ilDB->fetchAssoc($result))
227 $questionsbysequence[
$row[
"sequence"]] =
$row;
229 $seqresult = $ilDB->queryF(
"SELECT * FROM tst_sequence WHERE active_fi = %s",
233 while ($seqrow = $ilDB->fetchAssoc($seqresult))
235 $questionsequence = unserialize($seqrow[
"sequence"]);
236 foreach ($questionsequence as $sidx => $seq)
238 $qsid = $questionsbysequence[$seq][
"original_id"] ? $questionsbysequence[$seq][
"original_id"] : $questionsbysequence[$seq][
"question_fi"];
239 $this->
getParticipant($active_id)->addQuestion($qsid, $questionsbysequence[$seq][
"question_fi"], $questionsbysequence[$seq][
"points"], $sidx + 1, $seqrow[
"pass"]);
240 $this->
addQuestionTitle($questionsbysequence[$seq][
"question_fi"], $questionsbysequence[$seq][
"title"]);
246 if ($this->
getTest()->getECTSOutput())
248 $passed_array =& $this->
getTest()->getTotalPointsPassedArray();
251 $percentage = $this->
getParticipant($active_id)->getReachedPointsInPercent();
252 $mark = $this->
getTest()->getMarkSchema()->getMatchingMark($percentage);
253 if (is_object($mark))
255 $this->
getParticipant($active_id)->setMark($mark->getShortName());
256 $this->
getParticipant($active_id)->setMarkOfficial($mark->getOfficialName());
259 if ($this->
getTest()->getECTSOutput())
264 $visitingTime =& $this->
getTest()->getVisitTimeOfParticipant($active_id);
265 $this->
getParticipant($active_id)->setFirstVisit($visitingTime[
"firstvisit"]);
266 $this->
getParticipant($active_id)->setLastVisit($visitingTime[
"lastvisit"]);
276 $this->test =&
$test;
291 $this->questionTitles[$question_id] = $question_title;
301 if (array_key_exists($question_id, $this->questionTitles))
303 return $this->questionTitles[$question_id];
313 include_once
"./Modules/Test/classes/class.ilTestStatistics.php";
319 if (count($this->arrFilter))
321 $filteredParticipants = array();
322 $courseids = array();
325 if (array_key_exists(
'group', $this->arrFilter))
328 $groupids = array_merge($groupids, $ids);
330 if (array_key_exists(
'course', $this->arrFilter))
333 $courseids = array_merge($courseids, $ids);
335 foreach ($this->participants as $active_id => $participant)
338 if (array_key_exists(
'name', $this->arrFilter))
340 if (!(strpos(strtolower($participant->getName()), strtolower($this->arrFilter[
'name'])) !== FALSE)) $remove = TRUE;
344 if (array_key_exists(
'group', $this->arrFilter))
346 include_once
"./Services/Membership/classes/class.ilParticipants.php";
348 $foundfilter = FALSE;
349 if (count(array_intersect($groupids, $groups))) $foundfilter = TRUE;
350 if (!$foundfilter) $remove = TRUE;
355 if (array_key_exists(
'course', $this->arrFilter))
357 include_once
"./Services/Membership/classes/class.ilParticipants.php";
359 $foundfilter = FALSE;
360 if (count(array_intersect($courseids, $courses))) $foundfilter = TRUE;
361 if (!$foundfilter) $remove = TRUE;
366 if (array_key_exists(
'active_id', $this->arrFilter))
368 if ($active_id != $this->arrFilter[
'active_id']) $remove = TRUE;
371 if (!$remove) $filteredParticipants[$active_id] = $participant;
373 return $filteredParticipants;
383 $this->arrFilter = array();
394 $this->arrFilter = array($by => $text);
409 $this->participants[$active_id] = $participant;
414 return $this->participants[$active_id];
419 return array_key_exists($active_id, $this->participants);
424 unset($this->participants[$active_id]);
434 return array_keys($this->participants);
440 if (is_numeric(
$pass))
442 $result = $ilDB->queryF(
"SELECT * FROM tst_times WHERE active_fi = %s AND pass = %s",
443 array(
'integer',
'integer'),
444 array($active_id,
$pass)
449 $result = $ilDB->queryF(
"SELECT * FROM tst_times WHERE active_fi = %s",
460 $result = $ilDB->queryF(
"SELECT tst_times.* FROM tst_times, tst_active WHERE tst_times.active_fi = tst_active.active_id AND tst_active.test_fi = %s",
471 while (
$row = $ilDB->fetchAssoc($result))
473 if (!array_key_exists(
$row[
'question_fi'],
$data))
477 if (!array_key_exists(
$row[
'pass'],
$data[
$row[
'question_fi']]))
479 $data[$row[
'question_fi']][$row[
'pass']] = array();
481 if (!array_key_exists($row[
'active_fi'],
$data[$row[
'question_fi']][$row[
'pass']]))
483 $data[$row[
'question_fi']][$row[
'pass']][$row[
'active_fi']] = array();
485 preg_match(
"/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row[
"started"], $matches);
486 $epoch_1 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
487 preg_match(
"/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/", $row[
"finished"], $matches);
488 $epoch_2 = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
489 $timeInSeconds = ($epoch_2 - $epoch_1);
490 array_push(
$data[$row[
'question_fi']][$row[
'pass']][$row[
'active_fi']], $timeInSeconds);