original_string: public function import_from_xml($xml, $fromform, qformat_xml $format, $extra=null) {
          // Return if data type is not our own one.
          if (!isset($xml['@']['type']) || $xml['@']['type'] != $this->name()) {
              return false;
          }
  
          // Import the common question headers and set the corresponding field.
          $fromform = $format->import_headers($xml);
          $fromform->qtype = $this->name();
          $format->import_combined_feedback($fromform, $xml, true);
          $format->import_hints($fromform, $xml, true);
  
          $extras = $this->extra_question_fields();
          array_shift($extras);
          foreach ($extras as $extra) {
              $fromform->$extra = $format->getpath($xml, array('#', $extra, 0, '#'), '', true);
          }
  
          return $fromform;
      }
code: public function import_from_xml($xml, $fromform, qformat_xml $format, $extra=null) {
          // Return if data type is not our own one.
          if (!isset($xml['@']['type']) || $xml['@']['type'] != $this->name()) {
              return false;
          }
  
          // Import the common question headers and set the corresponding field.
          $fromform = $format->import_headers($xml);
          $fromform->qtype = $this->name();
          $format->import_combined_feedback($fromform, $xml, true);
          $format->import_hints($fromform, $xml, true);
  
          $extras = $this->extra_question_fields();
          array_shift($extras);
          foreach ($extras as $extra) {
              $fromform->$extra = $format->getpath($xml, array('#', $extra, 0, '#'), '', true);
          }
  
          return $fromform;
      }
code_tokens: public function import_from_xml ( $ xml , $ fromform , qformat_xml $ format , $ extra = null ) { // Return if data type is not our own one. if ( ! isset ( $ xml [ '@' ] [ 'type' ] ) || $ xml [ '@' ] [ 'type' ] != $ this -> name ( ) ) { return false ; } // Import the common question headers and set the corresponding field. $ fromform = $ format -> import_headers ( $ xml ) ; $ fromform -> qtype = $ this -> name ( ) ; $ format -> import_combined_feedback ( $ fromform , $ xml , true ) ; $ format -> import_hints ( $ fromform , $ xml , true ) ; $ extras = $ this -> extra_question_fields ( ) ; array_shift ( $ extras ) ; foreach ( $ extras as $ extra ) { $ fromform -> $ extra = $ format -> getpath ( $ xml , array ( '#' , $ extra , 0 , '#' ) , '' , true ) ; } return $ fromform ; }
docstring: Imports the question from Moodle XML format.
  
  @param array $xml structure containing the XML data
  @param object $fromform question object to fill: ignored by this function (assumed to be null)
  @param qformat_xml $format format class exporting the question
  @param object $extra extra information (not required for importing this question in this format)
  @return object question object
docstring_tokens: Imports the question from Moodle XML format .