4include_once 
"./Modules/Test/classes/inc.AssessmentConstants.php";
 
    5include_once 
'Modules/Test/classes/class.ilTestService.php';
 
  120        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
  121        $ilTabs = 
$DIC[
'ilTabs'];
 
  122        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
  124        $lng->loadLanguageModule(
'cert');
 
  130        $this->tabs = $ilTabs;
 
  131        $this->objCache = $ilObjDataCache;
 
  133        $this->
object = &$a_object;
 
  134        $this->tree = &
$tree;
 
  135        $this->ref_id = $a_object->ref_id;
 
  139        require_once 
'Modules/Test/classes/class.ilTestSessionFactory.php';
 
  142        require_once 
'Modules/Test/classes/class.ilTestSequenceFactory.php';
 
  145        $this->objectiveOrientedContainer = 
null;
 
  174            $considerHiddenQuestions = 
false;
 
  176            require_once 
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
 
  179            $considerHiddenQuestions = 
true;
 
  182        $scoredPass = $this->
object->_getResultPass($testSession->
getActiveId());
 
  184        require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
 
  189        foreach ($passes as 
$pass) {
 
  192            $considerOptionalQuestions = 
true;
 
  195                $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($testSession->
getActiveId(), 
$pass);
 
  197                $testSequence->loadFromDb();
 
  198                $testSequence->loadQuestions();
 
  200                if ($this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed()) {
 
  201                    $considerOptionalQuestions = 
false;
 
  204                $testSequence->setConsiderHiddenQuestionsEnabled($considerHiddenQuestions);
 
  205                $testSequence->setConsiderOptionalQuestionsEnabled($considerOptionalQuestions);
 
  208                $objectivesList->loadObjectivesTitles();
 
  210                $row[
'objectives'] = $objectivesList->getUniqueObjectivesStringForQuestions($testSequence->getUserSequenceQuestions());
 
  214                $result_array = $this->
object->getTestResult($testSession->
getActiveId(), 
$pass, 
false, $considerHiddenQuestions, $considerOptionalQuestions);
 
  216                foreach ($result_array as $resultStructKEY => $question) {
 
  217                    if ($resultStructKEY === 
'test' || $resultStructKEY === 
'pass') {
 
  221                    $requestData = $questionHintRequestRegister->getRequestByTestPassIndexAndQuestionId(
$pass, $question[
'qid']);
 
  224                        $result_array[
'pass'][
'total_requested_hints'] += $requestData->getRequestsCount();
 
  226                        $result_array[$resultStructKEY][
'requested_hints'] = $requestData->getRequestsCount();
 
  227                        $result_array[$resultStructKEY][
'hint_points'] = $requestData->getRequestsPoints();
 
  231                if (!$result_array[
'pass'][
'total_max_points']) {
 
  234                    $percentage = ($result_array[
'pass'][
'total_reached_points'] / $result_array[
'pass'][
'total_max_points']) * 100;
 
  236                $total_max = $result_array[
'pass'][
'total_max_points'];
 
  237                $total_reached = $result_array[
'pass'][
'total_reached_points'];
 
  238                $total_requested_hints = $result_array[
'pass'][
'total_requested_hints'];
 
  242                $row[
'scored'] = (
$pass == $scoredPass);
 
  245            $row[
'pass'] = 
$pass;
 
  248                $row[
'num_workedthrough_questions'] = $result_array[
'pass'][
'num_workedthrough'];
 
  249                $row[
'num_questions_total'] = $result_array[
'pass'][
'num_questions_total'];
 
  251                if ($this->object->isOfferingQuestionHintsEnabled()) {
 
  252                    $row[
'hints'] = $total_requested_hints;
 
  255                $row[
'reached_points'] = $total_reached;
 
  256                $row[
'max_points'] = $total_max;
 
  257                $row[
'percentage'] = $percentage;
 
  287        $cmd = $this->ctrl->getCmd();
 
  288        $next_class = $this->ctrl->getNextClass($this);
 
  291        switch ($next_class) {
 
  293                $ret = &$this->$cmd();
 
  314        if (!isset(
$_GET[
'pdf'])) {
 
  318        if (!(
bool) 
$_GET[
'pdf']) {
 
  330        require_once 
'Modules/Test/classes/tables/class.ilTestPassOverviewTableGUI.php';
 
  334        $table->setPdfPresentationEnabled(
 
  338        $table->setObjectiveOrientedPresentationEnabled(
 
  357        $maintemplate = 
new ilTemplate(
"tpl.il_as_tst_list_of_answers.html", 
true, 
true, 
"Modules/Test");
 
  361        foreach ($result_array as $question_data) {
 
  362            if (($question_data[
"workedthrough"] == 1) || ($only_answered_questions == 
false)) {
 
  363                $template = 
new ilTemplate(
"tpl.il_as_qpl_question_printview.html", 
true, 
true, 
"Modules/TestQuestionPool");
 
  364                $question_id = $question_data[
"qid"];
 
  365                if (is_numeric($question_id)) {
 
  366                    $maintemplate->setCurrentBlock(
"printview_question");
 
  367                    $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
 
  369                    if (is_object($question_gui)) {
 
  375                            $template->setCurrentBlock(
'block_id');
 
  376                            $template->setVariable(
'BLOCK_ID', 
"detailed_answer_block_act_{$active_id}_qst_{$question_id}");
 
  377                            $template->parseCurrentBlock();
 
  379                            $template->setCurrentBlock(
'back_anchor');
 
  380                            $template->setVariable(
'HREF_BACK_ANCHOR', 
"#pass_details_tbl_row_act_{$active_id}_qst_{$question_id}");
 
  381                            $template->setVariable(
'TXT_BACK_ANCHOR', $this->lng->txt(
'tst_back_to_question_list'));
 
  382                            $template->parseCurrentBlock();
 
  385                        if ($show_reached_points) {
 
  386                            $template->setCurrentBlock(
"result_points");
 
  387                            $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());
 
  388                            $template->parseCurrentBlock();
 
  390                        $template->setVariable(
"COUNTER_QUESTION", $counter . 
". ");
 
  391                        $template->setVariable(
"TXT_QUESTION_ID", $this->lng->txt(
'question_id_short'));
 
  392                        $template->setVariable(
"QUESTION_ID", $question_gui->object->getId());
 
  393                        $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()));
 
  395                        if ($objectivesList !== 
null) {
 
  396                            $objectives = $this->lng->txt(
'tst_res_lo_objectives_header') . 
': ';
 
  397                            $objectives .= $objectivesList->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
 
  398                            $template->setVariable(
"OBJECTIVES", $objectives);
 
  401                        $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ? 
true : 
false;
 
  406                        if ($show_solutions) {
 
  407                            $compare_template = 
new ilTemplate(
'tpl.il_as_tst_answers_compare.html', 
true, 
true, 
'Modules/Test');
 
  408                            $compare_template->setVariable(
"HEADER_PARTICIPANT", $this->lng->txt(
'tst_header_participant'));
 
  409                            $compare_template->setVariable(
"HEADER_SOLUTION", $this->lng->txt(
'tst_header_solution'));
 
  410                            $result_output = $question_gui->getSolutionOutput($active_id, 
$pass, $show_solutions, 
false, $show_question_only, $showFeedback);
 
  411                            $best_output = $question_gui->getSolutionOutput($active_id, 
$pass, 
false, 
false, $show_question_only, 
false, 
true);
 
  413                            $compare_template->setVariable(
'PARTICIPANT', $result_output);
 
  414                            $compare_template->setVariable(
'SOLUTION', $best_output);
 
  415                            if ($question_gui->supportsIntermediateSolutionOutput() && $question_gui->hasIntermediateSolution($active_id, 
$pass)) {
 
  416                                $question_gui->setUseIntermediateSolution(
true);
 
  417                                $intermediate_output = $question_gui->getSolutionOutput($active_id, 
$pass, $show_solutions, 
false, 
true, $showFeedback);
 
  418                                $question_gui->setUseIntermediateSolution(
false);
 
  419                                $compare_template->setVariable(
'TXT_INTERMEDIATE', $this->lng->txt(
'autosavecontent'));
 
  420                                $compare_template->setVariable(
'INTERMEDIATE', $intermediate_output);
 
  422                            $template->setVariable(
'SOLUTION_OUTPUT', $compare_template->get());
 
  424                            $result_output = $question_gui->getSolutionOutput($active_id, 
$pass, $show_solutions, 
false, $show_question_only, $showFeedback);
 
  425                            if ($question_gui->supportsIntermediateSolutionOutput() && $question_gui->hasIntermediateSolution($active_id, 
$pass)) {
 
  426                                $question_gui->setUseIntermediateSolution(
true);
 
  427                                $intermediate_output = $question_gui->getSolutionOutput($active_id, 
$pass, $show_solutions, 
false, 
true, $showFeedback);
 
  428                                $question_gui->setUseIntermediateSolution(
false);
 
  429                                $template->setVariable(
'TXT_INTERMEDIATE', $this->lng->txt(
'autosavecontent'));
 
  430                                $template->setVariable(
'INTERMEDIATE', $intermediate_output);
 
  432                            $template->setVariable(
'SOLUTION_OUTPUT', $result_output);
 
  435                        $maintemplate->setCurrentBlock(
"printview_question");
 
  436                        $maintemplate->setVariable(
"QUESTION_PRINTVIEW", $template->get());
 
  437                        $maintemplate->parseCurrentBlock();
 
  444        if ($testResultHeaderLabelBuilder !== 
null) {
 
  445            if (
$pass !== 
null) {
 
  446                $headerText = $testResultHeaderLabelBuilder->getListOfAnswersHeaderLabel(
$pass + 1);
 
  448                $headerText = $testResultHeaderLabelBuilder->getVirtualListOfAnswersHeaderLabel();
 
  454        $maintemplate->setVariable(
"RESULTS_OVERVIEW", $headerText);
 
  455        return $maintemplate->get();
 
  463        $shuffler->setSeed($fixed_seed);
 
  474        $fixed_seed = $basic_seed;
 
  476        if (strlen($fixed_seed) < self::FIXED_SHUFFLER_SEED_MIN_LENGTH) {
 
  478                10 * (self::FIXED_SHUFFLER_SEED_MIN_LENGTH - strlen($fixed_seed))
 
  499        include_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
  501        $maintemplate = 
new ilTemplate(
"tpl.il_as_tst_list_of_answers.html", 
true, 
true, 
"Modules/Test");
 
  503        include_once 
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
 
  508        foreach ($result_array as $question_data) {
 
  509            $question = $question_data[
"qid"];
 
  510            if (is_numeric($question)) {
 
  511                $question_gui = $this->
object->createQuestionGUI(
"", $question);
 
  512                if (in_array($question_gui->object->getQuestionTypeID(), $scoring)) {
 
  513                    $template = 
new ilTemplate(
"tpl.il_as_qpl_question_printview.html", 
true, 
true, 
"Modules/TestQuestionPool");
 
  514                    $scoretemplate = 
new ilTemplate(
"tpl.il_as_tst_manual_scoring_points.html", 
true, 
true, 
"Modules/Test");
 
  515                    #mbecker: No such block. $this->tpl->setCurrentBlock("printview_question");
 
  516                    $template->setVariable(
"COUNTER_QUESTION", $counter . 
". ");
 
  517                    $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()));
 
  518                    $points = $question_gui->object->getMaximumPoints();
 
  520                        $template->setVariable(
"QUESTION_POINTS", $points . 
" " . $this->lng->txt(
"point"));
 
  522                        $template->setVariable(
"QUESTION_POINTS", $points . 
" " . $this->lng->txt(
"points"));
 
  525                    $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ? 
true : 
false;
 
  526                    $result_output = $question_gui->getSolutionOutput($active_id, 
$pass, $show_solutions, 
false, $show_question_only, $this->object->getShowSolutionFeedback(), 
false, 
true);
 
  528                    $solout = $question_gui->object->getSuggestedSolutionOutput();
 
  529                    if (strlen($solout)) {
 
  530                        $scoretemplate->setCurrentBlock(
"suggested_solution");
 
  531                        $scoretemplate->setVariable(
"TEXT_SUGGESTED_SOLUTION", $this->lng->txt(
"solution_hint"));
 
  532                        $scoretemplate->setVariable(
"VALUE_SUGGESTED_SOLUTION", $solout);
 
  533                        $scoretemplate->parseCurrentBlock();
 
  536                    $scoretemplate->setCurrentBlock(
"feedback");
 
  537                    $scoretemplate->setVariable(
"FEEDBACK_NAME_INPUT", $question);
 
  538                    $feedback = $this->
object->getSingleManualFeedback($active_id, $question, 
$pass)[
'feedback'];
 
  539                    $scoretemplate->setVariable(
"VALUE_FEEDBACK", 
ilUtil::prepareFormOutput($this->object->prepareTextareaOutput($feedback, 
true)));
 
  540                    $scoretemplate->setVariable(
"TEXT_MANUAL_FEEDBACK", $this->lng->txt(
"set_manual_feedback"));
 
  541                    $scoretemplate->parseCurrentBlock();
 
  543                    $scoretemplate->setVariable(
"NAME_INPUT", $question);
 
  544                    $this->ctrl->setParameter($this, 
"active_id", $active_id);
 
  545                    $this->ctrl->setParameter($this, 
"pass", 
$pass);
 
  546                    $scoretemplate->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this, 
"manscoring"));
 
  547                    $scoretemplate->setVariable(
"LABEL_INPUT", $this->lng->txt(
"tst_change_points_for_question"));
 
  549                    $scoretemplate->setVariable(
"VALUE_SAVE", $this->lng->txt(
"save"));
 
  551                    $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
 
  552                    $maintemplate->setCurrentBlock(
"printview_question");
 
  553                    $maintemplate->setVariable(
"QUESTION_PRINTVIEW", $template->get());
 
  554                    $maintemplate->setVariable(
"QUESTION_SCORING", $scoretemplate->get());
 
  555                    $maintemplate->parseCurrentBlock();
 
  562            $maintemplate->setVariable(
"NO_QUESTIONS_FOUND", $this->lng->txt(
"manscoring_questions_not_found"));
 
  564        $maintemplate->setVariable(
"RESULTS_OVERVIEW", sprintf($this->lng->txt(
"manscoring_results_pass"), 
$pass + 1));
 
  566        include_once 
"./Services/YUI/classes/class.ilYuiUtil.php";
 
  569        return $maintemplate->get();
 
  574        $this->ctrl->setParameter($targetGUI, 
'active_id', $active_id);
 
  575        $this->ctrl->setParameter($targetGUI, 
'pass', 
$pass);
 
  580            $tableGUI->setAnswerListAnchorEnabled($questionAnchorNav);
 
  583        $tableGUI->setSingleAnswerScreenCmd($questionDetailsCMD);
 
  584        $tableGUI->setShowHintCount($this->object->isOfferingQuestionHintsEnabled());
 
  586        if ($objectivesList !== 
null) {
 
  587            $tableGUI->setQuestionRelatedObjectivesList($objectivesList);
 
  588            $tableGUI->setObjectiveOrientedPresentationEnabled(
true);
 
  591        $tableGUI->setMultipleObjectivesInvolved($multipleObjectivesInvolved);
 
  593        $tableGUI->setActiveId($active_id);
 
  594        $tableGUI->setShowSuggestedSolution(
false);
 
  596        $usersQuestionSolutions = array();
 
  598        foreach ($result_array as $key => $val) {
 
  599            if ($key === 
'test' || $key === 
'pass') {
 
  603            if ($this->object->getShowSolutionSuggested() && strlen($val[
'solution'])) {
 
  604                $tableGUI->setShowSuggestedSolution(
true);
 
  607            if (isset($val[
'pass'])) {
 
  608                $tableGUI->setPassColumnEnabled(
true);
 
  611            $usersQuestionSolutions[$key] = $val;
 
  614        $tableGUI->initColumns()->initFilter();
 
  616        $tableGUI->setFilterCommand($targetCMD . 
'SetTableFilter');
 
  617        $tableGUI->setResetCommand($targetCMD . 
'ResetTableFilter');
 
  619        $tableGUI->setData($usersQuestionSolutions);
 
  632        if ($this->object->getShowSolutionSignature() && !$this->object->getAnonymity()) {
 
  633            $template = 
new ilTemplate(
"tpl.il_as_tst_results_userdata_signature.html", 
true, 
true, 
"Modules/Test");
 
  634            $template->setVariable(
"TXT_DATE", $this->lng->txt(
"date"));
 
  639            $template->setVariable(
"TXT_SIGNATURE", $this->lng->txt(
"tst_signature"));
 
  641            return $template->get();
 
  658        if (!is_object($testSession)) {
 
  659            throw new TestException();
 
  661        $template = 
new ilTemplate(
"tpl.il_as_tst_results_userdata.html", 
true, 
true, 
"Modules/Test");
 
  662        include_once 
'./Services/User/classes/class.ilObjUser.php';
 
  663        $user_id = $this->
object->_getUserIdFromActiveId($active_id);
 
  668            $user->setLastname($this->lng->txt(
"deleted_user"));
 
  670        $t = $testSession->getSubmittedTimestamp();
 
  672            $t = $this->
object->_getLastAccess($testSession->getActiveId());
 
  676            $uname = $this->
object->userLookupFullName($user_id, $overwrite_anonymity);
 
  677            $template->setCurrentBlock(
"name");
 
  678            $template->setVariable(
'TXT_USR_NAME', $this->lng->txt(
"name"));
 
  679            $template->setVariable(
'VALUE_USR_NAME', $uname);
 
  680            $template->parseCurrentBlock();
 
  684        if (strlen($user->getMatriculation()) && (($this->object->getAnonymity() == 
false) || ($overwrite_anonymity))) {
 
  685            $template->setCurrentBlock(
"matriculation");
 
  686            $template->setVariable(
"TXT_USR_MATRIC", $this->lng->txt(
"matriculation"));
 
  687            $template->setVariable(
"VALUE_USR_MATRIC", $user->getMatriculation());
 
  688            $template->parseCurrentBlock();
 
  689            $title_matric = 
" - " . $this->lng->txt(
"matriculation") . 
": " . $user->getMatriculation();
 
  692        $invited_user = array_pop($this->object->getInvitedUsers($user_id));
 
  693        if (strlen($invited_user[
"clientip"])) {
 
  694            $template->setCurrentBlock(
"client_ip");
 
  695            $template->setVariable(
"TXT_CLIENT_IP", $this->lng->txt(
"client_ip"));
 
  696            $template->setVariable(
"VALUE_CLIENT_IP", $invited_user[
"clientip"]);
 
  697            $template->parseCurrentBlock();
 
  698            $title_client = 
" - " . $this->lng->txt(
"clientip") . 
": " . $invited_user[
"clientip"];
 
  701        $template->setVariable(
"TXT_TEST_TITLE", $this->lng->txt(
"title"));
 
  702        $template->setVariable(
"VALUE_TEST_TITLE", $this->object->getTitle());
 
  705        $pagetitle = $this->
object->getTitle() . $title_matric . $title_client;
 
  706        $this->tpl->setHeaderPageTitle($pagetitle);
 
  708        return $template->get();
 
  725        $test_id = $this->
object->getTestId();
 
  726        $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
 
  732        $template = 
new ilTemplate(
"tpl.il_as_tst_correct_solution_output.html", 
true, 
true, 
"Modules/Test");
 
  733        $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ? 
true : 
false;
 
  734        $result_output = $question_gui->getSolutionOutput($active_id, 
$pass, 
true, 
false, $show_question_only, $this->object->getShowSolutionFeedback(), 
false, 
false, 
true);
 
  735        $best_output = $question_gui->getSolutionOutput($active_id, 
$pass, 
false, 
false, $show_question_only, 
false, 
true, 
false, 
false);
 
  736        if ($this->object->getShowSolutionFeedback() && 
$_GET[
'cmd'] != 
'outCorrectSolution') {
 
  737            $specificAnswerFeedback = $question_gui->getSpecificFeedbackOutput(
 
  738                $question_gui->object->fetchIndexedValuesFromValuePairs(
 
  739                    $question_gui->object->getSolutionValues($active_id, 
$pass)
 
  742            if (strlen($specificAnswerFeedback)) {
 
  743                $template->setCurrentBlock(
"outline_specific_feedback");
 
  744                $template->setVariable(
"OUTLINE_SPECIFIC_FEEDBACK", $specificAnswerFeedback);
 
  745                $template->parseCurrentBlock();
 
  748        if ($this->object->isBestSolutionPrintedWithResult() && strlen($best_output)) {
 
  749            $template->setCurrentBlock(
"best_solution");
 
  750            $template->setVariable(
"TEXT_BEST_SOLUTION", $this->lng->txt(
"tst_best_solution_is"));
 
  751            $template->setVariable(
"BEST_OUTPUT", $best_output);
 
  752            $template->parseCurrentBlock();
 
  754        $template->setVariable(
"TEXT_YOUR_SOLUTION", $this->lng->txt(
"tst_your_answer_was"));
 
  755        $template->setVariable(
"TEXT_SOLUTION_OUTPUT", $this->lng->txt(
"tst_your_answer_was")); 
 
  757        $maxpoints = $question_gui->object->getMaximumPoints();
 
  758        if ($maxpoints == 1) {
 
  759            $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()) . 
" (" . $maxpoints . 
" " . $this->lng->txt(
"point") . 
")");
 
  761            $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()) . 
" (" . $maxpoints . 
" " . $this->lng->txt(
"points") . 
")");
 
  763        if ($objectivesList !== 
null) {
 
  764            $objectives = $this->lng->txt(
'tst_res_lo_objectives_header') . 
': ';
 
  765            $objectives .= $objectivesList->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
 
  766            $template->setVariable(
'OBJECTIVES', $objectives);
 
  768        $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
 
  769        $template->setVariable(
"RECEIVED_POINTS", sprintf($this->lng->txt(
"you_received_a_of_b_points"), $question_gui->object->getReachedPoints($active_id, 
$pass), $maxpoints));
 
  770        $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
  771        $template->setVariable(
"BACKLINK_TEXT", 
"<< " . $this->lng->txt(
"back"));
 
  772        return $template->get();
 
  787    public function getResultsOfUserOutput($testSession, $active_id, 
$pass, $targetGUI, $show_pass_details = 
true, $show_answers = 
true, $show_question_only = 
false, $show_reached_points = 
false)
 
  790        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
  792        include_once(
"./Services/UICore/classes/class.ilTemplate.php");
 
  793        $template = 
new ilTemplate(
"tpl.il_as_tst_results_participant.html", 
true, 
true, 
"Modules/Test");
 
  796            $user_id = $this->participantData->getUserIdByActiveId($active_id);
 
  797            $uname = $this->participantData->getConcatedFullnameByActiveId($active_id, 
false);
 
  799            $user_id = $this->
object->_getUserIdFromActiveId($active_id);
 
  800            $uname = $this->
object->userLookupFullName($user_id, 
true);
 
  803        if (((array_key_exists(
"pass", 
$_GET)) && (strlen(
$_GET[
"pass"]) > 0)) || (!is_null(
$pass))) {
 
  804            if (is_null(
$pass)) {
 
  809        if (!is_null(
$pass)) {
 
  810            require_once 
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
 
  813            $objectivesList = 
null;
 
  816                $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, 
$pass);
 
  817                $testSequence->loadFromDb();
 
  818                $testSequence->loadQuestions();
 
  820                require_once 
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
 
  824                $objectivesList->loadObjectivesTitles();
 
  826                $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
 
  827                $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
 
  828                $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
 
  829                $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
 
  830                $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
 
  833            $result_array = $this->
object->getTestResult(
 
  840            $user_id = $this->
object->_getUserIdFromActiveId($active_id);
 
  841            $showAllAnswers = 
true;
 
  842            if ($this->object->isExecutable($testSession, $user_id)) {
 
  843                $showAllAnswers = 
false;
 
  850                    $_SESSION[
'tst_results_show_best_solutions'],
 
  853                    $show_reached_points,
 
  856                    $testResultHeaderLabelBuilder
 
  858                $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
 
  861            if ($show_pass_details) {
 
  863                $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
 
  864                $template->setVariable(
"PASS_DETAILS", $overviewTableGUI->getHTML());
 
  868            $template->setVariable(
"SIGNATURE", $signature);
 
  870            if ($this->object->isShowExamIdInTestResultsEnabled()) {
 
  871                $template->setCurrentBlock(
'exam_id_footer');
 
  873                    $testSession->getActiveId(),
 
  876                $template->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
 
  877                $template->parseCurrentBlock();
 
  881        $template->setCurrentBlock(
'participant_back_anchor');
 
  882        $template->setVariable(
"HREF_PARTICIPANT_BACK_ANCHOR", 
"#tst_results_toolbar");
 
  883        $template->setVariable(
"TXT_PARTICIPANT_BACK_ANCHOR", $this->lng->txt(
'tst_back_to_top'));
 
  884        $template->parseCurrentBlock();
 
  886        $template->setCurrentBlock(
'participant_block_id');
 
  887        $template->setVariable(
"PARTICIPANT_BLOCK_ID", 
"participant_active_{$active_id}");
 
  888        $template->parseCurrentBlock();
 
  892            $gradingMessageBuilder->buildList();
 
  894            $template->setCurrentBlock(
'grading_message');
 
  895            $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
 
  896            $template->parseCurrentBlock();
 
  901        $template->setVariable(
"TEXT_HEADING", sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
 
  902        $template->setVariable(
"USER_DATA", $user_data);
 
  907        return $template->get();
 
  919        $template = 
new ilTemplate(
"tpl.il_as_tst_results_head_user_pass.html", 
true, 
true, 
"Modules/Test");
 
  920        include_once 
'./Services/User/classes/class.ilObjUser.php';
 
  921        $user_id = $this->
object->_getUserIdFromActiveId($active_id);
 
  926            $user->setLastname($this->lng->txt(
"deleted_user"));
 
  929        if (strlen($user->getMatriculation()) && (($this->object->getAnonymity() == 
false))) {
 
  930            $template->setCurrentBlock(
"user_matric");
 
  931            $template->setVariable(
"TXT_USR_MATRIC", $this->lng->txt(
"matriculation"));
 
  932            $template->parseCurrentBlock();
 
  933            $template->setCurrentBlock(
"user_matric_value");
 
  934            $template->setVariable(
"VALUE_USR_MATRIC", $user->getMatriculation());
 
  935            $template->parseCurrentBlock();
 
  936            $template->touchBlock(
"user_matric_separator");
 
  937            $title_matric = 
" - " . $this->lng->txt(
"matriculation") . 
": " . $user->getMatriculation();
 
  940        $invited_user = array_pop($this->object->getInvitedUsers($user_id));
 
  941        if (strlen($invited_user[
"clientip"])) {
 
  942            $template->setCurrentBlock(
"user_clientip");
 
  943            $template->setVariable(
"TXT_CLIENT_IP", $this->lng->txt(
"client_ip"));
 
  944            $template->parseCurrentBlock();
 
  945            $template->setCurrentBlock(
"user_clientip_value");
 
  946            $template->setVariable(
"VALUE_CLIENT_IP", $invited_user[
"clientip"]);
 
  947            $template->parseCurrentBlock();
 
  948            $template->touchBlock(
"user_clientip_separator");
 
  949            $title_client = 
" - " . $this->lng->txt(
"clientip") . 
": " . $invited_user[
"clientip"];
 
  952        $template->setVariable(
"TXT_USR_NAME", $this->lng->txt(
"name"));
 
  953        $uname = $this->
object->userLookupFullName($user_id, 
false);
 
  954        $template->setVariable(
"VALUE_USR_NAME", $uname);
 
  955        $template->setVariable(
"TXT_PASS", $this->lng->txt(
"scored_pass"));
 
  956        $template->setVariable(
"VALUE_PASS", 
$pass);
 
  957        return $template->get();
 
  973        $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
 
  975        $this->
object->setAccessFilteredParticipantList(
 
  976            $this->object->buildStatisticsAccessFilteredParticipantList()
 
  979        $foundusers = $this->
object->getParticipantsForTestAndQuestion($test_id, $question_id);
 
  981        foreach ($foundusers as $active_id => $passes) {
 
  982            $resultpass = $this->
object->_getResultPass($active_id);
 
  983            for (
$i = 0; 
$i < count($passes); 
$i++) {
 
  984                if (($resultpass !== 
null) && ($resultpass == $passes[
$i][
"pass"])) {
 
  986                        $output .= 
"<br /><br /><br />";
 
  990                    $question_gui = $this->
object->createQuestionGUI(
"", $passes[
$i][
"qid"]);
 
  993                    $output .= $question_gui->getSolutionOutput(
 
  996                        $graphicalOutput = 
false,
 
  997                        $result_output = 
false,
 
  998                        $show_question_only = 
false,
 
  999                        $show_feedback = 
false 
 1005        require_once 
'./Modules/Test/classes/class.ilTestPDFGenerator.php';
 
 1014        if (!isset($targetGUI->object) && method_exists($targetGUI, 
'getTestObj')) {
 
 1015            $targetGUI->object = $targetGUI->getTestObj();
 
 1018        require_once 
'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
 
 1030        if ($this->object->isShowGradingStatusEnabled()) {
 
 1034        if ($this->object->isShowGradingMarkEnabled()) {
 
 1038        if ($this->object->areObligationsEnabled()) {
 
 1051        require_once 
'Modules/Test/classes/class.ilTestGradingMessageBuilder.php';
 
 1054        $gradingMessageBuilder->setActiveId($activeId);
 
 1056        return $gradingMessageBuilder;
 
 1061        require_once 
'Modules/Test/classes/class.ilTestQuestionRelatedObjectivesList.php';
 
 1066        return $questionRelatedObjectivesList;
 
 1073        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
 1076        $table_gui->initFilter();
 
 1078        require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
 
 1081        $questionList->setParentObjIdsFilter(array($this->object->getId()));
 
 1084        foreach ($table_gui->getFilterItems() as $item) {
 
 1085            if (substr($item->getPostVar(), 0, strlen(
'tax_')) == 
'tax_') {
 
 1086                $v = $item->getValue();
 
 1088                if (is_array($v) && count($v) && !(
int) $v[0]) {
 
 1092                $taxId = substr($item->getPostVar(), strlen(
'tax_'));
 
 1093                $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->object->getId(), 
'tst');
 
 1094            } elseif ($item->getValue() !== 
false) {
 
 1095                $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
 
 1099        $questionList->load();
 
 1101        $filteredTestResult = array();
 
 1103        $resultData = $this->
object->getTestResult($active_id, 
$pass, 
false, $considerHiddenQuestions, $considerOptionalQuestions);
 
 1105        foreach ($resultData as $resultItemKey => $resultItemValue) {
 
 1106            if ($resultItemKey === 
'test' || $resultItemKey === 
'pass') {
 
 1110            if (!$questionList->isInList($resultItemValue[
'qid'])) {
 
 1114            $filteredTestResult[] = $resultItemValue;
 
 1117        return $filteredTestResult;
 
 1129                $this->object->getTitleFilenameCompliant(),
 
 1133            $this->tpl->setContent($content);
 
 1142        require_once 
'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
 
 1160        if (!$this->object->getShowSolutionDetails()) {
 
 1162            $this->ctrl->redirectByClass(
"ilobjtestgui", 
"infoScreen");
 
 1165        $testSession = $this->testSessionFactory->getSession();
 
 1166        $activeId = $testSession->getActiveId();
 
 1168        if (!($activeId > 0)) {
 
 1169            $this->ctrl->redirectByClass(
"ilobjtestgui", 
"infoScreen");
 
 1172        $this->ctrl->saveParameter($this, 
"pass");
 
 1175        $questionId = (int) 
$_GET[
'evaluation'];
 
 1177        $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId, 
$pass);
 
 1178        $testSequence->loadFromDb();
 
 1179        $testSequence->loadQuestions();
 
 1181        if (!$testSequence->questionExists($questionId)) {
 
 1186            $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId, 
$pass);
 
 1187            $testSequence->loadFromDb();
 
 1188            $testSequence->loadQuestions();
 
 1190            require_once 
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
 
 1193            $objectivesList->loadObjectivesTitles();
 
 1195            $objectivesList = 
null;
 
 1199        $ilTabs = 
$DIC[
'ilTabs'];
 
 1202            $ilTabs->setBackTarget(
 
 1203                $this->lng->txt(
"tst_back_to_virtual_pass"),
 
 1204                $this->ctrl->getLinkTarget($this, 
'showVirtualPass')
 
 1207            $ilTabs->setBackTarget(
 
 1208                $this->lng->txt(
"tst_back_to_pass_details"),
 
 1209                $this->ctrl->getLinkTarget($this, 
'outUserPassDetails')
 
 1212        $ilTabs->clearSubTabs();
 
 1214        include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
 1215        $this->tpl->setCurrentBlock(
"ContentStyle");
 
 1217        $this->tpl->parseCurrentBlock();
 
 1219        $this->tpl->setCurrentBlock(
"SyntaxStyle");
 
 1221        $this->tpl->parseCurrentBlock();
 
 1224        if ($this->object->getShowSolutionAnswersOnly()) {
 
 1230        $this->tpl->setContent($solution);
 
 1243        $tpl->setVariable(
"PASS_FINISH_DATE_LABEL", $this->lng->txt(
'tst_pass_finished_on'));
 
 1244        $tpl->setVariable(
"PASS_FINISH_DATE_VALUE", $passFinishDate);
 
 1254        if ($this->object->isShowExamIdInTestResultsEnabled()) {
 
 1255            $tpl->setVariable(
"EXAM_ID_TXT", $this->lng->txt(
'exam_id'));
 
 1267    $sort = (
$_GET[
"sort"]) ? (
$_GET[
"sort"]) : 
"nr";
 
 1268    $sortorder = (
$_GET[
"sortorder"]) ? (
$_GET[
"sortorder"]) : 
"asc";
 
 1269    if (strcmp($sortorder, 
"asc")) {
 
 1276    if (
$a[$sort] == 
$b[$sort]) {
 
 1279    return (
$a[$sort] < 
$b[$sort]) ? $smaller : $greater;
 
An exception for terminatinating execution or to throw for unit testing.
const RENDER_PURPOSE_PRINT_PDF
static _getReachedPoints($active_id, $question_id, $pass=null)
Returns the points, a learner has reached answering the question.
static getRequestRequestStatisticDataRegisterByActiveId($activeId)
const QUESTION_INSTANCE_TYPE_DUPLICATES
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
static useRelativeDates()
check if relative dates are used
@classDescription Date and time handling
buildQuestionRelatedObjectiveList(ilTestQuestionSequence $a_test_sequence, ilTestQuestionRelatedObjectivesList $a_objectives_list)
static getInstance(ilTestSession $a_test_session)
static _getManualScoring()
Retrieve the manual scoring settings.
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static accessViolationRedirect()
static lookupExamId($active_id, $pass)
static lookupLastTestPassAccess($activeId, $passIndex)
static _lookupLogin($a_user_id)
lookup login
static prepareGenerationRequest($service, $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
special template class to simplify handling of ITX/PEAR
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
const PDF_OUTPUT_DOWNLOAD
Class ilTestPassOverviewTableGUI.
Service GUI class for tests.
getGradingMessageBuilder($activeId)
getFilteredTestResult($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
outCorrectSolution()
Creates an output of the solution of an answer compared to the correct solution.
getCorrectSolutionOutput($question_id, $active_id, $pass, ilTestQuestionRelatedObjectivesList $objectivesList=null)
Returns an output of the solution to an answer compared to the correct solution.
populateContent($content)
populateExamId(ilTemplate $tpl, int $activeId, int $pass)
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.
getObjectiveOrientedContainer()
setObjectiveOrientedContainer(ilTestObjectiveOrientedContainer $objectiveOrientedContainer)
executeCommand()
execute command
isContextResultPresentation()
populatePassFinishDate($tpl, $passFinishDate)
$contextResultPresentation
__construct(ilObjTest $a_object)
The constructor takes the test object reference as parameter.
getResultsSignature()
Returns HTML code for a signature field.
getCommand($cmd)
Retrieves the ilCtrl command.
buildPassOverviewTableGUI($targetGUI)
const FIXED_SHUFFLER_SEED_MIN_LENGTH
getQuestionResultForTestUsers($question_id, $test_id)
Creates a HTML representation for the results of a given question in a test.
buildUserTestResultsToolbarGUI()
buildFixedShufflerSeedFromBasicSeed(string $basic_seed)
setContextResultPresentation($contextResultPresentation)
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
isGradingMessageRequired()
getPassListOfAnswers(&$result_array, $active_id, $pass, $show_solutions=false, $only_answered_questions=false, $show_question_only=false, $show_reached_points=false, $anchorNav=false, ilTestQuestionRelatedObjectivesList $objectivesList=null, ilTestResultHeaderLabelBuilder $testResultHeaderLabelBuilder=null)
Returns the list of answers of a users test pass.
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
getResultsHeadUserAndPass($active_id, $pass)
Returns the user and pass data for a test results output.
$objectiveOrientedContainer
setParticipantData($participantData)
buildQuestionAnswerShuffler(string $question_id, string $active_id, string $active_pass)
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
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 getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
static initDomEvent(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI DomEvent.
const PDF_USER_RESULT
PDF Purposes.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
redirection script todo: (a better solution should control the processing via a xml file)