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)
 
 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 ()
 
 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)
 
 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(), getFormActionForCommand(), handleAccessViolation(), mayBeAmended(), and setToolbar().

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

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

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

300  $section = $this->getMember()->getGrading()->toFormInput(
301  $this->input_factory->field(),
303  $this->lng,
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  }
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 560 of file class.ilIndividualAssessmentMemberGUI.php.

References getUserFileStorage().

Referenced by getRemoveResult().

561  {
562  $storage = $this->getUserFileStorage();
563  $storage->deleteCurrentFile();
564  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ downloadFile()

ilIndividualAssessmentMemberGUI::downloadFile ( )
protected

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

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

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

◆ edit()

ilIndividualAssessmentMemberGUI::edit ( )
protected

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

References buildForm(), finalizeConfirmation(), getFormActionForCommand(), 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->setToolbar();
195  $form = $this->buildForm($this->getFormActionForCommand(self::CMD_UPDATE), true);
196  $this->tpl->setContent($this->renderer->render($form));
197  }
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 323 of file class.ilIndividualAssessmentMemberGUI.php.

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

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

◆ finalizeConfirmation()

ilIndividualAssessmentMemberGUI::finalizeConfirmation ( )
protected

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

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

Referenced by edit().

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

◆ getAccessHandler()

ilIndividualAssessmentMemberGUI::getAccessHandler ( )
protected

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

References $iass_access, and getObject().

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

613  {
614  if (is_null($this->iass_access)) {
615  $this->iass_access = $this->getObject()->accessHandler();
616  }
617  return $this->iass_access;
618  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExaminee()

ilIndividualAssessmentMemberGUI::getExaminee ( )
protected

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

References $_GET.

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

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

◆ getExistingFileInfoURL()

ilIndividualAssessmentMemberGUI::getExistingFileInfoURL ( )

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

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

References getExaminee().

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

◆ getFileIdentifierParameterName()

ilIndividualAssessmentMemberGUI::getFileIdentifierParameterName ( )

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

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

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

507  : string
508  {
509  return 'iass';
510  }
+ Here is the caller graph for this function:

◆ getFileName()

ilIndividualAssessmentMemberGUI::getFileName ( )
protected

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

References getFilePath().

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

566  : ?string
567  {
568  $path = $this->getFilePath();
569  if (is_null($path)) {
570  return null;
571  }
572 
573  return end(explode('/', $path));
574  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFilePath()

ilIndividualAssessmentMemberGUI::getFilePath ( )
protected

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

References getUserFileStorage().

Referenced by getFileName(), and getInfoResult().

576  : ?string
577  {
578  $storage = $this->getUserFileStorage();
579  if ($storage->isEmpty()) {
580  return null;
581  }
582 
583  return $storage->getFilePath();
584  }
+ 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 539 of file class.ilIndividualAssessmentMemberGUI.php.

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

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

◆ getFormActionForCommand()

ilIndividualAssessmentMemberGUI::getFormActionForCommand ( string  $cmd)
protected

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

References getExaminee().

Referenced by amend(), and edit().

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

◆ getInfoForExistingFiles()

ilIndividualAssessmentMemberGUI::getInfoForExistingFiles ( array  $file_ids)

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

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

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

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

◆ getInfoResult()

ilIndividualAssessmentMemberGUI::getInfoResult ( string  $identifier)
protected

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

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

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

◆ getMember()

ilIndividualAssessmentMemberGUI::getMember ( )
protected

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

References getExaminee(), and getObject().

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

633  {
634  return $this->getObject()->membersStorage()->loadMember(
635  $this->getObject(),
636  $this->getExaminee()
637  );
638  }
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 597 of file class.ilIndividualAssessmentMemberGUI.php.

References $object.

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

598  {
599  return $this->object;
600  }
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 607 of file class.ilIndividualAssessmentMemberGUI.php.

References $parent_gui.

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

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

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

Referenced by buildForm().

405  : array
406  {
407  return [
408  ilIndividualAssessmentMembers::LP_IN_PROGRESS => $this->lng->txt('iass_status_pending'),
409  ilIndividualAssessmentMembers::LP_COMPLETED => $this->lng->txt('iass_status_completed'),
410  ilIndividualAssessmentMembers::LP_FAILED => $this->lng->txt('iass_status_failed')
411  ];
412  }
+ Here is the caller graph for this function:

◆ getRemoveResult()

ilIndividualAssessmentMemberGUI::getRemoveResult ( string  $identifier)
protected

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

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

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

◆ getUploadResult()

ilIndividualAssessmentMemberGUI::getUploadResult ( )
protected

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

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

414  : HandlerResult
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
$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 515 of file class.ilIndividualAssessmentMemberGUI.php.

References getExaminee().

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

◆ getUserFileStorage()

ilIndividualAssessmentMemberGUI::getUserFileStorage ( )
protected

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

References getExaminee(), and getObject().

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

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

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

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

◆ isFinalized()

ilIndividualAssessmentMemberGUI::isFinalized ( )
protected

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

References getMember().

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

697  : bool
698  {
699  return $this->getMember()->finalized();
700  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mayBeAmended()

ilIndividualAssessmentMemberGUI::mayBeAmended ( )
protected

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

References getExaminee().

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

586  : void
587  {
588  $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
589  $this->ctrl->redirect($this, $cmd);
590  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAmend()

ilIndividualAssessmentMemberGUI::saveAmend ( )
protected

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

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

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

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

Referenced by edit(), and saveAmend().

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

References $object.

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

◆ setParentGUI()

ilIndividualAssessmentMemberGUI::setParentGUI ( ilIndividualAssessmentMembersGUI  $parent_gui)

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

References $parent_gui.

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

◆ setToolbar()

ilIndividualAssessmentMemberGUI::setToolbar ( )
protected

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

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

Referenced by amend(), and edit().

641  {
642  $member = $this->getMember();
643  if ($member->fileName() != '') {
644  $btn = ilLinkButton::getInstance();
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  }
+ 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.

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

Referenced by userMayGrade().

689  : bool
690  {
691  return
692  (int) $member->examinerId() !== (int) $this->user->getId() &&
693  0 !== (int) $member->examinerId()
694  ;
695  }
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 550 of file class.ilIndividualAssessmentMemberGUI.php.

References getUserFileStorage().

Referenced by getUploadResult().

550  : string
551  {
552  $storage = $this->getUserFileStorage();
553  $storage->create();
554  $storage->deleteCurrentFile();
555  $storage->uploadFile($result);
556 
557  return $storage->getFileName();
558  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userMayAmend()

ilIndividualAssessmentMemberGUI::userMayAmend ( )
protected

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

References getAccessHandler().

Referenced by mayBeAmended().

684  : bool
685  {
686  return $this->getAccessHandler()->isSystemAdmin() || $this->getAccessHandler()->mayAmendGradeUser();
687  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userMayGrade()

ilIndividualAssessmentMemberGUI::userMayGrade ( )
protected

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

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

Referenced by mayBeEdited(), and mayBeViewed().

671  : bool
672  {
673  return
674  $this->getAccessHandler()->isSystemAdmin() ||
675  (!$this->targetWasEditedByOtherUser($this->getMember()) && $this->getAccessHandler()->mayGradeUser())
676  ;
677  }
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 679 of file class.ilIndividualAssessmentMemberGUI.php.

References getAccessHandler().

Referenced by mayBeViewed().

679  : bool
680  {
681  return $this->getAccessHandler()->isSystemAdmin() || $this->getAccessHandler()->mayViewUser();
682  }
+ 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(), and buildForm().

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