ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestEvaluationPassData Class Reference
+ Collaboration diagram for ilTestEvaluationPassData:

Public Member Functions

 __sleep ()
 
 __construct ()
 Constructor. More...
 
 getNrOfAnsweredQuestions ()
 
 setNrOfAnsweredQuestions ($nrOfAnsweredQuestions)
 
 getReachedPoints ()
 
 setReachedPoints ($reachedpoints)
 
 getMaxPoints ()
 
 setMaxPoints ($maxpoints)
 
 getQuestionCount ()
 
 setQuestionCount ($questioncount)
 
 getWorkingTime ()
 
 setWorkingTime ($workingtime)
 
 getPass ()
 
 setPass ($a_pass)
 
 getAnsweredQuestions ()
 
 addAnsweredQuestion ($question_id, $max_points, $reached_points, $isAnswered, $sequence=null, $manual=0)
 
 getAnsweredQuestion ($index)
 
 getAnsweredQuestionByQuestionId ($question_id)
 
 getAnsweredQuestionCount ()
 
 getRequestedHintsCount ()
 Getter for $requestedHintsCount. More...
 
 setRequestedHintsCount ($requestedHintsCount)
 Setter for $requestedHintsCount. More...
 
 getDeductedHintPoints ()
 Getter for $deductedHintPoints. More...
 
 setDeductedHintPoints ($deductedHintPoints)
 Setter for $deductedHintPoints. More...
 
 setObligationsAnswered ($obligationsAnswered)
 setter for property obligationsAnswered More...
 
 getExamId ()
 
 setExamId (string $examId)
 
 areObligationsAnswered ()
 getter for property obligationsAnswered. More...
 

Data Fields

 $answeredQuestions
 
 $pass
 

Private Attributes

 $workingtime
 
 $questioncount
 
 $maxpoints
 
 $reachedpoints
 
 $nrOfAnsweredQuestions
 
 $requestedHintsCount = null
 
 $deductedHintPoints = null
 
 $obligationsAnswered = null
 
 $examId = ''
 

Detailed Description

Definition at line 19 of file class.ilTestEvaluationPassData.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestEvaluationPassData::__construct ( )

Constructor.

public

Definition at line 105 of file class.ilTestEvaluationPassData.php.

106  {
107  $this->answeredQuestions = array();
108  }

Member Function Documentation

◆ __sleep()

ilTestEvaluationPassData::__sleep ( )

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

95  {
96  return array('answeredQuestions', 'pass', 'nrOfAnsweredQuestions', 'reachedpoints',
97  'maxpoints', 'questioncount', 'workingtime', 'examId');
98  }

◆ addAnsweredQuestion()

ilTestEvaluationPassData::addAnsweredQuestion (   $question_id,
  $max_points,
  $reached_points,
  $isAnswered,
  $sequence = null,
  $manual = 0 
)

Definition at line 175 of file class.ilTestEvaluationPassData.php.

176  {
177  $this->answeredQuestions[] = array(
178  "id" => $question_id,
179  "points" => round($max_points, 2),
180  "reached" => round($reached_points, 2),
181  'isAnswered' => $isAnswered,
182  "sequence" => $sequence,
183  'manual' => $manual
184  );
185  }

◆ areObligationsAnswered()

ilTestEvaluationPassData::areObligationsAnswered ( )

getter for property obligationsAnswered.

if property wasn't set yet the method is trying to determine this information by iterating over the added questions. if both wasn't possible the method throws an exception

Exceptions
ilTestEvaluationException
Returns
boolean

Definition at line 287 of file class.ilTestEvaluationPassData.php.

References $obligationsAnswered.

288  {
289  if (!is_null($this->obligationsAnswered)) {
291  }
292 
293  if (is_array($this->answeredQuestions) && count($this->answeredQuestions)) {
294  foreach ($this->answeredQuestions as $question) {
295  if (!$question['isAnswered']) {
296  return false;
297  }
298  }
299 
300  return true;
301  }
302 
303  throw new ilTestEvaluationException(
304  'Neither the boolean property ilTestEvaluationPassData::obligationsAnswered was set, ' .
305  'nor the property array property ilTestEvaluationPassData::answeredQuestions contains elements!'
306  );
307  }

