You are here

function qformat_blackboard_6::strip_applet_tags_get_mathml in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/question/format/blackboard_6/format.php \qformat_blackboard_6::strip_applet_tags_get_mathml()
1 call to qformat_blackboard_6::strip_applet_tags_get_mathml()
qformat_blackboard_6::process_block in includes/moodle/question/format/blackboard_6/format.php

File

includes/moodle/question/format/blackboard_6/format.php, line 911

Class

qformat_blackboard_6

Code

function strip_applet_tags_get_mathml($string) {
  if (stristr($string, '</APPLET>') === FALSE) {
    return $string;
  }
  else {

    // strip all applet tags keeping stuff before/after and inbetween (if mathml) them
    while (stristr($string, '</APPLET>') !== FALSE) {
      preg_match("/(.*)\\<applet.*value=\"(\\<math\\>.*\\<\\/math\\>)\".*\\<\\/applet\\>(.*)/i", $string, $mathmls);
      $string = $mathmls[1] . $mathmls[2] . $mathmls[3];
    }
    return $string;
  }
}