ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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 (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)
 
 toExport ()
 Transform the object into a simple, associative array. More...
 
- Public Member Functions inherited from ILIAS\Test\Settings\TestSettings
 __construct ()
 
 toForm (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, ?array $environment=null)
 
 toStorage ()
 
 toLog (AdditionalInformationGenerator $additional_info)
 
 toExport ()
 Transform the object into a simple, associative array. More...
 

Static Public Member Functions

static fromExport (array $data)
 Creates an instance of the object from an array. More...
 
static fromExport (array $data)
 Creates an instance of the object from an array. More...
 

Private Member Functions

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

Detailed Description

Definition at line 31 of file SettingsParticipantFunctionality.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::__construct ( 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.

40 {
42 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ fromExport()

static ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality::fromExport ( array  $data)
static

Creates an instance of the object from an array.

This static factory method is responsible for constructing a new object instance from the provided array data. It should validate the input and may throw an exception if the data is incomplete or malformed.

Parameters
ExportableArray$dataThe data to restore the object from
Returns
static A new instance of the class

Implements ILIAS\Test\ExportImport\Exportable.

Definition at line 280 of file SettingsParticipantFunctionality.php.

280 : static
281 {
282 return new self(
283 (bool) $data['use_previous_answers'],
284 (bool) $data['suspend_test_allowed'],
285 (bool) $data['postponed_questions_move_to_end'],
286 (int) $data['usr_pass_overview_mode'],
287 (bool) $data['question_marking_enabled'],
288 (bool) $data['show_questionlist']
289 );
290 }

References $data.

Referenced by ILIAS\Test\Settings\MainSettings\MainSettings\fromExport().

+ Here is the caller graph for this function:

◆ getInputUsrPassOverview()

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

Definition at line 88 of file SettingsParticipantFunctionality.php.

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

◆ getPostponedQuestionsMoveToEnd()

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

Definition at line 204 of file SettingsParticipantFunctionality.php.

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

◆ getQuestionListEnabled()

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

Definition at line 215 of file SettingsParticipantFunctionality.php.

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

◆ getQuestionMarkingEnabled()

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

Definition at line 256 of file SettingsParticipantFunctionality.php.

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

◆ getShowDescriptionInQuestionList()

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

Definition at line 251 of file SettingsParticipantFunctionality.php.

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

◆ getShownQuestionListAtBeginning()

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

Definition at line 242 of file SettingsParticipantFunctionality.php.

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

◆ getShownQuestionListAtEnd()

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

Definition at line 246 of file SettingsParticipantFunctionality.php.

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

◆ getSuspendTestAllowed()

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

Definition at line 193 of file SettingsParticipantFunctionality.php.

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

◆ getUsePreviousAnswerAllowed()

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

Definition at line 182 of file SettingsParticipantFunctionality.php.

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

◆ getUsrPassOverviewEnabled()

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

Definition at line 238 of file SettingsParticipantFunctionality.php.

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

◆ getUsrPassOverviewMode()

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

Definition at line 226 of file SettingsParticipantFunctionality.php.

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

◆ toExport()

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

Transform the object into a simple, associative array.

The resulting array represents the object's state and should contain only scalar values, arrays, or other Exportable objects.

Returns
ExportableArray The exportable array representation of the object

Implements ILIAS\Test\ExportImport\Exportable.

Definition at line 268 of file SettingsParticipantFunctionality.php.

◆ 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 44 of file SettingsParticipantFunctionality.php.

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

153 : array
154 {
155 $log_array = [
162 ];
163
166 if ($this->getUsrPassOverviewEnabled()) {
173 }
174
179 return $log_array;
180 }

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 141 of file SettingsParticipantFunctionality.php.

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

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 208 of file SettingsParticipantFunctionality.php.

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

◆ withQuestionListEnabled()

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

Definition at line 219 of file SettingsParticipantFunctionality.php.

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

◆ withQuestionMarkingEnabled()

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

Definition at line 261 of file SettingsParticipantFunctionality.php.

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

◆ withSuspendTestAllowed()

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

Definition at line 197 of file SettingsParticipantFunctionality.php.

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

◆ withUsePreviousAnswerAllowed()

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

Definition at line 186 of file SettingsParticipantFunctionality.php.

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

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 231 of file SettingsParticipantFunctionality.php.

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

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