コード例 #1
0
 /**
  * Command: save and show page editor
  */
 public function saveEdit()
 {
     // assQuestionGUI::saveEdit()
     // - calls writePostData
     // - redirects after successful saving
     // - otherwise does nothing
     parent::saveEdit();
     // question couldn't be saved
     $this->form->setValuesByPost();
     $this->getQuestionTemplate();
     $this->tpl->setVariable("QUESTION_DATA", $this->form->getHTML());
 }
コード例 #2
0
 function saveEdit()
 {
     $unfilled_answer = false;
     foreach ($_POST as $key => $value) {
         if (preg_match("/answer_(\\d+)/", $key, $matches)) {
             if (!$value) {
                 $unfilled_answer = true;
             }
         }
     }
     if ($unfilled_answer) {
         ilUtil::sendInfo($this->lng->txt("qpl_answertext_fields_not_filled"));
         $this->writePostData();
         $this->editQuestion();
     } else {
         parent::saveEdit();
     }
 }