ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestSequenceDynamicQuestionSet Class Reference
+ Collaboration diagram for ilTestSequenceDynamicQuestionSet:

Public Member Functions

 __construct (ilDB $db, ilTestDynamicQuestionSet $questionSet, $activeId)
 Constructor. More...
 
 getActiveId ()
 
 loadFromDb ()
 
 saveToDb ()
 
 loadQuestions (ilObjTestDynamicQuestionSetConfig $dynamicQuestionSetConfig, ilTestDynamicQuestionSetFilterSelection $filterSelection)
 
 cleanupQuestions (ilTestSessionDynamicQuestionSet $testSession)
 
 getUpcomingQuestionId ()
 
 isAnsweredQuestion ($questionId)
 
 isPostponedQuestion ($questionId)
 
 isFilteredQuestion ($questionId)
 
 trackedQuestionExists ()
 
 getTrackedQuestionList ($currentQuestionId=null)
 
 resetTrackedQuestionList ()
 
 openQuestionExists ()
 
 getOpenQuestions ()
 
 getTrackedQuestionCount ()
 
 getCurrentPositionIndex ($questionId)
 
 getLastPositionIndex ()
 
 setQuestionPostponed ($questionId)
 
 unsetQuestionPostponed ($questionId)
 
 setQuestionAnsweredCorrect ($questionId)
 
 setQuestionAnsweredWrong ($questionId)
 
 hasStarted ()
 
 getCompleteQuestionsData ()
 
 getFilteredQuestionsData ()
 
 getUserSequenceQuestions ()
 

Private Member Functions

 loadQuestionTracking ()
 
 loadAnswerStatus ()
 
 loadPostponedQuestions ()
 
 saveNewlyTrackedQuestion ()
 
 getNewOrderIndexForQuestionTracking ()
 
 saveNewlyAnsweredQuestionsAnswerStatus ()
 
 saveNewlyPostponedQuestion ()
 
 removeQuestionsNotPostponedAnymore ()
 
 fetchUpcomingQuestionId ($excludePostponedQuestions, $forceNonAnsweredQuestion)
 
 trackQuestion ($questionId, $answerStatus)
 
 fetchMostLeastPostponedQuestion ($postponedQuestions)
 

Private Attributes

 $db = null
 
 $questionSet = null
 
 $activeId = null
 
 $questionTracking = array()
 
 $newlyTrackedQuestion
 
 $newlyTrackedQuestionsStatus
 
 $postponedQuestions = array()
 
 $newlyPostponedQuestion
 
 $newlyPostponedQuestionsCount
 
 $correctAnsweredQuestions = array()
 
 $wrongAnsweredQuestions = array()
 
 $newlyAnsweredQuestion
 
 $newlyAnsweredQuestionsAnswerStatus
 

Detailed Description

Definition at line 14 of file class.ilTestSequenceDynamicQuestionSet.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestSequenceDynamicQuestionSet::__construct ( ilDB  $db,
ilTestDynamicQuestionSet  $questionSet,
  $activeId 
)

Constructor.

Parameters
ilTestDynamicQuestionSet$questionSet

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

References $activeId, $db, and $questionSet.

87  {
88  $this->db = $db;
89  $this->questionSet = $questionSet;
90  $this->activeId = $activeId;
91 
92  $this->newlyTrackedQuestion = null;
93  $this->newlyTrackedQuestionsStatus = null;
94 
95  $this->newlyPostponedQuestion = null;
96  $this->newlyPostponedQuestionsCount = null;
97 
98  $this->newlyAnsweredQuestion = null;
99  $this->newlyAnsweredQuestionsAnswerStatus = null;
100  }

Member Function Documentation

◆ cleanupQuestions()

ilTestSequenceDynamicQuestionSet::cleanupQuestions ( ilTestSessionDynamicQuestionSet  $testSession)

Definition at line 311 of file class.ilTestSequenceDynamicQuestionSet.php.

References ilTestSessionDynamicQuestionSet\getCurrentQuestionId(), isFilteredQuestion(), and ilTestSessionDynamicQuestionSet\setCurrentQuestionId().

312  {
313  switch( true )
314  {
315  case !$this->questionSet->questionExists($testSession->getCurrentQuestionId()):
316  case !$this->isFilteredQuestion($testSession->getCurrentQuestionId()):
317 
318  $testSession->setCurrentQuestionId(null);
319  }
320 
321  foreach($this->postponedQuestions as $questionId)
322  {
323  if( !$this->questionSet->questionExists($questionId) )
324  {
325  unset($this->postponedQuestions[$questionId]);
326  }
327  }
328 
329  foreach($this->wrongAnsweredQuestions as $questionId)
330  {
331  if( !$this->questionSet->questionExists($questionId) )
332  {
333  unset($this->wrongAnsweredQuestions[$questionId]);
334  }
335  }
336 
337  foreach($this->correctAnsweredQuestions as $questionId)
338  {
339  if( !$this->questionSet->questionExists($questionId) )
340  {
341  unset($this->correctAnsweredQuestions[$questionId]);
342  }
343  }
344  }
+ Here is the call graph for this function:

◆ fetchMostLeastPostponedQuestion()

ilTestSequenceDynamicQuestionSet::fetchMostLeastPostponedQuestion (   $postponedQuestions)
private
Parameters
$postponedQuestions
Returns
int|null|string

Definition at line 613 of file class.ilTestSequenceDynamicQuestionSet.php.

References $postponedQuestions.

Referenced by fetchUpcomingQuestionId().

614  {
615  $minPostponeCount = null;
616  $minPostponeItem = null;
617 
618  foreach(array_reverse($postponedQuestions, true) as $qId => $postponeCount)
619  {
620  if($minPostponeCount === null || $postponeCount <= $minPostponeCount)
621  {
622  $minPostponeCount = $postponeCount;
623  $minPostponeItem = $qId;
624  }
625  }
626  return $minPostponeItem;
627  }
+ Here is the caller graph for this function:

◆ fetchUpcomingQuestionId()

ilTestSequenceDynamicQuestionSet::fetchUpcomingQuestionId (   $excludePostponedQuestions,
  $forceNonAnsweredQuestion 
)
private

Definition at line 365 of file class.ilTestSequenceDynamicQuestionSet.php.

References $postponedQuestions, and fetchMostLeastPostponedQuestion().

Referenced by getUpcomingQuestionId().

