ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 
 getFileIdentifierParameterName ()
 
 getUploadURL ()
 
 getExistingFileInfoURL ()
 
 getFileRemovalURL ()
 
 setObject (ilObjIndividualAssessment $object)
 
 setParentGUI (ilIndividualAssessmentMembersGUI $parent_gui)
 
 getParentGUI ()
 
 handleAccessViolation ()
 
- Public Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 __construct ()
 ilUIDemoFileUploadHandlerGUI constructor. More...
 
 getFileIdentifierParameterName ()
 
 getUploadURL ()
 
 getExistingFileInfoURL ()
 
 getFileRemovalURL ()
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 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)
 
 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 ()
 
- Protected Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 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.

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().

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)
+ Here is the call graph for this function:

Member Function Documentation

◆ amend()

ilIndividualAssessmentMemberGUI::amend ( )
protected

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

References buildForm(), getExaminee(), handleAccessViolation(), mayBeAmended(), and setToolbar().

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)
+ 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.

References $lng, $refinery_factory, $section, getMember(), getObject(), and getPossibleLPStates().

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

295  $section = $this->getMember()->getGrading()->toFormInput(
296  $this->input_factory->field(),
297  $this->lng,
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  }
This describes commonalities between all forms.
Definition: Form.php:15
$section
Definition: Utf8Test.php:83
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteFile()

ilIndividualAssessmentMemberGUI::deleteFile ( )
protected

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

References getUserFileStorage().

Referenced by getRemoveResult().

555  {
556  $storage = $this->getUserFileStorage();
557  $storage->deleteCurrentFile();
558  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ downloadFile()

ilIndividualAssessmentMemberGUI::downloadFile ( )
protected

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

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

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.
+ Here is the call graph for this function:

◆ edit()

ilIndividualAssessmentMemberGUI::edit ( )
protected

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

References buildForm(), finalizeConfirmation(), getExaminee(), getMember(), getObject(), getUserFileStorage(), handleAccessViolation(), mayBeEdited(), redirect(), saveMember(), setToolbar(), and ilIndividualAssessmentLPInterface\updateLPStatusOfMember().

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  }
buildForm(string $form_action, bool $may_be_edited, bool $amend=false)
+ 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

Implements ILIAS\FileUpload\Handler\ilCtrlAwareUploadHandler.

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:
160  case self::CMD_FINALIZE:
161  case self::CMD_FINALIZE_CONFIRMATION:
162  case self::CMD_AMEND:
163  case self::CMD_SAVE_AMEND:
164  case self::CMD_DOWNLOAD_FILE:
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  }

◆ finalize()

ilIndividualAssessmentMemberGUI::finalize ( )
protected

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

