ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour Class Reference
+ Inheritance diagram for ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour:
+ Collaboration diagram for ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour:

Public Member Functions

 __construct (int $test_id, protected int $question_title_output_mode, protected bool $autosave_enabled, protected int $autosave_interval, protected bool $shuffle_questions, protected bool $question_hints_enabled, protected bool $instant_feedback_points_enabled, protected bool $instant_feedback_generic_enabled, protected bool $instant_feedback_specific_enabled, protected bool $instant_feedback_solution_enabled, protected bool $force_instant_feedback_on_next_question, protected bool $lock_answer_on_instant_feedback, protected bool $lock_answer_on_next_question)
 
 toForm (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, ?array $environment=null)
 
 toStorage ()
 
 toLog (AdditionalInformationGenerator $additional_info)
 
 getQuestionTitleOutputMode ()
 
 withQuestionTitleOutputMode (int $question_title_output_mode)
 
 getAutosaveEnabled ()
 
 withAutosaveEnabled (bool $autosave_enabled)
 
 getAutosaveInterval ()
 
 withAutosaveInterval (int $autosave_interval)
 
 getShuffleQuestions ()
 
 withShuffleQuestions (bool $shuffle_questions)
 
 getQuestionHintsEnabled ()
 
 withQuestionHintsEnabled (bool $question_hints_enabled)
 
 getInstantFeedbackPointsEnabled ()
 
 withInstantFeedbackPointsEnabled (bool $instant_feedback_points_enabled)
 
 getInstantFeedbackGenericEnabled ()
 
 withInstantFeedbackGenericEnabled (bool $instant_feedback_generic_enabled)
 
 getInstantFeedbackSpecificEnabled ()
 
 withInstantFeedbackSpecificEnabled (bool $instant_feedback_specific_enabled)
 
 getInstantFeedbackSolutionEnabled ()
 
 withInstantFeedbackSolutionEnabled (bool $instant_feedback_solution_enabled)
 
 getForceInstantFeedbackOnNextQuestion ()
 
 withForceInstantFeedbackOnNextQuestion (bool $force_instant_feedback_on_next_question)
 
 getLockAnswerOnInstantFeedbackEnabled ()
 
 withLockAnswerOnInstantFeedbackEnabled (bool $lock_answer_on_instant_feedback)
 
 getLockAnswerOnNextQuestionEnabled ()
 
 withLockAnswerOnNextQuestionEnabled (bool $lock_answer_on_next_question)
 
- 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)
 

Data Fields

const ANSWER_FIXATION_NONE = 'none'
 
const ANSWER_FIXATION_ON_INSTANT_FEEDBACK = 'instant_feedback'
 
const ANSWER_FIXATION_ON_FOLLOWUP_QUESTION = 'followup_question'
 
const ANSWER_FIXATION_ON_IFB_OR_FUQST = 'ifb_or_fuqst'
 

Private Member Functions

 getInputAutosave (\ilLanguage $lng, FieldFactory $f, Refinery $refinery)
 
 getInputInstantFeedback (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment)
 
 getSubInputInstantFeedback (\ilLanguage $lng, FieldFactory $f)
 
 getInputLockAnswers (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment)
 
 getTransformationLockAnswers (Refinery $refinery)
 
 getShuffleAndLockAnswersConstraint (\ilLanguage $lng, Refinery $refinery)
 
 isAnyInstantFeedbackOptionEnabled ()
 
 getAnswerFixationSettingsAsFormValue ()
 

Private Attributes

const DEFAULT_AUTOSAVE_INTERVAL = 30000
 

Additional Inherited Members

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

Detailed Description

Definition at line 33 of file SettingsQuestionBehaviour.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::__construct ( int  $test_id,
protected int  $question_title_output_mode,
protected bool  $autosave_enabled,
protected int  $autosave_interval,
protected bool  $shuffle_questions,
protected bool  $question_hints_enabled,
protected bool  $instant_feedback_points_enabled,
protected bool  $instant_feedback_generic_enabled,
protected bool  $instant_feedback_specific_enabled,
protected bool  $instant_feedback_solution_enabled,
protected bool  $force_instant_feedback_on_next_question,
protected bool  $lock_answer_on_instant_feedback,
protected bool  $lock_answer_on_next_question 
)

