ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality Class Reference
+ Inheritance diagram for ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality:
+ Collaboration diagram for ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality:

Public Member Functions

 __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)
 
 toForm (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, ?array $environment=null)
 
 toStorage ()
 
 toLog (AdditionalInformationGenerator $additional_info)
 
 getUsePreviousAnswerAllowed ()
 
 withUsePreviousAnswerAllowed (bool $use_previous_answers_allowed)
 
 getSuspendTestAllowed ()
 
 withSuspendTestAllowed (bool $suspend_test_allowed)
 
 getPostponedQuestionsMoveToEnd ()
 
 withPostponedQuestionsMoveToEnd (bool $postponed_questions_move_to_end)
 
 getQuestionListEnabled ()
 
 withQuestionListEnabled (bool $question_list_enabled)
 
 getUsrPassOverviewMode ()
 
 withUsrPassOverviewMode (int $usrpass_overview_mode)
 
 getUsrPassOverviewEnabled ()
 
 getShownQuestionListAtBeginning ()
 
 getShownQuestionListAtEnd ()
 
 getShowDescriptionInQuestionList ()
 
 getQuestionMarkingEnabled ()
 
 withQuestionMarkingEnabled (bool $question_marking_enabled)
 
- Public Member Functions inherited from ILIAS\Test\Settings\TestSettings
 __construct (int $test_id)
 
 getTestId ()
 
 withTestId (int $test_id)
 
 toForm (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, ?array $environment=null)
 
 toStorage ()
 
 toLog (AdditionalInformationGenerator $additional_info)
 

Private Member Functions

 getInputUsrPassOverview (\ilLanguage $lng, FieldFactory $f, Refinery $refinery)
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\Test\Settings\TestSettings
int $test_id
 

Detailed Description

Definition at line 31 of file SettingsParticipantFunctionality.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::__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 
)

Definition at line 33 of file SettingsParticipantFunctionality.php.

