ILIAS  release_8 Revision v8.24
ilIndividualAssessmentMemberGUI Class Reference
+ Inheritance diagram for ilIndividualAssessmentMemberGUI:
+ Collaboration diagram for ilIndividualAssessmentMemberGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilLanguage $lng, ilGlobalPageTemplate $tpl, ilObjUser $user, Input\Factory $input_factory, MessageBox\Factory $messagebox_factory, Button\Factory $button_factory, Refinery\Factory $refinery_factory, Data\Factory $data_factory, Renderer $renderer, ServerRequest $request, ilIndividualAssessmentPrimitiveInternalNotificator $notificator, ilToolbarGUI $toolbar, ilObjIndividualAssessment $object, ilErrorHandling $error_object, ILIAS\Refinery\Factory $refinery, ILIAS\HTTP\Wrapper\RequestWrapper $request_wrapper, ilIndividualAssessmentDateFormatter $date_formatter)
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
 getFileIdentifierParameterName ()
 @inheritDoc More...
 
 getUploadURL ()
 @inheritDoc More...
 
 getExistingFileInfoURL ()
 @inheritDoc More...
 
 setObject (ilObjIndividualAssessment $object)
 
 setParentGUI (ilIndividualAssessmentMembersGUI $parent_gui)
 
 getParentGUI ()
 
 handleAccessViolation ()
 
- Public Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 __construct ()
 ilUIDemoFileUploadHandlerGUI constructor. More...
 
 getFileIdentifierParameterName ()
 @inheritDoc More...
 
 getUploadURL ()
 @inheritDoc More...
 
 getExistingFileInfoURL ()
 @inheritDoc More...
 
 getFileRemovalURL ()
 @inheritDoc More...
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
 supportsChunkedUploads ()
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getFileIdentifierParameterName ()
 
 getUploadURL ()
 
 getFileRemovalURL ()
 
 getExistingFileInfoURL ()
 
 getInfoForExistingFiles (array $file_ids)
 
 getInfoResult (string $identifier)
 
 supportsChunkedUploads ()
 

Data Fields

const CMD_VIEW = 'view'
 
const CMD_EDIT = 'edit'
 
const CMD_UPDATE = 'update'
 
const CMD_FINALIZE = 'finalize'
 
const CMD_FINALIZE_CONFIRMATION = 'finalizeConfirmation'
 
const CMD_AMEND = 'amend'
 
const CMD_SAVE_AMEND = "saveAmend"
 
const CMD_DOWNLOAD_FILE = "downloadFile"
 
- Data Fields inherited from ILIAS\UI\Component\Input\Field\UploadHandler
const DEFAULT_FILE_ID_PARAMETER = 'file_id'
 

Protected Member Functions

 view ()
 
 edit ()
 
 amend ()
 
 getFormActionForCommand (string $cmd)
 
 downloadFile ()
 
 saveAmend ()
 
 buildForm (string $form_action, bool $may_be_edited, bool $amend=false)
 
 finalize ()
 
 finalizeConfirmation ()
 
 saveMember (ilIndividualAssessmentUserGrading $grading, bool $keep_examiner=false, bool $amend=false)
 
 getPossibleLPStates ()
 
 getUploadResult ()
 
 getRemoveResult (string $identifier)
 
 redirect (string $cmd)
 
 getObject ()
 
 getAccessHandler ()
 
 getExaminee ()
 
 getUserFileStorage ()
 
 getMember ()
 
 setToolbar ()
 
 mayBeEdited ()
 
 mayBeViewed ()
 
 mayBeAmended ()
 
 userMayGrade ()
 
 userMayView ()
 
 userMayAmend ()
 
 targetWasEditedByOtherUser (ilIndividualAssessmentMember $member)
 
 isFinalized ()
 
- Protected Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 readChunkedInformation ()
 
 getUploadResult ()
 
 getRemoveResult (string $identifier)
 

Protected Attributes

ilLanguage $lng
 
ilGlobalPageTemplate $tpl
 
ilObjUser $user
 
Input Factory $input_factory
 
MessageBox Factory $messagebox_factory
 
Button Factory $button_factory
 
Refinery Factory $refinery_factory
 
Data Factory $data_factory
 
Renderer $renderer
 
ServerRequest $request
 
ilObjIndividualAssessment $object
 
ilIndividualAssessmentMembersGUI $parent_gui
 
ilIndividualAssessmentAccessHandler $iass_access = null
 
ilIndividualAssessmentPrimitiveInternalNotificator $notificator
 
ilToolbarGUI $toolbar
 
ilErrorHandling $error_object
 
ILIAS Refinery Factory $refinery
 
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
 
ilIndividualAssessmentDateFormatter $date_formatter
 
- Protected Attributes inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
const CMD_UPLOAD = 'upload'
 
const CMD_REMOVE = 'remove'
 
const CMD_INFO = 'info'
 
HttpServices $http
 
ilCtrl $ctrl
 
FileUpload $upload
 
bool $is_chunked = false
 
int $chunk_index = 0
 
int $amount_of_chunks = 0
 
string $chunk_id = null
 
int $chunk_total_size = 0
 

Detailed Description

Definition at line 35 of file class.ilIndividualAssessmentMemberGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilIndividualAssessmentMemberGUI::__construct ( ilCtrl  $ctrl,
ilLanguage  $lng,
ilGlobalPageTemplate  $tpl,
ilObjUser  $user,
Input\Factory  $input_factory,
MessageBox\Factory  $messagebox_factory,
Button\Factory  $button_factory,
Refinery\Factory  $refinery_factory,
Data\Factory  $data_factory,
Renderer  $renderer,
ServerRequest  $request,
ilIndividualAssessmentPrimitiveInternalNotificator  $notificator,
ilToolbarGUI  $toolbar,
ilObjIndividualAssessment  $object,
ilErrorHandling  $error_object,
ILIAS\Refinery\Factory  $refinery,
ILIAS\HTTP\Wrapper\RequestWrapper  $request_wrapper,
ilIndividualAssessmentDateFormatter  $date_formatter 
)

Definition at line 66 of file class.ilIndividualAssessmentMemberGUI.php.

85 {
87
88 $this->ctrl = $ctrl;
89 $this->lng = $lng;
90 $this->tpl = $tpl;
91 $this->user = $user;
92 $this->input_factory = $input_factory;
93 $this->messagebox_factory = $messagebox_factory;
94 $this->button_factory = $button_factory;
95 $this->refinery_factory = $refinery_factory;
96 $this->data_factory = $data_factory;
97 $this->renderer = $renderer;
98 $this->request = $request;
99 $this->notificator = $notificator;
100 $this->toolbar = $toolbar;
101 $this->object = $object;
102 $this->error_object = $error_object;
103 $this->refinery = $refinery;
104 $this->request_wrapper = $request_wrapper;
105 $this->date_formatter = $date_formatter;
106 }
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
ilIndividualAssessmentDateFormatter $date_formatter
ilIndividualAssessmentPrimitiveInternalNotificator $notificator
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $button_factory, ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\$ctrl, $data_factory, $date_formatter, $error_object, $input_factory, $lng, $messagebox_factory, $notificator, $object, $refinery, $refinery_factory, $renderer, $request, $request_wrapper, $toolbar, $tpl, $user, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ amend()

ilIndividualAssessmentMemberGUI::amend ( )
protected

Definition at line 189 of file class.ilIndividualAssessmentMemberGUI.php.

189 : void
190 {
191 if (!$this->mayBeAmended()) {
192 $this->handleAccessViolation();
193 return;
194 }
195
196 $this->setToolbar();
197 $form = $this->buildForm($this->getFormActionForCommand(self::CMD_SAVE_AMEND), true, true);
198 $form->withSubmitCaption($this->lng->txt("save_amend"));
199 $this->tpl->setContent($this->renderer->render($form));
200 }
buildForm(string $form_action, bool $may_be_edited, bool $amend=false)

References buildForm(), getFormActionForCommand(), handleAccessViolation(), ILIAS\Repository\lng(), mayBeAmended(), and setToolbar().

+ Here is the call graph for this function:

◆ buildForm()

ilIndividualAssessmentMemberGUI::buildForm ( string  $form_action,
bool  $may_be_edited,
bool  $amend = false 
)
protected

Definition at line 247 of file class.ilIndividualAssessmentMemberGUI.php.

252 $date_format = $this->date_formatter->getUserDateFormat($this->user, false);
253
254 $section = $this->getMember()->getGrading()->toFormInput(
255 $this->input_factory->field(),
256 $this->data_factory,
257 $this->lng,
258 $this->refinery_factory,
259 $this,
260 $date_format,
261 $this->getPossibleLPStates(),
262 $may_be_edited,
263 $this->getObject()->getSettings()->isEventTimePlaceRequired(),
264 $amend
265 );
266
267 $form = $this->input_factory->container()->form()->standard($form_action, [$section]);
268 return $form->withAdditionalTransformation(
269 $this->refinery_factory->custom()->transformation(
270 function ($values) use ($amend) {
271 return array_shift($values);
272 }
273 )
274 );
275 }
static return function(ContainerConfigurator $containerConfigurator)
Definition: basic_rector.php:9
This describes commonalities between all forms.
Definition: Form.php:33

Referenced by amend(), edit(), and view().

+ Here is the caller graph for this function:

◆ downloadFile()

ilIndividualAssessmentMemberGUI::downloadFile ( )
protected

Definition at line 211 of file class.ilIndividualAssessmentMemberGUI.php.

211 : void
212 {
213 $path = $this->getUserFileStorage()->getAbsolutePath();
214 $file_name = $this->getMember()->fileName();
215 ilFileDelivery::deliverFileLegacy($path . "/" . $file_name, $file_name);
216 }
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
$path
Definition: ltiservices.php:32

References $path, ilFileDelivery\deliverFileLegacy(), getMember(), and getUserFileStorage().

+ Here is the call graph for this function:

◆ edit()

ilIndividualAssessmentMemberGUI::edit ( )
protected

Definition at line 143 of file class.ilIndividualAssessmentMemberGUI.php.

143 : void
144 {
145 if (!$this->mayBeEdited()) {
146 $this->handleAccessViolation();
147 return;
148 }
149
150 $this->setToolbar();
151 $form = $this->buildForm($this->getFormActionForCommand(self::CMD_UPDATE), true);
152 $this->tpl->setContent($this->renderer->render($form));
153 }

References buildForm(), getFormActionForCommand(), handleAccessViolation(), mayBeEdited(), and setToolbar().

+ Here is the call graph for this function:

◆ executeCommand()

ilIndividualAssessmentMemberGUI::executeCommand ( )

Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented.

The Implementation MUST make sure, the Upload and the Removal Command are handled correctly

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 108 of file class.ilIndividualAssessmentMemberGUI.php.

108 : void
109 {
110 $cmd = $this->ctrl->getCmd();
111
112 switch ($cmd) {
113 case self::CMD_VIEW:
114 case self::CMD_UPDATE:
115 case self::CMD_EDIT:
118 case self::CMD_AMEND:
121 $this->$cmd();
122 break;
123 case AbstractCtrlAwareUploadHandler::CMD_UPLOAD:
124 case AbstractCtrlAwareUploadHandler::CMD_REMOVE:
125 case AbstractCtrlAwareUploadHandler::CMD_INFO:
126 parent::executeCommand();
127 break;
128 default:
129 throw new LogicException("Unknown command $cmd");
130 }
131 }

References CMD_AMEND, CMD_DOWNLOAD_FILE, CMD_EDIT, CMD_FINALIZE, CMD_FINALIZE_CONFIRMATION, CMD_SAVE_AMEND, CMD_UPDATE, CMD_VIEW, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ finalize()

ilIndividualAssessmentMemberGUI::finalize ( )
protected

Definition at line 277 of file class.ilIndividualAssessmentMemberGUI.php.

277 : void
278 {
279 if (!$this->mayBeEdited()) {
280 $this->handleAccessViolation();
281 return;
282 }
283
284 $member = $this->getMember();
285 if (!$member->mayBeFinalized()) {
286 $this->tpl->setOnScreenMessage("failure", $this->lng->txt('iass_may_not_finalize'), true);
287 $this->redirect('edit');
288 return;
289 }
290
291 try {
292 $grading = $member->getGrading()->withFinalized(true);
293 $member = $member->withGrading($grading);
294 $this->getObject()->membersStorage()->updateMember($member);
296 $this->tpl->setOnScreenMessage("failure", $e->getMessage(), true);
297 $this->redirect('edit');
298 return;
299 }
300
301 if ($this->object->isActiveLP()) {
303 }
304
305 try {
306 $member->maybeSendNotification($this->notificator);
307 $this->ctrl->redirectByClass(ilIndividualAssessmentMembersGUI::class, 'view');
309 $this->tpl->setOnScreenMessage("failure", $e->getMessage(), true);
310 $this->redirect('edit');
311 return;
312 }
313
314 $this->tpl->setOnScreenMessage("success", $this->lng->txt('iass_membership_finalized'), true);
315 $this->redirect('view');
316 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static updateLPStatusOfMember(ilIndividualAssessmentMember $member)

References Vendor\Package\$e, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilIndividualAssessmentLPInterface\updateLPStatusOfMember().

+ Here is the call graph for this function:

◆ finalizeConfirmation()

ilIndividualAssessmentMemberGUI::finalizeConfirmation ( )
protected

Definition at line 318 of file class.ilIndividualAssessmentMemberGUI.php.

318 : void
319 {
320 if (!$this->mayBeEdited()) {
321 $this->handleAccessViolation();
322 return;
323 }
324
325 $message = $this->lng->txt('iass_finalize_user_qst');
326 $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
327 $finalize = $this->ctrl->getFormActionByClass(self::class, self::CMD_FINALIZE);
328 $cancel = $this->ctrl->getFormActionByClass(self::class, self::CMD_EDIT);
329 $this->ctrl->clearParameterByClass(self::class, 'usr_id');
330
331 $buttons = [
332 $this->button_factory->standard($this->lng->txt('iass_confirm_finalize'), $finalize),
333 $this->button_factory->standard($this->lng->txt('iass_cancel'), $cancel)
334 ];
335
336 $message_box = $this->messagebox_factory->confirmation($message)->withButtons($buttons);
337
338 $this->tpl->setContent($this->renderer->render($message_box));
339 }
$message
Definition: xapiexit.php:32

References $message, ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getAccessHandler()

ilIndividualAssessmentMemberGUI::getAccessHandler ( )
protected

Definition at line 476 of file class.ilIndividualAssessmentMemberGUI.php.

477 {
478 if (is_null($this->iass_access)) {
479 $this->iass_access = $this->getObject()->accessHandler();
480 }
481 return $this->iass_access;
482 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilIndividualAssessmentAccessHandler $iass_access

◆ getExaminee()

ilIndividualAssessmentMemberGUI::getExaminee ( )
protected

Definition at line 484 of file class.ilIndividualAssessmentMemberGUI.php.

484 : ilObjUser
485 {
486 return new ilObjUser($this->request_wrapper->retrieve('usr_id', $this->refinery->kindlyTo()->int()));
487 }
User class.

Referenced by getFormActionForCommand().

+ Here is the caller graph for this function:

◆ getExistingFileInfoURL()

ilIndividualAssessmentMemberGUI::getExistingFileInfoURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 441 of file class.ilIndividualAssessmentMemberGUI.php.

441 : string
442 {
443 $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
444 $link = $this->ctrl->getLinkTarget($this, self::CMD_INFO);
445 $this->ctrl->setParameter($this, 'usr_id', null);
446
447 return $link;
448 }

References ILIAS\Repository\ctrl(), and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ getFileIdentifierParameterName()

ilIndividualAssessmentMemberGUI::getFileIdentifierParameterName ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 427 of file class.ilIndividualAssessmentMemberGUI.php.

427 : string
428 {
429 return 'iass';
430 }

◆ getFormActionForCommand()

ilIndividualAssessmentMemberGUI::getFormActionForCommand ( string  $cmd)
protected

Definition at line 202 of file class.ilIndividualAssessmentMemberGUI.php.

202 : string
203 {
204 $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
205 $action = $this->ctrl->getFormAction($this, $cmd);
206 $this->ctrl->clearParameterByClass(self::class, 'usr_id');
207
208 return $action;
209 }

References ILIAS\Repository\ctrl(), getExaminee(), and ILIAS\Survey\Mode\getId().

Referenced by amend(), and edit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInfoForExistingFiles()

ilIndividualAssessmentMemberGUI::getInfoForExistingFiles ( array  $file_ids)
Parameters
array$file_ids
Returns
BasicFileInfoResult[]

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 412 of file class.ilIndividualAssessmentMemberGUI.php.

412 : array
413 {
414 $file_ids = array_filter($file_ids, fn ($id) => $id !== "");
415 $path = $this->getUserFileStorage()->getAbsolutePath();
416 return array_map(function ($id) use ($path) {
417 return new BasicFileInfoResult(
419 $id,
420 $id,
421 filesize($path . "/" . $id),
422 pathinfo($path . "/" . $id, PATHINFO_EXTENSION)
423 );
424 }, $file_ids);
425 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id, and $path.

◆ getInfoResult()

ilIndividualAssessmentMemberGUI::getInfoResult ( string  $identifier)
Returns
null|FileInfoResult for the file with the given identifier or null if the file does not exist.

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 399 of file class.ilIndividualAssessmentMemberGUI.php.

400 {
401 $storage = $this->getUserFileStorage();
402 $path = $storage->getAbsolutePath() . "/" . $identifier;
403 return new BasicFileInfoResult(
405 $identifier,
406 $identifier,
407 filesize($path),
408 pathinfo($path, PATHINFO_EXTENSION)
409 );
410 }

References $path.

◆ getMember()

ilIndividualAssessmentMemberGUI::getMember ( )
protected

Definition at line 496 of file class.ilIndividualAssessmentMemberGUI.php.

497 {
498 return $this->getObject()->membersStorage()->loadMember(
499 $this->getObject(),
500 $this->getExaminee()
501 );
502 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by downloadFile(), and saveAmend().

+ Here is the caller graph for this function:

◆ getObject()

ilIndividualAssessmentMemberGUI::getObject ( )
protected

Definition at line 461 of file class.ilIndividualAssessmentMemberGUI.php.

462 {
463 return $this->object;
464 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by saveAmend().

+ Here is the caller graph for this function:

◆ getParentGUI()

ilIndividualAssessmentMemberGUI::getParentGUI ( )

Definition at line 471 of file class.ilIndividualAssessmentMemberGUI.php.

472 {
473 return $this->parent_gui;
474 }
For the purpose of streamlining the grading and learning-process status definition outside of tests,...

◆ getPossibleLPStates()

ilIndividualAssessmentMemberGUI::getPossibleLPStates ( )
protected

◆ getRemoveResult()

ilIndividualAssessmentMemberGUI::getRemoveResult ( string  $identifier)
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 391 of file class.ilIndividualAssessmentMemberGUI.php.

392 {
393 $status = HandlerResult::STATUS_OK;
394 $message = $this->lng->txt('iass_file_deleted');
395
396 return new BasicHandlerResult($this->getFileIdentifierParameterName(), $status, $identifier, $message);
397 }

References $message, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getUploadResult()

ilIndividualAssessmentMemberGUI::getUploadResult ( )
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 369 of file class.ilIndividualAssessmentMemberGUI.php.

370 {
371 $this->upload->process();
372 $array = $this->upload->getResults();
373 $result = end($array);
374
375 $storage = $this->getUserFileStorage();
376 $storage->create();
377
378 if ($result instanceof UploadResult && $result->isOK()) {
379 $identifier = $storage->uploadFile($result);
380 $status = HandlerResult::STATUS_OK;
381 $message = 'Upload ok';
382 } else {
383 $status = HandlerResult::STATUS_FAILED;
384 $identifier = '';
385 $message = $result->getStatus()->getMessage();
386 }
387
388 return new BasicHandlerResult($this->getFileIdentifierParameterName(), $status, $identifier, $message);
389 }

References $message, ILIAS\FileUpload\DTO\UploadResult\isOK(), and ILIAS\Repository\upload().

+ Here is the call graph for this function:

◆ getUploadURL()

ilIndividualAssessmentMemberGUI::getUploadURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 432 of file class.ilIndividualAssessmentMemberGUI.php.

432 : string
433 {
434 $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
435 $link = $this->ctrl->getLinkTarget($this, self::CMD_UPLOAD);
436 $this->ctrl->setParameter($this, 'usr_id', null);
437
438 return $link;
439 }

References ILIAS\Repository\ctrl(), and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ getUserFileStorage()

ilIndividualAssessmentMemberGUI::getUserFileStorage ( )
protected

Definition at line 489 of file class.ilIndividualAssessmentMemberGUI.php.

490 {
491 $storage = $this->getObject()->getFileStorage();
492 $storage->setUserId($this->getExaminee()->getId());
493 return $storage;
494 }
Handles the file upload and folder creation for files uploaded in grading form.

References ILIAS\Survey\Mode\getId(), and ilIndividualAssessmentFileStorage\setUserId().

Referenced by downloadFile(), and saveAmend().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleAccessViolation()

ilIndividualAssessmentMemberGUI::handleAccessViolation ( )

Definition at line 566 of file class.ilIndividualAssessmentMemberGUI.php.

566 : void
567 {
568 $this->error_object->raiseError($this->lng->txt("msg_no_perm_read"), $this->error_object->WARNING);
569 }

References ILIAS\Repository\lng().

Referenced by amend(), edit(), saveAmend(), and view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isFinalized()

ilIndividualAssessmentMemberGUI::isFinalized ( )
protected

Definition at line 561 of file class.ilIndividualAssessmentMemberGUI.php.

561 : bool
562 {
563 return $this->getMember()->finalized();
564 }

◆ mayBeAmended()

ilIndividualAssessmentMemberGUI::mayBeAmended ( )
protected

Definition at line 530 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by amend(), and saveAmend().

+ Here is the caller graph for this function:

◆ mayBeEdited()

ilIndividualAssessmentMemberGUI::mayBeEdited ( )
protected

Definition at line 517 of file class.ilIndividualAssessmentMemberGUI.php.

517 : bool
518 {
519 return $this->getAccessHandler()->isSystemAdmin() || (!$this->isFinalized() && $this->userMayGrade());
520 }

Referenced by edit().

+ Here is the caller graph for this function:

◆ mayBeViewed()

ilIndividualAssessmentMemberGUI::mayBeViewed ( )
protected

Definition at line 522 of file class.ilIndividualAssessmentMemberGUI.php.

522 : bool
523 {
524 return
525 $this->getAccessHandler()->isSystemAdmin() ||
526 ($this->isFinalized() && ($this->userMayGrade() || $this->userMayView()))
527 ;
528 }

Referenced by view().

+ Here is the caller graph for this function:

◆ redirect()

ilIndividualAssessmentMemberGUI::redirect ( string  $cmd)
protected

Definition at line 450 of file class.ilIndividualAssessmentMemberGUI.php.

450 : void
451 {
452 $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
453 $this->ctrl->redirect($this, $cmd);
454 }

References ILIAS\Repository\ctrl(), and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ saveAmend()

ilIndividualAssessmentMemberGUI::saveAmend ( )
protected

Definition at line 218 of file class.ilIndividualAssessmentMemberGUI.php.

218 : void
219 {
220 if (!$this->mayBeAmended()) {
221 $this->handleAccessViolation();
222 return;
223 }
224
225 $form = $this
226 ->buildForm($this->ctrl->getFormAction($this, self::CMD_AMEND), true, true)
227 ->withRequest($this->request)
228 ;
229
230 $grading = $form->getData();
231
232 if (!is_null($grading)) {
233 $this->saveMember($grading, true, true);
234
235 $storage = $this->getUserFileStorage();
236 $storage->deleteAllFilesBut($grading->getFile());
237
238 if ($this->getObject()->isActiveLP()) {
240 }
241
242 $this->tpl->setOnScreenMessage("success", $this->lng->txt('iass_amend_saved'), true);
243 $this->ctrl->redirectByClass(ilIndividualAssessmentMembersGUI::class, 'view');
244 }
245 }
saveMember(ilIndividualAssessmentUserGrading $grading, bool $keep_examiner=false, bool $amend=false)

References ILIAS\Repository\ctrl(), getMember(), getObject(), getUserFileStorage(), handleAccessViolation(), ILIAS\Repository\lng(), mayBeAmended(), saveMember(), and ilIndividualAssessmentLPInterface\updateLPStatusOfMember().

+ Here is the call graph for this function:

◆ saveMember()

ilIndividualAssessmentMemberGUI::saveMember ( ilIndividualAssessmentUserGrading  $grading,
bool  $keep_examiner = false,
bool  $amend = false 
)
protected

Definition at line 341 of file class.ilIndividualAssessmentMemberGUI.php.

345 : void {
346 $member = $this->getMember()
347 ->withGrading($grading)
348 ;
349
350 if ($amend) {
351 $member = $member->withChangerId($this->user->getId());
352 }
353
354 if (!$keep_examiner) {
355 $member = $member->withExaminerId($this->user->getId());
356 }
357 $this->getObject()->membersStorage()->updateMember($member);
358 }

References ILIAS\Repository\user().

Referenced by saveAmend().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setObject()

ilIndividualAssessmentMemberGUI::setObject ( ilObjIndividualAssessment  $object)

Definition at line 456 of file class.ilIndividualAssessmentMemberGUI.php.

456 : void
457 {
458 $this->object = $object;
459 }

◆ setParentGUI()

ilIndividualAssessmentMemberGUI::setParentGUI ( ilIndividualAssessmentMembersGUI  $parent_gui)

Definition at line 466 of file class.ilIndividualAssessmentMemberGUI.php.

466 : void
467 {
468 $this->parent_gui = $parent_gui;
469 }

◆ setToolbar()

ilIndividualAssessmentMemberGUI::setToolbar ( )
protected

Definition at line 504 of file class.ilIndividualAssessmentMemberGUI.php.

504 : void
505 {
506 $member = $this->getMember();
507 if ($member->fileName() != '') {
509 $btn->setCaption('download_assessment_paper');
510 $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
511 $btn->setUrl($this->ctrl->getLinkTarget($this, self::CMD_DOWNLOAD_FILE, "", false, true));
512 $this->ctrl->setParameter($this, 'usr_id', null);
513 $this->toolbar->addButtonInstance($btn);
514 }
515 }

References ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilLinkButton\getInstance(), and ILIAS\Repository\toolbar().

Referenced by amend(), and edit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ targetWasEditedByOtherUser()

ilIndividualAssessmentMemberGUI::targetWasEditedByOtherUser ( ilIndividualAssessmentMember  $member)
protected

Definition at line 553 of file class.ilIndividualAssessmentMemberGUI.php.

553 : bool
554 {
555 return
556 (int) $member->examinerId() !== $this->user->getId() &&
557 0 !== (int) $member->examinerId()
558 ;
559 }

References ilIndividualAssessmentMember\examinerId(), ILIAS\Repository\int(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ userMayAmend()

ilIndividualAssessmentMemberGUI::userMayAmend ( )
protected

Definition at line 548 of file class.ilIndividualAssessmentMemberGUI.php.

548 : bool
549 {
550 return $this->getAccessHandler()->mayAmendAllUsers();
551 }

◆ userMayGrade()

ilIndividualAssessmentMemberGUI::userMayGrade ( )
protected

Definition at line 535 of file class.ilIndividualAssessmentMemberGUI.php.

535 : bool
536 {
537 return
538 $this->getAccessHandler()->isSystemAdmin() ||
539 (!$this->targetWasEditedByOtherUser($this->getMember()) && $this->getAccessHandler()->mayGradeUser($this->getMember()->id()))
540 ;
541 }
targetWasEditedByOtherUser(ilIndividualAssessmentMember $member)

◆ userMayView()

ilIndividualAssessmentMemberGUI::userMayView ( )
protected

Definition at line 543 of file class.ilIndividualAssessmentMemberGUI.php.

543 : bool
544 {
545 return $this->getAccessHandler()->mayViewUser($this->getMember()->id());
546 }

◆ view()

ilIndividualAssessmentMemberGUI::view ( )
protected

Definition at line 133 of file class.ilIndividualAssessmentMemberGUI.php.

133 : void
134 {
135 if (!$this->mayBeViewed()) {
136 $this->handleAccessViolation();
137 return;
138 }
139 $form = $this->buildForm('', false);
140 $this->tpl->setContent($this->renderer->render($form));
141 }

References buildForm(), handleAccessViolation(), and mayBeViewed().

+ Here is the call graph for this function:

Field Documentation

◆ $button_factory

Button Factory ilIndividualAssessmentMemberGUI::$button_factory
protected

Definition at line 51 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $data_factory

Data Factory ilIndividualAssessmentMemberGUI::$data_factory
protected

Definition at line 53 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $date_formatter

ilIndividualAssessmentDateFormatter ilIndividualAssessmentMemberGUI::$date_formatter
protected

Definition at line 64 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $error_object

ilErrorHandling ilIndividualAssessmentMemberGUI::$error_object
protected

Definition at line 61 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $iass_access

ilIndividualAssessmentAccessHandler ilIndividualAssessmentMemberGUI::$iass_access = null
protected

Definition at line 58 of file class.ilIndividualAssessmentMemberGUI.php.

◆ $input_factory

Input Factory ilIndividualAssessmentMemberGUI::$input_factory
protected

Definition at line 49 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $lng

ilLanguage ilIndividualAssessmentMemberGUI::$lng
protected

Definition at line 46 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $messagebox_factory

MessageBox Factory ilIndividualAssessmentMemberGUI::$messagebox_factory
protected

Definition at line 50 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $notificator

ilIndividualAssessmentPrimitiveInternalNotificator ilIndividualAssessmentMemberGUI::$notificator
protected

Definition at line 59 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $object

ilObjIndividualAssessment ilIndividualAssessmentMemberGUI::$object
protected

Definition at line 56 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $parent_gui

ilIndividualAssessmentMembersGUI ilIndividualAssessmentMemberGUI::$parent_gui
protected

Definition at line 57 of file class.ilIndividualAssessmentMemberGUI.php.

◆ $refinery

ILIAS Refinery Factory ilIndividualAssessmentMemberGUI::$refinery
protected

Definition at line 62 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $refinery_factory

Refinery Factory ilIndividualAssessmentMemberGUI::$refinery_factory
protected

Definition at line 52 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $renderer

Renderer ilIndividualAssessmentMemberGUI::$renderer
protected

Definition at line 54 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $request

ServerRequest ilIndividualAssessmentMemberGUI::$request
protected

Definition at line 55 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $request_wrapper

ILIAS HTTP Wrapper RequestWrapper ilIndividualAssessmentMemberGUI::$request_wrapper
protected

Definition at line 63 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $toolbar

ilToolbarGUI ilIndividualAssessmentMemberGUI::$toolbar
protected

Definition at line 60 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $tpl

ilGlobalPageTemplate ilIndividualAssessmentMemberGUI::$tpl
protected

Definition at line 47 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ $user

ilObjUser ilIndividualAssessmentMemberGUI::$user
protected

Definition at line 48 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by __construct().

◆ CMD_AMEND

const ilIndividualAssessmentMemberGUI::CMD_AMEND = 'amend'

Definition at line 42 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by executeCommand().

◆ CMD_DOWNLOAD_FILE

const ilIndividualAssessmentMemberGUI::CMD_DOWNLOAD_FILE = "downloadFile"

◆ CMD_EDIT

const ilIndividualAssessmentMemberGUI::CMD_EDIT = 'edit'

Definition at line 38 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by executeCommand().

◆ CMD_FINALIZE

const ilIndividualAssessmentMemberGUI::CMD_FINALIZE = 'finalize'

Definition at line 40 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by executeCommand().

◆ CMD_FINALIZE_CONFIRMATION

const ilIndividualAssessmentMemberGUI::CMD_FINALIZE_CONFIRMATION = 'finalizeConfirmation'

Definition at line 41 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by executeCommand().

◆ CMD_SAVE_AMEND

const ilIndividualAssessmentMemberGUI::CMD_SAVE_AMEND = "saveAmend"

Definition at line 43 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by executeCommand().

◆ CMD_UPDATE

const ilIndividualAssessmentMemberGUI::CMD_UPDATE = 'update'

Definition at line 39 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by executeCommand().

◆ CMD_VIEW

const ilIndividualAssessmentMemberGUI::CMD_VIEW = 'view'

Definition at line 37 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by executeCommand().


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