/** * Init form. * * @param int $a_mode Edit Mode */ public function initSettingsForm() { global $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // title $title = new ilTextInputGUI($this->txt("title"), "title"); $title->setRequired(true); $this->form->addItem($title); // description $description = new ilTextAreaInputGUI($this->txt("description"), "description"); $description->setCols(39); $description->setRows(4); $this->form->addItem($description); // show submissions $show_submissions = new ilCheckboxInputGUI($this->txt("show_submissions"), "show_submissions"); $show_submissions->setInfo($this->txt("show_submissions_info")); $this->form->addItem($show_submissions); // pass mode $pass_mode = new ilRadioGroupInputGUI($this->txt("pass_mode"), "pass_mode"); $pass_all = new ilRadioOption($this->txt("pass_all"), "all", $this->txt("pass_all_info")); $pass_mode->addOption($pass_all); $pass_min = new ilRadioOption($this->txt("pass_minimum_nr"), "pass_min", $this->txt("pass_minimum_nr_info")); $pass_mode->addOption($pass_min); // minimum number of assignments to pass $min_number = new ilNumberInputGUI($this->txt("min_nr"), "min_number"); $min_number->setSize(4); $min_number->setMaxLength(4); $min_number->setRequired(true); include_once "./Customizing/global/plugins/Services/Repository/RepositoryObject/Ephorus/classes/class.ilEphAssignment.php"; $mand = ilEphAssignment::countMandatory($this->object->getId()); $min = max($mand, 1); $min_number->setMinValue($min); $pass_min->addSubItem($min_number); $this->form->addItem($pass_mode); $notification = new ilCheckboxInputGUI($this->txt("submission_notification"), "notification"); $notification->setInfo($this->txt("submission_notification_info")); $this->form->addItem($notification); $copletion_by_submission = new ilCheckboxInputGUI($this->txt('completion_by_submission'), 'completion_by_submission'); $copletion_by_submission->setInfo($this->txt('completion_by_submission_info')); $copletion_by_submission->setValue(1); $this->form->addItem($copletion_by_submission); $processtype = new ilSelectInputGUI($this->txt("processtype"), "processtype"); $processtype->setOptions(array(1 => $this->txt("default"), 2 => $this->txt("reference"), 3 => $this->txt("private"))); $processtype->setInfo($this->txt("processtype_description")); $this->form->addItem($processtype); $this->form->addCommandButton("updateSettings", $this->txt("save")); $this->form->setTitle($this->txt("edit_ephorus_exercise")); $this->form->setFormAction($ilCtrl->getFormAction($this)); }