57 $this->current_user = $DIC[
'ilUser'];
86 $cmd = $this->
ctrl->getCmd();
87 $next_class = $this->
ctrl->getNextClass($this);
88 $this->
ctrl->saveParameter($this,
"sequence");
89 $this->
ctrl->saveParameter($this,
"active_id");
91 switch ($next_class) {
92 case 'iltestpassdetailsoverviewtablegui':
93 require_once
'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
96 $tableGUI->initFilter();
97 $this->
ctrl->forwardCommand($tableGUI);
101 $ret = $this->$cmd();
116 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
118 $table_gui->writeFilterToSession();
119 $this->
ctrl->redirect($this,
"outEvaluation");
131 include_once
"./Modules/Test/classes/tables/class.ilEvaluationAllTableGUI.php";
133 $table_gui->resetFilter();
134 $this->
ctrl->redirect($this,
"outEvaluation");
145 $ilToolbar = $DIC->toolbar();
156 $this->
object->getAnonymity(),
157 $this->
object->isOfferingQuestionHintsEnabled()
163 foreach ($table_gui->getFilterItems() as $item) {
164 if (!in_array($item->getValue(), [
false,
''])) {
165 switch ($item->getPostVar()) {
169 $filter_array[$item->getPostVar()] = $item->getValue();
172 $passedonly = $item->getChecked();
179 $eval->setFilterArray($filter_array);
180 $foundParticipants = $eval->getParticipants();
193 if ($this->
object->getECTSOutput()) {
194 $passed_array = $this->
object->getTotalPointsPassedArray();
197 if (!isset($foundParticipants[$active_id]) || !($foundParticipants[$active_id] instanceof
ilTestEvaluationUserData)) {
202 $userdata = $foundParticipants[$active_id];
206 $mark_obj = $this->
object->getMarkSchema()->getMatchingMark($userdata->getReachedPointsInPercent());
208 if ($mark_obj->getPassed() ==
false || !$userdata->areObligationsAnswered()) {
214 $evaluationrow = array();
215 if ($this->
object->getAnonymity()) {
216 $evaluationrow[
'name'] = $counter;
217 $evaluationrow[
'login'] =
'';
219 $evaluationrow[
'name'] = $userdata->getName();
220 if (strlen($userdata->getLogin())) {
221 $evaluationrow[
'login'] =
"[" . $userdata->getLogin() .
"]";
223 $evaluationrow[
'login'] =
'';
227 $evaluationrow[
'reached'] = $userdata->getReached();
228 $evaluationrow[
'max'] = $userdata->getMaxpoints();
229 $evaluationrow[
'hint_count'] = $userdata->getRequestedHintsCountFromScoredPass();
230 $evaluationrow[
'exam_id'] = $userdata->getExamIdFromScoredPass();
231 $percentage = $userdata->getReachedPointsInPercent();
232 $mark = $this->
object->getMarkSchema()->getMatchingMark($percentage);
233 if (is_object($mark)) {
234 $evaluationrow[
'mark'] = $mark->getShortName();
236 if ($this->
object->getECTSOutput()) {
237 $ects_mark = $this->
object->getECTSGrade($passed_array, $userdata->getReached(), $userdata->getMaxPoints());
238 $evaluationrow[
'ects_grade'] = $ects_mark;
240 $evaluationrow[
'answered'] = $userdata->getQuestionsWorkedThroughInPercent();
241 $evaluationrow[
'questions_worked_through'] = $userdata->getQuestionsWorkedThrough();
242 $evaluationrow[
'number_of_questions'] = $userdata->getNumberOfQuestions();
243 $time_seconds = $userdata->getTimeOfWork();
244 $time_hours = floor($time_seconds / 3600);
245 $time_seconds -= $time_hours * 3600;
246 $time_minutes = floor($time_seconds / 60);
247 $time_seconds -= $time_minutes * 60;
248 $evaluationrow[
'working_time'] = sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds);
249 $this->
ctrl->setParameter($this,
"active_id", $active_id);
250 $href = $this->
ctrl->getLinkTarget($this,
"detailedEvaluation");
251 $detailed_evaluation = $this->
lng->txt(
"detailed_evaluation_show");
252 $evaluationrow[
'details'] =
"<a class=\"il_ContainerItemCommand\" href=\"$href\">$detailed_evaluation</a>";
254 if ($userdata->getUserID() !== null) {
257 $evaluationrow[
'gender'] = $userfields[
'gender'] ??
'';
258 $evaluationrow[
'email'] = $userfields[
'email'] ??
'';
259 $evaluationrow[
'institution'] = $userfields[
'institution'] ??
'';
260 $evaluationrow[
'street'] = $userfields[
'street'] ??
'';
261 $evaluationrow[
'city'] = $userfields[
'city'] ??
'';
262 $evaluationrow[
'zipcode'] = $userfields[
'zipcode'] ??
'';
263 $evaluationrow[
'country'] = $userfields[
'country'] ??
'';
264 $evaluationrow[
'sel_country'] = $userfields[
'sel_country'] ??
'';
265 $evaluationrow[
'department'] = $userfields[
'department'] ??
'';
266 $evaluationrow[
'matriculation'] = $userfields[
'matriculation'] ??
'';
268 $data[] = $evaluationrow;
275 $ilToolbar->setFormName(
'form_output_eval');
276 $ilToolbar->setFormAction($this->
ctrl->getFormAction($this,
'exportEvaluation'));
277 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
280 'excel' => $this->
lng->txt(
'exp_type_excel'),
281 'csv' => $this->
lng->txt(
'exp_type_spss')
284 if (!$this->
object->getAnonymity()) {
287 if ($globalCertificatePrerequisites->validate()) {
288 $options[
'certificate'] = $this->
lng->txt(
'exp_type_certificate');
294 $export_type->setOptions($options);
296 $ilToolbar->addInputItem($export_type,
true);
297 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
299 $button->setCommand(
'exportEvaluation');
300 $button->setCaption(
'export');
302 $ilToolbar->addButtonInstance($button);
306 if ($this->
object->getShowSolutionAnswersOnly()) {
310 $this->tpl->setContent($table_gui->getHTML());
330 $active_id = $this->testrequest->raw(
'active_id');
332 if (!$this->
getTestAccess()->checkResultsAccessForActiveId($active_id)) {
336 if (strlen($active_id) == 0) {
337 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'detailed_evaluation_missing_active_id'),
true);
338 $this->
ctrl->redirect($this,
'outEvaluation');
343 $toolbar = $DIC[
'ilToolbar'];
345 require_once
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
347 $backBtn->setCaption(
'back');
348 $backBtn->setUrl($this->
ctrl->getLinkTarget($this,
'outEvaluation'));
349 $toolbar->addInputItem($backBtn);
351 $this->
object->setAccessFilteredParticipantList(
352 $this->
object->buildStatisticsAccessFilteredParticipantList()
355 $data = $this->
object->getCompleteEvaluationData();
357 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
359 $form->setTitle(sprintf(
360 $this->
lng->txt(
'detailed_evaluation_for'),
361 $data->getParticipant($active_id)->getName()
365 $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()) .
" %" .
")");
366 $form->addItem($resultPoints);
368 if (strlen(
$data->getParticipant($active_id)->getMark())) {
370 $resultMarks->
setValue(
$data->getParticipant($active_id)->getMark());
371 $form->addItem($resultMarks);
372 if (strlen(
$data->getParticipant($active_id)->getECTSMark())) {
374 $ectsGrade->
setValue(
$data->getParticipant($active_id)->getECTSMark());
375 $form->addItem($ectsGrade);
379 if ($this->
object->isOfferingQuestionHintsEnabled()) {
381 $requestHints->
setValue(
$data->getParticipant($active_id)->getRequestedHintsCountFromScoredPass());
382 $form->addItem($requestHints);
385 $time_seconds =
$data->getParticipant($active_id)->getTimeOfWork();
386 $atime_seconds =
$data->getParticipant($active_id)->getNumberOfQuestions() ? $time_seconds /
$data->getParticipant($active_id)->getNumberOfQuestions() : 0;
387 $time_hours = floor($time_seconds / 3600);
388 $time_seconds -= $time_hours * 3600;
389 $time_minutes = floor($time_seconds / 60);
390 $time_seconds -= $time_minutes * 60;
392 $timeOfWork->
setValue(sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
393 $form->addItem($timeOfWork);
395 $this->tpl->setVariable(
"TXT_ATIMEOFWORK", $this->
lng->txt(
""));
396 $time_hours = floor($atime_seconds / 3600);
397 $atime_seconds -= $time_hours * 3600;
398 $time_minutes = floor($atime_seconds / 60);
399 $atime_seconds -= $time_minutes * 60;
401 $avgTimeOfWork->
setValue(sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $atime_seconds));
402 $form->addItem($avgTimeOfWork);
406 $form->addItem($firstVisit);
410 $form->addItem($lastVisit);
413 $nrPasses->
setValue(
$data->getParticipant($active_id)->getLastPass() + 1);
414 $form->addItem($nrPasses);
418 $scoredPass->
setValue(
$data->getParticipant($active_id)->getBestPass() + 1);
420 $scoredPass->setValue(
$data->getParticipant($active_id)->getLastPass() + 1);
422 $form->addItem($scoredPass);
424 $median =
$data->getStatistics()->getStatistics()->median();
425 $pct =
$data->getParticipant($active_id)->getMaxpoints() ? ($median /
$data->getParticipant($active_id)->getMaxpoints()) * 100.0 : 0;
426 $mark = $this->
object->mark_schema->getMatchingMark($pct);
427 if (is_object($mark)) {
429 $markMedian->
setValue($mark->getShortName());
430 $form->addItem($markMedian);
434 $rankParticipant->
setValue(
$data->getStatistics()->getStatistics()->rank(
$data->getParticipant($active_id)->getReached()));
435 $form->addItem($rankParticipant);
438 $rankMedian->
setValue(
$data->getStatistics()->getStatistics()->rank_median());
439 $form->addItem($rankMedian);
442 $totalParticipants->
setValue(
$data->getStatistics()->getStatistics()->count());
443 $form->addItem($totalParticipants);
447 $form->addItem($medianField);
449 $this->tpl->setContent($form->getHTML());
453 for ($pass = 0; $pass <=
$data->getParticipant($active_id)->getLastPass(); $pass++) {
455 if ($finishdate > 0) {
456 if (($DIC->access()->checkAccess(
'write',
'', $this->testrequest->getRefId()))) {
457 $this->
ctrl->setParameter($this,
'statistics',
'1');
458 $this->
ctrl->setParameter($this,
'active_id', $active_id);
459 $this->
ctrl->setParameter($this,
'pass', $pass);
461 $this->
ctrl->setParameter($this,
'statistics',
'');
462 $this->
ctrl->setParameter($this,
'active_id',
'');
463 $this->
ctrl->setParameter($this,
'pass',
'');
466 require_once
'Modules/Test/classes/tables/class.ilTestDetailedEvaluationStatisticsTableGUI.php';
468 $table->
setTitle(sprintf($this->
lng->txt(
"tst_eval_question_points"), $pass + 1));
469 if (($DIC->access()->checkAccess(
'write',
'', $this->testrequest->getRefId()))) {
470 $table->addCommandButton(
'outParticipantsPassDetails', $this->
lng->txt(
'tst_show_answer_sheet'));
473 $questions =
$data->getParticipant($active_id)->getQuestions($pass);
474 if (!is_array($questions)) {
475 $questions =
$data->getParticipant($active_id)->getQuestions(0);
478 $tableData = array();
481 foreach ((array) $questions as $question) {
482 $userDataData = array(
483 'counter' => ++$counter,
484 'id' => $question[
'id'],
485 'id_txt' => $this->
lng->txt(
'question_id_short'),
486 'title' => $this->
refinery->string()->stripTags()->transform(
487 $data->getQuestionTitle($question[
'id'])
491 $answeredquestion =
$data->getParticipant($active_id)->getPass($pass)->getAnsweredQuestionByQuestionId($question[
"id"]);
492 if (is_array($answeredquestion)) {
493 $percent = $answeredquestion[
'points'] ? $answeredquestion[
'reached'] / $answeredquestion[
'points'] * 100.0 : 0;
494 $userDataData[
'points'] = $answeredquestion[
'reached'] .
' ' . strtolower($this->
lng->txt(
'of')) .
" " . $answeredquestion[
'points'] .
' (' . sprintf(
"%.2f", $percent) .
' %)';
496 $userDataData[
'points'] =
'0 ' . strtolower($this->
lng->txt(
'of')) .
' ' . $question[
'points'] .
' (' . sprintf(
"%.2f", 0) .
' %) - ' . $this->
lng->txt(
'question_not_answered');
499 $tableData[] = $userDataData;
501 $table->setData($tableData);
503 $tables[] = $table->getHTML();
508 $DIC[
'tpl']->setContent($form->getHTML() . implode(
'', $tables));
526 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
529 $question_object->deliverFileUploadZIPFile(
531 $this->
object->getTestId(),
532 $this->
object->getTitle()
535 $this->
ctrl->redirect($this,
"singleResults");
549 $ilToolbar = $DIC->toolbar();
557 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_anonymous_aggregation.html",
"Modules/Test");
559 $this->
object->setAccessFilteredParticipantList(
560 $this->
object->buildStatisticsAccessFilteredParticipantList()
563 $eval = $this->
object->getCompleteEvaluationData();
565 $foundParticipants = $eval->getParticipants();
566 if (count($foundParticipants)) {
567 $ilToolbar->setFormName(
'form_output_eval');
568 $ilToolbar->setFormAction($this->
ctrl->getFormAction($this,
'exportAggregatedResults'));
569 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
571 $export_type->setOptions(array(
572 'excel' => $this->
lng->txt(
'exp_type_excel'),
573 'csv' => $this->
lng->txt(
'exp_type_spss')
575 $ilToolbar->addInputItem($export_type,
true);
576 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
578 $button->setCommand(
'exportAggregatedResults');
579 $button->setCaption(
'export');
581 $ilToolbar->addButtonInstance($button);
583 array_push(
$data, array(
584 'result' => $this->
lng->txt(
"tst_eval_total_persons"),
585 'value' => count($foundParticipants)
587 $total_finished = $eval->getTotalFinishedParticipants();
588 array_push(
$data, array(
589 'result' => $this->
lng->txt(
"tst_eval_total_finished"),
590 'value' => $total_finished
592 $average_time = $this->
object->evalTotalStartedAverageTime(
593 $eval->getParticipantIds()
595 $diff_seconds = $average_time;
596 $diff_hours = floor($diff_seconds / 3600);
597 $diff_seconds -= $diff_hours * 3600;
598 $diff_minutes = floor($diff_seconds / 60);
599 $diff_seconds -= $diff_minutes * 60;
600 array_push(
$data, array(
601 'result' => $this->
lng->txt(
"tst_eval_total_finished_average_time"),
602 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
605 $total_passed_reached = 0;
606 $total_passed_max = 0;
607 $total_passed_time = 0;
608 foreach ($foundParticipants as $userdata) {
609 if ($userdata->getPassed()) {
611 $total_passed_reached += $userdata->getReached();
612 $total_passed_max += $userdata->getMaxpoints();
613 $total_passed_time += $userdata->getTimeOfWork();
616 $average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
617 $average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
618 $average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
619 array_push(
$data, array(
620 'result' => $this->
lng->txt(
"tst_eval_total_passed"),
621 'value' => $total_passed
623 array_push(
$data, array(
624 'result' => $this->
lng->txt(
"tst_eval_total_passed_average_points"),
625 'value' => sprintf(
"%2.2f", $average_passed_reached) .
" " . strtolower($this->
lng->txt(
"of")) .
" " . sprintf(
"%2.2f", $average_passed_max)
627 $average_time = $average_passed_time;
628 $diff_seconds = $average_time;
629 $diff_hours = floor($diff_seconds / 3600);
630 $diff_seconds -= $diff_hours * 3600;
631 $diff_minutes = floor($diff_seconds / 60);
632 $diff_seconds -= $diff_minutes * 60;
633 array_push(
$data, array(
634 'result' => $this->
lng->txt(
"tst_eval_total_passed_average_time"),
635 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
639 include_once
"./Modules/Test/classes/tables/class.ilTestAggregatedResultsTableGUI.php";
641 $table_gui->setData(
$data);
642 $this->tpl->setVariable(
'AGGREGATED_RESULTS', $table_gui->getHTML());
646 foreach ($eval->getQuestionTitles() as $question_id => $question_title) {
650 foreach ($foundParticipants as $userdata) {
651 for (
$i = 0;
$i <= $userdata->getLastPass();
$i++) {
652 if (is_object($userdata->getPass(
$i))) {
653 $question = $userdata->getPass(
$i)->getAnsweredQuestionByQuestionId($question_id);
654 if (is_array($question)) {
656 $reached += $question[
"reached"];
657 $max += $question[
"points"];
662 $percent = $max ? $reached / $max * 100.0 : 0;
664 $this->
ctrl->setParameter($this,
"qid", $question_id);
666 $points_reached = ($answered ? $reached / $answered : 0);
667 $points_max = ($answered ? $max / $answered : 0);
671 'qid' => $question_id,
672 'title' => $this->
refinery->string()->stripTags()->transform($question_title),
673 'points' => $points_reached,
674 'points_reached' => $points_reached,
675 'points_max' => $points_max,
676 'percentage' => (float) $percent,
677 'answers' => $answered
681 include_once
"./Modules/Test/classes/tables/class.ilTestAverageReachedPointsTableGUI.php";
683 $table_gui->setData(
$rows);
684 $this->tpl->setVariable(
'TBL_AVG_REACHED', $table_gui->getHTML());
693 if ($this->testrequest->isset(
"g_filterby")) {
694 $filterby = $this->testrequest->raw(
"g_filterby");
698 if ($this->testrequest->isset(
"g_userfilter")) {
699 $filtertext = $this->testrequest->raw(
"g_userfilter");
703 if ($this->testrequest->isset(
"g_passedonly")) {
704 if ($this->testrequest->raw(
"g_passedonly") == 1) {
709 require_once
'Modules/Test/classes/class.ilTestExportFactory.php';
712 switch ($this->testrequest->raw(
"export_type")) {
714 $expFactory->getExporter(
'results')->exportToExcel(
723 $expFactory->getExporter(
'results')->exportToCSV(
733 $this->
ctrl->setParameterByClass(
"iltestcertificategui",
"g_passedonly",
"1");
735 if (strlen($filtertext)) {
736 $this->
ctrl->setParameterByClass(
"iltestcertificategui",
"g_userfilter", $filtertext);
738 $this->
ctrl->redirect($this,
"exportCertificate");
750 require_once
'Modules/Test/classes/class.ilTestExportFactory.php';
752 $exportObj = $expFactory->getExporter(
'aggregated');
754 switch ($_POST[
"export_type"]) {
756 $exportObj->exportToExcel($deliver =
true);
759 $exportObj->exportToCSV($deliver =
true);
775 if (!$globalCertificatePrerequisites->validate()) {
776 $DIC[
'ilErr']->raiseError($this->
lng->txt(
'permission_denied'), $DIC[
'ilErr']->MESSAGE);
779 $database = $DIC->database();
780 $logger = $DIC->logger()->root();
783 $objectId = $this->
object->getId();
786 $pathFactory->create($this->object)
790 $total_users = array();
792 $this->
object->setAccessFilteredParticipantList(
793 $this->
object->buildStatisticsAccessFilteredParticipantList()
797 $pdfGenerator =
new ilPdfGenerator($ilUserCertificateRepository, $logger);
799 $total_users = $this->
object->evalTotalPersonsArray();
800 if (count($total_users)) {
803 foreach ($total_users as $active_id =>
$name) {
804 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
806 if (!$certValidator->isCertificateDownloadable($user_id, $objectId)) {
814 $this->
lng->txt(
'error_creating_certificate_pdf')
817 $pdf = $pdfAction->
createPDF($user_id, $objectId);
819 $zipAction->addPDFtoArchiveDirectory($pdf, $archive_dir, $user_id .
"_" . str_replace(
826 $zipArchive = $zipAction->zipCertificatesInArchiveDirectory($archive_dir,
true);
838 if ($original_id > 0) {
855 $ilTabs = $DIC[
'ilTabs'];
856 $ilAccess = $DIC[
'ilAccess'];
857 $ilObjDataCache = $DIC[
'ilObjDataCache'];
859 $active_id = (
int) $this->testrequest->raw(
"active_id");
861 if (!$this->
getTestAccess()->checkResultsAccessForActiveId($active_id)) {
865 $this->
ctrl->saveParameter($this,
"active_id");
866 $testSession = $this->testSessionFactory->getSession($active_id);
869 if ($testSession->getTestId() != $this->
object->getTestId()) {
873 $this->
ctrl->saveParameter($this,
"pass");
874 $pass = (
int) $this->testrequest->raw(
"pass");
876 if ($this->testrequest->isset(
'statistics') && $this->testrequest->raw(
'statistics') == 1) {
877 $this->
ctrl->setParameterByClass(
"ilTestEvaluationGUI",
"active_id", $active_id);
878 $this->
ctrl->saveParameter($this,
'statistics');
880 $ilTabs->setBackTarget(
881 $this->
lng->txt(
'back'),
882 $this->
ctrl->getLinkTargetByClass(
'ilTestEvaluationGUI',
'detailedEvaluation')
884 } elseif ($this->
object->getNrOfTries() == 1) {
885 $ilTabs->setBackTarget(
886 $this->
lng->txt(
'back'),
887 $this->
ctrl->getLinkTargetByClass(
'ilParticipantsTestResultsGUI')
890 $ilTabs->setBackTarget(
891 $this->
lng->txt(
'tst_results_back_overview'),
892 $this->
ctrl->getLinkTarget($this,
'outParticipantsResultsOverview')
901 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
904 $objectivesList = null;
907 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
908 $testSequence->loadFromDb();
909 $testSequence->loadQuestions();
911 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
915 $objectivesList->loadObjectivesTitles();
917 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
918 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
919 $testResultHeaderLabelBuilder->setTestObjId($this->
object->getId());
920 $testResultHeaderLabelBuilder->setTestRefId($this->
object->getRefId());
921 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
931 "outParticipantsPassDetails",
936 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
938 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
940 $template =
new ilTemplate(
"tpl.il_as_tst_pass_details_overview_participants.html",
true,
true,
"Modules/Test");
944 $this->
ctrl->setParameter($this,
'pdf',
'1');
945 $toolbar->setPdfExportLinkTarget($this->
ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
946 $this->
ctrl->setParameter($this,
'pdf',
'');
948 if ($this->testrequest->isset(
'show_best_solutions')) {
950 } elseif ($this->testrequest->isset(
'hide_best_solutions')) {
952 } elseif (
ilSession::get(
'tst_results_show_best_solutions') !== null) {
957 $this->
ctrl->setParameter($this,
'hide_best_solutions',
'1');
958 $toolbar->setHideBestSolutionsLinkTarget($this->
ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
959 $this->
ctrl->setParameter($this,
'hide_best_solutions',
'');
961 $this->
ctrl->setParameter($this,
'show_best_solutions',
'1');
962 $toolbar->setShowBestSolutionsLinkTarget($this->
ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
963 $this->
ctrl->setParameter($this,
'show_best_solutions',
'');
967 $template->setVariable(
'RESULTS_TOOLBAR', $this->
ctrl->getHTML($toolbar));
971 $gradingMessageBuilder->buildList();
973 $template->setCurrentBlock(
'grading_message');
974 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
975 $template->parseCurrentBlock();
978 $list_of_answers = $this->
getPassListOfAnswers($result_array, $active_id, $pass,
ilSession::get(
'tst_results_show_best_solutions'),
false,
false,
false,
true, $objectivesList, $testResultHeaderLabelBuilder);
979 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
980 $template->setVariable(
"PASS_DETAILS", $this->
ctrl->getHTML($overviewTableGUI));
982 $data = $this->
object->getCompleteEvaluationData();
983 $data->getParticipant($active_id)->setPassScoring($pass);
984 $result =
$data->getParticipant($active_id)->getReached() .
" " . strtolower($this->
lng->txt(
"of")) .
" " .
$data->getParticipant($active_id)->getMaxpoints() .
" (" . sprintf(
"%2.2f",
$data->getParticipant($active_id)->getReachedPointsInPercent()) .
" %" .
")";
985 $template->setCurrentBlock(
'total_score');
986 $template->setVariable(
"TOTAL_RESULT_TEXT", $this->
lng->txt(
'tst_stat_result_resultspoints'));
987 $template->setVariable(
"TOTAL_RESULT", $result);
988 $template->parseCurrentBlock();
991 $template->setVariable(
"USER_DATA", $user_data);
993 $uname = $this->
object->userLookupFullName($user_id);
994 $template->setVariable(
"TEXT_HEADING", sprintf($this->
lng->txt(
"tst_result_user_name_pass"), $pass + 1, $uname));
996 $template->setVariable(
"TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
999 $template->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this));
1005 if ($this->
object->getShowSolutionAnswersOnly()) {
1013 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1025 $ilTabs = $DIC[
'ilTabs'];
1026 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1028 $active_id = (
int) $this->testrequest->raw(
"active_id");
1030 if (!$this->
getTestAccess()->checkResultsAccessForActiveId($active_id)) {
1034 $testSession = $this->testSessionFactory->getSession($active_id);
1037 if ($testSession->getTestId() != $this->
object->getTestId()) {
1041 if ($this->
object->getNrOfTries() == 1) {
1042 $this->
ctrl->setParameter($this,
"active_id", $active_id);
1044 $this->
ctrl->redirect($this,
"outParticipantsPassDetails");
1047 $ilTabs->setBackTarget(
1048 $this->
lng->txt(
'back'),
1049 $this->
ctrl->getLinkTargetByClass([
'ilObjTestGUI',
'ilTestResultsGUI',
'ilParticipantsTestResultsGUI'])
1057 $template =
new ilTemplate(
"tpl.il_as_tst_pass_overview_participants.html",
true,
true,
"Modules/Test");
1061 $this->
ctrl->setParameter($this,
'pdf',
'1');
1062 $toolbar->setPdfExportLinkTarget($this->
ctrl->getLinkTarget($this, __FUNCTION__));
1063 $this->
ctrl->setParameter($this,
'pdf',
'');
1066 $template->setVariable(
'RESULTS_TOOLBAR', $this->
ctrl->getHTML($toolbar));
1068 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1071 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1072 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1073 $testResultHeaderLabelBuilder->setTestObjId($this->
object->getId());
1074 $testResultHeaderLabelBuilder->setTestRefId($this->
object->getRefId());
1075 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1079 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1081 $testPassesSelector->setActiveId($testSession->getActiveId());
1082 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1085 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1086 $passOverViewTableGUI->setResultPresentationEnabled(
true);
1087 $passOverViewTableGUI->setPassDetailsCommand(
'outParticipantsPassDetails');
1088 $passOverViewTableGUI->init();
1089 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getExistingPasses(),
true));
1090 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1091 $template->setVariable(
"PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1095 $gradingMessageBuilder->buildList();
1097 $template->setCurrentBlock(
'grading_message');
1098 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
1099 $template->parseCurrentBlock();
1103 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
1106 if ($this->
object->getAnonymity()) {
1107 $template->setVariable(
"TEXT_HEADING", $this->
lng->txt(
"tst_result"));
1109 $uname = $this->
object->userLookupFullName($user_id,
true);
1110 $template->setVariable(
"TEXT_HEADING", sprintf($this->
lng->txt(
"tst_result_user_name"), $uname));
1111 $template->setVariable(
"USER_DATA", $user_data);
1115 $template->parseCurrentBlock();
1119 if ($this->
object->getShowSolutionAnswersOnly()) {
1123 if ($this->testrequest->isset(
"pdf") && ($this->testrequest->raw(
"pdf") == 1)) {
1127 $filename =
$name[
'lastname'] .
'_' .
$name[
'firstname'] .
'_' .
$name[
'login'] .
'__' . $this->
object->getTitleFilenameCompliant();
1132 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1139 $tableGUI->initFilter();
1140 $tableGUI->resetOffset();
1141 $tableGUI->writeFilterToSession();
1148 $tableGUI->initFilter();
1149 $tableGUI->resetOffset();
1150 $tableGUI->resetFilter();
1157 $tableGUI->initFilter();
1158 $tableGUI->resetOffset();
1159 $tableGUI->writeFilterToSession();
1166 $tableGUI->initFilter();
1167 $tableGUI->resetOffset();
1168 $tableGUI->resetFilter();
1183 $ilTabs->clearSubTabs();
1184 $ilTabs->setBackTarget($this->
lng->txt(
'tst_results_back_overview'), $this->
ctrl->getLinkTarget($this));
1186 $testSession = $this->testSessionFactory->getSession();
1188 if (!$this->
object->getShowPassDetails()) {
1189 $this->
ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1192 $active_id = $testSession->getActiveId();
1193 $user_id = $testSession->getUserId();
1195 $this->
ctrl->saveParameter($this,
"pass");
1196 $pass = $this->testrequest->raw(
"pass");
1205 $objectivesList = null;
1207 $considerHiddenQuestions =
true;
1208 $considerOptionalQuestions =
true;
1211 $considerHiddenQuestions =
false;
1213 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
1214 $testSequence->loadFromDb();
1215 $testSequence->loadQuestions();
1217 if ($this->
object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed()) {
1218 $considerOptionalQuestions =
false;
1224 $objectivesList->loadObjectivesTitles();
1226 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1227 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1228 $testResultHeaderLabelBuilder->setTestObjId($this->
object->getId());
1229 $testResultHeaderLabelBuilder->setTestRefId($this->
object->getRefId());
1230 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1233 $result_array = $this->
getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions);
1235 $command_solution_details =
"";
1236 if ($this->
object->getShowSolutionDetails()) {
1237 $command_solution_details =
"outCorrectSolution";
1241 $questionAnchorNav =
1242 $this->
object->getShowSolutionListOwnAnswers();
1244 $tpl =
new ilTemplate(
'tpl.il_as_tst_pass_details_overview_participants.html',
true,
true,
"Modules/Test");
1249 $this->
ctrl->setParameter($this,
'pdf',
'1');
1250 $toolbar->setPdfExportLinkTarget($this->
ctrl->getLinkTarget($this,
'outUserPassDetails'));
1251 $this->
ctrl->setParameter($this,
'pdf',
'');
1254 if ($validator->isCertificateDownloadable($user_id, $this->object->getId())) {
1255 $toolbar->setCertificateLinkTarget($this->
ctrl->getLinkTarget($this,
'outCertificate'));
1260 $tpl->setVariable(
'RESULTS_TOOLBAR', $this->
ctrl->getHTML($toolbar));
1262 $tpl->setCurrentBlock(
'signature');
1264 $tpl->parseCurrentBlock();
1266 if ($this->
object->isShowExamIdInTestResultsEnabled()) {
1268 $testSession->getActiveId(),
1271 $tpl->setVariable(
'EXAM_ID_TXT', $this->
lng->txt(
'exam_id'));
1278 $gradingMessageBuilder->buildMessage();
1279 $gradingMessageBuilder->sendMessage();
1287 "outUserPassDetails",
1288 $command_solution_details,
1292 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
1293 $tpl->setVariable(
"PASS_DETAILS", $this->
ctrl->getHTML($overviewTableGUI));
1295 $data = $this->
object->getCompleteEvaluationData();
1296 $reached =
$data->getParticipant($active_id)->getPass($pass)->getReachedPoints();
1297 $max =
$data->getParticipant($active_id)->getPass($pass)->getMaxPoints();
1298 $percent = $max ? $reached / $max * 100.0 : 0;
1299 $result =
$data->getParticipant($active_id)->getPass($pass)->getReachedPoints() .
" " . strtolower($this->
lng->txt(
"of")) .
" " .
$data->getParticipant($active_id)->getPass($pass)->getMaxPoints() .
" (" . sprintf(
"%2.2f", $percent) .
" %" .
")";
1300 $tpl->setCurrentBlock(
'total_score');
1301 $tpl->setVariable(
"TOTAL_RESULT_TEXT", $this->
lng->txt(
'tst_stat_result_resultspoints'));
1302 $tpl->setVariable(
"TOTAL_RESULT", $result);
1303 $tpl->parseCurrentBlock();
1305 if ($this->
object->getShowSolutionListOwnAnswers()) {
1310 $this->
object->getShowSolutionListComparison(),
1316 $testResultHeaderLabelBuilder
1318 $tpl->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1321 $tpl->setVariable(
"TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
1322 $tpl->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this));
1324 $uname = $this->
object->userLookupFullName($user_id,
true);
1327 if ($this->
object->getAnonymity()) {
1328 $tpl->setVariable(
"TEXT_HEADING", $this->
lng->txt(
"tst_result_pass"));
1330 $tpl->setVariable(
"TEXT_HEADING", sprintf($this->
lng->txt(
"tst_result_user_name_pass"), $pass + 1, $uname));
1331 $tpl->setVariable(
"USER_DATA", $user_data);
1339 if ($this->
object->getShowSolutionAnswersOnly()) {
1346 $this->tpl->setContent(
$tpl->get());
1359 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1361 $testSession = $this->testSessionFactory->getSession();
1362 $active_id = $testSession->getActiveId();
1364 $uname = $this->
object->userLookupFullName($user_id,
true);
1366 if (!$this->
object->canShowTestResults($testSession)) {
1367 $this->
ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1375 $templatehead =
new ilTemplate(
"tpl.il_as_tst_results_participants.html",
true,
true,
"Modules/Test");
1376 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html",
true,
true,
"Modules/Test");
1380 $this->
ctrl->setParameter($this,
'pdf',
'1');
1381 $toolbar->setPdfExportLinkTarget($this->
ctrl->getLinkTarget($this,
'outUserResultsOverview'));
1382 $this->
ctrl->setParameter($this,
'pdf',
'');
1385 if ($validator->isCertificateDownloadable($user_id, $this->object->getId())) {
1386 $toolbar->setCertificateLinkTarget($this->
ctrl->getLinkTarget($this,
'outCertificate'));
1391 $templatehead->setVariable(
'RESULTS_TOOLBAR', $this->
ctrl->getHTML($toolbar));
1393 $passDetailsEnabled = $this->
object->getShowPassDetails();
1394 #if (!$passDetailsEnabled) 1396 # $executable = $this->object->isExecutable($testSession, $ilUser->getId()); 1397 # if (!$executable["executable"]) $passDetailsEnabled = true; 1400 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1403 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1404 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1405 $testResultHeaderLabelBuilder->setTestObjId($this->
object->getId());
1406 $testResultHeaderLabelBuilder->setTestRefId($this->
object->getRefId());
1407 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1410 $template->setCurrentBlock(
"pass_overview");
1413 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1415 $testPassesSelector->setActiveId($testSession->getActiveId());
1416 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1419 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1420 $passOverViewTableGUI->setResultPresentationEnabled(
true);
1421 if ($passDetailsEnabled) {
1422 $passOverViewTableGUI->setPassDetailsCommand(
'outUserPassDetails');
1424 if ($this->
object->isPassDeletionAllowed()) {
1425 $passOverViewTableGUI->setPassDeletionCommand(
'confirmDeletePass');
1427 $passOverViewTableGUI->init();
1428 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getReportablePasses(),
true));
1429 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1430 $overview = $passOverViewTableGUI->getHTML();
1432 require_once
'Modules/Test/classes/class.ilTestLearningObjectivesStatusGUI.php';
1435 $loStatus->setUsrId($testSession->getUserId());
1436 $overview .=
"<br />" . $loStatus->getHTML();
1438 $template->setVariable(
"PASS_OVERVIEW", $overview);
1439 $template->parseCurrentBlock();
1443 $gradingMessageBuilder->buildMessage();
1444 $gradingMessageBuilder->sendMessage();
1450 if ($this->
object->getAnonymity()) {
1451 $template->setVariable(
"TEXT_HEADING", $this->
lng->txt(
"tst_result"));
1453 $template->setVariable(
"TEXT_HEADING", sprintf($this->
lng->txt(
"tst_result_user_name"), $uname));
1454 $template->setVariable(
"USER_DATA", $user_data);
1459 if ($this->
object->getShowSolutionAnswersOnly()) {
1462 $templatehead->setVariable(
"RESULTS_PARTICIPANT", $template->get());
1467 $this->tpl->setContent($templatehead->get());
1482 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1484 if (!$this->
object->getShowSolutionPrintview()) {
1485 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"no_permission"),
true);
1486 $this->
ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1489 $template =
new ilTemplate(
"tpl.il_as_tst_info_list_of_answers.html",
true,
true,
"Modules/Test");
1492 if ($this->testrequest->isset(
"pass")) {
1493 if (strlen($this->testrequest->raw(
"pass"))) {
1494 $pass = $this->testrequest->raw(
"pass");
1499 $testSession = $this->testSessionFactory->getSession();
1500 $active_id = $testSession->getActiveId();
1502 $template->setVariable(
"TEXT_RESULTS", $this->
lng->txt(
"tst_passes"));
1505 $testPassesSelector->setActiveId($testSession->getActiveId());
1506 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1509 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1510 $passOverViewTableGUI->setResultPresentationEnabled(
false);
1511 $passOverViewTableGUI->setPassDetailsCommand(
'outUserListOfAnswerPasses');
1512 $passOverViewTableGUI->init();
1513 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getClosedPasses(),
false));
1514 $template->setVariable(
"PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1517 if (strlen($pass)) {
1520 $objectivesList = null;
1523 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
1524 $testSequence->loadFromDb();
1525 $testSequence->loadQuestions();
1530 $objectivesList->loadObjectivesTitles();
1532 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1533 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1534 $testResultHeaderLabelBuilder->setTestObjId($this->
object->getId());
1535 $testResultHeaderLabelBuilder->setTestRefId($this->
object->getRefId());
1536 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1539 $result_array = $this->
object->getTestResult(
1547 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
1548 $showAllAnswers =
true;
1549 if ($this->
object->isExecutable($testSession, $user_id)) {
1550 $showAllAnswers =
false;
1553 $answers = $this->
getPassListOfAnswers($result_array, $active_id, $pass,
false, $showAllAnswers,
false,
false,
false, $objectivesList, $testResultHeaderLabelBuilder);
1554 $template->setVariable(
"PASS_DETAILS", $answers);
1556 $template->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this));
1557 $template->setVariable(
"PRINT_TEXT", $this->
lng->txt(
"print"));
1558 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
1561 $template->setVariable(
"USER_DATA", $user_data);
1562 $template->setVariable(
"TEXT_LIST_OF_ANSWERS", $this->
lng->txt(
"tst_list_of_answers"));
1563 if (strlen($signature)) {
1564 $template->setVariable(
"SIGNATURE", $signature);
1566 if (!is_null($pass) && $this->
object->isShowExamIdInTestResultsEnabled()) {
1567 $template->setCurrentBlock(
'exam_id_footer');
1569 $testSession->getActiveId(),
1572 $template->setVariable(
'EXAM_ID_TXT', $this->
lng->txt(
'exam_id'));
1573 $template->parseCurrentBlock();
1575 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1578 if ($this->
object->getShowSolutionAnswersOnly()) {
1594 if ($this->testrequest->isset(
"pass") && (strlen($this->testrequest->raw(
"pass")) > 0)) {
1595 $this->
ctrl->saveParameter($this,
"pass");
1596 $this->
ctrl->saveParameter($this,
"active_id");
1597 $this->outTestResults(
false, $this->testrequest->raw(
"pass"));
1599 $this->outTestResults(
false);
1615 $this->
object->setAccessFilteredParticipantList(
1616 $this->
object->buildStatisticsAccessFilteredParticipantList()
1621 $data = $this->
object->getCompleteEvaluationData();
1622 $color_class = array(
"tblrow1",
"tblrow2");
1624 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_single_answers.html",
"Modules/Test");
1625 $foundParticipants =
$data->getParticipants();
1626 if (count($foundParticipants) == 0) {
1627 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"tst_no_evaluation_data"));
1631 foreach (
$data->getQuestionTitles() as $question_id => $question_title) {
1635 foreach ($foundParticipants as $userdata) {
1636 $pass = $userdata->getScoredPass();
1637 if (is_object($userdata->getPass($pass))) {
1638 $question = $userdata->getPass($pass)->getAnsweredQuestionByQuestionId($question_id);
1639 if (is_array($question)) {
1645 $this->
ctrl->setParameter($this,
"qid", $question_id);
1646 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
1650 if ($question_object->hasFileUploads($this->object->getTestId())) {
1651 $download =
"<a href=\"" . $this->
ctrl->getLinkTarget($this,
"exportFileUploadsForAllParticipants") .
"\">" . $this->
lng->txt(
"download") .
"</a>";
1657 'qid' => $question_id,
1658 'question_title' => $this->
refinery->string()->stripTags()->transform($question_title),
1659 'number_of_answers' => $answered,
1660 'output' =>
"<a href=\"" . $this->
ctrl->getLinkTarget($this,
"exportQuestionForAllParticipants") .
"\">" . $this->
lng->txt(
"pdf_export") .
"</a>",
1661 'file_uploads' => $download
1666 require_once
'./Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php';
1668 $table_gui->setTitle($this->
lng->txt(
"tst_answered_questions_test"));
1669 $table_gui->setData(
$rows);
1671 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1673 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $this->
lng->txt(
"adm_no_special_users"));
1685 $user = $DIC->user();
1686 $database = $DIC->database();
1687 $logger = $DIC->logger()->root();
1690 $pdfGenerator =
new ilPdfGenerator($ilUserCertificateRepository, $logger);
1696 $this->
lng->txt(
'error_creating_certificate_pdf')
1699 $pdfAction->
downloadPdf($user->getId(), $this->
object->getId());
1704 if ($this->testrequest->isset(
'context') && strlen($this->testrequest->raw(
'context'))) {
1705 $context = $this->testrequest->raw(
'context');
1710 if (!$this->
object->isPassDeletionAllowed() && !$this->
object->isDynamicTest()) {
1714 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1717 $confirm->build((
int) $this->testrequest->raw(
"active_id"), (
int) $this->testrequest->raw(
"pass"),
$context);
1721 $tpl->setContent($this->
ctrl->getHTML($confirm));
1731 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1736 $this->
ctrl->redirect($this,
'outUserResultsOverview');
1741 $this->
ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
1746 $this->
ctrl->redirectByClass(
'ilTestPlayerDynamicQuestionSetGUI',
'startTest');
1750 public function performDeletePass()
1752 if (isset($_POST[
'context']) && strlen($_POST[
'context'])) {
1758 if (!$this->
object->isPassDeletionAllowed() && !$this->
object->isDynamicTest()) {
1763 $ilDB = $DIC[
'ilDB'];
1768 if (isset($_POST[
'active_id']) && (
int) $_POST[
'active_id']) {
1769 $active_fi = $_POST[
'active_id'];
1772 if (isset($_POST[
'pass']) && is_numeric($_POST[
'pass'])) {
1773 $pass = $_POST[
'pass'];
1776 if (is_null($active_fi) || is_null($pass)) {
1777 $this->
ctrl->redirect($this,
'outUserResultsOverview');
1780 if (!$this->
object->isDynamicTest() && $pass == $this->
object->_getResultPass($active_fi)) {
1781 $this->
ctrl->redirect($this,
'outUserResultsOverview');
1785 $result =
$ilDB->query(
" 1786 SELECT tst_active.tries, tst_active.last_finished_pass, tst_sequence.pass 1788 LEFT JOIN tst_sequence 1789 ON tst_sequence.active_fi = tst_active.active_id 1790 AND tst_sequence.pass = tst_active.tries 1791 WHERE tst_active.active_id = {$ilDB->quote($active_fi, 'integer')} 1794 $row =
$ilDB->fetchAssoc($result);
1796 $tries = $row[
'tries'];
1797 $lastFinishedPass = is_numeric($row[
'last_finished_pass']) ? $row[
'last_finished_pass'] : -1;
1799 if ($pass < $lastFinishedPass) {
1800 $isActivePass =
false;
1801 $must_renumber =
true;
1802 } elseif ($pass == $lastFinishedPass) {
1803 $isActivePass =
false;
1805 if ($tries == $row[
'pass']) {
1806 $must_renumber =
true;
1808 $must_renumber =
false;
1810 } elseif ($pass == $row[
'pass']) {
1811 $isActivePass =
true;
1812 $must_renumber =
false;
1814 throw new ilTestException(
'This should not happen, please contact Bjoern Heyser to clean up this pass salad!');
1817 if (!$this->
object->isDynamicTest() && $isActivePass) {
1818 $this->
ctrl->redirect($this,
'outUserResultsOverview');
1822 ($lastFinishedPass == 0 && $tries == 1 && $tries != $row[
'pass'])
1823 || ($isActivePass ==
true)
1836 WHERE active_id = ' .
$ilDB->quote($active_fi,
'integer')
1838 } elseif (!$isActivePass) {
1841 SET tries = ' .
$ilDB->quote($tries - 1,
'integer') .
', 1842 last_finished_pass = ' .
$ilDB->quote($lastFinishedPass - 1,
'integer') .
' 1843 WHERE active_id = ' .
$ilDB->quote($active_fi,
'integer')
1850 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1851 AND pass = ' .
$ilDB->quote($pass,
'integer')
1854 if ($must_renumber) {
1856 'UPDATE tst_manual_fb 1858 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1859 AND pass > ' .
$ilDB->quote($pass,
'integer')
1868 FROM tst_pass_result 1869 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1870 AND pass = ' .
$ilDB->quote($pass,
'integer')
1873 if ($must_renumber) {
1875 'UPDATE tst_pass_result 1877 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1878 AND pass > ' .
$ilDB->quote($pass,
'integer')
1891 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1892 AND pass = ' .
$ilDB->quote($pass,
'integer')
1895 if ($must_renumber) {
1897 'UPDATE tst_sequence 1899 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1900 AND pass > ' .
$ilDB->quote($pass,
'integer')
1904 if ($this->
object->isDynamicTest()) {
1906 'tst_seq_qst_tracking',
'tst_seq_qst_answstatus',
'tst_seq_qst_postponed',
'tst_seq_qst_checked' 1909 foreach ($tables as $table) {
1912 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')} 1913 AND pass = {$ilDB->quote($pass, 'integer')} 1916 if ($must_renumber) {
1920 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')} 1921 AND pass > {$ilDB->quote($pass, 'integer')} 1931 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1932 AND pass = ' .
$ilDB->quote($pass,
'integer')
1935 if ($must_renumber) {
1937 'UPDATE tst_solutions 1939 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1940 AND pass > ' .
$ilDB->quote($pass,
'integer')
1947 FROM tst_test_result 1948 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1949 AND pass = ' .
$ilDB->quote($pass,
'integer')
1952 if ($must_renumber) {
1954 'UPDATE tst_test_result 1956 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1957 AND pass > ' .
$ilDB->quote($pass,
'integer')
1964 FROM qpl_hint_tracking 1965 WHERE qhtr_active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1966 AND qhtr_pass = ' .
$ilDB->quote($pass,
'integer')
1969 if ($must_renumber) {
1971 'UPDATE qpl_hint_tracking 1972 SET qhtr_pass = qhtr_pass - 1 1973 WHERE qhtr_active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1974 AND qhtr_pass > ' .
$ilDB->quote($pass,
'integer')
1984 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1985 AND pass = ' .
$ilDB->quote($pass,
'integer')
1988 if ($must_renumber) {
1992 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1993 AND pass > ' .
$ilDB->quote($pass,
'integer')
1997 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
2003 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
2006 if ($this->
object->isDynamicTest()) {
2007 require_once
'Modules/Test/classes/tables/class.ilTestDynamicQuestionSetStatisticTableGUI.php';
2014 protected function getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions): array
2017 $ilDB = $DIC[
'ilDB'];
2018 $component_repository = $DIC[
'component.repository'];
2020 $resultData = $this->
object->getTestResult($active_id, $pass,
false, $considerHiddenQuestions);
2021 $questionIds = array();
2022 foreach ($resultData as $resultItemKey => $resultItemValue) {
2023 if ($resultItemKey ===
'test' || $resultItemKey ===
'pass') {
2027 $questionIds[] = $resultItemValue[
'qid'];
2031 $table_gui->initFilter();
2034 $questionList->setParentObjId($this->
object->getId());
2035 $questionList->setParentObjectType($this->
object->getType());
2036 $questionList->setIncludeQuestionIdsFilter($questionIds);
2037 $questionList->setQuestionInstanceTypeFilter(null);
2039 foreach ($table_gui->getFilterItems() as $item) {
2040 if (substr($item->getPostVar(), 0, strlen(
'tax_')) ==
'tax_') {
2041 $v = $item->getValue();
2043 if (is_array($v) && count($v) && !(
int) $v[0]) {
2047 $taxId = substr($item->getPostVar(), strlen(
'tax_'));
2048 $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->
object->getId(),
'tst');
2049 } elseif ($item->getValue() !==
false) {
2050 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
2054 $questionList->load();
2056 $filteredTestResult = array();
2058 foreach ($resultData as $resultItemKey => $resultItemValue) {
2059 if ($resultItemKey ===
'test' || $resultItemKey ===
'pass') {
2063 if (!$questionList->isInList($resultItemValue[
'qid'])) {
2067 $filteredTestResult[] = $resultItemValue;
2070 return $filteredTestResult;
2075 $activeId = (
int) $this->testrequest->raw(
"active_id");
2088 $testSession->loadFromDb($activeId);
2090 if ($testSession->isSubmitted()) {
2091 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'tst_already_submitted'),
true);
2095 if (($this->
object->isEndingTimeEnabled() || $this->
object->getEnableProcessingTime())
2096 && !$this->
object->endingTimeReached()
2097 && !$this->
object->isMaxProcessingTimeReached(
2098 $this->
object->getStartingTimeOfUser($activeId),
2101 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'finish_pass_for_user_in_processing_time'));
2106 $cgui->setHeaderText(sprintf(
2107 $this->
lng->txt(
"finish_pass_for_user_confirmation"),
2111 $this->
ctrl->setParameter($this,
'active_id', $activeId);
2112 $cgui->setFormAction($this->
ctrl->getFormAction($this,
"participants"));
2114 $cgui->setCancel($this->
lng->txt(
"cancel"),
"redirectBackToParticipantsScreen");
2115 $cgui->setConfirm($this->
lng->txt(
"proceed"),
"confirmFinishTestPassForUser");
2117 $this->tpl->setContent($cgui->getHTML());
2122 $activeId = (
int) $this->testrequest->raw(
"active_id");
2124 require_once
'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2127 require_once
'Modules/Test/classes/class.ilTestParticipantList.php';
2138 $testSession->loadFromDb($activeId);
2140 if ($testSession->isSubmitted()) {
2141 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'tst_already_submitted'),
true);
2145 assQuestion::_updateTestPassResults(
2147 $testSession->getPass(),
2148 $this->
object->areObligationsEnabled(),
2150 $this->
object->getId()
2161 $this->tpl->setOnScreenMessage(
2163 $this->
lng->txt(
'finish_pass_for_all_users_in_processing_time'),
2170 $cgui->setFormAction($this->
ctrl->getFormAction($this));
2171 $cgui->setHeaderText($this->
lng->txt(
"finish_pass_for_all_users"));
2172 $cgui->setCancel($this->
lng->txt(
"cancel"),
"redirectBackToParticipantsScreen");
2173 $cgui->setConfirm($this->
lng->txt(
"proceed"),
"confirmFinishTestPassForAllUser");
2174 $this->tpl->setContent($cgui->getHTML());
2179 if (!$this->
object->isEndingTimeEnabled() && !$this->
object->getEnableProcessingTime()
2180 || $this->
object->endingTimeReached()) {
2186 $participant_list->initializeFromDbRows($this->
object->getTestParticipants());
2188 foreach ($participant_list->getAccessFilteredList($access_filter) as $participant) {
2189 if ($participant->hasUnfinishedPasses()
2190 && !$this->
object->isMaxProcessingTimeReached(
2191 $this->
object->getStartingTimeOfUser($participant->getActiveId()),
2192 $participant->getActiveId()
2203 require_once
'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2206 require_once
'Modules/Test/classes/class.ilTestParticipantList.php';
2208 $participantList->initializeFromDbRows($this->
object->getTestParticipants());
2209 $participantList = $participantList->getAccessFilteredList($accessFilter);
2211 foreach ($participantList as $participant) {
2212 if (!$participant->hasUnfinishedPasses()) {
2217 $testSession->loadFromDb($participant->getActiveId());
2219 assQuestion::_updateTestPassResults(
2220 $participant->getActiveId(),
2221 $testSession->getPass(),
2222 $this->
object->areObligationsEnabled(),
2224 $this->
object->getId()
2227 $this->
finishTestPass($participant->getActiveId(), $this->
object->getId());
2236 $processLocker = $this->processLockerFactory->withContextId((
int) $active_id)->getLocker();
2239 $test_pass_finisher->performFinishTasks($processLocker);
2244 $this->
ctrl->redirectByClass(
"ilTestParticipantsGUI");
static get(string $a_var)
Class ilPdfGeneratorConstantsTest.
ilTestProcessLockerFactory $processLockerFactory
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
singleResults()
Creates user results for single questions.
getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
setContextResultPresentation($contextResultPresentation)
exportEvaluation()
Exports the evaluation data to a selected file format.
confirmFinishTestPassForAllUser()
outCertificate()
Output of a test certificate.
exportCertificate()
Exports the user results as PDF certificates using XSL-FO via XML:RPC calls.
static _updateTestResultCache(int $active_id, ilAssQuestionProcessLocker $processLocker=null)
Move this to a proper place.
outParticipantsResultsOverview()
Output of the pass overview for a test called from the statistics.
setTestAccess($testAccess)
static lookupPassResultsUpdateTimestamp($active_id, $pass)
getObjectiveOrientedContainer()
passDetails()
Output of the learners view of an existing test pass.
const PDF_USER_RESULT
PDF Purposes.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
executeCommand()
execute command
static _lookupName(int $a_user_id)
lookup user name
exportAggregatedResults()
Exports the aggregated results.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
outUserResultsOverview()
Output of the pass overview for a test called by a test participant.
getResultsSignature()
Returns HTML code for a signature field.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilObjTest $a_object)
ilTestEvaluationGUI constructor
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
static accessViolationRedirect()
confirmFinishTestPassForUser()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isGradingMessageRequired()
buildUserTestResultsToolbarGUI()
static getASCIIFilename(string $a_filename)
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
getEvaluationQuestionId($question_id, $original_id="")
Returns the ID of a question for evaluation purposes.
static instantiateQuestion(int $question_id)
static getInstance(ilTestSession $a_test_session)
static _enabledAssessmentLogging()
finishTestPass($active_id, $obj_id)
const CONTEXT_PASS_OVERVIEW
outParticipantsPassDetails()
Output of the pass details of an existing test pass for the test statistics.
buildPassOverviewTableGUI($targetGUI)
outUserPassDetailsResetTableFilter()
static _getResultPass($active_id)
Retrieves the pass number that should be counted for a given user.
Validates if an active certificate is stored in the database and can be downloaded by the user...
outParticipantsPassDetailsSetTableFilter()
static getAccessStatisticsUserFilter($refId)
finishTestPassForSingleUser()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
redirectBackToParticipantsScreen()
static lookupLastTestPassAccess($activeId, $passIndex)
static _lookupFields(int $a_user_id)
lookup fields (deprecated; use more specific methods instead)
const CONTEXT_INFO_SCREEN
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
exportFileUploadsForAllParticipants()
Creates a ZIP file containing all file uploads for a given question in a test.
Just a wrapper class to create Unit Test for other classes.
detailedEvaluation()
Creates the detailed evaluation output for a selected participant.
createPDF(int $userId, int $objectId)
redirectToPassDeletionContext($context)
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
hasUsersWithWorkingTimeAvailable()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getGradingMessageBuilder($activeId)
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getManageParticipantsUserFilter($refId)
exportQuestionForAllParticipants()
Creates a PDF representation of the answers for a given question in a test.
populatePassFinishDate($tpl, $passFinishDate)
populateExamId(ilTemplate $tpl, int $activeId, int $pass)
outUserPassDetails()
Output of the pass details of an existing test pass for the active test participant.
outEvaluation()
Creates the evaluation output for the test.
Service GUI class for tests.
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
static prepareGenerationRequest(string $service, string $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
outUserListOfAnswerPasses()
Output of the pass overview for a user when he/she wants to see his/her list of answers.
const PDF_OUTPUT_DOWNLOAD
static clear(string $a_var)
getPassDetailsOverviewTableGUI( $result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
outParticipantsPassDetailsResetTableFilter()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
outUserPassDetailsSetTableFilter()
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.
const CONTEXT_DYN_TEST_PLAYER
static set(string $a_var, $a_val)
Set a value.
eval_a()
Output of anonymous aggregated results for the test.
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
This method uses the data of a given test pass to create an evaluation for displaying into a table us...
getQuestionResultForTestUsers($question_id, $test_id)
Creates a HTML representation for the results of a given question in a test.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupExamId($active_id, $pass)
downloadPdf(int $userId, int $objectId)