Ejemplo n.º 1
0
 /**
  * fix_js_CheckAnswers
  *
  * @param xxx $str (passed by reference)
  * @param xxx $start
  * @param xxx $length
  */
 function fix_js_CheckAnswers(&$str, $start, $length)
 {
     $substr = substr($str, $start, $length);
     // do several search and replace actions at once
     $search = array('/if \\(NumOfVisibleGaps < 1\\)\\{return;\\}/', "/(\\s+)Output = '';/s", '/Output \\+= MissingMistakes \\+ Get_NumMissingErr\\(\\);/', '/CalculateScore\\(\\);/');
     $replace = array('if (NumOfVisibleGaps){', '$1}$0', 'if (NumOfVisibleGaps) $0', 'if (NumOfVisibleGaps) $0');
     $substr = preg_replace($search, $replace, $substr, 1);
     parent::fix_js_CheckAnswers($substr, 0, strlen($substr));
     $str = substr_replace($str, $substr, $start, $length);
 }