public function parse()
 {
     // 定义题型样式
     $ap = $this->patterning(array($this->anp, $this->ap, $this->ep), 'umi');
     // 处理答案
     $answerTextArray = array();
     preg_match_all($ap, $this->_sectionText, $answerTextArray);
     if (count($answerTextArray) > 0 && count($answerTextArray[0]) > 0) {
         $answerTextArray = $answerTextArray[0];
     } else {
         return null;
     }
     // 处理答案
     $answerArray = array();
     foreach ($answerTextArray as $answerText) {
         // 拆解每个答案并生成对应的Answer
         $answer = new Answer();
         $answer->Set_content(ext_trim(preg_replace($ap, '$1', $answerText)));
         $answer->Set_type(AnswerType::CORRECTION);
         $answer->Set_desc(ext_trim(preg_replace($this->patterning(array($this->anp, $this->ap), 'umi'), '', $answerText)));
         $answerArray[] = $answer;
     }
     // 返回结果
     return $answerArray;
 }
 public function parse()
 {
     // 定义题型样式
     $ap = $this->patterning(array($this->anp, $this->ap), 'umi');
     // 处理答案
     $answerTextArray = array();
     preg_match_all($ap, $this->_sectionText, $answerTextArray);
     if (count($answerTextArray) > 0 && count($answerTextArray[0]) > 0) {
         $answerTextArray = $answerTextArray[0];
     } else {
         return null;
     }
     // 处理答案
     $answerArray = array();
     foreach ($answerTextArray as $answerText) {
         // 拆解每个答案并生成对应的Answer
         $answer = new Answer(true);
         $answerText = preg_replace($this->patterning($this->anp), '', $answerText);
         $subAnswerTextArray = array();
         $subAnswerTextArray = preg_split($this->patterning($this->sas), $answerText);
         foreach ($subAnswerTextArray as $subAnswerText) {
             $subAnswer = new Answer();
             $subAnswer->Set_content(ext_trim($subAnswerText));
             $subAnswer->Set_type(AnswerType::SHORT_ANSWER);
             $subAnswers =& $answer->Get_answers();
             $subAnswers[] = $subAnswer;
         }
         $answer->Set_type(AnswerType::SHORT_ANSWER);
         $answerArray[] = $answer;
     }
     // 返回结果
     return $answerArray;
 }
 public function parse()
 {
     // 定义题型样式
     $ap = $this->patterning($this->ap, 'usi');
     // 处理答案
     $answerTextArray = array();
     preg_match_all($ap, $this->_sectionText, $answerTextArray);
     if (count($answerTextArray) > 0 && count($answerTextArray[0]) > 0) {
         $answerTextArray = $answerTextArray[0];
         $cp = $this->patterning($this->mp, 'usi');
         for ($i = 0; $i < count($answerTextArray); $i++) {
             $answerTextArray[$i] = preg_replace(array($cp, '/^\\s*|\\s*$/s'), '', $answerTextArray[$i]);
         }
     } else {
         return null;
     }
     // 处理答案
     $answerArray = array();
     foreach ($answerTextArray as $answerText) {
         // 拆解每个答案并生成对应的Answer
         $answer = new Answer();
         $answer->Set_content($answerText);
         $answer->Set_type(AnswerType::OTHERS);
         $answerArray[] = $answer;
     }
     // 返回结果
     return $answerArray;
 }
 public function parse()
 {
     // 定义题型样式
     $ap = $this->patterning($this->ap, 'usi');
     // 处理答案
     $answerTextArray = array();
     preg_match_all($ap, $this->_sectionText, $answerTextArray);
     if (count($answerTextArray) > 0 && count($answerTextArray[0]) > 0) {
         $answerTextArray = $answerTextArray[0];
     } else {
         return null;
     }
     // 处理答案
     $answerArray = array();
     foreach ($answerTextArray as $answerText) {
         // 拆解每个答案并生成对应的Answer
         $answer = new Answer();
         $answer->Set_content($answerText);
         $answer->Set_type(AnswerType::MULTIPLE_CHOICE);
         $answerArray[] = $answer;
     }
     // 返回结果
     return $answerArray;
 }