ILIAS  release_7 Revision v7.30-3-g800a261c036
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)
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getInfoForExistingFiles (array $file_ids)
 @inheritDoc More...
 
 getFileIdentifierParameterName ()
 @inheritDoc More...
 
 getUploadURL ()
 @inheritDoc More...
 
 getExistingFileInfoURL ()
 @inheritDoc More...
 
 getFileRemovalURL ()
 @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...
 
 getInfoForExistingFiles (array $file_ids)
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getFileIdentifierParameterName ()
 
 getUploadURL ()
 
 getFileRemovalURL ()
 
 getExistingFileInfoURL ()
 
 getInfoForExistingFiles (array $file_ids)
 

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)
 
 getInfoResult (string $identifier)
 @inheritDoc More...
 
 uploadFile (UploadResult $result)
 
 deleteFile ()
 
 getFileName ()
 
 getFilePath ()
 
 redirect (string $cmd)
 
 getObject ()
 
 getAccessHandler ()
 
 getExaminee ()
 
 getUserFileStorage ()
 
 getMember ()
 
 setToolbar ()
 
 mayBeEdited ()
 
 mayBeViewed ()
 
 mayBeAmended ()
 
 userMayGrade ()
 
 userMayView ()
 
 userMayAmend ()
 
 targetWasEditedByOtherUser (ilIndividualAssessmentMember $member)
 
 isFinalized ()
 
 getUploadResult ()
 
 getRemoveResult (string $identifier)
 
 getInfoResult (string $identifier)
 

Protected Attributes

 $ctrl
 
 $lng
 
 $tpl
 
 $user
 
 $input_factory
 
 $messagebox_factory
 
 $button_factory
 
 $refinery_factory
 
 $data_factory
 
 $renderer
 
 $request
 
 $object
 
 $parent_gui
 
 $iass_access
 
 $notificator
 
 $toolbar
 
 $error_object
 
- Protected Attributes inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
const CMD_UPLOAD = 'upload'
 
const CMD_REMOVE = 'remove'
 
const CMD_INFO = 'info'
 
 $http
 
 $ctrl
 
 $upload
 

Detailed Description

Definition at line 20 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 
)

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

132 {
134
135 $this->ctrl = $ctrl;
136 $this->lng = $lng;
137 $this->tpl = $tpl;
138 $this->user = $user;
139 $this->input_factory = $input_factory;
140 $this->messagebox_factory = $messagebox_factory;
141 $this->button_factory = $button_factory;
142 $this->refinery_factory = $refinery_factory;
143 $this->data_factory = $data_factory;
144 $this->renderer = $renderer;
145 $this->request = $request;
146 $this->notificator = $notificator;
147 $this->toolbar = $toolbar;
148 $this->object = $object;
149 $this->error_object = $error_object;
150 }
user()
Definition: user.php:4
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $button_factory, $ctrl, $data_factory, $error_object, $input_factory, $lng, $messagebox_factory, $notificator, $object, $refinery_factory, $renderer, $request, $toolbar, $tpl, $user, ILIAS\GlobalScreen\Provider\__construct(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ amend()

ilIndividualAssessmentMemberGUI::amend ( )
protected

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

237 {
238 if (!$this->mayBeAmended()) {
239 $this->handleAccessViolation();
240 return;
241 }
242
243 $this->setToolbar();
244 $form = $this->buildForm($this->getFormActionForCommand(self::CMD_SAVE_AMEND), true, true);
245 $this->tpl->setContent($this->renderer->render($form));
246 }
buildForm(string $form_action, bool $may_be_edited, bool $amend=false)

References buildForm(), getFormActionForCommand(), handleAccessViolation(), 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 295 of file class.ilIndividualAssessmentMemberGUI.php.

300 $section = $this->getMember()->getGrading()->toFormInput(
301 $this->input_factory->field(),
302 $this->data_factory,
303 $this->lng,
304 $this->refinery_factory,
305 $this->getPossibleLPStates(),
306 $may_be_edited,
307 (bool) $this->getObject()->getSettings()->isEventTimePlaceRequired(),
308 $amend,
309 $this
310 );
311
312 $form = $this->input_factory->container()->form()->standard($form_action, [$section]);
313 $form = $form->withAdditionalTransformation(
314 $this->refinery_factory->custom()->transformation(
315 function ($values) use ($amend) {
316 return array_shift($values);
317 }
318 )
319 );
320 return $form;
321 }
$section
Definition: Utf8Test.php:83
This describes commonalities between all forms.
Definition: Form.php:16

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

+ Here is the caller graph for this function:

◆ deleteFile()

ilIndividualAssessmentMemberGUI::deleteFile ( )
protected

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

561 {
562 $storage = $this->getUserFileStorage();
563 $storage->deleteCurrentFile();
564 }

◆ downloadFile()

ilIndividualAssessmentMemberGUI::downloadFile ( )
protected

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

258 {
259 $path = $this->getUserFileStorage()->getFilePath();
260 $file_name = $this->getMember()->fileName();
261 ilUtil::deliverFile($path, $file_name);
262 }
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.

References ilUtil\deliverFile(), getMember(), and getUserFileStorage().

+ Here is the call graph for this function:

◆ edit()

ilIndividualAssessmentMemberGUI::edit ( )
protected

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

188 {
189 if (!$this->mayBeEdited()) {
190 $this->handleAccessViolation();
191 return;
192 }
193
194 $this->setToolbar();
195 $form = $this->buildForm($this->getFormActionForCommand(self::CMD_UPDATE), true);
196 $this->tpl->setContent($this->renderer->render($form));
197 }

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 152 of file class.ilIndividualAssessmentMemberGUI.php.

152 : void
153 {
154 $cmd = $this->ctrl->getCmd();
155
156 switch ($cmd) {
157 case self::CMD_VIEW:
158 case self::CMD_UPDATE:
159 case self::CMD_EDIT:
162 case self::CMD_AMEND:
165 $this->$cmd();
166 break;
167 case AbstractCtrlAwareUploadHandler::CMD_UPLOAD:
168 case AbstractCtrlAwareUploadHandler::CMD_REMOVE:
169 case AbstractCtrlAwareUploadHandler::CMD_INFO:
170 parent::executeCommand();
171 break;
172 default:
173 throw new LogicException("Unknown command $cmd");
174 }
175 }

References CMD_AMEND, CMD_DOWNLOAD_FILE, CMD_EDIT, CMD_FINALIZE, CMD_FINALIZE_CONFIRMATION, CMD_SAVE_AMEND, CMD_UPDATE, and CMD_VIEW.

◆ finalize()

ilIndividualAssessmentMemberGUI::finalize ( )
protected

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

323 : void
324 {
325 if (!$this->mayBeEdited()) {
326 $this->handleAccessViolation();
327 return;
328 }
329
330 $member = $this->getMember();
331 if (!$member->mayBeFinalized()) {
332 ilUtil::sendFailure($this->lng->txt('iass_may_not_finalize'), true);
333 $this->redirect('edit');
334 return;
335 }
336
337 try {
338 $grading = $member->getGrading()->withFinalized(true);
339 $member = $member->withGrading($grading);
340 $this->getObject()->membersStorage()->updateMember($member);
342 ilUtil::sendFailure($e->getMessage(), true);
343 $this->redirect('edit');
344 return;
345 }
346
347 if ($this->object->isActiveLP()) {
349 }
350
351 try {
352 $member->maybeSendNotification($this->notificator);
354 ilUtil::sendFailure($e->getMessage(), true);
355 $this->redirect('edit');
356 return;
357 }
358
359 ilUtil::sendSuccess($this->lng->txt('iass_membership_finalized'), true);
360 $this->redirect('view');
361 }
static updateLPStatusOfMember(ilIndividualAssessmentMember $member)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References Vendor\Package\$e, ilUtil\sendFailure(), and ilIndividualAssessmentLPInterface\updateLPStatusOfMember().

+ Here is the call graph for this function:

◆ finalizeConfirmation()

ilIndividualAssessmentMemberGUI::finalizeConfirmation ( )
protected

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

