ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules 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 More...
 
 doesQuestionSetRelatedDataExist ()
 returns the fact wether a useable question set config exists or not More...
 
 removeQuestionSetRelatedData ()
 removes all question set config related data More...
 
 resetQuestionSetRelatedTestSettings ()
 
 cloneQuestionSetRelatedData ($cloneTestOBJ)
 removes all question set config related data for cloned/copied test More...
 
 loadFromDb ()
 loads the question set config for current test from the database More...
 
 saveToDb ()
 saves the question set config for current test to the database More...
 
 cloneToDbForTestId ($testId)
 saves the question set config for test with given id to the database More...
 
 deleteFromDb ()
 deletes the question set config for current test from the database More...
 
 isResultTaxonomyFilterSupported ()
 
- Public Member Functions inherited from ilTestQuestionSetConfig
 __construct (ilTree $tree, ilDB $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
 
 loadFromDb ()
 loads the question set config for current test from the database More...
 
 saveToDb ()
 saves the question set config for current test to the database More...
 
 cloneToDbForTestId ($testId)
 saves the question set config for test with given id to the database More...
 
 deleteFromDb ()
 deletes the question set config for current test from the database More...
 
 areDepenciesInVulnerableState ()
 
 getDepenciesInVulnerableStateMessage (ilLanguage $lng)
 
 areDepenciesBroken ()
 
 getDepenciesBrokenMessage (ilLanguage $lng)
 
 isValidRequestOnBrokenQuestionSetDepencies ($nextClass, $cmd)
 
 getHiddenTabsOnBrokenDepencies ()
 
 isQuestionSetConfigured ()
 
 doesQuestionSetRelatedDataExist ()
 checks wether question set config related data exists or not More...
 
 removeQuestionSetRelatedData ()
 removes all question set config related data More...
 
 resetQuestionSetRelatedTestSettings ()
 resets all test settings that depends on a non changed question set config More...
 
 cloneQuestionSetRelatedData ($cloneTestOBJ)
 removes all question set config related data for cloned/copied test More...
 
 getQuestionPoolPathString ($poolId)
 
 isResultTaxonomyFilterSupported ()
 

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

◆ cloneQuestionSetRelatedData()

ilTestFixedQuestionSetConfig::cloneQuestionSetRelatedData (   $cloneTestOBJ)

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

Parameters
ilObjTest$cloneTestOBJ

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

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

79  {
80  global $ilLog;
81 
82  require_once 'Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
83  require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
84 
85  $cwo = ilCopyWizardOptions::_getInstance($cloneTestOBJ->getId());
86 
87  foreach( $this->testOBJ->questions as $key => $question_id )
88  {
89  $question = assQuestion::_instanciateQuestion($question_id);
90  $cloneTestOBJ->questions[$key] = $question->duplicate(true, null, null, null, $cloneTestOBJ->getId());
91 
92  $original_id = assQuestion::_getOriginalId($question_id);
93 
94  $question = assQuestion::_instanciateQuestion($cloneTestOBJ->questions[$key]);
95  $question->saveToDb($original_id);
96 
97  // Save the mapping of old question id <-> new question id
98  // This will be used in class.ilObjCourse::cloneDependencies to copy learning objectives
99  $originalKey = $this->testOBJ->getRefId().'_'.$question_id;
100  $mappedKey = $cloneTestOBJ->getRefId().'_'.$cloneTestOBJ->questions[$key];
101  $cwo->appendMapping($originalKey, $mappedKey);
102  $ilLog->write(__METHOD__.": Added mapping $originalKey <-> $mappedKey");
103  }
104  }
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
static _getOriginalId($question_id)
Returns the original id of a question.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
+ Here is the call graph for this function:

◆ cloneToDbForTestId()

ilTestFixedQuestionSetConfig::cloneToDbForTestId (   $testId)

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

Parameters
$testId

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

128  {
129  // TODO: Implement saveToDbByTestId() method.
130  }

◆ deleteFromDb()

ilTestFixedQuestionSetConfig::deleteFromDb ( )

deletes the question set config for current test from the database

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

136  {
137  // TODO: Implement deleteFromDb() method.
138  }

◆ doesQuestionSetRelatedDataExist()

ilTestFixedQuestionSetConfig::doesQuestionSetRelatedDataExist ( )

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

Returns
boolean

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

References isQuestionSetConfigured().

37  {
38  return $this->isQuestionSetConfigured();
39  }
isQuestionSetConfigured()
returns the fact wether a useable question set config exists or not
+ Here is the call graph for this function:

◆ isQuestionSetConfigured()

ilTestFixedQuestionSetConfig::isQuestionSetConfigured ( )

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

Returns
boolean

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

Referenced by doesQuestionSetRelatedDataExist().

22  {
23  if( count($this->testOBJ->questions) )
24  {
25  return true;
26  }
27 
28  return false;
29  }
+ Here is the caller graph for this function:

◆ isResultTaxonomyFilterSupported()

ilTestFixedQuestionSetConfig::isResultTaxonomyFilterSupported ( )

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

141  {
142  return false;
143  }

◆ loadFromDb()

ilTestFixedQuestionSetConfig::loadFromDb ( )

loads the question set config for current test from the database

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

110  {
111  // TODO: Implement loadFromDb() method.
112  }

◆ removeQuestionSetRelatedData()

ilTestFixedQuestionSetConfig::removeQuestionSetRelatedData ( )

removes all question set config related data

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

References $res, and $row.

45  {
46  $this->testOBJ->removeAllTestEditings();
47 
48  $res = $this->db->queryF(
49  "SELECT question_fi FROM tst_test_question WHERE test_fi = %s",
50  array('integer'), array($this->testOBJ->getTestId())
51  );
52 
53  while( $row = $this->db->fetchAssoc($res) )
54  {
55  $this->testOBJ->removeQuestion($row["question_fi"]);
56  }
57 
58  $this->db->manipulateF(
59  "DELETE FROM tst_test_question WHERE test_fi = %s",
60  array('integer'), array($this->testOBJ->getTestId())
61  );
62 
63  $this->testOBJ->questions = array();
64 
65  $this->testOBJ->saveCompleteStatus($this);
66  }

◆ resetQuestionSetRelatedTestSettings()

ilTestFixedQuestionSetConfig::resetQuestionSetRelatedTestSettings ( )

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

69  {
70  // nothing to do
71  }

◆ saveToDb()

ilTestFixedQuestionSetConfig::saveToDb ( )

saves the question set config for current test to the database

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

118  {
119  // TODO: Implement saveToDb() method.
120  }

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