ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ()
 
 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->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
244 $action = $this->ctrl->getFormAction($this, self::CMD_SAVE_AMEND);
245 $this->ctrl->clearParameterByClass(self::class, 'usr_id');
246
247 $this->setToolbar();
248 $form = $this->buildForm($action, true, true);
249 $this->tpl->setContent($this->renderer->render($form));
250 }
buildForm(string $form_action, bool $may_be_edited, bool $amend=false)

References buildForm(), getExaminee(), 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 290 of file class.ilIndividualAssessmentMemberGUI.php.

295 $section = $this->getMember()->getGrading()->toFormInput(
296 $this->input_factory->field(),
297 $this->lng,
298 $this->refinery_factory,
299 $this->getPossibleLPStates(),
300 $may_be_edited,
301 (bool) $this->getObject()->getSettings()->isEventTimePlaceRequired(),
302 $amend,
303 $this
304 );
305
306 $form = $this->input_factory->container()->form()->standard($form_action, [$section]);
307 $form = $form->withAdditionalTransformation(
308 $this->refinery_factory->custom()->transformation(
309 function ($values) use ($amend) {
310 return array_shift($values);
311 }
312 )
313 );
314 return $form;
315 }
$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 554 of file class.ilIndividualAssessmentMemberGUI.php.

555 {
556 $storage = $this->getUserFileStorage();
557 $storage->deleteCurrentFile();
558 }

◆ downloadFile()

ilIndividualAssessmentMemberGUI::downloadFile ( )
protected

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

253 {
254 $path = $this->getUserFileStorage()->getFilePath();
255 $file_name = $this->getMember()->fileName();
256 ilUtil::deliverFile($path, $file_name);
257 }
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->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
195 $action = $this->ctrl->getFormAction($this, 'update');
196 $this->ctrl->clearParameterByClass(self::class, 'usr_id');
197
198 $this->setToolbar();
199 $form = $this->buildForm($action, true);
200 $this->tpl->setContent($this->renderer->render($form));
201 }

References buildForm(), getExaminee(), 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 317 of file class.ilIndividualAssessmentMemberGUI.php.

317 : void
318 {
319 if (!$this->mayBeEdited()) {
320 $this->handleAccessViolation();
321 return;
322 }
323
324 $member = $this->getMember();
325 if (!$member->mayBeFinalized()) {
326 ilUtil::sendFailure($this->lng->txt('iass_may_not_finalize'), true);
327 $this->redirect('edit');
328 return;
329 }
330
331 try {
332 $grading = $member->getGrading()->withFinalized(true);
333 $member = $member->withGrading($grading);
334 $this->getObject()->membersStorage()->updateMember($member);
336 ilUtil::sendFailure($e->getMessage(), true);
337 $this->redirect('edit');
338 return;
339 }
340
341 if ($this->object->isActiveLP()) {
343 }
344
345 try {
346 $member->maybeSendNotification($this->notificator);
348 ilUtil::sendFailure($e->getMessage(), true);
349 $this->redirect('edit');
350 return;
351 }
352
353 ilUtil::sendSuccess($this->lng->txt('iass_membership_finalized'), true);
354 $this->redirect('view');
355 }
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 357 of file class.ilIndividualAssessmentMemberGUI.php.

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

References $message.

◆ getAccessHandler()

ilIndividualAssessmentMemberGUI::getAccessHandler ( )
protected

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

607 {
608 if (is_null($this->iass_access)) {
609 $this->iass_access = $this->getObject()->accessHandler();
610 }
611 return $this->iass_access;
612 }

◆ getExaminee()

ilIndividualAssessmentMemberGUI::getExaminee ( )
protected

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

615 {
616 return new ilObjUser($_GET['usr_id']);
617 }
$_GET["client_id"]

References $_GET.

Referenced by amend(), and edit().

+ Here is the caller graph for this function:

◆ getExistingFileInfoURL()

ilIndividualAssessmentMemberGUI::getExistingFileInfoURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

521 : string
522 {
523 $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
524 $link = $this->ctrl->getLinkTarget($this, self::CMD_INFO);
525 $this->ctrl->setParameter($this, 'usr_id', null);
526
527 return $link;
528 }

◆ getFileIdentifierParameterName()