366  {
367  foreach($this->questionSet->getActualQuestionSequence() as $level => $questions)
368  {
369  $postponedQuestions = array();
370 
371  foreach($questions as $pos => $qId)
372  {
373  if( isset($this->correctAnsweredQuestions[$qId]) )
374  {
375  continue;
376  }
377 
378  if( $forceNonAnsweredQuestion && isset($this->wrongAnsweredQuestions[$qId]) )
379  {
380  continue;
381  }
382 
383  if( isset($this->postponedQuestions[$qId]) )
384  {
385  $postponedQuestions[$qId] = $this->postponedQuestions[$qId];
386  continue;
387  }
388 
389  return $qId;
390  }
391 
392  if( !$excludePostponedQuestions && count($postponedQuestions) )
393  {
395  }
396  }
397 
398  return null;
399  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActiveId()

◆ getCompleteQuestionsData()

ilTestSequenceDynamicQuestionSet::getCompleteQuestionsData ( )

Definition at line 583 of file class.ilTestSequenceDynamicQuestionSet.php.

584  {
585  return $this->questionSet->getCompleteQuestionList()->getQuestionDataArray();
586  }

◆ getCurrentPositionIndex()

ilTestSequenceDynamicQuestionSet::getCurrentPositionIndex (   $questionId)

Definition at line 483 of file class.ilTestSequenceDynamicQuestionSet.php.

484  {
485  $i = 0;
486 
487  foreach($this->questionSet->getActualQuestionSequence() as $level => $questions)
488  {
489  foreach($questions as $pos => $qId)
490  {
491  $i++;
492 
493  if($qId == $questionId)
494  {
495  return $i;
496  }
497  }
498  }
499 
500  return null;
501  }

◆ getFilteredQuestionsData()

ilTestSequenceDynamicQuestionSet::getFilteredQuestionsData ( )

Definition at line 588 of file class.ilTestSequenceDynamicQuestionSet.php.

589  {
590  return $this->questionSet->getFilteredQuestionList()->getQuestionDataArray();
591  }

◆ getLastPositionIndex()

ilTestSequenceDynamicQuestionSet::getLastPositionIndex ( )

Definition at line 503 of file class.ilTestSequenceDynamicQuestionSet.php.

504  {
505  $count = 0;
506 
507  foreach($this->questionSet->getActualQuestionSequence() as $level => $questions)
508  {
509  $count += count($questions);
510  }
511 
512  return $count;
513  }

◆ getNewOrderIndexForQuestionTracking()

ilTestSequenceDynamicQuestionSet::getNewOrderIndexForQuestionTracking ( )
private

Definition at line 225 of file class.ilTestSequenceDynamicQuestionSet.php.

References $query, $res, $row, and getActiveId().

Referenced by saveNewlyTrackedQuestion().

226  {
227  $query = "
228  SELECT (MAX(orderindex) + 1) new_order_index
229  FROM tst_seq_qst_tracking
230  WHERE active_fi = %s
231  AND pass = %s
232  ";
233 
234  $res = $this->db->queryF($query, array('integer','integer'), array($this->getActiveId(), 0));
235 
236  $row = $this->db->fetchAssoc($res);
237 
238  if( $row['new_order_index'] )
239  {
240  return $row['new_order_index'];
241  }
242 
243  return 1;
244  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOpenQuestions()

ilTestSequenceDynamicQuestionSet::getOpenQuestions ( )

Definition at line 462 of file class.ilTestSequenceDynamicQuestionSet.php.

Referenced by openQuestionExists().

463  {
464  $completeQuestionIds = array_keys( $this->questionSet->getAllQuestionsData() );
465 
466  $openQuestions = array_diff($completeQuestionIds, $this->correctAnsweredQuestions);
467 
468  return $openQuestions;
469  }
+ Here is the caller graph for this function:

◆ getTrackedQuestionCount()

ilTestSequenceDynamicQuestionSet::getTrackedQuestionCount ( )

Definition at line 471 of file class.ilTestSequenceDynamicQuestionSet.php.

472  {
473  $uniqueQuestions = array();
474 
475  foreach($this->questionTracking as $trackedQuestion)
476  {
477  $uniqueQuestions[$trackedQuestion['qid']] = $trackedQuestion['qid'];
478  }
479 
480  return count($uniqueQuestions);
481  }

◆ getTrackedQuestionList()

ilTestSequenceDynamicQuestionSet::getTrackedQuestionList (   $currentQuestionId = null)

Definition at line 432 of file class.ilTestSequenceDynamicQuestionSet.php.

433  {
434  $questionList = array();
435 
436  if( $currentQuestionId )
437  {
438  $questionList[$currentQuestionId] = $this->questionSet->getQuestionData($currentQuestionId);
439  }
440 
441  foreach( array_reverse($this->questionTracking) as $trackedQuestion)
442  {
443  if( !isset($questionList[ $trackedQuestion['qid'] ]) )
444  {
445  $questionList[ $trackedQuestion['qid'] ] = $this->questionSet->getQuestionData($trackedQuestion['qid']);
446  }
447  }
448 
449  return $questionList;
450  }

◆ getUpcomingQuestionId()

ilTestSequenceDynamicQuestionSet::getUpcomingQuestionId ( )

Definition at line 348 of file class.ilTestSequenceDynamicQuestionSet.php.

References fetchUpcomingQuestionId().

349  {
350  if( $questionId = $this->fetchUpcomingQuestionId(true, true) )
351  return $questionId;
352 
353  if( $questionId = $this->fetchUpcomingQuestionId(true, false) )
354  return $questionId;
355 
356  if( $questionId = $this->fetchUpcomingQuestionId(false, true) )
357  return $questionId;
358 
359  if( $questionId = $this->fetchUpcomingQuestionId(false, false) )
360  return $questionId;
361 
362  return null;
363  }
fetchUpcomingQuestionId($excludePostponedQuestions, $forceNonAnsweredQuestion)
+ Here is the call graph for this function:

◆ getUserSequenceQuestions()

ilTestSequenceDynamicQuestionSet::getUserSequenceQuestions ( )

Definition at line 595 of file class.ilTestSequenceDynamicQuestionSet.php.

596  {
597  //return array_keys( $this->getTrackedQuestionList() );
598 
599  $questionSequence = array();
600 
601  foreach( $this->questionSet->getActualQuestionSequence() as $level => $questions )
602  {
603  $questionSequence = array_merge($questionSequence, $questions);
604  }
605 
606  return $questionSequence;
607  }

◆ hasStarted()

ilTestSequenceDynamicQuestionSet::hasStarted ( )

Definition at line 576 of file class.ilTestSequenceDynamicQuestionSet.php.

References trackedQuestionExists().

+ Here is the call graph for this function:

◆ isAnsweredQuestion()

ilTestSequenceDynamicQuestionSet::isAnsweredQuestion (   $questionId)

Definition at line 401 of file class.ilTestSequenceDynamicQuestionSet.php.

402  {
403  return (
404  isset($this->correctAnsweredQuestions[$questionId])
405  || isset($this->wrongAnsweredQuestions[$questionId])
406  );
407  }

◆ isFilteredQuestion()

ilTestSequenceDynamicQuestionSet::isFilteredQuestion (   $questionId)

Definition at line 414 of file class.ilTestSequenceDynamicQuestionSet.php.

Referenced by cleanupQuestions().

415  {
416  foreach($this->questionSet->getActualQuestionSequence() as $level => $questions)
417  {
418  if( in_array($questionId, $questions) )
419  {
420  return true;
421  }
422  }
423 
424  return false;
425  }
+ Here is the caller graph for this function:

◆ isPostponedQuestion()

ilTestSequenceDynamicQuestionSet::isPostponedQuestion (   $questionId)

Definition at line 409 of file class.ilTestSequenceDynamicQuestionSet.php.

410  {
411  return isset($this->postponedQuestions[$questionId]);
412  }

◆ loadAnswerStatus()

ilTestSequenceDynamicQuestionSet::loadAnswerStatus ( )
private

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

References $query, $res, and $row.

Referenced by loadFromDb().

138  {
139  $query = "
140  SELECT question_fi, correctness
141  FROM tst_seq_qst_answstatus
142  WHERE active_fi = %s
143  AND pass = %s
144  ";
145 
146  $res = $this->db->queryF($query, array('integer','integer'), array($this->activeId, 0));
147 
148  $this->correctAnsweredQuestions = array();
149  $this->wrongAnsweredQuestions = array();
150 
151  while( $row = $this->db->fetchAssoc($res) )
152  {
153  if( $row['correctness'] )
154  {
155  $this->correctAnsweredQuestions[ $row['question_fi'] ] = $row['question_fi'];
156  }
157  else
158  {
159  $this->wrongAnsweredQuestions[ $row['question_fi'] ] = $row['question_fi'];
160  }
161  }
162  }
+ Here is the caller graph for this function:

◆ loadFromDb()

ilTestSequenceDynamicQuestionSet::loadFromDb ( )

◆ loadPostponedQuestions()

ilTestSequenceDynamicQuestionSet::loadPostponedQuestions ( )
private

Definition at line 164 of file class.ilTestSequenceDynamicQuestionSet.php.

References $query, $res, and $row.

Referenced by loadFromDb().

165  {
166  $query = "
167  SELECT question_fi, cnt
168  FROM tst_seq_qst_postponed
169  WHERE active_fi = %s
170  AND pass = %s
171  ";
172 
173  $res = $this->db->queryF($query, array('integer','integer'), array($this->activeId, 0));
174 
175  $this->postponedQuestions = array();
176 
177  while( $row = $this->db->fetchAssoc($res) )
178  {
179  $this->postponedQuestions[ $row['question_fi'] ] = $row['cnt'];
180  }
181  }
+ Here is the caller graph for this function:

◆ loadQuestions()

ilTestSequenceDynamicQuestionSet::loadQuestions ( ilObjTestDynamicQuestionSetConfig  $dynamicQuestionSetConfig,
ilTestDynamicQuestionSetFilterSelection  $filterSelection 
)

Definition at line 298 of file class.ilTestSequenceDynamicQuestionSet.php.

299  {
300  $this->questionSet->load($dynamicQuestionSetConfig, $filterSelection);
301 
302 // echo "<table><tr>";
303 // echo "<td width='200'><pre>".print_r($this->questionSet->getActualQuestionSequence(), 1)."</pre></td>";
304 // echo "<td width='200'><pre>".print_r($this->correctAnsweredQuestions, 1)."</pre></td>";
305 // echo "<td width='200'><pre>".print_r($this->wrongAnsweredQuestions, 1)."</pre></td>";
306 // echo "</tr></table>";
307  }

◆ loadQuestionTracking()

ilTestSequenceDynamicQuestionSet::loadQuestionTracking ( )
private

Definition at line 114 of file class.ilTestSequenceDynamicQuestionSet.php.

References $query, $res, and $row.

Referenced by loadFromDb().

115  {
116  $query = "
117  SELECT question_fi, status
118  FROM tst_seq_qst_tracking
119  WHERE active_fi = %s
120  AND pass = %s
121  ORDER BY orderindex ASC
122  ";
123 
124  $res = $this->db->queryF($query, array('integer','integer'), array($this->activeId, 0));
125 
126  $this->questionTracking = array();
127 
128  while( $row = $this->db->fetchAssoc($res) )
129  {
130  $this->questionTracking[] = array(
131  'qid' => $row['question_fi'],
132  'status' => $row['status']
133  );
134  }
135  }
+ Here is the caller graph for this function:

◆ openQuestionExists()

ilTestSequenceDynamicQuestionSet::openQuestionExists ( )

Definition at line 457 of file class.ilTestSequenceDynamicQuestionSet.php.

References getOpenQuestions().

458  {
459  return count($this->getOpenQuestions()) > 0;
460  }
+ Here is the call graph for this function:

◆ removeQuestionsNotPostponedAnymore()

ilTestSequenceDynamicQuestionSet::removeQuestionsNotPostponedAnymore ( )
private

Definition at line 280 of file class.ilTestSequenceDynamicQuestionSet.php.

References $query, and getActiveId().

Referenced by saveToDb().

281  {
282  $INquestions = $this->db->in('question_fi', array_keys($this->postponedQuestions), true, 'integer');
283 
284  // BEGIN fix symptom of mantis #0014191
285  if( $INquestions == ' 1=2 ' ) $INquestions = ' 1=1 ';
286  // END fix symptom of mantis #0014191
287 
288  $query = "
289  DELETE FROM tst_seq_qst_postponed
290  WHERE active_fi = %s
291  AND pass = %s
292  AND $INquestions
293  ";
294 
295  $this->db->manipulateF($query, array('integer','integer'), array($this->getActiveId(), 0));
296  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetTrackedQuestionList()

ilTestSequenceDynamicQuestionSet::resetTrackedQuestionList ( )

Definition at line 452 of file class.ilTestSequenceDynamicQuestionSet.php.

453  {
454  $this->questionTracking = array();
455  }

◆ saveNewlyAnsweredQuestionsAnswerStatus()

ilTestSequenceDynamicQuestionSet::saveNewlyAnsweredQuestionsAnswerStatus ( )
private

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

References getActiveId().

Referenced by saveToDb().

247  {
248  if( (int)$this->newlyAnsweredQuestion )
249  {
250  $this->db->replace('tst_seq_qst_answstatus',
251  array(
252  'active_fi' => array('integer', (int)$this->getActiveId()),
253  'pass' => array('integer', 0),
254  'question_fi' => array('integer', (int)$this->newlyAnsweredQuestion)
255  ),
256  array(
257  'correctness' => array('integer', (int)$this->newlyAnsweredQuestionsAnswerStatus)
258  )
259  );
260  }
261  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveNewlyPostponedQuestion()

ilTestSequenceDynamicQuestionSet::saveNewlyPostponedQuestion ( )
private

Definition at line 263 of file class.ilTestSequenceDynamicQuestionSet.php.

References getActiveId().

Referenced by saveToDb().

264  {
265  if( (int)$this->newlyPostponedQuestion )
266  {
267  $this->db->replace('tst_seq_qst_postponed',
268  array(
269  'active_fi' => array('integer', (int)$this->getActiveId()),
270  'pass' => array('integer', 0),
271  'question_fi' => array('integer', (int)$this->newlyPostponedQuestion)
272  ),
273  array(
274  'cnt' => array('integer', (int)$this->newlyPostponedQuestionsCount)
275  )
276  );
277  }
278  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveNewlyTrackedQuestion()

ilTestSequenceDynamicQuestionSet::saveNewlyTrackedQuestion ( )
private

Definition at line 205 of file class.ilTestSequenceDynamicQuestionSet.php.

References getActiveId(), and getNewOrderIndexForQuestionTracking().

Referenced by saveToDb().

206  {
207  if( (int)$this->newlyTrackedQuestion )
208  {
209  $newOrderIndex = $this->getNewOrderIndexForQuestionTracking();
210 
211  $this->db->replace('tst_seq_qst_tracking',
212  array(
213  'active_fi' => array('integer', (int)$this->getActiveId()),
214  'pass' => array('integer', 0),
215  'question_fi' => array('integer', (int)$this->newlyTrackedQuestion)
216  ),
217  array(
218  'status' => array('text', $this->newlyTrackedQuestionsStatus),
219  'orderindex' => array('integer', $newOrderIndex)
220  )
221  );
222  }
223  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveToDb()

ilTestSequenceDynamicQuestionSet::saveToDb ( )

Definition at line 183 of file class.ilTestSequenceDynamicQuestionSet.php.

References getActiveId(), removeQuestionsNotPostponedAnymore(), saveNewlyAnsweredQuestionsAnswerStatus(), saveNewlyPostponedQuestion(), and saveNewlyTrackedQuestion().

184  {
185  $this->db->manipulateF(
186  "DELETE FROM tst_sequence WHERE active_fi = %s AND pass = %s",
187  array('integer','integer'), array($this->getActiveId(), 0)
188  );
189 
190  $this->db->insert('tst_sequence', array(
191  'active_fi' => array('integer', $this->getActiveId()),
192  'pass' => array('integer', 0),
193  'sequence' => array('clob', null),
194  'postponed' => array('text', null),
195  'hidden' => array('text', null),
196  'tstamp' => array('integer', time())
197  ));
198 
199  $this->saveNewlyTrackedQuestion();
203  }
+ Here is the call graph for this function:

◆ setQuestionAnsweredCorrect()

ilTestSequenceDynamicQuestionSet::setQuestionAnsweredCorrect (   $questionId)

Definition at line 538 of file class.ilTestSequenceDynamicQuestionSet.php.

References trackQuestion().

539  {
540  $this->trackQuestion($questionId, 'correct');
541 
542  $this->correctAnsweredQuestions[$questionId] = $questionId;
543 
544  if( isset($this->wrongAnsweredQuestions[$questionId]) )
545  unset($this->wrongAnsweredQuestions[$questionId]);
546 
547  $this->newlyAnsweredQuestion = $questionId;
548  $this->newlyAnsweredQuestionsAnswerStatus = true;
549  }
+ Here is the call graph for this function:

◆ setQuestionAnsweredWrong()

ilTestSequenceDynamicQuestionSet::setQuestionAnsweredWrong (   $questionId)

Definition at line 551 of file class.ilTestSequenceDynamicQuestionSet.php.

References trackQuestion().

552  {
553  $this->trackQuestion($questionId, 'wrong');
554 
555  $this->wrongAnsweredQuestions[$questionId] = $questionId;
556 
557  if( isset($this->correctAnsweredQuestions[$questionId]) )
558  unset($this->correctAnsweredQuestions[$questionId]);
559 
560  $this->newlyAnsweredQuestion = $questionId;
561  $this->newlyAnsweredQuestionsAnswerStatus = false;
562  }
+ Here is the call graph for this function:

◆ setQuestionPostponed()

ilTestSequenceDynamicQuestionSet::setQuestionPostponed (   $questionId)

Definition at line 517 of file class.ilTestSequenceDynamicQuestionSet.php.

References trackQuestion().

518  {
519  $this->trackQuestion($questionId, 'postponed');
520 
521  if( !isset($this->postponedQuestions[$questionId]) )
522  {
523  $this->postponedQuestions[$questionId] = 0;
524  }
525 
526  $this->postponedQuestions[$questionId]++;
527 
528  $this->newlyPostponedQuestion = $questionId;
529  $this->newlyPostponedQuestionsCount = $this->postponedQuestions[$questionId];
530  }
+ Here is the call graph for this function:

◆ trackedQuestionExists()

ilTestSequenceDynamicQuestionSet::trackedQuestionExists ( )

Definition at line 427 of file class.ilTestSequenceDynamicQuestionSet.php.

Referenced by hasStarted().

428  {
429  return (bool)count($this->questionTracking);
430  }
+ Here is the caller graph for this function:

◆ trackQuestion()

ilTestSequenceDynamicQuestionSet::trackQuestion (   $questionId,
  $answerStatus 
)
private

Definition at line 564 of file class.ilTestSequenceDynamicQuestionSet.php.

Referenced by setQuestionAnsweredCorrect(), setQuestionAnsweredWrong(), and setQuestionPostponed().

565  {
566  $this->questionTracking[] = array(
567  'qid' => $questionId, 'status' => $answerStatus
568  );
569 
570  $this->newlyTrackedQuestion = $questionId;
571  $this->newlyTrackedQuestionsStatus = $answerStatus;
572  }
+ Here is the caller graph for this function:

◆ unsetQuestionPostponed()

ilTestSequenceDynamicQuestionSet::unsetQuestionPostponed (   $questionId)

Definition at line 532 of file class.ilTestSequenceDynamicQuestionSet.php.

533  {
534  if( isset($this->postponedQuestions[$questionId]) )
535  unset($this->postponedQuestions[$questionId]);
536  }

Field Documentation

◆ $activeId

ilTestSequenceDynamicQuestionSet::$activeId = null
private

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

Referenced by __construct(), and getActiveId().

◆ $correctAnsweredQuestions

ilTestSequenceDynamicQuestionSet::$correctAnsweredQuestions = array()
private

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

◆ $db

ilTestSequenceDynamicQuestionSet::$db = null
private

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

Referenced by __construct().

◆ $newlyAnsweredQuestion

ilTestSequenceDynamicQuestionSet::$newlyAnsweredQuestion
private

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

◆ $newlyAnsweredQuestionsAnswerStatus

ilTestSequenceDynamicQuestionSet::$newlyAnsweredQuestionsAnswerStatus
private

Definition at line 79 of file class.ilTestSequenceDynamicQuestionSet.php.

◆ $newlyPostponedQuestion

ilTestSequenceDynamicQuestionSet::$newlyPostponedQuestion
private

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

◆ $newlyPostponedQuestionsCount

ilTestSequenceDynamicQuestionSet::$newlyPostponedQuestionsCount
private

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

◆ $newlyTrackedQuestion

ilTestSequenceDynamicQuestionSet::$newlyTrackedQuestion
private

Definition at line 39 of file class.ilTestSequenceDynamicQuestionSet.php.

◆ $newlyTrackedQuestionsStatus

ilTestSequenceDynamicQuestionSet::$newlyTrackedQuestionsStatus
private

Definition at line 44 of file class.ilTestSequenceDynamicQuestionSet.php.

◆ $postponedQuestions

ilTestSequenceDynamicQuestionSet::$postponedQuestions = array()
private

◆ $questionSet

ilTestSequenceDynamicQuestionSet::$questionSet = null
private

Definition at line 24 of file class.ilTestSequenceDynamicQuestionSet.php.

Referenced by __construct().

◆ $questionTracking

ilTestSequenceDynamicQuestionSet::$questionTracking = array()
private

Definition at line 34 of file class.ilTestSequenceDynamicQuestionSet.php.

◆ $wrongAnsweredQuestions

ilTestSequenceDynamicQuestionSet::$wrongAnsweredQuestions = array()
private

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


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