52 $this->toolbar = $ilToolbar;
62 $cmd = $this->ctrl->getCmd(
'showMarkSchema');
71 if(!$this->
object->canEditMarks())
74 $this->ctrl->redirect($this,
'showMarkSchema');
83 if(!$this->
object->canEditEctsGrades())
86 $this->ctrl->redirect($this,
'showMarkSchema');
98 $this->
object->getMarkSchema()->addMarkStep();
107 $this->
object->getMarkSchema()->flush();
108 foreach(
$_POST as $key => $value)
110 if(preg_match(
'/mark_short_(\d+)/', $key, $matches))
112 $this->
object->getMarkSchema()->addMarkStep(
129 $this->
object->getMarkSchema()->createSimpleSchema(
130 $this->lng->txt(
'failed_short'), $this->lng->txt(
'failed_official'),
132 $this->lng->txt(
'passed_short'), $this->lng->txt(
'passed_official'),
145 if(!isset(
$_POST[
'marks']) || !is_array(
$_POST[
'marks']))
152 $delete_mark_steps =
array();
153 foreach(
$_POST[
'marks'] as $mark_step_id)
155 $delete_mark_steps[] = $mark_step_id;
158 if(count($delete_mark_steps))
160 $this->
object->getMarkSchema()->deleteMarkSteps($delete_mark_steps);
180 $result = $this->
object->checkMarks();
184 $result = $this->lng->txt(
'mark_schema_invalid');
193 $this->
object->getMarkSchema()->saveToDb($this->
object->getMarkSchemaForeignId());
194 $this->
object->onMarkSchemaSaved();
198 $this->ctrl->redirect($this);
206 require_once
'Modules/Test/interfaces/interface.ilEctsGradesEnabled.php';
216 if(!$this->
object->canEditMarks())
221 $this->toolbar->setFormAction($this->ctrl->getFormAction($this,
'showMarkSchema'));
223 require_once
'Modules/Test/classes/tables/class.ilMarkSchemaTableGUI.php';
226 if($this->
object->canEditMarks())
228 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
230 $create_simple_mark_schema_button->setCaption($this->lng->txt(
'tst_mark_create_simple_mark_schema'),
false);
231 $create_simple_mark_schema_button->setCommand(
'addSimpleMarkSchema');
232 $this->toolbar->addButtonInstance($create_simple_mark_schema_button);
234 require_once
'Services/UIComponent/Button/classes/class.ilButton.php';
236 $create_new_mark_step_button->setCaption($this->lng->txt(
'tst_mark_create_new_mark_step'),
false);
238 $create_new_mark_step_button->setForm(
'form_' . $mark_schema_table->getId());
239 $create_new_mark_step_button->setName(
'addMarkStep');
240 $this->toolbar->addButtonInstance($create_new_mark_step_button);
244 $content_parts =
array($mark_schema_table->getHTML());
253 $content_parts[] = $ects_form->getHTML();
256 $this->tpl->setContent(implode(
'<br />', $content_parts));
266 $data[
'ectcs_status'] = $this->
object->getECTSOutput();
267 $data[
'use_ects_fx'] = preg_match(
'/\d+/', $this->
object->getECTSFX());
268 $data[
'ects_fx_threshold'] = $this->
object->getECTSFX();
270 $ects_grades = $this->
object->getECTSGrades();
271 for($i = ord(
'a'); $i <= ord(
'e'); $i++)
274 $data[
'ects_grade_' . $mark] = $ects_grades[chr($i - 32)];
285 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
287 $disabled = !$this->
object->canEditEctsGrades();
290 $form->setFormAction($this->ctrl->getFormAction($this,
'saveEctsForm'));
291 $form->setTitle($this->lng->txt(
'ects_output_of_ects_grades'));
293 $allow_ects_marks =
new ilCheckboxInputGUI($this->lng->txt(
'ects_allow_ects_grades'),
'ectcs_status');
295 for($i = ord(
'a'); $i <= ord(
'e'); $i++)
301 $this->lng->txt(
'ects_grade_desc_prefix') .
' ' . $this->lng->txt(
'ects_grade_' . $mark .
'_desc')
303 $mark_step->setSize(5);
304 $mark_step->allowDecimals(
true);
305 $mark_step->setMinValue(0,
true);
306 $mark_step->setMaxValue(100,
true);
307 $mark_step->setSuffix($this->lng->txt(
'percentile'));
308 $mark_step->setRequired(
true);
309 $mark_step->setDisabled($disabled);
310 $allow_ects_marks->addSubItem($mark_step);
315 $this->lng->txt(
'ects_grade_desc_prefix') .
' ' . $this->lng->txt(
'ects_grade_f_desc')
317 $allow_ects_marks->addSubItem($mark_step);
321 $allow_ects_marks->addSubItem($use_ects_fx);
325 $this->lng->txt(
'ects_grade_desc_prefix') .
' ' . $this->lng->txt(
'ects_grade_fx_desc')
327 $use_ects_fx->addSubItem($mark_step);
329 $threshold =
new ilNumberInputGUI($this->lng->txt(
'ects_fx_threshold'),
'ects_fx_threshold');
330 $threshold->
setInfo($this->lng->txt(
'ects_fx_threshold_info'));
331 $threshold->setSuffix($this->lng->txt(
'percentile'));
332 $threshold->allowDecimals(
true);
333 $threshold->setSize(5);
334 $threshold->setRequired(
true);
335 $threshold->setDisabled($disabled);
336 $use_ects_fx->addSubItem($threshold);
339 $form->addItem($allow_ects_marks);
343 $form->addCommandButton(
'saveEctsForm', $this->lng->txt(
'save'));
357 if(!$ects_form->checkInput())
359 $ects_form->setValuesByPost();
365 for($i = ord(
'a'); $i <= ord(
'e'); $i++)
368 $grades[chr($i - 32)] = $ects_form->getInput(
'ects_grade_' . $mark);
371 $this->
object->setECTSGrades($grades);
372 $this->
object->setECTSOutput((
int)$ects_form->getInput(
'ectcs_status'));
373 $this->
object->setECTSFX(
374 $ects_form->getInput(
'use_ects_fx') && preg_match(
'/\d+/', $ects_form->getInput(
'ects_fx_threshold')) ?
375 $ects_form->getInput(
'ects_fx_threshold'):
379 $this->
object->saveECTSStatus();
382 $ects_form->setValuesByPost();
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
ensureEctsGradesCanBeEdited()
executeCommand()
Controller method.
deleteMarkSteps()
Delete selected mark steps.
objectSupportsEctsGrades()
saveMarkSchemaFormData()
Save the mark schema POST data when the form was submitted.
addMarkStep()
Add a new mark step to the tests marks.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
showMarkSchema(ilPropertyFormGUI $ects_form=null)
Display mark schema.
addSimpleMarkSchema()
Add a simple mark schema to the tests marks.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
saveMarks()
Save the mark schema.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
ensureMarkSchemaCanBeEdited()
populateEctsForm(ilPropertyFormGUI $form)
This class represents a non editable value in a property form.
Create new PHPExcel object
obj_idprivate