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 \assQuestion::formatSAQuestion (author: akill) More...
 

Protected Member Functions

 handleLineBreaks ($string)
 

Detailed Description

Member Function Documentation

◆ format()

ilAssSelfAssessmentQuestionFormatter::format (   $string)

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

Parameters
$htmlstring
Returns
string

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

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 _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...
static insertLatexImages($a_text, $a_start="\[tex\]", $a_end="\[\/tex\]")
replace [text]...[/tex] tags with formula image code

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

+ 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.

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.

References ilUtil\isHTML().

Referenced by format().

+ 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: