ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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
 

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 42 of file class.assAnswerErrorText.php.

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

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

Member Function Documentation

◆ getLength()

assAnswerErrorText::getLength ( )

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

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

◆ getPoints()

assAnswerErrorText::getPoints ( )

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

References $points.

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

◆ getPosition()

assAnswerErrorText::getPosition ( )

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

References $position.

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

◆ getTextCorrect()

assAnswerErrorText::getTextCorrect ( )

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

References $text_correct.

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

◆ getTextWrong()

assAnswerErrorText::getTextWrong ( )

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

References $text_wrong.

Referenced by assErrorText\addPositionToErrorAnswer().

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

◆ withPoints()

assAnswerErrorText::withPoints ( float  $points)

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

References $points.

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

◆ withPosition()

assAnswerErrorText::withPosition ( int  $position)

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

References $position.

Referenced by assErrorText\addPositionToErrorAnswer().

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

Field Documentation

◆ $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: