original_string: public function import_shortanswer($question) {
          // Get common parts.
          $qo = $this->import_headers($question);
  
          // Header parts particular to shortanswer.
          $qo->qtype = 'shortanswer';
  
          // Get usecase.
          $qo->usecase = $this->getpath($question, array('#', 'usecase', 0, '#'), $qo->usecase);
  
          // Run through the answers.
          $answers = $question['#']['answer'];
          $acount = 0;
          foreach ($answers as $answer) {
              $ans = $this->import_answer($answer, false, $this->get_format($qo->questiontextformat));
              $qo->answer[$acount] = $ans->answer['text'];
              $qo->fraction[$acount] = $ans->fraction;
              $qo->feedback[$acount] = $ans->feedback;
              ++$acount;
          }
  
          $this->import_hints($qo, $question, false, false, $this->get_format($qo->questiontextformat));
  
          return $qo;
      }
code: public function import_shortanswer($question) {
          // Get common parts.
          $qo = $this->import_headers($question);
  
          // Header parts particular to shortanswer.
          $qo->qtype = 'shortanswer';
  
          // Get usecase.
          $qo->usecase = $this->getpath($question, array('#', 'usecase', 0, '#'), $qo->usecase);
  
          // Run through the answers.
          $answers = $question['#']['answer'];
          $acount = 0;
          foreach ($answers as $answer) {
              $ans = $this->import_answer($answer, false, $this->get_format($qo->questiontextformat));
              $qo->answer[$acount] = $ans->answer['text'];
              $qo->fraction[$acount] = $ans->fraction;
              $qo->feedback[$acount] = $ans->feedback;
              ++$acount;
          }
  
          $this->import_hints($qo, $question, false, false, $this->get_format($qo->questiontextformat));
  
          return $qo;
      }
code_tokens: public function import_shortanswer ( $ question ) { // Get common parts. $ qo = $ this -> import_headers ( $ question ) ; // Header parts particular to shortanswer. $ qo -> qtype = 'shortanswer' ; // Get usecase. $ qo -> usecase = $ this -> getpath ( $ question , array ( '#' , 'usecase' , 0 , '#' ) , $ qo -> usecase ) ; // Run through the answers. $ answers = $ question [ '#' ] [ 'answer' ] ; $ acount = 0 ; foreach ( $ answers as $ answer ) { $ ans = $ this -> import_answer ( $ answer , false , $ this -> get_format ( $ qo -> questiontextformat ) ) ; $ qo -> answer [ $ acount ] = $ ans -> answer [ 'text' ] ; $ qo -> fraction [ $ acount ] = $ ans -> fraction ; $ qo -> feedback [ $ acount ] = $ ans -> feedback ; ++ $ acount ; } $ this -> import_hints ( $ qo , $ question , false , false , $ this -> get_format ( $ qo -> questiontextformat ) ) ; return $ qo ; }
docstring: Import short answer type question
  @param array question question array from xml tree
  @return object question object
docstring_tokens: Import short answer type question