public function build()
 {
     $this->initTemplate();
     $this->loadResultData();
     if ($this->testOBJ->isShowGradingStatusEnabled()) {
         $this->populateGradingStatus();
     }
     if ($this->testOBJ->areObligationsEnabled()) {
         $this->populateObligationsStatus();
     }
     if ($this->testOBJ->isShowGradingMarkEnabled()) {
         $this->populateGradingMark();
     }
     if ($this->testOBJ->getECTSOutput()) {
         $this->populateEctsGrade();
     }
 }
 protected function isGradingMessageRequired()
 {
     if ($this->object->isShowGradingStatusEnabled()) {
         return true;
     }
     if ($this->object->isShowGradingMarkEnabled()) {
         return true;
     }
     if ($this->object->areObligationsEnabled()) {
         return true;
     }
     return false;
 }
 private function addResultSettingsFormSection(ilPropertyFormGUI $form)
 {
     // HEADER: result settings
     $header_tr = new ilFormSectionHeaderGUI();
     $header_tr->setTitle($this->lng->txt('test_results'));
     $form->addItem($header_tr);
     // access to test results
     $resultsAccessEnabled = new ilCheckboxInputGUI($this->lng->txt('tst_results_access_enabled'), 'results_access_enabled');
     $resultsAccessEnabled->setInfo($this->lng->txt('tst_results_access_enabled_desc'));
     $resultsAccessEnabled->setChecked($this->testOBJ->isScoreReportingEnabled());
     $resultsAccessSetting = new ilRadioGroupInputGUI($this->lng->txt('tst_results_access_setting'), 'results_access_setting');
     $resultsAccessSetting->setRequired(true);
     $optAlways = new ilRadioOption($this->lng->txt('tst_results_access_always'), 2, '');
     $optAlways->setInfo($this->lng->txt('tst_results_access_always_desc'));
     $resultsAccessSetting->addOption($optAlways);
     $optFinished = $opt = new ilRadioOption($this->lng->txt('tst_results_access_finished'), 1, '');
     $optFinished->setInfo($this->lng->txt('tst_results_access_finished_desc'));
     $resultsAccessSetting->addOption($optFinished);
     $optionDate = new ilRadioOption($this->lng->txt('tst_results_access_date'), 3, '');
     $optionDate->setInfo($this->lng->txt('tst_results_access_date_desc'));
     // access date
     $reportingDate = new ilDateTimeInputGUI($this->lng->txt('tst_reporting_date'), 'reporting_date');
     $reportingDate->setShowTime(true);
     if (strlen($this->testOBJ->getReportingDate())) {
         $reportingDate->setDate(new ilDateTime($this->testOBJ->getReportingDate(), IL_CAL_TIMESTAMP));
     } else {
         $reportingDate->setDate(new ilDateTime(time(), IL_CAL_UNIX));
     }
     $optionDate->addSubItem($reportingDate);
     $resultsAccessSetting->addOption($optionDate);
     $resultsAccessValue = $this->testOBJ->getScoreReporting();
     $resultsAccessSetting->setValue($resultsAccessValue > 0 && $resultsAccessValue < 4 ? $resultsAccessValue : 2);
     $resultsAccessEnabled->addSubItem($resultsAccessSetting);
     // show pass details
     $showPassDetails = new ilCheckboxInputGUI($this->lng->txt('tst_show_pass_details'), 'pass_details');
     $showPassDetails->setInfo($this->lng->txt('tst_show_pass_details_desc'));
     $showPassDetails->setChecked($this->testOBJ->getShowPassDetails());
     $resultsAccessEnabled->addSubItem($showPassDetails);
     $form->addItem($resultsAccessEnabled);
     // grading
     $chb_only_passed_failed = new ilCheckboxInputGUI($this->lng->txt('tst_results_grading_opt_show_status'), 'grading_status');
     $chb_only_passed_failed->setInfo($this->lng->txt('tst_results_grading_opt_show_status_desc'));
     $chb_only_passed_failed->setValue(1);
     $chb_only_passed_failed->setChecked($this->testOBJ->isShowGradingStatusEnabled());
     $form->addItem($chb_only_passed_failed);
     $chb_resulting_mark_only = new ilCheckboxInputGUI($this->lng->txt('tst_results_grading_opt_show_mark'), 'grading_mark');
     $chb_resulting_mark_only->setInfo($this->lng->txt('tst_results_grading_opt_show_mark_desc'));
     $chb_resulting_mark_only->setValue(1);
     $chb_resulting_mark_only->setChecked($this->testOBJ->isShowGradingMarkEnabled());
     $form->addItem($chb_resulting_mark_only);
 }
 protected function isGradingMessageRequired()
 {
     if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
         return false;
     }
     if ($this->object->isShowGradingStatusEnabled()) {
         return true;
     }
     if ($this->object->isShowGradingMarkEnabled()) {
         return true;
     }
     if ($this->object->areObligationsEnabled()) {
         return true;
     }
     return false;
 }