19 declare(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'),
103 $this->
lng->txt(
'tst_pass_overview_header_lo_qualifying_all_objectives'),
110 $this->
lng->txt(
'tst_pass_overview_header_lo_qualifying_per_objective'),
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'),
138 $this->
lng->txt(
'tst_pass_details_header_lo_qualifying'),
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'),
191 $this->test_type = self::LO_TEST_TYPE_INITIAL;
193 $this->test_type = self::LO_TEST_TYPE_QUALIFYING;
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);
215 return $this->test_type === self::LO_TEST_TYPE_INITIAL;
220 return $this->test_type === self::LO_TEST_TYPE_QUALIFYING;
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);
isQualifyingTestForAllObjectives()
isQualifyingTestPerObjective()
setAttemptLastAccessDate(string $formatted_date)
__construct(protected Language $lng, protected \ilObjectDataCache $obj_cache)
isInitialTestForAllObjectives()
const LO_TEST_TYPE_QUALIFYING
getPassDetailsHeaderLabel(int $attempt)
getVirtualListOfAnswersHeaderLabel()
string $attempt_last_access_date
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
int $objective_oriented_container_id
getPassOverviewHeaderLabel()
getAttemptLabel(int $attempt)
getListOfAnswersHeaderLabel(int $attempt)
setObjectiveOrientedContainerId(int $container_id)
initObjectiveOrientedMode()
isInitialTestPerObjective()
static getInstanceByObjId(int $a_obj_id)
setTestObjId(int $testObjId)
static getRun(int $a_container_id, int $a_user_id, int $a_test_id)
getVirtualPassDetailsHeaderLabel($objectiveTitle)
setTestRefId(int $testRefId)
getObjectiveTitle(\ilLOTestRun $loRun)
const LO_TEST_TYPE_INITIAL
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...