ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestSequenceRandomQuestionSet Class Reference
+ Inheritance diagram for ilTestSequenceRandomQuestionSet:
+ Collaboration diagram for ilTestSequenceRandomQuestionSet:

Public Member Functions

 loadQuestions ()
 hasRandomQuestionsForPass ($active_id, $pass)
 !!! LEGACY CODE !!!
 getResponsibleSourcePoolDefinitionId ($questionId)
- Public Member Functions inherited from ilTestSequence
 ilTestSequence ($active_id, $pass, $randomtest)
 ilTestSequence constructor
 getActiveId ()
 createNewSequence ($max, $shuffle)
 loadQuestions (ilTestQuestionSetConfig $testQuestionSetConfig=null, $taxonomyFilterSelection=array())
 Loads the question mapping.
 loadFromDb ()
 Loads the sequence data for a given active id.
 saveToDb ()
 Saves the sequence data for a given pass to the database.
 postponeQuestion ($question_id)
 hideQuestion ($question_id)
 isPostponedQuestion ($question_id)
 isHiddenQuestion ($question_id)
 isPostponedSequence ($sequence)
 isHiddenSequence ($sequence)
 postponeSequence ($sequence)
 hideSequence ($sequence)
 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.
 getQuestionForSequence ($sequence)
getSequenceSummary ($obligationsFilter=false)
 getPass ()
 setPass ($pass)
 hasSequence ()
 hasHiddenQuestions ()
 clearHiddenQuestions ()
 hasStarted (ilTestSession $testSession)
 openQuestionExists ()
 getQuestionIds ()
 questionExists ($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
 getCorrectedSequence ($with_hidden_questions=FALSE)

Detailed Description

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

Member Function Documentation

ilTestSequenceRandomQuestionSet::getResponsibleSourcePoolDefinitionId (   $questionId)

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

Referenced by ilLOTestQuestionAdapter\updateRandomQuestions().

{
if( isset($this->responsibleSourcePoolDefinitionByQuestion[$questionId]) )
{
return $this->responsibleSourcePoolDefinitionByQuestion[$questionId];
}
return null;
}

+ Here is the caller graph for this function:

ilTestSequenceRandomQuestionSet::hasRandomQuestionsForPass (   $active_id,
  $pass 
)

!!! LEGACY CODE !!!

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

private

Parameters
$active_idActive id of the test
$passPass of the test
Returns
boolean TRUE if the test already contains questions, FALSE otherwise

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

References ilTestSequence\$active_id, $ilDB, ilTestSequence\$pass, and $result.

{
global $ilDB;
$result = $ilDB->queryF("SELECT test_random_question_id FROM tst_test_rnd_qst WHERE active_fi = %s AND pass = %s",
array('integer','integer'),
array($active_id, $pass)
);
return ($result->numRows() > 0) ? true : false;
}
ilTestSequenceRandomQuestionSet::loadQuestions ( )

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

References $ilDB, and $result.

{
global $ilDB;
$this->questions = array();
$result = $ilDB->queryF("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",
array('integer','integer'),
array($this->active_id, $this->pass)
);
// The following is a fix for random tests prior to ILIAS 3.8. If someone started a random test in ILIAS < 3.8, there
// is only one test pass (pass = 0) in tst_test_rnd_qst while with ILIAS 3.8 there are questions for every test pass.
// To prevent problems with tests started in an older version and continued in ILIAS 3.8, the first pass should be taken if
// no questions are present for a newer pass.
if ($result->numRows() == 0)
{
$result = $ilDB->queryF("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",
array('integer'),
array($this->active_id)
);
}
$index = 1;
while ($data = $ilDB->fetchAssoc($result))
{
$this->questions[$index++] = $data["question_fi"];
$this->responsibleSourcePoolDefinitionByQuestion[$data['question_fi']] = $data['src_pool_def_fi'];
}
}

Field Documentation

ilTestSequenceRandomQuestionSet::$responsibleSourcePoolDefinitionByQuestion = array()
private

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


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