364 {
365 if (!$this->mayBeEdited()) {
366 $this->handleAccessViolation();
367 return;
368 }
369
370 $message = $this->lng->txt('iass_finalize_user_qst');
371 $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
372 $finalize = $this->ctrl->getFormActionByClass(self::class, self::CMD_FINALIZE);
373 $cancel = $this->ctrl->getFormActionByClass(self::class, self::CMD_EDIT);
374 $this->ctrl->clearParameterByClass(self::class, 'usr_id');
375
376 $buttons = [
377 $this->button_factory->standard($this->lng->txt('iass_confirm_finalize'), $finalize),
378 $this->button_factory->standard($this->lng->txt('iass_cancel'), $cancel)
379 ];
380
381 $message_box = $this->messagebox_factory->confirmation($message)->withButtons($buttons);
382
383 $this->tpl->setContent($this->renderer->render($message_box));
384 }
$message
Definition: xapiexit.php:14

References $message.

◆ getAccessHandler()

ilIndividualAssessmentMemberGUI::getAccessHandler ( )
protected

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

613 {
614 if (is_null($this->iass_access)) {
615 $this->iass_access = $this->getObject()->accessHandler();
616 }
617 return $this->iass_access;
618 }

◆ getExaminee()

ilIndividualAssessmentMemberGUI::getExaminee ( )
protected

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

621 {
622 return new ilObjUser($_GET['usr_id']);
623 }
$_GET["client_id"]

References $_GET.

Referenced by getFormActionForCommand().

+ Here is the caller graph for this function:

◆ getExistingFileInfoURL()

ilIndividualAssessmentMemberGUI::getExistingFileInfoURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

527 : string
528 {
529 $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
530 $link = $this->ctrl->getLinkTarget($this, self::CMD_INFO);
531 $this->ctrl->setParameter($this, 'usr_id', null);
532
533 return $link;
534 }

◆ getFileIdentifierParameterName()

ilIndividualAssessmentMemberGUI::getFileIdentifierParameterName ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

507 : string
508 {
509 return 'iass';
510 }

◆ getFileName()

ilIndividualAssessmentMemberGUI::getFileName ( )
protected

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

566 : ?string
567 {
568 $path = $this->getFilePath();
569 if (is_null($path)) {
570 return null;
571 }
572
573 return end(explode('/', $path));
574 }

◆ getFilePath()

ilIndividualAssessmentMemberGUI::getFilePath ( )
protected

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

576 : ?string
577 {
578 $storage = $this->getUserFileStorage();
579 if ($storage->isEmpty()) {
580 return null;
581 }
582
583 return $storage->getFilePath();
584 }

◆ getFileRemovalURL()

ilIndividualAssessmentMemberGUI::getFileRemovalURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

539 : string
540 {
541 $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
542 $this->ctrl->setParameter($this, $this->getFileIdentifierParameterName(), $this->getFileName());
543 $link = $this->ctrl->getLinkTarget($this, self::CMD_REMOVE);
544 $this->ctrl->setParameter($this, 'usr_id', null);
545 $this->ctrl->setParameter($this, $this->getFileIdentifierParameterName(), null);
546
547 return $link;
548 }

◆ getFormActionForCommand()

ilIndividualAssessmentMemberGUI::getFormActionForCommand ( string  $cmd)
protected

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

248 : string
249 {
250 $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
251 $action = $this->ctrl->getFormAction($this, $cmd);
252 $this->ctrl->clearParameterByClass(self::class, 'usr_id');
253
254 return $action;
255 }

References getExaminee().

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)

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

474 : array
475 {
476 $name = $this->getFileName();
477
478 $ids = array_filter($file_ids, function ($id) {
479 if ($id == "") {
480 return false;
481 }
482 return true;
483 });
484
485 if (is_null($name) || count($ids) === 0) {
486 return [];
487 }
488
489 if (!in_array($name, $file_ids)) {
490 throw new LogicException("Wrong filename " . $this->getFileName());
491 }
492
493 return [
496 "identifier",
497 $name,
498 64,
499 ''
500 )
501 ];
502 }
if($format !==null) $name
Definition: metadata.php:230

References $name.

◆ getInfoResult()

ilIndividualAssessmentMemberGUI::getInfoResult ( string  $identifier)
protected

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

