/**
  *
  */
 protected function initData()
 {
     $this->object->getMarkSchema()->sort();
     $data = array();
     $marks = $this->object->getMarkSchema()->getMarkSteps();
     foreach ($marks as $key => $value) {
         $data[] = array('mark_id' => $key, 'mark_short' => $value->getShortName(), 'mark_official' => $value->getOfficialName(), 'mark_percentage' => $value->getMinimumLevel(), 'mark_passed' => $value->getPassed() ? 1 : 0);
     }
     $this->setData($data);
 }
Exemplo n.º 2
0
 /**
  * Save the mark schema
  */
 protected function saveMarks()
 {
     $this->ensureMarkSchemaCanBeEdited();
     try {
         $this->saveMarkSchemaFormData();
         $result = $this->object->checkMarks();
     } catch (Exception $e) {
         $result = $this->lng->txt('mark_schema_invalid');
     }
     if (is_string($result)) {
         ilUtil::sendFailure($this->lng->txt($result), true);
     } else {
         $this->object->getMarkSchema()->saveToDb($this->object->getMarkSchemaForeignId());
         $this->object->onMarkSchemaSaved();
         ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
     }
     $this->ctrl->redirect($this);
 }