ILIAS  release_8 Revision v8.24
ilTestSequenceRandomQuestionSet Class Reference
+ Inheritance diagram for ilTestSequenceRandomQuestionSet:
+ Collaboration diagram for ilTestSequenceRandomQuestionSet:

Public Member Functions

 loadQuestions (ilTestQuestionSetConfig $testQuestionSetConfig=null, $taxonomyFilterSelection=array())
 Loads the question mapping. More...
 
 hasRandomQuestionsForPass ($active_id, $pass)
 !!! LEGACY CODE !!! More...
 
 getResponsibleSourcePoolDefinitionId ($questionId)
 
- Public Member Functions inherited from ilTestSequence
 __construct ($active_id, $pass, $randomtest)
 ilTestSequence constructor More...
 
 getActiveId ()
 
 createNewSequence ($max, $shuffle)
 
 loadQuestions (ilTestQuestionSetConfig $testQuestionSetConfig=null, $taxonomyFilterSelection=array())
 Loads the question mapping. More...
 
 loadFromDb ()
 Loads the sequence data for a given active id. More...
 
 saveToDb ()
 Saves the sequence data for a given pass to the database. More...
 
 postponeQuestion ($question_id)
 
 hideQuestion ($question_id)
 
 isPostponedQuestion ($question_id)
 
 isHiddenQuestion ($question_id)
 
 isPostponedSequence ($sequence)
 
 isHiddenSequence ($sequence)
 
 postponeSequence ($sequence)
 
 hideSequence ($sequence)
 
 setQuestionPresented ($questionId)
 
 isQuestionPresented ($questionId)
 
 isNextQuestionPresented ($questionId)
 
 setQuestionChecked ($questionId)
 
 isQuestionChecked ($questionId)
 
 getPositionOfSequence ($sequence)
 
 getUserQuestionCount ()
 
 getOrderedSequence ()
 
 getOrderedSequenceQuestions ()
 
 getUserSequence ()
 
 getUserSequenceQuestions ()
 
 getSequenceForQuestion ($question_id)
 
 getFirstSequence ()
 
 getLastSequence ()
 
 getNextSequence ($sequence)
 
 getPreviousSequence ($sequence)
 
 pcArrayShuffle ($array)
 Shuffles the values of a given array. More...
 
 getQuestionForSequence ($sequence)
 
 getSequenceSummary ($obligationsFilterEnabled=false)
 
 getPass ()
 
 setPass ($pass)
 
 hasSequence ()
 
 hasHiddenQuestions ()
 
 clearHiddenQuestions ()
 
 hasStarted (ilTestSession $testSession)
 
 openQuestionExists ()
 
 getQuestionIds ()
 
 questionExists ($questionId)
 
 setQuestionOptional ($questionId)
 
 isQuestionOptional ($questionId)
 
 hasOptionalQuestions ()
 
 getOptionalQuestions ()
 
 clearOptionalQuestions ()
 
 reorderOptionalQuestionsToSequenceEnd ()
 
 isAnsweringOptionalQuestionsConfirmed ()
 
 setAnsweringOptionalQuestionsConfirmed ($answeringOptionalQuestionsConfirmed)
 
 isConsiderHiddenQuestionsEnabled ()
 
 setConsiderHiddenQuestionsEnabled ($considerHiddenQuestionsEnabled)
 
 isConsiderOptionalQuestionsEnabled ()
 
 setConsiderOptionalQuestionsEnabled ($considerOptionalQuestionsEnabled)
 
 getQuestionIds ()
 
 getActiveId ()
 
 getSequenceSummary ($obligationsFilterEnabled=false)
 
 getResponsibleSourcePoolDefinitionId ($questionId)
 

Private Attributes

 $responsibleSourcePoolDefinitionByQuestion = array()
 

Additional Inherited Members

- Data Fields inherited from ilTestSequence
 $sequencedata
 
 $questions
 
 $active_id
 
 $pass
 
 $isRandomTest
 
- Protected Member Functions inherited from ilTestSequence
 loadPresentedQuestions ()
 
 saveNewlyPresentedQuestion ()
 
 getCorrectedSequence ()
 
