ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
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, ILIAS\Refinery\Factory $refinery, ILIAS\HTTP\Wrapper\RequestWrapper $request_wrapper, ilIndividualAssessmentDateFormatter $date_formatter)
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
 getFileIdentifierParameterName ()
 
 getUploadURL ()
 
 getExistingFileInfoURL ()
 
 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...
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
 supportsChunkedUploads ()
 

Data Fields

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

Protected Member Functions

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

Protected Attributes

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

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

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

Member Function Documentation

◆ amend()

ilIndividualAssessmentMemberGUI::amend ( )
protected

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

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

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

◆ buildForm()

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

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

References $data_factory, $lng, $refinery_factory, getMember(), getObject(), getPossibleLPStates(), and ILIAS\Repository\user().

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

252  $date_format = $this->date_formatter->getUserDateFormat($this->user, false);
253 
254  $section = $this->getMember()->getGrading()->toFormInput(
255  $this->input_factory->field(),
257  $this->lng,
259  $this,
260  $date_format,
261  $this->getPossibleLPStates(),
262  $may_be_edited,
263  $this->getObject()->getSettings()->isEventTimePlaceRequired(),
264  $amend
265  );
266 
267  $form = $this->input_factory->container()->form()->standard($form_action, [$section]);
268  return $form->withAdditionalTransformation(
269  $this->refinery_factory->custom()->transformation(
270  function ($values) use ($amend) {
271  return array_shift($values);
272  }
273  )
274  );
275  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ downloadFile()

ilIndividualAssessmentMemberGUI::downloadFile ( )
protected

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

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

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

◆ edit()

ilIndividualAssessmentMemberGUI::edit ( )
protected

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

References buildForm(), ILIAS\Repository\ctrl(), finalizeConfirmation(), getFormActionForCommand(), getMember(), getObject(), getUserFileStorage(), handleAccessViolation(), ILIAS\Repository\lng(), mayBeEdited(), saveMember(), setToolbar(), and ilIndividualAssessmentLPInterface\updateLPStatusOfMember().

143  : void
144  {
145  if (!$this->mayBeEdited()) {
146  $this->handleAccessViolation();
147  return;
148  }
149 
150  $this->setToolbar();
151  $form = $this->buildForm($this->getFormActionForCommand(self::CMD_UPDATE), true);
152  $this->tpl->setContent($this->renderer->render($form));
153  }
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 108 of file class.ilIndividualAssessmentMemberGUI.php.

References ILIAS\Repository\ctrl().

108  : void
109  {
110  $cmd = $this->ctrl->getCmd();
111 
112  switch ($cmd) {
113  case self::CMD_VIEW:
114  case self::CMD_UPDATE:
115  case self::CMD_EDIT:
116  case self::CMD_FINALIZE:
117  case self::CMD_FINALIZE_CONFIRMATION:
118  case self::CMD_AMEND:
119  case self::CMD_SAVE_AMEND:
120  case self::CMD_DOWNLOAD_FILE:
121  $this->$cmd();
122  break;
123  case AbstractCtrlAwareUploadHandler::CMD_UPLOAD:
124  case AbstractCtrlAwareUploadHandler::CMD_REMOVE:
125  case AbstractCtrlAwareUploadHandler::CMD_INFO:
126  parent::executeCommand();
127  break;
128  default:
129  throw new LogicException("Unknown command $cmd");
130  }
131  }
+ Here is the call graph for this function:

◆ finalize()

ilIndividualAssessmentMemberGUI::finalize ( )
protected

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

References Vendor\Package\$e, ILIAS\Repository\ctrl(), getMember(), getObject(), handleAccessViolation(), ILIAS\Repository\lng(), mayBeEdited(), ILIAS\Repository\object(), redirect(), and ilIndividualAssessmentLPInterface\updateLPStatusOfMember().

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

◆ finalizeConfirmation()

ilIndividualAssessmentMemberGUI::finalizeConfirmation ( )
protected

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

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

Referenced by edit().

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

