You are here

function qformat_learnwise::stringbetween in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/question/format/learnwise/format.php \qformat_learnwise::stringbetween()
1 call to qformat_learnwise::stringbetween()
qformat_learnwise::readquestion in includes/moodle/question/format/learnwise/format.php
Given the data known to define a question in this format, this function converts it into a question object suitable for processing and insertion into Moodle.

File

includes/moodle/question/format/learnwise/format.php, line 134

Class

qformat_learnwise
@package questionbank @subpackage importexport

Code

function stringbetween($text, $start, $end) {
  $startpos = strpos($text, $start) + strlen($start);
  $endpos = strpos($text, $end);
  if ($startpos <= $endpos) {
    return substr($text, $startpos, $endpos - $startpos);
  }
}