References Vendor\Package\$e, getMember(), getObject(), handleAccessViolation(), mayBeEdited(), redirect(), ilUtil\sendFailure(), and ilIndividualAssessmentLPInterface\updateLPStatusOfMember().

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);
347  } catch (ilIndividualAssessmentException $e) {
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.
+ Here is the call graph for this function:

◆ finalizeConfirmation()

ilIndividualAssessmentMemberGUI::finalizeConfirmation ( )
protected

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

References $message, getExaminee(), handleAccessViolation(), and mayBeEdited().

Referenced by edit().

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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAccessHandler()

ilIndividualAssessmentMemberGUI::getAccessHandler ( )
protected

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

References $iass_access, and getObject().

Referenced by mayBeAmended(), mayBeEdited(), mayBeViewed(), userMayAmend(), userMayGrade(), and userMayView().

607  {
608  if (is_null($this->iass_access)) {
609  $this->iass_access = $this->getObject()->accessHandler();
610  }
611  return $this->iass_access;
612  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExaminee()

ilIndividualAssessmentMemberGUI::getExaminee ( )
protected

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

References $_GET.

Referenced by amend(), edit(), finalizeConfirmation(), getExistingFileInfoURL(), getFileRemovalURL(), getMember(), getUploadURL(), getUserFileStorage(), redirect(), and setToolbar().

615  {
616  return new ilObjUser($_GET['usr_id']);
617  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getExistingFileInfoURL()

ilIndividualAssessmentMemberGUI::getExistingFileInfoURL ( )

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

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

References getExaminee().

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  }
+ Here is the call graph for this function:

◆ getFileIdentifierParameterName()

ilIndividualAssessmentMemberGUI::getFileIdentifierParameterName ( )

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

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

Referenced by getFileRemovalURL(), getInfoForExistingFiles(), getInfoResult(), getRemoveResult(), and getUploadResult().

501  : string
502  {
503  return 'iass';
504  }
+ Here is the caller graph for this function:

◆ getFileName()

ilIndividualAssessmentMemberGUI::getFileName ( )
protected

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

References getFilePath().

Referenced by getFileRemovalURL(), getInfoForExistingFiles(), getInfoResult(), and getRemoveResult().

560  : ?string
561  {
562  $path = $this->getFilePath();
563  if (is_null($path)) {
564  return null;
565  }
566 
567  return end(explode('/', $path));
568  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFilePath()

ilIndividualAssessmentMemberGUI::getFilePath ( )
protected

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

References getUserFileStorage().

Referenced by getFileName(), and getInfoResult().

570  : ?string
571  {
572  $storage = $this->getUserFileStorage();
573  if ($storage->isEmpty()) {
574  return null;
575  }
576 
577  return $storage->getFilePath();
578  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFileRemovalURL()

ilIndividualAssessmentMemberGUI::getFileRemovalURL ( )

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

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

References getExaminee(), getFileIdentifierParameterName(), and getFileName().

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  }
+ Here is the call graph for this function:

◆ getInfoForExistingFiles()

ilIndividualAssessmentMemberGUI::getInfoForExistingFiles ( array  $file_ids)

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

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

References $name, getFileIdentifierParameterName(), and getFileName().

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
+ Here is the call graph for this function:

◆ getInfoResult()

ilIndividualAssessmentMemberGUI::getInfoResult ( string  $identifier)
protected

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

References $filename, getFileIdentifierParameterName(), getFileName(), and getFilePath().

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
+ Here is the call graph for this function:

◆ getMember()

ilIndividualAssessmentMemberGUI::getMember ( )
protected

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

References getExaminee(), and getObject().

Referenced by buildForm(), downloadFile(), edit(), finalize(), getRemoveResult(), isFinalized(), saveAmend(), saveMember(), setToolbar(), and userMayGrade().

627  {
628  return $this->getObject()->membersStorage()->loadMember(
629  $this->getObject(),
630  $this->getExaminee()
631  );
632  }
Edit the record of a user, set LP.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObject()

ilIndividualAssessmentMemberGUI::getObject ( )
protected

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

References $object.

Referenced by buildForm(), edit(), finalize(), getAccessHandler(), getMember(), getRemoveResult(), getUserFileStorage(), saveAmend(), and saveMember().

592  {
593  return $this->object;
594  }
For the purpose of streamlining the grading and learning-process status definition outside of tests...
+ Here is the caller graph for this function:

◆ getParentGUI()

ilIndividualAssessmentMemberGUI::getParentGUI ( )

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

References $parent_gui.

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

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

References ilIndividualAssessmentMembers\LP_COMPLETED, ilIndividualAssessmentMembers\LP_FAILED, and ilIndividualAssessmentMembers\LP_IN_PROGRESS.

Referenced by buildForm().

399  : array
400  {
401  return [
402  ilIndividualAssessmentMembers::LP_IN_PROGRESS => $this->lng->txt('iass_status_pending'),
403  ilIndividualAssessmentMembers::LP_COMPLETED => $this->lng->txt('iass_status_completed'),
404  ilIndividualAssessmentMembers::LP_FAILED => $this->lng->txt('iass_status_failed')
405  ];
406  }
+ Here is the caller graph for this function:

◆ getRemoveResult()

ilIndividualAssessmentMemberGUI::getRemoveResult ( string  $identifier)
protected

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

References $message, deleteFile(), getFileIdentifierParameterName(), getFileName(), getMember(), and getObject().

427  : HandlerResult
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  }
$message
Definition: xapiexit.php:14
+ Here is the call graph for this function:

◆ getUploadResult()

ilIndividualAssessmentMemberGUI::getUploadResult ( )
protected

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

References $message, $result, getFileIdentifierParameterName(), and uploadFile().

408  : HandlerResult
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
$message
Definition: xapiexit.php:14
+ Here is the call graph for this function:

◆ getUploadURL()

ilIndividualAssessmentMemberGUI::getUploadURL ( )

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

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

References getExaminee().

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  }
+ Here is the call graph for this function:

◆ getUserFileStorage()

ilIndividualAssessmentMemberGUI::getUserFileStorage ( )
protected

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

References getExaminee(), and getObject().

Referenced by deleteFile(), downloadFile(), edit(), getFilePath(), saveAmend(), and uploadFile().

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.
+ 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.

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

697  {
698  $this->error_object->raiseError($this->txt("msg_no_perm_read"), $this->error_object->WARNING);
699  }
+ Here is the caller graph for this function:

◆ isFinalized()

ilIndividualAssessmentMemberGUI::isFinalized ( )
protected

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

References getMember().

Referenced by mayBeAmended(), mayBeEdited(), and mayBeViewed().

691  : bool
692  {
693  return $this->getMember()->finalized();
694  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mayBeAmended()

ilIndividualAssessmentMemberGUI::mayBeAmended ( )
protected

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

References getAccessHandler(), isFinalized(), and userMayAmend().

Referenced by amend(), and saveAmend().

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

◆ mayBeEdited()

ilIndividualAssessmentMemberGUI::mayBeEdited ( )
protected

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

References getAccessHandler(), isFinalized(), and userMayGrade().

Referenced by edit(), finalize(), and finalizeConfirmation().

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

◆ mayBeViewed()

ilIndividualAssessmentMemberGUI::mayBeViewed ( )
protected

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

References getAccessHandler(), isFinalized(), userMayGrade(), and userMayView().

Referenced by view().

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

◆ redirect()

ilIndividualAssessmentMemberGUI::redirect ( string  $cmd)
protected

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

References getExaminee().

Referenced by edit(), finalize(), and saveAmend().

580  : void
581  {
582  $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
583  $this->ctrl->redirect($this, $cmd);
584  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAmend()

ilIndividualAssessmentMemberGUI::saveAmend ( )
protected

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

References getMember(), getObject(), getUserFileStorage(), handleAccessViolation(), mayBeAmended(), redirect(), saveMember(), and ilIndividualAssessmentLPInterface\updateLPStatusOfMember().

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  }
static updateLPStatusOfMember(ilIndividualAssessmentMember $member)
saveMember(ilIndividualAssessmentUserGrading $grading, bool $keep_examiner=false, bool $amend=false)
+ 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.

References getMember(), getObject(), and user().

Referenced by edit(), and saveAmend().

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  }
user()
Definition: user.php:4
+ 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.

References $object.

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

◆ setParentGUI()

ilIndividualAssessmentMemberGUI::setParentGUI ( ilIndividualAssessmentMembersGUI  $parent_gui)

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

References $parent_gui.

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

◆ setToolbar()

ilIndividualAssessmentMemberGUI::setToolbar ( )
protected

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

References getExaminee(), ilLinkButton\getInstance(), and getMember().

Referenced by amend(), and edit().

635  {
636  $member = $this->getMember();
637  if ($member->fileName() != '') {
638  $btn = ilLinkButton::getInstance();
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  }
+ 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.

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

Referenced by userMayGrade().

683  : bool
684  {
685  return
686  (int) $member->examinerId() !== (int) $this->user->getId() &&
687  0 !== (int) $member->examinerId()
688  ;
689  }
user()
Definition: user.php:4
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadFile()

ilIndividualAssessmentMemberGUI::uploadFile ( UploadResult  $result)
protected

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

References ILIAS\FileUpload\DTO\UploadResult\getName(), and getUserFileStorage().

Referenced by getUploadResult().

544  : string
545  {
546  $storage = $this->getUserFileStorage();
547  $storage->create();
548  $storage->deleteCurrentFile();
549  $storage->uploadFile($result);
550 
551  return $result->getName();
552  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userMayAmend()

ilIndividualAssessmentMemberGUI::userMayAmend ( )
protected

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

References getAccessHandler().

Referenced by mayBeAmended().

678  : bool
679  {
680  return $this->getAccessHandler()->isSystemAdmin() || $this->getAccessHandler()->mayAmendGradeUser();
681  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userMayGrade()

ilIndividualAssessmentMemberGUI::userMayGrade ( )
protected

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

References getAccessHandler(), getMember(), and targetWasEditedByOtherUser().

Referenced by mayBeEdited(), and mayBeViewed().

665  : bool
666  {
667  return
668  $this->getAccessHandler()->isSystemAdmin() ||
669  (!$this->targetWasEditedByOtherUser($this->getMember()) && $this->getAccessHandler()->mayGradeUser())
670  ;
671  }
targetWasEditedByOtherUser(ilIndividualAssessmentMember $member)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userMayView()

ilIndividualAssessmentMemberGUI::userMayView ( )
protected

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

References getAccessHandler().

Referenced by mayBeViewed().

673  : bool
674  {
675  return $this->getAccessHandler()->isSystemAdmin() || $this->getAccessHandler()->mayViewUser();
676  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ view()

ilIndividualAssessmentMemberGUI::view ( )
protected

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

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

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  }
buildForm(string $form_action, bool $may_be_edited, bool $amend=false)
+ 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.

Referenced by getAccessHandler().

◆ $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(), and buildForm().

◆ $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(), getObject(), and setObject().

◆ $parent_gui

ilIndividualAssessmentMemberGUI::$parent_gui
protected

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

Referenced by getParentGUI(), and setParentGUI().

◆ $refinery_factory

ilIndividualAssessmentMemberGUI::$refinery_factory
protected

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

Referenced by __construct(), and buildForm().

◆ $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.

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

◆ CMD_FINALIZE

const ilIndividualAssessmentMemberGUI::CMD_FINALIZE = 'finalize'

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

◆ CMD_FINALIZE_CONFIRMATION

const ilIndividualAssessmentMemberGUI::CMD_FINALIZE_CONFIRMATION = 'finalizeConfirmation'

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

◆ CMD_SAVE_AMEND

const ilIndividualAssessmentMemberGUI::CMD_SAVE_AMEND = "saveAmend"

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

◆ CMD_UPDATE

const ilIndividualAssessmentMemberGUI::CMD_UPDATE = 'update'

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

◆ CMD_VIEW

const ilIndividualAssessmentMemberGUI::CMD_VIEW = 'view'

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


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