ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilIndividualAssessmentMemberGUI Class Reference

For the purpose of streamlining the grading and learning-process status definition outside of tests, SCORM courses e.t.c. More...

+ Collaboration diagram for ilIndividualAssessmentMemberGUI:

Public Member Functions

 __construct ($members_gui, $a_parent_gui, $a_ref_id)
 
 executeCommand ()
 

Protected Member Functions

 view ()
 View grading informations for user. More...
 
 edit (ilPropertyFormGUI $form=null)
 Edit grading informations for user. More...
 
 downloadAttachment ()
 
 save ()
 Save grading informations for user. More...
 
 finalizeConfirmation ()
 Save grading informations and show confirmation form. More...
 
 finalize ()
 Finalize the grading. More...
 
 cancelFinalize ()
 Cancel finalizing and get back to edit form. More...
 
 amend ($form=null)
 Show grading form to amend the result. More...
 
 saveAmend ()
 Save changes of grading result. More...
 
 initGradingForm ($may_be_edited=true, $amend=false)
 Inint form for gradings. More...
 
 fileUploaded ()
 
 fillForm (ilPropertyFormGUI $a_form, ilIndividualAssessmentMember $member)
 Fill form with current grading informations. More...
 
 getFileLinkHTML ($amend=false)
 Render grading form into template. More...
 
 renderForm (ilPropertyFormGUI $form)
 Render the form and put it into template. More...
 
 setTabs (ilTabsGUI $tabs)
 Set tabs. More...
 
 getBackLink ()
 Get link for backlink. More...
 
 redirect ($cmd)
 Redirect to this with command. More...
 
 mayBeEdited ()
 Grading may be edited by current user. More...
 
 mayBeViewed ()
 Content of grading may be viewes by current user. More...
 
 mayBeAmended ()
 Grading may be edited by current user after finalization. More...
 
 userMayGrade ()
 Current user has permission to edit learning progess. More...
 
 userMayView ()
 Current user has permission to read learning progress. More...
 
 userMayAmend ()
 Current user has permission to amend grading. More...
 
 targetWasEditedByOtherUser (ilIndividualAssessmentMember $member)
 Grading was edited by an other user. More...
 
 isFinalized ()
 Is grading finalized. More...
 
 saveMember (array $post, $keep_examiner=false, $amend=false)
 Save grading informations. More...
 
 updateDataInMemberByArray (ilIndividualAssessmentMember $member, $data, $keep_examiner=false, $amend=false)
 Updates member object with new grading informations. More...
 
 uploadFile ($file)
 
 updateFileName ($file_name)
 

Protected Attributes

 $notificator
 

Private Member Functions

 createDatetime ($datetime)
 

Detailed Description

For the purpose of streamlining the grading and learning-process status definition outside of tests, SCORM courses e.t.c.

the IndividualAssessment is used. It caries a LPStatus, which is set Individually.

Author
Denis Klöpfer denis.nosp@m..klo.nosp@m.epfer.nosp@m.@con.nosp@m.cepts.nosp@m.-and.nosp@m.-trai.nosp@m.ning.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilIndividualAssessmentMemberGUI::__construct (   $members_gui,
  $a_parent_gui,
  $a_ref_id 
)

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

26 {
28 global $DIC;
29 $this->ctrl = $DIC['ilCtrl'];
30 $this->members_gui = $members_gui;
31 $this->parent_gui = $a_parent_gui;
32 $this->object = $a_parent_gui->object;
33 $this->ref_id = $a_ref_id;
34 $this->tpl = $DIC['tpl'];
35 $this->lng = $DIC['lng'];
36 $this->ctrl->saveParameter($this, 'usr_id');
37 $this->examinee = new ilObjUser($_GET['usr_id']);
38 $this->examiner = $DIC['ilUser'];
39 $this->changer = $DIC['ilUser'];
40 $this->setTabs($DIC['ilTabs']);
41 $this->member = $this->object->membersStorage()
42 ->loadMember($this->object, $this->examinee);
43 $this->access = $this->object->accessHandler();
44 $this->file_storage = $this->object->getFileStorage();
45 }
$_GET["client_id"]
global $DIC
Definition: saml.php:7

