19declare(strict_types=1);
57 $this->objective_oriented_container_id = $container_id;
62 $this->test_obj_id = $testObjId;
67 $this->test_ref_id = $testRefId;
72 $this->user_id = $userId;
77 $this->attempt_last_access_date = $formatted_date;
82 if (!$this->objective_oriented_container_id) {
83 return $this->
lng->txt(
'tst_results_overview');
88 $this->
lng->txt(
'tst_pass_overview_header_lo_initial_all_objectives'),
95 $this->
lng->txt(
'tst_pass_overview_header_lo_initial_per_objective'),
96 $this->getObjectivesString(),
103 $this->
lng->txt(
'tst_pass_overview_header_lo_qualifying_all_objectives'),
110 $this->
lng->txt(
'tst_pass_overview_header_lo_qualifying_per_objective'),
111 $this->getObjectivesString(),
121 if (!$this->objective_oriented_container_id) {
123 $this->
lng->txt(
'tst_pass_details_overview_table_title'),
130 $this->
lng->txt(
'tst_pass_details_header_lo_initial'),
131 $this->getObjectivesString(),
132 $this->getAttemptLabel($attempt)
138 $this->
lng->txt(
'tst_pass_details_header_lo_qualifying'),
139 $this->getObjectivesString(),
140 $this->getAttemptLabel($attempt)
149 $langVar =
'tst_eval_results_by_pass';
151 if ($this->objective_oriented_container_id) {
152 $langVar =
'tst_eval_results_by_pass_lo';
155 $title = sprintf($this->
lng->txt($langVar), $attempt);
157 if ($this->attempt_last_access_date ===
null) {
161 return "{$title} - {$this->attempt_last_access_date}";
166 return $this->
lng->txt(
'tst_eval_results_lo');
173 $this->
lng->txt(
'tst_virtual_pass_header_lo_initial'),
178 $this->
lng->txt(
'tst_virtual_pass_header_lo_qualifying'),
190 if ($loSettings->getInitialTest() == $this->test_ref_id) {
192 } elseif ($loSettings->getQualifiedTest() == $this->test_ref_id) {
199 $lo_attempts =
\ilLOTestRun::getRun($this->objective_oriented_container_id, $this->user_id, $this->test_obj_id);
201 $this->objectives = [];
203 foreach ($lo_attempts as $lo_attempt) {
204 $this->objectives[$lo_attempt->getObjectiveId()] = $this->
getObjectiveTitle($lo_attempt);
210 $this->crs_title = $this->obj_cache->lookupTitle($this->objective_oriented_container_id);
225 if ($this->test_type !== self::LO_TEST_TYPE_INITIAL) {
229 if (count($this->objectives) <= 1) {
238 if ($this->test_type !== self::LO_TEST_TYPE_INITIAL) {
242 if (count($this->objectives) > 1) {
251 if ($this->test_type !== self::LO_TEST_TYPE_QUALIFYING) {
255 if (count($this->objectives) <= 1) {
264 if ($this->test_type !== self::LO_TEST_TYPE_QUALIFYING) {
268 if (count($this->objectives) > 1) {
277 return \ilCourseObjective::lookupObjectiveTitle($loRun->
getObjectiveId());
282 return implode(
', ', $this->objectives);
287 return sprintf($this->
lng->txt(
'tst_res_lo_try_n'), $attempt);
initObjectiveOrientedMode()
isInitialTestPerObjective()
getObjectiveTitle(\ilLOTestRun $loRun)
const LO_TEST_TYPE_QUALIFYING
setTestObjId(int $testObjId)
isInitialTestForAllObjectives()
__construct(protected Language $lng, protected \ilObjectDataCache $obj_cache)
setObjectiveOrientedContainerId(int $container_id)
isQualifyingTestForAllObjectives()
getAttemptLabel(int $attempt)
setAttemptLastAccessDate(string $formatted_date)
getPassOverviewHeaderLabel()
int $objective_oriented_container_id
getVirtualListOfAnswersHeaderLabel()
getPassDetailsHeaderLabel(int $attempt)
getListOfAnswersHeaderLabel(int $attempt)
string $attempt_last_access_date
const LO_TEST_TYPE_INITIAL
isQualifyingTestPerObjective()
setTestRefId(int $testRefId)
getVirtualPassDetailsHeaderLabel($objectiveTitle)
static getInstanceByObjId(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getRun(int $a_container_id, int $a_user_id, int $a_test_id)