4 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
5 include_once
'Modules/Test/classes/class.ilTestService.php';
115 $tree = $DIC[
'tree'];
116 $ilDB = $DIC[
'ilDB'];
117 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
118 $ilTabs = $DIC[
'ilTabs'];
119 $ilObjDataCache = $DIC[
'ilObjDataCache'];
121 $lng->loadLanguageModule(
'cert');
127 $this->tabs = $ilTabs;
128 $this->objCache = $ilObjDataCache;
130 $this->
object = &$a_object;
131 $this->tree = &
$tree;
132 $this->ref_id = $a_object->ref_id;
136 require_once
'Modules/Test/classes/class.ilTestSessionFactory.php';
139 require_once
'Modules/Test/classes/class.ilTestSequenceFactory.php';
142 $this->objectiveOrientedContainer = null;
171 $considerHiddenQuestions =
false;
173 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
176 $considerHiddenQuestions =
true;
179 $scoredPass = $this->
object->_getResultPass($testSession->
getActiveId());
181 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
186 foreach ($passes as
$pass) {
189 $considerOptionalQuestions =
true;
192 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($testSession->
getActiveId(),
$pass);
194 $testSequence->loadFromDb();
195 $testSequence->loadQuestions();
197 if ($this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed()) {
198 $considerOptionalQuestions =
false;
201 $testSequence->setConsiderHiddenQuestionsEnabled($considerHiddenQuestions);
202 $testSequence->setConsiderOptionalQuestionsEnabled($considerOptionalQuestions);
205 $objectivesList->loadObjectivesTitles();
207 $row[
'objectives'] = $objectivesList->getUniqueObjectivesStringForQuestions($testSequence->getUserSequenceQuestions());
211 $result_array = $this->
object->getTestResult($testSession->
getActiveId(),
$pass,
false, $considerHiddenQuestions, $considerOptionalQuestions);
213 foreach ($result_array as $resultStructKEY => $question) {
214 if ($resultStructKEY ===
'test' || $resultStructKEY ===
'pass') {
218 $requestData = $questionHintRequestRegister->getRequestByTestPassIndexAndQuestionId($pass, $question[
'qid']);
221 $result_array[
'pass'][
'total_requested_hints'] += $requestData->getRequestsCount();
223 $result_array[$resultStructKEY][
'requested_hints'] = $requestData->getRequestsCount();
224 $result_array[$resultStructKEY][
'hint_points'] = $requestData->getRequestsPoints();
228 if (!$result_array[
'pass'][
'total_max_points']) {
231 $percentage = ($result_array[
'pass'][
'total_reached_points'] / $result_array[
'pass'][
'total_max_points']) * 100;
233 $total_max = $result_array[
'pass'][
'total_max_points'];
234 $total_reached = $result_array[
'pass'][
'total_reached_points'];
235 $total_requested_hints = $result_array[
'pass'][
'total_requested_hints'];
239 $row[
'scored'] = ($pass == $scoredPass);
245 $row[
'num_workedthrough_questions'] = $result_array[
'pass'][
'num_workedthrough'];
246 $row[
'num_questions_total'] = $result_array[
'pass'][
'num_questions_total'];
248 if ($this->object->isOfferingQuestionHintsEnabled()) {
249 $row[
'hints'] = $total_requested_hints;
252 $row[
'reached_points'] = $total_reached;
253 $row[
'max_points'] = $total_max;
254 $row[
'percentage'] = $percentage;
284 $cmd = $this->ctrl->getCmd();
285 $next_class = $this->ctrl->getNextClass($this);
288 switch ($next_class) {
290 $ret = &$this->$cmd();
311 if (!isset(
$_GET[
'pdf'])) {
315 if (!(
bool)
$_GET[
'pdf']) {
327 require_once
'Modules/Test/classes/tables/class.ilTestPassOverviewTableGUI.php';
331 $table->setPdfPresentationEnabled(
335 $table->setObjectiveOrientedPresentationEnabled(
354 $maintemplate =
new ilTemplate(
"tpl.il_as_tst_list_of_answers.html",
true,
true,
"Modules/Test");
358 foreach ($result_array as $question_data) {
359 if (($question_data[
"workedthrough"] == 1) || ($only_answered_questions ==
false)) {
360 $template =
new ilTemplate(
"tpl.il_as_qpl_question_printview.html",
true,
true,
"Modules/TestQuestionPool");
361 $question = $question_data[
"qid"];
362 if (is_numeric($question)) {
363 $maintemplate->setCurrentBlock(
"printview_question");
364 $question_gui = $this->
object->createQuestionGUI(
"", $question);
365 if (is_object($question_gui)) {
372 $template->setVariable(
'BLOCK_ID',
"detailed_answer_block_act_{$active_id}_qst_{$question}");
375 $template->setCurrentBlock(
'back_anchor');
376 $template->setVariable(
'HREF_BACK_ANCHOR',
"#pass_details_tbl_row_act_{$active_id}_qst_{$question}");
377 $template->setVariable(
'TXT_BACK_ANCHOR', $this->lng->txt(
'tst_back_to_question_list'));
381 if ($show_reached_points) {
382 $template->setCurrentBlock(
"result_points");
383 $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());
386 $template->setVariable(
"COUNTER_QUESTION", $counter .
". ");
387 $template->setVariable(
"TXT_QUESTION_ID", $this->lng->txt(
'question_id_short'));
388 $template->setVariable(
"QUESTION_ID", $question_gui->object->getId());
389 $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()));
391 if ($objectivesList !== null) {
392 $objectives = $this->lng->txt(
'tst_res_lo_objectives_header') .
': ';
393 $objectives .= $objectivesList->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
394 $template->setVariable(
"OBJECTIVES", $objectives);
397 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ?
true :
false;
402 if ($show_solutions) {
403 $compare_template =
new ilTemplate(
'tpl.il_as_tst_answers_compare.html',
true,
true,
'Modules/Test');
404 $compare_template->setVariable(
"HEADER_PARTICIPANT", $this->lng->txt(
'tst_header_participant'));
405 $compare_template->setVariable(
"HEADER_SOLUTION", $this->lng->txt(
'tst_header_solution'));
406 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, $show_solutions,
false, $show_question_only, $showFeedback);
407 $best_output = $question_gui->getSolutionOutput($active_id,
$pass,
false,
false, $show_question_only,
false,
true);
409 $compare_template->setVariable(
'PARTICIPANT', $result_output);
410 $compare_template->setVariable(
'SOLUTION', $best_output);
411 if ($question_gui->supportsIntermediateSolutionOutput() && $question_gui->hasIntermediateSolution($active_id,
$pass)) {
412 $question_gui->setUseIntermediateSolution(
true);
413 $intermediate_output = $question_gui->getSolutionOutput($active_id,
$pass, $show_solutions,
false,
true, $showFeedback);
414 $question_gui->setUseIntermediateSolution(
false);
415 $compare_template->setVariable(
'TXT_INTERMEDIATE', $this->lng->txt(
'autosavecontent'));
416 $compare_template->setVariable(
'INTERMEDIATE', $intermediate_output);
418 $template->setVariable(
'SOLUTION_OUTPUT', $compare_template->get());
420 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, $show_solutions,
false, $show_question_only, $showFeedback);
421 if ($question_gui->supportsIntermediateSolutionOutput() && $question_gui->hasIntermediateSolution($active_id,
$pass)) {
422 $question_gui->setUseIntermediateSolution(
true);
423 $intermediate_output = $question_gui->getSolutionOutput($active_id,
$pass, $show_solutions,
false,
true, $showFeedback);
424 $question_gui->setUseIntermediateSolution(
false);
425 $template->setVariable(
'TXT_INTERMEDIATE', $this->lng->txt(
'autosavecontent'));
426 $template->setVariable(
'INTERMEDIATE', $intermediate_output);
428 $template->setVariable(
'SOLUTION_OUTPUT', $result_output);
431 $maintemplate->setCurrentBlock(
"printview_question");
432 $maintemplate->setVariable(
"QUESTION_PRINTVIEW",
$template->get());
433 $maintemplate->parseCurrentBlock();
440 if ($testResultHeaderLabelBuilder !== null) {
441 if (
$pass !== null) {
442 $headerText = $testResultHeaderLabelBuilder->getListOfAnswersHeaderLabel(
$pass + 1);
444 $headerText = $testResultHeaderLabelBuilder->getVirtualListOfAnswersHeaderLabel();
450 $maintemplate->setVariable(
"RESULTS_OVERVIEW", $headerText);
451 return $maintemplate->get();
468 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
470 $maintemplate =
new ilTemplate(
"tpl.il_as_tst_list_of_answers.html",
true,
true,
"Modules/Test");
472 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
477 foreach ($result_array as $question_data) {
478 $question = $question_data[
"qid"];
479 if (is_numeric($question)) {
480 $question_gui = $this->
object->createQuestionGUI(
"", $question);
481 if (in_array($question_gui->object->getQuestionTypeID(), $scoring)) {
482 $template =
new ilTemplate(
"tpl.il_as_qpl_question_printview.html",
true,
true,
"Modules/TestQuestionPool");
483 $scoretemplate =
new ilTemplate(
"tpl.il_as_tst_manual_scoring_points.html",
true,
true,
"Modules/Test");
484 #mbecker: No such block. $this->tpl->setCurrentBlock("printview_question"); 485 $template->setVariable(
"COUNTER_QUESTION", $counter .
". ");
486 $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()));
487 $points = $question_gui->object->getMaximumPoints();
489 $template->setVariable(
"QUESTION_POINTS", $points .
" " . $this->lng->txt(
"point"));
491 $template->setVariable(
"QUESTION_POINTS", $points .
" " . $this->lng->txt(
"points"));
494 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ?
true :
false;
495 $result_output = $question_gui->getSolutionOutput($active_id,
$pass, $show_solutions,
false, $show_question_only, $this->object->getShowSolutionFeedback(),
false,
true);
497 $solout = $question_gui->object->getSuggestedSolutionOutput();
498 if (strlen($solout)) {
499 $scoretemplate->setCurrentBlock(
"suggested_solution");
500 $scoretemplate->setVariable(
"TEXT_SUGGESTED_SOLUTION", $this->lng->txt(
"solution_hint"));
501 $scoretemplate->setVariable(
"VALUE_SUGGESTED_SOLUTION", $solout);
502 $scoretemplate->parseCurrentBlock();
505 $scoretemplate->setCurrentBlock(
"feedback");
506 $scoretemplate->setVariable(
"FEEDBACK_NAME_INPUT", $question);
507 $feedback = $this->
object->getManualFeedback($active_id, $question,
$pass);
508 $scoretemplate->setVariable(
"VALUE_FEEDBACK",
ilUtil::prepareFormOutput($this->object->prepareTextareaOutput($feedback,
true)));
509 $scoretemplate->setVariable(
"TEXT_MANUAL_FEEDBACK", $this->lng->txt(
"set_manual_feedback"));
510 $scoretemplate->parseCurrentBlock();
512 $scoretemplate->setVariable(
"NAME_INPUT", $question);
513 $this->ctrl->setParameter($this,
"active_id", $active_id);
514 $this->ctrl->setParameter($this,
"pass",
$pass);
515 $scoretemplate->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"manscoring"));
516 $scoretemplate->setVariable(
"LABEL_INPUT", $this->lng->txt(
"tst_change_points_for_question"));
518 $scoretemplate->setVariable(
"VALUE_SAVE", $this->lng->txt(
"save"));
520 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
521 $maintemplate->setCurrentBlock(
"printview_question");
522 $maintemplate->setVariable(
"QUESTION_PRINTVIEW",
$template->get());
523 $maintemplate->setVariable(
"QUESTION_SCORING", $scoretemplate->get());
524 $maintemplate->parseCurrentBlock();
531 $maintemplate->setVariable(
"NO_QUESTIONS_FOUND", $this->lng->txt(
"manscoring_questions_not_found"));
533 $maintemplate->setVariable(
"RESULTS_OVERVIEW", sprintf($this->lng->txt(
"manscoring_results_pass"),
$pass + 1));
535 include_once
"./Services/YUI/classes/class.ilYuiUtil.php";
538 return $maintemplate->get();
543 $this->ctrl->setParameter($targetGUI,
'active_id', $active_id);
544 $this->ctrl->setParameter($targetGUI,
'pass',
$pass);
549 $tableGUI->setAnswerListAnchorEnabled($questionAnchorNav);
552 $tableGUI->setSingleAnswerScreenCmd($questionDetailsCMD);
553 $tableGUI->setShowHintCount($this->object->isOfferingQuestionHintsEnabled());
555 if ($objectivesList !== null) {
556 $tableGUI->setQuestionRelatedObjectivesList($objectivesList);
557 $tableGUI->setObjectiveOrientedPresentationEnabled(
true);
560 $tableGUI->setMultipleObjectivesInvolved($multipleObjectivesInvolved);
562 $tableGUI->setActiveId($active_id);
563 $tableGUI->setShowSuggestedSolution(
false);
565 $usersQuestionSolutions = array();
567 foreach ($result_array as
$key => $val) {
568 if (
$key ===
'test' ||
$key ===
'pass') {
572 if ($this->object->getShowSolutionSuggested() && strlen($val[
'solution'])) {
573 $tableGUI->setShowSuggestedSolution(
true);
576 if (isset($val[
'pass'])) {
577 $tableGUI->setPassColumnEnabled(
true);
580 $usersQuestionSolutions[
$key] = $val;
583 $tableGUI->initColumns()->initFilter();
585 $tableGUI->setFilterCommand($targetCMD .
'SetTableFilter');
586 $tableGUI->setResetCommand($targetCMD .
'ResetTableFilter');
588 $tableGUI->setData($usersQuestionSolutions);
601 if ($this->object->getShowSolutionSignature() && !$this->
object->getAnonymity()) {
602 $template =
new ilTemplate(
"tpl.il_as_tst_results_userdata_signature.html",
true,
true,
"Modules/Test");
603 $template->setVariable(
"TXT_DATE", $this->lng->txt(
"date"));
608 $template->setVariable(
"TXT_SIGNATURE", $this->lng->txt(
"tst_signature"));
627 if (!is_object($testSession)) {
628 throw new TestException();
630 $template =
new ilTemplate(
"tpl.il_as_tst_results_userdata.html",
true,
true,
"Modules/Test");
631 include_once
'./Services/User/classes/class.ilObjUser.php';
632 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
637 $user->setLastname($this->lng->txt(
"deleted_user"));
639 $t = $testSession->getSubmittedTimestamp();
641 $t = $this->
object->_getLastAccess($testSession->getActiveId());
645 $uname = $this->
object->userLookupFullName($user_id, $overwrite_anonymity);
647 $template->setVariable(
'TXT_USR_NAME', $this->lng->txt(
"name"));
648 $template->setVariable(
'VALUE_USR_NAME', $uname);
653 if (strlen(
$user->getMatriculation()) && (($this->object->getAnonymity() ==
false) || ($overwrite_anonymity))) {
654 $template->setCurrentBlock(
"matriculation");
655 $template->setVariable(
"TXT_USR_MATRIC", $this->lng->txt(
"matriculation"));
656 $template->setVariable(
"VALUE_USR_MATRIC",
$user->getMatriculation());
658 $title_matric =
" - " . $this->lng->txt(
"matriculation") .
": " .
$user->getMatriculation();
661 $invited_user = array_pop($this->object->getInvitedUsers($user_id));
662 if (strlen($invited_user[
"clientip"])) {
664 $template->setVariable(
"TXT_CLIENT_IP", $this->lng->txt(
"client_ip"));
665 $template->setVariable(
"VALUE_CLIENT_IP", $invited_user[
"clientip"]);
667 $title_client =
" - " . $this->lng->txt(
"clientip") .
": " . $invited_user[
"clientip"];
670 $template->setVariable(
"TXT_TEST_TITLE", $this->lng->txt(
"title"));
671 $template->setVariable(
"VALUE_TEST_TITLE", $this->object->getTitle());
674 $pagetitle = $this->
object->getTitle() . $title_matric . $title_client;
675 $this->tpl->setHeaderPageTitle($pagetitle);
694 $test_id = $this->
object->getTestId();
695 $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
701 $template =
new ilTemplate(
"tpl.il_as_tst_correct_solution_output.html",
true,
true,
"Modules/Test");
702 $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ?
true :
false;
703 $result_output = $question_gui->getSolutionOutput($active_id,
$pass,
true,
false, $show_question_only, $this->object->getShowSolutionFeedback(),
false,
false,
true);
704 $best_output = $question_gui->getSolutionOutput($active_id,
$pass,
false,
false, $show_question_only,
false,
true,
false,
false);
705 if ($this->object->getShowSolutionFeedback() &&
$_GET[
'cmd'] !=
'outCorrectSolution') {
706 $specificAnswerFeedback = $question_gui->getSpecificFeedbackOutput(
707 $question_gui->object->fetchIndexedValuesFromValuePairs(
708 $question_gui->object->getSolutionValues($active_id,
$pass)
711 if (strlen($specificAnswerFeedback)) {
712 $template->setCurrentBlock(
"outline_specific_feedback");
713 $template->setVariable(
"OUTLINE_SPECIFIC_FEEDBACK", $specificAnswerFeedback);
717 if ($this->object->isBestSolutionPrintedWithResult() && strlen($best_output)) {
718 $template->setCurrentBlock(
"best_solution");
719 $template->setVariable(
"TEXT_BEST_SOLUTION", $this->lng->txt(
"tst_best_solution_is"));
720 $template->setVariable(
"BEST_OUTPUT", $best_output);
723 $template->setVariable(
"TEXT_YOUR_SOLUTION", $this->lng->txt(
"tst_your_answer_was"));
724 $maxpoints = $question_gui->object->getMaximumPoints();
725 if ($maxpoints == 1) {
726 $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()) .
" (" . $maxpoints .
" " . $this->lng->txt(
"point") .
")");
728 $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()) .
" (" . $maxpoints .
" " . $this->lng->txt(
"points") .
")");
730 if ($objectivesList !== null) {
731 $objectives = $this->lng->txt(
'tst_res_lo_objectives_header') .
': ';
732 $objectives .= $objectivesList->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
733 $template->setVariable(
'OBJECTIVES', $objectives);
735 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
736 $template->setVariable(
"RECEIVED_POINTS", sprintf($this->lng->txt(
"you_received_a_of_b_points"), $question_gui->object->getReachedPoints($active_id,
$pass), $maxpoints));
737 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
738 $template->setVariable(
"BACKLINK_TEXT",
"<< " . $this->lng->txt(
"back"));
754 public function getResultsOfUserOutput($testSession, $active_id,
$pass, $targetGUI, $show_pass_details =
true, $show_answers =
true, $show_question_only =
false, $show_reached_points =
false)
757 $ilObjDataCache = $DIC[
'ilObjDataCache'];
759 include_once(
"./Services/UICore/classes/class.ilTemplate.php");
760 $template =
new ilTemplate(
"tpl.il_as_tst_results_participant.html",
true,
true,
"Modules/Test");
763 $user_id = $this->participantData->getUserIdByActiveId($active_id);
764 $uname = $this->participantData->getConcatedFullnameByActiveId($active_id,
false);
766 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
767 $uname = $this->
object->userLookupFullName($user_id,
true);
770 if (((array_key_exists(
"pass",
$_GET)) && (strlen(
$_GET[
"pass"]) > 0)) || (!is_null(
$pass))) {
771 if (is_null(
$pass)) {
776 if (!is_null(
$pass)) {
777 require_once
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
780 $objectivesList = null;
783 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id,
$pass);
784 $testSequence->loadFromDb();
785 $testSequence->loadQuestions();
787 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
791 $objectivesList->loadObjectivesTitles();
793 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
794 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
795 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
796 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
797 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
800 $result_array = $this->
object->getTestResult(
807 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
808 $showAllAnswers =
true;
809 if ($this->object->isExecutable($testSession, $user_id)) {
810 $showAllAnswers =
false;
817 $_SESSION[
'tst_results_show_best_solutions'],
820 $show_reached_points,
823 $testResultHeaderLabelBuilder
825 $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
828 if ($show_pass_details) {
830 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
831 $template->setVariable(
"PASS_DETAILS", $overviewTableGUI->getHTML());
835 $template->setVariable(
"SIGNATURE", $signature);
837 if ($this->object->isShowExamIdInTestResultsEnabled()) {
838 $template->setCurrentBlock(
'exam_id_footer');
840 $testSession->getActiveId(),
843 $template->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
848 $template->setCurrentBlock(
'participant_back_anchor');
849 $template->setVariable(
"HREF_PARTICIPANT_BACK_ANCHOR",
"#tst_results_toolbar");
850 $template->setVariable(
"TXT_PARTICIPANT_BACK_ANCHOR", $this->lng->txt(
'tst_back_to_top'));
853 $template->setCurrentBlock(
'participant_block_id');
854 $template->setVariable(
"PARTICIPANT_BLOCK_ID",
"participant_active_{$active_id}");
859 $gradingMessageBuilder->buildList();
861 $template->setCurrentBlock(
'grading_message');
862 $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
868 $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
869 $template->setVariable(
"USER_DATA", $user_data);
886 $template =
new ilTemplate(
"tpl.il_as_tst_results_head_user_pass.html",
true,
true,
"Modules/Test");
887 include_once
'./Services/User/classes/class.ilObjUser.php';
888 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
893 $user->setLastname($this->lng->txt(
"deleted_user"));
896 if (strlen(
$user->getMatriculation()) && (($this->object->getAnonymity() ==
false))) {
897 $template->setCurrentBlock(
"user_matric");
898 $template->setVariable(
"TXT_USR_MATRIC", $this->lng->txt(
"matriculation"));
900 $template->setCurrentBlock(
"user_matric_value");
901 $template->setVariable(
"VALUE_USR_MATRIC",
$user->getMatriculation());
903 $template->touchBlock(
"user_matric_separator");
904 $title_matric =
" - " . $this->lng->txt(
"matriculation") .
": " .
$user->getMatriculation();
907 $invited_user = array_pop($this->object->getInvitedUsers($user_id));
908 if (strlen($invited_user[
"clientip"])) {
909 $template->setCurrentBlock(
"user_clientip");
910 $template->setVariable(
"TXT_CLIENT_IP", $this->lng->txt(
"client_ip"));
912 $template->setCurrentBlock(
"user_clientip_value");
913 $template->setVariable(
"VALUE_CLIENT_IP", $invited_user[
"clientip"]);
915 $template->touchBlock(
"user_clientip_separator");
916 $title_client =
" - " . $this->lng->txt(
"clientip") .
": " . $invited_user[
"clientip"];
919 $template->setVariable(
"TXT_USR_NAME", $this->lng->txt(
"name"));
920 $uname = $this->
object->userLookupFullName($user_id,
false);
921 $template->setVariable(
"VALUE_USR_NAME", $uname);
922 $template->setVariable(
"TXT_PASS", $this->lng->txt(
"scored_pass"));
940 $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
942 $this->
object->setAccessFilteredParticipantList(
943 $this->object->buildStatisticsAccessFilteredParticipantList()
946 $foundusers = $this->
object->getParticipantsForTestAndQuestion($test_id, $question_id);
948 foreach ($foundusers as $active_id => $passes) {
949 $resultpass = $this->
object->_getResultPass($active_id);
950 for (
$i = 0;
$i < count($passes);
$i++) {
951 if (($resultpass !== null) && ($resultpass == $passes[
$i][
"pass"])) {
953 $output .=
"<br /><br /><br />";
957 $question_gui = $this->
object->createQuestionGUI(
"", $passes[
$i][
"qid"]);
960 $output .= $question_gui->getSolutionOutput(
963 $graphicalOutput =
false,
964 $result_output =
false,
965 $show_question_only =
false,
966 $show_feedback =
false 972 require_once
'./Modules/Test/classes/class.ilTestPDFGenerator.php';
981 if (!isset($targetGUI->object) && method_exists($targetGUI,
'getTestObj')) {
982 $targetGUI->object = $targetGUI->getTestObj();
985 require_once
'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
997 if ($this->object->isShowGradingStatusEnabled()) {
1001 if ($this->object->isShowGradingMarkEnabled()) {
1005 if ($this->object->areObligationsEnabled()) {
1018 require_once
'Modules/Test/classes/class.ilTestGradingMessageBuilder.php';
1021 $gradingMessageBuilder->setActiveId($activeId);
1023 return $gradingMessageBuilder;
1028 require_once
'Modules/Test/classes/class.ilTestQuestionRelatedObjectivesList.php';
1033 return $questionRelatedObjectivesList;
1039 $ilDB = $DIC[
'ilDB'];
1040 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
1043 $table_gui->initFilter();
1045 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
1048 $questionList->setParentObjIdsFilter(array($this->object->getId()));
1051 foreach ($table_gui->getFilterItems() as $item) {
1052 if (substr($item->getPostVar(), 0, strlen(
'tax_')) ==
'tax_') {
1053 $v = $item->getValue();
1055 if (is_array($v) && count($v) && !(
int) $v[0]) {
1059 $taxId = substr($item->getPostVar(), strlen(
'tax_'));
1060 $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->
object->getId(),
'tst');
1061 } elseif ($item->getValue() !==
false) {
1062 $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
1066 $questionList->load();
1068 $filteredTestResult = array();
1070 $resultData = $this->
object->getTestResult($active_id,
$pass,
false, $considerHiddenQuestions, $considerOptionalQuestions);
1072 foreach ($resultData as $resultItemKey => $resultItemValue) {
1073 if ($resultItemKey ===
'test' || $resultItemKey ===
'pass') {
1077 if (!$questionList->isInList($resultItemValue[
'qid'])) {
1081 $filteredTestResult[] = $resultItemValue;
1084 return $filteredTestResult;
1093 require_once
'Modules/Test/classes/class.ilTestPDFGenerator.php';
1098 $this->object->getTitleFilenameCompliant(),
1102 $this->tpl->setContent($content);
1111 require_once
'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
1129 if (!$this->object->getShowSolutionDetails()) {
1131 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1134 $testSession = $this->testSessionFactory->getSession();
1135 $activeId = $testSession->getActiveId();
1137 if (!($activeId > 0)) {
1138 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
1141 $this->ctrl->saveParameter($this,
"pass");
1144 $questionId = (int)
$_GET[
'evaluation'];
1146 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId,
$pass);
1147 $testSequence->loadFromDb();
1148 $testSequence->loadQuestions();
1150 if (!$testSequence->questionExists($questionId)) {
1155 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId,
$pass);
1156 $testSequence->loadFromDb();
1157 $testSequence->loadQuestions();
1159 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
1162 $objectivesList->loadObjectivesTitles();
1164 $objectivesList = null;
1168 $ilTabs = $DIC[
'ilTabs'];
1171 $ilTabs->setBackTarget(
1172 $this->lng->txt(
"tst_back_to_virtual_pass"),
1173 $this->ctrl->getLinkTarget($this,
'showVirtualPass')
1176 $ilTabs->setBackTarget(
1177 $this->lng->txt(
"tst_back_to_pass_details"),
1178 $this->ctrl->getLinkTarget($this,
'outUserPassDetails')
1181 $ilTabs->clearSubTabs();
1183 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1184 $this->tpl->setCurrentBlock(
"ContentStyle");
1186 $this->tpl->parseCurrentBlock();
1188 $this->tpl->setCurrentBlock(
"SyntaxStyle");
1190 $this->tpl->parseCurrentBlock();
1193 if ($this->object->getShowSolutionAnswersOnly()) {
1199 $this->tpl->setContent($solution);
1212 $tpl->setVariable(
"PASS_FINISH_DATE_LABEL", $this->lng->txt(
'tst_pass_finished_on'));
1213 $tpl->setVariable(
"PASS_FINISH_DATE_VALUE", $passFinishDate);
1223 if ($this->object->isShowExamIdInTestResultsEnabled()) {
1224 $tpl->
setVariable(
"EXAM_ID_TXT", $this->lng->txt(
'exam_id'));
1236 $sort = (
$_GET[
"sort"]) ? (
$_GET[
"sort"]) :
"nr";
1237 $sortorder = (
$_GET[
"sortorder"]) ? (
$_GET[
"sortorder"]) :
"asc";
1238 if (strcmp($sortorder,
"asc")) {
1245 if ($a[$sort] == $b[$sort]) {
1248 return ($a[$sort] < $b[$sort]) ? $smaller : $greater;
static _lookupLogin($a_user_id)
lookup login
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
setContextResultPresentation($contextResultPresentation)
isContextResultPresentation()
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
getObjectiveOrientedContainer()
const PDF_USER_RESULT
PDF Purposes.
static setUseRelativeDates($a_status)
set use relative dates
getResultsSignature()
Returns HTML code for a signature field.
const QUESTION_INSTANCE_TYPE_DUPLICATES
static accessViolationRedirect()
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static getRequestRequestStatisticDataRegisterByActiveId($activeId)
static useRelativeDates()
check if relative dates are used
isGradingMessageRequired()
buildUserTestResultsToolbarGUI()
getCorrectSolutionOutput($question_id, $active_id, $pass, ilTestQuestionRelatedObjectivesList $objectivesList=null)
Returns an output of the solution to an answer compared to the correct solution.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
static getInstance(ilTestSession $a_test_session)
getResultsHeadUserAndPass($active_id, $pass)
Returns the user and pass data for a test results output.
setVariable($variable, $value='')
Sets a variable value.
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
buildPassOverviewTableGUI($targetGUI)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
populateContent($content)
getCommand($cmd)
Retrieves the ilCtrl command.
buildQuestionRelatedObjectiveList(ilTestQuestionSequence $a_test_sequence, ilTestQuestionRelatedObjectivesList $a_objectives_list)
special template class to simplify handling of ITX/PEAR
setParticipantData($participantData)
outCorrectSolution()
Creates an output of the solution of an answer compared to the correct solution.
static initDomEvent()
Init YUI DomEvent.
redirection script todo: (a better solution should control the processing via a xml file) ...
Class ilTestPassOverviewTableGUI.
static getSyntaxStylePath()
get syntax style path
static lookupLastTestPassAccess($activeId, $passIndex)
static getContentStylePath($a_style_id, $add_random=true)
get content style path
getResultsOfUserOutput($testSession, $active_id, $pass, $targetGUI, $show_pass_details=true, $show_answers=true, $show_question_only=false, $show_reached_points=false)
Output of the pass overview for a test called by a test participant.
$contextResultPresentation
$objectiveOrientedContainer
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
static _getManualScoring()
Retrieve the manual scoring settings.
getGradingMessageBuilder($activeId)
__construct(ilObjTest $a_object)
The constructor takes the test object reference as parameter.
populatePassFinishDate($tpl, $passFinishDate)
populateExamId(ilTemplate $tpl, int $activeId, int $pass)
executeCommand()
execute command
const RENDER_PURPOSE_PRINT_PDF
setObjectiveOrientedContainer(ilTestObjectiveOrientedContainer $objectiveOrientedContainer)
Service GUI class for tests.
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
if(empty($password)) $table
static _getReachedPoints($active_id, $question_id, $pass=null)
Returns the points, a learner has reached answering the question.
const PDF_OUTPUT_DOWNLOAD
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.
getPassListOfAnswersWithScoring(&$result_array, $active_id, $pass, $show_solutions=false)
Returns the list of answers of a users test pass and offers a scoring option.
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.
static lookupExamId($active_id, $pass)