References $_GET, $DIC, and setTabs().

+ Here is the call graph for this function:

Member Function Documentation

◆ amend()

ilIndividualAssessmentMemberGUI::amend (   $form = null)
protected

Show grading form to amend the result.

Parameters
ilPropertyFormGUI  |  null$form
Returns
null

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

253 {
254 if (!$this->mayBeAmended()) {
255 $this->parent_gui->handleAccessViolation();
256 return;
257 }
258
259 if ($form === null) {
260 $form = $this->fillForm($this->initGradingForm(true, true), $this->member);
261 }
262
263 $form->addCommandButton('saveAmend', $this->lng->txt('iass_save_amend'));
264 $this->renderForm($form, $this->getFileLinkHTML(true));
265 }
mayBeAmended()
Grading may be edited by current user after finalization.
fillForm(ilPropertyFormGUI $a_form, ilIndividualAssessmentMember $member)
Fill form with current grading informations.
getFileLinkHTML($amend=false)
Render grading form into template.
renderForm(ilPropertyFormGUI $form)
Render the form and put it into template.
initGradingForm($may_be_edited=true, $amend=false)
Inint form for gradings.
if(isset($_POST['submit'])) $form

References $form, fillForm(), getFileLinkHTML(), initGradingForm(), mayBeAmended(), and renderForm().

Referenced by saveAmend().

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

◆ cancelFinalize()

ilIndividualAssessmentMemberGUI::cancelFinalize ( )
protected

Cancel finalizing and get back to edit form.

Returns
null

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

241 {
242 $this->edit();
243 }
edit(ilPropertyFormGUI $form=null)
Edit grading informations for user.

References edit().

+ Here is the call graph for this function:

◆ createDatetime()

ilIndividualAssessmentMemberGUI::createDatetime (   $datetime)
private

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

635 {
636 return new ilDateTime($datetime . " 00:00:00", IL_CAL_DATETIME);
637 }
const IL_CAL_DATETIME
@classDescription Date and time handling

References IL_CAL_DATETIME.

Referenced by updateDataInMemberByArray().

+ Here is the caller graph for this function:

◆ downloadAttachment()

ilIndividualAssessmentMemberGUI::downloadAttachment ( )
protected

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

107 {
108 if (!$this->mayBeEdited() && !$this->mayBeViewed() && !$this->mayBeAmended()) {
109 $this->parent_gui->handleAccessViolation();
110 return;
111 }
112 $file_storage = $this->object->getFileStorage();
113 $file_storage->setUserId($this->member->id());
114 ilUtil::deliverFile($file_storage->getFilePath(), $this->member->fileName());
115 }
mayBeEdited()
Grading may be edited by current user.
mayBeViewed()
Content of grading may be viewes by current user.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.

References ilUtil\deliverFile(), mayBeAmended(), mayBeEdited(), and mayBeViewed().

+ Here is the call graph for this function:

◆ edit()

ilIndividualAssessmentMemberGUI::edit ( ilPropertyFormGUI  $form = null)
protected

Edit grading informations for user.

Parameters
ilPropertyFormGUI  |  null$form
Returns
null

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

91 {
92 if (!$this->mayBeEdited()) {
93 $this->parent_gui->handleAccessViolation();
94 return;
95 }
96
97 if ($form === null) {
98 $form = $this->fillForm($this->initGradingForm(), $this->member);
99 }
100
101 $form->addCommandButton('save', $this->lng->txt('save'));
102 $form->addCommandButton('finalizeConfirmation', $this->lng->txt('iass_finalize'));
103 $this->renderForm($form);
104 }

References $form, fillForm(), initGradingForm(), mayBeEdited(), and renderForm().

Referenced by cancelFinalize(), finalizeConfirmation(), and save().

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

◆ executeCommand()

ilIndividualAssessmentMemberGUI::executeCommand ( )

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

48 {
49 $cmd = $this->ctrl->getCmd();
50 switch ($cmd) {
51 case 'view':
52 case 'edit':
53 case 'save':
54 case 'finalizeConfirmation':
55 case 'finalize':
56 case 'cancelFinalize':
57 case 'amend':
58 case 'saveAmend':
59 case 'downloadAttachment':
60 case 'deliverFile':
61 break;
62 default:
63 $this->parent_gui->handleAccessViolation();
64 }
65 $this->$cmd();
66 }

◆ fileUploaded()

ilIndividualAssessmentMemberGUI::fileUploaded ( )
protected

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

399 {
400 return $this->member->fileName() && $this->member->fileName() != "";
401 }

◆ fillForm()

ilIndividualAssessmentMemberGUI::fillForm ( ilPropertyFormGUI  $a_form,
ilIndividualAssessmentMember  $member 
)
protected

Fill form with current grading informations.

Parameters
ilPropertyFormGUI$a_form
ilIndividualAssessmentMember$member
Returns
ilPropertyFormGUI

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

412 {
413 $a_form->setValuesByArray(array(
414 'name' => $member->name()
415 , 'record' => $member->record()
416 , 'internal_note' => $member->internalNote()
417 , 'place' => $member->place()
418 , 'event_time' => $member->eventTime()
419 , 'notify' => $member->notify()
420 , 'learning_progress' => (int) $member->LPStatus()
421 , 'file_visible_examinee' => (int) $member->viewFile()
422 , 'file_name' => $this->getFileLinkHTML()
423 ));
424 return $a_form;
425 }
viewFile()
Can user see the uploaded file.
LPStatus()
Get the LP-status corresponding to this membership.
notify()
Will the user be notified after finalization?
name()
Get the examinee name corresponding to this membership.
setValuesByArray($a_values, $a_restrict_to_value_keys=false)
Set form values from an array.

References ilIndividualAssessmentMember\eventTime(), ilIndividualAssessmentMember\internalNote(), ilIndividualAssessmentMember\LPStatus(), ilIndividualAssessmentMember\name(), ilIndividualAssessmentMember\notify(), ilIndividualAssessmentMember\place(), ilIndividualAssessmentMember\record(), ilPropertyFormGUI\setValuesByArray(), and ilIndividualAssessmentMember\viewFile().

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

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

◆ finalize()

ilIndividualAssessmentMemberGUI::finalize ( )
protected

Finalize the grading.

Returns
null

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

