19 declare(strict_types=1);
32 require_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
122 $this->
lng = $DIC[
'lng'];
123 $this->tpl = $DIC[
'tpl'];
124 $this->content_style = $DIC->contentStyle();
125 $this->error = $DIC[
'ilErr'];
126 $this->
access = $DIC[
'ilAccess'];
127 $this->
http = $DIC[
'http'];
128 $this->
ctrl = $DIC[
'ilCtrl'];
129 $this->
user = $DIC->user();
130 $this->
ilias = $DIC[
'ilias'];
131 $this->
settings = $DIC[
'ilSetting'];
132 $this->global_screen = $DIC[
'global_screen'];
133 $this->tree = $DIC[
'tree'];
134 $this->db = $DIC[
'ilDB'];
135 $this->component_repository = $DIC[
'component.repository'];
136 $this->navigation_history = $DIC[
'ilNavigationHistory'];
137 $this->
tabs = $DIC[
'ilTabs'];
138 $this->
toolbar = $DIC[
'ilToolbar'];
139 $this->logging_services = $DIC->logger();
140 $this->
help = $DIC[
'ilHelp'];
142 $this->ui_factory = $DIC[
'ui.factory'];
143 $this->ui_renderer = $DIC[
'ui.renderer'];
144 $this->rbac_system = $DIC[
'rbacsystem'];
145 $this->obj_cache = $DIC[
'ilObjDataCache'];
146 $this->skills_service = $DIC->skills();
147 $this->post_wrapper = $DIC->http()->wrapper()->post();
149 $this->questioninfo = $DIC->testQuestionPool()->questionInfo();
150 $this->service =
new ilTestService($this->
object, $this->db, $this->questioninfo);
152 $this->
lng->loadLanguageModule(
'cert');
153 $this->ref_id = $this->
object->getRefId();
155 $this->testSequenceFactory =
new ilTestSequenceFactory($this->
object, $this->db, $this->questioninfo);
156 $this->objective_oriented_container = null;
158 $this->ui_factory = $DIC[
'ui.factory'];
159 $this->ui_renderer = $DIC[
'ui.renderer'];
162 $this->testrequest = $local_dic[
'request.internal'];
163 $this->participant_access_filter = $local_dic[
'participantAccessFilterFactory'];
164 $this->shuffler = $local_dic[
'shuffler'];
165 $this->results_factory = $local_dic[
'factory.results'];
166 $this->results_presentation_factory = $local_dic[
'factory.results_presentation'];
192 $considerHiddenQuestions =
false;
196 $considerHiddenQuestions =
true;
199 $scoredPass = $this->
object->_getResultPass($testSession->
getActiveId());
205 foreach ($passes as $pass) {
209 'date' => ilObjTest::lookupLastTestPassAccess($testSession->
getActiveId(), $pass)
211 $considerOptionalQuestions =
true;
214 $test_sequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($testSession->
getActiveId(), $pass);
215 $test_sequence->loadFromDb();
216 $test_sequence->loadQuestions();
218 if ($this->
object->isRandomTest() && !$test_sequence->isAnsweringOptionalQuestionsConfirmed()) {
219 $considerOptionalQuestions =
false;
222 $test_sequence->setConsiderHiddenQuestionsEnabled($considerHiddenQuestions);
223 $test_sequence->setConsiderOptionalQuestionsEnabled($considerOptionalQuestions);
226 $objectives_list->loadObjectivesTitles();
228 $row[
'objectives'] = $objectives_list->getUniqueObjectivesStringForQuestions($test_sequence->getUserSequenceQuestions());
232 $result_array = $this->
object->getTestResult($testSession->
getActiveId(), $pass,
false, $considerHiddenQuestions, $considerOptionalQuestions);
234 foreach ($result_array as $resultStructKEY => $question) {
235 if ($resultStructKEY ===
'test' || $resultStructKEY ===
'pass') {
239 $requestData = $questionHintRequestRegister->getRequestByTestPassIndexAndQuestionId($pass, $question[
'qid']);
242 $result_array[
'pass'][
'total_requested_hints'] += $requestData->getRequestsCount();
244 $result_array[$resultStructKEY][
'requested_hints'] = $requestData->getRequestsCount();
245 $result_array[$resultStructKEY][
'hint_points'] = $requestData->getRequestsPoints();
249 if (!$result_array[
'pass'][
'total_max_points']) {
250 $row[
'percentage'] = 0;
252 $row[
'percentage'] = ($result_array[
'pass'][
'total_reached_points'] / $result_array[
'pass'][
'total_max_points']) * 100;
255 $row[
'max_points'] = $result_array[
'pass'][
'total_max_points'];
256 $row[
'reached_points'] = $result_array[
'pass'][
'total_reached_points'];
257 $row[
'scored'] = ($pass == $scoredPass);
258 $row[
'num_workedthrough_questions'] = $result_array[
'pass'][
'num_workedthrough'];
259 $row[
'num_questions_total'] = $result_array[
'pass'][
'num_questions_total'];
261 if ($this->
object->isOfferingQuestionHintsEnabled()) {
262 $row[
'hints'] = $result_array[
'pass'][
'total_requested_hints'];
293 $cmd = $this->
ctrl->getCmd();
294 $next_class = $this->
ctrl->getNextClass($this);
297 switch ($next_class) {
299 $ret = &$this->$cmd();
319 $table->setPdfPresentationEnabled(
320 $this->testrequest->isset(
'pdf') && $this->testrequest->raw(
'pdf') == 1
323 $table->setObjectiveOrientedPresentationEnabled(
344 $show_solutions =
false,
345 $only_answered_questions =
false,
346 $show_question_only =
false,
347 $show_reached_points =
false,
352 $maintemplate =
new ilTemplate(
"tpl.il_as_tst_list_of_answers.html",
true,
true,
"Modules/Test");
356 foreach ($result_array as $question_data) {
357 if (!array_key_exists(
'workedthrough', $question_data)) {
358 $question_data[
'workedthrough'] = 0;
360 if (!array_key_exists(
'qid', $question_data)) {
361 $question_data[
'qid'] = -1;
364 if (($question_data[
"workedthrough"] == 1) || ($only_answered_questions ==
false)) {
365 $template =
new ilTemplate(
"tpl.il_as_qpl_question_printview.html",
true,
true,
"Modules/TestQuestionPool");
366 $question_id = $question_data[
"qid"] ?? null;
367 if ($question_id !== null
368 && $question_id !== -1
369 && is_numeric($question_id)) {
370 $maintemplate->setCurrentBlock(
"printview_question");
371 $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
373 $question_gui->object->setShuffler($this->shuffler->getAnswerShuffleFor(
378 if (is_object($question_gui)) {
380 $template->setCurrentBlock(
'block_id');
381 $template->setVariable(
'BLOCK_ID',
"detailed_answer_block_act_{$active_id}_qst_{$question_id}");
382 $template->parseCurrentBlock();
384 $template->setCurrentBlock(
'back_anchor');
385 $template->setVariable(
'HREF_BACK_ANCHOR',
"#pass_details_tbl_row_act_{$active_id}_qst_{$question_id}");
386 $template->setVariable(
'TXT_BACK_ANCHOR', $this->
lng->txt(
'tst_back_to_question_list'));
387 $template->parseCurrentBlock();
390 if ($show_reached_points) {
391 $template->setCurrentBlock(
"result_points");
392 $template->setVariable(
"RESULT_POINTS", $this->
lng->txt(
"tst_reached_points") .
": " . $question_gui->object->getReachedPoints($active_id, $pass) .
" " . $this->
lng->txt(
"of") .
" " . $question_gui->object->getMaximumPoints());
393 $template->parseCurrentBlock();
395 $template->setVariable(
"COUNTER_QUESTION", $counter .
". ");
396 $template->setVariable(
"TXT_QUESTION_ID", $this->
lng->txt(
'question_id_short'));
397 $template->setVariable(
"QUESTION_ID", $question_gui->object->getId());
398 $template->setVariable(
"QUESTION_TITLE", $this->
object->getQuestionTitle($question_gui->object->getTitleForHTMLOutput()));
400 if ($objectives_list !== null) {
401 $objectives = $this->
lng->txt(
'tst_res_lo_objectives_header') .
': ';
402 $objectives .= $objectives_list->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
406 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ?
true :
false;
412 if ($show_best_solution) {
413 $compare_template =
new ilTemplate(
'tpl.il_as_tst_answers_compare.html',
true,
true,
'Modules/Test');
414 $test_session = $this->testSessionFactory->getSession($active_id);
415 if ($pass <= $test_session->getLastFinishedPass()) {
416 $compare_template->setVariable(
"HEADER_PARTICIPANT", $this->
lng->txt(
'tst_header_participant'));
418 $compare_template->setVariable(
"HEADER_PARTICIPANT", $this->
lng->txt(
'tst_header_participant_no_answer'));
421 $compare_template->setVariable(
"HEADER_SOLUTION", $this->
lng->txt(
'tst_header_solution'));
422 $result_output = $question_gui->getSolutionOutput($active_id, $pass, $show_graphical_output,
false, $show_question_only, $show_feedback);
423 $best_output = $question_gui->getSolutionOutput($active_id, $pass,
false,
false, $show_question_only,
false,
true);
425 $compare_template->setVariable(
'PARTICIPANT', $result_output);
426 $compare_template->setVariable(
'SOLUTION', $best_output);
427 $template->setVariable(
'SOLUTION_OUTPUT', $compare_template->get());
429 $result_output = $question_gui->getSolutionOutput($active_id, $pass, $show_graphical_output,
false, $show_question_only, $show_feedback);
430 $template->setVariable(
'SOLUTION_OUTPUT', $result_output);
433 $maintemplate->setCurrentBlock(
"printview_question");
434 $maintemplate->setVariable(
"QUESTION_PRINTVIEW", $template->get());
435 $maintemplate->parseCurrentBlock();
442 if ($testResultHeaderLabelBuilder !== null) {
443 if ($pass !== null) {
444 $headerText = $testResultHeaderLabelBuilder->getListOfAnswersHeaderLabel($pass + 1);
446 $headerText = $testResultHeaderLabelBuilder->getVirtualListOfAnswersHeaderLabel();
452 $maintemplate->setVariable(
"RESULTS_OVERVIEW", $headerText);
453 return $maintemplate->get();
470 $maintemplate =
new ilTemplate(
"tpl.il_as_tst_list_of_answers.html",
true,
true,
"Modules/Test");
475 foreach ($result_array as $question_data) {
476 $question = $question_data[
"qid"];
477 if (is_numeric($question)) {
478 $question_gui = $this->
object->createQuestionGUI(
"", $question);
479 if (in_array($question_gui->object->getQuestionTypeID(), $scoring)) {
480 $template =
new ilTemplate(
"tpl.il_as_qpl_question_printview.html",
true,
true,
"Modules/TestQuestionPool");
481 $scoretemplate =
new ilTemplate(
"tpl.il_as_tst_manual_scoring_points.html",
true,
true,
"Modules/Test");
482 #mbecker: No such block. $this->tpl->setCurrentBlock("printview_question"); 483 $template->setVariable(
"COUNTER_QUESTION", $counter .
". ");
484 $template->setVariable(
"QUESTION_TITLE", $this->
object->getQuestionTitle($question_gui->object->getTitleForHTMLOutput()));
485 $points = $question_gui->object->getMaximumPoints();
487 $template->setVariable(
"QUESTION_POINTS", $points .
" " . $this->
lng->txt(
"point"));
489 $template->setVariable(
"QUESTION_POINTS", $points .
" " . $this->
lng->txt(
"points"));
492 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ?
true :
false;
493 $result_output = $question_gui->getSolutionOutput($active_id, $pass, $show_solutions,
false, $show_question_only, $this->
object->getShowSolutionFeedback(),
false,
true);
495 $solout = $question_gui->object->getSuggestedSolutionOutput();
496 if (strlen($solout)) {
497 $scoretemplate->setCurrentBlock(
"suggested_solution");
498 $scoretemplate->setVariable(
"TEXT_SUGGESTED_SOLUTION", $this->
lng->txt(
"solution_hint"));
499 $scoretemplate->setVariable(
"VALUE_SUGGESTED_SOLUTION", $solout);
500 $scoretemplate->parseCurrentBlock();
503 $scoretemplate->setCurrentBlock(
"feedback");
504 $scoretemplate->setVariable(
"FEEDBACK_NAME_INPUT", $question);
506 $scoretemplate->setVariable(
509 $this->
object->prepareTextareaOutput($feedback,
true)
512 $scoretemplate->setVariable(
"TEXT_MANUAL_FEEDBACK", $this->
lng->txt(
"set_manual_feedback"));
513 $scoretemplate->parseCurrentBlock();
515 $scoretemplate->setVariable(
"NAME_INPUT", $question);
516 $this->
ctrl->setParameter($this,
"active_id", $active_id);
517 $this->
ctrl->setParameter($this,
"pass", $pass);
518 $scoretemplate->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this,
"manscoring"));
519 $scoretemplate->setVariable(
"LABEL_INPUT", $this->
lng->txt(
"tst_change_points_for_question"));
521 $scoretemplate->setVariable(
"VALUE_SAVE", $this->
lng->txt(
"save"));
523 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
524 $maintemplate->setCurrentBlock(
"printview_question");
525 $maintemplate->setVariable(
"QUESTION_PRINTVIEW", $template->get());
526 $maintemplate->setVariable(
"QUESTION_SCORING", $scoretemplate->get());
527 $maintemplate->parseCurrentBlock();
534 $maintemplate->setVariable(
"NO_QUESTIONS_FOUND", $this->
lng->txt(
"manscoring_questions_not_found"));
536 $maintemplate->setVariable(
"RESULTS_OVERVIEW", sprintf($this->
lng->txt(
"manscoring_results_pass"), $pass + 1));
540 return $maintemplate->get();
550 bool $multiple_objectives_involved =
true 552 $this->
ctrl->setParameter($target_gui,
'active_id', $active_id);
553 $this->
ctrl->setParameter($target_gui,
'pass', $pass);
556 $table_gui->setShowHintCount($this->
object->isOfferingQuestionHintsEnabled());
558 if ($objectives_list !== null) {
559 $table_gui->setQuestionRelatedObjectivesList($objectives_list);
560 $table_gui->setObjectiveOrientedPresentationEnabled(
true);
563 $table_gui->setMultipleObjectivesInvolved($multiple_objectives_involved);
565 $table_gui->setActiveId($active_id);
566 $table_gui->setShowSuggestedSolution(
false);
568 $users_question_solutions = [];
570 foreach ($result_array as
$key => $val) {
571 if (
$key ===
'test' ||
$key ===
'pass') {
575 if ($this->
object->getShowSolutionSuggested() && strlen($val[
'solution'])) {
576 $table_gui->setShowSuggestedSolution(
true);
579 if (isset($val[
'pass'])) {
580 $table_gui->setPassColumnEnabled(
true);
583 $users_question_solutions[
$key] = $val;
586 $table_gui->initColumns();
588 $table_gui->setFilterCommand($target_cmd .
'SetTableFilter');
589 $table_gui->setResetCommand($target_cmd .
'ResetTableFilter');
591 $table_gui->setData($users_question_solutions);
604 if ($this->
object->getShowSolutionSignature() && !$this->
object->getAnonymity()) {
605 $template =
new ilTemplate(
"tpl.il_as_tst_results_userdata_signature.html",
true,
true,
"Modules/Test");
606 $template->setVariable(
"TXT_DATE", $this->
lng->txt(
"date"));
611 $template->setVariable(
"TXT_SIGNATURE", $this->
lng->txt(
"tst_signature"));
613 return $template->get();
630 if (!is_object($testSession)) {
633 $template =
new ilTemplate(
"tpl.il_as_tst_results_userdata.html",
true,
true,
"Modules/Test");
634 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
641 $t = $testSession->getSubmittedTimestamp();
643 $t = $this->
object->_getLastAccess($testSession->getActiveId());
647 $uname = $this->
object->userLookupFullName($user_id, $overwrite_anonymity);
648 $template->setCurrentBlock(
"name");
649 $template->setVariable(
'TXT_USR_NAME', $this->
lng->txt(
"name"));
650 $template->setVariable(
'VALUE_USR_NAME', $uname);
651 $template->parseCurrentBlock();
655 if (strlen($user->
getMatriculation()) && (($this->
object->getAnonymity() ==
false) || ($overwrite_anonymity))) {
656 $template->setCurrentBlock(
"matriculation");
657 $template->setVariable(
"TXT_USR_MATRIC", $this->
lng->txt(
"matriculation"));
659 $template->parseCurrentBlock();
660 $title_matric =
" - " . $this->
lng->txt(
"matriculation") .
": " . $user->
getMatriculation();
663 $invited_user = array_pop($this->
object->getInvitedUsers($user_id));
665 if (is_array($invited_user)
666 && array_key_exists(
'clientip', $invited_user)
667 && is_string($invited_user[
'clientip'])
668 && trim($invited_user[
'clientip']) !==
'' 670 $template->setCurrentBlock(
"client_ip");
671 $template->setVariable(
"TXT_CLIENT_IP", $this->
lng->txt(
"client_ip"));
672 $template->setVariable(
"VALUE_CLIENT_IP", $invited_user[
"clientip"]);
673 $template->parseCurrentBlock();
674 $title_client =
" - " . $this->
lng->txt(
"clientip") .
": " . $invited_user[
"clientip"];
677 $template->setVariable(
"TXT_TEST_TITLE", $this->
lng->txt(
"title"));
678 $template->setVariable(
"VALUE_TEST_TITLE", $this->
object->getTitle());
681 $pagetitle = $this->
object->getTitle() . $title_matric . $title_client;
682 $this->tpl->setHeaderPageTitle($pagetitle);
684 return $template->get();
700 $test_id = $this->
object->getTestId();
701 $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
703 $template =
new ilTemplate(
"tpl.il_as_tst_correct_solution_output.html",
true,
true,
"Modules/Test");
704 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ?
true :
false;
705 $result_output = $question_gui->getSolutionOutput($active_id, $pass,
true,
false, $show_question_only, $this->
object->getShowSolutionFeedback(),
false,
false,
true);
706 $best_output = $question_gui->getSolutionOutput($active_id, $pass,
false,
false, $show_question_only,
false,
true,
false,
false);
707 if ($this->
object->getShowSolutionFeedback() && $this->testrequest->raw(
'cmd') !=
'outCorrectSolution') {
708 $specificAnswerFeedback = $question_gui->getSpecificFeedbackOutput(
709 $question_gui->object->fetchIndexedValuesFromValuePairs(
710 $question_gui->object->getSolutionValues($active_id, $pass)
713 if (strlen($specificAnswerFeedback)) {
714 $template->setCurrentBlock(
"outline_specific_feedback");
715 $template->setVariable(
"OUTLINE_SPECIFIC_FEEDBACK", $specificAnswerFeedback);
716 $template->parseCurrentBlock();
719 $template->setVariable(
"TEXT_YOUR_SOLUTION", $this->
lng->txt(
"tst_your_answer_was"));
720 $template->setVariable(
"TEXT_SOLUTION_OUTPUT", $this->
lng->txt(
"tst_your_answer_was"));
722 $maxpoints = $question_gui->object->getMaximumPoints();
723 if ($maxpoints == 1) {
724 $template->setVariable(
"QUESTION_TITLE", $this->
object->getQuestionTitle($question_gui->object->getTitleForHTMLOutput()) .
" (" . $maxpoints .
" " . $this->
lng->txt(
"point") .
")");
726 $template->setVariable(
"QUESTION_TITLE", $this->
object->getQuestionTitle($question_gui->object->getTitleForHTMLOutput()) .
" (" . $maxpoints .
" " . $this->
lng->txt(
"points") .
")");
728 if ($objectives_list !== null) {
729 $objectives = $this->
lng->txt(
'tst_res_lo_objectives_header') .
': ';
730 $objectives .= $objectives_list->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
733 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
734 $template->setVariable(
"RECEIVED_POINTS", sprintf($this->
lng->txt(
"you_received_a_of_b_points"), $question_gui->object->getReachedPoints($active_id, $pass), $maxpoints));
735 $template->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this));
736 $template->setVariable(
"BACKLINK_TEXT",
"<< " . $this->
lng->txt(
"back"));
737 return $template->get();
757 bool $show_pass_details =
true,
758 bool $show_answers =
true,
759 bool $show_question_only =
false,
760 bool $show_reached_points =
false 762 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html",
true,
true,
"Modules/Test");
765 $user_id = $this->participantData->getUserIdByActiveId($active_id);
766 $uname = $this->participantData->getConcatedFullnameByActiveId($active_id,
false);
768 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
769 $uname = $this->
object->userLookupFullName($user_id,
true);
772 if ($this->
object->getAnonymity()) {
773 $uname = $this->
lng->txt(
'anonymous');
776 if ((($this->testrequest->isset(
'pass')) && (strlen($this->testrequest->raw(
"pass")) > 0)) || (!is_null($pass))) {
777 if (is_null($pass)) {
778 $pass = $this->testrequest->raw(
"pass");
782 if (!is_null($pass)) {
784 $objectives_list = null;
787 $test_sequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
788 $test_sequence->loadFromDb();
789 $test_sequence->loadQuestions();
794 $objectives_list->loadObjectivesTitles();
797 $testResultHeaderLabelBuilder->setUserId($testSession->
getUserId());
798 $testResultHeaderLabelBuilder->setTestObjId($this->
object->getId());
799 $testResultHeaderLabelBuilder->setTestRefId($this->
object->getRefId());
800 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
803 $result_array = $this->
object->getTestResult(
810 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
811 $showAllAnswers =
true;
812 if ($this->
object->isExecutable($testSession, $user_id)) {
813 $showAllAnswers =
false;
823 $show_reached_points,
826 $testResultHeaderLabelBuilder
828 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
831 if ($show_pass_details) {
837 "getResultsOfUserOutput",
840 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel($pass + 1));
841 $template->setVariable(
"PASS_DETAILS", $overviewTableGUI->getHTML());
845 $template->setVariable(
"SIGNATURE", $signature);
847 if ($this->
object->isShowExamIdInTestResultsEnabled()) {
848 $template->setCurrentBlock(
'exam_id_footer');
853 $template->setVariable(
'EXAM_ID_TXT', $this->
lng->txt(
'exam_id'));
854 $template->parseCurrentBlock();
858 $template->setCurrentBlock(
'participant_back_anchor');
859 $template->setVariable(
"HREF_PARTICIPANT_BACK_ANCHOR",
"#tst_results_toolbar");
860 $template->setVariable(
"TXT_PARTICIPANT_BACK_ANCHOR", $this->
lng->txt(
'tst_back_to_top'));
861 $template->parseCurrentBlock();
863 $template->setCurrentBlock(
'participant_block_id');
864 $template->setVariable(
"PARTICIPANT_BLOCK_ID",
"participant_active_{$active_id}");
865 $template->parseCurrentBlock();
869 $gradingMessageBuilder->buildList();
871 $template->setCurrentBlock(
'grading_message');
872 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
873 $template->parseCurrentBlock();
878 $template->setVariable(
"TEXT_HEADING", sprintf($this->
lng->txt(
"tst_result_user_name"), $uname));
879 $template->setVariable(
"USER_DATA", $user_data);
884 return $template->get();
896 $template =
new ilTemplate(
"tpl.il_as_tst_results_head_user_pass.html",
true,
true,
"Modules/Test");
897 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
905 $template->setCurrentBlock(
"user_matric");
906 $template->setVariable(
"TXT_USR_MATRIC", $this->
lng->txt(
"matriculation"));
907 $template->parseCurrentBlock();
908 $template->setCurrentBlock(
"user_matric_value");
910 $template->parseCurrentBlock();
911 $template->touchBlock(
"user_matric_separator");
914 $invited_user = array_pop($this->
object->getInvitedUsers($user_id));
915 if (strlen($invited_user[
"clientip"] ??
'')) {
916 $template->setCurrentBlock(
"user_clientip");
917 $template->setVariable(
"TXT_CLIENT_IP", $this->
lng->txt(
"client_ip"));
918 $template->parseCurrentBlock();
919 $template->setCurrentBlock(
"user_clientip_value");
920 $template->setVariable(
"VALUE_CLIENT_IP", $invited_user[
"clientip"]);
921 $template->parseCurrentBlock();
922 $template->touchBlock(
"user_clientip_separator");
925 $template->setVariable(
"TXT_USR_NAME", $this->
lng->txt(
"name"));
926 $uname = $this->
object->userLookupFullName($user_id,
false);
927 $template->setVariable(
"VALUE_USR_NAME", $uname);
928 $template->setVariable(
"TXT_PASS", $this->
lng->txt(
"scored_pass"));
929 $template->setVariable(
"VALUE_PASS", $pass);
930 return $template->get();
935 $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
937 $this->
object->setAccessFilteredParticipantList(
938 $this->
object->buildStatisticsAccessFilteredParticipantList()
941 $foundusers = $this->
object->getParticipantsForTestAndQuestion($test_id, $question_id);
943 foreach ($foundusers as $active_id => $passes) {
944 $resultpass = $this->
object->_getResultPass($active_id);
945 for ($i = 0; $i < count($passes); $i++) {
946 if (($resultpass !== null) && ($resultpass == $passes[$i][
"pass"])) {
948 $output .=
"<br /><br /><br />";
952 $question_gui = $this->
object->createQuestionGUI(
"", $passes[$i][
"qid"]);
955 $output .= $question_gui->getSolutionOutput(
958 $graphicalOutput =
false,
959 $result_output =
false,
960 $show_question_only =
false,
961 $show_feedback =
false 978 $session = $this->testSessionFactory->getSession();
981 && $session->getLastFinishedPass() < $session->getLastStartedPass()) {
985 if ($this->
object->isShowGradingStatusEnabled()
986 || $this->
object->isShowGradingMarkEnabled()) {
997 $gradingMessageBuilder->setActiveId($active_id);
999 return $gradingMessageBuilder;
1010 return $questionRelatedObjectivesList;
1016 bool $considerHiddenQuestions,
1017 bool $considerOptionalQuestions
1026 $questionList->setParentObjIdsFilter([$this->
object->getId()]);
1029 foreach ($table_gui->getFilterItems() as $item) {
1030 if (substr($item->getPostVar(), 0, strlen(
'tax_')) ==
'tax_') {
1031 $v = $item->getValue();
1033 if (is_array($v) && count($v) && !(
int) $v[0]) {
1037 $taxId = substr($item->getPostVar(), strlen(
'tax_'));
1038 $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->
object->getId(),
'tst');
1039 } elseif ($item->getValue() !==
false) {
1040 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1044 $questionList->load();
1046 $filteredTestResult = [];
1048 $resultData = $this->
object->getTestResult($active_id, $pass,
false, $considerHiddenQuestions, $considerOptionalQuestions);
1050 foreach ($resultData as $resultItemKey => $resultItemValue) {
1051 if ($resultItemKey ===
'test' || $resultItemKey ===
'pass') {
1055 if (!$questionList->isInList($resultItemValue[
'qid'])) {
1059 $filteredTestResult[] = $resultItemValue;
1062 return $filteredTestResult;
1070 $this->tpl->setContent($content);
1093 if (!$this->
object->getShowSolutionDetails()) {
1094 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"no_permission"),
true);
1095 $this->
ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1098 $testSession = $this->testSessionFactory->getSession();
1099 $active_id = $testSession->getActiveId();
1101 if (!($active_id > 0)) {
1102 $this->
ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1105 $this->
ctrl->saveParameter($this,
"pass");
1106 $pass = (
int) $this->testrequest->raw(
"pass");
1108 $active_id = (
int) $this->testrequest->raw(
'evaluation');
1110 $test_sequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
1111 $test_sequence->loadFromDb();
1112 $test_sequence->loadQuestions();
1114 if (!$test_sequence->questionExists($active_id)) {
1115 ilObjTestGUI::accessViolationRedirect();
1119 $test_sequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, $pass);
1120 $test_sequence->loadFromDb();
1121 $test_sequence->loadQuestions();
1125 $objectives_list->loadObjectivesTitles();
1127 $objectives_list = null;
1134 $this->
lng->txt(
"tst_back_to_virtual_pass"),
1135 $this->
ctrl->getLinkTarget($this,
'showVirtualPass')
1138 $ilTabs->setBackTarget(
1139 $this->
lng->txt(
"tst_back_to_pass_details"),
1140 $this->
ctrl->getLinkTarget($this,
'outUserPassDetails')
1143 $ilTabs->clearSubTabs();
1145 $this->tpl->setCurrentBlock(
"ContentStyle");
1147 $this->tpl->parseCurrentBlock();
1149 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1151 $this->tpl->parseCurrentBlock();
1154 if ($this->
object->getShowSolutionAnswersOnly()) {
1160 $this->tpl->setContent($solution);
1165 if ($pass_finish_date === null) {
1172 $tpl->
setVariable(
"PASS_FINISH_DATE_LABEL", $this->
lng->txt(
'tst_pass_finished_on'));
1173 $tpl->
setVariable(
"PASS_FINISH_DATE_VALUE", $pass_finish_date_string);
1178 if ($this->
object->isShowExamIdInTestResultsEnabled()) {
1189 return $this->object;
static get(string $a_var)
populateExamId(ilTemplate $tpl, int $active_id, int $pass)
Readable part of repository interface to ilComponentDataDB.
ilComponentRepository $component_repository
getQuestionResultForTestUsers(int $question_id, int $test_id)
ilTestResultsPresentationFactory $results_presentation_factory
ilParticipantsTestResultsGUI: ilTestEvaluationGUI ilParticipantsTestResultsGUI: ilAssQuestionPageGUI...
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
isContextResultPresentation()
ContentStyle $content_style
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilTestResultsFactory $results_factory
ilRbacSystem $rbac_system
Provides fluid interface to LoggingServices.
Class ChatMainBarProvider .
setObjectiveOrientedContainer(ilTestObjectiveOrientedContainer $objective_oriented_container)
getObjectiveOrientedContainer()
getResultsOfUserOutput(ilTestSession $testSession, int $active_id, int $pass, ilParticipantsTestResultsGUI $target_gui, bool $show_pass_details=true, bool $show_answers=true, bool $show_question_only=false, bool $show_reached_points=false)
Output of the pass overview for a test called by a test participant.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
ilGlobalTemplateInterface ilTemplate $tpl
sk 2023-08-01: We need this union type, even if it is wrong! To change this
static initDomEvent(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI DomEvent used in Services/Calendar, Modules/Session, Modules/Test (Jan 2022) ...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
getFilteredTestResult(int $active_id, int $pass, bool $considerHiddenQuestions, bool $considerOptionalQuestions)
setContextResultPresentation(bool $contextResultPresentation)
getResultsSignature()
Returns HTML code for a signature field.
const QUESTION_INSTANCE_TYPE_DUPLICATES
getObjectiveOrientedContainerId()
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
buildPassOverviewTableGUI(ilTestEvaluationGUI $target_gui)
static getRequestRequestStatisticDataRegisterByActiveId($activeId)
static useRelativeDates()
isGradingMessageRequired()
buildUserTestResultsToolbarGUI()
getPassListOfAnswers(&$result_array, $active_id, $pass, $show_solutions=false, $only_answered_questions=false, $show_question_only=false, $show_reached_points=false, $anchorNav=false, ilTestQuestionRelatedObjectivesList $objectives_list=null, ilTestResultHeaderLabelBuilder $testResultHeaderLabelBuilder=null)
Returns the list of answers of a users test pass.
ilNavigationHistory $navigation_history
setParticipantData(ilTestParticipantData $participantData)
static getInstance(ilTestSession $a_test_session)
static getSingleManualFeedback(int $active_id, int $question_id, int $pass)
getResultsHeadUserAndPass($active_id, $pass)
Returns the user and pass data for a test results output.
static http()
Fetches the global http state from ILIAS.
setVariable($variable, $value='')
Sets a variable value.
getGradingMessageBuilder(int $active_id)
populateContent($content)
getCommand($cmd)
Retrieves the ilCtrl command.
static _getReachedPoints(int $active_id, int $question_id, int $pass)
buildQuestionRelatedObjectiveList(ilTestQuestionSequence $a_test_sequence, ilTestQuestionRelatedObjectivesList $a_objectives_list)
SkillService $skills_service
setBackTarget(string $a_title, string $a_target, string $a_frame="")
outCorrectSolution()
Creates an output of the solution of an answer compared to the correct solution.
Output class for assessment test evaluation.
buildPassDetailsOverviewTableGUI(ilTestServiceGUI|ilParticipantsTestResultsGUI $target_gui, string $target_cmd)
header include for all ilias files.
ilTestSessionFactory $testSessionFactory
Class ilTestPassOverviewTableGUI.
ArrayBasedRequestWrapper $post_wrapper
static getSyntaxStylePath()
getCorrectSolutionOutput($question_id, $active_id, $pass, ilTestQuestionRelatedObjectivesList $objectives_list=null)
Returns an output of the solution to an answer compared to the correct solution.
ilObjectDataCache $obj_cache
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
Last visited history for repository items.
ILIAS TestQuestionPool QuestionInfoService $questioninfo
setLastname(string $a_str)
bool $contextResultPresentation
getPassDetailsOverviewTableGUI(array $result_array, int $active_id, int $pass, ilTestServiceGUI|ilParticipantsTestResultsGUI $target_gui, string $target_cmd, ilTestQuestionRelatedObjectivesList $objectives_list=null, bool $multiple_objectives_involved=true)
Error Handling & global info handling.
ilTestParticipantData $participantData
ilTestObjectiveOrientedContainer $objective_oriented_container
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectives_adapter, ilTestQuestionSequence $test_sequence)
static _getManualScoring()
Retrieve the manual scoring settings.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
executeCommand()
execute command
const RENDER_PURPOSE_PRINT_PDF
Service GUI class for tests.
static setUseRelativeDates(bool $a_status)
set use relative dates
populatePassFinishDate(ilTemplate $tpl, ?int $pass_finish_date)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
InternalRequestService $testrequest
GlobalScreenServices $global_screen
getPassListOfAnswersWithScoring(&$result_array, $active_id, $pass, $show_solutions=false)
Returns the list of answers of a users test pass and offers a scoring option.
ilTestParticipantAccessFilterFactory $participant_access_filter
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
This method uses the data of a given test pass to create an evaluation for displaying into a table us...
LoggingServices $logging_services
ilTestSequenceFactory $testSequenceFactory
static lookupExamId($active_id, $pass)
static _lookupLogin(int $a_user_id)