86 return array(
'questionTitles',
'participants',
'statistics',
'filterby',
'filtertext',
'datasets',
'test');
96 $this->participants = array();
97 $this->questionTitles = array();
107 $this->participants = array();
110 include_once
"./Modules/Test/classes/class.ilTestEvaluationPassData.php";
111 include_once
"./Modules/Test/classes/class.ilTestEvaluationUserData.php";
112 $query = sprintf(
"SELECT usr_data.usr_id, usr_data.firstname, usr_data.lastname, usr_data.title, usr_data.login, " .
113 "tst_test_pass_result.* FROM tst_test_pass_result, tst_active " .
114 "LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id " .
115 "WHERE tst_active.active_id = tst_test_pass_result.active_fi " .
116 "AND tst_active.test_fi = %s " .
117 "ORDER BY usr_data.lastname, usr_data.firstname, active_id, pass, TIMESTAMP",
118 $ilDB->quote($this->getTest()->getTestId() .
"")
120 $ilLog->write($query);
121 $result = $ilDB->query($query);
132 $this->
getParticipant($row[
"active_fi"])->setName($this->
getTest()->buildName($row[
"usr_id"], $row[
"firstname"], $row[
"lastname"], $row[
"title"]));
133 $this->
getParticipant($row[
"active_fi"])->setLogin($row[
"login"]);
134 $this->
getParticipant($row[
"active_fi"])->setUserID($row[
"usr_id"]);
136 if (!is_object($this->
getParticipant($row[
"active_fi"])->getPass($row[
"pass"])))
139 $pass->setPass($row[
"pass"]);
142 $this->
getParticipant($row[
"active_fi"])->getPass($row[
"pass"])->setReachedPoints($row[
"points"]);
143 if ($row[
"questioncount"] == 0)
146 $this->
getParticipant($row[
"active_fi"])->getPass($row[
"pass"])->setMaxPoints(
$data[
'points']);
147 $this->
getParticipant($row[
"active_fi"])->getPass($row[
"pass"])->setQuestionCount(
$data[
'count']);
151 $this->
getParticipant($row[
"active_fi"])->getPass($row[
"pass"])->setMaxPoints($row[
"maxpoints"]);
152 $this->
getParticipant($row[
"active_fi"])->getPass($row[
"pass"])->setQuestionCount($row[
"questioncount"]);
154 $this->
getParticipant($row[
"active_fi"])->getPass($row[
"pass"])->setNrOfAnsweredQuestions($row[
"answeredquestions"]);
155 $this->
getParticipant($row[
"active_fi"])->getPass($row[
"pass"])->setWorkingTime($row[
"workingtime"]);
166 $this->test =&
$test;
181 $this->questionTitles[$question_id] = $question_title;
191 if (array_key_exists($question_id, $this->questionTitles))
193 return $this->questionTitles[$question_id];
203 include_once
"./Modules/Test/classes/class.ilTestStatistics.php";
211 $query =
"SELECT DISTINCT obd.obj_id,obr.ref_id FROM rbac_ua AS ua ".
212 "JOIN rbac_fa AS fa ON ua.rol_id = fa.rol_id ".
213 "JOIN tree AS t1 ON t1.child = fa.parent ".
214 "JOIN object_reference AS obr ON t1.parent = obr.ref_id ".
215 "JOIN object_data AS obd ON obr.obj_id = obd.obj_id ".
216 "WHERE obd.type = ".$ilDB->quote($a_type).
" ".
217 "AND fa.assign = 'y' ".
218 "AND ua.usr_id = ".$ilDB->quote($a_usr_id).
" ";
219 $res = $ilDB->query($query);
223 $ref_ids[] = $row->obj_id;
226 return $ref_ids ? $ref_ids : array();
231 if (strlen($this->filterby) && strlen($this->filtertext))
233 $filteredParticipants = array();
234 $courseids = array();
237 switch ($this->filterby)
240 $query = sprintf(
"SELECT obj_id FROM object_data WHERE type = 'grp' AND title LIKE %s",
241 $ilDB->quote(
"%" . $this->filtertext .
"%")
243 $result = $ilDB->query($query);
246 array_push($groupids, $row[
"obj_id"]);
250 $query = sprintf(
"SELECT obj_id FROM object_data WHERE type = 'crs' AND title LIKE %s",
251 $ilDB->quote(
"%" . $this->filtertext .
"%")
253 $result = $ilDB->query($query);
256 array_push($courseids, $row[
"obj_id"]);
260 foreach ($this->participants as $active_id => $participant)
263 switch ($this->filterby)
266 if (!(strpos(strtolower($participant->getName()), strtolower($this->filtertext)) !== FALSE)) $remove = TRUE;
270 $foundfilter = FALSE;
271 if (count(array_intersect($groupids, $groups))) $foundfilter = TRUE;
272 if (!$foundfilter) $remove = TRUE;
276 $foundfilter = FALSE;
277 if (count(array_intersect($courseids, $courses))) $foundfilter = TRUE;
278 if (!$foundfilter) $remove = TRUE;
281 if (!$remove) $filteredParticipants[$active_id] = $participant;
283 return $filteredParticipants;
293 $this->filterby =
"";
294 $this->filtertext =
"";
305 $this->filterby = $by;
306 $this->filtertext = $text;
311 $this->participants[$active_id] = $participant;
316 return $this->participants[$active_id];
321 return array_key_exists($active_id, $this->participants);
326 unset($this->participants[$active_id]);
336 return array_keys($this->participants);