ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilAssSelfAssessmentQuestionFormatter Class Reference

Class ilAssSelfAssessmentQuestionFormatter. More...

+ Collaboration diagram for ilAssSelfAssessmentQuestionFormatter:

Public Member Functions

 format ($string)
 Original code copied from ::formatSAQuestion (author: akill) More...
 

Protected Member Functions

 handleLineBreaks ($string)
 

Detailed Description

Member Function Documentation

◆ format()

ilAssSelfAssessmentQuestionFormatter::format (   $string)

Original code copied from ::formatSAQuestion (author: akill)

Parameters
$htmlstring
Returns
string

Definition at line 14 of file class.ilAssSelfAssessmentQuestionFormatter.php.

References ilRTE\_replaceMediaObjectImageSrc(), handleLineBreaks(), and ilUtil\insertLatexImages().

15  {
16  $string = $this->handleLineBreaks($string);
17 
18  require_once 'Services/RTE/classes/class.ilRTE.php';
19  $string = (string) ilRTE::_replaceMediaObjectImageSrc($string, 1);
20 
21  $string = str_replace("</li><br />", "</li>", $string);
22  $string = str_replace("</li><br>", "</li>", $string);
23 
24  require_once 'Services/Utilities/classes/class.ilUtil.php';
25  $string = ilUtil::insertLatexImages($string, "\[tex\]", "\[\/tex\]");
26  $string = ilUtil::insertLatexImages($string, "<span class\=\"latex\">", "<\/span>");
27 
28  $string = str_replace('{', '&#123;', $string);
29  $string = str_replace('}', '&#125;', $string);
30 
31  return $string;
32  }
static insertLatexImages($a_text, $a_start="\ex\, $a_end="\\tex\")
replace [text]...[/tex] tags with formula image code
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
+ Here is the call graph for this function:

◆ handleLineBreaks()

ilAssSelfAssessmentQuestionFormatter::handleLineBreaks (   $string)
protected
Parameters
string$string
Returns
string

Definition at line 38 of file class.ilAssSelfAssessmentQuestionFormatter.php.

References ilUtil\isHTML().

Referenced by format().

39  {
40  if( !ilUtil::isHTML($string) )
41  {
42  $string = nl2br($string);
43  }
44 
45  return $string;
46  }
static isHTML($a_text)
Checks if a given string contains HTML or not.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: