ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilIndividualAssessmentMemberGUI Class Reference
+ Inheritance diagram for ilIndividualAssessmentMemberGUI:
+ Collaboration diagram for ilIndividualAssessmentMemberGUI:

Public Member Functions

 __construct (protected ilCtrl $ctrl, protected ilLanguage $lng, protected ilGlobalPageTemplate $tpl, protected ilObjUser $user, protected Input\Factory $input_factory, protected MessageBox\Factory $messagebox_factory, protected Button\Factory $button_factory, protected Link\Factory $link_factory, protected Refinery\Factory $refinery_factory, protected Data\Factory $data_factory, protected Renderer $renderer, protected ServerRequest $request, protected ilIndividualAssessmentPrimitiveInternalNotificator $notificator, protected ilToolbarGUI $toolbar, protected ilObjIndividualAssessment $object, protected ilErrorHandling $error_object, protected ILIAS\Refinery\Factory $refinery, protected ILIAS\HTTP\Wrapper\RequestWrapper $request_wrapper, protected ilIndividualAssessmentDateFormatter $date_formatter, protected IRSS $irss, protected ilIndividualAssessmentGradingStakeholder $stakeholder,)
 
 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 ()
 
 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

ilIndividualAssessmentAccessHandler $iass_access = null
 
- 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 37 of file class.ilIndividualAssessmentMemberGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References ILIAS\MetaData\Repository\Validation\Data\__construct().

72  {
74  }
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ amend()

ilIndividualAssessmentMemberGUI::amend ( )
protected

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

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

154  : void
155  {
156  if (!$this->mayBeAmended()) {
157  $this->handleAccessViolation();
158  return;
159  }
160 
161  $this->setToolbar();
162  $form = $this->buildForm($this->getFormActionForCommand(self::CMD_SAVE_AMEND), true, true);
163  $form->withSubmitLabel($this->lng->txt("save_amend"));
164  $this->tpl->setContent($this->renderer->render($form));
165  }
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 211 of file class.ilIndividualAssessmentMemberGUI.php.

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

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

216  $section = $this->getMember()->getGrading()->toFormInput(
217  $this->input_factory->field(),
218  $this->data_factory,
219  $this->lng,
220  $this->refinery_factory,
221  $this,
222  $this->user->getDateFormat(),
223  $this->getPossibleLPStates(),
224  $may_be_edited,
225  $this->getObject()->getSettings()->isEventTimePlaceRequired(),
226  $this->getObject()->getSettings()->isFileRequired(),
227  $amend
228  );
229 
230  $form = $this->input_factory->container()->form()->standard($form_action, [$section]);
231  return $form->withAdditionalTransformation(
232  $this->refinery_factory->custom()->transformation(
233  function ($values) use ($amend) {
234  return array_shift($values);
235  }
236  )
237  );
238  }
$lng
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ downloadFile()

ilIndividualAssessmentMemberGUI::downloadFile ( )
protected

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

References getMember().

176  : void
177  {
178  $identifier = $this->getMember()->getGrading()->getFile();
179  $resource_id = $this->irss->manage()->find($identifier);
180  if($resource_id) {
181  $this->irss->consume()->download($resource_id)->run();
182  }
183  }
+ Here is the call graph for this function:

◆ edit()

ilIndividualAssessmentMemberGUI::edit ( )
protected

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

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

111  : void
112  {
113  if (!$this->mayBeEdited()) {
114  $this->handleAccessViolation();
115  return;
116  }
117 
118  $this->setToolbar();
119  $form = $this->buildForm($this->getFormActionForCommand(self::CMD_UPDATE), true);
120  $this->tpl->setContent($this->renderer->render($form));
121  }
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 76 of file class.ilIndividualAssessmentMemberGUI.php.

References ILIAS\Repository\ctrl().

76  : void
77  {
78  $cmd = $this->ctrl->getCmd();
79 
80  switch ($cmd) {
81  case self::CMD_VIEW:
82  case self::CMD_UPDATE:
83  case self::CMD_EDIT:
84  case self::CMD_FINALIZE:
85  case self::CMD_FINALIZE_CONFIRMATION:
86  case self::CMD_AMEND:
87  case self::CMD_SAVE_AMEND:
88  case self::CMD_DOWNLOAD_FILE:
89  $this->$cmd();
90  break;
91  case AbstractCtrlAwareUploadHandler::CMD_UPLOAD:
92  case AbstractCtrlAwareUploadHandler::CMD_REMOVE:
93  case AbstractCtrlAwareUploadHandler::CMD_INFO:
94  parent::executeCommand();
95  break;
96  default:
97  throw new LogicException("Unknown command $cmd");
98  }
99  }
+ Here is the call graph for this function:

◆ finalize()

ilIndividualAssessmentMemberGUI::finalize ( )
protected

Definition at line 240 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().

240  : void
241  {
242  if (!$this->mayBeEdited()) {
243  $this->handleAccessViolation();
244  return;
245  }
246 
247  $member = $this->getMember();
248  if (!$member->mayBeFinalized()) {
249  $this->tpl->setOnScreenMessage("failure", $this->lng->txt('iass_may_not_finalize'), true);
250  $this->redirect('edit');
251  return;
252  }
253 
254  try {
255  $grading = $member->getGrading()->withFinalized(true);
256  $member = $member->withGrading($grading);
257  $this->getObject()->membersStorage()->updateMember($member);
259  $this->tpl->setOnScreenMessage("failure", $e->getMessage(), true);
260  $this->redirect('edit');
261  return;
262  }
263 
264  if ($this->object->isActiveLP()) {
266  }
267 
268  try {
269  $member->maybeSendNotification($this->notificator);
270  $this->ctrl->redirectByClass(ilIndividualAssessmentMembersGUI::class, 'view');
271  } catch (ilIndividualAssessmentException $e) {
272  $this->tpl->setOnScreenMessage("failure", $e->getMessage(), true);
273  $this->redirect('edit');
274  return;
275  }
276 
277  $this->tpl->setOnScreenMessage("success", $this->lng->txt('iass_membership_finalized'), true);
278  $this->redirect('view');
279  }
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 281 of file class.ilIndividualAssessmentMemberGUI.php.

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

Referenced by edit().

281  : void
282  {
283  if (!$this->mayBeEdited()) {
284  $this->handleAccessViolation();
285  return;
286  }
287 
288  $message = $this->lng->txt('iass_finalize_user_qst');
289  $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
290  $finalize = $this->ctrl->getFormActionByClass(self::class, self::CMD_FINALIZE);
291  $cancel = $this->ctrl->getFormActionByClass(self::class, self::CMD_EDIT);
292  $this->ctrl->clearParameterByClass(self::class, 'usr_id');
293 
294  $buttons = [
295  $this->button_factory->standard($this->lng->txt('iass_confirm_finalize'), $finalize),
296  $this->button_factory->standard($this->lng->txt('iass_cancel'), $cancel)
297  ];
298 
299  $message_box = $this->messagebox_factory->confirmation($message)->withButtons($buttons);
300 
301  $this->tpl->setContent($this->renderer->render($message_box));
302  }
$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 455 of file class.ilIndividualAssessmentMemberGUI.php.

References $iass_access, and getObject().

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

456  {
457  if (is_null($this->iass_access)) {
458  $this->iass_access = $this->getObject()->accessHandler();
459  }
460  return $this->iass_access;
461  }
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 463 of file class.ilIndividualAssessmentMemberGUI.php.

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

463  : ilObjUser
464  {
465  return new ilObjUser($this->request_wrapper->retrieve('usr_id', $this->refinery->kindlyTo()->int()));
466  }
+ 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 420 of file class.ilIndividualAssessmentMemberGUI.php.

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

420  : string
421  {
422  $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
423  $link = $this->ctrl->getLinkTarget($this, self::CMD_INFO);
424  $this->ctrl->setParameter($this, 'usr_id', null);
425 
426  return $link;
427  }
+ 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 406 of file class.ilIndividualAssessmentMemberGUI.php.

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

406  : string
407  {
408  return 'iass';
409  }
+ Here is the caller graph for this function:

◆ getFormActionForCommand()

ilIndividualAssessmentMemberGUI::getFormActionForCommand ( string  $cmd)
protected

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

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

Referenced by amend(), and edit().

167  : string
168  {
169  $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
170  $action = $this->ctrl->getFormAction($this, $cmd);
171  $this->ctrl->clearParameterByClass(self::class, 'usr_id');
172 
173  return $action;
174  }
+ 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 386 of file class.ilIndividualAssessmentMemberGUI.php.

References $id, and getFileIdentifierParameterName().

386  : array
387  {
388  $file_ids = array_filter($file_ids, fn($id) => $id !== "");
389  return array_map(function ($id) {
390  $resource_id = $this->irss->manage()->find($identifier);
391  if(! $resource_id) {
392  return null;
393  }
394  $resource = $this->irss->manage()->getResource($resource_id);
395  $info = $resource->getCurrentRevision()->getInformation();
396  return new BasicFileInfoResult(
398  $id,
399  $info->getTitle(),
400  $info->getSize(),
401  $info->getMimeType()
402  );
403  }, $file_ids);
404  }
$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 368 of file class.ilIndividualAssessmentMemberGUI.php.

References getFileIdentifierParameterName().

368  : ?FileInfoResult
369  {
370  $resource_id = $this->irss->manage()->find($identifier);
371  if(! $resource_id) {
372  return null;
373  }
374  $resource = $this->irss->manage()->getResource($resource_id);
375  $info = $resource->getCurrentRevision()->getInformation();
376 
377  return new BasicFileInfoResult(
379  $identifier,
380  $info->getTitle(),
381  $info->getSize(),
382  $info->getMimeType()
383  );
384  }
+ Here is the call graph for this function:

◆ getMember()

ilIndividualAssessmentMemberGUI::getMember ( )
protected

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

References getExaminee(), and getObject().

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

469  {
470  return $this->getObject()->membersStorage()->loadMember(
471  $this->getObject(),
472  $this->getExaminee()
473  );
474  }
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 440 of file class.ilIndividualAssessmentMemberGUI.php.

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

441  {
442  return $this->object;
443  }
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 450 of file class.ilIndividualAssessmentMemberGUI.php.

451  {
452  return $this->parent_gui;
453  }
For the purpose of streamlining the grading and learning-process status definition outside of tests...

◆ getPossibleLPStates()

ilIndividualAssessmentMemberGUI::getPossibleLPStates ( )
protected

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

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

Referenced by buildForm().

323  : array
324  {
325  return [
326  ilIndividualAssessmentMembers::LP_IN_PROGRESS => $this->lng->txt('iass_status_pending'),
327  ilIndividualAssessmentMembers::LP_COMPLETED => $this->lng->txt('iass_status_completed'),
328  ilIndividualAssessmentMembers::LP_FAILED => $this->lng->txt('iass_status_failed')
329  ];
330  }
+ 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 353 of file class.ilIndividualAssessmentMemberGUI.php.

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

353  : HandlerResult
354  {
355  $resource_id = $this->irss->manage()->find($identifier);
356  if($resource_id) {
357  $this->irss->manage()->remove($resource_id, $this->stakeholder);
358  $status = HandlerResult::STATUS_OK;
359  $message = $this->lng->txt('iass_file_deleted');
360  } else {
361  $status = HandlerResult::STATUS_FAILED;
362  $identifier = '';
363  $message = 'no resource to delete';
364  }
365  return new BasicHandlerResult($this->getFileIdentifierParameterName(), $status, $identifier, $message);
366  }
$message
Definition: xapiexit.php:32
+ Here is the call graph for this function:

◆ getUploadResult()

ilIndividualAssessmentMemberGUI::getUploadResult ( )
protected

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

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

332  : HandlerResult
333  {
334  $this->upload->process();
335  $array = $this->upload->getResults();
336  $result = end($array);
337 
338  if ($result instanceof UploadResult && $result->isOK()) {
339 
340  $resource_id = $this->irss->manage()->upload($result, $this->stakeholder);
341  $identifier = $resource_id->serialize();
342  $status = HandlerResult::STATUS_OK;
343  $message = 'Upload ok';
344  } else {
345  $status = HandlerResult::STATUS_FAILED;
346  $identifier = '';
347  $message = $result->getStatus()->getMessage();
348  }
349 
350  return new BasicHandlerResult($this->getFileIdentifierParameterName(), $status, $identifier, $message);
351  }
$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 411 of file class.ilIndividualAssessmentMemberGUI.php.

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

411  : string
412  {
413  $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
414  $link = $this->ctrl->getLinkTarget($this, self::CMD_UPLOAD);
415  $this->ctrl->setParameter($this, 'usr_id', null);
416 
417  return $link;
418  }
+ Here is the call graph for this function:

◆ handleAccessViolation()

ilIndividualAssessmentMemberGUI::handleAccessViolation ( )

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

References ILIAS\Repository\lng().

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

