ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 
 areObligationsAnswered ()
 getter for property obligationsAnswered. More...
 

Data Fields

 $answeredQuestions
 
 $pass
 

Private Attributes

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

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestEvaluationPassData::__construct ( )

Constructor.

public

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

References array.

103  {
104  $this->answeredQuestions = array();
105  }
Create styles array
The data for the language used.

Member Function Documentation

◆ __sleep()

ilTestEvaluationPassData::__sleep ( )

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

References array.

92  {
93  return array('answeredQuestions', 'pass', 'nrOfAnsweredQuestions', 'reachedpoints',
94  'maxpoints', 'questioncount', 'workingtime');
95  }
Create styles array
The data for the language used.

◆ addAnsweredQuestion()

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

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

References array.

173  {
174  $this->answeredQuestions[] = array(
175  "id" => $question_id,
176  "points" => round($max_points, 2),
177  "reached" => round($reached_points, 2),
178  'isAnswered' => $isAnswered,
179  "sequence" => $sequence,
180  'manual' => $manual
181  );
182  }
Create styles array
The data for the language used.

◆ 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 273 of file class.ilTestEvaluationPassData.php.

References $obligationsAnswered.

274  {
275  if( !is_null($this->obligationsAnswered) )
276  {
278  }
279 
280  if( is_array($this->answeredQuestions) && count($this->answeredQuestions) )
281  {
282  foreach($this->answeredQuestions as $question)
283  {
284  if( !$question['isAnswered'] )
285  {
286  return false;
287  }
288  }
289 
290  return true;
291  }
292 
293  throw new ilTestEvaluationException(
294  'Neither the boolean property ilTestEvaluationPassData::obligationsAnswered was set, '.
295  'nor the property array property ilTestEvaluationPassData::answeredQuestions contains elements!'
296  );
297  }

◆ getAnsweredQuestion()

& ilTestEvaluationPassData::getAnsweredQuestion (   $index)

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

185  {
186  if (array_key_exists($index, $this->answeredQuestions))
187  {
188  return $this->answeredQuestions[$index];
189  }
190  else
191  {
192  return NULL;
193  }
194  }

◆ getAnsweredQuestionByQuestionId()

& ilTestEvaluationPassData::getAnsweredQuestionByQuestionId (   $question_id)

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

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

◆ getAnsweredQuestionCount()

ilTestEvaluationPassData::getAnsweredQuestionCount ( )

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

209  {
210  return count($this->answeredQuestions);
211  }

◆ getAnsweredQuestions()

ilTestEvaluationPassData::getAnsweredQuestions ( )

◆ getDeductedHintPoints()

ilTestEvaluationPassData::getDeductedHintPoints ( )

Getter for $deductedHintPoints.

Returns
integer $deductedHintPoints

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

References $deductedHintPoints.

◆ getMaxPoints()

ilTestEvaluationPassData::getMaxPoints ( )

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

References $maxpoints.

◆ getNrOfAnsweredQuestions()

ilTestEvaluationPassData::getNrOfAnsweredQuestions ( )

◆ getPass()

ilTestEvaluationPassData::getPass ( )

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

References $pass.

◆ getQuestionCount()

ilTestEvaluationPassData::getQuestionCount ( )

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

References $questioncount.

◆ getReachedPoints()

ilTestEvaluationPassData::getReachedPoints ( )

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

References $reachedpoints.

◆ getRequestedHintsCount()

ilTestEvaluationPassData::getRequestedHintsCount ( )

Getter for $requestedHintsCount.

Returns
integer $requestedHintsCount

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

References $requestedHintsCount.

◆ getWorkingTime()

ilTestEvaluationPassData::getWorkingTime ( )

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

References $workingtime.

◆ setDeductedHintPoints()

ilTestEvaluationPassData::setDeductedHintPoints (   $deductedHintPoints)

Setter for $deductedHintPoints.

Parameters
integer$deductedHintPoints

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

References $deductedHintPoints.

249  {
250  $this->deductedHintPoints = $deductedHintPoints;
251  }

◆ setMaxPoints()

ilTestEvaluationPassData::setMaxPoints (   $maxpoints)

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

References $maxpoints.

133  {
134  $this->maxpoints = $maxpoints;
135  }

◆ setNrOfAnsweredQuestions()

ilTestEvaluationPassData::setNrOfAnsweredQuestions (   $nrOfAnsweredQuestions)

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

References $nrOfAnsweredQuestions.

113  {
114  $this->nrOfAnsweredQuestions = $nrOfAnsweredQuestions;
115  }

◆ setObligationsAnswered()

ilTestEvaluationPassData::setObligationsAnswered (   $obligationsAnswered)

setter for property obligationsAnswered

Parameters
boolean$obligationsAnswered

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

References $obligationsAnswered.

259  {
260  $this->obligationsAnswered = (bool)$obligationsAnswered;
261  }

◆ setPass()

ilTestEvaluationPassData::setPass (   $a_pass)

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

163  {
164  $this->pass = $a_pass;
165  }

◆ setQuestionCount()

ilTestEvaluationPassData::setQuestionCount (   $questioncount)

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

References $questioncount.

143  {
144  $this->questioncount = $questioncount;
145  }

◆ setReachedPoints()

ilTestEvaluationPassData::setReachedPoints (   $reachedpoints)

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

References $reachedpoints.

123  {
124  $this->reachedpoints = $reachedpoints;
125  }

◆ setRequestedHintsCount()

ilTestEvaluationPassData::setRequestedHintsCount (   $requestedHintsCount)

Setter for $requestedHintsCount.

Parameters
integer$requestedHintsCount

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

References $requestedHintsCount.

229  {
230  $this->requestedHintsCount = $requestedHintsCount;
231  }

◆ setWorkingTime()

ilTestEvaluationPassData::setWorkingTime (   $workingtime)

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

References $workingtime.

153  {
154  $this->workingtime = $workingtime;
155  }

Field Documentation

◆ $answeredQuestions

ilTestEvaluationPassData::$answeredQuestions

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

Referenced by getAnsweredQuestions().

◆ $deductedHintPoints

ilTestEvaluationPassData::$deductedHintPoints = null
private

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