ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Test\Results\Data\QuestionResult Class Reference
+ Collaboration diagram for ILIAS\Test\Results\Data\QuestionResult:

Public Member Functions

 __construct (private readonly int $id, private readonly string $type, private readonly string $title, private readonly float $question_score, private readonly float $usr_score, private readonly string $usr_solution, private readonly string $best_solution, private readonly string $feedback, private readonly bool $workedthrough, private readonly bool $answered, private readonly ?string $content_for_recapitulation, private readonly int $position)
 
 getId ()
 
 getType ()
 
 getTitle ()
 
 getUserAnswer ()
 
 getBestSolution ()
 
 getQuestionScore ()
 
 getUserScore ()
 
 getUserScorePercent ()
 
 getCorrect ()
 
 getFeedback ()
 
 isWorkedThrough ()
 
 isAnswered ()
 
 getContentForRecapitulation ()
 
 getPosition ()
 

Data Fields

const CORRECT_FULL = 1
 
const CORRECT_PARTIAL = 2
 
const CORRECT_NONE = 3
 

Detailed Description

Definition at line 23 of file QuestionResult.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Results\Data\QuestionResult::__construct ( private readonly int  $id,
private readonly string  $type,
private readonly string  $title,
private readonly float  $question_score,
private readonly float  $usr_score,
private readonly string  $usr_solution,
private readonly string  $best_solution,
private readonly string  $feedback,
private readonly bool  $workedthrough,
private readonly bool  $answered,
private readonly ?string  $content_for_recapitulation,
private readonly int  $position 
)

Definition at line 29 of file QuestionResult.php.

42 {
43 }

Member Function Documentation

◆ getBestSolution()

ILIAS\Test\Results\Data\QuestionResult::getBestSolution ( )

Definition at line 61 of file QuestionResult.php.

61 : string
62 {
63 return $this->best_solution;
64 }

◆ getContentForRecapitulation()

ILIAS\Test\Results\Data\QuestionResult::getContentForRecapitulation ( )

Definition at line 103 of file QuestionResult.php.

103 : ?string
104 {
105 return $this->content_for_recapitulation;
106 }

◆ getCorrect()

◆ getFeedback()

ILIAS\Test\Results\Data\QuestionResult::getFeedback ( )

Definition at line 91 of file QuestionResult.php.

91 : string
92 {
93 return $this->feedback;
94 }

◆ getId()

ILIAS\Test\Results\Data\QuestionResult::getId ( )

Definition at line 45 of file QuestionResult.php.

45 : int
46 {
47 return $this->id;
48 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id.

◆ getPosition()

ILIAS\Test\Results\Data\QuestionResult::getPosition ( )

Definition at line 107 of file QuestionResult.php.

107 : int
108 {
109 return $this->position;
110 }

◆ getQuestionScore()

ILIAS\Test\Results\Data\QuestionResult::getQuestionScore ( )

Definition at line 65 of file QuestionResult.php.

65 : float
66 {
67 return $this->question_score;
68 }

Referenced by ILIAS\Test\Results\Data\QuestionResult\getCorrect(), and ILIAS\Test\Results\Data\QuestionResult\getUserScorePercent().

+ Here is the caller graph for this function:

◆ getTitle()

ILIAS\Test\Results\Data\QuestionResult::getTitle ( )

Definition at line 53 of file QuestionResult.php.

53 : string
54 {
55 return $this->title;
56 }

◆ getType()

ILIAS\Test\Results\Data\QuestionResult::getType ( )

Definition at line 49 of file QuestionResult.php.

49 : string
50 {
51 return $this->type;
52 }

◆ getUserAnswer()

ILIAS\Test\Results\Data\QuestionResult::getUserAnswer ( )

Definition at line 57 of file QuestionResult.php.

57 : string
58 {
59 return $this->usr_solution;
60 }

◆ getUserScore()

ILIAS\Test\Results\Data\QuestionResult::getUserScore ( )

Definition at line 69 of file QuestionResult.php.

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

Referenced by ILIAS\Test\Results\Data\QuestionResult\getCorrect(), and ILIAS\Test\Results\Data\QuestionResult\getUserScorePercent().

+ Here is the caller graph for this function:

◆ getUserScorePercent()

ILIAS\Test\Results\Data\QuestionResult::getUserScorePercent ( )

Definition at line 73 of file QuestionResult.php.

73 : float
74 {
75 if ($this->getQuestionScore() === 0.0) {
76 return 100;
77 }
78
79 return 100 / $this->getQuestionScore() * $this->getUserScore();
80 }

References ILIAS\Test\Results\Data\QuestionResult\getQuestionScore(), and ILIAS\Test\Results\Data\QuestionResult\getUserScore().

+ Here is the call graph for this function:

◆ isAnswered()

ILIAS\Test\Results\Data\QuestionResult::isAnswered ( )

Definition at line 99 of file QuestionResult.php.

99 : bool
100 {
101 return $this->answered;
102 }

◆ isWorkedThrough()

ILIAS\Test\Results\Data\QuestionResult::isWorkedThrough ( )

Definition at line 95 of file QuestionResult.php.

95 : bool
96 {
97 return $this->workedthrough;
98 }

Field Documentation

◆ CORRECT_FULL

◆ CORRECT_NONE

const ILIAS\Test\Results\Data\QuestionResult::CORRECT_NONE = 3

◆ CORRECT_PARTIAL


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