Definition at line 42 of file SettingsQuestionBehaviour.php.

References ILIAS\GlobalScreen\Provider\__construct().

56  {
58  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getAnswerFixationSettingsAsFormValue()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getAnswerFixationSettingsAsFormValue ( )
private

Definition at line 572 of file SettingsQuestionBehaviour.php.

References ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getLockAnswerOnInstantFeedbackEnabled(), and ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getLockAnswerOnNextQuestionEnabled().

Referenced by ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInputLockAnswers().

572  : string
573  {
576  return self::ANSWER_FIXATION_ON_IFB_OR_FUQST;
577  }
578 
580  return self::ANSWER_FIXATION_ON_INSTANT_FEEDBACK;
581  }
582 
583  if ($this->getLockAnswerOnNextQuestionEnabled()) {
584  return self::ANSWER_FIXATION_ON_FOLLOWUP_QUESTION;
585  }
586 
587  return self::ANSWER_FIXATION_NONE;
588  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAutosaveEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getAutosaveEnabled ( )

Definition at line 432 of file SettingsQuestionBehaviour.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInputAutosave(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\toLog(), and ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\toStorage().

432  : bool
433  {
434  return $this->autosave_enabled;
435  }
+ Here is the caller graph for this function:

◆ getAutosaveInterval()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getAutosaveInterval ( )

Definition at line 444 of file SettingsQuestionBehaviour.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInputAutosave(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\toLog(), and ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\toStorage().

444  : int
445  {
446  return $this->autosave_interval;
447  }
+ Here is the caller graph for this function:

◆ getForceInstantFeedbackOnNextQuestion()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getForceInstantFeedbackOnNextQuestion ( )

Definition at line 536 of file SettingsQuestionBehaviour.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInputInstantFeedback(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\toLog(), and ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\toStorage().

536  : bool
537  {
538  return $this->force_instant_feedback_on_next_question;
539  }
+ Here is the caller graph for this function:

◆ getInputAutosave()

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

Definition at line 105 of file SettingsQuestionBehaviour.php.

References ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getAutosaveEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getAutosaveInterval(), null, ilLanguage\txt(), and ILIAS\UI\Implementation\Component\Input\withValue().

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

109  : OptionalGroup {
110  $trafo = $refinery->custom()->transformation(
111  static function (?array $vs): array {
112  if ($vs === null) {
113  return [
114  'autosave_enabled' => false,
115  'autosave_interval' => self::DEFAULT_AUTOSAVE_INTERVAL
116  ];
117  }
118 
119  return [
120  'autosave_enabled' => true,
121  'autosave_interval' => $vs['autosave_interval'] * 1000
122  ];
123  }
124  );
125  $sub_inputs_autosave['autosave_interval'] = $f->numeric($lng->txt('autosave_ival'), $lng->txt('seconds'))
126  ->withRequired(true)
127  ->withAdditionalTransformation($refinery->int()->isGreaterThan(0))
128  ->withValue(
129  $this->getAutosaveInterval() !== 0
130  ? $this->getAutosaveInterval() / 1000
131  : 30
132  );
133 
134  $autosave_input = $f->optionalGroup(
135  $sub_inputs_autosave,
136  $lng->txt('autosave'),
137  $lng->txt('autosave_info')
138  )->withValue(null)
139  ->withAdditionalTransformation($trafo);
140 
141  if (!$this->getAutosaveEnabled()) {
142  return $autosave_input;
143  }
144 
145  return $autosave_input->withValue(['autosave_interval' => $this->getAutosaveInterval() / 1000]);
146  }
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:

◆ getInputInstantFeedback()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getInputInstantFeedback ( \ilLanguage  $lng,
FieldFactory  $f,
Refinery  $refinery,
array  $environment 
)
private

Definition at line 148 of file SettingsQuestionBehaviour.php.

References ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getForceInstantFeedbackOnNextQuestion(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackGenericEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackPointsEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackSolutionEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackSpecificEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getSubInputInstantFeedback(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\isAnyInstantFeedbackOptionEnabled(), null, ilLanguage\txt(), and ILIAS\UI\Implementation\Component\Input\withValue().

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

153  : OptionalGroup {
154  $constraint = $refinery->custom()->constraint(
155  fn(?array $vs) => $vs === null
156  || $vs['enabled_feedback_types']['instant_feedback_specific'] === null
157  && $vs['enabled_feedback_types']['instant_feedback_generic'] === null
158  && $vs['enabled_feedback_types']['instant_feedback_points'] === null
159  && $vs['enabled_feedback_types']['instant_feedback_solution'] === null
160  && $vs['feedback_trigger'] === null
161  || (
162  $vs['enabled_feedback_types']['instant_feedback_specific'] === true
163  || $vs['enabled_feedback_types']['instant_feedback_generic'] === true
164  || $vs['enabled_feedback_types']['instant_feedback_points'] === true
165  || $vs['enabled_feedback_types']['instant_feedback_solution'] === true
166  )
167  && $vs['feedback_trigger'] !== '',
168  $lng->txt('select_at_least_one_feedback_type_and_trigger')
169  );
170  $trafo = $refinery->custom()->transformation(
171  static function (?array $vs): array {
172  if ($vs === null) {
173  return [
174  'enabled_feedback_types' => [
175  'instant_feedback_specific' => false,
176  'instant_feedback_generic' => false,
177  'instant_feedback_points' => false,
178  'instant_feedback_solution' => false
179  ],
180  'feedback_on_next_question' => false
181  ];
182  }
183 
184  $vs['feedback_on_next_question'] = $vs['feedback_trigger'] === '1';
185  return $vs;
186  }
187  );
188 
189  $instant_feedback = $f->optionalGroup(
191  $lng->txt('tst_instant_feedback'),
192  $lng->txt('tst_instant_feedback_desc')
193  )->withValue(null)
194  ->withAdditionalTransformation($constraint)
195  ->withAdditionalTransformation($trafo);
196 
197  if ($this->isAnyInstantFeedbackOptionEnabled()) {
198  $instant_feedback = $instant_feedback->withValue(
199  [
200  'enabled_feedback_types' => [
201  'instant_feedback_specific' => (bool) $this->getInstantFeedbackSpecificEnabled(),
202  'instant_feedback_generic' => (bool) $this->getInstantFeedbackGenericEnabled(),
203  'instant_feedback_points' => (bool) $this->getInstantFeedbackPointsEnabled(),
204  'instant_feedback_solution' => (bool) $this->getInstantFeedbackSolutionEnabled()
205  ],
206  'feedback_trigger' => ($this->getForceInstantFeedbackOnNextQuestion() ? '1' : '0')
207  ]
208  );
209  }
210 
211  if (!$environment['participant_data_exists']) {
212  return $instant_feedback;
213  }
214 
215  return $instant_feedback->withDisabled(true);
216  }
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:

◆ getInputLockAnswers()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getInputLockAnswers ( \ilLanguage  $lng,
FieldFactory  $f,
Refinery  $refinery,
array  $environment 
)
private

Definition at line 261 of file SettingsQuestionBehaviour.php.

References ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getAnswerFixationSettingsAsFormValue(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getTransformationLockAnswers(), ilLanguage\txt(), ILIAS\UI\Implementation\Component\Input\ViewControl\withAdditionalTransformation(), and ILIAS\UI\Implementation\Component\Input\withValue().

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

266  : Radio {
267  $lock_answers = $f->radio(
268  $lng->txt('tst_answer_fixation_handling')
269  )->withOption(
270  self::ANSWER_FIXATION_NONE,
271  $lng->txt('tst_answer_fixation_none'),
272  $lng->txt('tst_answer_fixation_none_desc')
273  )->withOption(
274  self::ANSWER_FIXATION_ON_INSTANT_FEEDBACK,
275  $lng->txt('tst_answer_fixation_on_instant_feedback'),
276  $lng->txt('tst_answer_fixation_on_instant_feedback_desc')
277  )->withOption(
278  self::ANSWER_FIXATION_ON_FOLLOWUP_QUESTION,
279  $lng->txt('tst_answer_fixation_on_followup_question'),
280  $lng->txt('tst_answer_fixation_on_followup_question_desc')
281  )->withOption(
282  self::ANSWER_FIXATION_ON_IFB_OR_FUQST,
283  $lng->txt('tst_answer_fixation_on_instantfb_or_followupqst'),
284  $lng->txt('tst_answer_fixation_on_instantfb_or_followupqst_desc')
285  )->withValue(
288 
289  if (!$environment['participant_data_exists']) {
290  return $lock_answers;
291  }
292 
293  return $lock_answers->withDisabled(true);
294  }
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:

◆ getInstantFeedbackGenericEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getInstantFeedbackGenericEnabled ( )

◆ getInstantFeedbackPointsEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getInstantFeedbackPointsEnabled ( )

◆ getInstantFeedbackSolutionEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getInstantFeedbackSolutionEnabled ( )

◆ getInstantFeedbackSpecificEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getInstantFeedbackSpecificEnabled ( )

◆ getLockAnswerOnInstantFeedbackEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getLockAnswerOnInstantFeedbackEnabled ( )

Definition at line 548 of file SettingsQuestionBehaviour.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getAnswerFixationSettingsAsFormValue(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\toLog(), and ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\toStorage().

548  : bool
549  {
550  return $this->lock_answer_on_instant_feedback;
551  }
+ Here is the caller graph for this function:

◆ getLockAnswerOnNextQuestionEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getLockAnswerOnNextQuestionEnabled ( )

Definition at line 560 of file SettingsQuestionBehaviour.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getAnswerFixationSettingsAsFormValue(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\toLog(), and ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\toStorage().

560  : bool
561  {
562  return $this->lock_answer_on_next_question;
563  }
+ Here is the caller graph for this function:

◆ getQuestionHintsEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getQuestionHintsEnabled ( )

Definition at line 468 of file SettingsQuestionBehaviour.php.

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

468  : bool
469  {
470  return $this->question_hints_enabled;
471  }
+ Here is the caller graph for this function:

◆ getQuestionTitleOutputMode()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getQuestionTitleOutputMode ( )

Definition at line 420 of file SettingsQuestionBehaviour.php.

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

420  : int
421  {
422  return $this->question_title_output_mode;
423  }
+ Here is the caller graph for this function:

◆ getShuffleAndLockAnswersConstraint()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getShuffleAndLockAnswersConstraint ( \ilLanguage  $lng,
Refinery  $refinery 
)
private

Definition at line 328 of file SettingsQuestionBehaviour.php.

References ilLanguage\txt().

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

331  : Constraint {
332  return $refinery->custom()->constraint(
333  function ($vs): bool {
334  if ($vs['shuffle_questions'] === true
335  && $vs['lock_answers']['lock_answer_on_next_question']) {
336  return false;
337  }
338  return true;
339  },
340  $lng->txt('tst_settings_conflict_shuffle_and_lock'),
341  );
342  }
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getShuffleQuestions()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getShuffleQuestions ( )

Definition at line 456 of file SettingsQuestionBehaviour.php.

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

456  : bool
457  {
458  return $this->shuffle_questions;
459  }
+ Here is the caller graph for this function:

◆ getSubInputInstantFeedback()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getSubInputInstantFeedback ( \ilLanguage  $lng,
FieldFactory  $f 
)
private

Definition at line 218 of file SettingsQuestionBehaviour.php.

References ilLanguage\txt().

Referenced by ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInputInstantFeedback().

221  : array {
222  $feedback_options = [
223  'instant_feedback_points' => $f->checkbox(
224  $lng->txt('tst_instant_feedback_results'),
225  $lng->txt('tst_instant_feedback_results_desc')
226  ),
227  'instant_feedback_generic' => $f->checkbox(
228  $lng->txt('tst_instant_feedback_answer_generic'),
229  $lng->txt('tst_instant_feedback_answer_generic_desc')
230  ),
231  'instant_feedback_specific' => $f->checkbox(
232  $lng->txt('tst_instant_feedback_answer_specific'),
233  $lng->txt('tst_instant_feedback_answer_specific_desc')
234  ),
235  'instant_feedback_solution' => $f->checkbox(
236  $lng->txt('tst_instant_feedback_solution'),
237  $lng->txt('tst_instant_feedback_solution_desc')
238  )
239  ];
240 
241  $sub_inputs_feedback['enabled_feedback_types'] = $f->group(
242  $feedback_options,
243  $lng->txt('tst_instant_feedback_contents')
244  );
245 
246  $sub_inputs_feedback['feedback_trigger'] = $f->radio(
247  $lng->txt('tst_instant_feedback_trigger')
248  )->withOption(
249  '0',
250  $lng->txt('tst_instant_feedback_trigger_manual'),
251  $lng->txt('tst_instant_feedback_trigger_manual_desc')
252  )->withOption(
253  '1',
254  $lng->txt('tst_instant_feedback_trigger_forced'),
255  $lng->txt('tst_instant_feedback_trigger_forced_desc')
256  )->withRequired(true);
257 
258  return $sub_inputs_feedback;
259  }
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTransformationLockAnswers()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::getTransformationLockAnswers ( Refinery  $refinery)
private

Definition at line 296 of file SettingsQuestionBehaviour.php.

References null.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInputLockAnswers().

296  : Transformation
297  {
298  return $refinery->custom()->transformation(
299  static function (?string $v): array {
300  if ($v === null || $v === self::ANSWER_FIXATION_NONE) {
301  return [
302  'lock_answer_on_instant_feedback' => false,
303  'lock_answer_on_next_question' => false
304  ];
305  }
306 
307  if ($v === self::ANSWER_FIXATION_ON_INSTANT_FEEDBACK) {
308  return [
309  'lock_answer_on_instant_feedback' => true,
310  'lock_answer_on_next_question' => false
311  ];
312  }
313  if ($v === self::ANSWER_FIXATION_ON_FOLLOWUP_QUESTION) {
314  return [
315  'lock_answer_on_instant_feedback' => false,
316  'lock_answer_on_next_question' => true
317  ];
318  }
319 
320  return [
321  'lock_answer_on_instant_feedback' => true,
322  'lock_answer_on_next_question' => true
323  ];
324  }
325  );
326  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ isAnyInstantFeedbackOptionEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::isAnyInstantFeedbackOptionEnabled ( )
private

Definition at line 528 of file SettingsQuestionBehaviour.php.

References ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackGenericEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackPointsEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackSolutionEnabled(), and ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackSpecificEnabled().

Referenced by ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInputInstantFeedback(), and ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\toLog().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toForm()

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

Definition at line 64 of file SettingsQuestionBehaviour.php.

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInputAutosave(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInputInstantFeedback(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInputLockAnswers(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getQuestionHintsEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getQuestionTitleOutputMode(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getShuffleAndLockAnswersConstraint(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getShuffleQuestions(), ilLanguage\txt(), ILIAS\UI\Implementation\Component\Input\ViewControl\withAdditionalTransformation(), and ILIAS\UI\Implementation\Component\Input\withValue().

69  : FormInput {
70  $inputs['title_output'] = $f->radio($lng->txt('tst_title_output'))
71  ->withOption('0', $lng->txt('tst_title_output_full'))
72  ->withOption('1', $lng->txt('tst_title_output_hide_points'))
73  ->withOption('3', $lng->txt('tst_title_output_only_points'))
74  ->withOption('2', $lng->txt('tst_title_output_no_title'))
76  ->withAdditionalTransformation($refinery->kindlyTo()->int())
77  ;
78 
79  $inputs['autosave'] = $this->getInputAutosave($lng, $f, $refinery);
80 
81  $inputs['shuffle_questions'] = $f->checkbox(
82  $lng->txt('tst_shuffle_questions'),
83  $lng->txt('tst_shuffle_questions_description')
84  )->withValue($this->getShuffleQuestions());
85 
86  $inputs['offer_hints'] = $f->checkbox(
87  $lng->txt('tst_setting_offer_hints_label'),
88  $lng->txt('tst_setting_offer_hints_info')
90 
91  if ($environment['participant_data_exists']) {
92  $inputs['shuffle_questions'] = $inputs['shuffle_questions']->withDisabled(true);
93  $inputs['offer_hints'] = $inputs['offer_hints']->withDisabled(true);
94  }
95 
96  $inputs['instant_feedback'] = $this->getInputInstantFeedback($lng, $f, $refinery, $environment);
97  $inputs['lock_answers'] = $this->getInputLockAnswers($lng, $f, $refinery, $environment);
98 
99  $section = $f->section($inputs, $lng->txt('tst_presentation_properties'))
101 
102  return $section;
103  }
getInputInstantFeedback(\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment)
getInputAutosave(\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
getShuffleAndLockAnswersConstraint(\ilLanguage $lng, Refinery $refinery)
getInputLockAnswers(\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment)
+ Here is the call graph for this function:

◆ toLog()

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

Definition at line 362 of file SettingsQuestionBehaviour.php.

References ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getAutosaveEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getAutosaveInterval(), ILIAS\Test\Logging\AdditionalInformationGenerator\getEnabledDisabledTagForBool(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getForceInstantFeedbackOnNextQuestion(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackGenericEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackPointsEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackSolutionEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackSpecificEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getLockAnswerOnInstantFeedbackEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getLockAnswerOnNextQuestionEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getQuestionHintsEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getQuestionTitleOutputMode(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getShuffleQuestions(), ILIAS\Test\Logging\AdditionalInformationGenerator\getTagForLangVar(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\isAnyInstantFeedbackOptionEnabled(), ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_AUTOSAVE_ENABLED, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_FEEDBACK_ENABLED, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_FEEDBACK_SHOW_GENERIC, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_FEEDBACK_SHOW_POINTS, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_FEEDBACK_SHOW_SOLUTION, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_FEEDBACK_SHOW_SPECIFIC, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_FEEDBACK_TRIGGER, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_HINTS_ENABLED, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_LOCK_ANSWERS_MODE, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_SHUFFLE_QUESTIONS, and ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_TITLE_PRESENTATION.

362  : array
363  {
364 
365  switch ($this->getQuestionTitleOutputMode()) {
366  case 0:
368  ->getTagForLangVar('tst_title_output_full');
369  break;
370  case 1:
372  ->getTagForLangVar('tst_title_output_hide_points');
373  break;
374  case 2:
376  ->getTagForLangVar('tst_title_output_no_title');
377  break;
378  case 3:
380  ->getTagForLangVar('tst_title_output_only_points');
381  break;
382  }
384  ? $this->getAutosaveInterval() / 1000 . ' ' . $additional_info->getTagForLangVar('seconds') : $additional_info->getEnabledDisabledTagForBool(false);
386  ->getEnabledDisabledTagForBool($this->getShuffleQuestions());
387  $log_array[AdditionalInformationGenerator::KEY_TEST_HINTS_ENABLED] = $additional_info
388  ->getEnabledDisabledTagForBool($this->getQuestionHintsEnabled());
389 
390  $log_array[AdditionalInformationGenerator::KEY_TEST_FEEDBACK_ENABLED] = $additional_info
391  ->getEnabledDisabledTagForBool($this->isAnyInstantFeedbackOptionEnabled());
392  if ($this->isAnyInstantFeedbackOptionEnabled()) {
394  ->getEnabledDisabledTagForBool($this->getInstantFeedbackPointsEnabled());
396  ->getEnabledDisabledTagForBool($this->getInstantFeedbackGenericEnabled());
398  ->getEnabledDisabledTagForBool($this->getInstantFeedbackSpecificEnabled());
400  ->getEnabledDisabledTagForBool($this->getInstantFeedbackSolutionEnabled());
402  ? $additional_info->getTagForLangVar('tst_instant_feedback_trigger_forced')
403  : $additional_info->getTagForLangVar('tst_instant_feedback_trigger_manual');
404  }
405 
406  $lock_answers = $additional_info->getTagForLangVar('tst_answer_fixation_none');
409  $lock_answers = $additional_info->getTagForLangVar('tst_answer_fixation_on_instantfb_or_followupqst');
410  } elseif ($this->getLockAnswerOnInstantFeedbackEnabled()) {
411  $lock_answers = $additional_info->getTagForLangVar('tst_answer_fixation_on_instant_feedback');
412  } elseif ($this->getLockAnswerOnNextQuestionEnabled()) {
413  $lock_answers = $additional_info->getTagForLangVar('tst_answer_fixation_on_followup_question');
414  }
416 
417  return $log_array;
418  }
+ Here is the call graph for this function:

◆ toStorage()

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

Definition at line 344 of file SettingsQuestionBehaviour.php.

References ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getAutosaveEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getAutosaveInterval(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getForceInstantFeedbackOnNextQuestion(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackGenericEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackPointsEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackSolutionEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getInstantFeedbackSpecificEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getLockAnswerOnInstantFeedbackEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getLockAnswerOnNextQuestionEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getQuestionHintsEnabled(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getQuestionTitleOutputMode(), ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour\getShuffleQuestions(), and ILIAS\Repository\int().

344  : array
345  {
346  return [
347  'title_output' => ['integer', $this->getQuestionTitleOutputMode()],
348  'autosave' => ['integer', (int) $this->getAutosaveEnabled()],
349  'autosave_ival' => ['integer', $this->getAutosaveInterval()],
350  'shuffle_questions' => ['integer', (int) $this->getShuffleQuestions()],
351  'offer_question_hints' => ['integer', (int) $this->getQuestionHintsEnabled()],
352  'answer_feedback_points' => ['integer', (int) $this->getInstantFeedbackPointsEnabled()],
353  'answer_feedback' => ['integer', (int) $this->getInstantFeedbackGenericEnabled()],
354  'specific_feedback' => ['integer', (int) $this->getInstantFeedbackSpecificEnabled()],
355  'instant_verification' => ['integer', (int) $this->getInstantFeedbackSolutionEnabled()],
356  'force_inst_fb' => ['integer', (int) $this->getForceInstantFeedbackOnNextQuestion()],
357  'inst_fb_answer_fixation' => ['integer', (int) $this->getLockAnswerOnInstantFeedbackEnabled()],
358  'follow_qst_answer_fixation' => ['integer', (int) $this->getLockAnswerOnNextQuestionEnabled()]
359  ];
360  }
+ Here is the call graph for this function:

◆ withAutosaveEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::withAutosaveEnabled ( bool  $autosave_enabled)

Definition at line 437 of file SettingsQuestionBehaviour.php.

437  : self
438  {
439  $clone = clone $this;
440  $clone->autosave_enabled = $autosave_enabled;
441  return $clone;
442  }

◆ withAutosaveInterval()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::withAutosaveInterval ( int  $autosave_interval)

Definition at line 449 of file SettingsQuestionBehaviour.php.

449  : self
450  {
451  $clone = clone $this;
452  $clone->autosave_interval = $autosave_interval;
453  return $clone;
454  }

◆ withForceInstantFeedbackOnNextQuestion()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::withForceInstantFeedbackOnNextQuestion ( bool  $force_instant_feedback_on_next_question)

Definition at line 541 of file SettingsQuestionBehaviour.php.

541  : self
542  {
543  $clone = clone $this;
544  $clone->force_instant_feedback_on_next_question = $force_instant_feedback_on_next_question;
545  return $clone;
546  }

◆ withInstantFeedbackGenericEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::withInstantFeedbackGenericEnabled ( bool  $instant_feedback_generic_enabled)

Definition at line 497 of file SettingsQuestionBehaviour.php.

497  : self
498  {
499  $clone = clone $this;
500  $clone->instant_feedback_generic_enabled = $instant_feedback_generic_enabled;
501  return $clone;
502  }

◆ withInstantFeedbackPointsEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::withInstantFeedbackPointsEnabled ( bool  $instant_feedback_points_enabled)

Definition at line 485 of file SettingsQuestionBehaviour.php.

485  : self
486  {
487  $clone = clone $this;
488  $clone->instant_feedback_points_enabled = $instant_feedback_points_enabled;
489  return $clone;
490  }

◆ withInstantFeedbackSolutionEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::withInstantFeedbackSolutionEnabled ( bool  $instant_feedback_solution_enabled)

Definition at line 521 of file SettingsQuestionBehaviour.php.

521  : self
522  {
523  $clone = clone $this;
524  $clone->instant_feedback_solution_enabled = $instant_feedback_solution_enabled;
525  return $clone;
526  }

◆ withInstantFeedbackSpecificEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::withInstantFeedbackSpecificEnabled ( bool  $instant_feedback_specific_enabled)

Definition at line 509 of file SettingsQuestionBehaviour.php.

509  : self
510  {
511  $clone = clone $this;
512  $clone->instant_feedback_specific_enabled = $instant_feedback_specific_enabled;
513  return $clone;
514  }

◆ withLockAnswerOnInstantFeedbackEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::withLockAnswerOnInstantFeedbackEnabled ( bool  $lock_answer_on_instant_feedback)

Definition at line 553 of file SettingsQuestionBehaviour.php.

553  : self
554  {
555  $clone = clone $this;
556  $clone->lock_answer_on_instant_feedback = $lock_answer_on_instant_feedback;
557  return $clone;
558  }

◆ withLockAnswerOnNextQuestionEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::withLockAnswerOnNextQuestionEnabled ( bool  $lock_answer_on_next_question)

Definition at line 565 of file SettingsQuestionBehaviour.php.

565  : self
566  {
567  $clone = clone $this;
568  $clone->lock_answer_on_next_question = $lock_answer_on_next_question;
569  return $clone;
570  }

◆ withQuestionHintsEnabled()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::withQuestionHintsEnabled ( bool  $question_hints_enabled)

Definition at line 473 of file SettingsQuestionBehaviour.php.

473  : self
474  {
475  $clone = clone $this;
476  $clone->question_hints_enabled = $question_hints_enabled;
477  return $clone;
478  }

◆ withQuestionTitleOutputMode()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::withQuestionTitleOutputMode ( int  $question_title_output_mode)

Definition at line 425 of file SettingsQuestionBehaviour.php.

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

425  : self
426  {
427  $clone = clone $this;
428  $clone->question_title_output_mode = $question_title_output_mode;
429  return $clone;
430  }
+ Here is the caller graph for this function:

◆ withShuffleQuestions()

ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::withShuffleQuestions ( bool  $shuffle_questions)

Definition at line 461 of file SettingsQuestionBehaviour.php.

461  : self
462  {
463  $clone = clone $this;
464  $clone->shuffle_questions = $shuffle_questions;
465  return $clone;
466  }

Field Documentation

◆ ANSWER_FIXATION_NONE

const ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::ANSWER_FIXATION_NONE = 'none'

Definition at line 37 of file SettingsQuestionBehaviour.php.

◆ ANSWER_FIXATION_ON_FOLLOWUP_QUESTION

const ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::ANSWER_FIXATION_ON_FOLLOWUP_QUESTION = 'followup_question'

Definition at line 39 of file SettingsQuestionBehaviour.php.

◆ ANSWER_FIXATION_ON_IFB_OR_FUQST

const ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::ANSWER_FIXATION_ON_IFB_OR_FUQST = 'ifb_or_fuqst'

Definition at line 40 of file SettingsQuestionBehaviour.php.

◆ ANSWER_FIXATION_ON_INSTANT_FEEDBACK

const ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::ANSWER_FIXATION_ON_INSTANT_FEEDBACK = 'instant_feedback'

Definition at line 38 of file SettingsQuestionBehaviour.php.

◆ DEFAULT_AUTOSAVE_INTERVAL

const ILIAS\Test\Settings\MainSettings\SettingsQuestionBehaviour::DEFAULT_AUTOSAVE_INTERVAL = 30000
private

Definition at line 35 of file SettingsQuestionBehaviour.php.


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