public function to_sql()
 {
     $qd = parent::to_sql();
     $qd['answers'] = my_json_encode(array_map(function ($a) {
         return $a['text'];
     }, $this->answers));
     $qd['hex_ids'] = implode(',', array_keys($this->answers_by_hex_id));
     return $qd;
 }
 public function to_sql()
 {
     $qd = parent::to_sql();
     $qd['answers'] = my_json_encode($this->raw_answer);
     return $qd;
 }
 public function to_sql()
 {
     $qd = parent::to_sql();
     $get_text = function ($a) {
         return $a['text'];
     };
     $left = array_map($get_text, $this->left_column);
     $right = array_map($get_text, $this->right_column);
     $qd['answers'] = my_json_encode([$left, $right]);
     $qd['hex_ids'] = my_json_encode([array_keys($this->left_column_by_hex_id), array_keys($this->right_column_by_hex_id)]);
     return $qd;
 }
 public function to_sql()
 {
     $qd = parent::to_sql();
     $qd['answers'] = my_json_encode(array_map(function ($a) {
         return [$a['text'], (int) $a['fixed'], (int) $a['correct']];
     }, $this->answers));
     $qd['hex_ids'] = implode(',', array_keys($this->answers_by_hex_id));
     $qd['multiple_choice_min_answers'] = $this->min_answers;
     $qd['multiple_choice_max_answers'] = $this->max_answers;
     return $qd;
 }