ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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

 setTabs (ilTabsGUI $tabs)
 
 getBackLink ()
 
 cancel ()
 
 finalizeConfirmation ()
 
 finalize ()
 
 mayBeEdited ()
 
 edit ()
 
 renderForm (ilPropertyFormGUI $a_form)
 
 view ()
 
 save ()
 
 updateDataInMemberByArray (ilIndividualAssessmentMember $member, $data)
 
 initGradingForm ($may_be_edited=true)
 
 fillForm (ilPropertyFormGUI $a_form, ilIndividualAssessmentMember $member)
 
 targetWasEditedByOtherUser (ilIndividualAssessmentMember $member)
 

Protected Attributes

 $notificator
 

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

Constructor & Destructor Documentation

◆ __construct()

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

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

22 {
24 global $DIC;
25 $this->ctrl = $DIC['ilCtrl'];
26 $this->members_gui = $members_gui;
27 $this->parent_gui = $a_parent_gui;
28 $this->object = $a_parent_gui->object;
29 $this->ref_id = $a_ref_id;
30 $this->tpl = $DIC['tpl'];
31 $this->lng = $DIC['lng'];
32 $this->ctrl->saveParameter($this,'usr_id');
33 $this->examinee = new ilObjUser($_GET['usr_id']);
34 $this->examiner = $DIC['ilUser'];
35 $this->setTabs($DIC['ilTabs']);
36 $this->member = $this->object->membersStorage()
37 ->loadMember($this->object, $this->examinee);
38 }
$_GET["client_id"]
global $DIC

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

+ Here is the call graph for this function:

Member Function Documentation

◆ cancel()

ilIndividualAssessmentMemberGUI::cancel ( )
protected

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

83 {
84 $this->ctrl->redirect($this->members_gui);
85 }

◆ edit()

ilIndividualAssessmentMemberGUI::edit ( )
protected

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

148 {
149 if($this->mayBeEdited()) {
150 $this->parent_gui->setScreenId("iass", "member", "edit");
151 $form = $this->fillForm($this->initGradingForm(),$this->member);
152 $this->renderForm($form);
153 } else {
154 $this->view();
155 }
156 }
fillForm(ilPropertyFormGUI $a_form, ilIndividualAssessmentMember $member)

References fillForm(), initGradingForm(), mayBeEdited(), renderForm(), and view().

Referenced by finalize(), and finalizeConfirmation().

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

◆ executeCommand()

ilIndividualAssessmentMemberGUI::executeCommand ( )

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

40 {
41 $edited_by_other = $this->targetWasEditedByOtherUser($this->member);
42 $read_permission = $this->object->accessHandler()->checkAccessToObj($this->object,'read_learning_progress');
43 $edit_permission = $this->object->accessHandler()->checkAccessToObj($this->object,'edit_learning_progress');
44 if(!$read_permission && !$edit_permission) {
45 $a_parent_gui->handleAccessViolation();
46 }
47 $cmd = $this->ctrl->getCmd();
48 switch($cmd) {
49 case 'edit':
50 case 'save':
51 case 'finalize':
52 case 'finalizeConfirmation':
53 if($edited_by_other || !$edit_permission) {
54 $a_parent_gui->handleAccessViolation();
55 }
56 break;
57 case 'view':
58 if(($edited_by_other || !$edit_permission) && !$read_permission) {
59 $a_parent_gui->handleAccessViolation();
60 }
61 break;
62 case 'cancel':
63 break;
64 default:
65 $a_parent_gui->handleAccessViolation();
66 }
67 $this->$cmd();
68 }
targetWasEditedByOtherUser(ilIndividualAssessmentMember $member)
$cmd
Definition: sahs_server.php:35

References $cmd, and targetWasEditedByOtherUser().

+ Here is the call graph for this function:

◆ fillForm()

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

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

244 {
245 $a_form->setValuesByArray(array(
246 'name' => $member->name()
247 , 'record' => $member->record()
248 , 'internal_note' => $member->internalNote()
249 , 'notify' => $member->notify()
250 , 'learning_progress' => (int)$member->LPStatus()
251 ));
252 return $a_form;
253 }
LPStatus()
Get the LP-status corresponding to this membership.
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\internalNote(), ilIndividualAssessmentMember\LPStatus(), ilIndividualAssessmentMember\name(), ilIndividualAssessmentMember\notify(), ilIndividualAssessmentMember\record(), and ilPropertyFormGUI\setValuesByArray().

Referenced by edit(), and view().

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

◆ finalize()

ilIndividualAssessmentMemberGUI::finalize ( )
protected

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

