original_string: public function import_multichoice($question) {
          // Get common parts.
          $qo = $this->import_headers($question);
  
          // Header parts particular to multichoice.
          $qo->qtype = 'multichoice';
          $single = $this->getpath($question, array('#', 'single', 0, '#'), 'true');
          $qo->single = $this->trans_single($single);
          $shuffleanswers = $this->getpath($question,
                  array('#', 'shuffleanswers', 0, '#'), 'false');
          $qo->answernumbering = $this->getpath($question,
                  array('#', 'answernumbering', 0, '#'), 'abc');
          $qo->shuffleanswers = $this->trans_single($shuffleanswers);
  
          // There was a time on the 1.8 branch when it could output an empty
          // answernumbering tag, so fix up any found.
          if (empty($qo->answernumbering)) {
              $qo->answernumbering = 'abc';
          }
  
          // Run through the answers.
          $answers = $question['#']['answer'];
          $acount = 0;
          foreach ($answers as $answer) {
              $ans = $this->import_answer($answer, true, $this->get_format($qo->questiontextformat));
              $qo->answer[$acount] = $ans->answer;
              $qo->fraction[$acount] = $ans->fraction;
              $qo->feedback[$acount] = $ans->feedback;
              ++$acount;
          }
  
          $this->import_combined_feedback($qo, $question, true);
          $this->import_hints($qo, $question, true, false, $this->get_format($qo->questiontextformat));
  
          return $qo;
      }
code: public function import_multichoice($question) {
          // Get common parts.
          $qo = $this->import_headers($question);
  
          // Header parts particular to multichoice.
          $qo->qtype = 'multichoice';
          $single = $this->getpath($question, array('#', 'single', 0, '#'), 'true');
          $qo->single = $this->trans_single($single);
          $shuffleanswers = $this->getpath($question,
                  array('#', 'shuffleanswers', 0, '#'), 'false');
          $qo->answernumbering = $this->getpath($question,
                  array('#', 'answernumbering', 0, '#'), 'abc');
          $qo->shuffleanswers = $this->trans_single($shuffleanswers);
  
          // There was a time on the 1.8 branch when it could output an empty
          // answernumbering tag, so fix up any found.
          if (empty($qo->answernumbering)) {
              $qo->answernumbering = 'abc';
          }
  
          // Run through the answers.
          $answers = $question['#']['answer'];
          $acount = 0;
          foreach ($answers as $answer) {
              $ans = $this->import_answer($answer, true, $this->get_format($qo->questiontextformat));
              $qo->answer[$acount] = $ans->answer;
              $qo->fraction[$acount] = $ans->fraction;
              $qo->feedback[$acount] = $ans->feedback;
              ++$acount;
          }
  
          $this->import_combined_feedback($qo, $question, true);
          $this->import_hints($qo, $question, true, false, $this->get_format($qo->questiontextformat));
  
          return $qo;
      }
code_tokens: public function import_multichoice ( $ question ) { // Get common parts. $ qo = $ this -> import_headers ( $ question ) ; // Header parts particular to multichoice. $ qo -> qtype = 'multichoice' ; $ single = $ this -> getpath ( $ question , array ( '#' , 'single' , 0 , '#' ) , 'true' ) ; $ qo -> single = $ this -> trans_single ( $ single ) ; $ shuffleanswers = $ this -> getpath ( $ question , array ( '#' , 'shuffleanswers' , 0 , '#' ) , 'false' ) ; $ qo -> answernumbering = $ this -> getpath ( $ question , array ( '#' , 'answernumbering' , 0 , '#' ) , 'abc' ) ; $ qo -> shuffleanswers = $ this -> trans_single ( $ shuffleanswers ) ; // There was a time on the 1.8 branch when it could output an empty // answernumbering tag, so fix up any found. if ( empty ( $ qo -> answernumbering ) ) { $ qo -> answernumbering = 'abc' ; } // Run through the answers. $ answers = $ question [ '#' ] [ 'answer' ] ; $ acount = 0 ; foreach ( $ answers as $ answer ) { $ ans = $ this -> import_answer ( $ answer , true , $ this -> get_format ( $ qo -> questiontextformat ) ) ; $ qo -> answer [ $ acount ] = $ ans -> answer ; $ qo -> fraction [ $ acount ] = $ ans -> fraction ; $ qo -> feedback [ $ acount ] = $ ans -> feedback ; ++ $ acount ; } $ this -> import_combined_feedback ( $ qo , $ question , true ) ; $ this -> import_hints ( $ qo , $ question , true , false , $ this -> get_format ( $ qo -> questiontextformat ) ) ; return $ qo ; }
docstring: import multiple choice question
  @param array question question array from xml tree
  @return object question object
docstring_tokens: import multiple choice question