19declare(strict_types=1);
29use Psr\Http\Message\ServerRequestInterface;
34 private readonly UIFactory $ui_factory,
46 $input_factory = $this->ui_factory->input();
49 'name' => $input_factory->field()->text($this->
lng->txt(
'title'))
50 ->withLabel($this->
lng->txt(
'title'))
52 'author' => $input_factory->field()->text($this->
lng->txt(
'author'))
54 ->withValue($this->
user->getFullname()),
55 'description' => $input_factory->field()->textarea($this->
lng->txt(
'description')),
58 $explanation = $this->ui_factory->messageBox()->info(
59 $this->
lng->txt(
'personal_settings_explanation')
62 return $this->ui_factory->modal()->roundtrip(
63 $this->
lng->txt(
'personal_settings_create'),
67 )->withSubmitLabel($this->
lng->txt(
'personal_settings_save'));
70 public function perform(
int $test_id, ServerRequestInterface $request): void
80 throw new \InvalidArgumentException(
'personal_settings_required_title');
84 throw new \InvalidArgumentException(
'personal_settings_required_author');
91 $data[
'description'] ??
'',
96 $this->main_settings_repository->store(
97 $this->main_settings_repository->getFor($test_id)->withId($template->getSettingsId())
99 $this->score_settings_repository->store(
100 $this->score_settings_repository->getFor($test_id)->withId($template->getSettingsId())
104 $mark_schema = $this->marks_repository->getMarkSchemaFor($test_id);
105 $mark_ids = $this->marks_repository->storeMarkSchema($mark_schema->withTestId(-1));
106 $this->
repository->associateMarkSteps($template->getId(), $mark_ids);
Builds a Color from either hex- or rgb values.
__construct(private readonly UIFactory $ui_factory, private readonly Language $lng, private readonly \ilObjUser $user, private readonly PersonalSettingsRepository $repository, private readonly MainSettingsRepository $main_settings_repository, private readonly ScoreSettingsRepository $score_settings_repository, private readonly MarksRepository $marks_repository,)
perform(int $test_id, ServerRequestInterface $request)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...