◆ getAnsweredQuestion()

ilTestEvaluationPassData::getAnsweredQuestion (   $index)

Definition at line 187 of file class.ilTestEvaluationPassData.php.

References $index.

188  {
189  if (array_key_exists($index, $this->answeredQuestions)) {
190  return $this->answeredQuestions[$index];
191  } else {
192  return null;
193  }
194  }
$index
Definition: metadata.php:60

◆ getAnsweredQuestionByQuestionId()

ilTestEvaluationPassData::getAnsweredQuestionByQuestionId (   $question_id)

Definition at line 196 of file class.ilTestEvaluationPassData.php.

197  {
198  foreach ($this->answeredQuestions as $question) {
199  if ($question["id"] == $question_id) {
200  return $question;
201  }
202  }
203  return null;
204  }

◆ getAnsweredQuestionCount()

ilTestEvaluationPassData::getAnsweredQuestionCount ( )

Definition at line 206 of file class.ilTestEvaluationPassData.php.

207  {
208  return count($this->answeredQuestions);
209  }

◆ getAnsweredQuestions()

ilTestEvaluationPassData::getAnsweredQuestions ( )

◆ getDeductedHintPoints()

ilTestEvaluationPassData::getDeductedHintPoints ( )

Getter for $deductedHintPoints.

Returns
integer $deductedHintPoints

Definition at line 236 of file class.ilTestEvaluationPassData.php.

References $deductedHintPoints.

◆ getExamId()

ilTestEvaluationPassData::getExamId ( )
Returns
string

Definition at line 264 of file class.ilTestEvaluationPassData.php.

References $examId.

264  : string
265  {
266  return $this->examId;
267  }

◆ getMaxPoints()

ilTestEvaluationPassData::getMaxPoints ( )

Definition at line 130 of file class.ilTestEvaluationPassData.php.

References $maxpoints.

◆ getNrOfAnsweredQuestions()

ilTestEvaluationPassData::getNrOfAnsweredQuestions ( )

◆ getPass()

ilTestEvaluationPassData::getPass ( )

Definition at line 160 of file class.ilTestEvaluationPassData.php.

References $pass.

◆ getQuestionCount()

ilTestEvaluationPassData::getQuestionCount ( )

Definition at line 140 of file class.ilTestEvaluationPassData.php.

References $questioncount.

◆ getReachedPoints()

ilTestEvaluationPassData::getReachedPoints ( )

Definition at line 120 of file class.ilTestEvaluationPassData.php.

References $reachedpoints.

◆ getRequestedHintsCount()

ilTestEvaluationPassData::getRequestedHintsCount ( )

Getter for $requestedHintsCount.

Returns
integer $requestedHintsCount

Definition at line 216 of file class.ilTestEvaluationPassData.php.

References $requestedHintsCount.

◆ getWorkingTime()

ilTestEvaluationPassData::getWorkingTime ( )

Definition at line 150 of file class.ilTestEvaluationPassData.php.

References $workingtime.

◆ setDeductedHintPoints()

ilTestEvaluationPassData::setDeductedHintPoints (   $deductedHintPoints)

Setter for $deductedHintPoints.

Parameters
integer$deductedHintPoints

Definition at line 246 of file class.ilTestEvaluationPassData.php.

References $deductedHintPoints.

247  {
248  $this->deductedHintPoints = $deductedHintPoints;
249  }

◆ setExamId()

ilTestEvaluationPassData::setExamId ( string  $examId)
Parameters
string$examId

Definition at line 272 of file class.ilTestEvaluationPassData.php.

References $examId.

273  {
274  $this->examId = $examId;
275  }

◆ setMaxPoints()

ilTestEvaluationPassData::setMaxPoints (   $maxpoints)

Definition at line 135 of file class.ilTestEvaluationPassData.php.

References $maxpoints.

136  {
137  $this->maxpoints = $maxpoints;
138  }

◆ setNrOfAnsweredQuestions()

ilTestEvaluationPassData::setNrOfAnsweredQuestions (   $nrOfAnsweredQuestions)

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

References $nrOfAnsweredQuestions.

116  {
117  $this->nrOfAnsweredQuestions = $nrOfAnsweredQuestions;
118  }

◆ setObligationsAnswered()

ilTestEvaluationPassData::setObligationsAnswered (   $obligationsAnswered)

setter for property obligationsAnswered

Parameters
boolean$obligationsAnswered

Definition at line 256 of file class.ilTestEvaluationPassData.php.

References $obligationsAnswered.

257  {
258  $this->obligationsAnswered = (bool) $obligationsAnswered;
259  }

◆ setPass()

ilTestEvaluationPassData::setPass (   $a_pass)

Definition at line 165 of file class.ilTestEvaluationPassData.php.

166  {
167  $this->pass = $a_pass;
168  }

◆ setQuestionCount()

ilTestEvaluationPassData::setQuestionCount (   $questioncount)

Definition at line 145 of file class.ilTestEvaluationPassData.php.

References $questioncount.

146  {
147  $this->questioncount = $questioncount;
148  }

◆ setReachedPoints()

ilTestEvaluationPassData::setReachedPoints (   $reachedpoints)

Definition at line 125 of file class.ilTestEvaluationPassData.php.

References $reachedpoints.

126  {
127  $this->reachedpoints = $reachedpoints;
128  }

◆ setRequestedHintsCount()

ilTestEvaluationPassData::setRequestedHintsCount (   $requestedHintsCount)

Setter for $requestedHintsCount.

Parameters
integer$requestedHintsCount

Definition at line 226 of file class.ilTestEvaluationPassData.php.

References $requestedHintsCount.

227  {
228  $this->requestedHintsCount = $requestedHintsCount;
229  }

◆ setWorkingTime()

ilTestEvaluationPassData::setWorkingTime (   $workingtime)

Definition at line 155 of file class.ilTestEvaluationPassData.php.

References $workingtime.

156  {
157  $this->workingtime = $workingtime;
158  }

Field Documentation

◆ $answeredQuestions

ilTestEvaluationPassData::$answeredQuestions

Definition at line 26 of file class.ilTestEvaluationPassData.php.

Referenced by getAnsweredQuestions().

◆ $deductedHintPoints

ilTestEvaluationPassData::$deductedHintPoints = null
private

◆ $examId

ilTestEvaluationPassData::$examId = ''
private

Definition at line 92 of file class.ilTestEvaluationPassData.php.

Referenced by getExamId(), and setExamId().

◆ $maxpoints

ilTestEvaluationPassData::$maxpoints
private

Definition at line 47 of file class.ilTestEvaluationPassData.php.

Referenced by getMaxPoints(), and setMaxPoints().

◆ $nrOfAnsweredQuestions

ilTestEvaluationPassData::$nrOfAnsweredQuestions
private

◆ $obligationsAnswered

ilTestEvaluationPassData::$obligationsAnswered = null
private

◆ $pass

ilTestEvaluationPassData::$pass

Definition at line 68 of file class.ilTestEvaluationPassData.php.

Referenced by getPass().

◆ $questioncount

ilTestEvaluationPassData::$questioncount
private

Definition at line 40 of file class.ilTestEvaluationPassData.php.

Referenced by getQuestionCount(), and setQuestionCount().

◆ $reachedpoints

ilTestEvaluationPassData::$reachedpoints
private

Definition at line 54 of file class.ilTestEvaluationPassData.php.

Referenced by getReachedPoints(), and setReachedPoints().

◆ $requestedHintsCount

ilTestEvaluationPassData::$requestedHintsCount = null
private

◆ $workingtime

ilTestEvaluationPassData::$workingtime
private

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

Referenced by getWorkingTime(), and setWorkingTime().


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