51 $ilToolbar = $DIC[
'ilToolbar'];
56 $this->toolbar = $ilToolbar;
70 $cmd = $this->ctrl->getCmd(
'showMarkSchema');
79 if (!$this->object->canEditMarks()) {
81 $this->ctrl->redirect($this,
'showMarkSchema');
90 if (!$this->object->canEditEctsGrades()) {
92 $this->ctrl->redirect($this,
'showMarkSchema');
104 $this->
object->getMarkSchema()->addMarkStep();
113 $this->
object->getMarkSchema()->flush();
115 if (preg_match(
'/mark_short_(\d+)/',
$key, $matches)) {
116 $this->
object->getMarkSchema()->addMarkStep(
133 $this->
object->getMarkSchema()->createSimpleSchema(
134 $this->lng->txt(
'failed_short'),
135 $this->lng->txt(
'failed_official'),
138 $this->lng->txt(
'passed_short'),
139 $this->lng->txt(
'passed_official'),
153 if (!isset(
$_POST[
'marks']) || !is_array(
$_POST[
'marks'])) {
159 $delete_mark_steps = array();
160 foreach (
$_POST[
'marks'] as $mark_step_id) {
161 $delete_mark_steps[] = $mark_step_id;
164 if (count($delete_mark_steps)) {
165 $this->
object->getMarkSchema()->deleteMarkSteps($delete_mark_steps);
182 $result = $this->
object->checkMarks();
184 $result = $this->lng->txt(
'mark_schema_invalid');
190 $this->
object->getMarkSchema()->saveToDb($this->object->getMarkSchemaForeignId());
191 $this->
object->onMarkSchemaSaved();
192 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'),
true);
195 $this->ctrl->redirect($this);
203 require_once
'Modules/Test/interfaces/interface.ilEctsGradesEnabled.php';
213 if (!$this->object->canEditMarks()) {
217 $this->toolbar->setFormAction($this->ctrl->getFormAction($this,
'showMarkSchema'));
219 require_once
'Modules/Test/classes/tables/class.ilMarkSchemaTableGUI.php';
222 if ($this->object->canEditMarks()) {
223 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
225 $create_simple_mark_schema_button->setCaption($this->lng->txt(
'tst_mark_create_simple_mark_schema'),
false);
226 $create_simple_mark_schema_button->setCommand(
'addSimpleMarkSchema');
227 $this->toolbar->addButtonInstance($create_simple_mark_schema_button);
229 require_once
'Services/UIComponent/Button/classes/class.ilButton.php';
231 $create_new_mark_step_button->setCaption($this->lng->txt(
'tst_mark_create_new_mark_step'),
false);
233 $create_new_mark_step_button->setForm(
'form_' . $mark_schema_table->getId());
234 $create_new_mark_step_button->setName(
'addMarkStep');
235 $this->toolbar->addButtonInstance($create_new_mark_step_button);
239 $content_parts = array($mark_schema_table->getHTML());
246 $content_parts[] = $ects_form->getHTML();
249 $this->tpl->setContent(implode(
'<br />', $content_parts));
259 $data[
'ectcs_status'] = $this->
object->getECTSOutput();
260 $data[
'use_ects_fx'] = preg_match(
'/\d+/', $this->object->getECTSFX());
261 $data[
'ects_fx_threshold'] = $this->
object->getECTSFX();
263 $ects_grades = $this->
object->getECTSGrades();
264 for (
$i = ord(
'a');
$i <= ord(
'e');
$i++) {
266 $data[
'ects_grade_' . $mark] = $ects_grades[chr(
$i - 32)];
277 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
279 $disabled = !$this->
object->canEditEctsGrades();
282 $form->setFormAction($this->ctrl->getFormAction($this,
'saveEctsForm'));
283 $form->setTitle($this->lng->txt(
'ects_output_of_ects_grades'));
285 $allow_ects_marks =
new ilCheckboxInputGUI($this->lng->txt(
'ects_allow_ects_grades'),
'ectcs_status');
287 for (
$i = ord(
'a');
$i <= ord(
'e');
$i++) {
292 $this->lng->txt(
'ects_grade_desc_prefix') .
' ' . $this->lng->txt(
'ects_grade_' . $mark .
'_desc')
294 $mark_step->setSize(5);
295 $mark_step->allowDecimals(
true);
296 $mark_step->setMinValue(0,
true);
297 $mark_step->setMaxValue(100,
true);
298 $mark_step->setSuffix($this->lng->txt(
'percentile'));
299 $mark_step->setRequired(
true);
300 $mark_step->setDisabled($disabled);
301 $allow_ects_marks->addSubItem($mark_step);
306 $this->lng->txt(
'ects_grade_desc_prefix') .
' ' . $this->lng->txt(
'ects_grade_f_desc')
308 $allow_ects_marks->addSubItem($mark_step);
312 $allow_ects_marks->addSubItem($use_ects_fx);
316 $this->lng->txt(
'ects_grade_desc_prefix') .
' ' . $this->lng->txt(
'ects_grade_fx_desc')
318 $use_ects_fx->addSubItem($mark_step);
320 $threshold =
new ilNumberInputGUI($this->lng->txt(
'ects_fx_threshold'),
'ects_fx_threshold');
321 $threshold->
setInfo($this->lng->txt(
'ects_fx_threshold_info'));
322 $threshold->setSuffix($this->lng->txt(
'percentile'));
323 $threshold->allowDecimals(
true);
324 $threshold->setSize(5);
325 $threshold->setRequired(
true);
326 $threshold->setDisabled($disabled);
327 $use_ects_fx->addSubItem($threshold);
330 $form->addItem($allow_ects_marks);
333 $form->addCommandButton(
'saveEctsForm', $this->lng->txt(
'save'));
347 if (!$ects_form->checkInput()) {
348 $ects_form->setValuesByPost();
354 for (
$i = ord(
'a');
$i <= ord(
'e');
$i++) {
356 $grades[chr(
$i - 32)] = $ects_form->getInput(
'ects_grade_' . $mark);
359 $this->
object->setECTSGrades($grades);
360 $this->
object->setECTSOutput((
int) $ects_form->getInput(
'ectcs_status'));
361 $this->
object->setECTSFX(
362 $ects_form->getInput(
'use_ects_fx') && preg_match(
'/\d+/', $ects_form->getInput(
'ects_fx_threshold')) ?
363 $ects_form->getInput(
'ects_fx_threshold'):
367 $this->
object->saveECTSStatus();
369 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'));
370 $ects_form->setValuesByPost();
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.
if(isset($_POST['submit'])) $form
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.
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.