455 {
456 $filename = $this->getFileName();
457 if ($filename != $identifier) {
458 throw new LogicException("Wrong filename $identifier");
459 }
460
461 $file_size = filesize($this->getFilePath());
462 return new BasicFileInfoResult(
464 $identifier,
465 $filename,
466 $file_size,
467 pathinfo($filename, PATHINFO_EXTENSION)
468 );
469 }
$filename
Definition: buildRTE.php:89

References $filename.

◆ getMember()

ilIndividualAssessmentMemberGUI::getMember ( )
protected

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

633 {
634 return $this->getObject()->membersStorage()->loadMember(
635 $this->getObject(),
636 $this->getExaminee()
637 );
638 }
Edit the record of a user, set LP.

Referenced by downloadFile(), and saveAmend().

+ Here is the caller graph for this function:

◆ getObject()

ilIndividualAssessmentMemberGUI::getObject ( )
protected

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

598 {
599 return $this->object;
600 }
For the purpose of streamlining the grading and learning-process status definition outside of tests,...

Referenced by saveAmend().

+ Here is the caller graph for this function:

◆ getParentGUI()

ilIndividualAssessmentMemberGUI::getParentGUI ( )

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

608 {
609 return $this->parent_gui;
610 }
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 433 of file class.ilIndividualAssessmentMemberGUI.php.

434 {
435 $status = HandlerResult::STATUS_FAILED;
436 $message = $this->lng->txt('iass_file_deleted');
437
438 if ($this->getFileName() == $identifier) {
439 $this->deleteFile();
440 $member = $this->getMember();
441 $grading = $member->getGrading()->withFile(null);
442 $member = $member->withGrading($grading);
443 $this->getObject()->membersStorage()->updateMember($member);
444 $status = HandlerResult::STATUS_OK;
445 $message = 'File Deleted';
446 }
447
448 return new BasicHandlerResult($this->getFileIdentifierParameterName(), $status, $identifier, $message);
449 }

References $message, and ilIndividualAssessmentUserGrading\withFile().

+ Here is the call graph for this function:

◆ getUploadResult()

ilIndividualAssessmentMemberGUI::getUploadResult ( )
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

415 {
416 $this->upload->process();
417 $array = $this->upload->getResults();
418 $result = end($array);
419
420 if ($result instanceof UploadResult && $result->isOK()) {
421 $identifier = $this->uploadFile($result);
422 $status = HandlerResult::STATUS_OK;
423 $message = 'Upload ok';
424 } else {
425 $status = HandlerResult::STATUS_FAILED;
426 $identifier = '';
427 $message = $result->getStatus()->getMessage();
428 }
429
430 return new BasicHandlerResult($this->getFileIdentifierParameterName(), $status, $identifier, $message);
431 }
$result

References $message, and $result.

◆ getUploadURL()

ilIndividualAssessmentMemberGUI::getUploadURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

515 : string
516 {
517 $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
518 $link = $this->ctrl->getLinkTarget($this, self::CMD_UPLOAD);
519 $this->ctrl->setParameter($this, 'usr_id', null);
520
521 return $link;
522 }

◆ getUserFileStorage()

ilIndividualAssessmentMemberGUI::getUserFileStorage ( )
protected

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

626 {
627 $storage = $this->getObject()->getFileStorage();
628 $storage->setUserId($this->getExaminee()->getId());
629 return $storage;
630 }
Handles the fileupload and folder creation for files uploaded in grading form.

References 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 702 of file class.ilIndividualAssessmentMemberGUI.php.

703 {
704 $this->error_object->raiseError($this->txt("msg_no_perm_read"), $this->error_object->WARNING);
705 }

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

+ Here is the caller graph for this function:

◆ isFinalized()

ilIndividualAssessmentMemberGUI::isFinalized ( )
protected

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

697 : bool
698 {
699 return $this->getMember()->finalized();
700 }

◆ mayBeAmended()

ilIndividualAssessmentMemberGUI::mayBeAmended ( )
protected

Definition at line 666 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 653 of file class.ilIndividualAssessmentMemberGUI.php.

653 : bool
654 {
655 return $this->getAccessHandler()->isSystemAdmin() || (!$this->isFinalized() && $this->userMayGrade());
656 }

Referenced by edit().

+ Here is the caller graph for this function:

◆ mayBeViewed()

ilIndividualAssessmentMemberGUI::mayBeViewed ( )
protected

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

658 : bool
659 {
660 return
661 $this->getAccessHandler()->isSystemAdmin() ||
662 ($this->isFinalized() && ($this->userMayGrade() || $this->userMayView()))
663 ;
664 }

Referenced by view().

+ Here is the caller graph for this function:

◆ redirect()

ilIndividualAssessmentMemberGUI::redirect ( string  $cmd)
protected

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

586 : void
587 {
588 $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
589 $this->ctrl->redirect($this, $cmd);
590 }

Referenced by saveAmend().

+ Here is the caller graph for this function:

◆ saveAmend()

ilIndividualAssessmentMemberGUI::saveAmend ( )
protected

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

265 {
266 if (!$this->mayBeAmended()) {
267 $this->handleAccessViolation();
268 return;
269 }
270
271 $form = $this
272 ->buildForm($this->ctrl->getFormAction($this, self::CMD_AMEND), true, true)
273 ->withRequest($this->request)
274 ;
275
276 $grading = $form->getData();
277
278 if (!is_null($grading)) {
279 if ($grading->getFile() == '') {
280 $storage = $this->getUserFileStorage();
281 $storage->deleteCurrentFile();
282 }
283
284 $this->saveMember($grading, true, true);
285
286 if ($this->getObject()->isActiveLP()) {
288 }
289
290 ilUtil::sendSuccess($this->lng->txt('iass_amend_saved'), true);
291 $this->redirect(self::CMD_AMEND);
292 }
293 }
saveMember(ilIndividualAssessmentUserGrading $grading, bool $keep_examiner=false, bool $amend=false)

References getMember(), getObject(), getUserFileStorage(), handleAccessViolation(), mayBeAmended(), redirect(), 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 386 of file class.ilIndividualAssessmentMemberGUI.php.

390 : void {
391 $member = $this->getMember()
392 ->withGrading($grading)
393 ;
394
395 if ($amend) {
396 $member = $member->withChangerId($this->user->getId());
397 }
398
399 if (!$keep_examiner) {
400 $member = $member->withExaminerId($this->user->getId());
401 }
402 $this->getObject()->membersStorage()->updateMember($member);
403 }

References 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 592 of file class.ilIndividualAssessmentMemberGUI.php.

592 : void
593 {
594 $this->object = $object;
595 }

◆ setParentGUI()

ilIndividualAssessmentMemberGUI::setParentGUI ( ilIndividualAssessmentMembersGUI  $parent_gui)

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

602 : void
603 {
604 $this->parent_gui = $parent_gui;
605 }

◆ setToolbar()

ilIndividualAssessmentMemberGUI::setToolbar ( )
protected

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

641 {
642 $member = $this->getMember();
643 if ($member->fileName() != '') {
645 $btn->setCaption('download_assessment_paper');
646 $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
647 $btn->setUrl($this->ctrl->getLinkTarget($this, self::CMD_DOWNLOAD_FILE, false, true));
648 $this->ctrl->setParameter($this, 'usr_id', null);
649 $this->toolbar->addButtonInstance($btn);
650 }
651 }
static getInstance()
Factory.

References ilLinkButton\getInstance().

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 689 of file class.ilIndividualAssessmentMemberGUI.php.

689 : bool
690 {
691 return
692 (int) $member->examinerId() !== (int) $this->user->getId() &&
693 0 !== (int) $member->examinerId()
694 ;
695 }

References ilIndividualAssessmentMember\examinerId(), and user().

+ Here is the call graph for this function:

◆ uploadFile()

ilIndividualAssessmentMemberGUI::uploadFile ( UploadResult  $result)
protected

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

550 : string
551 {
552 $storage = $this->getUserFileStorage();
553 $storage->create();
554 $storage->deleteCurrentFile();
555 $storage->uploadFile($result);
556
557 return $storage->getFileName();
558 }

References $result.

◆ userMayAmend()

ilIndividualAssessmentMemberGUI::userMayAmend ( )
protected

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

684 : bool
685 {
686 return $this->getAccessHandler()->isSystemAdmin() || $this->getAccessHandler()->mayAmendGradeUser();
687 }

◆ userMayGrade()

ilIndividualAssessmentMemberGUI::userMayGrade ( )
protected

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

671 : bool
672 {
673 return
674 $this->getAccessHandler()->isSystemAdmin() ||
675 (!$this->targetWasEditedByOtherUser($this->getMember()) && $this->getAccessHandler()->mayGradeUser())
676 ;
677 }
targetWasEditedByOtherUser(ilIndividualAssessmentMember $member)

◆ userMayView()

ilIndividualAssessmentMemberGUI::userMayView ( )
protected

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

679 : bool
680 {
681 return $this->getAccessHandler()->isSystemAdmin() || $this->getAccessHandler()->mayViewUser();
682 }

◆ view()

ilIndividualAssessmentMemberGUI::view ( )
protected

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

178 {
179 if (!$this->mayBeViewed()) {
180 $this->handleAccessViolation();
181 return;
182 }
183 $form = $this->buildForm('', false);
184 $this->tpl->setContent($this->renderer->render($form));
185 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $button_factory

ilIndividualAssessmentMemberGUI::$button_factory
protected

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

Referenced by __construct().

◆ $ctrl

ilIndividualAssessmentMemberGUI::$ctrl
protected

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

Referenced by __construct().

◆ $data_factory

ilIndividualAssessmentMemberGUI::$data_factory
protected

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

Referenced by __construct().

◆ $error_object

ilIndividualAssessmentMemberGUI::$error_object
protected

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

Referenced by __construct().

◆ $iass_access

ilIndividualAssessmentMemberGUI::$iass_access
protected

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

◆ $input_factory

ilIndividualAssessmentMemberGUI::$input_factory
protected

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

Referenced by __construct().

◆ $lng

ilIndividualAssessmentMemberGUI::$lng
protected

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

Referenced by __construct().

◆ $messagebox_factory

ilIndividualAssessmentMemberGUI::$messagebox_factory
protected

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

Referenced by __construct().

◆ $notificator

ilIndividualAssessmentMemberGUI::$notificator
protected

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

Referenced by __construct().

◆ $object

ilIndividualAssessmentMemberGUI::$object
protected

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

Referenced by __construct().

◆ $parent_gui

ilIndividualAssessmentMemberGUI::$parent_gui
protected

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

◆ $refinery_factory

ilIndividualAssessmentMemberGUI::$refinery_factory
protected

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

Referenced by __construct().

◆ $renderer

ilIndividualAssessmentMemberGUI::$renderer
protected

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

Referenced by __construct().

◆ $request

ilIndividualAssessmentMemberGUI::$request
protected

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

Referenced by __construct().

◆ $toolbar

ilIndividualAssessmentMemberGUI::$toolbar
protected

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

Referenced by __construct().

◆ $tpl

ilIndividualAssessmentMemberGUI::$tpl
protected

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

Referenced by __construct().

◆ $user

ilIndividualAssessmentMemberGUI::$user
protected

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

Referenced by __construct().

◆ CMD_AMEND

const ilIndividualAssessmentMemberGUI::CMD_AMEND = 'amend'

Definition at line 27 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 23 of file class.ilIndividualAssessmentMemberGUI.php.

Referenced by executeCommand().

◆ CMD_FINALIZE

const ilIndividualAssessmentMemberGUI::CMD_FINALIZE = 'finalize'

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

Referenced by executeCommand().

◆ CMD_FINALIZE_CONFIRMATION

const ilIndividualAssessmentMemberGUI::CMD_FINALIZE_CONFIRMATION = 'finalizeConfirmation'

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

Referenced by executeCommand().

◆ CMD_SAVE_AMEND

const ilIndividualAssessmentMemberGUI::CMD_SAVE_AMEND = "saveAmend"

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

Referenced by executeCommand().

◆ CMD_UPDATE

const ilIndividualAssessmentMemberGUI::CMD_UPDATE = 'update'

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

Referenced by executeCommand().

◆ CMD_VIEW

const ilIndividualAssessmentMemberGUI::CMD_VIEW = 'view'

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

Referenced by executeCommand().


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