ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjTestSettingsQuestionBehaviour Class Reference
+ Inheritance diagram for ilObjTestSettingsQuestionBehaviour:
+ Collaboration diagram for ilObjTestSettingsQuestionBehaviour:

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, protected bool $compulsory_questions_enabled)
 
 toForm (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment=null)
 
 toStorage ()
 
 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 ()
 
 getLockAnswerOnNextQuestionEnabled ()
 
 withLockAnswerOnInstantFeedbackEnabled (bool $lock_answer_on_instant_feedback)
 
 withLockAnswerOnNextQuestionEnabled (bool $lock_answer_on_next_question)
 
 getCompulsoryQuestionsEnabled ()
 
 withCompulsoryQuestionsEnabled (bool $compulsory_questions_enabled)
 
- Public Member Functions inherited from TestSettings
 __construct (int $test_id)
 
 getTestId ()
 
 withTestId (int $test_id)
 
 toForm (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment=null)
 
 toStorage ()
 

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, array $environment)
 
 getInputLockAnswers (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment)
 
 getTransformationLockAnswers (Refinery $refinery)
 
 getConstraintsSectionQuestionBehaviour (\ilLanguage $lng, Refinery $refinery)
 
 isAnyInstantFeedbackOptionEnabled ()
 
 getAnswerFixationSettingsAsFormValue ()
 

Private Attributes

const DEFAULT_AUTOSAVE_INTERVAL = 30000
 

Additional Inherited Members

- Protected Attributes inherited from TestSettings
int $test_id
 

Detailed Description

Definition at line 28 of file ilObjTestSettingsQuestionBehaviour.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjTestSettingsQuestionBehaviour::__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,
protected bool  $compulsory_questions_enabled 
)

Definition at line 37 of file ilObjTestSettingsQuestionBehaviour.php.

References ILIAS\MetaData\Repository\Validation\Data\__construct().

52  {
54  }
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ getAnswerFixationSettingsAsFormValue()

ilObjTestSettingsQuestionBehaviour::getAnswerFixationSettingsAsFormValue ( )
private

Definition at line 519 of file ilObjTestSettingsQuestionBehaviour.php.

References getLockAnswerOnInstantFeedbackEnabled(), and getLockAnswerOnNextQuestionEnabled().

Referenced by getInputLockAnswers().

519  : string
520  {
523  return self::ANSWER_FIXATION_ON_IFB_OR_FUQST;
524  }
525 
527  return self::ANSWER_FIXATION_ON_INSTANT_FEEDBACK;
528  }
529 
530  if ($this->getLockAnswerOnNextQuestionEnabled()) {
531  return self::ANSWER_FIXATION_ON_FOLLOWUP_QUESTION;
532  }
533 
534  return self::ANSWER_FIXATION_NONE;
535  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAutosaveEnabled()

ilObjTestSettingsQuestionBehaviour::getAutosaveEnabled ( )

Definition at line 408 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by getInputAutosave(), and toStorage().

408  : bool
409  {
410  return $this->autosave_enabled;
411  }
+ Here is the caller graph for this function:

◆ getAutosaveInterval()

ilObjTestSettingsQuestionBehaviour::getAutosaveInterval ( )

Definition at line 419 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by getInputAutosave(), and toStorage().

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

◆ getCompulsoryQuestionsEnabled()

ilObjTestSettingsQuestionBehaviour::getCompulsoryQuestionsEnabled ( )

Definition at line 549 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by toForm(), and toStorage().

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

◆ getConstraintsSectionQuestionBehaviour()

ilObjTestSettingsQuestionBehaviour::getConstraintsSectionQuestionBehaviour ( \ilLanguage  $lng,
Refinery  $refinery 
)
private

Definition at line 346 of file ilObjTestSettingsQuestionBehaviour.php.

References ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\from(), and ilLanguage\txt().

Referenced by toForm().

349  : Generator {
350  yield from [
351  $refinery->custom()->constraint(
352  function ($vs): bool {
353  if ($vs['enable_compulsory_questions'] === true
354  && (
355  $vs['lock_answers']['lock_answer_on_instant_feedback']
356  || $vs['lock_answers']['lock_answer_on_next_question']
357  )
358  ) {
359  return false;
360  }
361  return true;
362  },
363  $lng->txt('tst_settings_conflict_compulsory_and_lock')
364  ),
365  $refinery->custom()->constraint(
366  function ($vs): bool {
367  if ($vs['shuffle_questions'] === true
368  && $vs['lock_answers']['lock_answer_on_next_question']) {
369  return false;
370  }
371  return true;
372  },
373  $lng->txt('tst_settings_conflict_shuffle_and_lock')
374  )
375  ];
376  }
$lng
Refinery Factory $refinery
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getForceInstantFeedbackOnNextQuestion()

