4declare(strict_types=1);
6use \ILIAS\UI\Component\Input\Field;
7use \ILIAS\Refinery\Factory as Refinery;
107 return !empty($this->file);
142 $clone = clone $this;
143 $clone->finalized = $finalize;
149 $clone = clone $this;
150 $clone->file =
$file;
158 array $grading_options,
159 bool $may_be_edited =
true,
160 bool $place_required =
false,
165 ->text(
$lng->txt(
'name'),
'')
171 ->textarea(
$lng->txt(
'iass_record'),
$lng->txt(
'iass_record_info'))
173 ->withDisabled(!$may_be_edited)
177 ->textarea(
$lng->txt(
'iass_internal_note'),
$lng->txt(
'iass_internal_note_info'))
179 ->withDisabled(!$may_be_edited)
183 ->file($file_handler,
$lng->txt(
'iass_upload_file'),
$lng->txt(
'iass_file_dropzone'))
187 $file_visible = $input
188 ->checkbox(
$lng->txt(
'iass_file_visible_examinee'))
190 ->withDisabled(!$may_be_edited)
194 ->select(
$lng->txt(
'grading'), $grading_options)
196 ->withDisabled(!$may_be_edited)
201 ->text(
$lng->txt(
'iass_place'))
203 ->withRequired($place_required)
204 ->withDisabled(!$may_be_edited)
208 ->dateTime(
$lng->txt(
'iass_event_time'))
209 ->withRequired($place_required)
210 ->withDisabled(!$may_be_edited)
218 ->checkbox(
$lng->txt(
'iass_notify'),
$lng->txt(
'iass_notify_explanation'))
220 ->withDisabled(!$may_be_edited)
228 'file_visible' => $file_visible,
237 ->checkbox(
$lng->txt(
'iass_finalize'),
$lng->txt(
'iass_finalize_info'))
239 ->withDisabled(!$may_be_edited)
245 return $input->section(
247 $lng->txt(
'iass_edit_record')
248 )->withAdditionalTransformation(
249 $refinery->custom()->transformation(function ($values) use ($amend) {
257 isset($values[
'file'][0]) &&
258 trim($values[
'file'][0]) !=
''
260 $file = $values[
'file'][0];
266 $values[
'internal_note'],
268 $values[
'file_visible'],
269 (
int) $values[
'learning_progress'],
271 $values[
'event_time'],
An exception for terminatinating execution or to throw for unit testing.
withFinalized(bool $finalize)
__construct(string $name, string $record, string $internal_note, ?string $file, bool $is_file_visible, int $learning_progress, string $place, ?DateTimeImmutable $event_time, bool $notify, bool $finalized=false)
toFormInput(Field\Factory $input, \ilLanguage $lng, Refinery $refinery, array $grading_options, bool $may_be_edited=true, bool $place_required=false, bool $amend=false, ilIndividualAssessmentMemberGUI $file_handler)