ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilTestAnswerOptionalQuestionsConfirmationGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
28{
29 protected ?string $cancelCmd;
30
31 protected ?string $confirmCmd;
32
33 public function __construct(ilLanguage $lng)
34 {
35 $this->lng = $lng;
36
37 $this->cancelCmd = null;
38 $this->confirmCmd = null;
39
41 }
42
43 public function getCancelCmd(): ?string
44 {
45 return $this->cancelCmd;
46 }
47
48 public function setCancelCmd(string $cancelCmd): void
49 {
50 $this->cancelCmd = $cancelCmd;
51 }
52
53 public function getConfirmCmd(): ?string
54 {
55 return $this->confirmCmd;
56 }
57
58 public function setConfirmCmd(string $confirmCmd): void
59 {
60 $this->confirmCmd = $confirmCmd;
61 }
62
63 public function build(bool $isFixedTest): void
64 {
65 $this->setHeaderText($this->buildHeaderText($isFixedTest));
66 $this->setCancel($this->lng->txt('back'), $this->getCancelCmd());
67 $this->setConfirm($this->lng->txt('proceed'), $this->getConfirmCmd());
68 }
69
70 private function buildHeaderText(bool $isFixedTest): string
71 {
72 if ($isFixedTest) {
73 return $this->lng->txt('tst_optional_questions_confirmation_fixed_test');
74 }
75
76 return $this->lng->txt('tst_optional_questions_confirmation_non_fixed_test');
77 }
78}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCancel(string $a_txt, string $a_cmd, string $a_id='')
setHeaderText(string $a_headertext)
setConfirm(string $a_txt, string $a_cmd, string $a_id='')
language handling
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc