ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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
 
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 27 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 41 of file class.assAnswerErrorText.php.

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

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

Member Function Documentation

◆ getLength()

assAnswerErrorText::getLength ( )

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

References $length.

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

◆ getPoints()

assAnswerErrorText::getPoints ( )

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

References $points.

69  : float
70  {
71  return $this->points;
72  }

◆ getPosition()

assAnswerErrorText::getPosition ( )

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

References $position.

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

◆ getTextCorrect()

assAnswerErrorText::getTextCorrect ( )

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

References $text_correct.

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

◆ getTextWrong()

assAnswerErrorText::getTextWrong ( )

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

References $text_wrong.

Referenced by assErrorText\addPositionToErrorAnswer().

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

◆ withPoints()

assAnswerErrorText::withPoints ( float  $points)

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

References $points.

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

◆ withPosition()

assAnswerErrorText::withPosition ( int  $position)

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

References $position.

Referenced by assErrorText\addPositionToErrorAnswer().

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

Field Documentation

◆ $length

int assAnswerErrorText::$length
protected

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

Referenced by getLength().

◆ $points

float assAnswerErrorText::$points
protected

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

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

◆ $position

int assAnswerErrorText::$position
protected

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

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

◆ $text_correct

string assAnswerErrorText::$text_correct
protected

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

Referenced by __construct(), and getTextCorrect().

◆ $text_wrong

string assAnswerErrorText::$text_wrong
protected

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

Referenced by __construct(), and getTextWrong().


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