コード例 #1
0
 /**
  * Persist the object to the database
  * @return boolean Success or failure of the save operation
  * @throws ValidationException
  */
 public function save($clear_checkout = true)
 {
     // Make sure 'correct' value is set for option
     if ((!isset($this->correct) or $this->correct = '') and $this->points1 != '' and count($this->options) > 0) {
         $this->set_points1($this->points1);
     }
     return parent::save($clear_checkout);
 }
コード例 #2
0
 /**
  * Persist the object to the database
  * @return boolean Success or failure of the save operation
  * @throws ValidationException
  */
 public function save($clear_checkout = true)
 {
     // Extract options into arrays for JSON encoding
     $this->extract_answers();
     $this->extract_vars();
     $this->extract_marks();
     try {
         $status = parent::save($clear_checkout);
     } catch (ValidationException $ex) {
         $this->unserialize_settings();
         throw new ValidationException($ex->getMessage());
     }
     return $status;
 }