ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilTestEvalObjectiveOrientedGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once './Modules/Test/classes/class.ilTestServiceGUI.php';
5
15{
16 public function executeCommand()
17 {
18 $this->ctrl->saveParameter($this, "active_id");
19
20 switch( $this->ctrl->getNextClass($this) )
21 {
22 default:
23 $this->handleTabs('results_objective_oriented');
24 $cmd = $this->ctrl->getCmd().'Cmd';
25 $this->$cmd();
26 }
27 }
28
30 {
31 $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'showVirtualPass');
32 $tableGUI->initFilter();
33 $tableGUI->resetOffset();
34 $tableGUI->writeFilterToSession();
35 $this->showVirtualPassCmd();
36 }
37
39 {
40 $tableGUI = $this->buildPassDetailsOverviewTableGUI($this, 'showVirtualPass');
41 $tableGUI->initFilter();
42 $tableGUI->resetOffset();
43 $tableGUI->resetFilter();
44 $this->showVirtualPassCmd();
45 }
46
47 private function showVirtualPassCmd()
48 {
49 $testSession = $this->testSessionFactory->getSession();
50
51 if( !$this->object->getShowPassDetails() )
52 {
53 $executable = $this->object->isExecutable($testSession, $testSession->getUserId());
54
55 if($executable["executable"])
56 {
57 $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
58 }
59 }
60
61 $this->tabs->setBackTarget(
62 $this->lng->txt('tst_results_back_introduction'),
63 $this->ctrl->getLinkTargetByClass('ilobjtestgui', 'participants')
64 );
65
66 $toolbar = $this->buildUserTestResultsToolbarGUI();
67 $this->ctrl->setParameter($this, 'pdf', '1');
68 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this, 'showVirtualPass') );
69 $this->ctrl->setParameter($this, 'pdf', '');
70 $toolbar->build();
71
72 $virtualSequence = $this->service->buildVirtualSequence($testSession);
73 $userResults = $this->service->getVirtualSequenceUserResults($virtualSequence);
74
75 require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
76 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($testSession);
77
78 $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $virtualSequence);
79 $objectivesList->loadObjectivesTitles();
80
81 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
82 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $this->objCache);
83
84 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($testSession->getObjectiveOrientedContainerId());
85 $testResultHeaderLabelBuilder->setUserId($testSession->getUserId());
86 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
87 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
88 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
89
90 $tpl = new ilTemplate('tpl.il_as_tst_virtual_pass_details.html', false, false, 'Modules/Test');
91
92 $command_solution_details = "";
93 if ($this->object->getShowSolutionDetails())
94 {
95 $command_solution_details = "outCorrectSolution";
96 }
97
98 $questionAnchorNav = $listOfAnswers = $this->object->canShowSolutionPrintview();
99
100 if( $listOfAnswers )
101 {
102 $list_of_answers = $this->getPassListOfAnswers(
103 $userResults, $testSession->getActiveId(), null, $this->object->getShowSolutionListComparison(),
104 false, false, false, true, $objectivesList, $testResultHeaderLabelBuilder
105 );
106 $tpl->setVariable("LIST_OF_ANSWERS", $list_of_answers);
107 }
108
109 foreach($objectivesList->getObjectives() as $loId => $loTitle)
110 {
111 $userResultsForLO = $objectivesList->filterResultsByObjective($userResults, $loId);
112
113 $overviewTableGUI = $this->getPassDetailsOverviewTableGUI(
114 $userResultsForLO, $testSession->getActiveId(), null, $this, "showVirtualPass",
115 $command_solution_details, $questionAnchorNav, $objectivesList
116 );
117 $overviewTableGUI->setTitle($testResultHeaderLabelBuilder->getVirtualPassDetailsHeaderLabel(
118 $objectivesList->getObjectiveTitleById($loId)
119 ));
120 $overviewTableGUI->setMultipleObjectivesInvolved(false);
121
122 require_once 'Modules/Test/classes/class.ilTestLearningObjectivesStatusGUI.php';
123 $loStatus = new ilTestLearningObjectivesStatusGUI($this->lng);
124 $loStatus->setCrsObjId($this->getObjectiveOrientedContainer()->getObjId());
125 $loStatus->setUsrId($testSession->getUserId());
126 $lostatus = $loStatus->getHTML($loId);
127
128 $tpl->setCurrentBlock('pass_details');
129 $tpl->setVariable("PASS_DETAILS", $overviewTableGUI->getHTML());
130 $tpl->setVariable("LO_STATUS", $lostatus);
131 $tpl->parseCurrentBlock();
132 }
133
134 $this->populateContent($this->ctrl->getHTML($toolbar).$tpl->get());
135 }
136}
static getInstance(ilTestSession $a_test_session)
special template class to simplify handling of ITX/PEAR
Service GUI class for tests.
getPassDetailsOverviewTableGUI($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null)
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.
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
buildPassDetailsOverviewTableGUI($targetGUI, $targetCMD)
$cmd
Definition: sahs_server.php:35