212 {
213 if (!$this->mayBeEdited()) {
214 $this->parent_gui->handleAccessViolation();
215 return;
216 }
217
218 if (!$this->member->mayBeFinalized()) {
219 ilUtil::sendFailure($this->lng->txt('iass_may_not_finalize'), true);
220 $this->redirect('edit');
221 return;
222 }
223
224 $this->member = $this->member->withFinalized();
225 $this->object->membersStorage()->updateMember($this->member);
226 if ($this->object->isActiveLP()) {
228 }
229 $this->member->maybeSendNotification($this->notificator);
230
231 ilUtil::sendSuccess($this->lng->txt('iass_membership_finalized'), true);
232 $this->redirect('view');
233 }
static updateLPStatusOfMember(ilIndividualAssessmentMember $member)
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References mayBeEdited(), redirect(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilIndividualAssessmentLPInterface\updateLPStatusOfMember().

+ Here is the call graph for this function:

◆ finalizeConfirmation()

ilIndividualAssessmentMemberGUI::finalizeConfirmation ( )
protected

Save grading informations and show confirmation form.

Returns
null

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

160 {
161 if (!$this->mayBeEdited()) {
162 $this->parent_gui->handleAccessViolation();
163 return;
164 }
165
166 $new_file = null;
167 $form = $this->initGradingForm();
168 $item = $form->getItemByPostVar('file');
169 if ($item && $item->checkInput()) {
170 $post = $_POST;
171 $new_file = $this->uploadFile($post["file"]);
172 if ($new_file) {
173 $this->updateFileName($post['file']['name']);
174 }
175 }
176
177 $form->setValuesByArray(array('file' => $this->member->fileName()));
178 if (!$form->checkInput()) {
179 $form->setValuesByPost();
180 $this->edit($form);
181 return;
182 }
183
184 $this->saveMember($_POST);
185
186 if (!$this->member->mayBeFinalized()) {
187 ilUtil::sendFailure($this->lng->txt('iass_may_not_finalize'), true);
188 $this->redirect('edit');
189 }
190
191 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
192 $confirm = new ilConfirmationGUI();
193 $confirm->addHiddenItem('record', $_POST['record']);
194 $confirm->addHiddenItem('internal_note', $_POST['internal_note']);
195 $confirm->addHiddenItem('notify', $_POST['notify']);
196 $confirm->addHiddenItem('learning_progress', $_POST['learning_progress']);
197 $confirm->addHiddenItem('place', $_POST['place']);
198 $confirm->addHiddenItem('event_time', $_POST['event_time']);
199 $confirm->setHeaderText($this->lng->txt('iass_finalize_user_qst'));
200 $confirm->setFormAction($this->ctrl->getFormAction($this));
201 $confirm->setConfirm($this->lng->txt('iass_finalize'), 'finalize');
202 $confirm->setCancel($this->lng->txt('cancel'), 'save');
203 $this->tpl->setContent($confirm->getHTML());
204 }
$_POST["username"]
Confirmation screen class.
saveMember(array $post, $keep_examiner=false, $amend=false)
Save grading informations.
$post
Definition: post.php:34

References $_POST, $form, $post, edit(), initGradingForm(), mayBeEdited(), redirect(), saveMember(), ilUtil\sendFailure(), updateFileName(), and uploadFile().

+ Here is the call graph for this function:

◆ getBackLink()

ilIndividualAssessmentMemberGUI::getBackLink ( )
protected

Get link for backlink.

Returns
string

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

476 {
477 return $this->ctrl->getLinkTargetByClass(
478 array(get_class($this->parent_gui)
479 ,get_class($this->members_gui)),
480 'view'
481 );
482 }

◆ getFileLinkHTML()

ilIndividualAssessmentMemberGUI::getFileLinkHTML (   $amend = false)
protected

Render grading form into template.

Parameters
ilPropertyFormGUI$form

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

433 {
434 $html = '';
435 if ($this->member->fileName() && $this->member->fileName() != "") {
436 $tpl = new ilTemplate("tpl.iass_user_file_download.html", true, true, "Modules/IndividualAssessment");
437 if (!$this->member->finalized() || $amend) {
438 $tpl->setVariable("FILE_NAME", $this->member->fileName());
439 }
440 $tpl->setVariable("HREF", $this->ctrl->getLinkTarget($this, "downloadAttachment"));
441 $html .= $tpl->get();
442 }
443 return $html;
444 }
$tpl
Definition: ilias.php:10
special template class to simplify handling of ITX/PEAR
$html
Definition: example_001.php:87

References $html, and $tpl.

Referenced by amend(), and initGradingForm().

+ Here is the caller graph for this function:

◆ initGradingForm()

ilIndividualAssessmentMemberGUI::initGradingForm (   $may_be_edited = true,
  $amend = false 
)
protected

Inint form for gradings.

Parameters
bool$may_be_edite
Returns
ilPropertyFormGUI

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

313 {
314 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
315 $form = new ilPropertyFormGUI();
316 $form->setFormAction($this->ctrl->getFormAction($this));
317 $form->setTitle($this->lng->txt('iass_edit_record'));
318
319 $examinee_name = $this->examinee->getLastname() . ', ' . $this->examinee->getFirstname();
320
321 $usr_name = new ilNonEditableValueGUI($this->lng->txt('name'), 'name');
322 $form->addItem($usr_name);
323 // record
324 $ti = new ilTextAreaInputGUI($this->lng->txt('iass_record'), 'record');
325 $ti->setInfo($this->lng->txt('iass_record_info'));
326 $ti->setCols(40);
327 $ti->setRows(5);
328 $ti->setDisabled(!$may_be_edited);
329 $form->addItem($ti);
330
331 // description
332 $ta = new ilTextAreaInputGUI($this->lng->txt('iass_internal_note'), 'internal_note');
333 $ta->setInfo($this->lng->txt('iass_internal_note_info'));
334 $ta->setCols(40);
335 $ta->setRows(5);
336 $ta->setDisabled(!$may_be_edited);
337 $form->addItem($ta);
338
339 if ($this->member->finalized() && !$amend) {
340 $link = $this->getFileLinkHTML(true);
341 if ($link !== "") {
342 $filelink = new ilNonEditableValueGUI($this->lng->txt('iass_upload_file'), '', true);
343 $filelink->setValue($link);
344 $form->addItem($filelink);
345 }
346 } else {
347 $title = $this->lng->txt('iass_upload_file');
348 $link = $this->getFileLinkHTML(true);
349 if ($link !== "") {
350 $filelink = new ilNonEditableValueGUI($title, '', true);
351 $filelink->setValue($link);
352 $form->addItem($filelink);
353 $title = "";
354 }
355 $file = new ilFileInputGUI($title, 'file');
356 $file->setRequired($this->object->getSettings()->fileRequired() && !$this->fileUploaded());
357 $file->setDisabled(!$may_be_edited);
358 $file->setAllowDeletion(false);
359 $form->addItem($file);
360 }
361
362
363 $file_visible_to_examinee = new ilCheckboxInputGUI($this->lng->txt('iass_file_visible_examinee'), 'file_visible_examinee');
364 $file_visible_to_examinee->setDisabled(!$may_be_edited);
365 $form->addItem($file_visible_to_examinee);
366
367
368 $learning_progress = new ilSelectInputGUI($this->lng->txt('grading'), 'learning_progress');
369 $learning_progress->setOptions(
370 array(ilIndividualAssessmentMembers::LP_IN_PROGRESS => $this->lng->txt('iass_status_pending')
371 , ilIndividualAssessmentMembers::LP_COMPLETED => $this->lng->txt('iass_status_completed')
372 , ilIndividualAssessmentMembers::LP_FAILED => $this->lng->txt('iass_status_failed'))
373 );
374 $learning_progress->setDisabled(!$may_be_edited);
375 $form->addItem($learning_progress);
376
377 $settings = $this->object->getSettings();
378 $txt = new ilTextInputGUI($this->lng->txt('iass_place'), 'place');
379 $txt->setRequired($settings->eventTimePlaceRequired());
380 $txt->setDisabled(!$may_be_edited);
381 $form->addItem($txt);
382
383 $date = new ilDateTimeInputGUI($this->lng->txt('iass_event_time'), 'event_time');
384 $date->setShowTime(false);
385 $date->setRequired($settings->eventTimePlaceRequired());
386 $date->setDisabled(!$may_be_edited);
387 $form->addItem($date);
388
389 // notify examinee
390 $notify = new ilCheckboxInputGUI($this->lng->txt('iass_notify'), 'notify');
391 $notify->setInfo($this->lng->txt('iass_notify_explanation'));
392 $notify->setDisabled(!$may_be_edited);
393 $form->addItem($notify);
394
395 return $form;
396 }
This class represents a checkbox property in a property form.
This class represents a date/time property in a property form.
This class represents a file property in a property form.
This class represents a non editable value in a property form.
This class represents a property form user interface.
This class represents a selection list property in a property form.
This class represents a text area property in a property form.
This class represents a text property in a property form.
$txt
Definition: error.php:11
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

References $file, $form, $title, $txt, getFileLinkHTML(), ilIndividualAssessmentMembers\LP_COMPLETED, ilIndividualAssessmentMembers\LP_FAILED, and ilIndividualAssessmentMembers\LP_IN_PROGRESS.

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

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

◆ isFinalized()

ilIndividualAssessmentMemberGUI::isFinalized ( )
protected

Is grading finalized.

Returns
bool

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

579 {
580 return $this->member->finalized();
581 }

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

+ Here is the caller graph for this function:

◆ mayBeAmended()

ilIndividualAssessmentMemberGUI::mayBeAmended ( )
protected

Grading may be edited by current user after finalization.

Returns
bool

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

524 {
525 return $this->access->isSystemAdmin()
526 || ($this->isFinalized() && $this->userMayAmend());
527 }
userMayAmend()
Current user has permission to amend grading.

References isFinalized(), and userMayAmend().

Referenced by amend(), downloadAttachment(), and saveAmend().

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

◆ mayBeEdited()

ilIndividualAssessmentMemberGUI::mayBeEdited ( )
protected

Grading may be edited by current user.

Returns
bool

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

502 {
503 return $this->access->isSystemAdmin()
504 || (!$this->isFinalized() && $this->userMayGrade());
505 }
userMayGrade()
Current user has permission to edit learning progess.

References isFinalized(), and userMayGrade().

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

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

◆ mayBeViewed()

ilIndividualAssessmentMemberGUI::mayBeViewed ( )
protected

Content of grading may be viewes by current user.

Returns
bool

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

513 {
514 return $this->access->isSystemAdmin()
515 || ($this->isFinalized() && ($this->userMayGrade() || $this->userMayView()));
516 }
userMayView()
Current user has permission to read learning progress.

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

Referenced by downloadAttachment(), and view().

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

◆ redirect()

ilIndividualAssessmentMemberGUI::redirect (   $cmd)
protected

Redirect to this with command.

Parameters
string$cmd
Returns
null

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

492 {
493 $this->ctrl->redirect($this, $cmd);
494 }

Referenced by finalize(), finalizeConfirmation(), save(), and saveAmend().

+ Here is the caller graph for this function:

◆ renderForm()

ilIndividualAssessmentMemberGUI::renderForm ( ilPropertyFormGUI  $form)
protected

Render the form and put it into template.

Parameters
ilPropertyFormGUI$form

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

452 {
453 $this->tpl->setContent($form->getHTML());
454 }

References $form.

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

+ Here is the caller graph for this function:

◆ save()

ilIndividualAssessmentMemberGUI::save ( )
protected

Save grading informations for user.

Returns
null

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

123 {
124 if (!$this->mayBeEdited()) {
125 $this->parent_gui->handleAccessViolation();
126 return;
127 }
128
129 $form = $this->initGradingForm();
130 $item = $form->getItemByPostVar('file');
131 if ($item && $item->checkInput()) {
132 $post = $_POST;
133 $new_file = $this->uploadFile($post["file"]);
134 if ($new_file) {
135 $this->updateFileName($post['file']['name']);
136 }
137 }
138
139 $form->setValuesByArray(array('file' => $this->member->fileName()));
140 if (!$form->checkInput()) {
141 $form->setValuesByPost();
142 $this->edit($form);
143 return;
144 }
145
146 $this->saveMember($_POST);
147 if ($this->object->isActiveLP()) {
149 }
150 ilUtil::sendSuccess($this->lng->txt('iass_membership_saved'), true);
151 $this->redirect('edit');
152 }

References $_POST, $form, $post, edit(), initGradingForm(), mayBeEdited(), redirect(), saveMember(), ilUtil\sendSuccess(), updateFileName(), ilIndividualAssessmentLPInterface\updateLPStatusOfMember(), and uploadFile().

+ Here is the call graph for this function:

◆ saveAmend()

ilIndividualAssessmentMemberGUI::saveAmend ( )
protected

Save changes of grading result.

Returns
null

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

273 {
274 if (!$this->mayBeAmended()) {
275 $this->parent_gui->handleAccessViolation();
276 return;
277 }
278 $new_file = null;
279 $form = $this->initGradingForm(true, true);
280 $item = $form->getItemByPostVar('file');
281 if ($item && $item->checkInput()) {
282 $post = $_POST;
283 $new_file = $this->uploadFile($post["file"]);
284 if ($new_file) {
285 $this->updateFileName($post['file']['name']);
286 }
287 }
288 $form->setValuesByArray(array('file' => $this->member->fileName()));
289 if (!$form->checkInput()) {
290 $form->setValuesByPost();
291 $this->amend($form);
292 return;
293 }
294
295 $this->saveMember($_POST, true, true);
296
297 if ($this->object->isActiveLP()) {
299 }
300
301 ilUtil::sendSuccess($this->lng->txt('iass_amend_saved'), true);
302 $this->redirect("amend");
303 }
amend($form=null)
Show grading form to amend the result.

References $_POST, $form, $post, amend(), initGradingForm(), mayBeAmended(), redirect(), saveMember(), ilUtil\sendSuccess(), updateFileName(), ilIndividualAssessmentLPInterface\updateLPStatusOfMember(), and uploadFile().

+ Here is the call graph for this function:

◆ saveMember()

ilIndividualAssessmentMemberGUI::saveMember ( array  $post,
  $keep_examiner = false,
  $amend = false 
)
protected

Save grading informations.

Parameters
string[]$post
bool$keep_examiner
Returns
null

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

592 {
593 $this->member = $this->updateDataInMemberByArray($this->member, $post, $keep_examiner, $amend);
594 $this->object->membersStorage()->updateMember($this->member);
595 }
updateDataInMemberByArray(ilIndividualAssessmentMember $member, $data, $keep_examiner=false, $amend=false)
Updates member object with new grading informations.

References $post, and updateDataInMemberByArray().

Referenced by finalizeConfirmation(), save(), and saveAmend().

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

◆ setTabs()

ilIndividualAssessmentMemberGUI::setTabs ( ilTabsGUI  $tabs)
protected

Set tabs.

Returns
null

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

462 {
463 $tabs->clearTargets();
464 $tabs->setBackTarget(
465 $this->lng->txt('back'),
466 $this->getBackLink()
467 );
468 }
if(!empty($this->data['faventry'])) $tabs
Definition: disco.tpl.php:124

References $tabs.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ targetWasEditedByOtherUser()

ilIndividualAssessmentMemberGUI::targetWasEditedByOtherUser ( ilIndividualAssessmentMember  $member)
protected

Grading was edited by an other user.

Returns
bool

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

568 {
569 return (int) $member->examinerId() !== (int) $this->examiner->getId()
570 && 0 !== (int) $member->examinerId();
571 }
examinerId()
Get the user id of the examiner.

References ilIndividualAssessmentMember\examinerId().

Referenced by userMayGrade().

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

◆ updateDataInMemberByArray()

ilIndividualAssessmentMemberGUI::updateDataInMemberByArray ( ilIndividualAssessmentMember  $member,
  $data,
  $keep_examiner = false,
  $amend = false 
)
protected

Updates member object with new grading informations.

Parameters
ilIndividualAssessmentMember$member
string[]$data
bool$keep_examiner
Returns
ilIndividualAssessmentMember

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

607 {
608 $member = $member->withRecord($data['record'])
609 ->withInternalNote($data['internal_note'])
610 ->withPlace($data['place'])
611 ->withLPStatus($data['learning_progress'])
612 ->withViewFile((bool) $data['file_visible_examinee']);
613 if ($data['event_time']) {
614 $member = $member->withEventTime($this->createDatetime($data['event_time']));
615 }
616 if ($amend) {
617 $member = $member->withChangerId($this->changer->getId());
618 }
619 if (!$keep_examiner) {
620 $member = $member->withExaminerId($this->examiner->getId());
621 }
622
623 if ($data['notify'] == 1) {
624 $member = $member->withNotify(true);
625 } else {
626 $member = $member->withNotify(false);
627 }
628 if ($new_file) {
629 $member = $member->withFileName($data['file']['name']);
630 }
631 return $member;
632 }
withExaminerId($examiner_id)
Clone this object and set an examiner_id.
withEventTime($event_time)
Clone this object and set an internal note.
withRecord($record)
Clone this object and set a record.
withNotify($notify)
Clone this object and set wether the examinee should be notified.
withChangerId($changer_id)
Clone this object and set an changer_id.
withFileName($file_name)
Set the name of the file.

References $data, createDatetime(), ilIndividualAssessmentMember\withChangerId(), ilIndividualAssessmentMember\withEventTime(), ilIndividualAssessmentMember\withExaminerId(), ilIndividualAssessmentMember\withFileName(), ilIndividualAssessmentMember\withNotify(), and ilIndividualAssessmentMember\withRecord().

Referenced by saveMember().

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

◆ updateFileName()

ilIndividualAssessmentMemberGUI::updateFileName (   $file_name)
protected

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

653 {
654 $this->member = $this->member->withFileName($file_name);
655 $this->object->membersStorage()->updateMember($this->member);
656 }

Referenced by finalizeConfirmation(), save(), and saveAmend().

+ Here is the caller graph for this function:

◆ uploadFile()

ilIndividualAssessmentMemberGUI::uploadFile (   $file)
protected

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

640 {
641 $new_file = false;
642 $this->file_storage->setUserId($this->member->id());
643 $this->file_storage->create();
644 if (!$file["name"] == "") {
645 $this->file_storage->deleteCurrentFile();
646 $this->file_storage->uploadFile($file);
647 $new_file = true;
648 }
649 return $new_file;
650 }

References $file.

Referenced by finalizeConfirmation(), save(), and saveAmend().

+ Here is the caller graph for this function:

◆ userMayAmend()

ilIndividualAssessmentMemberGUI::userMayAmend ( )
protected

Current user has permission to amend grading.

Returns
bool

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

557 {
558 return $this->access->isSystemAdmin()
559 || $this->access->mayAmendGradeUser();
560 }

Referenced by mayBeAmended().

+ Here is the caller graph for this function:

◆ userMayGrade()

ilIndividualAssessmentMemberGUI::userMayGrade ( )
protected

Current user has permission to edit learning progess.

Returns
bool

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

535 {
536 return $this->access->isSystemAdmin()
537 || (!$this->targetWasEditedByOtherUser($this->member) && $this->access->mayGradeUser());
538 }
targetWasEditedByOtherUser(ilIndividualAssessmentMember $member)
Grading was edited by an other user.

References targetWasEditedByOtherUser().

Referenced by mayBeEdited(), and mayBeViewed().

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

◆ userMayView()

ilIndividualAssessmentMemberGUI::userMayView ( )
protected

Current user has permission to read learning progress.

Returns
bool

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

546 {
547 return $this->access->isSystemAdmin()
548 || $this->access->mayViewUser();
549 }

Referenced by mayBeViewed().

+ Here is the caller graph for this function:

◆ view()

ilIndividualAssessmentMemberGUI::view ( )
protected

View grading informations for user.

Returns
null

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

74 {
75 if (!$this->mayBeViewed()) {
76 $this->parent_gui->handleAccessViolation();
77 return;
78 }
79 $form = $this->fillForm($this->initGradingForm(false), $this->member);
80 $this->renderForm($form);
81 }

References $form, fillForm(), initGradingForm(), mayBeViewed(), and renderForm().

+ Here is the call graph for this function:

Field Documentation

◆ $notificator

ilIndividualAssessmentMemberGUI::$notificator
protected

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


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