3 require_once
'Services/Form/classes/class.ilTextAreaInputGUI.php';
4 require_once
'Services/Form/classes/class.ilTextInputGUI.php';
5 require_once
'Services/Form/classes/class.ilCheckboxInputGUI.php';
6 require_once
'Services/Form/classes/class.ilNonEditableValueGUI.php';
7 require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
8 require_once
'Modules/IndividualAssessment/classes/LearningProgress/class.ilIndividualAssessmentLPInterface.php';
9 require_once
'Modules/IndividualAssessment/classes/Notification/class.ilIndividualAssessmentPrimitiveInternalNotificator.php';
10 require_once
'Modules/IndividualAssessment/classes/class.ilIndividualAssessmentLP.php';
11 require_once
'Modules/IndividualAssessment/classes/FileStorage/class.ilIndividualAssessmentFileStorage.php';
12 require_once
'Services/Form/classes/class.ilFileInputGUI.php';
25 public function __construct($members_gui, $a_parent_gui, $a_ref_id)
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');
38 $this->examiner = $DIC[
'ilUser'];
39 $this->changer = $DIC[
'ilUser'];
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();
49 $cmd = $this->ctrl->getCmd();
54 case 'finalizeConfirmation':
56 case 'cancelFinalize':
59 case 'downloadAttachment':
63 $this->parent_gui->handleAccessViolation();
76 $this->parent_gui->handleAccessViolation();
93 $this->parent_gui->handleAccessViolation();
101 $form->addCommandButton(
'save', $this->lng->txt(
'save'));
102 $form->addCommandButton(
'finalizeConfirmation', $this->lng->txt(
'iass_finalize'));
109 $this->parent_gui->handleAccessViolation();
112 $file_storage = $this->
object->getFileStorage();
113 $file_storage->setUserId($this->member->id());
125 $this->parent_gui->handleAccessViolation();
130 $item =
$form->getItemByPostVar(
'file');
131 if ($item && $item->checkInput()) {
139 $form->setValuesByArray(array(
'file' => $this->member->fileName()));
140 if (!
$form->checkInput()) {
141 $form->setValuesByPost();
147 if ($this->object->isActiveLP()) {
150 ilUtil::sendSuccess($this->lng->txt(
'iass_membership_saved'),
true);
162 $this->parent_gui->handleAccessViolation();
168 $item =
$form->getItemByPostVar(
'file');
169 if ($item && $item->checkInput()) {
177 $form->setValuesByArray(array(
'file' => $this->member->fileName()));
178 if (!
$form->checkInput()) {
179 $form->setValuesByPost();
186 if (!$this->member->mayBeFinalized()) {
191 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
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());
214 $this->parent_gui->handleAccessViolation();
218 if (!$this->member->mayBeFinalized()) {
224 $this->member = $this->member->withFinalized();
225 $this->
object->membersStorage()->updateMember($this->member);
226 if ($this->object->isActiveLP()) {
229 $this->member->maybeSendNotification($this->notificator);
231 ilUtil::sendSuccess($this->lng->txt(
'iass_membership_finalized'),
true);
255 $this->parent_gui->handleAccessViolation();
259 if (
$form === null) {
263 $form->addCommandButton(
'saveAmend', $this->lng->txt(
'iass_save_amend'));
275 $this->parent_gui->handleAccessViolation();
280 $item =
$form->getItemByPostVar(
'file');
281 if ($item && $item->checkInput()) {
288 $form->setValuesByArray(array(
'file' => $this->member->fileName()));
289 if (!
$form->checkInput()) {
290 $form->setValuesByPost();
297 if ($this->object->isActiveLP()) {
301 ilUtil::sendSuccess($this->lng->txt(
'iass_amend_saved'),
true);
314 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
316 $form->setFormAction($this->ctrl->getFormAction($this));
317 $form->setTitle($this->lng->txt(
'iass_edit_record'));
319 $examinee_name = $this->examinee->getLastname() .
', ' . $this->examinee->getFirstname();
322 $form->addItem($usr_name);
325 $ti->
setInfo($this->lng->txt(
'iass_record_info'));
328 $ti->setDisabled(!$may_be_edited);
333 $ta->
setInfo($this->lng->txt(
'iass_internal_note_info'));
336 $ta->setDisabled(!$may_be_edited);
339 if ($this->member->finalized() && !$amend) {
344 $form->addItem($filelink);
347 $title = $this->lng->txt(
'iass_upload_file');
351 $filelink->setValue($link);
352 $form->addItem($filelink);
356 $file->setRequired($this->object->getSettings()->fileRequired() && !$this->
fileUploaded());
357 $file->setDisabled(!$may_be_edited);
358 $file->setAllowDeletion(
false);
359 $form->addItem($file);
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);
368 $learning_progress =
new ilSelectInputGUI($this->lng->txt(
'grading'),
'learning_progress');
374 $learning_progress->setDisabled(!$may_be_edited);
375 $form->addItem($learning_progress);
377 $settings = $this->
object->getSettings();
379 $txt->setRequired($settings->eventTimePlaceRequired());
380 $txt->setDisabled(!$may_be_edited);
385 $date->setRequired($settings->eventTimePlaceRequired());
386 $date->setDisabled(!$may_be_edited);
387 $form->addItem($date);
391 $notify->
setInfo($this->lng->txt(
'iass_notify_explanation'));
392 $notify->setDisabled(!$may_be_edited);
393 $form->addItem($notify);
400 return $this->member->fileName() && $this->member->fileName() !=
"";
414 'name' => $member->
name()
415 ,
'record' => $member->
record()
417 ,
'place' => $member->
place()
419 ,
'notify' => $member->
notify()
420 ,
'learning_progress' => (int) $member->
LPStatus()
421 ,
'file_visible_examinee' => (int) $member->
viewFile()
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());
440 $tpl->setVariable(
"HREF", $this->ctrl->getLinkTarget($this,
"downloadAttachment"));
453 $this->tpl->setContent($form->
getHTML());
465 $this->lng->txt(
'back'),
477 return $this->ctrl->getLinkTargetByClass(
478 array(get_class($this->parent_gui)
479 ,get_class($this->members_gui)),
493 $this->ctrl->redirect($this, $cmd);
503 return $this->access->isSystemAdmin()
514 return $this->access->isSystemAdmin()
525 return $this->access->isSystemAdmin()
536 return $this->access->isSystemAdmin()
547 return $this->access->isSystemAdmin()
548 || $this->access->mayViewUser();
558 return $this->access->isSystemAdmin()
559 || $this->access->mayAmendGradeUser();
569 return (
int) $member->
examinerId() !== (int) $this->examiner->getId()
580 return $this->member->finalized();
594 $this->
object->membersStorage()->updateMember($this->member);
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']) {
619 if (!$keep_examiner) {
623 if ($data[
'notify'] == 1) {
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);
654 $this->member = $this->member->withFileName($file_name);
655 $this->
object->membersStorage()->updateMember($this->member);
updateDataInMemberByArray(ilIndividualAssessmentMember $member, $data, $keep_examiner=false, $amend=false)
Updates member object with new grading informations.
__construct($members_gui, $a_parent_gui, $a_ref_id)
setValue($a_value)
Set Value.
getBackLink()
Get link for backlink.
edit(ilPropertyFormGUI $form=null)
Edit grading informations for user.
examinerId()
Get the user id of the examiner.
withFileName($file_name)
Set the name of the file.
eventTime()
Get date when ia was.
userMayGrade()
Current user has permission to edit learning progess.
static updateLPStatusOfMember(ilIndividualAssessmentMember $member)
withChangerId($changer_id)
Clone this object and set an changer_id.
getFileLinkHTML($amend=false)
Render grading form into template.
view()
View grading informations for user.
userMayView()
Current user has permission to read learning progress.
setBackTarget($a_title, $a_target, $a_frame="")
back target for upper context
finalize()
Finalize the grading.
withRecord($record)
Clone this object and set a record.
fillForm(ilPropertyFormGUI $a_form, ilIndividualAssessmentMember $member)
Fill form with current grading informations.
Notificate user using internal mail system.
initGradingForm($may_be_edited=true, $amend=false)
Inint form for gradings.
mayBeAmended()
Grading may be edited by current user after finalization.
mayBeViewed()
Content of grading may be viewes by current user.
if(isset($_POST['submit'])) $form
withNotify($notify)
Clone this object and set wether the examinee should be notified.
withEventTime($event_time)
Clone this object and set an internal note.
special template class to simplify handling of ITX/PEAR
targetWasEditedByOtherUser(ilIndividualAssessmentMember $member)
Grading was edited by an other user.
This class represents a text property in a property form.
For the purpose of streamlining the grading and learning-process status definition outside of tests...
amend($form=null)
Show grading form to amend the result.
place()
Get place where ia was held.
clearTargets()
clear all targets
saveMember(array $post, $keep_examiner=false, $amend=false)
Save grading informations.
viewFile()
Can user see the uploaded file.
finalizeConfirmation()
Save grading informations and show confirmation form.
withExaminerId($examiner_id)
Clone this object and set an examiner_id.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Edit the record of a user, set LP.
notify()
Will the user be notified after finalization?
name()
Get the examinee name corresponding to this membership.
if(!empty($this->data['faventry'])) $tabs
updateFileName($file_name)
cancelFinalize()
Cancel finalizing and get back to edit form.
This class represents a non editable value in a property form.
This class represents a text area property in a property form.
renderForm(ilPropertyFormGUI $form)
Render the form and put it into template.
isFinalized()
Is grading finalized.
mayBeEdited()
Grading may be edited by current user.
saveAmend()
Save changes of grading result.
redirect($cmd)
Redirect to this with command.
save()
Save grading informations for user.
LPStatus()
Get the LP-status corresponding to this membership.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
Confirmation screen class.
userMayAmend()
Current user has permission to amend grading.
setTabs(ilTabsGUI $tabs)
Set tabs.