4require_once
'./Modules/Test/classes/class.ilTestServiceGUI.php';
5require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
6require_once
'Modules/Test/classes/class.ilTestPassFinishTasks.php';
54 require_once
'Modules/Test/classes/class.ilTestProcessLockerFactory.php';
82 $cmd = $this->ctrl->getCmd();
83 $next_class = $this->ctrl->getNextClass($this);
84 $this->ctrl->saveParameter($this,
"sequence");
85 $this->ctrl->saveParameter($this,
"active_id");
87 switch ($next_class) {
88 case 'iltestpassdetailsoverviewtablegui':
89 require_once
'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
92 $tableGUI->initFilter();
93 $this->ctrl->forwardCommand($tableGUI);
97 $ret = &$this->$cmd();
105 $headernames = array();
106 if ($this->object->getAnonymity()) {
107 array_push($headernames, $this->lng->txt(
"counter"));
109 array_push($headernames, $this->lng->txt(
"name"));
110 array_push($headernames, $this->lng->txt(
"login"));
112 $additionalFields = $this->
object->getEvaluationAdditionalFields();
113 if (count($additionalFields)) {
114 foreach ($additionalFields as $fieldname) {
115 array_push($headernames, $this->lng->txt($fieldname));
118 array_push($headernames, $this->lng->txt(
"tst_reached_points"));
119 array_push($headernames, $this->lng->txt(
"tst_mark"));
120 if ($this->object->getECTSOutput()) {
121 array_push($headernames, $this->lng->txt(
"ects_grade"));
123 array_push($headernames, $this->lng->txt(
"tst_answered_questions"));
124 array_push($headernames, $this->lng->txt(
"working_time"));
125 array_push($headernames, $this->lng->txt(
"detailed_evaluation"));
131 $headervars = array();
132 if ($this->object->getAnonymity()) {
133 array_push($headervars,
"counter");
135 array_push($headervars,
"name");
136 array_push($headervars,
"login");
138 array_push($headervars,
"resultspoints");
139 array_push($headervars,
"resultsmarks");
140 if ($this->object->getECTSOutput()) {
141 array_push($headervars,
"ects_grade");
143 array_push($headervars,
"qworkedthrough");
144 array_push($headervars,
"timeofwork");
145 array_push($headervars,
"");
158 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
160 $table_gui->writeFilterToSession();
161 $this->ctrl->redirect($this,
"outEvaluation");
173 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
175 $table_gui->resetFilter();
176 $this->ctrl->redirect($this,
"outEvaluation");
187 $ilToolbar =
$DIC->toolbar();
195 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
200 $this->object->getAnonymity(),
201 $this->object->isOfferingQuestionHintsEnabled()
205 $arrFilter = array();
207 foreach ($table_gui->getFilterItems() as $item) {
208 if ($item->getValue() !==
false) {
209 switch ($item->getPostVar()) {
213 $arrFilter[$item->getPostVar()] = $item->getValue();
216 $passedonly = $item->getChecked();
221 include_once
"./Modules/Test/classes/class.ilTestEvaluationData.php";
223 $eval->setFilterArray($arrFilter);
224 $foundParticipants = $eval->getParticipants();
226 require_once
'Modules/Test/classes/class.ilTestParticipantData.php';
227 require_once
'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
240 if ($this->object->getECTSOutput()) {
241 $passed_array = &$this->
object->getTotalPointsPassedArray();
244 if (!isset($foundParticipants[$active_id]) || !($foundParticipants[$active_id] instanceof
ilTestEvaluationUserData)) {
249 $userdata = $foundParticipants[$active_id];
253 $mark_obj = $this->
object->getMarkSchema()->getMatchingMark($userdata->getReachedPointsInPercent());
255 if ($mark_obj->getPassed() ==
false || !$userdata->areObligationsAnswered()) {
261 $evaluationrow = array();
262 if ($this->object->getAnonymity()) {
263 $evaluationrow[
'name'] = $counter;
264 $evaluationrow[
'login'] =
'';
266 $evaluationrow[
'name'] = $userdata->getName();
267 if (strlen($userdata->getLogin())) {
268 $evaluationrow[
'login'] =
"[" . $userdata->getLogin() .
"]";
270 $evaluationrow[
'login'] =
'';
274 $evaluationrow[
'reached'] = $userdata->getReached();
275 $evaluationrow[
'max'] = $userdata->getMaxpoints();
276 $evaluationrow[
'hint_count'] = $userdata->getRequestedHintsCountFromScoredPass();
277 $evaluationrow[
'exam_id'] = $userdata->getExamIdFromScoredPass();
278 $percentage = $userdata->getReachedPointsInPercent();
279 $mark = $this->
object->getMarkSchema()->getMatchingMark($percentage);
280 if (is_object($mark)) {
281 $evaluationrow[
'mark'] = $mark->getShortName();
283 if ($this->object->getECTSOutput()) {
284 $ects_mark = $this->
object->getECTSGrade($passed_array, $userdata->getReached(), $userdata->getMaxPoints());
285 $evaluationrow[
'ects_grade'] = $ects_mark;
287 $evaluationrow[
'answered'] = $userdata->getQuestionsWorkedThroughInPercent();
288 $evaluationrow[
'questions_worked_through'] = $userdata->getQuestionsWorkedThrough();
289 $evaluationrow[
'number_of_questions'] = $userdata->getNumberOfQuestions();
290 $time_seconds = $userdata->getTimeOfWork();
291 $time_hours = floor($time_seconds / 3600);
292 $time_seconds -= $time_hours * 3600;
293 $time_minutes = floor($time_seconds / 60);
294 $time_seconds -= $time_minutes * 60;
295 $evaluationrow[
'working_time'] = sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds);
296 $this->ctrl->setParameter($this,
"active_id", $active_id);
297 $href = $this->ctrl->getLinkTarget($this,
"detailedEvaluation");
298 $detailed_evaluation = $this->lng->txt(
"detailed_evaluation_show");
299 $evaluationrow[
'details'] =
"<a class=\"il_ContainerItemCommand\" href=\"$href\">$detailed_evaluation</a>";
301 $evaluationrow[
'gender'] = $userfields[
'gender'];
302 $evaluationrow[
'email'] = $userfields[
'email'];
303 $evaluationrow[
'institution'] = $userfields[
'institution'];
304 $evaluationrow[
'street'] = $userfields[
'street'];
305 $evaluationrow[
'city'] = $userfields[
'city'];
306 $evaluationrow[
'zipcode'] = $userfields[
'zipcode'];
307 $evaluationrow[
'country'] = $userfields[
'country'];
308 $evaluationrow[
'sel_country'] = $userfields[
'sel_country'];
309 $evaluationrow[
'department'] = $userfields[
'department'];
310 $evaluationrow[
'matriculation'] = $userfields[
'matriculation'];
312 $data[] = $evaluationrow;
317 $table_gui->setData(
$data);
319 $ilToolbar->setFormName(
'form_output_eval');
320 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
'exportEvaluation'));
321 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
322 $export_type =
new ilSelectInputGUI($this->lng->txt(
'exp_eval_data'),
'export_type');
324 'excel' => $this->lng->txt(
'exp_type_excel'),
325 'csv' => $this->lng->txt(
'exp_type_spss')
328 if (!$this->object->getAnonymity()) {
331 if ($globalCertificatePrerequisites->validate()) {
332 $options[
'certificate'] = $this->lng->txt(
'exp_type_certificate');
338 $export_type->setOptions($options);
340 $ilToolbar->addInputItem($export_type,
true);
341 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
343 $button->setCommand(
'exportEvaluation');
344 $button->setCaption(
'export');
345 $button->getOmitPreventDoubleSubmission();
346 $ilToolbar->addButtonInstance($button);
350 if ($this->object->getShowSolutionAnswersOnly()) {
354 $this->tpl->setContent($table_gui->getHTML());
374 $active_id =
$_GET[
'active_id'];
376 if (!$this->
getTestAccess()->checkResultsAccessForActiveId($active_id)) {
380 if (strlen($active_id) == 0) {
381 ilUtil::sendInfo($this->lng->txt(
'detailed_evaluation_missing_active_id'),
true);
382 $this->ctrl->redirect($this,
'outEvaluation');
387 $toolbar =
$DIC[
'ilToolbar'];
389 require_once
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
391 $backBtn->setCaption(
'back');
392 $backBtn->setUrl($this->ctrl->getLinkTarget($this,
'outEvaluation'));
393 $toolbar->addInputItem($backBtn);
395 $this->
object->setAccessFilteredParticipantList(
396 $this->object->buildStatisticsAccessFilteredParticipantList()
399 $data = &$this->
object->getCompleteEvaluationData();
401 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
403 $form->setTitle(sprintf(
404 $this->lng->txt(
'detailed_evaluation_for'),
405 $data->getParticipant($active_id)->getName()
409 $resultPoints->setValue(
$data->getParticipant($active_id)->getReached() .
" " . strtolower($this->lng->txt(
"of")) .
" " .
$data->getParticipant($active_id)->getMaxpoints() .
" (" . sprintf(
"%2.2f",
$data->getParticipant($active_id)->getReachedPointsInPercent()) .
" %" .
")");
410 $form->addItem($resultPoints);
412 if (strlen(
$data->getParticipant($active_id)->getMark())) {
414 $resultMarks->setValue(
$data->getParticipant($active_id)->getMark());
415 $form->addItem($resultMarks);
416 if (strlen(
$data->getParticipant($active_id)->getECTSMark())) {
418 $ectsGrade->setValue(
$data->getParticipant($active_id)->getECTSMark());
419 $form->addItem($ectsGrade);
423 if ($this->object->isOfferingQuestionHintsEnabled()) {
424 $requestHints =
new ilNonEditableValueGUI($this->lng->txt(
'tst_question_hints_requested_hint_count_header'));
425 $requestHints->setValue(
$data->getParticipant($active_id)->getRequestedHintsCountFromScoredPass());
426 $form->addItem($requestHints);
429 $time_seconds =
$data->getParticipant($active_id)->getTimeOfWork();
430 $atime_seconds =
$data->getParticipant($active_id)->getNumberOfQuestions() ? $time_seconds /
$data->getParticipant($active_id)->getNumberOfQuestions() : 0;
431 $time_hours = floor($time_seconds / 3600);
432 $time_seconds -= $time_hours * 3600;
433 $time_minutes = floor($time_seconds / 60);
434 $time_seconds -= $time_minutes * 60;
436 $timeOfWork->setValue(sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
437 $form->addItem($timeOfWork);
439 $this->tpl->setVariable(
"TXT_ATIMEOFWORK", $this->lng->txt(
""));
440 $time_hours = floor($atime_seconds / 3600);
441 $atime_seconds -= $time_hours * 3600;
442 $time_minutes = floor($atime_seconds / 60);
443 $atime_seconds -= $time_minutes * 60;
445 $avgTimeOfWork->setValue(sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $atime_seconds));
446 $form->addItem($avgTimeOfWork);
450 $form->addItem($firstVisit);
454 $form->addItem($lastVisit);
457 $nrPasses->setValue(
$data->getParticipant($active_id)->getLastPass() + 1);
458 $form->addItem($nrPasses);
462 $scoredPass->setValue(
$data->getParticipant($active_id)->getBestPass() + 1);
464 $scoredPass->setValue(
$data->getParticipant($active_id)->getLastPass() + 1);
466 $form->addItem($scoredPass);
468 $median =
$data->getStatistics()->getStatistics()->median();
469 $pct =
$data->getParticipant($active_id)->getMaxpoints() ? ($median /
$data->getParticipant($active_id)->getMaxpoints()) * 100.0 : 0;
470 $mark = $this->
object->mark_schema->getMatchingMark($pct);
471 if (is_object($mark)) {
473 $markMedian->setValue($mark->getShortName());
474 $form->addItem($markMedian);
478 $rankParticipant->setValue(
$data->getStatistics()->getStatistics()->rank(
$data->getParticipant($active_id)->getReached()));
479 $form->addItem($rankParticipant);
482 $rankMedian->setValue(
$data->getStatistics()->getStatistics()->rank_median());
483 $form->addItem($rankMedian);
485 $totalParticipants =
new ilNonEditableValueGUI($this->lng->txt(
'tst_stat_result_total_participants'));
486 $totalParticipants->setValue(
$data->getStatistics()->getStatistics()->count());
487 $form->addItem($totalParticipants);
490 $medianField->setValue($median);
491 $form->addItem($medianField);
493 $this->tpl->setContent($form->getHTML());
499 if ($finishdate > 0) {
500 if ((
$DIC->access()->checkAccess(
'write',
'', (
int)
$_GET[
'ref_id']))) {
501 $this->ctrl->setParameter($this,
'statistics',
'1');
502 $this->ctrl->setParameter($this,
'active_id', $active_id);
503 $this->ctrl->setParameter($this,
'pass',
$pass);
505 $this->ctrl->setParameter($this,
'statistics',
'');
506 $this->ctrl->setParameter($this,
'active_id',
'');
507 $this->ctrl->setParameter($this,
'pass',
'');
510 require_once
'Modules/Test/classes/tables/class.ilTestDetailedEvaluationStatisticsTableGUI.php';
512 $table->setTitle(sprintf($this->lng->txt(
"tst_eval_question_points"),
$pass + 1));
513 if ((
$DIC->access()->checkAccess(
'write',
'', (
int)
$_GET[
'ref_id']))) {
514 $table->addCommandButton(
'outParticipantsPassDetails', $this->lng->txt(
'tst_show_answer_sheet'));
517 $questions =
$data->getParticipant($active_id)->getQuestions(
$pass);
518 if (!is_array($questions)) {
519 $questions =
$data->getParticipant($active_id)->getQuestions(0);
522 $tableData = array();
525 foreach ((array) $questions as $question) {
526 $userDataData = array(
527 'counter' => ++$counter,
528 'id' => $question[
'id'],
529 'id_txt' => $this->lng->txt(
'question_id_short'),
530 'title' =>
$data->getQuestionTitle($question[
'id'])
533 $answeredquestion =
$data->getParticipant($active_id)->getPass(
$pass)->getAnsweredQuestionByQuestionId($question[
"id"]);
534 if (is_array($answeredquestion)) {
535 $percent = $answeredquestion[
'points'] ? $answeredquestion[
'reached'] / $answeredquestion[
'points'] * 100.0 : 0;
536 $userDataData[
'points'] = $answeredquestion[
'reached'] .
' ' . strtolower($this->lng->txt(
'of')) .
" " . $answeredquestion[
'points'] .
' (' . sprintf(
"%.2f", $percent) .
' %)';
538 $userDataData[
'points'] =
'0 ' . strtolower($this->lng->txt(
'of')) .
' ' . $question[
'points'] .
' (' . sprintf(
"%.2f", 0) .
' %) - ' . $this->lng->txt(
'question_not_answered');
541 $tableData[] = $userDataData;
543 $table->setData($tableData);
545 $tables[] = $table->getHTML();
550 $DIC[
'tpl']->setContent($form->getHTML() . implode(
'', $tables));
568 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
571 $question_object->deliverFileUploadZIPFile(
573 $this->object->getTestId(),
574 $this->object->getTitle()
577 $this->ctrl->redirect($this,
"singleResults");
591 $ilToolbar =
$DIC->toolbar();
599 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_anonymous_aggregation.html",
"Modules/Test");
601 $this->
object->setAccessFilteredParticipantList(
602 $this->object->buildStatisticsAccessFilteredParticipantList()
605 $eval = &$this->
object->getCompleteEvaluationData();
607 $foundParticipants = &$eval->getParticipants();
608 if (count($foundParticipants)) {
609 $ilToolbar->setFormName(
'form_output_eval');
610 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
'exportAggregatedResults'));
611 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
612 $export_type =
new ilSelectInputGUI($this->lng->txt(
'exp_eval_data'),
'export_type');
613 $export_type->setOptions(array(
614 'excel' => $this->lng->txt(
'exp_type_excel'),
615 'csv' => $this->lng->txt(
'exp_type_spss')
617 $ilToolbar->addInputItem($export_type,
true);
618 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
620 $button->setCommand(
'exportAggregatedResults');
621 $button->setCaption(
'export');
622 $button->getOmitPreventDoubleSubmission();
623 $ilToolbar->addButtonInstance($button);
625 array_push(
$data, array(
626 'result' => $this->lng->txt(
"tst_eval_total_persons"),
627 'value' => count($foundParticipants)
629 $total_finished = $eval->getTotalFinishedParticipants();
630 array_push(
$data, array(
631 'result' => $this->lng->txt(
"tst_eval_total_finished"),
632 'value' => $total_finished
634 $average_time = $this->
object->evalTotalStartedAverageTime(
635 $eval->getParticipantIds()
637 $diff_seconds = $average_time;
638 $diff_hours = floor($diff_seconds / 3600);
639 $diff_seconds -= $diff_hours * 3600;
640 $diff_minutes = floor($diff_seconds / 60);
641 $diff_seconds -= $diff_minutes * 60;
642 array_push(
$data, array(
643 'result' => $this->lng->txt(
"tst_eval_total_finished_average_time"),
644 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
647 $total_passed_reached = 0;
648 $total_passed_max = 0;
649 $total_passed_time = 0;
650 foreach ($foundParticipants as $userdata) {
651 if ($userdata->getPassed()) {
653 $total_passed_reached += $userdata->getReached();
654 $total_passed_max += $userdata->getMaxpoints();
655 $total_passed_time += $userdata->getTimeOfWork();
658 $average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
659 $average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
660 $average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
661 array_push(
$data, array(
662 'result' => $this->lng->txt(
"tst_eval_total_passed"),
663 'value' => $total_passed
665 array_push(
$data, array(
666 'result' => $this->lng->txt(
"tst_eval_total_passed_average_points"),
667 'value' => sprintf(
"%2.2f", $average_passed_reached) .
" " . strtolower($this->lng->txt(
"of")) .
" " . sprintf(
"%2.2f", $average_passed_max)
669 $average_time = $average_passed_time;
670 $diff_seconds = $average_time;
671 $diff_hours = floor($diff_seconds / 3600);
672 $diff_seconds -= $diff_hours * 3600;
673 $diff_minutes = floor($diff_seconds / 60);
674 $diff_seconds -= $diff_minutes * 60;
675 array_push(
$data, array(
676 'result' => $this->lng->txt(
"tst_eval_total_passed_average_time"),
677 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
681 include_once
"./Modules/Test/classes/tables/class.ilTestAggregatedResultsTableGUI.php";
683 $table_gui->setData(
$data);
684 $this->tpl->setVariable(
'AGGREGATED_RESULTS', $table_gui->getHTML());
687 foreach ($eval->getQuestionTitles() as $question_id => $question_title) {
691 foreach ($foundParticipants as $userdata) {
692 for (
$i = 0;
$i <= $userdata->getLastPass();
$i++) {
693 if (is_object($userdata->getPass(
$i))) {
694 $question = &$userdata->getPass(
$i)->getAnsweredQuestionByQuestionId($question_id);
695 if (is_array($question)) {
697 $reached += $question[
"reached"];
698 $max += $question[
"points"];
703 $percent = $max ? $reached / $max * 100.0 : 0;
705 $this->ctrl->setParameter($this,
"qid", $question_id);
707 $points_reached = ($answered ? $reached / $answered : 0);
708 $points_max = ($answered ? $max / $answered : 0);
712 'qid' => $question_id,
713 'title' => $question_title,
714 'points' => $points_reached,
715 'points_reached' => $points_reached,
716 'points_max' => $points_max,
717 'percentage' => (
float) $percent,
718 'answers' => $answered
722 include_once
"./Modules/Test/classes/tables/class.ilTestAverageReachedPointsTableGUI.php";
724 $table_gui->setData(
$rows);
725 $this->tpl->setVariable(
'TBL_AVG_REACHED', $table_gui->getHTML());
734 if (array_key_exists(
"g_filterby",
$_GET)) {
735 $filterby =
$_GET[
"g_filterby"];
739 if (array_key_exists(
"g_userfilter",
$_GET)) {
740 $filtertext =
$_GET[
"g_userfilter"];
744 if (array_key_exists(
"g_passedonly",
$_GET)) {
745 if (
$_GET[
"g_passedonly"] == 1) {
750 require_once
'Modules/Test/classes/class.ilTestExportFactory.php';
753 switch (
$_POST[
"export_type"]) {
755 $expFactory->getExporter(
'results')->exportToExcel(
764 $expFactory->getExporter(
'results')->exportToCSV(
774 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_passedonly",
"1");
776 if (strlen($filtertext)) {
777 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_userfilter", $filtertext);
779 $this->ctrl->redirect($this,
"exportCertificate");
791 require_once
'Modules/Test/classes/class.ilTestExportFactory.php';
793 $exportObj = $expFactory->getExporter(
'aggregated');
795 switch (
$_POST[
"export_type"]) {
797 $exportObj->exportToExcel($deliver =
true);
800 $exportObj->exportToCSV($deliver =
true);
816 if (!$globalCertificatePrerequisites->validate()) {
817 $DIC[
'ilErr']->raiseError($this->lng->txt(
'permission_denied'),
$DIC[
'ilErr']->MESSAGE);
820 $database =
$DIC->database();
821 $logger =
$DIC->logger()->root();
824 $objectId = $this->
object->getId();
827 $pathFactory->create($this->object)
830 $archive_dir = $zipAction->createArchiveDirectory();
831 $total_users = array();
833 $this->
object->setAccessFilteredParticipantList(
834 $this->object->buildStatisticsAccessFilteredParticipantList()
838 $pdfGenerator =
new ilPdfGenerator($ilUserCertificateRepository, $logger);
840 $total_users = &$this->
object->evalTotalPersonsArray();
841 if (count($total_users)) {
844 foreach ($total_users as $active_id =>
$name) {
845 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
847 if (!$certValidator->isCertificateDownloadable($user_id, $objectId)) {
855 $this->lng->txt(
'error_creating_certificate_pdf')
858 $pdf = $pdfAction->createPDF($user_id, $objectId);
863 $zipArchive = $zipAction->zipCertificatesInArchiveDirectory($archive_dir,
true);
875 if ($original_id > 0) {
892 $ilTabs =
$DIC[
'ilTabs'];
893 $ilAccess =
$DIC[
'ilAccess'];
894 $ilObjDataCache =
$DIC[
'ilObjDataCache'];
896 $active_id = (int)
$_GET[
"active_id"];
898 if (!$this->
getTestAccess()->checkResultsAccessForActiveId($active_id)) {
902 $this->ctrl->saveParameter($this,
"active_id");
903 $testSession = $this->testSessionFactory->getSession($active_id);
906 if ($testSession->getTestId() != $this->object->getTestId()) {
910 $this->ctrl->saveParameter($this,
"pass");
913 if (isset(
$_GET[
'statistics']) &&
$_GET[
'statistics'] == 1) {
914 $this->ctrl->setParameterByClass(
"ilTestEvaluationGUI",
"active_id", $active_id);
915 $this->ctrl->saveParameter($this,
'statistics');
917 $ilTabs->setBackTarget(
918 $this->lng->txt(
'back'),
919 $this->ctrl->getLinkTargetByClass(
'ilTestEvaluationGUI',
'detailedEvaluation')
921 } elseif ($this->object->getNrOfTries() == 1) {
922 $ilTabs->setBackTarget(
923 $this->lng->txt(
'back'),
924 $this->ctrl->getLinkTargetByClass(
'ilParticipantsTestResultsGUI')
927 $ilTabs->setBackTarget(
928 $this->lng->txt(
'tst_results_back_overview'),
929 $this->ctrl->getLinkTarget($this,
'outParticipantsResultsOverview')
938 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
941 $objectivesList =
null;
944 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
945 $testSequence->loadFromDb();
946 $testSequence->loadQuestions();
948 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
952 $objectivesList->loadObjectivesTitles();
954 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
955 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
956 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
957 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
958 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
964 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
966 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
968 $template =
new ilTemplate(
"tpl.il_as_tst_pass_details_overview_participants.html",
true,
true,
"Modules/Test");
972 $this->ctrl->setParameter($this,
'pdf',
'1');
973 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
974 $this->ctrl->setParameter($this,
'pdf',
'');
976 if (isset(
$_GET[
'show_best_solutions'])) {
977 $_SESSION[
'tst_results_show_best_solutions'] =
true;
978 } elseif (isset(
$_GET[
'hide_best_solutions'])) {
979 $_SESSION[
'tst_results_show_best_solutions'] =
false;
980 } elseif (!isset(
$_SESSION[
'tst_results_show_best_solutions'])) {
981 $_SESSION[
'tst_results_show_best_solutions'] =
false;
984 if (
$_SESSION[
'tst_results_show_best_solutions']) {
985 $this->ctrl->setParameter($this,
'hide_best_solutions',
'1');
986 $toolbar->setHideBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
987 $this->ctrl->setParameter($this,
'hide_best_solutions',
'');
989 $this->ctrl->setParameter($this,
'show_best_solutions',
'1');
990 $toolbar->setShowBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
991 $this->ctrl->setParameter($this,
'show_best_solutions',
'');
995 $template->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
999 $gradingMessageBuilder->buildList();
1001 $template->setCurrentBlock(
'grading_message');
1002 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
1003 $template->parseCurrentBlock();
1006 $list_of_answers = $this->
getPassListOfAnswers($result_array, $active_id,
$pass,
$_SESSION[
'tst_results_show_best_solutions'],
false,
false,
false,
true, $objectivesList, $testResultHeaderLabelBuilder);
1007 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1008 $template->setVariable(
"PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
1010 $data = &$this->
object->getCompleteEvaluationData();
1011 $result =
$data->getParticipant($active_id)->getReached() .
" " . strtolower($this->lng->txt(
"of")) .
" " .
$data->getParticipant($active_id)->getMaxpoints() .
" (" . sprintf(
"%2.2f",
$data->getParticipant($active_id)->getReachedPointsInPercent()) .
" %" .
")";
1012 $template->setCurrentBlock(
'total_score');
1013 $template->setVariable(
"TOTAL_RESULT_TEXT",$this->lng->txt(
'tst_stat_result_resultspoints'));
1014 $template->setVariable(
"TOTAL_RESULT",
$result);
1015 $template->parseCurrentBlock();
1018 $template->setVariable(
"USER_DATA", $user_data);
1020 $uname = $this->
object->userLookupFullName($user_id);
1021 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
1023 $template->setVariable(
"TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
1026 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1032 if ($this->object->getShowSolutionAnswersOnly()) {
1040 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1052 $ilTabs =
$DIC[
'ilTabs'];
1053 $ilObjDataCache =
$DIC[
'ilObjDataCache'];
1055 $active_id = (int)
$_GET[
"active_id"];
1057 if (!$this->
getTestAccess()->checkResultsAccessForActiveId($active_id)) {
1061 $testSession = $this->testSessionFactory->getSession($active_id);
1064 if ($testSession->getTestId() != $this->object->getTestId()) {
1068 if ($this->object->getNrOfTries() == 1) {
1069 $this->ctrl->setParameter($this,
"active_id", $active_id);
1071 $this->ctrl->redirect($this,
"outParticipantsPassDetails");
1074 $ilTabs->setBackTarget(
1075 $this->lng->txt(
'back'),
1076 $this->ctrl->getLinkTargetByClass([
'ilObjTestGUI',
'ilTestResultsGUI',
'ilParticipantsTestResultsGUI'])
1084 $template =
new ilTemplate(
"tpl.il_as_tst_pass_overview_participants.html",
true,
true,
"Modules/Test");
1088 $this->ctrl->setParameter($this,
'pdf',
'1');
1089 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, __FUNCTION__));
1090 $this->ctrl->setParameter($this,
'pdf',
'');
1093 $template->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1095 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1098 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1099 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1100 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1101 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1102 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1106 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1108 $testPassesSelector->setActiveId($testSession->getActiveId());
1109 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1112 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1113 $passOverViewTableGUI->setResultPresentationEnabled(
true);
1114 $passOverViewTableGUI->setPassDetailsCommand(
'outParticipantsPassDetails');
1115 $passOverViewTableGUI->init();
1116 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getExistingPasses(),
true,
true));
1117 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1118 $template->setVariable(
"PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1122 $gradingMessageBuilder->buildList();
1124 $template->setCurrentBlock(
'grading_message');
1125 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
1126 $template->parseCurrentBlock();
1130 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
1133 if ($this->object->getAnonymity()) {
1134 $template->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result"));
1136 $uname = $this->
object->userLookupFullName($user_id,
true);
1137 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1138 $template->setVariable(
"USER_DATA", $user_data);
1142 $template->parseCurrentBlock();
1146 if ($this->object->getShowSolutionAnswersOnly()) {
1150 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1)) {
1154 $filename =
$name[
'lastname'] .
'_' .
$name[
'firstname'] .
'_' .
$name[
'login'] .
'__' . $this->
object->getTitleFilenameCompliant();
1159 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1166 $tableGUI->initFilter();
1167 $tableGUI->resetOffset();
1168 $tableGUI->writeFilterToSession();
1175 $tableGUI->initFilter();
1176 $tableGUI->resetOffset();
1177 $tableGUI->resetFilter();
1184 $tableGUI->initFilter();
1185 $tableGUI->resetOffset();
1186 $tableGUI->writeFilterToSession();
1193 $tableGUI->initFilter();
1194 $tableGUI->resetOffset();
1195 $tableGUI->resetFilter();
1207 $ilTabs =
$DIC[
'ilTabs'];
1209 $ilObjDataCache =
$DIC[
'ilObjDataCache'];
1211 $ilTabs->clearSubTabs();
1212 $ilTabs->setBackTarget($this->lng->txt(
'tst_results_back_overview'), $this->ctrl->getLinkTarget($this));
1214 $testSession = $this->testSessionFactory->getSession();
1216 if (!$this->object->getShowPassDetails()) {
1217 #$executable = $this->object->isExecutable($testSession, $ilUser->getId());
1219 #if($executable["executable"])
1221 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1225 $active_id = $testSession->getActiveId();
1226 $user_id = $testSession->getUserId();
1228 $this->ctrl->saveParameter($this,
"pass");
1236 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1239 $objectivesList =
null;
1241 $considerHiddenQuestions =
true;
1242 $considerOptionalQuestions =
true;
1245 $considerHiddenQuestions =
false;
1247 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
1248 $testSequence->loadFromDb();
1249 $testSequence->loadQuestions();
1251 if ($this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed()) {
1252 $considerOptionalQuestions =
false;
1255 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1259 $objectivesList->loadObjectivesTitles();
1261 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1262 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1263 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1264 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1265 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1270 $command_solution_details =
"";
1271 if ($this->object->getShowSolutionDetails()) {
1272 $command_solution_details =
"outCorrectSolution";
1274 $questionAnchorNav = $this->
object->canShowSolutionPrintview();
1276 $tpl =
new ilTemplate(
'tpl.il_as_tst_pass_details_overview_participants.html',
true,
true,
"Modules/Test");
1281 $this->ctrl->setParameter($this,
'pdf',
'1');
1282 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this,
'outUserPassDetails'));
1283 $this->ctrl->setParameter($this,
'pdf',
'');
1286 if ($validator->isCertificateDownloadable($user_id, $this->object->getId())) {
1287 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this,
'outCertificate'));
1292 $tpl->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1294 $tpl->setCurrentBlock(
'signature');
1296 $tpl->parseCurrentBlock();
1298 if ($this->object->isShowExamIdInTestResultsEnabled()) {
1299 $tpl->setCurrentBlock(
'exam_id');
1301 $testSession->getActiveId(),
1304 $tpl->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1305 $tpl->parseCurrentBlock();
1312 $gradingMessageBuilder->buildMessage();
1313 $gradingMessageBuilder->sendMessage();
1315 #$template->setCurrentBlock('grading_message');
1316 #$template->setVariable('GRADING_MESSAGE', );
1317 #$template->parseCurrentBlock();
1325 "outUserPassDetails",
1326 $command_solution_details,
1330 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
1331 $tpl->setVariable(
"PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
1333 $data = &$this->
object->getCompleteEvaluationData();
1334 $result =
$data->getParticipant($active_id)->getReached() .
" " . strtolower($this->lng->txt(
"of")) .
" " .
$data->getParticipant($active_id)->getMaxpoints() .
" (" . sprintf(
"%2.2f",
$data->getParticipant($active_id)->getReachedPointsInPercent()) .
" %" .
")";
1335 $tpl->setCurrentBlock(
'total_score');
1336 $tpl->setVariable(
"TOTAL_RESULT_TEXT",$this->lng->txt(
'tst_stat_result_resultspoints'));
1338 $tpl->parseCurrentBlock();
1340 if ($this->object->canShowSolutionPrintview()) {
1345 $this->object->getShowSolutionListComparison(),
1351 $testResultHeaderLabelBuilder
1353 $tpl->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1356 $tpl->setVariable(
"TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
1357 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1359 $uname = $this->
object->userLookupFullName($user_id,
true);
1362 if ($this->object->getAnonymity()) {
1363 $tpl->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result_pass"));
1365 $tpl->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
1366 $tpl->setVariable(
"USER_DATA", $user_data);
1374 if ($this->object->getShowSolutionAnswersOnly()) {
1381 $this->tpl->setContent(
$tpl->get());
1394 $ilObjDataCache =
$DIC[
'ilObjDataCache'];
1396 $testSession = $this->testSessionFactory->getSession();
1397 $active_id = $testSession->getActiveId();
1399 $uname = $this->
object->userLookupFullName($user_id,
true);
1401 if (!$this->object->canShowTestResults($testSession)) {
1402 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1410 $templatehead =
new ilTemplate(
"tpl.il_as_tst_results_participants.html",
true,
true,
"Modules/Test");
1411 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html",
true,
true,
"Modules/Test");
1415 $this->ctrl->setParameter($this,
'pdf',
'1');
1416 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this,
'outUserResultsOverview'));
1417 $this->ctrl->setParameter($this,
'pdf',
'');
1420 if ($validator->isCertificateDownloadable($user_id, $this->object->getId())) {
1421 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this,
'outCertificate'));
1426 $templatehead->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1428 $passDetailsEnabled = $this->
object->getShowPassDetails();
1429 #if (!$passDetailsEnabled)
1431 # $executable = $this->object->isExecutable($testSession, $ilUser->getId());
1432 # if (!$executable["executable"]) $passDetailsEnabled = true;
1435 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1438 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1439 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1440 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1441 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1442 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1445 $template->setCurrentBlock(
"pass_overview");
1448 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1450 $testPassesSelector->setActiveId($testSession->getActiveId());
1451 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1454 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1455 $passOverViewTableGUI->setResultPresentationEnabled(
true);
1456 if ($passDetailsEnabled) {
1457 $passOverViewTableGUI->setPassDetailsCommand(
'outUserPassDetails');
1459 if ($this->object->isPassDeletionAllowed()) {
1460 $passOverViewTableGUI->setPassDeletionCommand(
'confirmDeletePass');
1462 $passOverViewTableGUI->init();
1463 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getReportablePasses(),
true));
1464 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1465 $overview = $passOverViewTableGUI->getHTML();
1467 require_once
'Modules/Test/classes/class.ilTestLearningObjectivesStatusGUI.php';
1470 $loStatus->setUsrId($testSession->getUserId());
1471 $overview .=
"<br />" . $loStatus->getHTML();
1473 $template->setVariable(
"PASS_OVERVIEW", $overview);
1474 $template->parseCurrentBlock();
1478 $gradingMessageBuilder->buildMessage();
1479 $gradingMessageBuilder->sendMessage();
1481 #$template->setCurrentBlock('grading_message');
1482 #$template->setVariable('GRADING_MESSAGE', );
1483 #$template->parseCurrentBlock();
1489 if ($this->object->getAnonymity()) {
1490 $template->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result"));
1492 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1493 $template->setVariable(
"USER_DATA", $user_data);
1498 if ($this->object->getShowSolutionAnswersOnly()) {
1501 $templatehead->setVariable(
"RESULTS_PARTICIPANT", $template->get());
1506 $this->tpl->setContent($templatehead->get());
1521 $ilObjDataCache =
$DIC[
'ilObjDataCache'];
1523 if (!$this->object->getShowSolutionPrintview()) {
1525 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1528 $template =
new ilTemplate(
"tpl.il_as_tst_info_list_of_answers.html",
true,
true,
"Modules/Test");
1531 if (array_key_exists(
"pass",
$_GET)) {
1532 if (strlen(
$_GET[
"pass"])) {
1538 $testSession = $this->testSessionFactory->getSession();
1539 $active_id = $testSession->getActiveId();
1541 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_passes"));
1544 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1546 $testPassesSelector->setActiveId($testSession->getActiveId());
1547 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1550 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1551 $passOverViewTableGUI->setResultPresentationEnabled(
false);
1552 $passOverViewTableGUI->setPassDetailsCommand(
'outUserListOfAnswerPasses');
1553 $passOverViewTableGUI->init();
1554 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getClosedPasses(),
false));
1555 $template->setVariable(
"PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1558 if (strlen(
$pass)) {
1559 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1562 $objectivesList =
null;
1565 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
1566 $testSequence->loadFromDb();
1567 $testSequence->loadQuestions();
1569 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1573 $objectivesList->loadObjectivesTitles();
1575 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1576 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1577 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1578 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1579 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1582 $result_array = $this->
object->getTestResult(
1590 $user_id = &$this->
object->_getUserIdFromActiveId($active_id);
1591 $showAllAnswers =
true;
1592 if ($this->object->isExecutable($testSession, $user_id)) {
1593 $showAllAnswers =
false;
1596 $answers = $this->
getPassListOfAnswers($result_array, $active_id,
$pass,
false, $showAllAnswers,
false,
false,
false, $objectivesList, $testResultHeaderLabelBuilder);
1597 $template->setVariable(
"PASS_DETAILS", $answers);
1599 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1600 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1601 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
1604 $template->setVariable(
"USER_DATA", $user_data);
1605 $template->setVariable(
"TEXT_LIST_OF_ANSWERS", $this->lng->txt(
"tst_list_of_answers"));
1606 if (strlen($signature)) {
1607 $template->setVariable(
"SIGNATURE", $signature);
1609 if (!is_null(
$pass) && $this->object->isShowExamIdInTestResultsEnabled()) {
1610 $template->setCurrentBlock(
'exam_id_footer');
1612 $testSession->getActiveId(),
1615 $template->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1616 $template->parseCurrentBlock();
1618 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1621 if ($this->object->getShowSolutionAnswersOnly()) {
1635 if (array_key_exists(
"pass",
$_GET) && (strlen(
$_GET[
"pass"]) > 0)) {
1636 $this->ctrl->saveParameter($this,
"pass");
1637 $this->ctrl->saveParameter($this,
"active_id");
1638 $this->outTestResults(
false,
$_GET[
"pass"]);
1640 $this->outTestResults(
false);
1656 $this->
object->setAccessFilteredParticipantList(
1657 $this->object->buildStatisticsAccessFilteredParticipantList()
1662 $data = &$this->
object->getCompleteEvaluationData();
1663 $color_class = array(
"tblrow1",
"tblrow2");
1665 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_single_answers.html",
"Modules/Test");
1666 $foundParticipants = &
$data->getParticipants();
1667 if (count($foundParticipants) == 0) {
1672 foreach (
$data->getQuestionTitles() as $question_id => $question_title) {
1676 foreach ($foundParticipants as $userdata) {
1677 $pass = $userdata->getScoredPass();
1678 if (is_object($userdata->getPass(
$pass))) {
1679 $question = &$userdata->getPass(
$pass)->getAnsweredQuestionByQuestionId($question_id);
1680 if (is_array($question)) {
1686 $this->ctrl->setParameter($this,
"qid", $question_id);
1687 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
1691 if ($question_object->hasFileUploads($this->object->getTestId())) {
1692 $download =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportFileUploadsForAllParticipants") .
"\">" . $this->lng->txt(
"download") .
"</a>";
1698 'qid' => $question_id,
1699 'question_title' => $question_title,
1700 'number_of_answers' => $answered,
1701 'output' =>
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportQuestionForAllParticipants") .
"\">" . $this->lng->txt(
"pdf_export") .
"</a>",
1702 'file_uploads' => $download
1707 require_once
'./Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php';
1709 $table_gui->setTitle($this->lng->txt(
"tst_answered_questions_test"));
1710 $table_gui->setData(
$rows);
1712 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1714 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $this->lng->txt(
"adm_no_special_users"));
1726 $user =
$DIC->user();
1727 $database =
$DIC->database();
1728 $logger =
$DIC->logger()->root();
1731 $pdfGenerator =
new ilPdfGenerator($ilUserCertificateRepository, $logger);
1737 $this->lng->txt(
'error_creating_certificate_pdf')
1740 $pdfAction->downloadPdf((
int) $user->getId(), (
int) $this->object->getId());
1745 if (isset(
$_GET[
'context']) && strlen(
$_GET[
'context'])) {
1751 if (!$this->object->isPassDeletionAllowed() && !$this->object->isDynamicTest()) {
1755 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1762 $tpl->setContent($this->ctrl->getHTML($confirm));
1772 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1777 $this->ctrl->redirect($this,
'outUserResultsOverview');
1782 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
1787 $this->ctrl->redirectByClass(
'ilTestPlayerDynamicQuestionSetGUI',
'startTest');
1791 public function performDeletePass()
1793 if (isset(
$_POST[
'context']) && strlen(
$_POST[
'context'])) {
1799 if (!$this->object->isPassDeletionAllowed() && !$this->object->isDynamicTest()) {
1809 if (isset(
$_POST[
'active_id']) && (
int)
$_POST[
'active_id']) {
1810 $active_fi =
$_POST[
'active_id'];
1813 if (isset(
$_POST[
'pass']) && is_numeric(
$_POST[
'pass'])) {
1817 if (is_null($active_fi) || is_null(
$pass)) {
1818 $this->ctrl->redirect($this,
'outUserResultsOverview');
1821 if (!$this->object->isDynamicTest() &&
$pass == $this->object->_getResultPass($active_fi)) {
1822 $this->ctrl->redirect($this,
'outUserResultsOverview');
1827 SELECT tst_active.tries, tst_active.last_finished_pass, tst_sequence.pass
1829 LEFT JOIN tst_sequence
1830 ON tst_sequence.active_fi = tst_active.active_id
1831 AND tst_sequence.pass = tst_active.tries
1832 WHERE tst_active.active_id = {$ilDB->quote($active_fi, 'integer')}
1837 $tries = $row[
'tries'];
1838 $lastFinishedPass = is_numeric($row[
'last_finished_pass']) ? $row[
'last_finished_pass'] : -1;
1840 if (
$pass < $lastFinishedPass) {
1841 $isActivePass =
false;
1842 $must_renumber =
true;
1843 } elseif (
$pass == $lastFinishedPass) {
1844 $isActivePass =
false;
1846 if ($tries == $row[
'pass']) {
1847 $must_renumber =
true;
1849 $must_renumber =
false;
1851 } elseif (
$pass == $row[
'pass']) {
1852 $isActivePass =
true;
1853 $must_renumber =
false;
1855 throw new ilTestException(
'This should not happen, please contact Bjoern Heyser to clean up this pass salad!');
1858 if (!$this->object->isDynamicTest() && $isActivePass) {
1859 $this->ctrl->redirect($this,
'outUserResultsOverview');
1863 ($lastFinishedPass == 0 && $tries == 1 && $tries != $row[
'pass'])
1864 || ($isActivePass ==
true)
1877 WHERE active_id = ' .
$ilDB->quote($active_fi,
'integer')
1879 } elseif (!$isActivePass) {
1882 SET tries = ' .
$ilDB->quote($tries - 1,
'integer') .
',
1883 last_finished_pass = ' .
$ilDB->quote($lastFinishedPass - 1,
'integer') .
'
1884 WHERE active_id = ' .
$ilDB->quote($active_fi,
'integer')
1891 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1892 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1895 if ($must_renumber) {
1897 'UPDATE tst_manual_fb
1899 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1900 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1909 FROM tst_pass_result
1910 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1911 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1914 if ($must_renumber) {
1916 'UPDATE tst_pass_result
1918 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1919 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1932 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1933 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1936 if ($must_renumber) {
1938 'UPDATE tst_sequence
1940 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1941 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1945 if ($this->object->isDynamicTest()) {
1947 'tst_seq_qst_tracking',
'tst_seq_qst_answstatus',
'tst_seq_qst_postponed',
'tst_seq_qst_checked'
1950 foreach ($tables as $table) {
1953 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')}
1954 AND pass = {$ilDB->quote($pass, 'integer')}
1957 if ($must_renumber) {
1961 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')}
1962 AND pass > {$ilDB->quote($pass, 'integer')}
1972 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1973 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1976 if ($must_renumber) {
1978 'UPDATE tst_solutions
1980 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1981 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1988 FROM tst_test_result
1989 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1990 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1993 if ($must_renumber) {
1995 'UPDATE tst_test_result
1997 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1998 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
2008 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
2009 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
2012 if ($must_renumber) {
2016 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
2017 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
2021 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
2027 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
2030 if ($this->object->isDynamicTest()) {
2031 require_once
'Modules/Test/classes/tables/class.ilTestDynamicQuestionSetStatisticTableGUI.php';
2042 $ilPluginAdmin =
$DIC[
'ilPluginAdmin'];
2044 $resultData = $this->
object->getTestResult($active_id,
$pass,
false, $considerHiddenQuestions);
2045 $questionIds = array();
2046 foreach ($resultData as $resultItemKey => $resultItemValue) {
2047 if ($resultItemKey ===
'test' || $resultItemKey ===
'pass') {
2051 $questionIds[] = $resultItemValue[
'qid'];
2055 $table_gui->initFilter();
2057 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
2060 $questionList->setIncludeQuestionIdsFilter($questionIds);
2061 $questionList->setQuestionInstanceTypeFilter(
null);
2063 foreach ($table_gui->getFilterItems() as $item) {
2064 if (substr($item->getPostVar(), 0, strlen(
'tax_')) ==
'tax_') {
2065 $v = $item->getValue();
2067 if (is_array($v) && count($v) && !(
int) $v[0]) {
2071 $taxId = substr($item->getPostVar(), strlen(
'tax_'));
2072 $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->object->getId(),
'tst');
2073 } elseif ($item->getValue() !==
false) {
2074 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
2078 $questionList->load();
2080 $filteredTestResult = array();
2082 foreach ($resultData as $resultItemKey => $resultItemValue) {
2083 if ($resultItemKey ===
'test' || $resultItemKey ===
'pass') {
2087 if (!$questionList->isInList($resultItemValue[
'qid'])) {
2091 $filteredTestResult[] = $resultItemValue;
2094 return $filteredTestResult;
2101 $activeId = (int)
$_GET[
"active_id"];
2103 require_once
'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2106 require_once
'Modules/Test/classes/class.ilTestParticipantList.php';
2120 if ($this->object->isEndingTimeEnabled() || $this->object->getEnableProcessingTime()) {
2121 if ($this->object->endingTimeReached() ==
false) {
2122 $starting_time = $this->
object->getStartingTimeOfUser($activeId);
2123 if ($this->object->isMaxProcessingTimeReached($starting_time, $activeId) ==
false) {
2124 ilUtil::sendInfo($this->lng->txt(
"finish_pass_for_user_in_processing_time"));
2129 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
2132 $cgui->setHeaderText(sprintf(
2133 $this->lng->txt(
"finish_pass_for_user_confirmation"),
2137 $this->ctrl->setParameter($this,
'active_id', $activeId);
2138 $cgui->setFormAction($this->ctrl->getFormAction($this,
"participants"));
2140 $cgui->setCancel($this->lng->txt(
"cancel"),
"redirectBackToParticipantsScreen");
2141 $cgui->setConfirm($this->lng->txt(
"proceed"),
"confirmFinishTestPassForUser");
2143 $this->tpl->setContent($cgui->getHTML());
2150 $activeId = (int)
$_GET[
"active_id"];
2152 require_once
'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2155 require_once
'Modules/Test/classes/class.ilTestParticipantList.php';
2174 if ($this->object->isEndingTimeEnabled() || $this->object->getEnableProcessingTime()) {
2175 if ($this->object->endingTimeReached() ==
false) {
2179 $participantList->initializeFromDbRows($this->object->getTestParticipants());
2180 $participantList = $participantList->getAccessFilteredList($accessFilter);
2182 foreach ($participantList as $participant) {
2183 if (!$participant->hasUnfinishedPasses()) {
2186 $starting_time = $this->
object->getStartingTimeOfUser($participant->getActiveId());
2187 if ($this->object->isMaxProcessingTimeReached($starting_time, $participant->getActiveId()) ==
false) {
2188 ilUtil::sendFailure($this->lng->txt(
"finish_pass_for_all_users_in_processing_time"),
true);
2195 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
2197 $cgui->setFormAction($this->ctrl->getFormAction($this));
2198 $cgui->setHeaderText($this->lng->txt(
"finish_pass_for_all_users"));
2199 $cgui->setCancel($this->lng->txt(
"cancel"),
"redirectBackToParticipantsScreen");
2200 $cgui->setConfirm($this->lng->txt(
"proceed"),
"confirmFinishTestPassForAllUser");
2201 $this->tpl->setContent($cgui->getHTML());
2206 require_once
'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2209 require_once
'Modules/Test/classes/class.ilTestParticipantList.php';
2211 $participantList->initializeFromDbRows($this->object->getTestParticipants());
2212 $participantList = $participantList->getAccessFilteredList($accessFilter);
2214 foreach ($participantList as $participant) {
2215 if (!$participant->hasUnfinishedPasses()) {
2219 $this->
finishTestPass($participant->getActiveId(), $this->object->getId());
2227 $processLocker = $this->processLockerFactory->withContextId((
int) $active_id)->getLocker();
2230 $test_pass_finisher->performFinishTasks($processLocker);
2235 $this->ctrl->redirectByClass(
"ilTestParticipantsGUI");
An exception for terminatinating execution or to throw for unit testing.
static _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.
Validates if an active certificate is stored in the database and can be downloaded by the user.
Just a wrapper class to create Unit Test for other classes.
Confirmation screen class.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
TableGUI class for evaluation of all users.
Base class for ILIAS Exception handling.
static getInstance(ilTestSession $a_test_session)
This class represents a non editable value in a property form.
static _getLogLanguage()
retrieve the log language for assessment logging
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
static accessViolationRedirect()
static _getResultPass($active_id)
Retrieves the pass number that should be counted for a given user.
static lookupExamId($active_id, $pass)
static lookupLastTestPassAccess($activeId, $passIndex)
static lookupPassResultsUpdateTimestamp($active_id, $pass)
static _lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
static _lookupName($a_user_id)
lookup user name
static prepareGenerationRequest($service, $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
TableGUI class for results by question.
special template class to simplify handling of ITX/PEAR
Class ilTestDetailedEvaluationStatisticsTableGUI.
Output class for assessment test evaluation.
exportFileUploadsForAllParticipants()
Creates a ZIP file containing all file uploads for a given question in a test.
outEvaluation()
Creates the evaluation output for the 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.
executeCommand()
execute command
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.
eval_a()
Output of anonymous aggregated results for the test.
exportAggregatedResults()
Exports the aggregated results.
detailedEvaluation()
Creates the detailed evaluation output for a selected participant.
outUserListOfAnswerPasses()
Output of the pass overview for a user when he/she wants to see his/her list of answers.
finishTestPassForSingleUser()
confirmFinishTestPassForAllUser()
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.
setTestAccess($testAccess)
outUserResultsOverview()
Output of the pass overview for a test called by a test participant.
confirmFinishTestPassForUser()
exportEvaluation()
Exports the evaluation data to a selected file format.
getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
outParticipantsResultsOverview()
Output of the pass overview for a test called from the statistics.
redirectToPassDeletionContext($context)
outParticipantsPassDetailsSetTableFilter()
redirectBackToParticipantsScreen()
outParticipantsPassDetailsResetTableFilter()
finishTestPass($active_id, $obj_id)
outUserPassDetailsSetTableFilter()
Base Exception for all Exceptions relating to Modules/Test.
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
const PDF_OUTPUT_DOWNLOAD
static getManageParticipantsUserFilter($refId)
static getAccessStatisticsUserFilter($refId)
const CONTEXT_INFO_SCREEN
const CONTEXT_DYN_TEST_PLAYER
const CONTEXT_PASS_OVERVIEW
Class ilTestPassFinishTasks.
Service GUI class for tests.
getGradingMessageBuilder($activeId)
populateExamId(ilTemplate $tpl, int $activeId, int $pass)
getObjectiveOrientedContainer()
populatePassFinishDate($tpl, $passFinishDate)
getResultsSignature()
Returns HTML code for a signature field.
getCommand($cmd)
Retrieves the ilCtrl command.
buildPassOverviewTableGUI($targetGUI)
getQuestionResultForTestUsers($question_id, $test_id)
Creates a HTML representation for the results of a given question in a test.
buildUserTestResultsToolbarGUI()
setContextResultPresentation($contextResultPresentation)
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
isGradingMessageRequired()
getPassListOfAnswers(&$result_array, $active_id, $pass, $show_solutions=false, $only_answered_questions=false, $show_question_only=false, $show_reached_points=false, $anchorNav=false, ilTestQuestionRelatedObjectivesList $objectivesList=null, ilTestResultHeaderLabelBuilder $testResultHeaderLabelBuilder=null)
Returns the list of answers of a users test pass.
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
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 sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
const PDF_USER_RESULT
PDF Purposes.
Interface ilObjFileHandlingQuestionType.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ilPdfGeneratorConstantsTest.