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 $data->getParticipant($active_id)->setPassScoring(
$pass);
1012 $result =
$data->getParticipant($active_id)->getReached() .
" " . strtolower($this->lng->txt(
"of")) .
" " .
$data->getParticipant($active_id)->getMaxpoints() .
" (" . sprintf(
"%2.2f",
$data->getParticipant($active_id)->getReachedPointsInPercent()) .
" %" .
")";
1013 $template->setCurrentBlock(
'total_score');
1014 $template->setVariable(
"TOTAL_RESULT_TEXT", $this->lng->txt(
'tst_stat_result_resultspoints'));
1015 $template->setVariable(
"TOTAL_RESULT",
$result);
1016 $template->parseCurrentBlock();
1019 $template->setVariable(
"USER_DATA", $user_data);
1021 $uname = $this->
object->userLookupFullName($user_id);
1022 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
1024 $template->setVariable(
"TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
1027 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1033 if ($this->object->getShowSolutionAnswersOnly()) {
1041 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1053 $ilTabs =
$DIC[
'ilTabs'];
1054 $ilObjDataCache =
$DIC[
'ilObjDataCache'];
1056 $active_id = (int)
$_GET[
"active_id"];
1058 if (!$this->
getTestAccess()->checkResultsAccessForActiveId($active_id)) {
1062 $testSession = $this->testSessionFactory->getSession($active_id);
1065 if ($testSession->getTestId() != $this->object->getTestId()) {
1069 if ($this->object->getNrOfTries() == 1) {
1070 $this->ctrl->setParameter($this,
"active_id", $active_id);
1072 $this->ctrl->redirect($this,
"outParticipantsPassDetails");
1075 $ilTabs->setBackTarget(
1076 $this->lng->txt(
'back'),
1077 $this->ctrl->getLinkTargetByClass([
'ilObjTestGUI',
'ilTestResultsGUI',
'ilParticipantsTestResultsGUI'])
1085 $template =
new ilTemplate(
"tpl.il_as_tst_pass_overview_participants.html",
true,
true,
"Modules/Test");
1089 $this->ctrl->setParameter($this,
'pdf',
'1');
1090 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, __FUNCTION__));
1091 $this->ctrl->setParameter($this,
'pdf',
'');
1094 $template->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1096 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1099 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1100 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1101 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1102 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1103 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1107 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1109 $testPassesSelector->setActiveId($testSession->getActiveId());
1110 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1113 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1114 $passOverViewTableGUI->setResultPresentationEnabled(
true);
1115 $passOverViewTableGUI->setPassDetailsCommand(
'outParticipantsPassDetails');
1116 $passOverViewTableGUI->init();
1117 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getExistingPasses(),
true,
true));
1118 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1119 $template->setVariable(
"PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1123 $gradingMessageBuilder->buildList();
1125 $template->setCurrentBlock(
'grading_message');
1126 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
1127 $template->parseCurrentBlock();
1131 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
1134 if ($this->object->getAnonymity()) {
1135 $template->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result"));
1137 $uname = $this->
object->userLookupFullName($user_id,
true);
1138 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1139 $template->setVariable(
"USER_DATA", $user_data);
1143 $template->parseCurrentBlock();
1147 if ($this->object->getShowSolutionAnswersOnly()) {
1151 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1)) {
1155 $filename =
$name[
'lastname'] .
'_' .
$name[
'firstname'] .
'_' .
$name[
'login'] .
'__' . $this->
object->getTitleFilenameCompliant();
1160 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1167 $tableGUI->initFilter();
1168 $tableGUI->resetOffset();
1169 $tableGUI->writeFilterToSession();
1176 $tableGUI->initFilter();
1177 $tableGUI->resetOffset();
1178 $tableGUI->resetFilter();
1185 $tableGUI->initFilter();
1186 $tableGUI->resetOffset();
1187 $tableGUI->writeFilterToSession();
1194 $tableGUI->initFilter();
1195 $tableGUI->resetOffset();
1196 $tableGUI->resetFilter();
1208 $ilTabs =
$DIC[
'ilTabs'];
1210 $ilObjDataCache =
$DIC[
'ilObjDataCache'];
1212 $ilTabs->clearSubTabs();
1213 $ilTabs->setBackTarget($this->lng->txt(
'tst_results_back_overview'), $this->ctrl->getLinkTarget($this));
1215 $testSession = $this->testSessionFactory->getSession();
1217 if (!$this->object->getShowPassDetails()) {
1218 #$executable = $this->object->isExecutable($testSession, $ilUser->getId());
1220 #if($executable["executable"])
1222 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1226 $active_id = $testSession->getActiveId();
1227 $user_id = $testSession->getUserId();
1229 $this->ctrl->saveParameter($this,
"pass");
1237 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1240 $objectivesList =
null;
1242 $considerHiddenQuestions =
true;
1243 $considerOptionalQuestions =
true;
1246 $considerHiddenQuestions =
false;
1248 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
1249 $testSequence->loadFromDb();
1250 $testSequence->loadQuestions();
1252 if ($this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed()) {
1253 $considerOptionalQuestions =
false;
1256 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1260 $objectivesList->loadObjectivesTitles();
1262 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1263 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1264 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1265 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1266 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1271 $command_solution_details =
"";
1272 if ($this->object->getShowSolutionDetails()) {
1273 $command_solution_details =
"outCorrectSolution";
1275 $questionAnchorNav = $this->
object->canShowSolutionPrintview();
1277 $tpl =
new ilTemplate(
'tpl.il_as_tst_pass_details_overview_participants.html',
true,
true,
"Modules/Test");
1282 $this->ctrl->setParameter($this,
'pdf',
'1');
1283 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this,
'outUserPassDetails'));
1284 $this->ctrl->setParameter($this,
'pdf',
'');
1287 if ($validator->isCertificateDownloadable($user_id, $this->object->getId())) {
1288 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this,
'outCertificate'));
1293 $tpl->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1295 $tpl->setCurrentBlock(
'signature');
1297 $tpl->parseCurrentBlock();
1299 if ($this->object->isShowExamIdInTestResultsEnabled()) {
1300 $tpl->setCurrentBlock(
'exam_id');
1302 $testSession->getActiveId(),
1305 $tpl->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1306 $tpl->parseCurrentBlock();
1313 $gradingMessageBuilder->buildMessage();
1314 $gradingMessageBuilder->sendMessage();
1316 #$template->setCurrentBlock('grading_message');
1317 #$template->setVariable('GRADING_MESSAGE', );
1318 #$template->parseCurrentBlock();
1326 "outUserPassDetails",
1327 $command_solution_details,
1331 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
1332 $tpl->setVariable(
"PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
1334 $data = &$this->
object->getCompleteEvaluationData();
1335 $percent =
$data->getParticipant($active_id)->getPass(
$pass)->getReachedPoints() /
$data->getParticipant($active_id)->getPass(
$pass)->getMaxPoints() * 100;
1336 $result =
$data->getParticipant($active_id)->getPass(
$pass)->getReachedPoints() .
" " . strtolower($this->lng->txt(
"of")) .
" " .
$data->getParticipant($active_id)->getPass(
$pass)->getMaxPoints() .
" (" . sprintf(
"%2.2f", $percent) .
" %" .
")";
1337 $tpl->setCurrentBlock(
'total_score');
1338 $tpl->setVariable(
"TOTAL_RESULT_TEXT", $this->lng->txt(
'tst_stat_result_resultspoints'));
1340 $tpl->parseCurrentBlock();
1342 if ($this->object->canShowSolutionPrintview()) {
1347 $this->object->getShowSolutionListComparison(),
1353 $testResultHeaderLabelBuilder
1355 $tpl->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1358 $tpl->setVariable(
"TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
1359 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1361 $uname = $this->
object->userLookupFullName($user_id,
true);
1364 if ($this->object->getAnonymity()) {
1365 $tpl->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result_pass"));
1367 $tpl->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
1368 $tpl->setVariable(
"USER_DATA", $user_data);
1376 if ($this->object->getShowSolutionAnswersOnly()) {
1383 $this->tpl->setContent(
$tpl->get());
1396 $ilObjDataCache =
$DIC[
'ilObjDataCache'];
1398 $testSession = $this->testSessionFactory->getSession();
1399 $active_id = $testSession->getActiveId();
1401 $uname = $this->
object->userLookupFullName($user_id,
true);
1403 if (!$this->object->canShowTestResults($testSession)) {
1404 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1412 $templatehead =
new ilTemplate(
"tpl.il_as_tst_results_participants.html",
true,
true,
"Modules/Test");
1413 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html",
true,
true,
"Modules/Test");
1417 $this->ctrl->setParameter($this,
'pdf',
'1');
1418 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this,
'outUserResultsOverview'));
1419 $this->ctrl->setParameter($this,
'pdf',
'');
1422 if ($validator->isCertificateDownloadable($user_id, $this->object->getId())) {
1423 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this,
'outCertificate'));
1428 $templatehead->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1430 $passDetailsEnabled = $this->
object->getShowPassDetails();
1431 #if (!$passDetailsEnabled)
1433 # $executable = $this->object->isExecutable($testSession, $ilUser->getId());
1434 # if (!$executable["executable"]) $passDetailsEnabled = true;
1437 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1440 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1441 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1442 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1443 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1444 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1447 $template->setCurrentBlock(
"pass_overview");
1450 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1452 $testPassesSelector->setActiveId($testSession->getActiveId());
1453 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1456 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1457 $passOverViewTableGUI->setResultPresentationEnabled(
true);
1458 if ($passDetailsEnabled) {
1459 $passOverViewTableGUI->setPassDetailsCommand(
'outUserPassDetails');
1461 if ($this->object->isPassDeletionAllowed()) {
1462 $passOverViewTableGUI->setPassDeletionCommand(
'confirmDeletePass');
1464 $passOverViewTableGUI->init();
1465 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getReportablePasses(),
true));
1466 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1467 $overview = $passOverViewTableGUI->getHTML();
1469 require_once
'Modules/Test/classes/class.ilTestLearningObjectivesStatusGUI.php';
1472 $loStatus->setUsrId($testSession->getUserId());
1473 $overview .=
"<br />" . $loStatus->getHTML();
1475 $template->setVariable(
"PASS_OVERVIEW", $overview);
1476 $template->parseCurrentBlock();
1480 $gradingMessageBuilder->buildMessage();
1481 $gradingMessageBuilder->sendMessage();
1483 #$template->setCurrentBlock('grading_message');
1484 #$template->setVariable('GRADING_MESSAGE', );
1485 #$template->parseCurrentBlock();
1491 if ($this->object->getAnonymity()) {
1492 $template->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result"));
1494 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1495 $template->setVariable(
"USER_DATA", $user_data);
1500 if ($this->object->getShowSolutionAnswersOnly()) {
1503 $templatehead->setVariable(
"RESULTS_PARTICIPANT", $template->get());
1508 $this->tpl->setContent($templatehead->get());
1523 $ilObjDataCache =
$DIC[
'ilObjDataCache'];
1525 if (!$this->object->getShowSolutionPrintview()) {
1527 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1530 $template =
new ilTemplate(
"tpl.il_as_tst_info_list_of_answers.html",
true,
true,
"Modules/Test");
1533 if (array_key_exists(
"pass",
$_GET)) {
1534 if (strlen(
$_GET[
"pass"])) {
1540 $testSession = $this->testSessionFactory->getSession();
1541 $active_id = $testSession->getActiveId();
1543 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_passes"));
1546 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1548 $testPassesSelector->setActiveId($testSession->getActiveId());
1549 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1552 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1553 $passOverViewTableGUI->setResultPresentationEnabled(
false);
1554 $passOverViewTableGUI->setPassDetailsCommand(
'outUserListOfAnswerPasses');
1555 $passOverViewTableGUI->init();
1556 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getClosedPasses(),
false));
1557 $template->setVariable(
"PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1560 if (strlen(
$pass)) {
1561 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1564 $objectivesList =
null;
1567 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
1568 $testSequence->loadFromDb();
1569 $testSequence->loadQuestions();
1571 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1575 $objectivesList->loadObjectivesTitles();
1577 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1578 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1579 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1580 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1581 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1584 $result_array = $this->
object->getTestResult(
1592 $user_id = &$this->
object->_getUserIdFromActiveId($active_id);
1593 $showAllAnswers =
true;
1594 if ($this->object->isExecutable($testSession, $user_id)) {
1595 $showAllAnswers =
false;
1598 $answers = $this->
getPassListOfAnswers($result_array, $active_id,
$pass,
false, $showAllAnswers,
false,
false,
false, $objectivesList, $testResultHeaderLabelBuilder);
1599 $template->setVariable(
"PASS_DETAILS", $answers);
1601 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1602 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1603 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
1606 $template->setVariable(
"USER_DATA", $user_data);
1607 $template->setVariable(
"TEXT_LIST_OF_ANSWERS", $this->lng->txt(
"tst_list_of_answers"));
1608 if (strlen($signature)) {
1609 $template->setVariable(
"SIGNATURE", $signature);
1611 if (!is_null(
$pass) && $this->object->isShowExamIdInTestResultsEnabled()) {
1612 $template->setCurrentBlock(
'exam_id_footer');
1614 $testSession->getActiveId(),
1617 $template->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1618 $template->parseCurrentBlock();
1620 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1623 if ($this->object->getShowSolutionAnswersOnly()) {
1637 if (array_key_exists(
"pass",
$_GET) && (strlen(
$_GET[
"pass"]) > 0)) {
1638 $this->ctrl->saveParameter($this,
"pass");
1639 $this->ctrl->saveParameter($this,
"active_id");
1640 $this->outTestResults(
false,
$_GET[
"pass"]);
1642 $this->outTestResults(
false);
1658 $this->
object->setAccessFilteredParticipantList(
1659 $this->object->buildStatisticsAccessFilteredParticipantList()
1664 $data = &$this->
object->getCompleteEvaluationData();
1665 $color_class = array(
"tblrow1",
"tblrow2");
1667 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_single_answers.html",
"Modules/Test");
1668 $foundParticipants = &
$data->getParticipants();
1669 if (count($foundParticipants) == 0) {
1674 foreach (
$data->getQuestionTitles() as $question_id => $question_title) {
1678 foreach ($foundParticipants as $userdata) {
1679 $pass = $userdata->getScoredPass();
1680 if (is_object($userdata->getPass(
$pass))) {
1681 $question = &$userdata->getPass(
$pass)->getAnsweredQuestionByQuestionId($question_id);
1682 if (is_array($question)) {
1688 $this->ctrl->setParameter($this,
"qid", $question_id);
1689 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
1693 if ($question_object->hasFileUploads($this->object->getTestId())) {
1694 $download =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportFileUploadsForAllParticipants") .
"\">" . $this->lng->txt(
"download") .
"</a>";
1700 'qid' => $question_id,
1701 'question_title' => $question_title,
1702 'number_of_answers' => $answered,
1703 'output' =>
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportQuestionForAllParticipants") .
"\">" . $this->lng->txt(
"pdf_export") .
"</a>",
1704 'file_uploads' => $download
1709 require_once
'./Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php';
1711 $table_gui->setTitle($this->lng->txt(
"tst_answered_questions_test"));
1712 $table_gui->setData(
$rows);
1714 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1716 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $this->lng->txt(
"adm_no_special_users"));
1728 $user =
$DIC->user();
1729 $database =
$DIC->database();
1730 $logger =
$DIC->logger()->root();
1733 $pdfGenerator =
new ilPdfGenerator($ilUserCertificateRepository, $logger);
1739 $this->lng->txt(
'error_creating_certificate_pdf')
1742 $pdfAction->downloadPdf((
int) $user->getId(), (
int) $this->object->getId());
1747 if (isset(
$_GET[
'context']) && strlen(
$_GET[
'context'])) {
1753 if (!$this->object->isPassDeletionAllowed() && !$this->object->isDynamicTest()) {
1757 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1764 $tpl->setContent($this->ctrl->getHTML($confirm));
1774 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1779 $this->ctrl->redirect($this,
'outUserResultsOverview');
1784 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
1789 $this->ctrl->redirectByClass(
'ilTestPlayerDynamicQuestionSetGUI',
'startTest');
1793 public function performDeletePass()
1795 if (isset(
$_POST[
'context']) && strlen(
$_POST[
'context'])) {
1801 if (!$this->object->isPassDeletionAllowed() && !$this->object->isDynamicTest()) {
1811 if (isset(
$_POST[
'active_id']) && (
int)
$_POST[
'active_id']) {
1812 $active_fi =
$_POST[
'active_id'];
1815 if (isset(
$_POST[
'pass']) && is_numeric(
$_POST[
'pass'])) {
1819 if (is_null($active_fi) || is_null(
$pass)) {
1820 $this->ctrl->redirect($this,
'outUserResultsOverview');
1823 if (!$this->object->isDynamicTest() &&
$pass == $this->object->_getResultPass($active_fi)) {
1824 $this->ctrl->redirect($this,
'outUserResultsOverview');
1829 SELECT tst_active.tries, tst_active.last_finished_pass, tst_sequence.pass
1831 LEFT JOIN tst_sequence
1832 ON tst_sequence.active_fi = tst_active.active_id
1833 AND tst_sequence.pass = tst_active.tries
1834 WHERE tst_active.active_id = {$ilDB->quote($active_fi, 'integer')}
1839 $tries = $row[
'tries'];
1840 $lastFinishedPass = is_numeric($row[
'last_finished_pass']) ? $row[
'last_finished_pass'] : -1;
1842 if (
$pass < $lastFinishedPass) {
1843 $isActivePass =
false;
1844 $must_renumber =
true;
1845 } elseif (
$pass == $lastFinishedPass) {
1846 $isActivePass =
false;
1848 if ($tries == $row[
'pass']) {
1849 $must_renumber =
true;
1851 $must_renumber =
false;
1853 } elseif (
$pass == $row[
'pass']) {
1854 $isActivePass =
true;
1855 $must_renumber =
false;
1857 throw new ilTestException(
'This should not happen, please contact Bjoern Heyser to clean up this pass salad!');
1860 if (!$this->object->isDynamicTest() && $isActivePass) {
1861 $this->ctrl->redirect($this,
'outUserResultsOverview');
1865 ($lastFinishedPass == 0 && $tries == 1 && $tries != $row[
'pass'])
1866 || ($isActivePass ==
true)
1879 WHERE active_id = ' .
$ilDB->quote($active_fi,
'integer')
1881 } elseif (!$isActivePass) {
1884 SET tries = ' .
$ilDB->quote($tries - 1,
'integer') .
',
1885 last_finished_pass = ' .
$ilDB->quote($lastFinishedPass - 1,
'integer') .
'
1886 WHERE active_id = ' .
$ilDB->quote($active_fi,
'integer')
1893 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1894 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1897 if ($must_renumber) {
1899 'UPDATE tst_manual_fb
1901 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1902 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1911 FROM tst_pass_result
1912 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1913 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1916 if ($must_renumber) {
1918 'UPDATE tst_pass_result
1920 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1921 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1934 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1935 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1938 if ($must_renumber) {
1940 'UPDATE tst_sequence
1942 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1943 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1947 if ($this->object->isDynamicTest()) {
1949 'tst_seq_qst_tracking',
'tst_seq_qst_answstatus',
'tst_seq_qst_postponed',
'tst_seq_qst_checked'
1952 foreach ($tables as $table) {
1955 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')}
1956 AND pass = {$ilDB->quote($pass, 'integer')}
1959 if ($must_renumber) {
1963 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')}
1964 AND pass > {$ilDB->quote($pass, 'integer')}
1974 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1975 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1978 if ($must_renumber) {
1980 'UPDATE tst_solutions
1982 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1983 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1990 FROM tst_test_result
1991 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
1992 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1995 if ($must_renumber) {
1997 'UPDATE tst_test_result
1999 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
2000 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
2007 FROM qpl_hint_tracking
2008 WHERE qhtr_active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
2009 AND qhtr_pass = ' .
$ilDB->quote(
$pass,
'integer')
2012 if ($must_renumber) {
2014 'UPDATE qpl_hint_tracking
2015 SET qhtr_pass = qhtr_pass - 1
2016 WHERE qhtr_active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
2017 AND qhtr_pass > ' .
$ilDB->quote(
$pass,
'integer')
2027 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
2028 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
2031 if ($must_renumber) {
2035 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
'
2036 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
2040 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
2046 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
2049 if ($this->object->isDynamicTest()) {
2050 require_once
'Modules/Test/classes/tables/class.ilTestDynamicQuestionSetStatisticTableGUI.php';
2061 $ilPluginAdmin =
$DIC[
'ilPluginAdmin'];
2063 $resultData = $this->
object->getTestResult($active_id,
$pass,
false, $considerHiddenQuestions);
2064 $questionIds = array();
2065 foreach ($resultData as $resultItemKey => $resultItemValue) {
2066 if ($resultItemKey ===
'test' || $resultItemKey ===
'pass') {
2070 $questionIds[] = $resultItemValue[
'qid'];
2074 $table_gui->initFilter();
2076 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
2078 $questionList->setIncludeQuestionIdsFilter($questionIds);
2079 $questionList->setQuestionInstanceTypeFilter(
null);
2081 foreach ($table_gui->getFilterItems() as $item) {
2082 if (substr($item->getPostVar(), 0, strlen(
'tax_')) ==
'tax_') {
2083 $v = $item->getValue();
2085 if (is_array($v) && count($v) && !(
int) $v[0]) {
2089 $taxId = substr($item->getPostVar(), strlen(
'tax_'));
2090 $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->object->getId(),
'tst');
2091 } elseif ($item->getValue() !==
false) {
2092 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
2096 $questionList->load();
2098 $filteredTestResult = array();
2100 foreach ($resultData as $resultItemKey => $resultItemValue) {
2101 if ($resultItemKey ===
'test' || $resultItemKey ===
'pass') {
2105 if (!$questionList->isInList($resultItemValue[
'qid'])) {
2109 $filteredTestResult[] = $resultItemValue;
2112 return $filteredTestResult;
2119 $activeId = (int)
$_GET[
"active_id"];
2121 require_once
'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2124 require_once
'Modules/Test/classes/class.ilTestParticipantList.php';
2138 if ($this->object->isEndingTimeEnabled() || $this->object->getEnableProcessingTime()) {
2139 if ($this->object->endingTimeReached() ==
false) {
2140 $starting_time = $this->
object->getStartingTimeOfUser($activeId);
2141 if ($this->object->isMaxProcessingTimeReached($starting_time, $activeId) ==
false) {
2142 ilUtil::sendInfo($this->lng->txt(
"finish_pass_for_user_in_processing_time"));
2147 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
2150 $cgui->setHeaderText(sprintf(
2151 $this->lng->txt(
"finish_pass_for_user_confirmation"),
2155 $this->ctrl->setParameter($this,
'active_id', $activeId);
2156 $cgui->setFormAction($this->ctrl->getFormAction($this,
"participants"));
2158 $cgui->setCancel($this->lng->txt(
"cancel"),
"redirectBackToParticipantsScreen");
2159 $cgui->setConfirm($this->lng->txt(
"proceed"),
"confirmFinishTestPassForUser");
2161 $this->tpl->setContent($cgui->getHTML());
2168 $activeId = (int)
$_GET[
"active_id"];
2170 require_once
'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2173 require_once
'Modules/Test/classes/class.ilTestParticipantList.php';
2181 $testSession->loadFromDb($activeId);
2183 assQuestion::_updateTestPassResults(
2185 $testSession->getPass(),
2186 $this->object->areObligationsEnabled(),
2188 $this->object->getId()
2204 if ($this->object->isEndingTimeEnabled() || $this->object->getEnableProcessingTime()) {
2205 if ($this->object->endingTimeReached() ==
false) {
2208 $participantList->initializeFromDbRows($this->object->getTestParticipants());
2209 $participantList = $participantList->getAccessFilteredList($accessFilter);
2211 foreach ($participantList as $participant) {
2212 if (!$participant->hasUnfinishedPasses()) {
2215 $starting_time = $this->
object->getStartingTimeOfUser($participant->getActiveId());
2216 if ($this->object->isMaxProcessingTimeReached($starting_time, $participant->getActiveId()) ==
false) {
2217 ilUtil::sendFailure($this->lng->txt(
"finish_pass_for_all_users_in_processing_time"),
true);
2224 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
2226 $cgui->setFormAction($this->ctrl->getFormAction($this));
2227 $cgui->setHeaderText($this->lng->txt(
"finish_pass_for_all_users"));
2228 $cgui->setCancel($this->lng->txt(
"cancel"),
"redirectBackToParticipantsScreen");
2229 $cgui->setConfirm($this->lng->txt(
"proceed"),
"confirmFinishTestPassForAllUser");
2230 $this->tpl->setContent($cgui->getHTML());
2235 require_once
'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2238 require_once
'Modules/Test/classes/class.ilTestParticipantList.php';
2240 $participantList->initializeFromDbRows($this->object->getTestParticipants());
2241 $participantList = $participantList->getAccessFilteredList($accessFilter);
2243 foreach ($participantList as $participant) {
2244 if (!$participant->hasUnfinishedPasses()) {
2249 $testSession->loadFromDb($participant->getActiveId());
2251 assQuestion::_updateTestPassResults(
2252 $participant->getActiveId(),
2253 $testSession->getPass(),
2254 $this->object->areObligationsEnabled(),
2256 $this->object->getId()
2259 $this->
finishTestPass($participant->getActiveId(), $this->object->getId());
2267 $processLocker = $this->processLockerFactory->withContextId((
int) $active_id)->getLocker();
2270 $test_pass_finisher->performFinishTasks($processLocker);
2275 $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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.