4include_once 
"./Modules/Test/classes/inc.AssessmentConstants.php";
 
    5include_once 
'Modules/Test/classes/class.ilTestService.php';
 
  116        $this->tabs = $ilTabs;
 
  117        $this->objCache = $ilObjDataCache;
 
  119        $this->
object =&$a_object;
 
  121        $this->ref_id = $a_object->ref_id;
 
  125        require_once 
'Modules/Test/classes/class.ilTestSessionFactory.php';
 
  128        require_once 
'Modules/Test/classes/class.ilTestSequenceFactory.php';
 
  131        $this->objectiveOrientedContainer = 
null;
 
  160            $considerHiddenQuestions = 
false;
 
  162            require_once 
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
 
  165            $considerHiddenQuestions = 
true;
 
  168        $scoredPass = $this->
object->_getResultPass($testSession->
getActiveId());
 
  170        require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
 
  175        foreach ($passes as 
$pass) {
 
  178            $considerOptionalQuestions = 
true;
 
  181                $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($testSession->
getActiveId(), 
$pass);
 
  183                $testSequence->loadFromDb();
 
  184                $testSequence->loadQuestions();
 
  186                if ($this->object->isRandomTest() && !$testSequence->isAnsweringOptionalQuestionsConfirmed()) {
 
  187                    $considerOptionalQuestions = 
false;
 
  190                $testSequence->setConsiderHiddenQuestionsEnabled($considerHiddenQuestions);
 
  191                $testSequence->setConsiderOptionalQuestionsEnabled($considerOptionalQuestions);
 
  194                $objectivesList->loadObjectivesTitles();
 
  196                $row[
'objectives'] = $objectivesList->getUniqueObjectivesStringForQuestions($testSequence->getUserSequenceQuestions());
 
  200                $result_array = $this->
object->getTestResult($testSession->
getActiveId(), 
$pass, 
false, $considerHiddenQuestions, $considerOptionalQuestions);
 
  202                foreach ($result_array as $resultStructKEY => $question) {
 
  203                    if ($resultStructKEY === 
'test' || $resultStructKEY === 
'pass') {
 
  207                    $requestData = $questionHintRequestRegister->getRequestByTestPassIndexAndQuestionId(
$pass, $question[
'qid']);
 
  210                        $result_array[
'pass'][
'total_requested_hints'] += $requestData->getRequestsCount();
 
  212                        $result_array[$resultStructKEY][
'requested_hints'] = $requestData->getRequestsCount();
 
  213                        $result_array[$resultStructKEY][
'hint_points'] = $requestData->getRequestsPoints();
 
  217                if (!$result_array[
'pass'][
'total_max_points']) {
 
  220                    $percentage = ($result_array[
'pass'][
'total_reached_points'] / $result_array[
'pass'][
'total_max_points']) * 100;
 
  222                $total_max = $result_array[
'pass'][
'total_max_points'];
 
  223                $total_reached = $result_array[
'pass'][
'total_reached_points'];
 
  224                $total_requested_hints = $result_array[
'pass'][
'total_requested_hints'];
 
  234                $row[
'num_workedthrough_questions'] = $result_array[
'pass'][
'num_workedthrough'];
 
  235                $row[
'num_questions_total'] = $result_array[
'pass'][
'num_questions_total'];
 
  237                if ($this->object->isOfferingQuestionHintsEnabled()) {
 
  238                    $row[
'hints'] = $total_requested_hints;
 
  241                $row[
'reached_points'] = $total_reached;
 
  242                $row[
'max_points'] = $total_max;
 
  243                $row[
'percentage'] = $percentage;
 
  273        $cmd = $this->ctrl->getCmd();
 
  274        $next_class = $this->ctrl->getNextClass($this);
 
  277        switch ($next_class) {
 
  279                $ret =&$this->$cmd();
 
  298            require_once 
'Services/Link/classes/class.ilLink.php';
 
  300            $this->tabs->setBack2Target($this->lng->txt(
'back_to_objective_container'), $courseLink);
 
  303                'results_pass_oriented',
 
  304                $this->lng->txt(
'tst_tab_results_pass_oriented'),
 
  305                $this->ctrl->getLinkTargetByClass(
'ilTestEvaluationGUI', 
'outUserResultsOverview')
 
  309                'results_objective_oriented',
 
  310                $this->lng->txt(
'tst_tab_results_objective_oriented'),
 
  311                $this->ctrl->getLinkTargetByClass(
'ilTestEvalObjectiveOrientedGUI', 
'showVirtualPass')
 
  314            $this->tabs->setTabActive($activeTabId);
 
  323        if (!isset(
$_GET[
'pdf'])) {
 
  327        if (!(
bool) 
$_GET[
'pdf']) {
 
  339        require_once 
'Modules/Test/classes/tables/class.ilTestPassOverviewTableGUI.php';
 
  343        $table->setPdfPresentationEnabled(
 
  347        $table->setObjectiveOrientedPresentationEnabled(
 
  366        $maintemplate = 
new ilTemplate(
"tpl.il_as_tst_list_of_answers.html", 
true, 
true, 
"Modules/Test");
 
  370        foreach ($result_array as $question_data) {
 
  371            if (($question_data[
"workedthrough"] == 1) || ($only_answered_questions == 
false)) {
 
  372                $template = 
new ilTemplate(
"tpl.il_as_qpl_question_printview.html", 
true, 
true, 
"Modules/TestQuestionPool");
 
  373                $question = $question_data[
"qid"];
 
  374                if (is_numeric($question)) {
 
  375                    $maintemplate->setCurrentBlock(
"printview_question");
 
  376                    $question_gui = $this->
object->createQuestionGUI(
"", $question);
 
  377                    if (is_object($question_gui)) {
 
  384                            $template->setVariable(
'BLOCK_ID', 
"detailed_answer_block_act_{$active_id}_qst_{$question}");
 
  387                            $template->setCurrentBlock(
'back_anchor');
 
  388                            $template->setVariable(
'HREF_BACK_ANCHOR', 
"#pass_details_tbl_row_act_{$active_id}_qst_{$question}");
 
  389                            $template->setVariable(
'TXT_BACK_ANCHOR', $this->lng->txt(
'tst_back_to_question_list'));
 
  393                        if ($show_reached_points) {
 
  394                            $template->setCurrentBlock(
"result_points");
 
  395                            $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());
 
  399                        $template->setVariable(
"TXT_QUESTION_ID", $this->lng->txt(
'question_id_short'));
 
  400                        $template->setVariable(
"QUESTION_ID", $question_gui->object->getId());
 
  401                        $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()));
 
  403                        if ($objectivesList !== 
null) {
 
  404                            $objectives = $this->lng->txt(
'tst_res_lo_objectives_header') . 
': ';
 
  405                            $objectives .= $objectivesList->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
 
  406                            $template->setVariable(
"OBJECTIVES", $objectives);
 
  409                        $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ? 
true : 
false;
 
  414                        if ($show_solutions) {
 
  415                            $compare_template = 
new ilTemplate(
'tpl.il_as_tst_answers_compare.html', 
true, 
true, 
'Modules/Test');
 
  416                            $compare_template->setVariable(
"HEADER_PARTICIPANT", $this->lng->txt(
'tst_header_participant'));
 
  417                            $compare_template->setVariable(
"HEADER_SOLUTION", $this->lng->txt(
'tst_header_solution'));
 
  418                            $result_output = $question_gui->getSolutionOutput($active_id, 
$pass, $show_solutions, 
false, $show_question_only, $showFeedback);
 
  419                            $best_output   = $question_gui->getSolutionOutput($active_id, 
$pass, 
false, 
false, $show_question_only, 
false, 
true);
 
  421                            $compare_template->setVariable(
'PARTICIPANT', $result_output);
 
  422                            $compare_template->setVariable(
'SOLUTION', $best_output);
 
  423                            $template->setVariable(
'SOLUTION_OUTPUT', $compare_template->get());
 
  425                            $result_output = $question_gui->getSolutionOutput($active_id, 
$pass, $show_solutions, 
false, $show_question_only, $showFeedback);
 
  426                            $template->setVariable(
'SOLUTION_OUTPUT', $result_output);
 
  429                        $maintemplate->setCurrentBlock(
"printview_question");
 
  430                        $maintemplate->setVariable(
"QUESTION_PRINTVIEW", 
$template->get());
 
  431                        $maintemplate->parseCurrentBlock();
 
  438        if ($testResultHeaderLabelBuilder !== 
null) {
 
  439            if (
$pass !== 
null) {
 
  440                $headerText = $testResultHeaderLabelBuilder->getListOfAnswersHeaderLabel(
$pass + 1);
 
  442                $headerText = $testResultHeaderLabelBuilder->getVirtualListOfAnswersHeaderLabel();
 
  448        $maintemplate->setVariable(
"RESULTS_OVERVIEW", $headerText);
 
  449        return $maintemplate->get();
 
  466        include_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
  468        $maintemplate = 
new ilTemplate(
"tpl.il_as_tst_list_of_answers.html", 
true, 
true, 
"Modules/Test");
 
  470        include_once 
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
 
  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");
 
  484                    $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()));
 
  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);
 
  505                    $feedback = $this->
object->getManualFeedback($active_id, $question, 
$pass);
 
  506                    $scoretemplate->setVariable(
"VALUE_FEEDBACK", 
ilUtil::prepareFormOutput($this->object->prepareTextareaOutput($feedback, 
true)));
 
  507                    $scoretemplate->setVariable(
"TEXT_MANUAL_FEEDBACK", $this->lng->txt(
"set_manual_feedback"));
 
  508                    $scoretemplate->parseCurrentBlock();
 
  510                    $scoretemplate->setVariable(
"NAME_INPUT", $question);
 
  511                    $this->ctrl->setParameter($this, 
"active_id", $active_id);
 
  512                    $this->ctrl->setParameter($this, 
"pass", 
$pass);
 
  513                    $scoretemplate->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this, 
"manscoring"));
 
  514                    $scoretemplate->setVariable(
"LABEL_INPUT", $this->lng->txt(
"tst_change_points_for_question"));
 
  516                    $scoretemplate->setVariable(
"VALUE_SAVE", $this->lng->txt(
"save"));
 
  518                    $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
 
  519                    $maintemplate->setCurrentBlock(
"printview_question");
 
  520                    $maintemplate->setVariable(
"QUESTION_PRINTVIEW", 
$template->get());
 
  521                    $maintemplate->setVariable(
"QUESTION_SCORING", $scoretemplate->get());
 
  522                    $maintemplate->parseCurrentBlock();
 
  529            $maintemplate->setVariable(
"NO_QUESTIONS_FOUND", $this->lng->txt(
"manscoring_questions_not_found"));
 
  531        $maintemplate->setVariable(
"RESULTS_OVERVIEW", 
sprintf($this->lng->txt(
"manscoring_results_pass"), 
$pass+1));
 
  533        include_once 
"./Services/YUI/classes/class.ilYuiUtil.php";
 
  536        return $maintemplate->get();
 
  541        $this->ctrl->setParameter($targetGUI, 
'active_id', $active_id);
 
  542        $this->ctrl->setParameter($targetGUI, 
'pass', 
$pass);
 
  547            $tableGUI->setAnswerListAnchorEnabled($questionAnchorNav);
 
  550        $tableGUI->setSingleAnswerScreenCmd($questionDetailsCMD);
 
  551        $tableGUI->setShowHintCount($this->object->isOfferingQuestionHintsEnabled());
 
  553        if ($objectivesList !== 
null) {
 
  554            $tableGUI->setQuestionRelatedObjectivesList($objectivesList);
 
  555            $tableGUI->setObjectiveOrientedPresentationEnabled(
true);
 
  558        $tableGUI->setMultipleObjectivesInvolved($multipleObjectivesInvolved);
 
  560        $tableGUI->setActiveId($active_id);
 
  561        $tableGUI->setShowSuggestedSolution(
false);
 
  563        $usersQuestionSolutions = array();
 
  565        foreach ($result_array as 
$key => $val) {
 
  566            if (
$key === 
'test' || 
$key === 
'pass') {
 
  570            if ($this->object->getShowSolutionSuggested() && strlen($val[
'solution'])) {
 
  571                $tableGUI->setShowSuggestedSolution(
true);
 
  574            if (isset($val[
'pass'])) {
 
  575                $tableGUI->setPassColumnEnabled(
true);
 
  578            $usersQuestionSolutions[
$key] = $val;
 
  581        $tableGUI->initColumns()->initFilter();
 
  583        $tableGUI->setFilterCommand($targetCMD . 
'SetTableFilter');
 
  584        $tableGUI->setResetCommand($targetCMD . 
'ResetTableFilter');
 
  586        $tableGUI->setData($usersQuestionSolutions);
 
  599        if ($this->object->getShowSolutionSignature() && !$this->object->getAnonymity()) {
 
  600            $template = 
new ilTemplate(
"tpl.il_as_tst_results_userdata_signature.html", 
true, 
true, 
"Modules/Test");
 
  601            $template->setVariable(
"TXT_DATE", $this->lng->txt(
"date"));
 
  606            $template->setVariable(
"TXT_SIGNATURE", $this->lng->txt(
"tst_signature"));
 
  625        if (!is_object($testSession)) {
 
  626            throw new TestException();
 
  628        $template = 
new ilTemplate(
"tpl.il_as_tst_results_userdata.html", 
true, 
true, 
"Modules/Test");
 
  629        include_once 
'./Services/User/classes/class.ilObjUser.php';
 
  630        $user_id = $this->
object->_getUserIdFromActiveId($active_id);
 
  635            $user->setLastname($this->lng->txt(
"deleted_user"));
 
  637        $t = $testSession->getSubmittedTimestamp();
 
  639            $t = $this->
object->_getLastAccess($testSession->getActiveId());
 
  643            $uname = $this->
object->userLookupFullName($user_id, $overwrite_anonymity);
 
  645            $template->setVariable(
'TXT_USR_NAME', $this->lng->txt(
"name"));
 
  646            $template->setVariable(
'VALUE_USR_NAME', $uname);
 
  651        if (strlen($user->getMatriculation()) && (($this->object->getAnonymity() == 
false) || ($overwrite_anonymity))) {
 
  652            $template->setCurrentBlock(
"matriculation");
 
  653            $template->setVariable(
"TXT_USR_MATRIC", $this->lng->txt(
"matriculation"));
 
  654            $template->setVariable(
"VALUE_USR_MATRIC", $user->getMatriculation());
 
  656            $title_matric = 
" - " . $this->lng->txt(
"matriculation") . 
": " . $user->getMatriculation();
 
  659        $invited_user = array_pop($this->object->getInvitedUsers($user_id));
 
  660        if (strlen($invited_user[
"clientip"])) {
 
  662            $template->setVariable(
"TXT_CLIENT_IP", $this->lng->txt(
"client_ip"));
 
  663            $template->setVariable(
"VALUE_CLIENT_IP", $invited_user[
"clientip"]);
 
  665            $title_client = 
" - " . $this->lng->txt(
"clientip") . 
": " . $invited_user[
"clientip"];
 
  668        $template->setVariable(
"TXT_TEST_TITLE", $this->lng->txt(
"title"));
 
  669        $template->setVariable(
"VALUE_TEST_TITLE", $this->object->getTitle());
 
  672        $pagetitle = $this->
object->getTitle() . $title_matric . $title_client;
 
  673        $this->tpl->setHeaderPageTitle($pagetitle);
 
  691        $test_id = $this->
object->getTestId();
 
  692        $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
 
  698        $template = 
new ilTemplate(
"tpl.il_as_tst_correct_solution_output.html", 
true, 
true, 
"Modules/Test");
 
  699        $show_question_only = ($this->
object->getShowSolutionAnswersOnly()) ? 
true : 
false;
 
  700        $result_output = $question_gui->getSolutionOutput($active_id, 
$pass, 
true, 
false, $show_question_only, $this->object->getShowSolutionFeedback(), 
false, 
false, 
true);
 
  701        $best_output = $question_gui->getSolutionOutput($active_id, 
$pass, 
false, 
false, $show_question_only, 
false, 
true, 
false, 
false);
 
  702        if ($this->object->getShowSolutionFeedback() && 
$_GET[
'cmd'] != 
'outCorrectSolution') {
 
  703            $specificAnswerFeedback = $question_gui->getSpecificFeedbackOutput($active_id, 
$pass);
 
  704            if (strlen($specificAnswerFeedback)) {
 
  705                $template->setCurrentBlock(
"outline_specific_feedback");
 
  706                $template->setVariable(
"OUTLINE_SPECIFIC_FEEDBACK", $specificAnswerFeedback);
 
  710        if ($this->object->isBestSolutionPrintedWithResult() && strlen($best_output)) {
 
  711            $template->setCurrentBlock(
"best_solution");
 
  712            $template->setVariable(
"TEXT_BEST_SOLUTION", $this->lng->txt(
"tst_best_solution_is"));
 
  713            $template->setVariable(
"BEST_OUTPUT", $best_output);
 
  716        $template->setVariable(
"TEXT_YOUR_SOLUTION", $this->lng->txt(
"tst_your_answer_was"));
 
  717        $maxpoints = $question_gui->object->getMaximumPoints();
 
  718        if ($maxpoints == 1) {
 
  719            $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()) . 
" (" . $maxpoints . 
" " . $this->lng->txt(
"point") . 
")");
 
  721            $template->setVariable(
"QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()) . 
" (" . $maxpoints . 
" " . $this->lng->txt(
"points") . 
")");
 
  723        if ($objectivesList !== 
null) {
 
  724            $objectives = $this->lng->txt(
'tst_res_lo_objectives_header') . 
': ';
 
  725            $objectives .= $objectivesList->getQuestionRelatedObjectiveTitles($question_gui->object->getId());
 
  726            $template->setVariable(
'OBJECTIVES', $objectives);
 
  728        $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
 
  729        $template->setVariable(
"RECEIVED_POINTS", 
sprintf($this->lng->txt(
"you_received_a_of_b_points"), $question_gui->object->getReachedPoints($active_id, 
$pass), $maxpoints));
 
  730        $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
  731        $template->setVariable(
"BACKLINK_TEXT", 
"<< " . $this->lng->txt(
"back"));
 
  747    public function getResultsOfUserOutput($testSession, $active_id, 
$pass, $targetGUI, $show_pass_details = 
true, $show_answers = 
true, $show_question_only = 
false, $show_reached_points = 
false)
 
  749        global $ilObjDataCache;
 
  751        include_once(
"./Services/UICore/classes/class.ilTemplate.php");
 
  752        $template = 
new ilTemplate(
"tpl.il_as_tst_results_participant.html", 
true, 
true, 
"Modules/Test");
 
  755            $user_id = $this->participantData->getUserIdByActiveId($active_id);
 
  756            $uname = $this->participantData->getConcatedFullnameByActiveId($active_id, 
false);
 
  758            $user_id = $this->
object->_getUserIdFromActiveId($active_id);
 
  759            $uname = $this->
object->userLookupFullName($user_id, 
true);
 
  762        if (((array_key_exists(
"pass", 
$_GET)) && (strlen(
$_GET[
"pass"]) > 0)) || (!is_null(
$pass))) {
 
  763            if (is_null(
$pass)) {
 
  768        if (!is_null(
$pass)) {
 
  769            require_once 
'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
 
  772            $objectivesList = 
null;
 
  775                $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($active_id, 
$pass);
 
  776                $testSequence->loadFromDb();
 
  777                $testSequence->loadQuestions();
 
  779                require_once 
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
 
  783                $objectivesList->loadObjectivesTitles();
 
  785                $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
 
  786                $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
 
  787                $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
 
  788                $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
 
  789                $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
 
  792            $result_array = $this->
object->getTestResult(
 
  799            $user_id = $this->
object->_getUserIdFromActiveId($active_id);
 
  800            $showAllAnswers = 
true;
 
  801            if ($this->object->isExecutable($testSession, $user_id)) {
 
  802                $showAllAnswers = 
false;
 
  809                    $_SESSION[
'tst_results_show_best_solutions'],
 
  812                    $show_reached_points,
 
  815                    $testResultHeaderLabelBuilder
 
  817                $template->setVariable(
"LIST_OF_ANSWERS", $list_of_answers);
 
  820            if ($show_pass_details) {
 
  822                $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getPassDetailsHeaderLabel(
$pass + 1));
 
  823                $template->setVariable(
"PASS_DETAILS", $overviewTableGUI->getHTML());
 
  827            $template->setVariable(
"SIGNATURE", $signature);
 
  829            if ($this->object->isShowExamIdInTestResultsEnabled()) {
 
  830                $template->setCurrentBlock(
'exam_id_footer');
 
  832                    $testSession->getActiveId(),
 
  835                $template->setVariable(
'EXAM_ID_TXT', $this->lng->txt(
'exam_id'));
 
  840        $template->setCurrentBlock(
'participant_back_anchor');
 
  841        $template->setVariable(
"HREF_PARTICIPANT_BACK_ANCHOR", 
"#tst_results_toolbar");
 
  842        $template->setVariable(
"TXT_PARTICIPANT_BACK_ANCHOR", $this->lng->txt(
'tst_back_to_top'));
 
  845        $template->setCurrentBlock(
'participant_block_id');
 
  846        $template->setVariable(
"PARTICIPANT_BLOCK_ID", 
"participant_active_{$active_id}");
 
  851            $gradingMessageBuilder->buildList();
 
  853            $template->setCurrentBlock(
'grading_message');
 
  854            $template->setVariable(
'GRADING_MESSAGE', $gradingMessageBuilder->getList());
 
  860        $template->setVariable(
"TEXT_HEADING", 
sprintf($this->lng->txt(
"tst_result_user_name"), $uname));
 
  861        $template->setVariable(
"USER_DATA", $user_data);
 
  877        $template = 
new ilTemplate(
"tpl.il_as_tst_results_head_user_pass.html", 
true, 
true, 
"Modules/Test");
 
  878        include_once 
'./Services/User/classes/class.ilObjUser.php';
 
  879        $user_id = $this->
object->_getUserIdFromActiveId($active_id);
 
  884            $user->setLastname($this->lng->txt(
"deleted_user"));
 
  887        if (strlen($user->getMatriculation()) && (($this->object->getAnonymity() == 
false))) {
 
  888            $template->setCurrentBlock(
"user_matric");
 
  889            $template->setVariable(
"TXT_USR_MATRIC", $this->lng->txt(
"matriculation"));
 
  891            $template->setCurrentBlock(
"user_matric_value");
 
  892            $template->setVariable(
"VALUE_USR_MATRIC", $user->getMatriculation());
 
  894            $template->touchBlock(
"user_matric_separator");
 
  895            $title_matric = 
" - " . $this->lng->txt(
"matriculation") . 
": " . $user->getMatriculation();
 
  898        $invited_user = array_pop($this->object->getInvitedUsers($user_id));
 
  899        if (strlen($invited_user[
"clientip"])) {
 
  900            $template->setCurrentBlock(
"user_clientip");
 
  901            $template->setVariable(
"TXT_CLIENT_IP", $this->lng->txt(
"client_ip"));
 
  903            $template->setCurrentBlock(
"user_clientip_value");
 
  904            $template->setVariable(
"VALUE_CLIENT_IP", $invited_user[
"clientip"]);
 
  906            $template->touchBlock(
"user_clientip_separator");
 
  907            $title_client = 
" - " . $this->lng->txt(
"clientip") . 
": " . $invited_user[
"clientip"];
 
  910        $template->setVariable(
"TXT_USR_NAME", $this->lng->txt(
"name"));
 
  911        $uname = $this->
object->userLookupFullName($user_id, 
false);
 
  912        $template->setVariable(
"VALUE_USR_NAME", $uname);
 
  913        $template->setVariable(
"TXT_PASS", $this->lng->txt(
"scored_pass"));
 
  928        require_once 
'Services/PDFGeneration/classes/class.ilPDFGeneration.php';
 
  932        $question_gui = $this->
object->createQuestionGUI(
"", $question_id);
 
  934        $foundusers = $this->
object->getParticipantsForTestAndQuestion($test_id, $question_id);
 
  936        foreach ($foundusers as $active_id => $passes) {
 
  937            $resultpass = $this->
object->_getResultPass($active_id);
 
  938            for (
$i = 0; 
$i < count($passes); 
$i++) {
 
  939                if (($resultpass !== 
null) && ($resultpass == $passes[
$i][
"pass"])) {
 
  941                        $output .= 
"<br /><br /><br />";
 
  945                    $question_gui = $this->
object->createQuestionGUI(
"", $passes[
$i][
"qid"]);
 
  948                    $output .= $question_gui->getSolutionOutput(
 
  951                        $graphicalOutput = 
false,
 
  952                        $result_output = 
false,
 
  953                        $show_question_only = 
false,
 
  954                        $show_feedback = 
false 
  960        require_once 
'./Modules/Test/classes/class.ilTestPDFGenerator.php';
 
  969        require_once 
'Modules/Test/classes/tables/class.ilTestPassDetailsOverviewTableGUI.php';
 
  981        if ($this->object->isShowGradingStatusEnabled()) {
 
  985        if ($this->object->isShowGradingMarkEnabled()) {
 
  989        if ($this->object->areObligationsEnabled()) {
 
 1002        require_once 
'Modules/Test/classes/class.ilTestGradingMessageBuilder.php';
 
 1005        $gradingMessageBuilder->setActiveId($activeId);
 
 1007        return $gradingMessageBuilder;
 
 1012        require_once 
'Modules/Test/classes/class.ilTestQuestionRelatedObjectivesList.php';
 
 1017        return $questionRelatedObjectivesList;
 
 1022        global 
$ilDB, $ilPluginAdmin;
 
 1025        $table_gui->initFilter();
 
 1027        require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
 
 1030        $questionList->setParentObjIdsFilter(array($this->object->getId()));
 
 1033        foreach ($table_gui->getFilterItems() as $item) {
 
 1034            if (substr($item->getPostVar(), 0, strlen(
'tax_')) == 
'tax_') {
 
 1035                $v = $item->getValue();
 
 1037                if (is_array($v) && count($v) && !(
int) $v[0]) {
 
 1041                $taxId = substr($item->getPostVar(), strlen(
'tax_'));
 
 1042                $questionList->addTaxonomyFilter($taxId, $item->getValue(), $this->object->getId(), 
'tst');
 
 1043            } elseif ($item->getValue() !== 
false) {
 
 1044                $questionList->addFieldFilter($item->getPostVar(), $item->getValue());
 
 1048        $questionList->load();
 
 1050        $filteredTestResult = array();
 
 1052        $resultData = $this->
object->getTestResult($active_id, 
$pass, 
false, $considerHiddenQuestions, $considerOptionalQuestions);
 
 1054        foreach ($resultData as $resultItemKey => $resultItemValue) {
 
 1055            if ($resultItemKey === 
'test' || $resultItemKey === 
'pass') {
 
 1059            if (!$questionList->isInList($resultItemValue[
'qid'])) {
 
 1063            $filteredTestResult[] = $resultItemValue;
 
 1066        return $filteredTestResult;
 
 1075            require_once 
'Modules/Test/classes/class.ilTestPDFGenerator.php';
 
 1080                $this->object->getTitleFilenameCompliant(),
 
 1084            $this->tpl->setContent($content);
 
 1093        require_once 
'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
 
 1096        $toolbar->setSkillResultButtonEnabled($this->object->isSkillServiceToBeConsidered());
 
 1113        if (!$this->object->getShowSolutionDetails()) {
 
 1115            $this->ctrl->redirectByClass(
"ilobjtestgui", 
"infoScreen");
 
 1118        $testSession = $this->testSessionFactory->getSession();
 
 1119        $activeId = $testSession->getActiveId();
 
 1121        if (!($activeId > 0)) {
 
 1122            $this->ctrl->redirectByClass(
"ilobjtestgui", 
"infoScreen");
 
 1125        $this->ctrl->saveParameter($this, 
"pass");
 
 1128        $questionId = (int) 
$_GET[
'evaluation'];
 
 1130        $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId, 
$pass);
 
 1131        $testSequence->loadFromDb();
 
 1132        $testSequence->loadQuestions();
 
 1134        if (!$testSequence->questionExists($questionId)) {
 
 1139            $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($activeId, 
$pass);
 
 1140            $testSequence->loadFromDb();
 
 1141            $testSequence->loadQuestions();
 
 1143            require_once 
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
 
 1146            $objectivesList->loadObjectivesTitles();
 
 1148            $objectivesList = 
null;
 
 1154            $ilTabs->setBackTarget(
 
 1155                $this->lng->txt(
"tst_back_to_virtual_pass"),
 
 1156                $this->ctrl->getLinkTarget($this, 
'showVirtualPass')
 
 1159            $ilTabs->setBackTarget(
 
 1160                $this->lng->txt(
"tst_back_to_pass_details"),
 
 1161                $this->ctrl->getLinkTarget($this, 
'outUserPassDetails')
 
 1165        include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
 1166        $this->tpl->setCurrentBlock(
"ContentStyle");
 
 1168        $this->tpl->parseCurrentBlock();
 
 1170        $this->tpl->setCurrentBlock(
"SyntaxStyle");
 
 1172        $this->tpl->parseCurrentBlock();
 
 1175        if ($this->object->getShowSolutionAnswersOnly()) {
 
 1181        $this->tpl->setContent($solution);
 
 1194        $tpl->setVariable(
"PASS_FINISH_DATE_LABEL", $this->lng->txt(
'tst_pass_finished_on'));
 
 1195        $tpl->setVariable(
"PASS_FINISH_DATE_VALUE", $passFinishDate);
 
 1202    $sort = (
$_GET[
"sort"]) ? (
$_GET[
"sort"]) : 
"nr";
 
 1203    $sortorder = (
$_GET[
"sortorder"]) ? (
$_GET[
"sortorder"]) : 
"asc";
 
 1204    if (strcmp($sortorder, 
"asc")) {
 
 1211    if ($a[$sort] == $b[$sort]) {
 
 1214    return ($a[$sort] < $b[$sort]) ? $smaller : $greater;
 
sprintf('%.4f', $callTime)
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)
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 _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static _getManualScoring()
Retrieve the manual scoring settings.
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
static accessViolationRedirect()
static lookupExamId($active_id, $pass)
static lookupLastTestPassAccess($activeId, $passIndex)
static _lookupLogin($a_user_id)
lookup login
static prepareGeneration()
Prepare the PDF generation This initializes the purpose for MathJax rendering It has to be called bef...
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)
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()
buildPassOverviewTableGUI($targetGUI, $targetCmd='')
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.
getQuestionResultForTestUsers($question_id, $test_id)
Creates a HTML representation for the results of a given question in a test.
buildUserTestResultsToolbarGUI()
setContextResultPresentation($contextResultPresentation)
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
getPassOverviewTableData(ilTestSession $testSession, $passes, $withResults)
isGradingMessageRequired()
getPassListOfAnswers(&$result_array, $active_id, $pass, $show_solutions=false, $only_answered_questions=false, $show_question_only=false, $show_reached_points=false, $anchorNav=false, ilTestQuestionRelatedObjectivesList $objectivesList=null, ilTestResultHeaderLabelBuilder $testResultHeaderLabelBuilder=null)
Returns the list of answers of a users test pass.
getAdditionalUsrDataHtmlAndPopulateWindowTitle($testSession, $active_id, $overwrite_anonymity=false)
Returns the user data for a test results output.
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
getResultsHeadUserAndPass($active_id, $pass)
Returns the user and pass data for a test results output.
$objectiveOrientedContainer
setParticipantData($participantData)
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()
Init YUI DomEvent.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\s+" &#(? foreach( $entity_files as $file) $output
const PDF_USER_RESULT
PDF Purposes.
redirection script todo: (a better solution should control the processing via a xml file)
if(empty($password)) $table