41 {
43 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\Test\Settings\TestSettings\$test_id, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ getInputUsrPassOverview()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::getInputUsrPassOverview ( \ilLanguage  $lng,
FieldFactory  $f,
Refinery  $refinery 
)
private

Definition at line 89 of file SettingsParticipantFunctionality.php.

93 : OptionalGroup {
94 $trafo = $refinery->custom()->transformation(
95 static function (?array $vs): int {
96 if ($vs === null) {
97 return 0;
98 }
99
100 $usrpass_overview_mode = 1;
101
102 if ($vs['show_at_beginning'] === true) {
103 $usrpass_overview_mode += 2;
104 }
105
106 if ($vs['show_at_end'] === true) {
107 $usrpass_overview_mode += 4;
108 }
109
110 if ($vs['show_description'] === true) {
111 $usrpass_overview_mode += 8;
112 }
113
114 return $usrpass_overview_mode;
115 }
116 );
117
118 $sub_inputs_usrpass_questionlist['show_at_beginning'] = $f->checkbox($lng->txt('tst_list_of_questions_start'));
119 $sub_inputs_usrpass_questionlist['show_at_end'] = $f->checkbox($lng->txt('tst_list_of_questions_end'));
120 $sub_inputs_usrpass_questionlist['show_description'] = $f->checkbox($lng->txt('tst_list_of_questions_with_description'));
121
122 $enable_usrpass_questionlist = $f->optionalGroup(
123 $sub_inputs_usrpass_questionlist,
124 $lng->txt('tst_show_summary'),
125 $lng->txt('tst_show_summary_description')
126 )->withValue(null)
127 ->withAdditionalTransformation($trafo);
128
129 if ($this->getUsrPassOverviewEnabled() === false) {
130 return $enable_usrpass_questionlist;
131 }
132
133 return $enable_usrpass_questionlist->withValue(
134 [
135 'show_at_beginning' => $this->getShownQuestionListAtBeginning(),
136 'show_at_end' => $this->getShownQuestionListAtEnd(),
137 'show_description' => $this->getShowDescriptionInQuestionList()
138 ]
139 );
140 }
global $lng
Definition: privfeed.php:31

◆ getPostponedQuestionsMoveToEnd()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::getPostponedQuestionsMoveToEnd ( )

Definition at line 205 of file SettingsParticipantFunctionality.php.

205 : bool
206 {
207 return $this->postponed_questions_move_to_end;
208 }

◆ getQuestionListEnabled()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::getQuestionListEnabled ( )

Definition at line 216 of file SettingsParticipantFunctionality.php.

216 : bool
217 {
218 return $this->question_list_enabled;
219 }

◆ getQuestionMarkingEnabled()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::getQuestionMarkingEnabled ( )

Definition at line 257 of file SettingsParticipantFunctionality.php.

257 : bool
258 {
259 return $this->question_marking_enabled;
260 }

◆ getShowDescriptionInQuestionList()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::getShowDescriptionInQuestionList ( )

Definition at line 252 of file SettingsParticipantFunctionality.php.

252 : bool
253 {
254 return ($this->usrpass_overview_mode & 8) > 0;
255 }

◆ getShownQuestionListAtBeginning()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::getShownQuestionListAtBeginning ( )

Definition at line 243 of file SettingsParticipantFunctionality.php.

243 : bool
244 {
245 return ($this->usrpass_overview_mode & 2) > 0;
246 }

◆ getShownQuestionListAtEnd()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::getShownQuestionListAtEnd ( )

Definition at line 247 of file SettingsParticipantFunctionality.php.

247 : bool
248 {
249 return ($this->usrpass_overview_mode & 4) > 0;
250 }

◆ getSuspendTestAllowed()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::getSuspendTestAllowed ( )

Definition at line 194 of file SettingsParticipantFunctionality.php.

194 : bool
195 {
196 return $this->suspend_test_allowed;
197 }

◆ getUsePreviousAnswerAllowed()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::getUsePreviousAnswerAllowed ( )

Definition at line 183 of file SettingsParticipantFunctionality.php.

183 : bool
184 {
185 return $this->use_previous_answers_allowed;
186 }

◆ getUsrPassOverviewEnabled()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::getUsrPassOverviewEnabled ( )

Definition at line 239 of file SettingsParticipantFunctionality.php.

239 : bool
240 {
241 return ($this->usrpass_overview_mode & 1) > 0;
242 }

◆ getUsrPassOverviewMode()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::getUsrPassOverviewMode ( )

Definition at line 227 of file SettingsParticipantFunctionality.php.

227 : int
228 {
229 return $this->usrpass_overview_mode;
230 }

◆ toForm()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::toForm ( \ilLanguage  $lng,
FieldFactory  $f,
Refinery  $refinery,
?array  $environment = null 
)

Reimplemented from ILIAS\Test\Settings\TestSettings.

Definition at line 45 of file SettingsParticipantFunctionality.php.

50 : FormInput {
51 $inputs['use_previous_answers'] = $f->checkbox(
52 $lng->txt('tst_use_previous_answers'),
53 $lng->txt('tst_use_previous_answers_description')
54 )->withValue($this->getUsePreviousAnswerAllowed());
55
56 $inputs['allow_suspend_test'] = $f->checkbox(
57 $lng->txt('tst_show_cancel'),
58 $lng->txt('tst_show_cancel_description')
59 )->withValue($this->getSuspendTestAllowed());
60
61 $inputs['postponed_questions_behaviour'] = $f->radio(
62 $lng->txt('tst_postpone')
63 )->withOption(
64 '0',
65 $lng->txt('tst_postpone_off'),
66 $lng->txt('tst_postpone_off_desc')
67 )->withOption(
68 '1',
69 $lng->txt('tst_postpone_on'),
70 $lng->txt('tst_postpone_on_desc')
71 )->withValue($this->getPostponedQuestionsMoveToEnd() ? '1' : '0')
72 ->withAdditionalTransformation($refinery->kindlyTo()->bool());
73
74 $inputs['enable_question_list'] = $f->checkbox(
75 $lng->txt('tst_enable_questionlist'),
76 $lng->txt('tst_enable_questionlist_description')
77 )->withValue($this->getQuestionListEnabled());
78
79 $inputs['usr_pass_overview'] = $this->getInputUsrPassOverview($lng, $f, $refinery);
80
81 $inputs['enable_question_marking'] = $f->checkbox(
82 $lng->txt('question_marking'),
83 $lng->txt('question_marking_description')
84 )->withValue($this->getQuestionMarkingEnabled());
85
86 return $f->section($inputs, $lng->txt('tst_sequence_properties'));
87 }
getInputUsrPassOverview(\ilLanguage $lng, FieldFactory $f, Refinery $refinery)

◆ toLog()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::toLog ( AdditionalInformationGenerator  $additional_info)

Reimplemented from ILIAS\Test\Settings\TestSettings.

Definition at line 154 of file SettingsParticipantFunctionality.php.

154 : array
155 {
156 $log_array = [
163 ];
164
167 if ($this->getUsrPassOverviewEnabled()) {
174 }
175
180 return $log_array;
181 }

References ILIAS\Test\Logging\AdditionalInformationGenerator\getEnabledDisabledTagForBool().

+ Here is the call graph for this function:

◆ toStorage()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::toStorage ( )

Reimplemented from ILIAS\Test\Settings\TestSettings.

Definition at line 142 of file SettingsParticipantFunctionality.php.

142 : array
143 {
144 return [
145 'use_previous_answers' => ['integer', (int) $this->getUsePreviousAnswerAllowed()],
146 'suspend_test_allowed' => ['integer', (int) $this->getSuspendTestAllowed()],
147 'sequence_settings' => ['integer', (int) $this->getPostponedQuestionsMoveToEnd()],
148 'usr_pass_overview_mode' => ['integer', $this->getUsrPassOverviewMode()],
149 'show_marker' => ['integer', (int) $this->getQuestionMarkingEnabled()],
150 'show_questionlist' => ['integer', $this->getQuestionListEnabled()]
151 ];
152 }

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ withPostponedQuestionsMoveToEnd()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::withPostponedQuestionsMoveToEnd ( bool  $postponed_questions_move_to_end)

Definition at line 209 of file SettingsParticipantFunctionality.php.

209 : self
210 {
211 $clone = clone $this;
212 $clone->postponed_questions_move_to_end = $postponed_questions_move_to_end;
213 return $clone;
214 }

◆ withQuestionListEnabled()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::withQuestionListEnabled ( bool  $question_list_enabled)

Definition at line 220 of file SettingsParticipantFunctionality.php.

220 : self
221 {
222 $clone = clone $this;
223 $clone->question_list_enabled = $question_list_enabled;
224 return $clone;
225 }

◆ withQuestionMarkingEnabled()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::withQuestionMarkingEnabled ( bool  $question_marking_enabled)

Definition at line 262 of file SettingsParticipantFunctionality.php.

262 : self
263 {
264 $clone = clone $this;
265 $clone->question_marking_enabled = $question_marking_enabled;
266 return $clone;
267 }

◆ withSuspendTestAllowed()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::withSuspendTestAllowed ( bool  $suspend_test_allowed)

Definition at line 198 of file SettingsParticipantFunctionality.php.

198 : self
199 {
200 $clone = clone $this;
201 $clone->suspend_test_allowed = $suspend_test_allowed;
202 return $clone;
203 }

◆ withUsePreviousAnswerAllowed()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::withUsePreviousAnswerAllowed ( bool  $use_previous_answers_allowed)

Definition at line 187 of file SettingsParticipantFunctionality.php.

187 : self
188 {
189 $clone = clone $this;
190 $clone->use_previous_answers_allowed = $use_previous_answers_allowed;
191 return $clone;
192 }

Referenced by ILIAS\Test\Settings\MainSettings\SettingsMainGUI\getParticipantsFunctionalitySettingsForStorage().

+ Here is the caller graph for this function:

◆ withUsrPassOverviewMode()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::withUsrPassOverviewMode ( int  $usrpass_overview_mode)

Definition at line 232 of file SettingsParticipantFunctionality.php.

232 : self
233 {
234 $clone = clone $this;
235 $clone->usrpass_overview_mode = $usrpass_overview_mode;
236 return $clone;
237 }

The documentation for this class was generated from the following file: