4 require_once
'./Modules/Test/classes/class.ilTestServiceGUI.php';
5 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
6 require_once
'Modules/Test/classes/class.ilTestPassFinishTasks.php';
50 parent::__construct($a_object);
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;
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()) {
330 if ($globalCertificatePrerequisites->validate()) {
331 $options[
'certificate'] = $this->lng->txt(
'exp_type_certificate');
337 $ilToolbar->addInputItem($export_type,
true);
338 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
340 $button->setCommand(
'exportEvaluation');
341 $button->setCaption(
'export');
342 $button->getOmitPreventDoubleSubmission();
343 $ilToolbar->addButtonInstance($button);
347 if ($this->object->getShowSolutionAnswersOnly()) {
351 $this->tpl->setContent($table_gui->getHTML());
371 $active_id =
$_GET[
'active_id'];
373 if (!$this->
getTestAccess()->checkResultsAccessForActiveId($active_id)) {
377 if (strlen($active_id) == 0) {
378 ilUtil::sendInfo($this->lng->txt(
'detailed_evaluation_missing_active_id'),
true);
379 $this->ctrl->redirect($this,
'outEvaluation');
384 $toolbar = $DIC[
'ilToolbar'];
386 require_once
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
388 $backBtn->setCaption(
'back');
389 $backBtn->setUrl($this->ctrl->getLinkTarget($this,
'outEvaluation'));
390 $toolbar->addInputItem($backBtn);
392 $this->
object->setAccessFilteredParticipantList(
393 $this->object->buildStatisticsAccessFilteredParticipantList()
396 $data = &$this->
object->getCompleteEvaluationData();
398 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
400 $form->setTitle(sprintf(
401 $this->lng->txt(
'detailed_evaluation_for'),
402 $data->getParticipant($active_id)->getName()
406 $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()) .
" %" .
")");
407 $form->addItem($resultPoints);
409 if (strlen(
$data->getParticipant($active_id)->getMark())) {
411 $resultMarks->
setValue(
$data->getParticipant($active_id)->getMark());
412 $form->addItem($resultMarks);
413 if (strlen(
$data->getParticipant($active_id)->getECTSMark())) {
415 $ectsGrade->
setValue(
$data->getParticipant($active_id)->getECTSMark());
416 $form->addItem($ectsGrade);
420 if ($this->object->isOfferingQuestionHintsEnabled()) {
421 $requestHints =
new ilNonEditableValueGUI($this->lng->txt(
'tst_question_hints_requested_hint_count_header'));
422 $requestHints->
setValue(
$data->getParticipant($active_id)->getRequestedHintsCountFromScoredPass());
423 $form->addItem($requestHints);
426 $time_seconds =
$data->getParticipant($active_id)->getTimeOfWork();
427 $atime_seconds =
$data->getParticipant($active_id)->getNumberOfQuestions() ? $time_seconds /
$data->getParticipant($active_id)->getNumberOfQuestions() : 0;
428 $time_hours = floor($time_seconds / 3600);
429 $time_seconds -= $time_hours * 3600;
430 $time_minutes = floor($time_seconds / 60);
431 $time_seconds -= $time_minutes * 60;
433 $timeOfWork->
setValue(sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $time_seconds));
434 $form->addItem($timeOfWork);
436 $this->tpl->setVariable(
"TXT_ATIMEOFWORK", $this->lng->txt(
""));
437 $time_hours = floor($atime_seconds / 3600);
438 $atime_seconds -= $time_hours * 3600;
439 $time_minutes = floor($atime_seconds / 60);
440 $atime_seconds -= $time_minutes * 60;
442 $avgTimeOfWork->
setValue(sprintf(
"%02d:%02d:%02d", $time_hours, $time_minutes, $atime_seconds));
443 $form->addItem($avgTimeOfWork);
447 $form->addItem($firstVisit);
451 $form->addItem($lastVisit);
454 $nrPasses->
setValue(
$data->getParticipant($active_id)->getLastPass() + 1);
455 $form->addItem($nrPasses);
459 $scoredPass->
setValue(
$data->getParticipant($active_id)->getBestPass() + 1);
461 $scoredPass->setValue(
$data->getParticipant($active_id)->getLastPass() + 1);
463 $form->addItem($scoredPass);
465 $median =
$data->getStatistics()->getStatistics()->median();
466 $pct =
$data->getParticipant($active_id)->getMaxpoints() ? ($median /
$data->getParticipant($active_id)->getMaxpoints()) * 100.0 : 0;
467 $mark = $this->
object->mark_schema->getMatchingMark($pct);
468 if (is_object($mark)) {
470 $markMedian->
setValue($mark->getShortName());
471 $form->addItem($markMedian);
475 $rankParticipant->
setValue(
$data->getStatistics()->getStatistics()->rank(
$data->getParticipant($active_id)->getReached()));
476 $form->addItem($rankParticipant);
479 $rankMedian->
setValue(
$data->getStatistics()->getStatistics()->rank_median());
480 $form->addItem($rankMedian);
482 $totalParticipants =
new ilNonEditableValueGUI($this->lng->txt(
'tst_stat_result_total_participants'));
483 $totalParticipants->
setValue(
$data->getStatistics()->getStatistics()->count());
484 $form->addItem($totalParticipants);
488 $form->addItem($medianField);
490 $this->tpl->setContent(
$form->getHTML());
496 if ($finishdate > 0) {
497 if (($DIC->access()->checkAccess(
'write',
'', (
int)
$_GET[
'ref_id']))) {
498 $this->ctrl->setParameter($this,
'statistics',
'1');
499 $this->ctrl->setParameter($this,
'active_id', $active_id);
500 $this->ctrl->setParameter($this,
'pass',
$pass);
502 $this->ctrl->setParameter($this,
'statistics',
'');
503 $this->ctrl->setParameter($this,
'active_id',
'');
504 $this->ctrl->setParameter($this,
'pass',
'');
507 require_once
'Modules/Test/classes/tables/class.ilTestDetailedEvaluationStatisticsTableGUI.php';
509 $table->setTitle(sprintf($this->lng->txt(
"tst_eval_question_points"),
$pass + 1));
510 if (($DIC->access()->checkAccess(
'write',
'', (
int) $_GET[
'ref_id']))) {
511 $table->addCommandButton(
'outParticipantsPassDetails', $this->lng->txt(
'tst_show_answer_sheet'));
514 $questions =
$data->getParticipant($active_id)->getQuestions(
$pass);
515 if (!is_array($questions)) {
516 $questions =
$data->getParticipant($active_id)->getQuestions(0);
519 $tableData = array();
522 foreach ((array) $questions as $question) {
523 $userDataData = array(
524 'counter' => ++$counter,
525 'id' => $question[
'id'],
526 'id_txt' => $this->lng->txt(
'question_id_short'),
527 'title' =>
$data->getQuestionTitle($question[
'id'])
530 $answeredquestion =
$data->getParticipant($active_id)->getPass(
$pass)->getAnsweredQuestionByQuestionId($question[
"id"]);
531 if (is_array($answeredquestion)) {
532 $percent = $answeredquestion[
'points'] ? $answeredquestion[
'reached'] / $answeredquestion[
'points'] * 100.0 : 0;
533 $userDataData[
'points'] = $answeredquestion[
'reached'] .
' ' . strtolower($this->lng->txt(
'of')) .
" " . $answeredquestion[
'points'] .
' (' . sprintf(
"%.2f", $percent) .
' %)';
535 $userDataData[
'points'] =
'0 ' . strtolower($this->lng->txt(
'of')) .
' ' . $question[
'points'] .
' (' . sprintf(
"%.2f", 0) .
' %) - ' . $this->lng->txt(
'question_not_answered');
538 $tableData[] = $userDataData;
540 $table->setData($tableData);
542 $tables[] =
$table->getHTML();
547 $DIC[
'tpl']->setContent(
$form->getHTML() . implode(
'', $tables));
565 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
568 $question_object->deliverFileUploadZIPFile(
570 $this->object->getTestId(),
571 $this->
object->getTitle()
574 $this->ctrl->redirect($this,
"singleResults");
588 $ilToolbar = $DIC->toolbar();
596 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_anonymous_aggregation.html",
"Modules/Test");
598 $this->
object->setAccessFilteredParticipantList(
599 $this->object->buildStatisticsAccessFilteredParticipantList()
602 $eval = &$this->
object->getCompleteEvaluationData();
604 $foundParticipants = &$eval->getParticipants();
605 if (count($foundParticipants)) {
606 $ilToolbar->setFormName(
'form_output_eval');
607 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
'exportAggregatedResults'));
608 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
609 $export_type =
new ilSelectInputGUI($this->lng->txt(
'exp_eval_data'),
'export_type');
611 'excel' => $this->lng->txt(
'exp_type_excel'),
612 'csv' => $this->lng->txt(
'exp_type_spss')
614 $ilToolbar->addInputItem($export_type,
true);
615 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
617 $button->setCommand(
'exportAggregatedResults');
618 $button->setCaption(
'export');
619 $button->getOmitPreventDoubleSubmission();
620 $ilToolbar->addButtonInstance($button);
622 array_push(
$data, array(
623 'result' => $this->lng->txt(
"tst_eval_total_persons"),
624 'value' => count($foundParticipants)
626 $total_finished = $eval->getTotalFinishedParticipants();
627 array_push(
$data, array(
628 'result' => $this->lng->txt(
"tst_eval_total_finished"),
629 'value' => $total_finished
631 $average_time = $this->
object->evalTotalStartedAverageTime(
632 $eval->getParticipantIds()
634 $diff_seconds = $average_time;
635 $diff_hours = floor($diff_seconds / 3600);
636 $diff_seconds -= $diff_hours * 3600;
637 $diff_minutes = floor($diff_seconds / 60);
638 $diff_seconds -= $diff_minutes * 60;
639 array_push(
$data, array(
640 'result' => $this->lng->txt(
"tst_eval_total_finished_average_time"),
641 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
644 $total_passed_reached = 0;
645 $total_passed_max = 0;
646 $total_passed_time = 0;
647 foreach ($foundParticipants as $userdata) {
648 if ($userdata->getPassed()) {
650 $total_passed_reached += $userdata->getReached();
651 $total_passed_max += $userdata->getMaxpoints();
652 $total_passed_time += $userdata->getTimeOfWork();
655 $average_passed_reached = $total_passed ? $total_passed_reached / $total_passed : 0;
656 $average_passed_max = $total_passed ? $total_passed_max / $total_passed : 0;
657 $average_passed_time = $total_passed ? $total_passed_time / $total_passed : 0;
658 array_push(
$data, array(
659 'result' => $this->lng->txt(
"tst_eval_total_passed"),
660 'value' => $total_passed
662 array_push(
$data, array(
663 'result' => $this->lng->txt(
"tst_eval_total_passed_average_points"),
664 'value' => sprintf(
"%2.2f", $average_passed_reached) .
" " . strtolower($this->lng->txt(
"of")) .
" " . sprintf(
"%2.2f", $average_passed_max)
666 $average_time = $average_passed_time;
667 $diff_seconds = $average_time;
668 $diff_hours = floor($diff_seconds / 3600);
669 $diff_seconds -= $diff_hours * 3600;
670 $diff_minutes = floor($diff_seconds / 60);
671 $diff_seconds -= $diff_minutes * 60;
672 array_push(
$data, array(
673 'result' => $this->lng->txt(
"tst_eval_total_passed_average_time"),
674 'value' => sprintf(
"%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds)
678 include_once
"./Modules/Test/classes/tables/class.ilTestAggregatedResultsTableGUI.php";
680 $table_gui->setData(
$data);
681 $this->tpl->setVariable(
'AGGREGATED_RESULTS', $table_gui->getHTML());
684 foreach ($eval->getQuestionTitles() as $question_id => $question_title) {
688 foreach ($foundParticipants as $userdata) {
689 for (
$i = 0;
$i <= $userdata->getLastPass();
$i++) {
690 if (is_object($userdata->getPass(
$i))) {
691 $question = &$userdata->getPass(
$i)->getAnsweredQuestionByQuestionId($question_id);
692 if (is_array($question)) {
694 $reached += $question[
"reached"];
695 $max += $question[
"points"];
700 $percent = $max ? $reached / $max * 100.0 : 0;
702 $this->ctrl->setParameter($this,
"qid", $question_id);
704 $points_reached = ($answered ? $reached / $answered : 0);
705 $points_max = ($answered ? $max / $answered : 0);
709 'qid' => $question_id,
710 'title' => $question_title,
711 'points' => $points_reached,
712 'points_reached' => $points_reached,
713 'points_max' => $points_max,
714 'percentage' => (
float) $percent,
715 'answers' => $answered
719 include_once
"./Modules/Test/classes/tables/class.ilTestAverageReachedPointsTableGUI.php";
721 $table_gui->setData(
$rows);
722 $this->tpl->setVariable(
'TBL_AVG_REACHED', $table_gui->getHTML());
731 if (array_key_exists(
"g_filterby",
$_GET)) {
732 $filterby =
$_GET[
"g_filterby"];
736 if (array_key_exists(
"g_userfilter",
$_GET)) {
737 $filtertext =
$_GET[
"g_userfilter"];
741 if (array_key_exists(
"g_passedonly",
$_GET)) {
742 if (
$_GET[
"g_passedonly"] == 1) {
747 require_once
'Modules/Test/classes/class.ilTestExportFactory.php';
750 switch (
$_POST[
"export_type"]) {
752 $expFactory->getExporter(
'results')->exportToExcel(
761 $expFactory->getExporter(
'results')->exportToCSV(
771 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_passedonly",
"1");
773 if (strlen($filtertext)) {
774 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"g_userfilter", $filtertext);
776 $this->ctrl->redirect($this,
"exportCertificate");
788 require_once
'Modules/Test/classes/class.ilTestExportFactory.php';
790 $exportObj = $expFactory->getExporter(
'aggregated');
792 switch (
$_POST[
"export_type"]) {
794 $exportObj->exportToExcel($deliver =
true);
797 $exportObj->exportToCSV($deliver =
true);
813 if (!$globalCertificatePrerequisites->validate()) {
814 $DIC[
'ilErr']->raiseError($this->lng->txt(
'permission_denied'), $DIC[
'ilErr']->MESSAGE);
817 $database = $DIC->database();
818 $logger = $DIC->logger()->root();
825 $total_users = array();
827 $this->
object->setAccessFilteredParticipantList(
828 $this->object->buildStatisticsAccessFilteredParticipantList()
832 $pdfGenerator =
new ilPdfGenerator($ilUserCertificateRepository, $logger);
834 $total_users = &$this->
object->evalTotalPersonsArray();
835 if (count($total_users)) {
838 foreach ($total_users as $active_id =>
$name) {
839 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
841 if (!$certValidator->isCertificateDownloadable($user_id, $this->object->getId())) {
849 $this->lng->txt(
'error_creating_certificate_pdf')
852 $pdf = $pdfAction->createPDF($user_id, $this->object->getid());
857 $zipArchive =
$certificate->zipCertificatesInArchiveDirectory($archive_dir,
true);
869 if ($original_id > 0) {
886 $ilTabs = $DIC[
'ilTabs'];
887 $ilAccess = $DIC[
'ilAccess'];
888 $ilObjDataCache = $DIC[
'ilObjDataCache'];
890 $active_id = (int)
$_GET[
"active_id"];
892 if (!$this->
getTestAccess()->checkResultsAccessForActiveId($active_id)) {
896 $this->ctrl->saveParameter($this,
"active_id");
897 $testSession = $this->testSessionFactory->getSession($active_id);
900 if ($testSession->getTestId() != $this->
object->getTestId()) {
904 $this->ctrl->saveParameter($this,
"pass");
907 if (isset(
$_GET[
'statistics']) &&
$_GET[
'statistics'] == 1) {
908 $this->ctrl->setParameterByClass(
"ilTestEvaluationGUI",
"active_id", $active_id);
909 $this->ctrl->saveParameter($this,
'statistics');
911 $ilTabs->setBackTarget(
912 $this->lng->txt(
'back'),
913 $this->ctrl->getLinkTargetByClass(
'ilTestEvaluationGUI',
'detailedEvaluation')
915 } elseif ($this->object->getNrOfTries() == 1) {
916 $ilTabs->setBackTarget(
917 $this->lng->txt(
'back'),
918 $this->ctrl->getLinkTargetByClass(
'ilParticipantsTestResultsGUI')
921 $ilTabs->setBackTarget(
922 $this->lng->txt(
'tst_results_back_overview'),
923 $this->ctrl->getLinkTarget($this,
'outParticipantsResultsOverview')
932 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
935 $objectivesList = null;
938 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
939 $testSequence->loadFromDb();
940 $testSequence->loadQuestions();
942 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
946 $objectivesList->loadObjectivesTitles();
948 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
949 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
950 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
951 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
952 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
958 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
960 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
962 $template =
new ilTemplate(
"tpl.il_as_tst_pass_details_overview_participants.html",
true,
true,
"Modules/Test");
966 $this->ctrl->setParameter($this,
'pdf',
'1');
967 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
968 $this->ctrl->setParameter($this,
'pdf',
'');
970 if (isset(
$_GET[
'show_best_solutions'])) {
971 $_SESSION[
'tst_results_show_best_solutions'] =
true;
972 } elseif (isset(
$_GET[
'hide_best_solutions'])) {
973 $_SESSION[
'tst_results_show_best_solutions'] =
false;
974 } elseif (!isset(
$_SESSION[
'tst_results_show_best_solutions'])) {
975 $_SESSION[
'tst_results_show_best_solutions'] =
false;
978 if (
$_SESSION[
'tst_results_show_best_solutions']) {
979 $this->ctrl->setParameter($this,
'hide_best_solutions',
'1');
980 $toolbar->setHideBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
981 $this->ctrl->setParameter($this,
'hide_best_solutions',
'');
983 $this->ctrl->setParameter($this,
'show_best_solutions',
'1');
984 $toolbar->setShowBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this,
'outParticipantsPassDetails'));
985 $this->ctrl->setParameter($this,
'show_best_solutions',
'');
989 $template->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
993 $gradingMessageBuilder->buildList();
995 $template->setCurrentBlock(
'grading_message');
996 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
1000 $list_of_answers = $this->
getPassListOfAnswers($result_array, $active_id,
$pass,
$_SESSION[
'tst_results_show_best_solutions'],
false,
false,
false,
true, $objectivesList, $testResultHeaderLabelBuilder);
1001 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1002 $template->setVariable(
"PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
1004 $data = &$this->
object->getCompleteEvaluationData();
1005 $result =
$data->getParticipant($active_id)->getReached() .
" " . strtolower($this->lng->txt(
"of")) .
" " .
$data->getParticipant($active_id)->getMaxpoints() .
" (" . sprintf(
"%2.2f",
$data->getParticipant($active_id)->getReachedPointsInPercent()) .
" %" .
")";
1006 $template->setCurrentBlock(
'total_score');
1007 $template->setVariable(
"TOTAL_RESULT_TEXT",$this->lng->txt(
'tst_stat_result_resultspoints'));
1012 $template->setVariable(
"USER_DATA", $user_data);
1014 $uname = $this->
object->userLookupFullName($user_id);
1015 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
1017 $template->setVariable(
"TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
1020 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1026 if ($this->object->getShowSolutionAnswersOnly()) {
1032 require_once
'Modules/Test/classes/class.ilTestPDFGenerator.php';
1035 $this->tpl->setVariable(
"ADM_CONTENT",
$template->get());
1047 $ilTabs = $DIC[
'ilTabs'];
1048 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1050 $active_id = (int)
$_GET[
"active_id"];
1052 if (!$this->
getTestAccess()->checkResultsAccessForActiveId($active_id)) {
1056 $testSession = $this->testSessionFactory->getSession($active_id);
1059 if ($testSession->getTestId() != $this->
object->getTestId()) {
1063 if ($this->object->getNrOfTries() == 1) {
1064 $this->ctrl->setParameter($this,
"active_id", $active_id);
1066 $this->ctrl->redirect($this,
"outParticipantsPassDetails");
1069 $ilTabs->setBackTarget(
1070 $this->lng->txt(
'back'),
1071 $this->ctrl->getLinkTargetByClass(
'ilParticipantsTestResultsGUI')
1079 $template =
new ilTemplate(
"tpl.il_as_tst_pass_overview_participants.html",
true,
true,
"Modules/Test");
1083 $this->ctrl->setParameter($this,
'pdf',
'1');
1084 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, __FUNCTION__));
1085 $this->ctrl->setParameter($this,
'pdf',
'');
1088 $template->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1090 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1093 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1094 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1095 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1096 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1097 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1101 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1103 $testPassesSelector->setActiveId($testSession->getActiveId());
1104 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1107 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1108 $passOverViewTableGUI->setResultPresentationEnabled(
true);
1109 $passOverViewTableGUI->setPassDetailsCommand(
'outParticipantsPassDetails');
1110 $passOverViewTableGUI->init();
1111 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getExistingPasses(),
true,
true));
1112 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1113 $template->setVariable(
"PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1117 $gradingMessageBuilder->buildList();
1119 $template->setCurrentBlock(
'grading_message');
1120 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
1125 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
1128 if ($this->object->getAnonymity()) {
1129 $template->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result"));
1131 $uname = $this->
object->userLookupFullName($user_id,
true);
1132 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1133 $template->setVariable(
"USER_DATA", $user_data);
1141 if ($this->object->getShowSolutionAnswersOnly()) {
1145 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1)) {
1149 $filename =
$name[
'lastname'] .
'_' .
$name[
'firstname'] .
'_' .
$name[
'login'] .
'__' . $this->
object->getTitleFilenameCompliant();
1150 require_once
'Modules/Test/classes/class.ilTestPDFGenerator.php';
1155 $this->tpl->setVariable(
"ADM_CONTENT",
$template->get());
1162 $tableGUI->initFilter();
1163 $tableGUI->resetOffset();
1164 $tableGUI->writeFilterToSession();
1171 $tableGUI->initFilter();
1172 $tableGUI->resetOffset();
1173 $tableGUI->resetFilter();
1180 $tableGUI->initFilter();
1181 $tableGUI->resetOffset();
1182 $tableGUI->writeFilterToSession();
1189 $tableGUI->initFilter();
1190 $tableGUI->resetOffset();
1191 $tableGUI->resetFilter();
1203 $ilTabs = $DIC[
'ilTabs'];
1205 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1207 $ilTabs->clearSubTabs();
1208 $ilTabs->setBackTarget($this->lng->txt(
'tst_results_back_overview'), $this->ctrl->getLinkTarget($this));
1210 $testSession = $this->testSessionFactory->getSession();
1212 if (!$this->object->getShowPassDetails()) {
1213 #$executable = $this->object->isExecutable($testSession, $ilUser->getId()); 1215 #if($executable["executable"]) 1217 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1221 $active_id = $testSession->getActiveId();
1222 $user_id = $testSession->getUserId();
1224 $this->ctrl->saveParameter($this,
"pass");
1232 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1235 $objectivesList = null;
1237 $considerHiddenQuestions =
true;
1238 $considerOptionalQuestions =
true;
1241 $considerHiddenQuestions =
false;
1243 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
1244 $testSequence->loadFromDb();
1245 $testSequence->loadQuestions();
1247 if ($this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed()) {
1248 $considerOptionalQuestions =
false;
1251 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1255 $objectivesList->loadObjectivesTitles();
1257 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1258 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1259 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1260 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1261 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1266 $command_solution_details =
"";
1267 if ($this->object->getShowSolutionDetails()) {
1268 $command_solution_details =
"outCorrectSolution";
1270 $questionAnchorNav = $this->
object->canShowSolutionPrintview();
1272 $tpl =
new ilTemplate(
'tpl.il_as_tst_pass_details_overview_participants.html',
true,
true,
"Modules/Test");
1277 $this->ctrl->setParameter($this,
'pdf',
'1');
1278 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this,
'outUserPassDetails'));
1279 $this->ctrl->setParameter($this,
'pdf',
'');
1282 if ($validator->isCertificateDownloadable($user_id, $this->object->getId())) {
1283 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this,
'outCertificate'));
1288 $tpl->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1290 $tpl->setCurrentBlock(
'signature');
1292 $tpl->parseCurrentBlock();
1294 if ($this->object->isShowExamIdInTestResultsEnabled()) {
1295 $tpl->setCurrentBlock(
'exam_id');
1297 $testSession->getActiveId(),
1300 $tpl->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1301 $tpl->parseCurrentBlock();
1308 $gradingMessageBuilder->buildMessage();
1309 $gradingMessageBuilder->sendMessage();
1311 #$template->setCurrentBlock('grading_message'); 1312 #$template->setVariable('GRADING_MESSAGE', ); 1313 #$template->parseCurrentBlock(); 1321 "outUserPassDetails",
1322 $command_solution_details,
1326 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
1327 $tpl->setVariable(
"PASS_DETAILS", $this->ctrl->getHTML($overviewTableGUI));
1329 $data = &$this->
object->getCompleteEvaluationData();
1330 $result =
$data->getParticipant($active_id)->getReached() .
" " . strtolower($this->lng->txt(
"of")) .
" " .
$data->getParticipant($active_id)->getMaxpoints() .
" (" . sprintf(
"%2.2f",
$data->getParticipant($active_id)->getReachedPointsInPercent()) .
" %" .
")";
1331 $tpl->setCurrentBlock(
'total_score');
1332 $tpl->setVariable(
"TOTAL_RESULT_TEXT",$this->lng->txt(
'tst_stat_result_resultspoints'));
1334 $tpl->parseCurrentBlock();
1336 if ($this->object->canShowSolutionPrintview()) {
1341 $this->object->getShowSolutionListComparison(),
1347 $testResultHeaderLabelBuilder
1349 $tpl->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
1352 $tpl->setVariable(
"TEXT_RESULTS", $testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
1353 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1355 $uname = $this->
object->userLookupFullName($user_id,
true);
1358 if ($this->object->getAnonymity()) {
1359 $tpl->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result_pass"));
1361 $tpl->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name_pass"),
$pass + 1, $uname));
1362 $tpl->setVariable(
"USER_DATA", $user_data);
1370 if ($this->object->getShowSolutionAnswersOnly()) {
1375 require_once
'Modules/Test/classes/class.ilTestPDFGenerator.php';
1378 $this->tpl->setContent(
$tpl->get());
1391 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1393 $testSession = $this->testSessionFactory->getSession();
1394 $active_id = $testSession->getActiveId();
1396 $uname = $this->
object->userLookupFullName($user_id,
true);
1398 if (!$this->object->canShowTestResults($testSession)) {
1399 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1407 $templatehead =
new ilTemplate(
"tpl.il_as_tst_results_participants.html",
true,
true,
"Modules/Test");
1408 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html",
true,
true,
"Modules/Test");
1412 $this->ctrl->setParameter($this,
'pdf',
'1');
1413 $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this,
'outUserResultsOverview'));
1414 $this->ctrl->setParameter($this,
'pdf',
'');
1417 if ($validator->isCertificateDownloadable($user_id, $this->object->getId())) {
1418 $toolbar->setCertificateLinkTarget($this->ctrl->getLinkTarget($this,
'outCertificate'));
1423 $templatehead->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
1425 $passDetailsEnabled = $this->
object->getShowPassDetails();
1426 #if (!$passDetailsEnabled) 1428 # $executable = $this->object->isExecutable($testSession, $ilUser->getId()); 1429 # if (!$executable["executable"]) $passDetailsEnabled = true; 1432 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1435 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1436 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1437 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1438 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1439 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1442 $template->setCurrentBlock(
"pass_overview");
1445 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1447 $testPassesSelector->setActiveId($testSession->getActiveId());
1448 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1451 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1452 $passOverViewTableGUI->setResultPresentationEnabled(
true);
1453 if ($passDetailsEnabled) {
1454 $passOverViewTableGUI->setPassDetailsCommand(
'outUserPassDetails');
1456 if ($this->object->isPassDeletionAllowed()) {
1457 $passOverViewTableGUI->setPassDeletionCommand(
'confirmDeletePass');
1459 $passOverViewTableGUI->init();
1460 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getReportablePasses(),
true));
1461 $passOverViewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassOverviewHeaderLabel());
1462 $overview = $passOverViewTableGUI->getHTML();
1464 require_once
'Modules/Test/classes/class.ilTestLearningObjectivesStatusGUI.php';
1467 $loStatus->setUsrId($testSession->getUserId());
1468 $overview .=
"<br />" . $loStatus->getHTML();
1470 $template->setVariable(
"PASS_OVERVIEW", $overview);
1475 $gradingMessageBuilder->buildMessage();
1476 $gradingMessageBuilder->sendMessage();
1478 #$template->setCurrentBlock('grading_message'); 1479 #$template->setVariable('GRADING_MESSAGE', ); 1480 #$template->parseCurrentBlock(); 1486 if ($this->object->getAnonymity()) {
1487 $template->setVariable(
"TEXT_HEADING", $this->lng->txt(
"tst_result"));
1489 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
1490 $template->setVariable(
"USER_DATA", $user_data);
1495 if ($this->object->getShowSolutionAnswersOnly()) {
1498 $templatehead->setVariable(
"RESULTS_PARTICIPANT",
$template->get());
1502 require_once
'Modules/Test/classes/class.ilTestPDFGenerator.php';
1505 $this->tpl->setContent($templatehead->get());
1520 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1522 if (!$this->object->getShowSolutionPrintview()) {
1524 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1527 $template =
new ilTemplate(
"tpl.il_as_tst_info_list_of_answers.html",
true,
true,
"Modules/Test");
1530 if (array_key_exists(
"pass",
$_GET)) {
1531 if (strlen(
$_GET[
"pass"])) {
1537 $testSession = $this->testSessionFactory->getSession();
1538 $active_id = $testSession->getActiveId();
1540 $template->setVariable(
"TEXT_RESULTS", $this->lng->txt(
"tst_passes"));
1543 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
1545 $testPassesSelector->setActiveId($testSession->getActiveId());
1546 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
1549 $passOverViewTableGUI->setActiveId($testSession->getActiveId());
1550 $passOverViewTableGUI->setResultPresentationEnabled(
false);
1551 $passOverViewTableGUI->setPassDetailsCommand(
'outUserListOfAnswerPasses');
1552 $passOverViewTableGUI->init();
1553 $passOverViewTableGUI->setData($this->
getPassOverviewTableData($testSession, $testPassesSelector->getClosedPasses(),
false));
1554 $template->setVariable(
"PASS_OVERVIEW", $passOverViewTableGUI->getHTML());
1557 if (strlen(
$pass)) {
1558 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
1561 $objectivesList = null;
1564 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
1565 $testSequence->loadFromDb();
1566 $testSequence->loadQuestions();
1568 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1572 $objectivesList->loadObjectivesTitles();
1574 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
1575 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
1576 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
1577 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
1578 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
1581 $result_array = $this->
object->getTestResult(
1589 $user_id = &$this->
object->_getUserIdFromActiveId($active_id);
1590 $showAllAnswers =
true;
1591 if ($this->object->isExecutable($testSession, $user_id)) {
1592 $showAllAnswers =
false;
1595 $answers = $this->
getPassListOfAnswers($result_array, $active_id,
$pass,
false, $showAllAnswers,
false,
false,
false, $objectivesList, $testResultHeaderLabelBuilder);
1596 $template->setVariable(
"PASS_DETAILS", $answers);
1598 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1599 $template->setVariable(
"PRINT_TEXT", $this->lng->txt(
"print"));
1600 $template->setVariable(
"PRINT_URL",
"javascript:window.print();");
1603 $template->setVariable(
"USER_DATA", $user_data);
1604 $template->setVariable(
"TEXT_LIST_OF_ANSWERS", $this->lng->txt(
"tst_list_of_answers"));
1605 if (strlen($signature)) {
1606 $template->setVariable(
"SIGNATURE", $signature);
1608 if (!is_null(
$pass) && $this->object->isShowExamIdInTestResultsEnabled()) {
1609 $template->setCurrentBlock(
'exam_id_footer');
1611 $testSession->getActiveId(),
1614 $template->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
1617 $this->tpl->setVariable(
"ADM_CONTENT",
$template->get());
1620 if ($this->object->getShowSolutionAnswersOnly()) {
1634 if (array_key_exists(
"pass",
$_GET) && (strlen(
$_GET[
"pass"]) > 0)) {
1635 $this->ctrl->saveParameter($this,
"pass");
1636 $this->ctrl->saveParameter($this,
"active_id");
1637 $this->outTestResults(
false,
$_GET[
"pass"]);
1639 $this->outTestResults(
false);
1655 $this->
object->setAccessFilteredParticipantList(
1656 $this->object->buildStatisticsAccessFilteredParticipantList()
1661 $data = &$this->
object->getCompleteEvaluationData();
1662 $color_class = array(
"tblrow1",
"tblrow2");
1664 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_eval_single_answers.html",
"Modules/Test");
1665 $foundParticipants = &
$data->getParticipants();
1666 if (count($foundParticipants) == 0) {
1671 foreach (
$data->getQuestionTitles() as $question_id => $question_title) {
1675 foreach ($foundParticipants as $userdata) {
1676 $pass = $userdata->getScoredPass();
1677 if (is_object($userdata->getPass(
$pass))) {
1678 $question = &$userdata->getPass(
$pass)->getAnsweredQuestionByQuestionId($question_id);
1679 if (is_array($question)) {
1685 $this->ctrl->setParameter($this,
"qid", $question_id);
1686 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
1690 if ($question_object->hasFileUploads($this->object->getTestId())) {
1691 $download =
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportFileUploadsForAllParticipants") .
"\">" . $this->lng->txt(
"download") .
"</a>";
1697 'qid' => $question_id,
1698 'question_title' => $question_title,
1699 'number_of_answers' => $answered,
1700 'output' =>
"<a href=\"" . $this->ctrl->getLinkTarget($this,
"exportQuestionForAllParticipants") .
"\">" . $this->lng->txt(
"pdf_export") .
"</a>",
1701 'file_uploads' => $download
1706 require_once
'./Modules/Test/classes/tables/class.ilResultsByQuestionTableGUI.php';
1708 $table_gui->setTitle($this->lng->txt(
"tst_answered_questions_test"));
1709 $table_gui->setData(
$rows);
1711 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $table_gui->getHTML());
1713 $this->tpl->setVariable(
"TBL_SINGLE_ANSWERS", $this->lng->txt(
"adm_no_special_users"));
1725 $user = $DIC->user();
1726 $database = $DIC->database();
1727 $logger = $DIC->logger()->root();
1730 $pdfGenerator =
new ilPdfGenerator($ilUserCertificateRepository, $logger);
1736 $this->lng->txt(
'error_creating_certificate_pdf')
1739 $pdfAction->
downloadPdf((
int)
$user->getId(), (int) $this->object->getId());
1744 if (isset(
$_GET[
'context']) && strlen(
$_GET[
'context'])) {
1750 if (!$this->object->isPassDeletionAllowed() && !$this->
object->isDynamicTest()) {
1754 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1757 $confirm->build((
int)
$_GET[
'active_id'], (
int) $_GET[
'pass'],
$context);
1761 $tpl->setContent($this->ctrl->getHTML($confirm));
1771 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
1776 $this->ctrl->redirect($this,
'outUserResultsOverview');
1781 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
1786 $this->ctrl->redirectByClass(
'ilTestPlayerDynamicQuestionSetGUI',
'startTest');
1790 public function performDeletePass()
1792 if (isset(
$_POST[
'context']) && strlen(
$_POST[
'context'])) {
1798 if (!$this->object->isPassDeletionAllowed() && !$this->
object->isDynamicTest()) {
1803 $ilDB = $DIC[
'ilDB'];
1808 if (isset(
$_POST[
'active_id']) && (
int)
$_POST[
'active_id']) {
1809 $active_fi = $_POST[
'active_id'];
1812 if (isset($_POST[
'pass']) && is_numeric($_POST[
'pass'])) {
1813 $pass = $_POST[
'pass'];
1816 if (is_null($active_fi) || is_null(
$pass)) {
1817 $this->ctrl->redirect($this,
'outUserResultsOverview');
1820 if (!$this->object->isDynamicTest() &&
$pass == $this->
object->_getResultPass($active_fi)) {
1821 $this->ctrl->redirect($this,
'outUserResultsOverview');
1826 SELECT tst_active.tries, tst_active.last_finished_pass, tst_sequence.pass 1828 LEFT JOIN tst_sequence 1829 ON tst_sequence.active_fi = tst_active.active_id 1830 AND tst_sequence.pass = tst_active.tries 1831 WHERE tst_active.active_id = {$ilDB->quote($active_fi, 'integer')} 1836 $tries =
$row[
'tries'];
1837 $lastFinishedPass = is_numeric(
$row[
'last_finished_pass']) ?
$row[
'last_finished_pass'] : -1;
1839 if (
$pass < $lastFinishedPass) {
1840 $isActivePass =
false;
1841 $must_renumber =
true;
1842 } elseif (
$pass == $lastFinishedPass) {
1843 $isActivePass =
false;
1845 if ($tries ==
$row[
'pass']) {
1846 $must_renumber =
true;
1848 $must_renumber =
false;
1851 $isActivePass =
true;
1852 $must_renumber =
false;
1854 throw new ilTestException(
'This should not happen, please contact Bjoern Heyser to clean up this pass salad!');
1857 if (!$this->object->isDynamicTest() && $isActivePass) {
1858 $this->ctrl->redirect($this,
'outUserResultsOverview');
1862 ($lastFinishedPass == 0 && $tries == 1 && $tries !=
$row[
'pass'])
1863 || ($isActivePass ==
true)
1876 WHERE active_id = ' .
$ilDB->quote($active_fi,
'integer')
1878 } elseif (!$isActivePass) {
1881 SET tries = ' .
$ilDB->quote($tries - 1,
'integer') .
', 1882 last_finished_pass = ' .
$ilDB->quote($lastFinishedPass - 1,
'integer') .
' 1883 WHERE active_id = ' .
$ilDB->quote($active_fi,
'integer')
1890 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1891 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1894 if ($must_renumber) {
1896 'UPDATE tst_manual_fb 1898 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1899 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1908 FROM tst_pass_result 1909 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1910 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1913 if ($must_renumber) {
1915 'UPDATE tst_pass_result 1917 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1918 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_sequence 1939 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1940 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1944 if ($this->object->isDynamicTest()) {
1946 'tst_seq_qst_tracking',
'tst_seq_qst_answstatus',
'tst_seq_qst_postponed',
'tst_seq_qst_checked' 1949 foreach ($tables as
$table) {
1952 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')} 1953 AND pass = {$ilDB->quote($pass, 'integer')} 1956 if ($must_renumber) {
1960 WHERE active_fi = {$ilDB->quote($active_fi, 'integer')} 1961 AND pass > {$ilDB->quote($pass, 'integer')} 1971 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1972 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1975 if ($must_renumber) {
1977 'UPDATE tst_solutions 1979 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1980 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
1987 FROM tst_test_result 1988 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1989 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
1992 if ($must_renumber) {
1994 'UPDATE tst_test_result 1996 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 1997 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
2007 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 2008 AND pass = ' .
$ilDB->quote(
$pass,
'integer')
2011 if ($must_renumber) {
2015 WHERE active_fi = ' .
$ilDB->quote($active_fi,
'integer') .
' 2016 AND pass > ' .
$ilDB->quote(
$pass,
'integer')
2020 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
2026 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
2029 if ($this->object->isDynamicTest()) {
2030 require_once
'Modules/Test/classes/tables/class.ilTestDynamicQuestionSetStatisticTableGUI.php';
2040 $ilDB = $DIC[
'ilDB'];
2041 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
2043 $resultData = $this->
object->getTestResult($active_id,
$pass,
false, $considerHiddenQuestions);
2044 $questionIds = array();
2045 foreach ($resultData as $resultItemKey => $resultItemValue) {
2046 if ($resultItemKey ===
'test' || $resultItemKey ===
'pass') {
2050 $questionIds[] = $resultItemValue[
'qid'];
2054 $table_gui->initFilter();
2056 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
2059 $questionList->setIncludeQuestionIdsFilter($questionIds);
2060 $questionList->setQuestionInstanceTypeFilter(null);
2062 foreach ($table_gui->getFilterItems() as $item) {
2063 if (substr($item->getPostVar(), 0, strlen(
'tax_')) ==
'tax_') {
2064 $v = $item->getValue();
2066 if (is_array($v) && count($v) && !(
int) $v[0]) {
2070 $taxId = substr($item->getPostVar(), strlen(
'tax_'));
2071 $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->
object->getId(),
'tst');
2072 } elseif ($item->getValue() !==
false) {
2073 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
2077 $questionList->load();
2079 $filteredTestResult = array();
2081 foreach ($resultData as $resultItemKey => $resultItemValue) {
2082 if ($resultItemKey ===
'test' || $resultItemKey ===
'pass') {
2086 if (!$questionList->isInList($resultItemValue[
'qid'])) {
2090 $filteredTestResult[] = $resultItemValue;
2093 return $filteredTestResult;
2100 $activeId = (int)
$_GET[
"active_id"];
2102 require_once
'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2105 require_once
'Modules/Test/classes/class.ilTestParticipantList.php';
2115 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
2118 $cgui->setHeaderText(sprintf(
2119 $this->lng->txt(
"finish_pass_for_user_confirmation"),
2123 $this->ctrl->setParameter($this,
'active_id', $activeId);
2124 $cgui->setFormAction($this->ctrl->getFormAction($this,
"participants"));
2126 $cgui->setCancel($this->lng->txt(
"cancel"),
"redirectBackToParticipantsScreen");
2127 $cgui->setConfirm($this->lng->txt(
"proceed"),
"confirmFinishTestPassForUser");
2129 $this->tpl->setContent($cgui->getHTML());
2136 $activeId = (int)
$_GET[
"active_id"];
2138 require_once
'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2141 require_once
'Modules/Test/classes/class.ilTestParticipantList.php';
2156 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
2158 $cgui->setFormAction($this->ctrl->getFormAction($this));
2159 $cgui->setHeaderText($this->lng->txt(
"finish_pass_for_all_users"));
2160 $cgui->setCancel($this->lng->txt(
"cancel"),
"redirectBackToParticipantsScreen");
2161 $cgui->setConfirm($this->lng->txt(
"proceed"),
"confirmFinishTestPassForAllUser");
2162 $this->tpl->setContent($cgui->getHTML());
2167 require_once
'Modules/Test/classes/class.ilTestParticipantAccessFilter.php';
2170 require_once
'Modules/Test/classes/class.ilTestParticipantList.php';
2172 $participantList->initializeFromDbRows($this->object->getTestParticipants());
2173 $participantList = $participantList->getAccessFilteredList($accessFilter);
2175 foreach ($participantList as $participant) {
2176 if (!$participant->hasUnfinishedPasses()) {
2180 $this->
finishTestPass($participant->getActiveId(), $this->
object->getId());
2188 $this->processLockerFactory->setActiveId($active_id);
2189 $processLocker = $this->processLockerFactory->getLocker();
2192 $test_pass_finisher->performFinishTasks($processLocker);
2197 $this->ctrl->redirectByClass(
"ilTestParticipantsGUI");
static _lookupName($a_user_id)
lookup user name
Class ilPdfGeneratorConstantsTest.
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
static _updateTestResultCache($active_id, ilAssQuestionProcessLocker $processLocker=null)
Move this to a proper place.
Class ilTestPassFinishTasks.
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)
setValue($a_value)
Set Value.
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.
outParticipantsResultsOverview()
Output of the pass overview for a test called from the statistics.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
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.
TableGUI class for results by question.
executeCommand()
execute command
exportAggregatedResults()
Exports the aggregated results.
Interface ilObjFileHandlingQuestionType.
outUserResultsOverview()
Output of the pass overview for a test called by a test participant.
getResultsSignature()
Returns HTML code for a signature field.
TableGUI class for evaluation of all users.
__construct(ilObjTest $a_object)
ilTestEvaluationGUI constructor
static accessViolationRedirect()
confirmFinishTestPassForUser()
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
Base Exception for all Exceptions relating to Modules/Test.
isGradingMessageRequired()
buildUserTestResultsToolbarGUI()
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
static _getLogLanguage()
retrieve the log language for assessment logging
getEvaluationQuestionId($question_id, $original_id="")
Returns the ID of a question for evaluation purposes.
static getInstance(ilTestSession $a_test_session)
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
finishTestPass($active_id, $obj_id)
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
if(isset($_POST['submit'])) $form
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.
getCommand($cmd)
Retrieves the ilCtrl command.
special template class to simplify handling of ITX/PEAR
Validates if an active certificate is stored in the database and can be downloaded by the user...
outParticipantsPassDetailsSetTableFilter()
static getAccessStatisticsUserFilter($refId)
finishTestPassForSingleUser()
Output class for assessment test evaluation.
redirectBackToParticipantsScreen()
static lookupLastTestPassAccess($activeId, $passIndex)
const CONTEXT_INFO_SCREEN
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.
redirectToPassDeletionContext($context)
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
This class represents a non editable value in a property form.
getGradingMessageBuilder($activeId)
Class ilTestDetailedEvaluationStatisticsTableGUI.
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 _lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
if(empty($password)) $table
outUserListOfAnswerPasses()
Output of the pass overview for a user when he/she wants to see his/her list of answers.
const PDF_OUTPUT_DOWNLOAD
outParticipantsPassDetailsResetTableFilter()
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
eval_a()
Output of anonymous aggregated results for the test.
static prepareGenerationRequest($service, $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
getQuestionResultForTestUsers($question_id, $test_id)
Creates a HTML representation for the results of a given question in a test.
Confirmation screen class.
static lookupExamId($active_id, $pass)
downloadPdf(int $userId, int $objectId)