/** * Display mark schema * @param ilPropertyFormGUI $ects_form */ protected function showMarkSchema(ilPropertyFormGUI $ects_form = null) { if (!$this->object->canEditMarks()) { ilUtil::sendInfo($this->lng->txt('cannot_edit_marks')); } $this->toolbar->setFormAction($this->ctrl->getFormAction($this, 'showMarkSchema')); if ($this->object->canEditMarks()) { require_once 'Services/UIComponent/Button/classes/class.ilSubmitButton.php'; $create_simple_mark_schema_button = ilSubmitButton::getInstance(); $create_simple_mark_schema_button->setCaption($this->lng->txt('tst_mark_create_simple_mark_schema'), false); $create_simple_mark_schema_button->setCommand('addSimpleMarkSchema'); $this->toolbar->addButtonInstance($create_simple_mark_schema_button); } require_once 'Modules/Test/classes/tables/class.ilMarkSchemaTableGUI.php'; $mark_schema_table = new ilMarkSchemaTableGUI($this, 'showMarkSchema', '', $this->object); $content_parts = array($mark_schema_table->getHTML()); if ($this->objectSupportsEctsGrades() && $this->object->canEditEctsGrades()) { if (!$ects_form instanceof ilPropertyFormGUI) { $ects_form = $this->getEctsForm(); $this->populateEctsForm($ects_form); } $content_parts[] = $ects_form->getHTML(); } $this->tpl->setContent(implode('<br />', $content_parts)); }
/** * @param array $row */ public function fillRow(array $row) { $short_name = new ilTextInputGUI('', 'mark_short_' . $row['mark_id']); $short_name->setValue($row['mark_short']); $short_name->setDisabled(!$this->is_editable); $short_name->setSize(10); $official_name = new ilTextInputGUI('', 'mark_official_' . $row['mark_id']); $official_name->setSize(20); $official_name->setDisabled(!$this->object->canEditMarks()); $official_name->setValue($row['mark_official']); $percentage = new ilNumberInputGUI('', 'mark_percentage_' . $row['mark_id']); $percentage->allowDecimals(true); $percentage->setValue($row['mark_percentage']); $percentage->setSize(10); $percentage->setDisabled(!$this->is_editable); $percentage->setMinValue(0); $percentage->setMaxValue(100); $this->tpl->setVariable('VAL_MARK_ID', $row['mark_id']); $this->tpl->setVariable('VAL_CHECKBOX', ilUtil::formCheckbox(false, 'marks[]', $row['mark_id'], !$this->is_editable)); $this->tpl->setVariable('VAL_SHORT_NAME', $short_name->render()); $this->tpl->setVariable('VAL_OFFICIAL_NAME', $official_name->render()); $this->tpl->setVariable('VAL_PERCENTAGE', $percentage->render()); $this->tpl->setVariable('VAL_PASSED_CHECKBOX', ilUtil::formCheckbox((bool) $row['mark_passed'], 'passed_' . $row['mark_id'], '1', !$this->is_editable)); }