- Protected Attributes inherited from ilTestSequence
 $alreadyPresentedQuestions = array()
 
 $newlyPresentedQuestion = 0
 
 $alreadyCheckedQuestions
 
 $newlyCheckedQuestion
 
 $optionalQuestions
 

Detailed Description

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

Member Function Documentation

◆ getResponsibleSourcePoolDefinitionId()

ilTestSequenceRandomQuestionSet::getResponsibleSourcePoolDefinitionId (   $questionId)

Implements ilTestRandomQuestionSequence.

Definition at line 84 of file class.ilTestSequenceRandomQuestionSet.php.

85 {
86 if (isset($this->responsibleSourcePoolDefinitionByQuestion[$questionId])) {
87 return $this->responsibleSourcePoolDefinitionByQuestion[$questionId];
88 }
89
90 return null;
91 }

Referenced by ilLOTestQuestionAdapter\updateRandomQuestions().

+ Here is the caller graph for this function:

◆ hasRandomQuestionsForPass()

ilTestSequenceRandomQuestionSet::hasRandomQuestionsForPass (   $active_id,
  $pass 
)

!!! LEGACY CODE !!!

Checkes wheather a random test has already created questions for a given pass or not

@access private

Parameters
$active_idint Active id of the test
$passint Pass of the test
Returns
boolean TRUE if the test already contains questions, FALSE otherwise

Definition at line 72 of file class.ilTestSequenceRandomQuestionSet.php.

72 : bool
73 {
74 global $DIC;
75 $ilDB = $DIC['ilDB'];
76 $result = $ilDB->queryF(
77 "SELECT test_random_question_id FROM tst_test_rnd_qst WHERE active_fi = %s AND pass = %s",
78 array('integer','integer'),
79 array($active_id, $pass)
80 );
81 return ($result->numRows() > 0) ? true : false;
82 }
return true
global $DIC
Definition: feed.php:28

References ilTestSequence\$active_id, $DIC, $ilDB, ilTestSequence\$pass, and true.

◆ loadQuestions()

ilTestSequenceRandomQuestionSet::loadQuestions ( ilTestQuestionSetConfig  $testQuestionSetConfig = null,
  $taxonomyFilterSelection = array() 
)

Loads the question mapping.

Reimplemented from ilTestSequence.

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

30 {
31 global $DIC;
32 $ilDB = $DIC['ilDB'];
33
34 $this->questions = array();
35
36 $result = $ilDB->queryF(
37 "SELECT tst_test_rnd_qst.* FROM tst_test_rnd_qst, qpl_questions WHERE tst_test_rnd_qst.active_fi = %s AND qpl_questions.question_id = tst_test_rnd_qst.question_fi AND tst_test_rnd_qst.pass = %s ORDER BY sequence",
38 array('integer','integer'),
39 array($this->active_id, $this->pass)
40 );
41 // The following is a fix for random tests prior to ILIAS 3.8. If someone started a random test in ILIAS < 3.8, there
42 // is only one test pass (pass = 0) in tst_test_rnd_qst while with ILIAS 3.8 there are questions for every test pass.
43 // To prevent problems with tests started in an older version and continued in ILIAS 3.8, the first pass should be taken if
44 // no questions are present for a newer pass.
45 if ($result->numRows() == 0) {
46 $result = $ilDB->queryF(
47 "SELECT tst_test_rnd_qst.* FROM tst_test_rnd_qst, qpl_questions WHERE tst_test_rnd_qst.active_fi = %s AND qpl_questions.question_id = tst_test_rnd_qst.question_fi AND tst_test_rnd_qst.pass = 0 ORDER BY sequence",
48 array('integer'),
49 array($this->active_id)
50 );
51 }
52
53 $index = 1;
54
55 while ($data = $ilDB->fetchAssoc($result)) {
56 $this->questions[$index++] = $data["question_fi"];
57
58 $this->responsibleSourcePoolDefinitionByQuestion[$data['question_fi']] = $data['src_pool_def_fi'];
59 }
60 }
$index
Definition: metadata.php:145

References $data, $DIC, $ilDB, and $index.

Field Documentation

◆ $responsibleSourcePoolDefinitionByQuestion

ilTestSequenceRandomQuestionSet::$responsibleSourcePoolDefinitionByQuestion = array()
private

Definition at line 27 of file class.ilTestSequenceRandomQuestionSet.php.


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