ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

References ILIAS\GlobalScreen\Provider\__construct().

41  {
43  }
__construct(Container $dic, ilPlugin $plugin)
+ 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.

References ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getShowDescriptionInQuestionList(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getShownQuestionListAtBeginning(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getShownQuestionListAtEnd(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getUsrPassOverviewEnabled(), null, ilLanguage\txt(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\toForm().

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPostponedQuestionsMoveToEnd()

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

Definition at line 205 of file SettingsParticipantFunctionality.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\toForm(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\toLog(), and ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\toStorage().

205  : bool
206  {
207  return $this->postponed_questions_move_to_end;
208  }
+ Here is the caller graph for this function:

◆ getQuestionListEnabled()

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

◆ getQuestionMarkingEnabled()

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

◆ getShowDescriptionInQuestionList()

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

Definition at line 252 of file SettingsParticipantFunctionality.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getInputUsrPassOverview(), and ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\toLog().

252  : bool
253  {
254  return ($this->usrpass_overview_mode & 8) > 0;
255  }
+ Here is the caller graph for this function:

◆ getShownQuestionListAtBeginning()

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

Definition at line 243 of file SettingsParticipantFunctionality.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getInputUsrPassOverview(), and ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\toLog().

243  : bool
244  {
245  return ($this->usrpass_overview_mode & 2) > 0;
246  }
+ Here is the caller graph for this function:

◆ getShownQuestionListAtEnd()

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

Definition at line 247 of file SettingsParticipantFunctionality.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getInputUsrPassOverview(), and ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\toLog().

247  : bool
248  {
249  return ($this->usrpass_overview_mode & 4) > 0;
250  }
+ Here is the caller graph for this function:

◆ getSuspendTestAllowed()

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

◆ getUsePreviousAnswerAllowed()

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

Definition at line 183 of file SettingsParticipantFunctionality.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\toForm(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\toLog(), and ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\toStorage().

183  : bool
184  {
185  return $this->use_previous_answers_allowed;
186  }
+ Here is the caller graph for this function:

◆ getUsrPassOverviewEnabled()

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

Definition at line 239 of file SettingsParticipantFunctionality.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getInputUsrPassOverview(), and ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\toLog().

239  : bool
240  {
241  return ($this->usrpass_overview_mode & 1) > 0;
242  }
+ Here is the caller graph for this function:

◆ getUsrPassOverviewMode()

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

Definition at line 227 of file SettingsParticipantFunctionality.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\toStorage().

227  : int
228  {
229  return $this->usrpass_overview_mode;
230  }
+ Here is the caller graph for this function:

◆ toForm()

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

Definition at line 45 of file SettingsParticipantFunctionality.php.

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getInputUsrPassOverview(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getPostponedQuestionsMoveToEnd(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getQuestionListEnabled(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getQuestionMarkingEnabled(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getSuspendTestAllowed(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getUsePreviousAnswerAllowed(), ilLanguage\txt(), ILIAS\UI\Implementation\Component\Input\ViewControl\withAdditionalTransformation(), and ILIAS\UI\Implementation\Component\Input\withValue().

50  : FormInput {
51  $inputs['use_previous_answers'] = $f->checkbox(
52  $lng->txt('tst_use_previous_answers'),
53  $lng->txt('tst_use_previous_answers_description')
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')
85 
86  return $f->section($inputs, $lng->txt('tst_sequence_properties'));
87  }
getInputUsrPassOverview(\ilLanguage $lng, FieldFactory $f, Refinery $refinery)
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:

◆ toLog()

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

Definition at line 154 of file SettingsParticipantFunctionality.php.

References ILIAS\Test\Logging\AdditionalInformationGenerator\getEnabledDisabledTagForBool(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getPostponedQuestionsMoveToEnd(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getQuestionListEnabled(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getQuestionMarkingEnabled(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getShowDescriptionInQuestionList(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getShownQuestionListAtBeginning(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getShownQuestionListAtEnd(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getSuspendTestAllowed(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getUsePreviousAnswerAllowed(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getUsrPassOverviewEnabled(), ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_OVERVIEW_ENABLED, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_OVERVIEW_SHOW_DESCRIPTION, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_OVERVIEW_SHOW_END, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_OVERVIEW_SHOW_START, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_POSTPONED_MOVE_TO_END, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_QUESTION_LIST_ENABLED, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_QUESTION_MARKING_ENABLED, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_SUSPEND_ALLOWED, and ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_USE_PREVIOUS_ANSWERS_ENABELD.

154  : array
155  {
156  $log_array = [
158  ->getEnabledDisabledTagForBool($this->getUsePreviousAnswerAllowed()),
160  ->getEnabledDisabledTagForBool($this->getSuspendTestAllowed()),
162  ->getEnabledDisabledTagForBool($this->getPostponedQuestionsMoveToEnd())
163  ];
164 
165  $log_array[AdditionalInformationGenerator::KEY_TEST_OVERVIEW_ENABLED] = $additional_info
166  ->getEnabledDisabledTagForBool($this->getUsrPassOverviewEnabled());
167  if ($this->getUsrPassOverviewEnabled()) {
169  ->getEnabledDisabledTagForBool($this->getShownQuestionListAtBeginning());
171  ->getEnabledDisabledTagForBool($this->getShownQuestionListAtEnd());
173  ->getEnabledDisabledTagForBool($this->getShowDescriptionInQuestionList());
174  }
175 
177  ->getEnabledDisabledTagForBool($this->getQuestionMarkingEnabled());
179  ->getEnabledDisabledTagForBool($this->getQuestionListEnabled());
180  return $log_array;
181  }
+ Here is the call graph for this function:

◆ toStorage()

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

Definition at line 142 of file SettingsParticipantFunctionality.php.

References ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getPostponedQuestionsMoveToEnd(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getQuestionListEnabled(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getQuestionMarkingEnabled(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getSuspendTestAllowed(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getUsePreviousAnswerAllowed(), ILIAS\Test\Settings\MainSettings\SettingsParticipantFunctionality\getUsrPassOverviewMode(), and ILIAS\Repository\int().

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  }
+ 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.

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

187  : self
188  {
189  $clone = clone $this;
190  $clone->use_previous_answers_allowed = $use_previous_answers_allowed;
191  return $clone;
192  }
+ 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: