コード例 #1
0
 /**
  * Replace STACK 2 tags in the question text with new ones.
  * @param  string incoming question text
  * @param  array input names
  * @return string converted raw keyvals.
  */
 public function convert_questiontext($questiontext, $inputnames)
 {
     foreach ($inputnames as $name) {
         $questiontext = str_replace('#' . $name . '#', "[[input:{$name}]]", $questiontext);
         $questiontext = str_replace('<IEfeedback>' . $name . '</IEfeedback>', "[[validation:{$name}]]", $questiontext);
     }
     $questiontext = stack_fact_sheets::convert_legacy_tags($questiontext);
     return $this->fix_maths_delimiters($questiontext);
 }
コード例 #2
0
 /**
  * Replace any <hint> delimiters in the given text from the
  * form with the recommended delimiters.
  * @param string $text input to convert.
  */
 protected function convert_legacy_fact_sheets($text)
 {
     return stack_fact_sheets::convert_legacy_tags($text);
 }
コード例 #3
0
 public function test_legacy_convert()
 {
     $this->assertEquals("An [[facts:old_hint]] and [[facts:older_hint]].", stack_fact_sheets::convert_legacy_tags("An <hint>old_hint</hint> and <hint>older_hint</hint>."));
 }