19declare(strict_types=1);
28 private readonly UIFactory $ui_factory,
29 private readonly RefineryFactory
$refinery,
31 private readonly
ilCtrl $ctrl
37 return $this->ui_factory->modal()->roundtrip(
41 $this->
ctrl->getFormActionByClass([ilObjTestGUI::class, ilTestCorrectionsGUI::class],
'addAnswer')
47 $to_int_trafo = $this->
refinery->kindlyTo()->int();
48 $fix_points_trafo = $this->
refinery->custom()->transformation(
50 $v = str_replace(
',',
'.', $v);
61 $inputs[
'question_id'] = $this->ui_factory->input()->field()->hidden()
62 ->withAdditionalTransformation($to_int_trafo)
63 ->withValue((
string) (
$data[
'question_id'] ??
''));
64 $inputs[
'question_index'] = $this->ui_factory->input()->field()->hidden()
65 ->withAdditionalTransformation($to_int_trafo)
66 ->withValue((
string) (
$data[
'question_index'] ??
''));
67 $inputs[
'answer_value'] = $this->ui_factory->input()->field()->hidden($this->
language->txt(
'answer'))
69 $inputs[
'answer'] = $this->ui_factory->input()->field()->text($this->
language->txt(
'answer'))
72 $inputs[
'points'] = $this->ui_factory->input()->field()->text($this->
language->txt(
'points'))
Builds a Color from either hex- or rgb values.
Class ilCtrl provides processing control methods.