You are here

function qformat_hotpot::hotpot_prepare_str in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/question/format/hotpot/format.php \qformat_hotpot::hotpot_prepare_str()
8 calls to qformat_hotpot::hotpot_prepare_str()
qformat_hotpot::hotpot_get_instructions in includes/moodle/question/format/hotpot/format.php
qformat_hotpot::hotpot_get_reading in includes/moodle/question/format/hotpot/format.php
qformat_hotpot::hotpot_get_title in includes/moodle/question/format/hotpot/format.php
qformat_hotpot::process_jcloze in includes/moodle/question/format/hotpot/format.php
qformat_hotpot::process_jcross in includes/moodle/question/format/hotpot/format.php

... See full list

File

includes/moodle/question/format/hotpot/format.php, line 524

Class

qformat_hotpot
@package questionbank @subpackage importexport

Code

function hotpot_prepare_str($str) {

  // convert html entities to unicode and add slashes
  $str = preg_replace('/&#x([0-9a-f]+);/ie', "hotpot_charcode_to_utf8(hexdec('\\1'))", $str);
  $str = preg_replace('/&#([0-9]+);/e', "hotpot_charcode_to_utf8(\\1)", $str);
  return addslashes($str);
}