ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjTestDynamicQuestionSetConfig Class Reference
+ Inheritance diagram for ilObjTestDynamicQuestionSetConfig:
+ Collaboration diagram for ilObjTestDynamicQuestionSetConfig:

Public Member Functions

 getSourceQuestionPoolId ()
 getter for source question pool id More...
 
 setSourceQuestionPoolId ($sourceQuestionPoolId)
 getter for source question pool id More...
 
 getSourceQuestionPoolTitle ()
 getter for source question pool title More...
 
 setSourceQuestionPoolTitle ($sourceQuestionPoolTitle)
 getter for source question pool title More...
 
 isAnswerStatusFilterEnabled ()
 
 setAnswerStatusFilterEnabled ($answerStatusFilterEnabled)
 
 isTaxonomyFilterEnabled ()
 isser for taxonomie filter enabled More...
 
 setTaxonomyFilterEnabled ($taxonomyFilterEnabled)
 setter for taxonomie filter enabled More...
 
 getOrderingTaxonomyId ()
 setter for ordering taxonomy id More...
 
 setOrderingTaxonomyId ($orderingTaxonomyId)
 getter for ordering taxonomy id More...
 
 isPreviousQuestionsListEnabled ()
 
 setPreviousQuestionsListEnabled ($previousQuestionsListEnabled)
 
 initFromArray ($dataArray)
 initialises the current object instance with values from matching properties within the passed array 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...
 
 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 (in this case it's only the config itself) More...
 
 resetQuestionSetRelatedTestSettings ()
 
 cloneQuestionSetRelatedData ($cloneTestOBJ)
 removes all question set config related data for cloned/copied test More...
 
 getSourceQuestionPoolSummaryString (ilLanguage $lng)
 
 areDepenciesInVulnerableState ()
 
 getDepenciesInVulnerableStateMessage (ilLanguage $lng)
 
 areDepenciesBroken ()
 
 getDepenciesBrokenMessage (ilLanguage $lng)
 
 isValidRequestOnBrokenQuestionSetDepencies ($nextClass, $cmd)
 
 getHiddenTabsOnBrokenDepencies ()
 
 getSourceQuestionPoolRefIds ()
 
 isResultTaxonomyFilterSupported ()
 
 isAnyQuestionFilterEnabled ()
 
- 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 ()
 

Static Public Member Functions

static getPoolQuestionChangeListener (ilDB $db, $poolObjId)
 

Private Member Functions

 dbRecordExists ($testId)
 checks wether a question set config for current test exists in the database More...
 
 updateDbRecord ($testId)
 updates the record in the database that corresponds to the question set config for the current test More...
 
 insertDbRecord ($testId)
 inserts a new record for the question set config for the current test into the database More...
 
 getSourceQuestionPoolNumQuestions ()
 

Private Attributes

 $sourceQuestionPoolId = null
 
 $answerStatusFilterEnabled = null
 
 $taxonomyFilterEnabled = null
 
 $orderingTaxonomyId = null
 
 $previousQuestionsListEnabled = null
 
 $sourceQuestionPoolRefIds = null
 

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.ilObjTestDynamicQuestionSetConfig.php.

Member Function Documentation

◆ areDepenciesBroken()

ilObjTestDynamicQuestionSetConfig::areDepenciesBroken ( )

Definition at line 440 of file class.ilObjTestDynamicQuestionSetConfig.php.

References getSourceQuestionPoolId(), and getSourceQuestionPoolRefIds().

441  {
442  if( !$this->getSourceQuestionPoolId() )
443  {
444  return false;
445  }
446 
447  $poolRefs = $this->getSourceQuestionPoolRefIds();
448 
449  if( count($poolRefs) )
450  {
451  return false;
452  }
453 
454  return true;
455  }
getSourceQuestionPoolId()
getter for source question pool id
+ Here is the call graph for this function:

◆ areDepenciesInVulnerableState()

ilObjTestDynamicQuestionSetConfig::areDepenciesInVulnerableState ( )

Definition at line 411 of file class.ilObjTestDynamicQuestionSetConfig.php.

References getSourceQuestionPoolId(), and getSourceQuestionPoolRefIds().

412  {
413  if( !$this->getSourceQuestionPoolId() )
414  {
415  return false;
416  }
417 
418  $poolRefs = $this->getSourceQuestionPoolRefIds();
419 
420  foreach( $poolRefs as $refId )
421  {
422  if( !$this->tree->isDeleted($refId) )
423  {
424  return false;
425  }
426  }
427 
428  return true;
429  }
getSourceQuestionPoolId()
getter for source question pool id
+ Here is the call graph for this function:

◆ cloneQuestionSetRelatedData()

ilObjTestDynamicQuestionSetConfig::cloneQuestionSetRelatedData (   $cloneTestOBJ)

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

Parameters
ilObjTest$cloneTestOBJ

Definition at line 343 of file class.ilObjTestDynamicQuestionSetConfig.php.

References cloneToDbForTestId(), and loadFromDb().

344  {
345  $this->loadFromDb();
346  $this->cloneToDbForTestId($cloneTestOBJ->getTestId());
347  }
loadFromDb()
loads the question set config for current test from the database
cloneToDbForTestId($testId)
saves the question set config for test with given id to the database
+ Here is the call graph for this function:

◆ cloneToDbForTestId()

ilObjTestDynamicQuestionSetConfig::cloneToDbForTestId (   $testId)

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

Parameters
$testId

Definition at line 224 of file class.ilObjTestDynamicQuestionSetConfig.php.

References insertDbRecord().

Referenced by cloneQuestionSetRelatedData().

225  {
226  $this->insertDbRecord($testId);
227  }
insertDbRecord($testId)
inserts a new record for the question set config for the current test into the database ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dbRecordExists()

ilObjTestDynamicQuestionSetConfig::dbRecordExists (   $testId)
private

checks wether a question set config for current test exists in the database

Parameters
$testId
Returns
boolean

Definition at line 250 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $res, and $row.

Referenced by saveToDb().

251  {
252  $res = $this->db->queryF(
253  "SELECT COUNT(*) cnt FROM tst_dyn_quest_set_cfg WHERE test_fi = %s",
254  array('integer'), array($testId)
255  );
256 
257  $row = $this->db->fetchAssoc($res);
258 
259  return (bool)$row['cnt'];
260  }
+ Here is the caller graph for this function:

◆ deleteFromDb()

ilObjTestDynamicQuestionSetConfig::deleteFromDb ( )

deletes the question set config for current test from the database

Returns
boolean

Definition at line 234 of file class.ilObjTestDynamicQuestionSetConfig.php.

Referenced by removeQuestionSetRelatedData().

235  {
236  $aff = $this->db->manipulateF(
237  "DELETE FROM tst_dyn_quest_set_cfg WHERE test_fi = %s",
238  array('integer'), array($this->testOBJ->getTestId())
239  );
240 
241  return (bool)$aff;
242  }
+ Here is the caller graph for this function:

◆ doesQuestionSetRelatedDataExist()

ilObjTestDynamicQuestionSetConfig::doesQuestionSetRelatedDataExist ( )

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

Returns
boolean

Definition at line 319 of file class.ilObjTestDynamicQuestionSetConfig.php.

References isQuestionSetConfigured().

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

◆ getDepenciesBrokenMessage()

ilObjTestDynamicQuestionSetConfig::getDepenciesBrokenMessage ( ilLanguage  $lng)

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

References getSourceQuestionPoolTitle(), and ilLanguage\txt().

458  {
459  $msg = sprintf(
460  $lng->txt('tst_dyn_quest_set_pool_deleted'), $this->getSourceQuestionPoolTitle()
461  );
462 
463  return $msg;
464  }
getSourceQuestionPoolTitle()
getter for source question pool title
txt($a_topic, $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ getDepenciesInVulnerableStateMessage()

ilObjTestDynamicQuestionSetConfig::getDepenciesInVulnerableStateMessage ( ilLanguage  $lng)

Definition at line 431 of file class.ilObjTestDynamicQuestionSetConfig.php.

References getSourceQuestionPoolTitle(), and ilLanguage\txt().

432  {
433  $msg = sprintf(
434  $lng->txt('tst_dyn_quest_set_pool_trashed'), $this->getSourceQuestionPoolTitle()
435  );
436 
437  return $msg;
438  }
getSourceQuestionPoolTitle()
getter for source question pool title
txt($a_topic, $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ getHiddenTabsOnBrokenDepencies()

ilObjTestDynamicQuestionSetConfig::getHiddenTabsOnBrokenDepencies ( )

Definition at line 504 of file class.ilObjTestDynamicQuestionSetConfig.php.

505  {
506  return array(
507  'settings', 'manscoring', 'scoringadjust', 'statistics', 'history', 'export'
508  );
509  }

◆ getOrderingTaxonomyId()

ilObjTestDynamicQuestionSetConfig::getOrderingTaxonomyId ( )

setter for ordering taxonomy id

Returns
integer $orderingTaxonomyId

Definition at line 129 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $orderingTaxonomyId.

Referenced by ilTestDynamicQuestionSet\initActualQuestionSequence(), ilTestDynamicQuestionSet\initFilteredQuestionList(), insertDbRecord(), and updateDbRecord().

+ Here is the caller graph for this function:

◆ getPoolQuestionChangeListener()

static ilObjTestDynamicQuestionSetConfig::getPoolQuestionChangeListener ( ilDB  $db,
  $poolObjId 
)
static
Parameters
integer$poolObjId
Returns

Definition at line 527 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $query, $res, $row, ilDB\fetchAssoc(), and ilDB\queryF().

Referenced by ilObjTest\getPoolQuestionChangeListeners().

528  {
529  $query = "
530  SELECT obj_fi
531  FROM tst_dyn_quest_set_cfg
532  INNER JOIN tst_tests
533  ON tst_tests.test_id = tst_dyn_quest_set_cfg.test_fi
534  WHERE source_qpl_fi = %s
535  ";
536 
537  $res = $db->queryF($query, array('integer'), array($poolObjId));
538 
539  require_once 'Modules/Test/classes/class.ilDynamicTestQuestionChangeListener.php';
540  $questionChangeListener = new ilDynamicTestQuestionChangeListener($db);
541 
542  while( $row = $db->fetchAssoc($res) )
543  {
544  $questionChangeListener->addTestObjId( $row['obj_fi'] );
545  }
546 
547  return $questionChangeListener;
548  }
fetchAssoc($a_set)
Fetch row as associative array from result set.
queryF($a_query, $a_types, $a_values)
Formatted query (for SELECTS).
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSourceQuestionPoolId()

◆ getSourceQuestionPoolNumQuestions()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolNumQuestions ( )
private
Returns
integer

Definition at line 395 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

Referenced by getSourceQuestionPoolSummaryString().

396  {
397  $query = "
398  SELECT COUNT(*) num from qpl_questions
399  WHERE obj_fi = %s AND original_id IS NULL
400  ";
401 
402  $res = $this->db->queryF(
403  $query, array('integer'), array($this->getSourceQuestionPoolId())
404  );
405 
406  $row = $this->db->fetchAssoc($res);
407 
408  return $row['num'];
409  }
getSourceQuestionPoolId()
getter for source question pool id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSourceQuestionPoolRefIds()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolRefIds ( )

Definition at line 513 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $sourceQuestionPoolRefIds, ilObject\_getAllReferences(), and getSourceQuestionPoolId().

Referenced by areDepenciesBroken(), areDepenciesInVulnerableState(), and getSourceQuestionPoolSummaryString().

514  {
515  if( $this->sourceQuestionPoolRefIds === null )
516  {
517  $this->sourceQuestionPoolRefIds = ilObject::_getAllReferences($this->getSourceQuestionPoolId());
518  }
519 
521  }
static _getAllReferences($a_id)
get all reference ids of object
getSourceQuestionPoolId()
getter for source question pool id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSourceQuestionPoolSummaryString()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolSummaryString ( ilLanguage  $lng)
Parameters
ilLanguage$lng
ilTree$tree
Returns
string

Definition at line 354 of file class.ilObjTestDynamicQuestionSetConfig.php.

References ilTestQuestionSetConfig\getQuestionPoolPathString(), getSourceQuestionPoolId(), getSourceQuestionPoolNumQuestions(), getSourceQuestionPoolRefIds(), getSourceQuestionPoolTitle(), and ilLanguage\txt().

355  {
356  $poolRefs = $this->getSourceQuestionPoolRefIds();
357 
358  if( !count($poolRefs) )
359  {
360  $sourceQuestionPoolSummaryString = sprintf(
361  $lng->txt('tst_dyn_quest_set_src_qpl_summary_string_deleted'),
363  );
364 
365  return $sourceQuestionPoolSummaryString;
366  }
367 
368  foreach($poolRefs as $refId)
369  {
370  if( !$this->tree->isDeleted($refId) )
371  {
372  $sourceQuestionPoolSummaryString = sprintf(
373  $lng->txt('tst_dynamic_question_set_source_questionpool_summary_string'),
377  );
378 
379  return $sourceQuestionPoolSummaryString;
380  }
381  }
382 
383  $sourceQuestionPoolSummaryString = sprintf(
384  $lng->txt('tst_dyn_quest_set_src_qpl_summary_string_trashed'),
387  );
388 
389  return $sourceQuestionPoolSummaryString;
390  }
getSourceQuestionPoolTitle()
getter for source question pool title
txt($a_topic, $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getSourceQuestionPoolId()
getter for source question pool id
+ Here is the call graph for this function:

◆ getSourceQuestionPoolTitle()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolTitle ( )

getter for source question pool title

Returns
string

Definition at line 73 of file class.ilObjTestDynamicQuestionSetConfig.php.

Referenced by getDepenciesBrokenMessage(), getDepenciesInVulnerableStateMessage(), getSourceQuestionPoolSummaryString(), insertDbRecord(), and updateDbRecord().

74  {
75  return $this->sourceQuestionPoolTitle;
76  }
+ Here is the caller graph for this function:

◆ initFromArray()

ilObjTestDynamicQuestionSetConfig::initFromArray (   $dataArray)

initialises the current object instance with values from matching properties within the passed array

Parameters
array$dataArray

Definition at line 166 of file class.ilObjTestDynamicQuestionSetConfig.php.

References setAnswerStatusFilterEnabled(), setOrderingTaxonomyId(), setPreviousQuestionsListEnabled(), setSourceQuestionPoolId(), setSourceQuestionPoolTitle(), and setTaxonomyFilterEnabled().

Referenced by loadFromDb().

167  {
168  foreach($dataArray as $field => $value)
169  {
170  switch($field)
171  {
172  case 'source_qpl_fi': $this->setSourceQuestionPoolId($value); break;
173  case 'source_qpl_title': $this->setSourceQuestionPoolTitle($value); break;
174  case 'answer_filter_enabled': $this->setAnswerStatusFilterEnabled($value); break;
175  case 'tax_filter_enabled': $this->setTaxonomyFilterEnabled($value); break;
176  case 'order_tax': $this->setOrderingTaxonomyId($value); break;
177  case 'prev_quest_list_enabled': $this->setPreviousQuestionsListEnabled($value); break;
178  }
179  }
180  }
setTaxonomyFilterEnabled($taxonomyFilterEnabled)
setter for taxonomie filter enabled
setOrderingTaxonomyId($orderingTaxonomyId)
getter for ordering taxonomy id
setSourceQuestionPoolId($sourceQuestionPoolId)
getter for source question pool id
setSourceQuestionPoolTitle($sourceQuestionPoolTitle)
getter for source question pool title
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertDbRecord()

ilObjTestDynamicQuestionSetConfig::insertDbRecord (   $testId)
private

inserts a new record for the question set config for the current test into the database

Parameters
$testId

Definition at line 291 of file class.ilObjTestDynamicQuestionSetConfig.php.

References getOrderingTaxonomyId(), getSourceQuestionPoolId(), getSourceQuestionPoolTitle(), isAnswerStatusFilterEnabled(), isPreviousQuestionsListEnabled(), and isTaxonomyFilterEnabled().

Referenced by cloneToDbForTestId(), and saveToDb().

292  {
293  $this->db->insert('tst_dyn_quest_set_cfg', array(
294  'test_fi' => array('integer', $testId),
295  'source_qpl_fi' => array('integer', $this->getSourceQuestionPoolId()),
296  'source_qpl_title' => array('text', $this->getSourceQuestionPoolTitle()),
297  'answer_filter_enabled' => array('integer', $this->isAnswerStatusFilterEnabled()),
298  'tax_filter_enabled' => array('integer', $this->isTaxonomyFilterEnabled()),
299  'order_tax' => array('integer', $this->getOrderingTaxonomyId()),
300  'prev_quest_list_enabled' => array('integer', $this->isPreviousQuestionsListEnabled())
301  ));
302  }
isTaxonomyFilterEnabled()
isser for taxonomie filter enabled
getSourceQuestionPoolTitle()
getter for source question pool title
getSourceQuestionPoolId()
getter for source question pool id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAnswerStatusFilterEnabled()

ilObjTestDynamicQuestionSetConfig::isAnswerStatusFilterEnabled ( )

◆ isAnyQuestionFilterEnabled()

ilObjTestDynamicQuestionSetConfig::isAnyQuestionFilterEnabled ( )

Definition at line 555 of file class.ilObjTestDynamicQuestionSetConfig.php.

References isAnswerStatusFilterEnabled(), and isTaxonomyFilterEnabled().

556  {
557  if( $this->isTaxonomyFilterEnabled() )
558  {
559  return true;
560  }
561 
562  if( $this->isAnswerStatusFilterEnabled() )
563  {
564  return true;
565  }
566 
567  return false;
568  }
isTaxonomyFilterEnabled()
isser for taxonomie filter enabled
+ Here is the call graph for this function:

◆ isPreviousQuestionsListEnabled()

ilObjTestDynamicQuestionSetConfig::isPreviousQuestionsListEnabled ( )
Returns
boolean

Definition at line 147 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $previousQuestionsListEnabled.

Referenced by insertDbRecord(), and updateDbRecord().

+ Here is the caller graph for this function:

◆ isQuestionSetConfigured()

ilObjTestDynamicQuestionSetConfig::isQuestionSetConfigured ( )

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

Returns
boolean

Definition at line 309 of file class.ilObjTestDynamicQuestionSetConfig.php.

References getSourceQuestionPoolId().

Referenced by doesQuestionSetRelatedDataExist().

310  {
311  return $this->getSourceQuestionPoolId() > 0;
312  }
getSourceQuestionPoolId()
getter for source question pool id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isResultTaxonomyFilterSupported()

ilObjTestDynamicQuestionSetConfig::isResultTaxonomyFilterSupported ( )

Definition at line 550 of file class.ilObjTestDynamicQuestionSetConfig.php.

551  {
552  return false;
553  }

◆ isTaxonomyFilterEnabled()

ilObjTestDynamicQuestionSetConfig::isTaxonomyFilterEnabled ( )

isser for taxonomie filter enabled

Returns
boolean

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

References $taxonomyFilterEnabled.

Referenced by ilTestDynamicQuestionSet\initFilteredQuestionList(), insertDbRecord(), isAnyQuestionFilterEnabled(), and updateDbRecord().

+ Here is the caller graph for this function:

◆ isValidRequestOnBrokenQuestionSetDepencies()

ilObjTestDynamicQuestionSetConfig::isValidRequestOnBrokenQuestionSetDepencies (   $nextClass,
  $cmd 
)

Definition at line 466 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $cmd.

467  {
468  //vd($nextClass, $cmd);
469 
470  if( !$this->testOBJ->participantDataExist() )
471  {
472  return true;
473  }
474 
475  switch( $nextClass )
476  {
477  case 'ilobjtestdynamicquestionsetconfiggui':
478 
479  case 'ilmdeditorgui':
480  case 'ilpermissiongui':
481 
482  return true;
483 
484  case 'ilobjtestgui':
485  case '':
486 
487  $cmds = array(
488  'infoScreen', 'participants', 'npSetFilter', 'npResetFilter',
489  'deleteAllUserResults', 'confirmDeleteAllUserResults',
490  'deleteSingleUserResults', 'confirmDeleteSelectedUserData', 'cancelDeleteSelectedUserData'
491  );
492 
493  if( in_array($cmd, $cmds) )
494  {
495  return true;
496  }
497 
498  break;
499  }
500 
501  return false;
502  }
$cmd
Definition: sahs_server.php:35

◆ loadFromDb()

ilObjTestDynamicQuestionSetConfig::loadFromDb ( )

loads the question set config for current test from the database

Returns
boolean

Definition at line 187 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $res, $row, and initFromArray().

Referenced by cloneQuestionSetRelatedData(), and ilObjTest\getQuestionsOfPass().

188  {
189  $res = $this->db->queryF(
190  "SELECT * FROM tst_dyn_quest_set_cfg WHERE test_fi = %s",
191  array('integer'), array($this->testOBJ->getTestId())
192  );
193 
194  while( $row = $this->db->fetchAssoc($res) )
195  {
196  $this->initFromArray($row);
197 
198  return true;
199  }
200 
201  return false;
202  }
initFromArray($dataArray)
initialises the current object instance with values from matching properties within the passed array ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeQuestionSetRelatedData()

ilObjTestDynamicQuestionSetConfig::removeQuestionSetRelatedData ( )

removes all question set config related data (in this case it's only the config itself)

Definition at line 328 of file class.ilObjTestDynamicQuestionSetConfig.php.

References deleteFromDb().

329  {
330  $this->deleteFromDb();
331  }
deleteFromDb()
deletes the question set config for current test from the database
+ Here is the call graph for this function:

◆ resetQuestionSetRelatedTestSettings()

ilObjTestDynamicQuestionSetConfig::resetQuestionSetRelatedTestSettings ( )

Definition at line 333 of file class.ilObjTestDynamicQuestionSetConfig.php.

334  {
335  // nothing to do
336  }

◆ saveToDb()

ilObjTestDynamicQuestionSetConfig::saveToDb ( )

saves the question set config for current test to the database

Definition at line 207 of file class.ilObjTestDynamicQuestionSetConfig.php.

References dbRecordExists(), insertDbRecord(), and updateDbRecord().

208  {
209  if( $this->dbRecordExists($this->testOBJ->getTestId()) )
210  {
211  $this->updateDbRecord($this->testOBJ->getTestId());
212  }
213  else
214  {
215  $this->insertDbRecord($this->testOBJ->getTestId());
216  }
217  }
updateDbRecord($testId)
updates the record in the database that corresponds to the question set config for the current test ...
insertDbRecord($testId)
inserts a new record for the question set config for the current test into the database ...
dbRecordExists($testId)
checks wether a question set config for current test exists in the database
+ Here is the call graph for this function:

◆ setAnswerStatusFilterEnabled()

ilObjTestDynamicQuestionSetConfig::setAnswerStatusFilterEnabled (   $answerStatusFilterEnabled)
Parameters
boolean$answerStatusFilterEnabled

Definition at line 99 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $answerStatusFilterEnabled.

Referenced by initFromArray().

100  {
101  $this->answerStatusFilterEnabled = $answerStatusFilterEnabled;
102  }
+ Here is the caller graph for this function:

◆ setOrderingTaxonomyId()

ilObjTestDynamicQuestionSetConfig::setOrderingTaxonomyId (   $orderingTaxonomyId)

getter for ordering taxonomy id

Parameters
integer$orderingTaxonomyId

Definition at line 139 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $orderingTaxonomyId.

Referenced by initFromArray().

140  {
141  $this->orderingTaxonomyId = $orderingTaxonomyId;
142  }
+ Here is the caller graph for this function:

◆ setPreviousQuestionsListEnabled()

ilObjTestDynamicQuestionSetConfig::setPreviousQuestionsListEnabled (   $previousQuestionsListEnabled)
Parameters
boolean$previousQuestionsListEnabled

Definition at line 155 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $previousQuestionsListEnabled.

Referenced by initFromArray().

156  {
157  $this->previousQuestionsListEnabled = $previousQuestionsListEnabled;
158  }
+ Here is the caller graph for this function:

◆ setSourceQuestionPoolId()

ilObjTestDynamicQuestionSetConfig::setSourceQuestionPoolId (   $sourceQuestionPoolId)

getter for source question pool id

Parameters
integer$sourceQuestionPoolId

Definition at line 63 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $sourceQuestionPoolId.

Referenced by initFromArray().

64  {
65  $this->sourceQuestionPoolId = (int)$sourceQuestionPoolId;
66  }
+ Here is the caller graph for this function:

◆ setSourceQuestionPoolTitle()

ilObjTestDynamicQuestionSetConfig::setSourceQuestionPoolTitle (   $sourceQuestionPoolTitle)

getter for source question pool title

Parameters
string$sourceQuestionPoolTitle

Definition at line 83 of file class.ilObjTestDynamicQuestionSetConfig.php.

Referenced by initFromArray().

84  {
85  $this->sourceQuestionPoolTitle = $sourceQuestionPoolTitle;
86  }
+ Here is the caller graph for this function:

◆ setTaxonomyFilterEnabled()

ilObjTestDynamicQuestionSetConfig::setTaxonomyFilterEnabled (   $taxonomyFilterEnabled)

setter for taxonomie filter enabled

Parameters
boolean$taxonomyFilterEnabled

Definition at line 119 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $taxonomyFilterEnabled.

Referenced by initFromArray().

120  {
121  $this->taxonomyFilterEnabled = (bool)$taxonomyFilterEnabled;
122  }
+ Here is the caller graph for this function:

◆ updateDbRecord()

ilObjTestDynamicQuestionSetConfig::updateDbRecord (   $testId)
private

updates the record in the database that corresponds to the question set config for the current test

Parameters
$testId

Definition at line 268 of file class.ilObjTestDynamicQuestionSetConfig.php.

References getOrderingTaxonomyId(), getSourceQuestionPoolId(), getSourceQuestionPoolTitle(), isAnswerStatusFilterEnabled(), isPreviousQuestionsListEnabled(), and isTaxonomyFilterEnabled().

Referenced by saveToDb().

269  {
270  $this->db->update('tst_dyn_quest_set_cfg',
271  array(
272  'source_qpl_fi' => array('integer', $this->getSourceQuestionPoolId()),
273  'source_qpl_title' => array('text', $this->getSourceQuestionPoolTitle()),
274  'answer_filter_enabled' => array('integer', $this->isAnswerStatusFilterEnabled()),
275  'tax_filter_enabled' => array('integer', $this->isTaxonomyFilterEnabled()),
276  'order_tax' => array('integer', $this->getOrderingTaxonomyId()),
277  'prev_quest_list_enabled' => array('integer', $this->isPreviousQuestionsListEnabled())
278  ),
279  array(
280  'test_fi' => array('integer', $testId)
281  )
282  );
283  }
isTaxonomyFilterEnabled()
isser for taxonomie filter enabled
getSourceQuestionPoolTitle()
getter for source question pool title
getSourceQuestionPoolId()
getter for source question pool id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $answerStatusFilterEnabled

ilObjTestDynamicQuestionSetConfig::$answerStatusFilterEnabled = null
private

◆ $orderingTaxonomyId

ilObjTestDynamicQuestionSetConfig::$orderingTaxonomyId = null
private

◆ $previousQuestionsListEnabled

ilObjTestDynamicQuestionSetConfig::$previousQuestionsListEnabled = null
private

◆ $sourceQuestionPoolId

ilObjTestDynamicQuestionSetConfig::$sourceQuestionPoolId = null
private

◆ $sourceQuestionPoolRefIds

ilObjTestDynamicQuestionSetConfig::$sourceQuestionPoolRefIds = null
private

◆ $taxonomyFilterEnabled

ilObjTestDynamicQuestionSetConfig::$taxonomyFilterEnabled = null
private

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