118 {
119 if($this->mayBeEdited()) {
120 $form = $this->initGradingForm();
121 $form->setValuesByArray($_POST);
122 if($form->checkInput()) {
123 $member = $this->updateDataInMemberByArray($this->member,$_POST);
124 if($member->mayBeFinalized()) {
125 $this->member = $member->withFinalized()->maybeSendNotification($this->notificator);
126 $this->object->membersStorage()->updateMember($this->member);
127 ilUtil::sendSuccess($this->lng->txt('iass_membership_finalized'));
128 if($this->object->isActiveLP()) {
130 }
131 $this->view();
132 } else {
133 ilUtil::sendFailure($this->lng->txt('iass_may_not_finalize'));
134 $this->edit();
135 }
136 } else {
137 $this->edit();
138 }
139 } else {
140 $this->view();
141 }
142 }
$_POST["username"]
static updateLPStatusOfMember(ilIndividualAssessmentMember $member)
updateDataInMemberByArray(ilIndividualAssessmentMember $member, $data)
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 $_POST, edit(), initGradingForm(), mayBeEdited(), ilUtil\sendFailure(), ilUtil\sendSuccess(), updateDataInMemberByArray(), ilIndividualAssessmentLPInterface\updateLPStatusOfMember(), and view().

+ Here is the call graph for this function:

◆ finalizeConfirmation()

ilIndividualAssessmentMemberGUI::finalizeConfirmation ( )
protected

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

87 {
88 if($this->mayBeEdited()) {
89 $form = $this->initGradingForm();
90 $form->setValuesByArray($_POST);
91 if($form->checkInput()) {
92 $member = $this->updateDataInMemberByArray($this->member,$_POST);
93 if($member->mayBeFinalized()) {
94 $this->parent_gui->setScreenId("iass", "member", "finalizeConfirmation");
95 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
96 $confirm = new ilConfirmationGUI();
97 $confirm->addHiddenItem('record', $_POST['record']);
98 $confirm->addHiddenItem('internal_note', $_POST['internal_note']);
99 $confirm->addHiddenItem('notify', $_POST['notify']);
100 $confirm->addHiddenItem('learning_progress',$_POST['learning_progress']);
101 $confirm->setHeaderText($this->lng->txt('iass_finalize_user_qst'));
102 $confirm->setFormAction($this->ctrl->getFormAction($this));
103 $confirm->setConfirm($this->lng->txt('iass_finalize'), 'finalize');
104 $confirm->setCancel($this->lng->txt('cancel'), 'save');
105 $this->tpl->setContent($confirm->getHTML());
106 } else {
107 ilUtil::sendFailure($this->lng->txt('iass_may_not_finalize'));
108 $this->edit();
109 }
110 } else {
111 $this->edit();
112 }
113 } else {
114 $this->view();
115 }
116 }
Confirmation screen class.

References $_POST, edit(), initGradingForm(), mayBeEdited(), ilUtil\sendFailure(), updateDataInMemberByArray(), and view().

+ Here is the call graph for this function:

◆ getBackLink()

ilIndividualAssessmentMemberGUI::getBackLink ( )
protected

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

76 {
77 return $this->ctrl->getLinkTargetByClass(
78 array(get_class($this->parent_gui)
79 ,get_class($this->members_gui))
80 ,'view');
81 }

◆ initGradingForm()

ilIndividualAssessmentMemberGUI::initGradingForm (   $may_be_edited = true)
protected

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

196 {
197 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
198 $form = new ilPropertyFormGUI();
199 $form->setFormAction($this->ctrl->getFormAction($this));
200 $form->setTitle($this->lng->txt('iass_edit_record'));
201
202 $examinee_name = $this->examinee->getLastname().', '.$this->examinee->getFirstname();
203
204 $usr_name = new ilNonEditableValueGUI($this->lng->txt('name'),'name');
205 $form->addItem($usr_name);
206 // record
207 $ti = new ilTextAreaInputGUI($this->lng->txt('iass_record'), 'record');
208 $ti->setInfo($this->lng->txt('iass_record_info'));
209 $ti->setCols(40);
210 $ti->setRows(5);
211 $ti->setDisabled(!$may_be_edited);
212 $form->addItem($ti);
213
214 // description
215 $ta = new ilTextAreaInputGUI($this->lng->txt('iass_internal_note'), 'internal_note');
216 $ta->setInfo($this->lng->txt('iass_internal_note_info'));
217 $ta->setCols(40);
218 $ta->setRows(5);
219 $ta->setDisabled(!$may_be_edited);
220 $form->addItem($ta);
221
222 $learning_progress = new ilSelectInputGUI($this->lng->txt('grading'),'learning_progress');
223 $learning_progress->setOptions(
224 array(ilIndividualAssessmentMembers::LP_IN_PROGRESS => $this->lng->txt('iass_status_pending')
225 , ilIndividualAssessmentMembers::LP_COMPLETED => $this->lng->txt('iass_status_completed')
226 , ilIndividualAssessmentMembers::LP_FAILED => $this->lng->txt('iass_status_failed')));
227 $learning_progress->setDisabled(!$may_be_edited);
228 $form->addItem($learning_progress);
229
230 // notify examinee
231 $notify = new ilCheckboxInputGUI($this->lng->txt('iass_notify'), 'notify');
232 $notify->setInfo($this->lng->txt('iass_notify_explanation'));
233 $notify->setDisabled(!$may_be_edited);
234 $form->addItem($notify);
235
236 if($may_be_edited) {
237 $form->addCommandButton('save', $this->lng->txt('save'));
238 $form->addCommandButton('finalizeConfirmation',$this->lng->txt('iass_finalize'));
239 }
240 $form->addCommandButton('cancel', $this->lng->txt('iass_return'));
241 return $form;
242 }
This class represents a checkbox 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.

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

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

+ Here is the caller graph for this function:

◆ mayBeEdited()

ilIndividualAssessmentMemberGUI::mayBeEdited ( )
protected

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

144 {
145 return !$this->member->finalized() && !$this->targetWasEditedByOtherUser($this->member);
146 }

References targetWasEditedByOtherUser().

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

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

◆ renderForm()

ilIndividualAssessmentMemberGUI::renderForm ( ilPropertyFormGUI  $a_form)
protected

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

158 {
159 $this->tpl->setContent($a_form->getHTML());
160 }

References ilPropertyFormGUI\getHTML().

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

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

◆ save()

ilIndividualAssessmentMemberGUI::save ( )
protected

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

168 {
169 if($this->mayBeEdited()) {
170 $this->parent_gui->setScreenId("iass", "member", "save");
171 $form = $this->initGradingForm();
172 $form->setValuesByArray($_POST);
173 if($form->checkInput()) {
174 $this->member = $this->updateDataInMemberByArray($this->member,$_POST);
175 $this->object->membersStorage()->updateMember($this->member);
176 ilUtil::sendSuccess($this->lng->txt('iass_membership_saved'));
177 if($this->object->isActiveLP()) {
179 }
180 }
181 $this->renderForm($form);
182 } else {
183 $this->view();
184 }
185 }

References $_POST, initGradingForm(), mayBeEdited(), renderForm(), ilUtil\sendSuccess(), updateDataInMemberByArray(), ilIndividualAssessmentLPInterface\updateLPStatusOfMember(), and view().

+ Here is the call graph for this function:

◆ setTabs()

ilIndividualAssessmentMemberGUI::setTabs ( ilTabsGUI  $tabs)
protected

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

70 {
71 $tabs->clearTargets();
72 $tabs->setBackTarget($this->lng->txt('back'),
73 $this->getBackLink());
74 }
clearTargets()
clear all targets
setBackTarget($a_title, $a_target, $a_frame="")
back target for upper context

References ilTabsGUI\clearTargets(), and ilTabsGUI\setBackTarget().

Referenced by __construct().

+ 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 255 of file class.ilIndividualAssessmentMemberGUI.php.

255 {
256 return (int)$member->examinerId() !== (int)$this->examiner->getId()
257 && 0 !== (int)$member->examinerId();
258 }
examinerId()
Get the user id of the examiner.

References ilIndividualAssessmentMember\examinerId().

Referenced by executeCommand(), and mayBeEdited().

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

◆ updateDataInMemberByArray()

ilIndividualAssessmentMemberGUI::updateDataInMemberByArray ( ilIndividualAssessmentMember  $member,
  $data 
)
protected

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

187 {
188 $member = $member->withRecord($data['record'])
189 ->withInternalNote($data['internal_note'])
190 ->withLPStatus($data['learning_progress'])
191 ->withExaminerId($this->examiner->getId())
192 ->withNotify(($data['notify'] == 1 ? true : false));
193 return $member;
194 }
withRecord($record)
Clone this object and set a record.

References $data, and ilIndividualAssessmentMember\withRecord().

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

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

◆ view()

ilIndividualAssessmentMemberGUI::view ( )
protected

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

162 {
163 $this->parent_gui->setScreenId("iass", "member", "view");
164 $form = $this->fillForm($this->initGradingForm(false),$this->member);
165 $this->renderForm($form);
166 }

References fillForm(), initGradingForm(), and renderForm().

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

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

Field Documentation

◆ $notificator

ilIndividualAssessmentMemberGUI::$notificator
protected

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


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