540  : void
541  {
542  $this->error_object->raiseError($this->lng->txt("msg_no_perm_read"), $this->error_object->WARNING);
543  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isFinalized()

ilIndividualAssessmentMemberGUI::isFinalized ( )
protected

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

References getMember().

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

535  : bool
536  {
537  return $this->getMember()->finalized();
538  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mayBeAmended()

ilIndividualAssessmentMemberGUI::mayBeAmended ( )
protected

Definition at line 504 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 491 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 496 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 429 of file class.ilIndividualAssessmentMemberGUI.php.

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

Referenced by finalize().

429  : void
430  {
431  $this->ctrl->setParameterByClass(self::class, 'usr_id', $this->getExaminee()->getId());
432  $this->ctrl->redirect($this, $cmd);
433  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAmend()

ilIndividualAssessmentMemberGUI::saveAmend ( )
protected

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

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

185  : void
186  {
187  if (!$this->mayBeAmended()) {
188  $this->handleAccessViolation();
189  return;
190  }
191 
192  $form = $this
193  ->buildForm($this->ctrl->getFormAction($this, self::CMD_AMEND), true, true)
194  ->withRequest($this->request)
195  ;
196 
197  $grading = $form->getData();
198 
199  if (!is_null($grading)) {
200  $this->saveMember($grading, true, true);
201 
202  if ($this->getObject()->isActiveLP()) {
204  }
205 
206  $this->tpl->setOnScreenMessage("success", $this->lng->txt('iass_amend_saved'), true);
207  $this->ctrl->redirectByClass(ilIndividualAssessmentMembersGUI::class, 'view');
208  }
209  }
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 304 of file class.ilIndividualAssessmentMemberGUI.php.

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

Referenced by edit(), and saveAmend().

308  : void {
309  $member = $this->getMember()
310  ->withGrading($grading)
311  ;
312 
313  if ($amend) {
314  $member = $member->withChangerId($this->user->getId());
315  }
316 
317  if (!$keep_examiner) {
318  $member = $member->withExaminerId($this->user->getId());
319  }
320  $this->getObject()->membersStorage()->updateMember($member);
321  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setObject()

ilIndividualAssessmentMemberGUI::setObject ( ilObjIndividualAssessment  $object)

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

435  : void
436  {
437  $this->object = $object;
438  }

◆ setParentGUI()

ilIndividualAssessmentMemberGUI::setParentGUI ( ilIndividualAssessmentMembersGUI  $parent_gui)

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

445  : void
446  {
447  $this->parent_gui = $parent_gui;
448  }

◆ setToolbar()

ilIndividualAssessmentMemberGUI::setToolbar ( )
protected

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

References $url, ILIAS\Repository\ctrl(), getExaminee(), ILIAS\Survey\Mode\getId(), getMember(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

Referenced by amend(), and edit().

476  : void
477  {
478  $member = $this->getMember();
479  if ($member->fileName() != '') {
480  $this->ctrl->setParameter($this, 'usr_id', $this->getExaminee()->getId());
481  $url = $this->ctrl->getLinkTarget($this, self::CMD_DOWNLOAD_FILE, "", false, true);
482  $this->ctrl->setParameter($this, 'usr_id', null);
483  $btn = $this->link_factory->standard(
484  $this->lng->txt('download_assessment_paper'),
485  $url
486  );
487  $this->toolbar->addComponent($btn);
488  }
489  }
$url
Definition: ltiregstart.php:35
+ 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 527 of file class.ilIndividualAssessmentMemberGUI.php.

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

Referenced by userMayGrade().

527  : bool
528  {
529  return
530  (int) $member->examinerId() !== $this->user->getId() &&
531  0 !== (int) $member->examinerId()
532  ;
533  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userMayAmend()

ilIndividualAssessmentMemberGUI::userMayAmend ( )
protected

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

References getAccessHandler().

Referenced by mayBeAmended().

522  : bool
523  {
524  return $this->getAccessHandler()->mayAmendAllUsers();
525  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userMayGrade()

ilIndividualAssessmentMemberGUI::userMayGrade ( )
protected

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

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

Referenced by mayBeEdited(), and mayBeViewed().

509  : bool
510  {
511  return
512  $this->getAccessHandler()->isSystemAdmin() ||
513  (!$this->targetWasEditedByOtherUser($this->getMember()) && $this->getAccessHandler()->mayGradeUser($this->getMember()->id()))
514  ;
515  }
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 517 of file class.ilIndividualAssessmentMemberGUI.php.

References getAccessHandler(), and getMember().

Referenced by mayBeViewed().

517  : bool
518  {
519  return $this->getAccessHandler()->mayViewUser($this->getMember()->id());
520  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ view()

ilIndividualAssessmentMemberGUI::view ( )
protected

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

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

101  : void
102  {
103  if (!$this->mayBeViewed()) {
104  $this->handleAccessViolation();
105  return;
106  }
107  $form = $this->buildForm('', false);
108  $this->tpl->setContent($this->renderer->render($form));
109  }
buildForm(string $form_action, bool $may_be_edited, bool $amend=false)
+ Here is the call graph for this function:

Field Documentation

◆ $iass_access

ilIndividualAssessmentAccessHandler ilIndividualAssessmentMemberGUI::$iass_access = null
protected

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

Referenced by getAccessHandler().

◆ CMD_AMEND

const ilIndividualAssessmentMemberGUI::CMD_AMEND = 'amend'

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

◆ CMD_DOWNLOAD_FILE

const ilIndividualAssessmentMemberGUI::CMD_DOWNLOAD_FILE = "downloadFile"

◆ CMD_EDIT

const ilIndividualAssessmentMemberGUI::CMD_EDIT = 'edit'

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

◆ CMD_FINALIZE

const ilIndividualAssessmentMemberGUI::CMD_FINALIZE = 'finalize'

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

◆ CMD_FINALIZE_CONFIRMATION

const ilIndividualAssessmentMemberGUI::CMD_FINALIZE_CONFIRMATION = 'finalizeConfirmation'

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

◆ CMD_SAVE_AMEND

const ilIndividualAssessmentMemberGUI::CMD_SAVE_AMEND = "saveAmend"

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

◆ CMD_UPDATE

const ilIndividualAssessmentMemberGUI::CMD_UPDATE = 'update'

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

◆ CMD_VIEW

const ilIndividualAssessmentMemberGUI::CMD_VIEW = 'view'

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


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