ilIndividualAssessmentMemberGUI::getFileIdentifierParameterName ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

501 : string
502 {
503 return 'iass';
504 }

◆ getFileName()

ilIndividualAssessmentMemberGUI::getFileName ( )
protected

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

560 : ?string
561 {
562 $path = $this->getFilePath();
563 if (is_null($path)) {
564 return null;
565 }
566
567 return end(explode('/', $path));
568 }

◆ getFilePath()

ilIndividualAssessmentMemberGUI::getFilePath ( )
protected

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

570 : ?string
571 {
572 $storage = $this->getUserFileStorage();
573 if ($storage->isEmpty()) {
574 return null;
575 }
576
577 return $storage->getFilePath();
578 }

◆ getFileRemovalURL()

ilIndividualAssessmentMemberGUI::getFileRemovalURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

533 : string
534 {
535 $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
536 $this->ctrl->setParameter($this, $this->getFileIdentifierParameterName(), $this->getFileName());
537 $link = $this->ctrl->getLinkTarget($this, self::CMD_REMOVE);
538 $this->ctrl->setParameter($this, 'usr_id', null);
539 $this->ctrl->setParameter($this, $this->getFileIdentifierParameterName(), null);
540
541 return $link;
542 }

◆ getInfoForExistingFiles()

ilIndividualAssessmentMemberGUI::getInfoForExistingFiles ( array  $file_ids)

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

468 : array
469 {
470 $name = $this->getFileName();
471
472 $ids = array_filter($file_ids, function ($id) {
473 if ($id == "") {
474 return false;
475 }
476 return true;
477 });
478
479 if (is_null($name) || count($ids) === 0) {
480 return [];
481 }
482
483 if (!in_array($name, $file_ids)) {
484 throw new LogicException("Wrong filename " . $this->getFileName());
485 }
486
487 return [
490 "identifier",
491 $name,
492 64,
493 ''
494 )
495 ];
496 }
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 448 of file class.ilIndividualAssessmentMemberGUI.php.

449 {
450 $filename = $this->getFileName();
451 if ($filename != $identifier) {
452 throw new LogicException("Wrong filename $identifier");
453 }
454
455 $file_size = filesize($this->getFilePath());
456 return new BasicFileInfoResult(
458 $identifier,
459 $filename,
460 $file_size,
461 pathinfo($filename, PATHINFO_EXTENSION)
462 );
463 }
$filename
Definition: buildRTE.php:89

References $filename.

◆ getMember()

ilIndividualAssessmentMemberGUI::getMember ( )
protected

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

627 {
628 return $this->getObject()->membersStorage()->loadMember(
629 $this->getObject(),
630 $this->getExaminee()
631 );
632 }
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 591 of file class.ilIndividualAssessmentMemberGUI.php.

592 {
593 return $this->object;
594 }
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 601 of file class.ilIndividualAssessmentMemberGUI.php.

602 {
603 return $this->parent_gui;
604 }
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 427 of file class.ilIndividualAssessmentMemberGUI.php.

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

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

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

References $message, and $result.

◆ getUploadURL()

ilIndividualAssessmentMemberGUI::getUploadURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

509 : string
510 {
511 $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
512 $link = $this->ctrl->getLinkTarget($this, self::CMD_UPLOAD);
513 $this->ctrl->setParameter($this, 'usr_id', null);
514
515 return $link;
516 }

◆ getUserFileStorage()

ilIndividualAssessmentMemberGUI::getUserFileStorage ( )
protected

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

620 {
621 $storage = $this->getObject()->getFileStorage();
622 $storage->setUserId($this->getExaminee()->getId());
623 return $storage;
624 }
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 696 of file class.ilIndividualAssessmentMemberGUI.php.

697 {
698 $this->error_object->raiseError($this->txt("msg_no_perm_read"), $this->error_object->WARNING);
699 }

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

+ Here is the caller graph for this function:

◆ isFinalized()

ilIndividualAssessmentMemberGUI::isFinalized ( )
protected

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

691 : bool
692 {
693 return $this->getMember()->finalized();
694 }

◆ mayBeAmended()

ilIndividualAssessmentMemberGUI::mayBeAmended ( )
protected

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

647 : bool
648 {
649 return $this->getAccessHandler()->isSystemAdmin() || (!$this->isFinalized() && $this->userMayGrade());
650 }

