19 declare(strict_types=1);
30 protected bool $use_previous_answers_allowed =
false,
31 protected bool $suspend_test_allowed =
false,
32 protected bool $postponed_questions_move_to_end =
false,
33 protected int $usrpass_overview_mode = 0,
34 protected bool $question_marking_enabled =
false,
35 protected bool $question_list_enabled =
false 48 array $environment = null
50 $inputs[
'use_previous_answers'] = $f->checkbox(
51 $lng->
txt(
'tst_use_previous_answers'),
52 $lng->
txt(
'tst_use_previous_answers_description')
55 $inputs[
'allow_suspend_test'] = $f->checkbox(
56 $lng->
txt(
'tst_show_cancel'),
57 $lng->
txt(
'tst_show_cancel_description')
60 $inputs[
'postponed_questions_behaviour'] = $f->radio(
61 $lng->
txt(
'tst_postpone')
64 $lng->
txt(
'tst_postpone_off'),
65 $lng->
txt(
'tst_postpone_off_desc'),
68 $lng->
txt(
'tst_postpone_on'),
69 $lng->
txt(
'tst_postpone_on_desc'),
73 $inputs[
'enable_question_list'] = $f->checkbox(
74 $lng->
txt(
'tst_enable_questionlist'),
75 $lng->
txt(
'tst_enable_questionlist_description')
84 $inputs[
'enable_question_marking'] = $f->checkbox(
85 $lng->
txt(
'question_marking'),
86 $lng->
txt(
'question_marking_description')
89 return $f->section(
$inputs, $lng->
txt(
'tst_sequence_properties'));
97 $trafo = $refinery->custom()->transformation(
98 static function (?array $vs):
int {
103 $usrpass_overview_mode = 1;
105 if ($vs[
'show_at_beginning'] ===
true) {
106 $usrpass_overview_mode += 2;
109 if ($vs[
'show_at_end'] ===
true) {
110 $usrpass_overview_mode += 4;
113 if ($vs[
'show_description'] ===
true) {
114 $usrpass_overview_mode += 8;
117 return $usrpass_overview_mode;
121 $sub_inputs_usrpass_questionlist[
'show_at_beginning'] = $f->checkbox(
122 $lng->
txt(
'tst_list_of_questions_start')
124 $sub_inputs_usrpass_questionlist[
'show_at_end'] = $f->checkbox(
125 $lng->
txt(
'tst_list_of_questions_end')
127 $sub_inputs_usrpass_questionlist[
'show_description'] = $f->checkbox(
128 $lng->
txt(
'tst_list_of_questions_with_description')
131 $enable_usrpass_questionlist = $f->optionalGroup(
132 $sub_inputs_usrpass_questionlist,
133 $lng->
txt(
'tst_show_summary'),
134 $lng->
txt(
'tst_show_summary_description')
136 ->withAdditionalTransformation($trafo);
139 return $enable_usrpass_questionlist;
142 return $enable_usrpass_questionlist->withValue(
165 return $this->use_previous_answers_allowed;
169 $clone = clone $this;
170 $clone->use_previous_answers_allowed = $use_previous_answers_allowed;
176 return $this->suspend_test_allowed;
180 $clone = clone $this;
181 $clone->suspend_test_allowed = $suspend_test_allowed;
187 return $this->postponed_questions_move_to_end;
191 $clone = clone $this;
192 $clone->postponed_questions_move_to_end = $postponed_questions_move_to_end;
198 return $this->question_list_enabled;
202 $clone = clone $this;
203 $clone->question_list_enabled = $question_list_enabled;
209 return $this->usrpass_overview_mode;
213 if (($this->usrpass_overview_mode & 1) > 0) {
221 if (($this->usrpass_overview_mode & 2) > 0) {
229 if (($this->usrpass_overview_mode & 4) > 0) {
237 if (($this->usrpass_overview_mode & 8) > 0) {
245 $clone = clone $this;
246 $clone->usrpass_overview_mode = $usrpass_overview_mode;
252 return $this->question_marking_enabled;
256 $clone = clone $this;
257 $clone->question_marking_enabled = $question_marking_enabled;
withUsrPassOverviewMode(int $usrpass_overview_mode)
withSuspendTestAllowed(bool $suspend_test_allowed)
withQuestionListEnabled(bool $question_list_enabled)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getShownQuestionListAtBeginning()
getPostponedQuestionsMoveToEnd()
getUsePreviousAnswerAllowed()
getQuestionMarkingEnabled()
toForm(\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment=null)
withUsePreviousAnswerAllowed(bool $use_previous_answers_allowed)
getUsrPassOverviewEnabled()
__construct(int $test_id, protected bool $use_previous_answers_allowed=false, protected bool $suspend_test_allowed=false, protected bool $postponed_questions_move_to_end=false, protected int $usrpass_overview_mode=0, protected bool $question_marking_enabled=false, protected bool $question_list_enabled=false)
withQuestionMarkingEnabled(bool $question_marking_enabled)
getShowDescriptionInQuestionList()
getShownQuestionListAtEnd()
withPostponedQuestionsMoveToEnd(bool $postponed_questions_move_to_end)
Refinery Factory $refinery
getInputUsrPassOverview(\ilLanguage $lng, FieldFactory $f, Refinery $refinery)