ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilQuestionResult Class Reference
+ Collaboration diagram for ilQuestionResult:

Public Member Functions

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

Data Fields

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

Detailed Description

Definition at line 25 of file class.ilQuestionResult.php.

Constructor & Destructor Documentation

◆ __construct()

ilQuestionResult::__construct ( protected int  $id,
protected string  $type,
protected string  $title,
protected float  $question_score,
protected float  $usr_score,
protected string  $usr_solution,
protected string  $best_solution,
protected string  $feedback,
protected bool  $workedthrough,
protected bool  $answered,
protected int  $requested_hints,
protected ?string  $content_for_recapitulation,
protected ?string  $autosaved_answer,
protected int  $position 
)

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

46  {
47  }

Member Function Documentation

◆ getAutosavedAnswer()

ilQuestionResult::getAutosavedAnswer ( )

Definition at line 115 of file class.ilQuestionResult.php.

115  : ?string
116  {
117  return $this->autosaved_answer;
118  }

◆ getBestSolution()

ilQuestionResult::getBestSolution ( )

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

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

◆ getContentForRecapitulation()

ilQuestionResult::getContentForRecapitulation ( )

Definition at line 107 of file class.ilQuestionResult.php.

107  : ?string
108  {
109  return $this->content_for_recapitulation;
110  }

◆ getCorrect()

ilQuestionResult::getCorrect ( )

Definition at line 85 of file class.ilQuestionResult.php.

References getQuestionScore(), and getUserScore().

85  : int
86  {
87  if ($this->getUserScore() === 0.0) {
88  return self::CORRECT_NONE;
89  }
90  if ($this->getUserScore() === $this->getQuestionScore()) {
91  return self::CORRECT_FULL;
92  }
93  return self::CORRECT_PARTIAL;
94  }
+ Here is the call graph for this function:

◆ getFeedback()

ilQuestionResult::getFeedback ( )

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

95  : string
96  {
97  return $this->feedback;
98  }

◆ getId()

ilQuestionResult::getId ( )

Definition at line 49 of file class.ilQuestionResult.php.

References $id.

49  : int
50  {
51  return $this->id;
52  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ getNumberOfRequestedHints()

ilQuestionResult::getNumberOfRequestedHints ( )

Definition at line 111 of file class.ilQuestionResult.php.

111  : int
112  {
113  return $this->requested_hints;
114  }

◆ getPosition()

ilQuestionResult::getPosition ( )

Definition at line 119 of file class.ilQuestionResult.php.

119  : int
120  {
121  return $this->position;
122  }

◆ getQuestionScore()

ilQuestionResult::getQuestionScore ( )

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

Referenced by ilTestPassResultsTable\applyControls(), getCorrect(), and getUserScorePercent().

69  : float
70  {
71  return $this->question_score;
72  }
+ Here is the caller graph for this function:

◆ getTitle()

ilQuestionResult::getTitle ( )

Definition at line 57 of file class.ilQuestionResult.php.

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

◆ getType()

ilQuestionResult::getType ( )

Definition at line 53 of file class.ilQuestionResult.php.

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

◆ getUserAnswer()

ilQuestionResult::getUserAnswer ( )

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

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

◆ getUserScore()

ilQuestionResult::getUserScore ( )

Definition at line 73 of file class.ilQuestionResult.php.

Referenced by getCorrect(), and getUserScorePercent().

73  : float
74  {
75  return $this->usr_score;
76  }
+ Here is the caller graph for this function:

◆ getUserScorePercent()

ilQuestionResult::getUserScorePercent ( )

Definition at line 77 of file class.ilQuestionResult.php.

References getQuestionScore(), and getUserScore().

77  : float
78  {
79  if ($this->getQuestionScore() === 0.0) {
80  return 100;
81  }
82 
83  return 100 / $this->getQuestionScore() * $this->getUserScore();
84  }
+ Here is the call graph for this function:

◆ isAnswered()

ilQuestionResult::isAnswered ( )

Definition at line 103 of file class.ilQuestionResult.php.

103  : bool
104  {
105  return $this->answered;
106  }

◆ isWorkedThrough()

ilQuestionResult::isWorkedThrough ( )

Definition at line 99 of file class.ilQuestionResult.php.

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

Field Documentation

◆ CORRECT_FULL

const ilQuestionResult::CORRECT_FULL = 1

◆ CORRECT_NONE

const ilQuestionResult::CORRECT_NONE = 3

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

Referenced by ilTestPassResultsTable\getMapping().

◆ CORRECT_PARTIAL


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