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

Public Member Functions

 isQuestionSetConfigured ()
 returns the fact wether a useable question set config exists or not
 doesQuestionSetRelatedDataExist ()
 returns the fact wether a useable question set config exists or not
 removeQuestionSetRelatedData ()
 removes all question set config related data
 resetQuestionSetRelatedTestSettings ()
 resets all test settings that depends on a non changed question set config
 cloneQuestionSetRelatedData ($cloneTestOBJ)
 removes all question set config related data for cloned/copied test
 loadFromDb ()
 loads the question set config for current test from the database
 saveToDb ()
 saves the question set config for current test to the database
 cloneToDbForTestId ($testId)
 saves the question set config for test with given id to the database
 deleteFromDb ()
 deletes the question set config for current test from the database
 isResultTaxonomyFilterSupported ()
- Public Member Functions inherited from ilTestQuestionSetConfig
 __construct (ilTree $tree, ilDB $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
 areDepenciesInVulnerableState ()
 getDepenciesInVulnerableStateMessage (ilLanguage $lng)
 areDepenciesBroken ()
 getDepenciesBrokenMessage (ilLanguage $lng)
 isValidRequestOnBrokenQuestionSetDepencies ($nextClass, $cmd)
 getHiddenTabsOnBrokenDepencies ()
 getQuestionPoolPathString ($poolId)

Additional Inherited Members

- Protected Attributes inherited from ilTestQuestionSetConfig
 $tree = null
 $db = null
 $pluginAdmin = null
 $testOBJ = null

Detailed Description

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

Member Function Documentation

ilTestFixedQuestionSetConfig::cloneQuestionSetRelatedData (   $cloneTestOBJ)

removes all question set config related data for cloned/copied test

Parameters
ilObjTest$cloneTestOBJ

Reimplemented from ilTestQuestionSetConfig.

Definition at line 78 of file class.ilTestFixedQuestionSetConfig.php.

References $ilLog, ilCopyWizardOptions\_getInstance(), assQuestion\_getOriginalId(), and assQuestion\_instanciateQuestion().

{
global $ilLog;
require_once 'Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
$cwo = ilCopyWizardOptions::_getInstance($cloneTestOBJ->getId());
foreach( $this->testOBJ->questions as $key => $question_id )
{
$question = assQuestion::_instanciateQuestion($question_id);
$cloneTestOBJ->questions[$key] = $question->duplicate(true, null, null, null, $cloneTestOBJ->getId());
$original_id = assQuestion::_getOriginalId($question_id);
$question = assQuestion::_instanciateQuestion($cloneTestOBJ->questions[$key]);
$question->saveToDb($original_id);
// Save the mapping of old question id <-> new question id
// This will be used in class.ilObjCourse::cloneDependencies to copy learning objectives
$originalKey = $this->testOBJ->getRefId().'_'.$question_id;
$mappedKey = $cloneTestOBJ->getRefId().'_'.$cloneTestOBJ->questions[$key];
$cwo->appendMapping($originalKey, $mappedKey);
$ilLog->write(__METHOD__.": Added mapping $originalKey <-> $mappedKey");
}
}

+ Here is the call graph for this function:

ilTestFixedQuestionSetConfig::cloneToDbForTestId (   $testId)

saves the question set config for test with given id to the database

Parameters
$testId

Reimplemented from ilTestQuestionSetConfig.

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

{
// TODO: Implement saveToDbByTestId() method.
}
ilTestFixedQuestionSetConfig::deleteFromDb ( )

deletes the question set config for current test from the database

Reimplemented from ilTestQuestionSetConfig.

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

{
// TODO: Implement deleteFromDb() method.
}
ilTestFixedQuestionSetConfig::doesQuestionSetRelatedDataExist ( )

returns the fact wether a useable question set config exists or not

Returns
boolean

Reimplemented from ilTestQuestionSetConfig.

Definition at line 36 of file class.ilTestFixedQuestionSetConfig.php.

References isQuestionSetConfigured().

{
return $this->isQuestionSetConfigured();
}

+ Here is the call graph for this function:

ilTestFixedQuestionSetConfig::isQuestionSetConfigured ( )

returns the fact wether a useable question set config exists or not

Returns
boolean

Reimplemented from ilTestQuestionSetConfig.

Definition at line 21 of file class.ilTestFixedQuestionSetConfig.php.

Referenced by doesQuestionSetRelatedDataExist().

{
if( count($this->testOBJ->questions) )
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

ilTestFixedQuestionSetConfig::isResultTaxonomyFilterSupported ( )

Reimplemented from ilTestQuestionSetConfig.

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

{
return false;
}
ilTestFixedQuestionSetConfig::loadFromDb ( )

loads the question set config for current test from the database

Reimplemented from ilTestQuestionSetConfig.

Definition at line 109 of file class.ilTestFixedQuestionSetConfig.php.

{
// TODO: Implement loadFromDb() method.
}
ilTestFixedQuestionSetConfig::removeQuestionSetRelatedData ( )

removes all question set config related data

Reimplemented from ilTestQuestionSetConfig.

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

References $res, and $row.

{
$this->testOBJ->removeAllTestEditings();
$res = $this->db->queryF(
"SELECT question_fi FROM tst_test_question WHERE test_fi = %s",
array('integer'), array($this->testOBJ->getTestId())
);
while( $row = $this->db->fetchAssoc($res) )
{
$this->testOBJ->removeQuestion($row["question_fi"]);
}
$this->db->manipulateF(
"DELETE FROM tst_test_question WHERE test_fi = %s",
array('integer'), array($this->testOBJ->getTestId())
);
$this->testOBJ->questions = array();
$this->testOBJ->saveCompleteStatus($this);
}
ilTestFixedQuestionSetConfig::resetQuestionSetRelatedTestSettings ( )

resets all test settings that depends on a non changed question set config

Reimplemented from ilTestQuestionSetConfig.

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

{
// nothing to do
}
ilTestFixedQuestionSetConfig::saveToDb ( )

saves the question set config for current test to the database

Reimplemented from ilTestQuestionSetConfig.

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

{
// TODO: Implement saveToDb() method.
}

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