original_string: public function process_extraanswerdata($data) {
          global $DB;
  
          $extra = $this->qtypeobj->extra_answer_fields();
          $tablename = array_shift($extra);
  
          $oldquestionid = $this->get_old_parentid('question');
          $questioncreated = $this->get_mappingid('question_created', $oldquestionid) ? true : false;
  
          if ($questioncreated) {
              $data['answerid'] = $this->get_mappingid('question_answer', $data['id']);
              $DB->insert_record($tablename, $data);
          } else {
              $DB->update_record($tablename, $data);
          }
      }
code: public function process_extraanswerdata($data) {
          global $DB;
  
          $extra = $this->qtypeobj->extra_answer_fields();
          $tablename = array_shift($extra);
  
          $oldquestionid = $this->get_old_parentid('question');
          $questioncreated = $this->get_mappingid('question_created', $oldquestionid) ? true : false;
  
          if ($questioncreated) {
              $data['answerid'] = $this->get_mappingid('question_answer', $data['id']);
              $DB->insert_record($tablename, $data);
          } else {
              $DB->update_record($tablename, $data);
          }
      }
code_tokens: public function process_extraanswerdata ( $ data ) { global $ DB ; $ extra = $ this -> qtypeobj -> extra_answer_fields ( ) ; $ tablename = array_shift ( $ extra ) ; $ oldquestionid = $ this -> get_old_parentid ( 'question' ) ; $ questioncreated = $ this -> get_mappingid ( 'question_created' , $ oldquestionid ) ? true : false ; if ( $ questioncreated ) { $ data [ 'answerid' ] = $ this -> get_mappingid ( 'question_answer' , $ data [ 'id' ] ) ; $ DB -> insert_record ( $ tablename , $ data ) ; } else { $ DB -> update_record ( $ tablename , $ data ) ; } }
docstring: Processes the extra answer data
  
  @param array $data extra answer data
docstring_tokens: Processes the extra answer data