ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
assAnswerErrorText Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for assAnswerErrorText:

Public Member Functions

 __construct (string $text_wrong="", string $text_correct="", float $points=0.0, ?int $position=null)
 assAnswerErrorText constructor More...
 
 getTextWrong ()
 
 getTextCorrect ()
 
 getPoints ()
 
 withPoints (float $points)
 
 getPosition ()
 
 withPosition (int $position)
 
 getLength ()
 

Protected Attributes

string $text_wrong
 
string $text_correct
 
float $points
 
int $position
 
int $length
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class for error text answers

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de

Definition at line 29 of file class.assAnswerErrorText.php.

Constructor & Destructor Documentation

◆ __construct()

assAnswerErrorText::__construct ( string  $text_wrong = "",
string  $text_correct = "",
float  $points = 0.0,
?int  $position = null 
)

assAnswerErrorText constructor

Parameters
string$text_wrongWrong text
string$text_correctCorrect text
double$pointsPoints

Definition at line 43 of file class.assAnswerErrorText.php.

References $points, $position, $text_correct, and $text_wrong.

48  {
49  $this->text_wrong = $text_wrong;
50  $this->text_correct = $text_correct;
51  $this->points = $points;
52  $this->position = $position;
53 
54  $word_array = preg_split("/\s+/", $text_wrong);
55 
56  if ($word_array) {
57  $this->length = count($word_array);
58  }
59  }

Member Function Documentation

◆ getLength()

assAnswerErrorText::getLength ( )

Definition at line 95 of file class.assAnswerErrorText.php.

References $length.

95  : int
96  {
97  return $this->length;
98  }

◆ getPoints()

assAnswerErrorText::getPoints ( )

Definition at line 71 of file class.assAnswerErrorText.php.

References $points.

71  : string
72  {
73  return $this->points;
74  }

◆ getPosition()

assAnswerErrorText::getPosition ( )

Definition at line 83 of file class.assAnswerErrorText.php.

References $position.

83  : ?int
84  {
85  return $this->position;
86  }

◆ getTextCorrect()

assAnswerErrorText::getTextCorrect ( )

Definition at line 66 of file class.assAnswerErrorText.php.

References $text_correct.

66  : string
67  {
68  return $this->text_correct;
69  }

◆ getTextWrong()

assAnswerErrorText::getTextWrong ( )

Definition at line 61 of file class.assAnswerErrorText.php.

References $text_wrong.

Referenced by assErrorText\addPositionToErrorAnswer().

61  : string
62  {
63  return $this->text_wrong;
64  }
+ Here is the caller graph for this function:

◆ withPoints()

assAnswerErrorText::withPoints ( float  $points)

Definition at line 76 of file class.assAnswerErrorText.php.

References $points.

76  : self
77  {
78  $clone = clone $this;
79  $clone->points = $points;
80  return $clone;
81  }

◆ withPosition()

assAnswerErrorText::withPosition ( int  $position)

Definition at line 88 of file class.assAnswerErrorText.php.

References $position.

Referenced by assErrorText\addPositionToErrorAnswer().

88  : self
89  {
90  $clone = clone $this;
91  $clone->position = $position;
92  return $clone;
93  }
+ Here is the caller graph for this function:

Field Documentation

◆ $length

int assAnswerErrorText::$length
protected

Definition at line 35 of file class.assAnswerErrorText.php.

Referenced by getLength().

◆ $points

float assAnswerErrorText::$points
protected

Definition at line 33 of file class.assAnswerErrorText.php.

Referenced by __construct(), getPoints(), and withPoints().

◆ $position

int assAnswerErrorText::$position
protected

Definition at line 34 of file class.assAnswerErrorText.php.

Referenced by __construct(), getPosition(), and withPosition().

◆ $text_correct

string assAnswerErrorText::$text_correct
protected

Definition at line 32 of file class.assAnswerErrorText.php.

Referenced by __construct(), and getTextCorrect().

◆ $text_wrong

string assAnswerErrorText::$text_wrong
protected

Definition at line 31 of file class.assAnswerErrorText.php.

Referenced by __construct(), and getTextWrong().


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