3require_once
'Services/Form/classes/class.ilTextAreaInputGUI.php';
4require_once
'Services/Form/classes/class.ilTextInputGUI.php';
5require_once
'Services/Form/classes/class.ilCheckboxInputGUI.php';
6require_once
'Services/Form/classes/class.ilNonEditableValueGUI.php';
7require_once
'Services/Form/classes/class.ilSelectInputGUI.php';
8require_once
'Modules/IndividualAssessment/classes/LearningProgress/class.ilIndividualAssessmentLPInterface.php';
9require_once
'Modules/IndividualAssessment/classes/Notification/class.ilIndividualAssessmentPrimitiveInternalNotificator.php';
10require_once
'Modules/IndividualAssessment/classes/class.ilIndividualAssessmentLP.php';
11require_once
'Modules/IndividualAssessment/classes/FileStorage/class.ilIndividualAssessmentFileStorage.php';
12require_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()) {
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);
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()) {
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) {
343 $filelink->setValue($link);
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);
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');
369 $learning_progress->setOptions(
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);
384 $date->setShowTime(
false);
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()
422 ,
'file_name' => $this->getFileLinkHTML()
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());
463 $tabs->clearTargets();
464 $tabs->setBackTarget(
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);
An exception for terminatinating execution or to throw for unit testing.
Confirmation screen class.
@classDescription Date and time handling
static updateLPStatusOfMember(ilIndividualAssessmentMember $member)
For the purpose of streamlining the grading and learning-process status definition outside of tests,...
__construct($members_gui, $a_parent_gui, $a_ref_id)
mayBeEdited()
Grading may be edited by current user.
setTabs(ilTabsGUI $tabs)
Set tabs.
mayBeAmended()
Grading may be edited by current user after finalization.
fillForm(ilPropertyFormGUI $a_form, ilIndividualAssessmentMember $member)
Fill form with current grading informations.
getBackLink()
Get link for backlink.
edit(ilPropertyFormGUI $form=null)
Edit grading informations for user.
view()
View grading informations for user.
cancelFinalize()
Cancel finalizing and get back to edit form.
userMayGrade()
Current user has permission to edit learning progess.
redirect($cmd)
Redirect to this with command.
isFinalized()
Is grading finalized.
saveAmend()
Save changes of grading result.
save()
Save grading informations for user.
userMayAmend()
Current user has permission to amend grading.
userMayView()
Current user has permission to read learning progress.
saveMember(array $post, $keep_examiner=false, $amend=false)
Save grading informations.
updateDataInMemberByArray(ilIndividualAssessmentMember $member, $data, $keep_examiner=false, $amend=false)
Updates member object with new grading informations.
updateFileName($file_name)
getFileLinkHTML($amend=false)
Render grading form into template.
amend($form=null)
Show grading form to amend the result.
createDatetime($datetime)
targetWasEditedByOtherUser(ilIndividualAssessmentMember $member)
Grading was edited by an other user.
finalize()
Finalize the grading.
mayBeViewed()
Content of grading may be viewes by current user.
renderForm(ilPropertyFormGUI $form)
Render the form and put it into template.
initGradingForm($may_be_edited=true, $amend=false)
Inint form for gradings.
finalizeConfirmation()
Save grading informations and show confirmation form.
Edit the record of a user, set LP.
examinerId()
Get the user id of the examiner.
viewFile()
Can user see the uploaded file.
place()
Get place where ia was held.
withExaminerId($examiner_id)
Clone this object and set an examiner_id.
eventTime()
Get date when ia was.
LPStatus()
Get the LP-status corresponding to this membership.
withEventTime($event_time)
Clone this object and set an internal note.
notify()
Will the user be notified after finalization?
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.
name()
Get the examinee name corresponding to this membership.
Notificate user using internal mail system.
This class represents a non editable value in a property form.
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
if(!empty($this->data['faventry'])) $tabs
if(isset($_POST['submit'])) $form
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file