4require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
5require_once
'./Modules/Test/classes/class.ilTestServiceGUI.php';
6require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
39 parent::ilTestServiceGUI($a_object);
47 $cmd = $this->ctrl->getCmd();
48 $next_class = $this->ctrl->getNextClass($this);
49 $this->ctrl->saveParameter($this,
"sequence");
50 $this->ctrl->saveParameter($this,
"active_id");
54 case 'iltestpassdetailsoverviewtablegui':
55 require_once
'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
58 $tableGUI->initFilter();
59 $this->ctrl->forwardCommand($tableGUI);
71 $headernames = array();
72 if ($this->object->getAnonymity())
74 array_push($headernames, $this->lng->txt(
"counter"));
78 array_push($headernames, $this->lng->txt(
"name"));
79 array_push($headernames, $this->lng->txt(
"login"));
81 $additionalFields = $this->
object->getEvaluationAdditionalFields();
82 if (count($additionalFields))
84 foreach ($additionalFields as $fieldname)
86 array_push($headernames, $this->lng->txt($fieldname));
89 array_push($headernames, $this->lng->txt(
"tst_reached_points"));
90 array_push($headernames, $this->lng->txt(
"tst_mark"));
91 if ($this->object->getECTSOutput())
93 array_push($headernames, $this->lng->txt(
"ects_grade"));
95 array_push($headernames, $this->lng->txt(
"tst_answered_questions"));
96 array_push($headernames, $this->lng->txt(
"working_time"));
97 array_push($headernames, $this->lng->txt(
"detailed_evaluation"));
103 $headervars = array();
104 if ($this->object->getAnonymity())
106 array_push($headervars,
"counter");
110 array_push($headervars,
"name");
111 array_push($headervars,
"login");
113 array_push($headervars,
"resultspoints");
114 array_push($headervars,
"resultsmarks");
115 if ($this->object->getECTSOutput())
117 array_push($headervars,
"ects_grade");
119 array_push($headervars,
"qworkedthrough");
120 array_push($headervars,
"timeofwork");
121 array_push($headervars,
"");
127 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
129 $table_gui->writeFilterToSession();
130 $this->ctrl->redirect($this,
"outEvaluation");
135 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
137 $table_gui->resetFilter();
138 $this->ctrl->redirect($this,
"outEvaluation");
146 function outEvaluation()
152 global $ilAccess, $ilToolbar;
154 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
158 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
161 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
164 $this,
'outEvaluation', $this->object->getAnonymity(), $this->object->isOfferingQuestionHintsEnabled()
168 $arrFilter = array();
170 foreach ($table_gui->getFilterItems() as $item)
172 if ($item->getValue() !==
false)
174 switch ($item->getPostVar())
179 $arrFilter[$item->getPostVar()] = $item->getValue();
182 $passedonly = $item->getChecked();
187 include_once
"./Modules/Test/classes/class.ilTestEvaluationData.php";
189 $eval->setFilterArray($arrFilter);
190 $foundParticipants =& $eval->getParticipants();
192 if (count($foundParticipants) > 0)
194 if ($this->object->getECTSOutput())
196 $passed_array =& $this->
object->getTotalPointsPassedArray();
198 foreach ($foundParticipants as $active_id => $userdata)
205 $mark_obj = $this->
object->getMarkSchema()->getMatchingMark($userdata->getReachedPointsInPercent());
207 if( $mark_obj->getPassed() == FALSE || !$userdata->areObligationsAnswered() )
215 $evaluationrow = array();
216 if ($this->object->getAnonymity())
218 $evaluationrow[
'name'] = $counter;
219 $evaluationrow[
'login'] =
'';
223 $evaluationrow[
'name'] = $userdata->getName();
224 if (strlen($userdata->getLogin()))
226 $evaluationrow[
'login'] =
"[" . $userdata->getLogin() .
"]";
230 $evaluationrow[
'login'] =
'';
234 $evaluationrow[
'reached'] = $userdata->getReached();
235 $evaluationrow[
'max'] = $userdata->getMaxpoints();
236 $evaluationrow[
'hint_count'] = $userdata->getRequestedHintsCountFromScoredPass();
237 $percentage = $userdata->getReachedPointsInPercent();
238 $mark = $this->
object->getMarkSchema()->getMatchingMark($percentage);
239 if (is_object($mark))
241 $evaluationrow[
'mark'] = $mark->getShortName();
243 if ($this->object->getECTSOutput())
245 $ects_mark = $this->
object->getECTSGrade($passed_array, $userdata->getReached(), $userdata->getMaxPoints());
246 $evaluationrow[
'ects_grade'] = $ects_mark;
248 $evaluationrow[
'answered'] = $userdata->getQuestionsWorkedThroughInPercent();
249 $evaluationrow[
'questions_worked_through'] = $userdata->getQuestionsWorkedThrough();
250 $evaluationrow[
'number_of_questions'] = $userdata->getNumberOfQuestions();
251 $time_seconds = $userdata->getTimeOfWork();
252 $time_hours = floor($time_seconds/3600);
253 $time_seconds -= $time_hours * 3600;
254 $time_minutes = floor($time_seconds/60);
255 $time_seconds -= $time_minutes * 60;
256 $evaluationrow[
'working_time'] = sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds);
257 $this->ctrl->setParameter($this,
"active_id", $active_id);
258 $href = $this->ctrl->getLinkTarget($this,
"detailedEvaluation");
259 $detailed_evaluation = $this->lng->txt(
"detailed_evaluation_show");
260 $evaluationrow[
'details'] =
"<a class=\"il_ContainerItemCommand\" href=\"$href\">$detailed_evaluation</a>";
262 $evaluationrow[
'gender'] = $userfields[
'gender'];
263 $evaluationrow[
'email'] = $userfields[
'email'];
264 $evaluationrow[
'institution'] = $userfields[
'institution'];
265 $evaluationrow[
'street'] = $userfields[
'street'];
266 $evaluationrow[
'city'] = $userfields[
'city'];
267 $evaluationrow[
'zipcode'] = $userfields[
'zipcode'];
268 $evaluationrow[
'country'] = $userfields[
'country'];
269 $evaluationrow[
'sel_country'] = $userfields[
'sel_country'];
270 $evaluationrow[
'department'] = $userfields[
'department'];
271 $evaluationrow[
'matriculation'] = $userfields[
'matriculation'];
273 $data[] = $evaluationrow;
278 $table_gui->setData(
$data);
279 if(count($foundParticipants) > 0)
281 $ilToolbar->setFormName(
'form_output_eval');
282 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
'exportEvaluation'));
283 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
284 $export_type =
new ilSelectInputGUI($this->lng->txt(
'exp_eval_data'),
'export_type');
286 'excel' => $this->lng->txt(
'exp_type_excel'),
287 'csv' => $this->lng->txt(
'exp_type_spss')
290 if(!$this->object->getAnonymity())
292 include_once
'Services/Certificate/classes/class.ilCertificate.php';
293 include_once
'Modules/Test/classes/class.ilTestCertificateAdapter.php';
296 $options[
'certificate'] = $this->lng->txt(
'exp_type_certificate');
302 $ilToolbar->addInputItem($export_type,
true);
303 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
305 $button->setCommand(
'exportEvaluation');
306 $button->setCaption(
'export');
307 $button->getOmitPreventDoubleSubmission();
308 $ilToolbar->addButtonInstance($button);
312 if ($this->object->getShowSolutionAnswersOnly())
317 $this->tpl->setContent($table_gui->getHTML());
331 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
334 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
337 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_evaluation_details.html",
"Modules/Test");
339 $active_id =
$_GET[
"active_id"];
340 if (strlen($active_id) == 0)
342 ilUtil::sendInfo($this->lng->txt(
"detailed_evaluation_missing_active_id"), TRUE);
343 $this->ctrl->redirect($this,
"outEvaluation");
348 $data =& $this->
object->getCompleteEvaluationData();
349 $this->tpl->setVariable(
"TEXT_BACK", $this->lng->txt(
"back"));
350 $this->tpl->setVariable(
"URL_BACK", $this->ctrl->getLinkTarget($this,
"outEvaluation"));
351 $this->tpl->setVariable(
"HEADING_DETAILED_EVALUATION", sprintf($this->lng->txt(
"detailed_evaluation_for"),
352 $data->getParticipant($active_id)->getName())
354 $this->tpl->setVariable(
"STATISTICAL_DATA", $this->lng->txt(
"statistical_data"));
355 $this->tpl->setVariable(
"TXT_RESULTSPOINTS", $this->lng->txt(
"tst_stat_result_resultspoints"));
356 $this->tpl->setVariable(
"VALUE_RESULTSPOINTS",
$data->getParticipant($active_id)->getReached() .
" " . strtolower($this->lng->txt(
"of")) .
" " .
$data->getParticipant($active_id)->getMaxpoints() .
" (" . sprintf(
"%2.2f",
$data->getParticipant($active_id)->getReachedPointsInPercent()) .
" %" .
")");
357 if (strlen(
$data->getParticipant($active_id)->getMark()))
359 $this->tpl->setVariable(
"TXT_RESULTSMARKS", $this->lng->txt(
"tst_stat_result_resultsmarks"));
360 $this->tpl->setVariable(
"VALUE_RESULTSMARKS",
$data->getParticipant($active_id)->getMark());
361 if (strlen(
$data->getParticipant($active_id)->getECTSMark()))
363 $this->tpl->setVariable(
"TXT_ECTS", $this->lng->txt(
"ects_grade"));
364 $this->tpl->setVariable(
"VALUE_ECTS",
$data->getParticipant($active_id)->getECTSMark());
368 if( $this->object->isOfferingQuestionHintsEnabled() )
370 $this->tpl->setVariable(
"TXT_REQUESTED_HINTS_COUNT", $this->lng->txt(
"tst_question_hints_requested_hint_count_header"));
371 $this->tpl->setVariable(
"VALUE_REQUESTED_HINTS_COUNT",
$data->getParticipant($active_id)->getRequestedHintsCountFromScoredPass());
374 $this->tpl->setVariable(
"TXT_QWORKEDTHROUGH", $this->lng->txt(
"tst_stat_result_qworkedthrough"));
375 $this->tpl->setVariable(
"VALUE_QWORKEDTHROUGH",
$data->getParticipant($active_id)->getQuestionsWorkedThrough() .
" " . strtolower($this->lng->txt(
"of")) .
" " .
$data->getParticipant($active_id)->getNumberOfQuestions() .
" (" . sprintf(
"%2.2f",
$data->getParticipant($active_id)->getQuestionsWorkedThroughInPercent()) .
" %" .
")");
377 $this->tpl->setVariable(
"TXT_TIMEOFWORK", $this->lng->txt(
"tst_stat_result_timeofwork"));
378 $time_seconds =
$data->getParticipant($active_id)->getTimeOfWork();
379 $atime_seconds =
$data->getParticipant($active_id)->getNumberOfQuestions() ? $time_seconds /
$data->getParticipant($active_id)->getNumberOfQuestions() : 0;
380 $time_hours = floor($time_seconds/3600);
381 $time_seconds -= $time_hours * 3600;
382 $time_minutes = floor($time_seconds/60);
383 $time_seconds -= $time_minutes * 60;
384 $this->tpl->setVariable(
"VALUE_TIMEOFWORK", sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
385 $this->tpl->setVariable(
"TXT_ATIMEOFWORK", $this->lng->txt(
"tst_stat_result_atimeofwork"));
386 $time_hours = floor($atime_seconds/3600);
387 $atime_seconds -= $time_hours * 3600;
388 $time_minutes = floor($atime_seconds/60);
389 $atime_seconds -= $time_minutes * 60;
390 $this->tpl->setVariable(
"VALUE_ATIMEOFWORK", sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $atime_seconds));
391 $this->tpl->setVariable(
"TXT_FIRSTVISIT", $this->lng->txt(
"tst_stat_result_firstvisit"));
392 #$this->tpl->setVariable("VALUE_FIRSTVISIT",
393 # date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], $data->getParticipant($active_id)->getFirstVisit())
397 $this->tpl->setVariable(
"TXT_LASTVISIT", $this->lng->txt(
"tst_stat_result_lastvisit"));
398 #$this->tpl->setVariable("VALUE_LASTVISIT",
399 # date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], $data->getParticipant($active_id)->getLastVisit())
404 $this->tpl->setVariable(
"TXT_NROFPASSES", $this->lng->txt(
"tst_nr_of_passes"));
405 $this->tpl->setVariable(
"VALUE_NROFPASSES",
$data->getParticipant($active_id)->getLastPass() + 1);
406 $this->tpl->setVariable(
"TXT_SCOREDPASS", $this->lng->txt(
"scored_pass"));
409 $this->tpl->setVariable(
"VALUE_SCOREDPASS",
$data->getParticipant($active_id)->getBestPass() + 1);
413 $this->tpl->setVariable(
"VALUE_SCOREDPASS",
$data->getParticipant($active_id)->getLastPass() + 1);
416 $median =
$data->getStatistics()->getStatistics()->median();
417 $pct =
$data->getParticipant($active_id)->getMaxpoints() ? ($median /
$data->getParticipant($active_id)->getMaxpoints()) * 100.0 : 0;
418 $mark = $this->
object->mark_schema->getMatchingMark($pct);
419 if (is_object($mark))
421 $this->tpl->setVariable(
"TXT_MARK_MEDIAN", $this->lng->txt(
"tst_stat_result_mark_median"));
422 $this->tpl->setVariable(
"VALUE_MARK_MEDIAN", $mark->getShortName());
425 $this->tpl->setVariable(
"TXT_RANK_PARTICIPANT", $this->lng->txt(
"tst_stat_result_rank_participant"));
426 $this->tpl->setVariable(
"VALUE_RANK_PARTICIPANT",
$data->getStatistics()->getStatistics()->rank(
$data->getParticipant($active_id)->getReached()));
427 $this->tpl->setVariable(
"TXT_RANK_MEDIAN", $this->lng->txt(
"tst_stat_result_rank_median"));
428 $this->tpl->setVariable(
"VALUE_RANK_MEDIAN",
$data->getStatistics()->getStatistics()->rank_median());
429 $this->tpl->setVariable(
"TXT_TOTAL_PARTICIPANTS", $this->lng->txt(
"tst_stat_result_total_participants"));
430 $this->tpl->setVariable(
"VALUE_TOTAL_PARTICIPANTS",
$data->getStatistics()->getStatistics()->count());
431 $this->tpl->setVariable(
"TXT_RESULT_MEDIAN", $this->lng->txt(
"tst_stat_result_median"));
432 $this->tpl->setVariable(
"VALUE_RESULT_MEDIAN", $median);
436 $finishdate = $this->
object->getPassFinishDate($active_id,
$pass);
439 $this->tpl->setCurrentBlock(
"question_header");
440 $this->tpl->setVariable(
"TXT_QUESTION_DATA", sprintf($this->lng->txt(
"tst_eval_question_points"),
$pass+1));
441 $this->tpl->parseCurrentBlock();
443 if (($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])))
445 $this->tpl->setCurrentBlock(
"question_footer");
446 $this->tpl->setVariable(
"TEXT_TO_DETAILED_RESULTS", $this->lng->txt(
"tst_show_answer_sheet"));
447 $this->ctrl->setParameter($this,
"statistics",
"1");
448 $this->ctrl->setParameter($this,
"active_id", $active_id);
449 $this->ctrl->setParameter($this,
"pass",
$pass);
450 $this->tpl->setVariable(
"URL_TO_DETAILED_RESULTS", $this->ctrl->getLinkTarget($this,
"outParticipantsPassDetails"));
451 $this->tpl->parseCurrentBlock();
453 $questions =
$data->getParticipant($active_id)->getQuestions(
$pass);
454 if (!is_array($questions))
456 $questions =
$data->getParticipant($active_id)->getQuestions(0);
459 foreach ((array)$questions as $question)
461 $this->tpl->setCurrentBlock(
"question_row");
462 $this->tpl->setVariable(
"QUESTION_COUNTER", $counter);
463 $this->tpl->setVariable(
"QUESTION_ID", $question[
"id"]);
464 $this->tpl->setVariable(
"QUESTION_ID_TXT", $this->lng->txt(
'question_id_short'));
465 $this->tpl->setVariable(
"QUESTION_TITLE",
$data->getQuestionTitle($question[
"id"]));
466 $answeredquestion =
$data->getParticipant($active_id)->getPass(
$pass)->getAnsweredQuestionByQuestionId($question[
"id"]);
467 if (is_array($answeredquestion))
469 $percent = $answeredquestion[
"points"] ? $answeredquestion[
"reached"] / $answeredquestion[
"points"] * 100.0 : 0;
470 $this->tpl->setVariable(
"QUESTION_POINTS", $answeredquestion[
"reached"] .
" " . strtolower($this->lng->txt(
"of")) .
" " . $answeredquestion[
"points"] .
" (" . sprintf(
"%.2f", $percent) .
" %)");
474 $this->tpl->setVariable(
"QUESTION_POINTS",
"0 " . strtolower($this->lng->txt(
"of")) .
" " . $question[
"points"] .
" (" . sprintf(
"%.2f", 0) .
" %) - " . $this->lng->txt(
"question_not_answered"));
476 $this->tpl->parseCurrentBlock();
479 $this->tpl->touchBlock(
"question_stats");
499 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
503 $question_object->getFileUploadZIPFile($this->object->getTestId());
507 $this->ctrl->redirect($this,
"singleResults");
524 global $ilAccess, $ilToolbar;
526 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
530 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
533 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_anonymous_aggregation.html",
"Modules/Test");
534 $eval =& $this->
object->getCompleteEvaluationData();
536 $foundParticipants =& $eval->getParticipants();
537 if (count($foundParticipants))
539 $ilToolbar->setFormName(
'form_output_eval');
540 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
'exportAggregatedResults'));
541 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
542 $export_type =
new ilSelectInputGUI($this->lng->txt(
'exp_eval_data'),
'export_type');
543 $export_type->setOptions(array(
544 'excel' => $this->lng->txt(
'exp_type_excel'),
545 'csv' => $this->lng->txt(
'exp_type_spss')
547 $ilToolbar->addInputItem($export_type,
true);
548 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
550 $button->setCommand(
'exportAggregatedResults');
551 $button->setCaption(
'export');
552 $button->getOmitPreventDoubleSubmission();
553 $ilToolbar->addButtonInstance($button);
555 array_push(
$data, array(
556 'result' => $this->lng->txt(
"tst_eval_total_persons"),
557 'value' => count($foundParticipants)
559 $total_finished = $this->
object->evalTotalFinished();
560 array_push(
$data, array(
561 'result' => $this->lng->txt(
"tst_eval_total_finished"),
562 'value' => $total_finished
564 $average_time = $this->
object->evalTotalStartedAverageTime();
565 $diff_seconds = $average_time;
566 $diff_hours = floor($diff_seconds/3600);
567 $diff_seconds -= $diff_hours * 3600;
568 $diff_minutes = floor($diff_seconds/60);
569 $diff_seconds -= $diff_minutes * 60;
570 array_push(
$data, array(
571 'result' => $this->lng->txt(
"tst_eval_total_finished_average_time"),
572 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
575 $total_passed_reached = 0;
576 $total_passed_max = 0;
577 $total_passed_time = 0;
578 foreach ($foundParticipants as $userdata)
580 if ($userdata->getPassed())
583 $total_passed_reached += $userdata->getReached();
584 $total_passed_max += $userdata->getMaxpoints();
585 $total_passed_time += $userdata->getTimeOfWork();
588 $average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
589 $average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
590 $average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
591 array_push(
$data, array(
592 'result' => $this->lng->txt(
"tst_eval_total_passed"),
593 'value' => $total_passed
595 array_push(
$data, array(
596 'result' => $this->lng->txt(
"tst_eval_total_passed_average_points"),
597 'value' => sprintf(
"%2.2f", $average_passed_reached) .
" " . strtolower($this->lng->txt(
"of")) .
" " . sprintf(
"%2.2f", $average_passed_max)
599 $average_time = $average_passed_time;
600 $diff_seconds = $average_time;
601 $diff_hours = floor($diff_seconds/3600);
602 $diff_seconds -= $diff_hours * 3600;
603 $diff_minutes = floor($diff_seconds/60);
604 $diff_seconds -= $diff_minutes * 60;
605 array_push(
$data, array(
606 'result' => $this->lng->txt(
"tst_eval_total_passed_average_time"),
607 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
611 include_once
"./Modules/Test/classes/tables/class.ilTestAggregatedResultsTableGUI.php";
613 $table_gui->setData(
$data);
614 $this->tpl->setVariable(
'AGGREGATED_RESULTS', $table_gui->getHTML());
617 foreach ($eval->getQuestionTitles() as $question_id => $question_title)
622 foreach ($foundParticipants as $userdata)
624 for ($i = 0; $i <= $userdata->getLastPass(); $i++)
626 if (is_object($userdata->getPass($i)))
628 $question =& $userdata->getPass($i)->getAnsweredQuestionByQuestionId($question_id);
629 if (is_array($question))
632 $reached += $question[
"reached"];
633 $max += $question[
"points"];
638 $percent = $max ? $reached/$max * 100.0 : 0;
640 $this->ctrl->setParameter($this,
"qid", $question_id);
642 $points_reached = ($answered ? $reached / $answered : 0);
643 $points_max = ($answered ? $max / $answered : 0);
646 'qid' => $question_id,
647 'title' => $question_title,
648 'points' => $points_reached,
649 'points_reached' => $points_reached,
650 'points_max' => $points_max,
651 'percentage' => (
float)$percent,
652 'answers' => $answered
656 include_once
"./Modules/Test/classes/tables/class.ilTestAverageReachedPointsTableGUI.php";
658 $table_gui->setData($rows);
659 $this->tpl->setVariable(
'TBL_AVG_REACHED', $table_gui->getHTML());
668 if (array_key_exists(
"g_filterby",
$_GET))
670 $filterby =
$_GET[
"g_filterby"];
674 if (array_key_exists(
"g_userfilter",
$_GET))
676 $filtertext =
$_GET[
"g_userfilter"];
680 if (array_key_exists(
"g_passedonly",
$_GET))
682 if (
$_GET[
"g_passedonly"] == 1)
688 switch (
$_POST[
"export_type"])
691 require_once
'./Modules/Test/classes/class.ilTestExport.php';
692 $exportObj =
new ilTestExport($this->
object,
"results");
693 $exportObj->exportToExcel($deliver = TRUE, $filterby, $filtertext, $passedonly);
697 require_once
'./Modules/Test/classes/class.ilTestExport.php';
698 $exportObj =
new ilTestExport($this->
object,
"results");
699 $exportObj->exportToCSV($deliver = TRUE, $filterby, $filtertext, $passedonly);
705 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_passedonly",
"1");
707 if (strlen($filtertext))
709 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_userfilter", $filtertext);
711 $this->ctrl->redirect($this,
"exportCertificate");
723 switch (
$_POST[
"export_type"])
726 include_once
"./Modules/Test/classes/class.ilTestExport.php";
727 $exportObj =
new ilTestExport($this->
object,
"aggregated");
728 $exportObj->exportToExcel($deliver = TRUE);
731 include_once
"./Modules/Test/classes/class.ilTestExport.php";
732 $exportObj =
new ilTestExport($this->
object,
"aggregated");
733 $exportObj->exportToCSV($deliver = TRUE);
748 include_once
"./Services/Utilities/classes/class.ilUtil.php";
749 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
750 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
752 $archive_dir = $certificate->createArchiveDirectory();
753 $total_users = array();
754 $total_users =& $this->
object->evalTotalPersonsArray();
755 if (count($total_users))
757 foreach ($total_users as $active_id => $name)
759 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
760 $pdf = $certificate->outCertificate(
762 "active_id" => $active_id,
763 "userfilter" => $userfilter,
764 "passedonly" => $passedonly
770 $certificate->addPDFtoArchiveDirectory($pdf, $archive_dir, $user_id .
"_" . str_replace(
" ",
"_",
ilUtil::getASCIIFilename($name)) .
".pdf");
773 $zipArchive = $certificate->zipCertificatesInArchiveDirectory($archive_dir, TRUE);
786 if ($original_id > 0)
805 global $ilTabs, $ilAccess;
807 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
811 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
814 $this->ctrl->saveParameter($this,
"active_id");
815 $active_id = (int)
$_GET[
"active_id"];
816 $testSession = $this->testSessionFactory->getSession($active_id);
819 if( $testSession->getTestId() != $this->
object->getTestId() )
822 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
825 $this->ctrl->saveParameter($this,
"pass");
828 if ( isset(
$_GET[
'statistics']) &&
$_GET[
'statistics'] == 1)
830 $this->ctrl->setParameterByClass(
"ilTestEvaluationGUI",
"active_id", $active_id);
832 $ilTabs->setBackTarget(
833 $this->lng->txt(
'back'), $this->ctrl->getLinkTargetByClass(
'ilTestEvaluationGUI',
'detailedEvaluation')
836 elseif ($this->object->getNrOfTries() == 1)
838 $ilTabs->setBackTarget(
839 $this->lng->txt(
'back'), $this->ctrl->getLinkTargetByClass(
'ilobjtestgui',
'participants')
844 $ilTabs->setBackTarget(
845 $this->lng->txt(
'tst_results_back_overview'), $this->ctrl->getLinkTarget($this,
'outParticipantsResultsOverview')
849 $result_array =& $this->
object->getTestResult($active_id,
$pass);
853 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
855 $template =
new ilTemplate(
"tpl.il_as_tst_pass_details_overview_participants.html", TRUE, TRUE,
"Modules/Test");
857 require_once
'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
860 $this->ctrl->setParameter($this,
'pdf',
'1');
861 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails') );
862 $this->ctrl->setParameter($this,
'pdf',
'');
864 if( isset(
$_GET[
'show_best_solutions']) )
866 $_SESSION[
'tst_results_show_best_solutions'] =
true;
868 elseif( isset(
$_GET[
'hide_best_solutions']) )
870 $_SESSION[
'tst_results_show_best_solutions'] =
false;
872 elseif( !isset(
$_SESSION[
'tst_results_show_best_solutions']) )
874 $_SESSION[
'tst_results_show_best_solutions'] =
false;
877 if(
$_SESSION[
'tst_results_show_best_solutions'] )
879 $this->ctrl->setParameter($this,
'hide_best_solutions',
'1');
880 $toolbar->setHideBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
881 $this->ctrl->setParameter($this,
'hide_best_solutions',
'');
885 $this->ctrl->setParameter($this,
'show_best_solutions',
'1');
886 $toolbar->setShowBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
887 $this->ctrl->setParameter($this,
'show_best_solutions',
'');
891 $template->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
895 $template->setCurrentBlock(
'grading_message');
897 $template->parseCurrentBlock();
901 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
902 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
903 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
904 $template->setVariable(
"PASS_DETAILS", $overview);
905 $template->setVariable(
"USER_DATA", $user_data);
906 $uname = $this->
object->userLookupFullName($user_id);
907 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
910 if ($this->object->getShowSolutionAnswersOnly())
918 require_once
'class.ilTestPDFGenerator.php';
923 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
934 global $ilTabs, $ilAccess;
936 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
940 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
943 $active_id = (int)
$_GET[
"active_id"];
944 $testSession = $this->testSessionFactory->getSession($active_id);
947 if( $testSession->getTestId() != $this->
object->getTestId() )
950 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
953 if ($this->object->getNrOfTries() == 1)
955 $this->ctrl->setParameter($this,
"active_id", $active_id);
957 $this->ctrl->redirect($this,
"outParticipantsPassDetails");
960 $ilTabs->setBackTarget(
961 $this->lng->txt(
'back'), $this->ctrl->getLinkTargetByClass(
'ilobjtestgui',
'participants')
964 $template =
new ilTemplate(
"tpl.il_as_tst_pass_overview_participants.html", TRUE, TRUE,
"Modules/Test");
966 require_once
'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
969 $this->ctrl->setParameter($this,
'pdf',
'1');
970 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this, __FUNCTION__) );
971 $this->ctrl->setParameter($this,
'pdf',
'');
974 $template->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
976 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outParticipantsPassDetails",
false,
false,
true);
977 $template->setVariable(
"PASS_OVERVIEW", $overview);
979 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
981 $template->setVariable(
"USER_DATA", $user_data);
982 $template->setVariable(
"TEXT_OVERVIEW", $this->lng->txt(
"tst_results_overview"));
986 $template->setCurrentBlock(
'grading_message');
988 $template->parseCurrentBlock();
991 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
992 $template->parseCurrentBlock();
995 if ($this->object->getShowSolutionAnswersOnly())
1000 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
1005 $filename = $name[
'lastname'] .
'_' . $name[
'firstname'] .
'_' . $name[
'login'] .
'__'. $this->
object->getTitle();
1006 require_once
'class.ilTestPDFGenerator.php';
1013 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1020 $tableGUI->initFilter();
1021 $tableGUI->resetOffset();
1022 $tableGUI->writeFilterToSession();
1029 $tableGUI->initFilter();
1030 $tableGUI->resetOffset();
1031 $tableGUI->resetFilter();
1044 if ($this->object->getNrOfTries() == 1)
1046 $ilTabs->setBackTarget($this->lng->txt(
'tst_results_back_introduction'), $this->ctrl->getLinkTargetByClass(
'ilObjTestGUI',
'infoScreen'));
1050 $ilTabs->setBackTarget($this->lng->txt(
'tst_results_back_overview'), $this->ctrl->getLinkTarget($this,
'outUserResultsOverview'));
1053 $testSession = $this->testSessionFactory->getSession();
1055 if( !$this->object->getShowPassDetails() )
1057 #$executable = $this->object->isExecutable($testSession, $ilUser->getId());
1059 #if($executable["executable"])
1061 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1065 $active_id = $testSession->getActiveId();
1066 $user_id = $testSession->getUserId();
1068 $this->ctrl->saveParameter($this,
"pass");
1073 $command_solution_details =
"";
1074 if ($this->object->getShowSolutionDetails())
1076 $command_solution_details =
"outCorrectSolution";
1078 $questionAnchorNav = $this->
object->canShowSolutionPrintview();
1080 $tpl =
new ilTemplate(
'tpl.il_as_tst_pass_details_overview_participants.html',
true,
true,
"Modules/Test");
1084 require_once
'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
1087 $this->ctrl->setParameter($this,
'pdf',
'1');
1088 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this,
'outUserPassDetails') );
1089 $this->ctrl->setParameter($this,
'pdf',
'');
1091 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1092 if( $this->object->canShowCertificate($testSession, $user_id, $active_id) )
1094 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this,
'outCertificate'));
1099 $tpl->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1101 $tpl->setCurrentBlock(
'signature');
1103 $tpl->parseCurrentBlock();
1105 if ($this->object->isShowExamIdInTestResultsEnabled())
1107 $tpl->setCurrentBlock(
'exam_id');
1108 $tpl->setVariable(
'EXAM_ID', $this->object->lookupExamId(
1109 $testSession->getActiveId(),
$pass
1111 $tpl->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1112 $tpl->parseCurrentBlock();
1118 $tpl->setCurrentBlock(
'grading_message');
1120 $tpl->parseCurrentBlock();
1124 $result_array, $active_id,
$pass, $this,
"outUserPassDetails", $command_solution_details, $questionAnchorNav
1126 $tpl->setVariable(
"PASS_DETAILS", $overview);
1128 if( $this->object->canShowSolutionPrintview() )
1131 $result_array, $active_id,
$pass, $this->object->getShowSolutionListComparison(),
1132 false,
false,
false,
true
1134 $tpl->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1137 $tpl->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results"));
1138 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1140 $uname = $this->
object->userLookupFullName($user_id, TRUE);
1142 if ($this->object->getAnonymity())
1144 $tpl->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result_pass"));
1148 $tpl->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
1149 $tpl->setVariable(
"USER_DATA", $user_data);
1153 if ($this->object->getShowSolutionAnswersOnly())
1160 require_once
'class.ilTestPDFGenerator.php';
1165 $this->tpl->setContent(
$tpl->get());
1178 $ilTabs->setBackTarget(
1179 $this->lng->txt(
'tst_results_back_introduction'),
1180 $this->ctrl->getLinkTargetByClass(
'ilObjTestGUI',
'infoScreen')
1183 $testSession = $this->testSessionFactory->getSession();
1184 $active_id = $testSession->getActiveId();
1186 $uname = $this->
object->userLookupFullName($user_id, TRUE);
1188 if( !$this->object->canShowTestResults($testSession,
$ilUser->getId()) )
1190 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1193 $templatehead =
new ilTemplate(
"tpl.il_as_tst_results_participants.html", TRUE, TRUE,
"Modules/Test");
1194 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html", TRUE, TRUE,
"Modules/Test");
1196 require_once
'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
1199 $this->ctrl->setParameter($this,
'pdf',
'1');
1200 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this,
'outUserResultsOverview') );
1201 $this->ctrl->setParameter($this,
'pdf',
'');
1203 include_once
'./Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1204 if( $this->object->canShowCertificate($testSession, $user_id, $active_id) )
1206 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this,
'outCertificate'));
1211 $templatehead->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1213 $hide_details = !$this->
object->getShowPassDetails();
1216 # $executable = $this->object->isExecutable($testSession, $ilUser->getId());
1217 # if (!$executable["executable"]) $hide_details = FALSE;
1220 $template->setCurrentBlock(
"pass_overview");
1221 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outUserPassDetails", FALSE, $hide_details);
1222 $template->setVariable(
"PASS_OVERVIEW", $overview);
1223 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_results_overview"));
1224 $template->parseCurrentBlock();
1228 if ($this->object->getAnonymity()) {
1229 $template->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result"));
1232 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1233 $template->setVariable(
"USER_DATA", $user_data);
1238 $template->setCurrentBlock(
'grading_message');
1239 $template->setVariable(
'GRADING_MESSAGE', $this->
getGradingMessage($active_id));
1240 $template->parseCurrentBlock();
1244 if ($this->object->getShowSolutionAnswersOnly())
1248 $templatehead->setVariable(
"RESULTS_PARTICIPANT", $template->get());
1253 require_once
'class.ilTestPDFGenerator.php';
1259 $this->tpl->setContent($templatehead->get());
1274 if (!$this->object->getShowSolutionPrintview())
1277 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1280 $template =
new ilTemplate(
"tpl.il_as_tst_info_list_of_answers.html", TRUE, TRUE,
"Modules/Test");
1283 if (array_key_exists(
"pass",
$_GET))
1289 $testSession = $this->testSessionFactory->getSession();
1290 $active_id = $testSession->getActiveId();
1293 if ($this->object->getNrOfTries() == 1)
1299 $overview = $this->
getPassOverview($active_id,
"iltestevaluationgui",
"outUserListOfAnswerPasses", TRUE);
1300 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_passes"));
1301 $template->setVariable(
"PASS_OVERVIEW", $overview);
1308 $result_array =& $this->
object->getTestResult($active_id,
$pass);
1309 $user_id =& $this->
object->_getUserIdFromActiveId($active_id);
1310 $showAllAnswers = TRUE;
1311 if ($this->object->isExecutable($testSession, $user_id))
1313 $showAllAnswers = FALSE;
1316 $template->setVariable(
"PASS_DETAILS", $answers);
1318 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1319 $template->setVariable(
"BACK_TEXT", $this->lng->txt(
"tst_results_back_introduction"));
1320 $template->setVariable(
"BACK_URL", $this->ctrl->getLinkTargetByClass(
"ilobjtestgui",
"infoScreen"));
1321 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1322 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
1325 $template->setVariable(
"USER_DATA", $user_data);
1326 $template->setVariable(
"TEXT_LIST_OF_ANSWERS", $this->lng->txt(
"tst_list_of_answers"));
1327 if (strlen($signature))
1329 $template->setVariable(
"SIGNATURE", $signature);
1331 if (!is_null(
$pass) && $this->object->isShowExamIdInTestResultsEnabled())
1333 $template->setCurrentBlock(
'exam_id_footer');
1334 $template->setVariable(
'EXAM_ID_VAL', $this->object->lookupExamId(
1335 $testSession->getActiveId(),
$pass
1337 $template->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1338 $template->parseCurrentBlock();
1340 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1343 if ($this->object->getShowSolutionAnswersOnly())
1358 if (array_key_exists(
"pass",
$_GET) && (strlen(
$_GET[
"pass"]) > 0))
1360 $this->ctrl->saveParameter($this,
"pass");
1361 $this->ctrl->saveParameter($this,
"active_id");
1362 $this->outTestResults(
false,
$_GET[
"pass"]);
1366 $this->outTestResults(
false);
1377 if( !$this->object->getShowSolutionDetails() )
1380 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1383 $testSession = $this->testSessionFactory->getSession();
1384 $activeId = $testSession->getActiveId();
1386 if( !($activeId > 0) )
1388 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1391 if( !$this->object->canShowTestResults($testSession, $testSession->getUserId()) )
1393 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1396 $this->ctrl->saveParameter($this,
"pass");
1399 $testSequence = $this->testSequenceFactory->getSequenceByPass($testSession,
$pass);
1400 $testSequence->loadFromDb();
1401 $testSequence->loadQuestions();
1403 $questionId = (int)
$_GET[
'evaluation'];
1405 if( !$testSequence->questionExists($questionId) )
1407 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1412 $ilTabs->setBackTarget($this->lng->txt(
"tst_back_to_pass_details"), $this->ctrl->getLinkTarget($this,
'outUserPassDetails'));
1414 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1415 $this->tpl->setCurrentBlock(
"ContentStyle");
1417 $this->tpl->parseCurrentBlock();
1419 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1421 $this->tpl->parseCurrentBlock();
1424 if ($this->object->getShowSolutionAnswersOnly())
1431 $this->tpl->setContent($solution);
1442 if ((!$ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) && (!$ilAccess->checkAccess(
"write",
"", $this->ref_id)))
1446 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1449 $data =& $this->
object->getCompleteEvaluationData();
1450 $color_class = array(
"tblrow1",
"tblrow2");
1452 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_single_answers.html",
"Modules/Test");
1453 $foundParticipants =&
$data->getParticipants();
1454 if (count($foundParticipants) == 0)
1462 foreach (
$data->getQuestionTitles() as $question_id => $question_title)
1467 foreach ($foundParticipants as $userdata)
1469 $pass = $userdata->getScoredPass();
1470 if (is_object($userdata->getPass(
$pass)))
1472 $question =& $userdata->getPass(
$pass)->getAnsweredQuestionByQuestionId($question_id);
1473 if (is_array($question))
1480 $this->ctrl->setParameter($this,
"qid", $question_id);
1481 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
1486 if ($question_object->hasFileUploads($this->object->getTestId()))
1488 $download =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportFileUploadsForAllParticipants").
"\">" . $this->lng->txt(
"download") .
"</a>";
1493 'qid' => $question_id,
1494 'question_title' => $question_title,
1495 'number_of_answers' => $answered,
1496 'output' =>
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportQuestionForAllParticipants") .
"\">" . $this->lng->txt(
"pdf_export") .
"</a>",
1497 'file_uploads' => $download
1503 require_once
'./Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php';
1505 $table_gui->setTitle($this->lng->txt(
"tst_answered_questions_test"));
1506 $table_gui->setData($rows);
1508 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1512 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $this->lng->txt(
"adm_no_special_users"));
1522 $testSession = $this->testSessionFactory->getSession();
1524 require_once
'./Services/Certificate/classes/class.ilCertificate.php';
1525 require_once
'./Modules/Test/classes/class.ilTestCertificateAdapter.php';
1527 $certificate->outCertificate(
1529 "active_id" => $testSession->getActiveId(),
1537 if( !$this->object->isPassDeletionAllowed() )
1539 $this->ctrl->redirect($this,
'outUserResultsOverview');
1542 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1544 if( isset(
$_GET[
'context']) && strlen(
$_GET[
'context']) )
1546 $context =
$_GET[
'context'];
1554 $confirm->build((
int)
$_GET[
'active_id'], (
int)
$_GET[
'pass'], $context);
1557 $tpl->setContent($this->ctrl->getHTML($confirm));
1567 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1573 $this->ctrl->redirect($this,
'outUserResultsOverview');
1577 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
1581 $this->ctrl->redirectByClass(
'ilTestPlayerDynamicQuestionSetGUI',
'startTest');
1585 public function performDeletePass()
1587 if( !$this->object->isPassDeletionAllowed() )
1589 $this->ctrl->redirect($this,
'outUserResultsOverview');
1597 if( isset(
$_POST[
'active_id']) && (
int)
$_POST[
'active_id'] )
1599 $active_fi =
$_POST[
'active_id'];
1602 if( isset(
$_POST[
'pass']) && is_numeric(
$_POST[
'pass']) )
1607 if( is_null($active_fi) || is_null(
$pass) )
1609 $this->ctrl->redirect($this,
'outUserResultsOverview');
1612 if( !$this->object->isDynamicTest() &&
$pass == $this->object->_getResultPass($active_fi) )
1614 $this->ctrl->redirect($this,
'outUserResultsOverview');
1619 SELECT tst_active.tries, tst_active.last_finished_pass, tst_sequence.pass
1621 LEFT JOIN tst_sequence
1622 ON tst_sequence.active_fi = tst_active.active_id
1623 AND tst_sequence.pass = tst_active.tries
1624 WHERE tst_active.active_id = {$ilDB->quote($active_fi, 'integer')}
1629 $tries =
$row[
'tries'];
1630 $lastFinishedPass = is_numeric(
$row[
'last_finished_pass']) ?
$row[
'last_finished_pass'] : -1;
1632 if(
$pass < $lastFinishedPass )
1634 $isActivePass =
false;
1635 $must_renumber =
true;
1637 elseif(
$pass == $lastFinishedPass )
1639 $isActivePass =
false;
1641 if( $tries ==
$row[
'pass'] )
1643 $must_renumber =
true;
1647 $must_renumber =
false;
1652 $isActivePass =
true;
1653 $must_renumber =
false;
1657 throw new ilTestException (
'This should not happen, please contact Bjoern Heyser to clean up this pass salad!');
1660 if( !$this->object->isDynamicTest() && $isActivePass )
1662 $this->ctrl->redirect($this,
'outUserResultsOverview');
1666 ($lastFinishedPass == 0 && $tries == 1 && $tries !=
$row[
'pass'])
1667 || ($isActivePass ==
true)
1684 WHERE active_id = ' .
$ilDB->quote($active_fi,
'integer')
1687 elseif( !$isActivePass )
1691 SET tries = ' .
$ilDB->quote($tries-1,
'integer') .
',
1692 last_finished_pass = ' .
$ilDB->quote($lastFinishedPass-1,
'integer') .
'
1693 WHERE active_id = ' .
$ilDB->quote($active_fi,
'integer')
1700 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1701 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1707 'UPDATE tst_manual_fb
1709 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer').
'
1710 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1719 FROM tst_pass_result
1720 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1721 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1727 'UPDATE tst_pass_result
1729 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer').
'
1730 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1743 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1744 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1750 'UPDATE tst_sequence
1752 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer').
'
1753 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1757 if( $this->object->isDynamicTest() )
1760 'tst_seq_qst_tracking',
'tst_seq_qst_answstatus',
'tst_seq_qst_postponed',
'tst_seq_qst_checked'
1763 foreach($tables as $table)
1767 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')}
1768 AND pass = {$ilDB->quote($pass, 'integer')}
1771 if( $must_renumber )
1776 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')}
1777 AND pass > {$ilDB->quote($pass, 'integer')}
1787 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1788 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1794 'UPDATE tst_solutions
1796 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer').
'
1797 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1804 FROM tst_test_result
1805 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1806 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1812 'UPDATE tst_test_result
1814 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1815 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1825 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1826 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1834 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer').
'
1835 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1839 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
1846 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
1849 if( $this->object->isDynamicTest() )
1851 require_once
'Modules/Test/classes/tables/class.ilTestDynamicQuestionSetStatisticTableGUI.php';
1860 global
$ilDB, $ilPluginAdmin;
1862 $testResults = $this->
object->getTestResult($active_id,
$pass);
1863 $questionIds = array();
1864 foreach($testResults as $resultItemKey => $resultItemValue)
1866 if($resultItemKey ===
'test' || $resultItemKey ===
'pass')
1871 $questionIds[] = $resultItemValue[
'qid'];
1875 $table_gui->initFilter();
1877 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
1879 $questionList->setQuestionIdsFilter($questionIds);
1880 $questionList->setQuestionInstanceTypeFilter(
null);
1882 foreach ($table_gui->getFilterItems() as $item)
1884 if( substr($item->getPostVar(), 0, strlen(
'tax_')) ==
'tax_' )
1886 $v = $item->getValue();
1888 if( is_array($v) && count($v) && !(
int)$v[0] )
1893 $taxId = substr($item->getPostVar(), strlen(
'tax_'));
1894 $questionList->addTaxonomyFilter($taxId, $item->getValue());
1896 elseif( $item->getValue() !==
false )
1898 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1902 $questionList->load();
1904 $filteredTestResult = array();
1906 foreach($testResults as $resultItemKey => $resultItemValue)
1908 if($resultItemKey ===
'test' || $resultItemKey ===
'pass')
1913 if( !$questionList->isInList($resultItemValue[
'qid']) )
1918 $filteredTestResult[] = $resultItemValue;
1921 return $filteredTestResult;
_updateTestResultCache($active_id, ilAssQuestionProcessLocker $processLocker=null)
@TODO Move this to a proper place.
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
_isComplete($adapter)
Checks the status of the certificate.
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
TableGUI class for evaluation of all users.
_getLogLanguage()
retrieve the log language for assessment logging
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
getContentStylePath($a_style_id)
get content style path
getSyntaxStylePath()
get syntax style path
_getResultPass($active_id)
Retrieves the pass number that should be counted for a given user.
_lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
static _lookupName($a_user_id)
lookup user name
TableGUI class for results by question.
special template class to simplify handling of ITX/PEAR
Test certificate adapter.
Output class for assessment test evaluation.
exportFileUploadsForAllParticipants()
Creates a ZIP file containing all file uploads for a given question in a test.
outCertificate()
Output of a test certificate.
singleResults()
Creates user results for single questions.
outUserPassDetails()
Output of the pass details of an existing test pass for the active test participant.
passDetails()
Output of the learners view of an existing test pass.
__construct(ilObjTest $a_object)
ilTestEvaluationGUI constructor
exportCertificate()
Exports the user results as PDF certificates using XSL-FO via XML:RPC calls.
exportAggregatedResults()
Exports the aggregated results.
& executeCommand()
execute command
detailedEvaluation()
Creates the detailed evaluation output for a selected participant.
outCorrectSolution()
Creates an output of the solution of an answer compared to the correct solution.
outUserListOfAnswerPasses()
Output of the pass overview for a user when he/she wants to see his/her list of answers.
exportQuestionForAllParticipants()
Creates a PDF representation of the answers for a given question in a test.
outUserPassDetailsResetTableFilter()
outParticipantsPassDetails()
Output of the pass details of an existing test pass for the test statistics.
getEvaluationQuestionId($question_id, $original_id="")
Returns the ID of a question for evaluation purposes.
getFilteredTestResult($active_id, $pass)
outUserResultsOverview()
Output of the pass overview for a test called by a test participant.
exportEvaluation()
Exports the evaluation data to a selected file format.
outParticipantsResultsOverview()
Output of the pass overview for a test called from the statistics.
redirectToPassDeletionContext($context)
outUserPassDetailsSetTableFilter()
Base Exception for all Exceptions relating to Modules/Test.
const PDF_OUTPUT_DOWNLOAD
static generatePDF($pdf_output, $output_mode, $filename=null)
const CONTEXT_INFO_SCREEN
const CONTEXT_DYN_TEST_PLAYER
const CONTEXT_PASS_OVERVIEW
Service GUI class for tests.
getGradingMessage($activeId)
getResultsSignature()
Returns HTML code for a signature field.
getCommand($cmd)
Retrieves the ilCtrl command.
getQuestionResultForTestUsers($question_id, $test_id)
Creates a HTML representation for the results of a given question in a test.
getResultsUserdata($testSession, $active_id, $overwrite_anonymity=FALSE)
Returns the user data for a test results output.
getCorrectSolutionOutput($question_id, $active_id, $pass)
Returns an output of the solution to an answer compared to the correct solution.
isGradingMessageRequired()
getPassOverview($active_id, $targetclass="", $targetcommand="", $short=FALSE, $hide_details=FALSE, $adminMode=false)
Returns the pass overview for a given active ID.
getPassDetailsOverview($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav)
getPassListOfAnswers(&$result_array, $active_id, $pass, $show_solutions=FALSE, $only_answered_questions=FALSE, $show_question_only=FALSE, $show_reached_points=FALSE, $anchorNav=false)
Returns the list of answers of a users test pass.
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Interface ilObjFileHandlingQuestionType.
if(!is_array($argv)) $options