ilObjTestSettingsQuestionBehaviour::getForceInstantFeedbackOnNextQuestion ( )

Definition at line 500 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by getInputInstantFeedback(), and toStorage().

500  : bool
501  {
502  return $this->force_instant_feedback_on_next_question;
503  }
+ Here is the caller graph for this function:

◆ getInputAutosave()

ilObjTestSettingsQuestionBehaviour::getInputAutosave ( \ilLanguage  $lng,
FieldFactory  $f,
Refinery  $refinery 
)
private

Definition at line 111 of file ilObjTestSettingsQuestionBehaviour.php.

References getAutosaveEnabled(), getAutosaveInterval(), ilLanguage\txt(), ILIAS\UI\Component\Input\Input\withAdditionalTransformation(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by toForm().

115  : OptionalGroup {
116  $trafo = $refinery->custom()->transformation(
117  static function (?array $vs): array {
118  if ($vs === null) {
119  return [
120  'autosave_enabled' => false,
121  'autosave_interval' => self::DEFAULT_AUTOSAVE_INTERVAL
122  ];
123  }
124 
125  return [
126  'autosave_enabled' => true,
127  'autosave_interval' => $vs['autosave_interval'] * 1000
128  ];
129  }
130  );
131  $sub_inputs_autosave['autosave_interval'] = $f->numeric($lng->txt('autosave_ival'), $lng->txt('seconds'))
132  ->withRequired(true)
133  ->withAdditionalTransformation($refinery->int()->isGreaterThan(0))
134  ->withValue(
135  $this->getAutosaveInterval() !== 0
136  ? $this->getAutosaveInterval() / 1000
137  : 30
138  );
139 
140  $autosave_input = $f->optionalGroup(
141  $sub_inputs_autosave,
142  $lng->txt('autosave'),
143  $lng->txt('autosave_info')
144  )->withValue(null)
145  ->withAdditionalTransformation($trafo);
146 
147  if (!$this->getAutosaveEnabled()) {
148  return $autosave_input;
149  }
150 
151  return $autosave_input->withValue(
152  [
153  'autosave_interval' => $this->getAutosaveInterval() / 1000
154  ]
155  );
156  }
This describes optional group inputs.
$lng
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:58
Refinery Factory $refinery
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInputInstantFeedback()

ilObjTestSettingsQuestionBehaviour::getInputInstantFeedback ( \ilLanguage  $lng,
FieldFactory  $f,
Refinery  $refinery,
array  $environment 
)
private

Definition at line 158 of file ilObjTestSettingsQuestionBehaviour.php.

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

Referenced by toForm().

163  : OptionalGroup {
164  $constraint = $refinery->custom()->constraint(
165  fn(?array $vs) => $vs === null
166  || $vs['enabled_feedback_types']['instant_feedback_specific'] === null
167  && $vs['enabled_feedback_types']['instant_feedback_generic'] === null
168  && $vs['enabled_feedback_types']['instant_feedback_points'] === null
169  && $vs['enabled_feedback_types']['instant_feedback_solution'] === null
170  && $vs['feedback_trigger'] === null
171  || (
172  $vs['enabled_feedback_types']['instant_feedback_specific'] === true
173  || $vs['enabled_feedback_types']['instant_feedback_generic'] === true
174  || $vs['enabled_feedback_types']['instant_feedback_points'] === true
175  || $vs['enabled_feedback_types']['instant_feedback_solution'] === true
176  )
177  && $vs['feedback_trigger'] !== '',
178  $lng->txt('select_at_least_one_feedback_type_and_trigger')
179  );
180  $trafo = $refinery->custom()->transformation(
181  static function (?array $vs): array {
182  if ($vs === null) {
183  return [
184  'enabled_feedback_types' => [
185  'instant_feedback_specific' => false,
186  'instant_feedback_generic' => false,
187  'instant_feedback_points' => false,
188  'instant_feedback_solution' => false
189  ],
190  'feedback_on_next_question' => false
191  ];
192  }
193 
194  $vs['feedback_on_next_question'] = $vs['feedback_trigger'] === '1' ? true : false;
195  return $vs;
196  }
197  );
198 
199  $instant_feedback = $f->optionalGroup(
200  $this->getSubInputInstantFeedback($lng, $f, $environment),
201  $lng->txt('tst_instant_feedback'),
202  $lng->txt('tst_instant_feedback_desc')
203  )->withValue(null)
204  ->withAdditionalTransformation($constraint)
205  ->withAdditionalTransformation($trafo);
206 
207  if ($this->isAnyInstantFeedbackOptionEnabled()) {
208  $instant_feedback = $instant_feedback->withValue(
209  [
210  'enabled_feedback_types' => [
211  'instant_feedback_specific' => (bool) $this->getInstantFeedbackSpecificEnabled(),
212  'instant_feedback_generic' => (bool) $this->getInstantFeedbackGenericEnabled(),
213  'instant_feedback_points' => (bool) $this->getInstantFeedbackPointsEnabled(),
214  'instant_feedback_solution' => (bool) $this->getInstantFeedbackSolutionEnabled()
215  ],
216  'feedback_trigger' => (string) ($this->getForceInstantFeedbackOnNextQuestion() ?
217  '1' : '0')
218  ]
219  );
220  }
221 
222  if (!$environment['participant_data_exists']) {
223  return $instant_feedback;
224  }
225 
226  return $instant_feedback->withDisabled(true);
227  }
This describes optional group inputs.
$lng
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:58
getSubInputInstantFeedback(\ilLanguage $lng, FieldFactory $f, array $environment)
Refinery Factory $refinery
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInputLockAnswers()

ilObjTestSettingsQuestionBehaviour::getInputLockAnswers ( \ilLanguage  $lng,
FieldFactory  $f,
Refinery  $refinery,
array  $environment 
)
private

Definition at line 279 of file ilObjTestSettingsQuestionBehaviour.php.

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

Referenced by toForm().

284  : Radio {
285  $lock_answers = $f->radio(
286  $lng->txt('tst_answer_fixation_handling')
287  )->withOption(
288  self::ANSWER_FIXATION_NONE,
289  $lng->txt('tst_answer_fixation_none'),
290  $lng->txt('tst_answer_fixation_none_desc')
291  )->withOption(
292  self::ANSWER_FIXATION_ON_INSTANT_FEEDBACK,
293  $lng->txt('tst_answer_fixation_on_instant_feedback'),
294  $lng->txt('tst_answer_fixation_on_instant_feedback_desc')
295  )->withOption(
296  self::ANSWER_FIXATION_ON_FOLLOWUP_QUESTION,
297  $lng->txt('tst_answer_fixation_on_followup_question'),
298  $lng->txt('tst_answer_fixation_on_followup_question_desc')
299  )->withOption(
300  self::ANSWER_FIXATION_ON_IFB_OR_FUQST,
301  $lng->txt('tst_answer_fixation_on_instantfb_or_followupqst'),
302  $lng->txt('tst_answer_fixation_on_instantfb_or_followupqst_desc')
303  )->withValue(
306 
307  if (!$environment['participant_data_exists']) {
308  return $lock_answers;
309  }
310 
311  return $lock_answers->withDisabled(true);
312  }
This is what a radio-input looks like.
Definition: Radio.php:28
$lng
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:58
Refinery Factory $refinery
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstantFeedbackGenericEnabled()

ilObjTestSettingsQuestionBehaviour::getInstantFeedbackGenericEnabled ( )

Definition at line 462 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by getInputInstantFeedback(), isAnyInstantFeedbackOptionEnabled(), and toStorage().

462  : bool
463  {
464  return $this->instant_feedback_generic_enabled;
465  }
+ Here is the caller graph for this function:

◆ getInstantFeedbackPointsEnabled()

ilObjTestSettingsQuestionBehaviour::getInstantFeedbackPointsEnabled ( )

Definition at line 452 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by getInputInstantFeedback(), isAnyInstantFeedbackOptionEnabled(), and toStorage().

452  : bool
453  {
454  return $this->instant_feedback_points_enabled;
455  }
+ Here is the caller graph for this function:

◆ getInstantFeedbackSolutionEnabled()

ilObjTestSettingsQuestionBehaviour::getInstantFeedbackSolutionEnabled ( )

Definition at line 482 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by getInputInstantFeedback(), isAnyInstantFeedbackOptionEnabled(), and toStorage().

482  : bool
483  {
484  return $this->instant_feedback_solution_enabled;
485  }
+ Here is the caller graph for this function:

◆ getInstantFeedbackSpecificEnabled()

ilObjTestSettingsQuestionBehaviour::getInstantFeedbackSpecificEnabled ( )

Definition at line 472 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by getInputInstantFeedback(), isAnyInstantFeedbackOptionEnabled(), and toStorage().

472  : bool
473  {
474  return $this->instant_feedback_specific_enabled;
475  }
+ Here is the caller graph for this function:

◆ getLockAnswerOnInstantFeedbackEnabled()

ilObjTestSettingsQuestionBehaviour::getLockAnswerOnInstantFeedbackEnabled ( )

Definition at line 511 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by getAnswerFixationSettingsAsFormValue(), and toStorage().

511  : bool
512  {
513  return $this->lock_answer_on_instant_feedback;
514  }
+ Here is the caller graph for this function:

◆ getLockAnswerOnNextQuestionEnabled()

ilObjTestSettingsQuestionBehaviour::getLockAnswerOnNextQuestionEnabled ( )

Definition at line 515 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by getAnswerFixationSettingsAsFormValue(), and toStorage().

515  : bool
516  {
517  return $this->lock_answer_on_next_question;
518  }
+ Here is the caller graph for this function:

◆ getQuestionHintsEnabled()

ilObjTestSettingsQuestionBehaviour::getQuestionHintsEnabled ( )

Definition at line 441 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by toForm(), and toStorage().

441  : bool
442  {
443  return $this->question_hints_enabled;
444  }
+ Here is the caller graph for this function:

◆ getQuestionTitleOutputMode()

ilObjTestSettingsQuestionBehaviour::getQuestionTitleOutputMode ( )

Definition at line 397 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by toForm(), and toStorage().

397  : int
398  {
399  return $this->question_title_output_mode;
400  }
+ Here is the caller graph for this function:

◆ getShuffleQuestions()

ilObjTestSettingsQuestionBehaviour::getShuffleQuestions ( )

Definition at line 430 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by toForm(), and toStorage().

430  : bool
431  {
432  return $this->shuffle_questions;
433  }
+ Here is the caller graph for this function:

◆ getSubInputInstantFeedback()

ilObjTestSettingsQuestionBehaviour::getSubInputInstantFeedback ( \ilLanguage  $lng,
FieldFactory  $f,
array  $environment 
)
private

Definition at line 229 of file ilObjTestSettingsQuestionBehaviour.php.

References ilLanguage\txt().

Referenced by getInputInstantFeedback().

233  : array {
234  $feedback_options = [
235  'instant_feedback_points' => $f->checkbox(
236  $lng->txt('tst_instant_feedback_results'),
237  $lng->txt('tst_instant_feedback_results_desc')
238  ),
239  'instant_feedback_generic' => $f->checkbox(
240  $lng->txt('tst_instant_feedback_answer_generic'),
241  $lng->txt('tst_instant_feedback_answer_generic_desc')
242  ),
243  'instant_feedback_specific' => $f->checkbox(
244  $lng->txt('tst_instant_feedback_answer_specific'),
245  $lng->txt('tst_instant_feedback_answer_specific_desc')
246  ),
247  'instant_feedback_solution' => $f->checkbox(
248  $lng->txt('tst_instant_feedback_solution'),
249  $lng->txt('tst_instant_feedback_solution_desc')
250  )
251  ];
252 
253  $sub_inputs_feedback['enabled_feedback_types'] = $f->group(
254  $feedback_options,
255  $lng->txt('tst_instant_feedback_contents')
256  );
257 
258  $sub_inputs_feedback['feedback_trigger'] = $f->radio(
259  $lng->txt('tst_instant_feedback_trigger')
260  )->withOption(
261  '0',
262  $lng->txt('tst_instant_feedback_trigger_manual'),
263  $lng->txt('tst_instant_feedback_trigger_manual_desc')
264  )->withOption(
265  '1',
266  $lng->txt('tst_instant_feedback_trigger_forced'),
267  $lng->txt('tst_instant_feedback_trigger_forced_desc')
268  );
269 
270  if (!$environment['participant_data_exists']) {
271  $sub_inputs_feedback['feedback_trigger'] = $sub_inputs_feedback['feedback_trigger']
272  ->withRequired(true);
273  }
274  return $sub_inputs_feedback;
275 
276 
277  }
$lng
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTransformationLockAnswers()

ilObjTestSettingsQuestionBehaviour::getTransformationLockAnswers ( Refinery  $refinery)
private

Definition at line 314 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by getInputLockAnswers().

315  {
316  return $refinery->custom()->transformation(
317  static function (?string $v): array {
318  if ($v === null || $v === self::ANSWER_FIXATION_NONE) {
319  return [
320  'lock_answer_on_instant_feedback' => false,
321  'lock_answer_on_next_question' => false
322  ];
323  }
324 
325  if ($v === self::ANSWER_FIXATION_ON_INSTANT_FEEDBACK) {
326  return [
327  'lock_answer_on_instant_feedback' => true,
328  'lock_answer_on_next_question' => false
329  ];
330  }
331  if ($v === self::ANSWER_FIXATION_ON_FOLLOWUP_QUESTION) {
332  return [
333  'lock_answer_on_instant_feedback' => false,
334  'lock_answer_on_next_question' => true
335  ];
336  }
337 
338  return [
339  'lock_answer_on_instant_feedback' => true,
340  'lock_answer_on_next_question' => true
341  ];
342  }
343  );
344  }
A transformation is a function from one datatype to another.
Refinery Factory $refinery
+ Here is the caller graph for this function:

◆ isAnyInstantFeedbackOptionEnabled()

ilObjTestSettingsQuestionBehaviour::isAnyInstantFeedbackOptionEnabled ( )
private

◆ toForm()

ilObjTestSettingsQuestionBehaviour::toForm ( \ilLanguage  $lng,
FieldFactory  $f,
Refinery  $refinery,
array  $environment = null 
)
Returns
array<ILIAS>

Definition at line 60 of file ilObjTestSettingsQuestionBehaviour.php.

References ILIAS\UI\Implementation\Component\Input\$inputs, getCompulsoryQuestionsEnabled(), getConstraintsSectionQuestionBehaviour(), getInputAutosave(), getInputInstantFeedback(), getInputLockAnswers(), getQuestionHintsEnabled(), getQuestionTitleOutputMode(), getShuffleQuestions(), ilLanguage\txt(), ILIAS\UI\Implementation\Component\Input\ViewControl\withAdditionalTransformation(), and ILIAS\UI\Implementation\Component\Input\withValue().

65  : FormInput {
66  $inputs['title_output'] = $f->radio($lng->txt('tst_title_output'))
67  ->withOption('0', $lng->txt('tst_title_output_full'))
68  ->withOption('1', $lng->txt('tst_title_output_hide_points'))
69  ->withOption('3', $lng->txt('tst_title_output_only_points'))
70  ->withOption('2', $lng->txt('tst_title_output_no_title'))
72  ->withAdditionalTransformation($refinery->kindlyTo()->int());
73 
74  $inputs['autosave'] = $this->getInputAutosave($lng, $f, $refinery);
75 
76  $inputs['shuffle_questions'] = $f->checkbox(
77  $lng->txt('tst_shuffle_questions'),
78  $lng->txt('tst_shuffle_questions_description')
79  )->withValue($this->getShuffleQuestions());
80 
81  $inputs['offer_hints'] = $f->checkbox(
82  $lng->txt('tst_setting_offer_hints_label'),
83  $lng->txt('tst_setting_offer_hints_info')
85 
86  if ($environment['participant_data_exists']) {
87  $inputs['shuffle_questions'] = $inputs['shuffle_questions']->withDisabled(true);
88  $inputs['offer_hints'] = $inputs['offer_hints']->withDisabled(true);
89  }
90 
91  $inputs['instant_feedback'] = $this->getInputInstantFeedback($lng, $f, $refinery, $environment);
92  $inputs['lock_answers'] = $this->getInputLockAnswers($lng, $f, $refinery, $environment);
93 
94  $inputs['enable_compulsory_questions'] = $f->checkbox(
95  $lng->txt('tst_setting_enable_obligations_label'),
96  $lng->txt('tst_setting_enable_obligations_info')
98 
99  if ($environment['participant_data_exists']) {
100  $inputs['enable_compulsory_questions'] = $inputs['enable_compulsory_questions']->withDisabled(true);
101  }
102 
103  $section = $f->section($inputs, $lng->txt('tst_presentation_properties'));
104  foreach ($this->getConstraintsSectionQuestionBehaviour($lng, $refinery) as $constraint) {
105  $section = $section->withAdditionalTransformation($constraint);
106  }
107 
108  return $section;
109  }
$lng
getInputLockAnswers(\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:58
getConstraintsSectionQuestionBehaviour(\ilLanguage $lng, Refinery $refinery)
getInputInstantFeedback(\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment)
This describes inputs that can be used in forms.
Definition: FormInput.php:31
Refinery Factory $refinery
+ Here is the call graph for this function:

◆ toStorage()

ilObjTestSettingsQuestionBehaviour::toStorage ( )

Definition at line 378 of file ilObjTestSettingsQuestionBehaviour.php.

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

378  : array
379  {
380  return [
381  'title_output' => ['integer', $this->getQuestionTitleOutputMode()],
382  'autosave' => ['integer', (int) $this->getAutosaveEnabled()],
383  'autosave_ival' => ['integer', $this->getAutosaveInterval()],
384  'shuffle_questions' => ['integer', (int) $this->getShuffleQuestions()],
385  'offer_question_hints' => ['integer', (int) $this->getQuestionHintsEnabled()],
386  'answer_feedback_points' => ['integer', (int) $this->getInstantFeedbackPointsEnabled()],
387  'answer_feedback' => ['integer', (int) $this->getInstantFeedbackGenericEnabled()],
388  'specific_feedback' => ['integer', (int) $this->getInstantFeedbackSpecificEnabled()],
389  'instant_verification' => ['integer', (int) $this->getInstantFeedbackSolutionEnabled()],
390  'force_inst_fb' => ['integer', (int) $this->getForceInstantFeedbackOnNextQuestion()],
391  'inst_fb_answer_fixation' => ['integer', (int) $this->getLockAnswerOnInstantFeedbackEnabled()],
392  'follow_qst_answer_fixation' => ['integer', (int) $this->getLockAnswerOnNextQuestionEnabled()],
393  'obligations_enabled' => ['integer', (int) $this->getCompulsoryQuestionsEnabled()]
394  ];
395  }
+ Here is the call graph for this function:

◆ withAutosaveEnabled()

ilObjTestSettingsQuestionBehaviour::withAutosaveEnabled ( bool  $autosave_enabled)

Definition at line 412 of file ilObjTestSettingsQuestionBehaviour.php.

412  : self
413  {
414  $clone = clone $this;
415  $clone->autosave_enabled = $autosave_enabled;
416  return $clone;
417  }

◆ withAutosaveInterval()

ilObjTestSettingsQuestionBehaviour::withAutosaveInterval ( int  $autosave_interval)

Definition at line 423 of file ilObjTestSettingsQuestionBehaviour.php.

423  : self
424  {
425  $clone = clone $this;
426  $clone->autosave_interval = $autosave_interval;
427  return $clone;
428  }

◆ withCompulsoryQuestionsEnabled()

ilObjTestSettingsQuestionBehaviour::withCompulsoryQuestionsEnabled ( bool  $compulsory_questions_enabled)

Definition at line 553 of file ilObjTestSettingsQuestionBehaviour.php.

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

◆ withForceInstantFeedbackOnNextQuestion()

ilObjTestSettingsQuestionBehaviour::withForceInstantFeedbackOnNextQuestion ( bool  $force_instant_feedback_on_next_question)

Definition at line 504 of file ilObjTestSettingsQuestionBehaviour.php.

504  : self
505  {
506  $clone = clone $this;
507  $clone->force_instant_feedback_on_next_question = $force_instant_feedback_on_next_question;
508  return $clone;
509  }

◆ withInstantFeedbackGenericEnabled()

ilObjTestSettingsQuestionBehaviour::withInstantFeedbackGenericEnabled ( bool  $instant_feedback_generic_enabled)

Definition at line 466 of file ilObjTestSettingsQuestionBehaviour.php.

466  : self
467  {
468  $clone = clone $this;
469  $clone->instant_feedback_generic_enabled = $instant_feedback_generic_enabled;
470  return $clone;
471  }

◆ withInstantFeedbackPointsEnabled()

ilObjTestSettingsQuestionBehaviour::withInstantFeedbackPointsEnabled ( bool  $instant_feedback_points_enabled)

Definition at line 456 of file ilObjTestSettingsQuestionBehaviour.php.

456  : self
457  {
458  $clone = clone $this;
459  $clone->instant_feedback_points_enabled = $instant_feedback_points_enabled;
460  return $clone;
461  }

◆ withInstantFeedbackSolutionEnabled()

ilObjTestSettingsQuestionBehaviour::withInstantFeedbackSolutionEnabled ( bool  $instant_feedback_solution_enabled)

Definition at line 486 of file ilObjTestSettingsQuestionBehaviour.php.

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

◆ withInstantFeedbackSpecificEnabled()

ilObjTestSettingsQuestionBehaviour::withInstantFeedbackSpecificEnabled ( bool  $instant_feedback_specific_enabled)

Definition at line 476 of file ilObjTestSettingsQuestionBehaviour.php.

476  : self
477  {
478  $clone = clone $this;
479  $clone->instant_feedback_specific_enabled = $instant_feedback_specific_enabled;
480  return $clone;
481  }

◆ withLockAnswerOnInstantFeedbackEnabled()

ilObjTestSettingsQuestionBehaviour::withLockAnswerOnInstantFeedbackEnabled ( bool  $lock_answer_on_instant_feedback)

Definition at line 536 of file ilObjTestSettingsQuestionBehaviour.php.

536  : self
537  {
538  $clone = clone $this;
539  $clone->lock_answer_on_instant_feedback = $lock_answer_on_instant_feedback;
540  return $clone;
541  }

◆ withLockAnswerOnNextQuestionEnabled()

ilObjTestSettingsQuestionBehaviour::withLockAnswerOnNextQuestionEnabled ( bool  $lock_answer_on_next_question)

Definition at line 542 of file ilObjTestSettingsQuestionBehaviour.php.

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

◆ withQuestionHintsEnabled()

ilObjTestSettingsQuestionBehaviour::withQuestionHintsEnabled ( bool  $question_hints_enabled)

Definition at line 445 of file ilObjTestSettingsQuestionBehaviour.php.

445  : self
446  {
447  $clone = clone $this;
448  $clone->question_hints_enabled = $question_hints_enabled;
449  return $clone;
450  }

◆ withQuestionTitleOutputMode()

ilObjTestSettingsQuestionBehaviour::withQuestionTitleOutputMode ( int  $question_title_output_mode)

Definition at line 401 of file ilObjTestSettingsQuestionBehaviour.php.

Referenced by ilObjTestSettingsMainGUI\getQuestionBehaviourSettingsForStorage().

401  : self
402  {
403  $clone = clone $this;
404  $clone->question_title_output_mode = $question_title_output_mode;
405  return $clone;
406  }
+ Here is the caller graph for this function:

◆ withShuffleQuestions()

ilObjTestSettingsQuestionBehaviour::withShuffleQuestions ( bool  $shuffle_questions)

Definition at line 434 of file ilObjTestSettingsQuestionBehaviour.php.

434  : self
435  {
436  $clone = clone $this;
437  $clone->shuffle_questions = $shuffle_questions;
438  return $clone;
439  }

Field Documentation

◆ ANSWER_FIXATION_NONE

const ilObjTestSettingsQuestionBehaviour::ANSWER_FIXATION_NONE = 'none'

Definition at line 32 of file ilObjTestSettingsQuestionBehaviour.php.

◆ ANSWER_FIXATION_ON_FOLLOWUP_QUESTION

const ilObjTestSettingsQuestionBehaviour::ANSWER_FIXATION_ON_FOLLOWUP_QUESTION = 'followup_question'

Definition at line 34 of file ilObjTestSettingsQuestionBehaviour.php.

◆ ANSWER_FIXATION_ON_IFB_OR_FUQST

const ilObjTestSettingsQuestionBehaviour::ANSWER_FIXATION_ON_IFB_OR_FUQST = 'ifb_or_fuqst'

Definition at line 35 of file ilObjTestSettingsQuestionBehaviour.php.

◆ ANSWER_FIXATION_ON_INSTANT_FEEDBACK

const ilObjTestSettingsQuestionBehaviour::ANSWER_FIXATION_ON_INSTANT_FEEDBACK = 'instant_feedback'

Definition at line 33 of file ilObjTestSettingsQuestionBehaviour.php.

◆ DEFAULT_AUTOSAVE_INTERVAL

const ilObjTestSettingsQuestionBehaviour::DEFAULT_AUTOSAVE_INTERVAL = 30000
private

Definition at line 30 of file ilObjTestSettingsQuestionBehaviour.php.


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