19 declare(strict_types=1);
44 private readonly \
ilObjUser $current_user,
52 return self::ACTION_ID;
57 return $this->test_obj->getEnableProcessingTime()
58 && $this->test_access->checkManageParticipantsAccess();
67 return $this->ui_factory->table()->action()->standard(
68 $this->
lng->txt(self::ACTION_ID),
78 array $selected_participants,
79 bool $all_participants_selected
87 sprintf($this->
lng->txt(
'already_added_extra_time'), $participant->
getExtraTime())
89 $selected_participants
92 return $this->ui_factory->modal()->roundtrip(
93 $this->
lng->txt(
'extratime'),
95 $this->ui_factory->messageBox()->info(
97 $this->resolveInfoMessage(
98 $selected_participants,
99 $all_participants_selected,
100 $has_different_extra_time
104 $this->ui_factory->listing()->unordered($participant_rows)
107 'extra_time' => $this->ui_factory->input()->field()->numeric(
108 $this->
lng->txt(
'extratime')
109 )->withRequired(
true)
110 ->withAdditionalTransformation($this->
refinery->int()->isGreaterThan(0))
113 $this->
lng->txt(
'extra_time_byline')
116 $url_builder->
buildURI()->__toString()
117 )->withSubmitLabel($this->
lng->txt(
'add'));
123 array $selected_participants,
124 bool $all_participants_selected
126 if (!$this->test_access->checkManageParticipantsAccess()) {
127 $this->tpl->setOnScreenMessage(
129 $this->
lng->txt(
'no_permission'),
136 $selected_participants,
137 $all_participants_selected
138 )->withRequest($request);
140 $data = $modal->getData();
142 return $modal->withOnLoad($modal->getShowSignal());
147 $this->tpl->setOnScreenMessage(
149 $this->
lng->txt(
'extratime_added'),
161 array $selected_participants,
162 bool $all_participants_selected,
163 bool $has_different_extra_time
165 if ($all_participants_selected) {
166 return 'extra_time_for_all_participants';
169 if (count($selected_participants) === 1) {
170 return 'extra_time_for_single_participant';
172 if ($has_different_extra_time) {
173 return 'extra_time_for_selected_participants_different';
176 return 'extra_time_for_selected_participants';
195 foreach ($participants as $participant) {
196 $this->participant_repository->updateExtraTime($participant->withAddedExtraTime($minutes));
199 if ($this->test_obj->getTestLogger()->isLoggingEnabled()) {
200 $this->test_obj->getTestLogger()->logTestAdministrationInteraction(
201 $this->test_obj->getTestLogger()->getInteractionFactory()->buildTestAdministrationInteraction(
202 $this->test_obj->getRefId(),
203 $this->current_user->getId(),
204 TestAdministrationInteractionTypes::EXTRA_TIME_ADDED,
This describes commonalities between the different modals.
TestAdministrationInteractionTypes
buildURI()
Get a URI representation of the full URL including query string and fragment/hash.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const MESSAGE_TYPE_SUCCESS
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
withParameter(URLBuilderToken $token, string|array $value)
Change an acquired parameter's value if the supplied token is valid.
const MESSAGE_TYPE_FAILURE