◆ getAccessHandler()

ilIndividualAssessmentMemberGUI::getAccessHandler ( )
protected

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

References $iass_access, and getObject().

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

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

◆ getExaminee()

ilIndividualAssessmentMemberGUI::getExaminee ( )
protected

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

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

484  : ilObjUser
485  {
486  return new ilObjUser($this->request_wrapper->retrieve('usr_id', $this->refinery->kindlyTo()->int()));
487  }
+ Here is the caller graph for this function:

◆ getExistingFileInfoURL()

ilIndividualAssessmentMemberGUI::getExistingFileInfoURL ( )
Returns
string of the URL where in GUI existing files are handled. The URL is called by GET with a field with name from getFileIdentifierParameterName() and the FileID of the desired file. Return a FI

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

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

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

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

◆ getFileIdentifierParameterName()

ilIndividualAssessmentMemberGUI::getFileIdentifierParameterName ( )
Returns
string defaults to self::DEFAULT_FILE_ID_PARAMETER

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

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

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

427  : string
428  {
429  return 'iass';
430  }
+ Here is the caller graph for this function:

◆ getFormActionForCommand()

ilIndividualAssessmentMemberGUI::getFormActionForCommand ( string  $cmd)
protected

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

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

Referenced by amend(), and edit().

202  : string
203  {
204  $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
205  $action = $this->ctrl->getFormAction($this, $cmd);
206  $this->ctrl->clearParameterByClass(self::class, 'usr_id');
207 
208  return $action;
209  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInfoForExistingFiles()

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

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

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

References $id, $path, getFileIdentifierParameterName(), and getUserFileStorage().

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

◆ getInfoResult()

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

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

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

References $path, getFileIdentifierParameterName(), and getUserFileStorage().

400  {
401  $storage = $this->getUserFileStorage();
402  $path = $storage->getAbsolutePath() . "/" . $identifier;
403  return new BasicFileInfoResult(
405  $identifier,
406  $identifier,
407  filesize($path),
408  pathinfo($path, PATHINFO_EXTENSION)
409  );
410  }
$path
Definition: ltiservices.php:32
+ Here is the call graph for this function:

◆ getMember()

ilIndividualAssessmentMemberGUI::getMember ( )
protected

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

References getExaminee(), and getObject().

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

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

◆ getObject()

ilIndividualAssessmentMemberGUI::getObject ( )
protected

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

References $object.

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

462  {
463  return $this->object;
464  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getParentGUI()

ilIndividualAssessmentMemberGUI::getParentGUI ( )

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

References $parent_gui.

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

◆ getPossibleLPStates()

ilIndividualAssessmentMemberGUI::getPossibleLPStates ( )
protected

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

References ILIAS\Repository\lng(), ilIndividualAssessmentMembers\LP_COMPLETED, ilIndividualAssessmentMembers\LP_FAILED, and ilIndividualAssessmentMembers\LP_IN_PROGRESS.

Referenced by buildForm().

360  : array
361  {
362  return [
363  ilIndividualAssessmentMembers::LP_IN_PROGRESS => $this->lng->txt('iass_status_pending'),
364  ilIndividualAssessmentMembers::LP_COMPLETED => $this->lng->txt('iass_status_completed'),
365  ilIndividualAssessmentMembers::LP_FAILED => $this->lng->txt('iass_status_failed')
366  ];
367  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRemoveResult()

ilIndividualAssessmentMemberGUI::getRemoveResult ( string  $identifier)
protected

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

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

391  : HandlerResult
392  {
393  $status = HandlerResult::STATUS_OK;
394  $message = $this->lng->txt('iass_file_deleted');
395 
396  return new BasicHandlerResult($this->getFileIdentifierParameterName(), $status, $identifier, $message);
397  }
$message
Definition: xapiexit.php:32
+ Here is the call graph for this function:

◆ getUploadResult()

ilIndividualAssessmentMemberGUI::getUploadResult ( )
protected

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

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

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

◆ getUploadURL()

ilIndividualAssessmentMemberGUI::getUploadURL ( )
Returns
string of the URL where dropped files are sent to. This URL must make sure the upload is handled and a is returned as JSON.

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

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

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

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

◆ getUserFileStorage()

ilIndividualAssessmentMemberGUI::getUserFileStorage ( )
protected

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

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

Referenced by downloadFile(), edit(), getInfoForExistingFiles(), getInfoResult(), getUploadResult(), and saveAmend().

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

◆ handleAccessViolation()

ilIndividualAssessmentMemberGUI::handleAccessViolation ( )

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

References ILIAS\Repository\lng().

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

566  : void
567  {
568  $this->error_object->raiseError($this->lng->txt("msg_no_perm_read"), $this->error_object->WARNING);
569  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isFinalized()

ilIndividualAssessmentMemberGUI::isFinalized ( )
protected

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

References getMember().

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

561  : bool
562  {
563  return $this->getMember()->finalized();
564  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mayBeAmended()

ilIndividualAssessmentMemberGUI::mayBeAmended ( )
protected

Definition at line 530 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 517 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 522 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 450 of file class.ilIndividualAssessmentMemberGUI.php.

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

Referenced by finalize().

450  : void
451  {
452  $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
453  $this->ctrl->redirect($this, $cmd);
454  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAmend()

ilIndividualAssessmentMemberGUI::saveAmend ( )
protected

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

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

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

References getMember(), getObject(), and ILIAS\Repository\user().

Referenced by edit(), and saveAmend().

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

◆ setObject()

ilIndividualAssessmentMemberGUI::setObject ( ilObjIndividualAssessment  $object)

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

References $object.

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

◆ setParentGUI()

ilIndividualAssessmentMemberGUI::setParentGUI ( ilIndividualAssessmentMembersGUI  $parent_gui)

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

References $parent_gui.

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

◆ setToolbar()

ilIndividualAssessmentMemberGUI::setToolbar ( )
protected

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

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

Referenced by amend(), and edit().

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

◆ targetWasEditedByOtherUser()

ilIndividualAssessmentMemberGUI::targetWasEditedByOtherUser ( ilIndividualAssessmentMember  $member)
protected

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

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

Referenced by userMayGrade().

553  : bool
554  {
555  return
556  (int) $member->examinerId() !== $this->user->getId() &&
557  0 !== (int) $member->examinerId()
558  ;
559  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userMayAmend()

ilIndividualAssessmentMemberGUI::userMayAmend ( )
protected

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

References getAccessHandler().

Referenced by mayBeAmended().

548  : bool
549  {
550  return $this->getAccessHandler()->mayAmendAllUsers();
551  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userMayGrade()

ilIndividualAssessmentMemberGUI::userMayGrade ( )
protected

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

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

Referenced by mayBeEdited(), and mayBeViewed().

535  : bool
536  {
537  return
538  $this->getAccessHandler()->isSystemAdmin() ||
539  (!$this->targetWasEditedByOtherUser($this->getMember()) && $this->getAccessHandler()->mayGradeUser($this->getMember()->id()))
540  ;
541  }
targetWasEditedByOtherUser(ilIndividualAssessmentMember $member)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userMayView()

ilIndividualAssessmentMemberGUI::userMayView ( )
protected

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

References getAccessHandler(), and getMember().

Referenced by mayBeViewed().

543  : bool
544  {
545  return $this->getAccessHandler()->mayViewUser($this->getMember()->id());
546  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ view()

ilIndividualAssessmentMemberGUI::view ( )
protected

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

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

133  : void
134  {
135  if (!$this->mayBeViewed()) {
136  $this->handleAccessViolation();
137  return;
138  }
139  $form = $this->buildForm('', false);
140  $this->tpl->setContent($this->renderer->render($form));
141  }
buildForm(string $form_action, bool $may_be_edited, bool $amend=false)
+ Here is the call graph for this function:

Field Documentation

◆ $button_factory

Button Factory ilIndividualAssessmentMemberGUI::$button_factory
protected

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

Referenced by __construct().

◆ $data_factory

Data Factory ilIndividualAssessmentMemberGUI::$data_factory
protected

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

Referenced by __construct(), and buildForm().

◆ $date_formatter

ilIndividualAssessmentDateFormatter ilIndividualAssessmentMemberGUI::$date_formatter
protected

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

Referenced by __construct().

◆ $error_object

ilErrorHandling ilIndividualAssessmentMemberGUI::$error_object
protected

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

Referenced by __construct().

◆ $iass_access

ilIndividualAssessmentAccessHandler ilIndividualAssessmentMemberGUI::$iass_access = null
protected

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

Referenced by getAccessHandler().

◆ $input_factory

Input Factory ilIndividualAssessmentMemberGUI::$input_factory
protected

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

Referenced by __construct().

◆ $lng

ilLanguage ilIndividualAssessmentMemberGUI::$lng
protected

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

Referenced by __construct(), and buildForm().

◆ $messagebox_factory

MessageBox Factory ilIndividualAssessmentMemberGUI::$messagebox_factory
protected

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

Referenced by __construct().

◆ $notificator

ilIndividualAssessmentPrimitiveInternalNotificator ilIndividualAssessmentMemberGUI::$notificator
protected

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

Referenced by __construct().

◆ $object

ilObjIndividualAssessment ilIndividualAssessmentMemberGUI::$object
protected

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

Referenced by __construct(), getObject(), and setObject().

◆ $parent_gui

ilIndividualAssessmentMembersGUI ilIndividualAssessmentMemberGUI::$parent_gui
protected

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

Referenced by getParentGUI(), and setParentGUI().

◆ $refinery

ILIAS Refinery Factory ilIndividualAssessmentMemberGUI::$refinery
protected

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

Referenced by __construct().

◆ $refinery_factory

Refinery Factory ilIndividualAssessmentMemberGUI::$refinery_factory
protected

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

Referenced by __construct(), and buildForm().

◆ $renderer

Renderer ilIndividualAssessmentMemberGUI::$renderer
protected

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

Referenced by __construct().

◆ $request

ServerRequest ilIndividualAssessmentMemberGUI::$request
protected

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

Referenced by __construct().

◆ $request_wrapper

ILIAS HTTP Wrapper RequestWrapper ilIndividualAssessmentMemberGUI::$request_wrapper
protected

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

Referenced by __construct().

◆ $toolbar

ilToolbarGUI ilIndividualAssessmentMemberGUI::$toolbar
protected

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

Referenced by __construct().

◆ $tpl

ilGlobalPageTemplate ilIndividualAssessmentMemberGUI::$tpl
protected

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

Referenced by __construct().

◆ $user

ilObjUser ilIndividualAssessmentMemberGUI::$user
protected

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

Referenced by __construct().

◆ CMD_AMEND

const ilIndividualAssessmentMemberGUI::CMD_AMEND = 'amend'

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

◆ CMD_DOWNLOAD_FILE

const ilIndividualAssessmentMemberGUI::CMD_DOWNLOAD_FILE = "downloadFile"

◆ CMD_EDIT

const ilIndividualAssessmentMemberGUI::CMD_EDIT = 'edit'

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

◆ CMD_FINALIZE

const ilIndividualAssessmentMemberGUI::CMD_FINALIZE = 'finalize'

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

◆ CMD_FINALIZE_CONFIRMATION

const ilIndividualAssessmentMemberGUI::CMD_FINALIZE_CONFIRMATION = 'finalizeConfirmation'

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

◆ CMD_SAVE_AMEND

const ilIndividualAssessmentMemberGUI::CMD_SAVE_AMEND = "saveAmend"

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

◆ CMD_UPDATE

const ilIndividualAssessmentMemberGUI::CMD_UPDATE = 'update'

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

◆ CMD_VIEW

const ilIndividualAssessmentMemberGUI::CMD_VIEW = 'view'

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


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