Referenced by edit().

+ Here is the caller graph for this function:

◆ mayBeViewed()

ilIndividualAssessmentMemberGUI::mayBeViewed ( )
protected

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

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

Referenced by view().

+ Here is the caller graph for this function:

◆ redirect()

ilIndividualAssessmentMemberGUI::redirect ( string  $cmd)
protected

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

580 : void
581 {
582 $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
583 $this->ctrl->redirect($this, $cmd);
584 }

Referenced by saveAmend().

+ Here is the caller graph for this function:

◆ saveAmend()

ilIndividualAssessmentMemberGUI::saveAmend ( )
protected

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

260 {
261 if (!$this->mayBeAmended()) {
262 $this->handleAccessViolation();
263 return;
264 }
265
266 $form = $this
267 ->buildForm($this->ctrl->getFormAction($this, self::CMD_AMEND), true, true)
268 ->withRequest($this->request)
269 ;
270
271 $grading = $form->getData();
272
273 if (!is_null($grading)) {
274 if ($grading->getFile() == '') {
275 $storage = $this->getUserFileStorage();
276 $storage->deleteCurrentFile();
277 }
278
279 $this->saveMember($grading, true, true);
280
281 if ($this->getObject()->isActiveLP()) {
283 }
284
285 ilUtil::sendSuccess($this->lng->txt('iass_amend_saved'), true);
286 $this->redirect(self::CMD_AMEND);
287 }
288 }
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 380 of file class.ilIndividualAssessmentMemberGUI.php.

384 : void {
385 $member = $this->getMember()
386 ->withGrading($grading)
387 ;
388
389 if ($amend) {
390 $member = $member->withChangerId($this->user->getId());
391 }
392
393 if (!$keep_examiner) {
394 $member = $member->withExaminerId($this->user->getId());
395 }
396 $this->getObject()->membersStorage()->updateMember($member);
397 }

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

586 : void
587 {
588 $this->object = $object;
589 }

◆ setParentGUI()

ilIndividualAssessmentMemberGUI::setParentGUI ( ilIndividualAssessmentMembersGUI  $parent_gui)

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

596 : void
597 {
598 $this->parent_gui = $parent_gui;
599 }

◆ setToolbar()

ilIndividualAssessmentMemberGUI::setToolbar ( )
protected

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

635 {
636 $member = $this->getMember();
637 if ($member->fileName() != '') {
639 $btn->setCaption('download_assessment_paper');
640 $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
641 $btn->setUrl($this->ctrl->getLinkTarget($this, self::CMD_DOWNLOAD_FILE, false, true));
642 $this->ctrl->setParameter($this, 'usr_id', null);
643 $this->toolbar->addButtonInstance($btn);
644 }
645 }
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 683 of file class.ilIndividualAssessmentMemberGUI.php.

683 : bool
684 {
685 return
686 (int) $member->examinerId() !== (int) $this->user->getId() &&
687 0 !== (int) $member->examinerId()
688 ;
689 }

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

+ Here is the call graph for this function:

◆ uploadFile()

ilIndividualAssessmentMemberGUI::uploadFile ( UploadResult  $result)
protected

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

544 : string
545 {
546 $storage = $this->getUserFileStorage();
547 $storage->create();
548 $storage->deleteCurrentFile();
549 $storage->uploadFile($result);
550
551 return $result->getName();
552 }

References $result.

◆ userMayAmend()

ilIndividualAssessmentMemberGUI::userMayAmend ( )
protected

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

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

◆ userMayGrade()

ilIndividualAssessmentMemberGUI::userMayGrade ( )
protected

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

665 : bool
666 {
667 return
668 $this->getAccessHandler()->isSystemAdmin() ||
669 (!$this->targetWasEditedByOtherUser($this->getMember()) && $this->getAccessHandler()->mayGradeUser())
670 ;
671 }
targetWasEditedByOtherUser(ilIndividualAssessmentMember $member)

◆ userMayView()

ilIndividualAssessmentMemberGUI::userMayView ( )
protected

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

673 : bool
674 {
675 return $this->getAccessHandler()->isSystemAdmin() || $this->getAccessHandler()->mayViewUser();
676 }

◆ 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: