52 $this->toolbar = $ilToolbar;
62 $cmd = $this->ctrl->getCmd(
'showMarkSchema');
71 if(!$this->object->canEditMarks())
74 $this->ctrl->redirect($this,
'showMarkSchema');
86 $this->
object->getMarkSchema()->addMarkStep();
95 $this->
object->getMarkSchema()->flush();
96 foreach(
$_POST as $key => $value)
98 if(preg_match(
'/mark_short_(\d+)/', $key, $matches))
100 $this->
object->getMarkSchema()->addMarkStep(
117 $this->
object->getMarkSchema()->createSimpleSchema(
118 $this->lng->txt(
'failed_short'), $this->lng->txt(
'failed_official'),
120 $this->lng->txt(
'passed_short'), $this->lng->txt(
'passed_official'),
133 if(!isset(
$_POST[
'marks']) || !is_array(
$_POST[
'marks']))
140 $delete_mark_steps = array();
141 foreach(
$_POST[
'marks'] as $mark_step_id)
143 $delete_mark_steps[] = $mark_step_id;
146 if(count($delete_mark_steps))
148 $this->
object->getMarkSchema()->deleteMarkSteps($delete_mark_steps);
168 $result = $this->
object->checkMarks();
172 $result = $this->lng->txt(
'mark_schema_invalid');
181 $this->
object->getMarkSchema()->saveToDb($this->object->getMarkSchemaForeignId());
182 $this->
object->onMarkSchemaSaved();
186 $this->ctrl->redirect($this);
194 require_once
'Modules/Test/interfaces/interface.ilEctsGradesEnabled.php';
204 if(!$this->object->canEditMarks())
209 $this->toolbar->setFormAction($this->ctrl->getFormAction($this,
'showMarkSchema'));
211 if($this->object->canEditMarks())
213 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
215 $create_simple_mark_schema_button->setCaption($this->lng->txt(
'tst_mark_create_simple_mark_schema'),
false);
216 $create_simple_mark_schema_button->setCommand(
'addSimpleMarkSchema');
217 $this->toolbar->addButtonInstance($create_simple_mark_schema_button);
220 require_once
'Modules/Test/classes/tables/class.ilMarkSchemaTableGUI.php';
223 $content_parts = array($mark_schema_table->getHTML());
232 $content_parts[] = $ects_form->getHTML();
235 $this->tpl->setContent(implode(
'<br />', $content_parts));
245 $data[
'ectcs_status'] = $this->
object->getECTSOutput();
246 $data[
'use_ects_fx'] = preg_match(
'/\d+/', $this->object->getECTSFX());
247 $data[
'ects_fx_threshold'] = $this->
object->getECTSFX();
249 $ects_grades = $this->
object->getECTSGrades();
250 for($i = ord(
'a'); $i <= ord(
'e'); $i++)
253 $data[
'ects_grade_' . $mark] = $ects_grades[chr($i - 32)];
264 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
267 $form->setFormAction($this->ctrl->getFormAction($this,
'saveEctsForm'));
268 $form->addCommandButton(
'saveEctsForm', $this->lng->txt(
'save'));
269 $form->setTitle($this->lng->txt(
'ects_output_of_ects_grades'));
271 $allow_ects_marks =
new ilCheckboxInputGUI($this->lng->txt(
'ects_allow_ects_grades'),
'ectcs_status');
272 for($i = ord(
'a'); $i <= ord(
'e'); $i++)
276 $mark_step =
new ilNumberInputGUI(chr($i - 32) .
' - ' . $this->lng->txt(
'ects_grade_' . $mark .
'_short'),
'ects_grade_' . $mark);
278 $mark_step->allowDecimals(
true);
279 $mark_step->setMinValue(0,
true);
280 $mark_step->setMaxValue(100,
true);
281 $mark_step->setSuffix($this->lng->txt(
'percentile'));
282 $mark_step->setRequired(
true);
283 $allow_ects_marks->addSubItem($mark_step);
287 $threshold =
new ilNumberInputGUI($this->lng->txt(
'ects_fx_threshold'),
'ects_fx_threshold');
288 $threshold->
setInfo($this->lng->txt(
'ects_fx_threshold_info'));
289 $threshold->setSuffix($this->lng->txt(
'percentile'));
290 $threshold->allowDecimals(
true);
291 $threshold->setSize(5);
293 $use_ects_fx->addSubItem($threshold);
294 $allow_ects_marks->addSubItem($use_ects_fx);
296 $form->addItem($allow_ects_marks);
313 if(!$ects_form->checkInput())
315 $ects_form->setValuesByPost();
321 for($i = ord(
'a'); $i <= ord(
'e'); $i++)
324 $grades[chr($i - 32)] = $ects_form->getInput(
'ects_grade_' . $mark);
327 $this->
object->setECTSGrades($grades);
328 $this->
object->setECTSOutput((
int)$ects_form->getInput(
'ectcs_status'));
329 $this->
object->setECTSFX(
330 $ects_form->getInput(
'use_ects_fx') && preg_match(
'/\d+/', $ects_form->getInput(
'ects_fx_threshold')) ?
331 $ects_form->getInput(
'ects_fx_threshold'):
335 $this->
object->saveECTSStatus();
338 $ects_form->setValuesByPost();