ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 
 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 (ilObjTest $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 ()
 
 getSourceQuestionPoolLink ()
 
- Public Member Functions inherited from ilTestQuestionSetConfig
 __construct (ilTree $tree, ilDBInterface $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 (ilObjTest $cloneTestOBJ)
 removes all question set config related data for cloned/copied test More...
 
 getQuestionPoolPathString ($poolId)
 
 isResultTaxonomyFilterSupported ()
 

Static Public Member Functions

static getPoolQuestionChangeListener (ilDBInterface $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
 
 $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 416 of file class.ilObjTestDynamicQuestionSetConfig.php.

References getSourceQuestionPoolId(), and getSourceQuestionPoolRefIds().

417  {
418  if( !$this->getSourceQuestionPoolId() )
419  {
420  return false;
421  }
422 
423  $poolRefs = $this->getSourceQuestionPoolRefIds();
424 
425  if( count($poolRefs) )
426  {
427  return false;
428  }
429 
430  return true;
431  }
getSourceQuestionPoolId()
getter for source question pool id
+ Here is the call graph for this function:

◆ areDepenciesInVulnerableState()

ilObjTestDynamicQuestionSetConfig::areDepenciesInVulnerableState ( )

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

References getSourceQuestionPoolId(), and getSourceQuestionPoolRefIds().

388  {
389  if( !$this->getSourceQuestionPoolId() )
390  {
391  return false;
392  }
393 
394  $poolRefs = $this->getSourceQuestionPoolRefIds();
395 
396  foreach( $poolRefs as $refId )
397  {
398  if( !$this->tree->isDeleted($refId) )
399  {
400  return false;
401  }
402  }
403 
404  return true;
405  }
getSourceQuestionPoolId()
getter for source question pool id
+ Here is the call graph for this function:

◆ cloneQuestionSetRelatedData()

ilObjTestDynamicQuestionSetConfig::cloneQuestionSetRelatedData ( ilObjTest  $cloneTestOBJ)

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

Parameters
ilObjTest$cloneTestOBJ

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

References cloneToDbForTestId(), ilObjTest\getTestId(), and loadFromDb().

320  {
321  $this->loadFromDb();
322  $this->cloneToDbForTestId($cloneTestOBJ->getTestId());
323  }
loadFromDb()
loads the question set config for current test from the database
getTestId()
Gets the database id of the additional test data.
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 202 of file class.ilObjTestDynamicQuestionSetConfig.php.

References insertDbRecord().

Referenced by cloneQuestionSetRelatedData().

203  {
204  $this->insertDbRecord($testId);
205  }
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 228 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $res, $row, and array.

Referenced by saveToDb().

229  {
230  $res = $this->db->queryF(
231  "SELECT COUNT(*) cnt FROM tst_dyn_quest_set_cfg WHERE test_fi = %s",
232  array('integer'), array($testId)
233  );
234 
235  $row = $this->db->fetchAssoc($res);
236 
237  return (bool)$row['cnt'];
238  }
Create styles array
The data for the language used.
+ 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 212 of file class.ilObjTestDynamicQuestionSetConfig.php.

References array.

Referenced by removeQuestionSetRelatedData().

213  {
214  $aff = $this->db->manipulateF(
215  "DELETE FROM tst_dyn_quest_set_cfg WHERE test_fi = %s",
216  array('integer'), array($this->testOBJ->getTestId())
217  );
218 
219  return (bool)$aff;
220  }
Create styles array
The data for the language used.
+ 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 295 of file class.ilObjTestDynamicQuestionSetConfig.php.

References isQuestionSetConfigured().

296  {
297  return $this->isQuestionSetConfigured();
298  }
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 433 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

434  {
435  $msg = sprintf(
436  $lng->txt('tst_dyn_quest_set_pool_deleted'), $this->getSourceQuestionPoolTitle()
437  );
438 
439  return $msg;
440  }
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 407 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

408  {
409  $msg = sprintf(
410  $lng->txt('tst_dyn_quest_set_pool_trashed'), $this->getSourceQuestionPoolTitle()
411  );
412 
413  return $msg;
414  }
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 480 of file class.ilObjTestDynamicQuestionSetConfig.php.

References array.

481  {
482  return array(
483  'settings', 'manscoring', 'scoringadjust', 'statistics', 'history', 'export'
484  );
485  }
Create styles array
The data for the language used.

◆ getOrderingTaxonomyId()

ilObjTestDynamicQuestionSetConfig::getOrderingTaxonomyId ( )

setter for ordering taxonomy id

Returns
integer $orderingTaxonomyId

Definition at line 124 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 ( ilDBInterface  $db,
  $poolObjId 
)
static
Parameters
integer$poolObjId
Returns

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

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

Referenced by ilObjTest\getPoolQuestionChangeListeners().

504  {
505  $query = "
506  SELECT obj_fi
507  FROM tst_dyn_quest_set_cfg
508  INNER JOIN tst_tests
509  ON tst_tests.test_id = tst_dyn_quest_set_cfg.test_fi
510  WHERE source_qpl_fi = %s
511  ";
512 
513  $res = $db->queryF($query, array('integer'), array($poolObjId));
514 
515  require_once 'Modules/Test/classes/class.ilDynamicTestQuestionChangeListener.php';
516  $questionChangeListener = new ilDynamicTestQuestionChangeListener($db);
517 
518  while( $row = $db->fetchAssoc($res) )
519  {
520  $questionChangeListener->addTestObjId( $row['obj_fi'] );
521  }
522 
523  return $questionChangeListener;
524  }
queryF($query, $types, $values)
Create styles array
The data for the language used.
fetchAssoc($query_result)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSourceQuestionPoolId()

◆ getSourceQuestionPoolLink()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolLink ( )

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

References $title, ilObject\_getAllReferences(), ilLink\_getLink(), getSourceQuestionPoolId(), and getSourceQuestionPoolTitle().

547  {
548  $refId = current(ilObject::_getAllReferences($this->getSourceQuestionPoolId()));
549  $href = ilLink::_getLink($refId, 'qpl');
551 
552  return "<a href=\"$href\" alt=\"$title\">$title</a>";
553  }
static _getAllReferences($a_id)
get all reference ids of object
getSourceQuestionPoolTitle()
getter for source question pool title
getSourceQuestionPoolId()
getter for source question pool id
+ Here is the call graph for this function:

◆ getSourceQuestionPoolNumQuestions()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolNumQuestions ( )
private
Returns
integer

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

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

Referenced by getSourceQuestionPoolSummaryString().

372  {
373  $query = "
374  SELECT COUNT(*) num from qpl_questions
375  WHERE obj_fi = %s AND original_id IS NULL
376  ";
377 
378  $res = $this->db->queryF(
379  $query, array('integer'), array($this->getSourceQuestionPoolId())
380  );
381 
382  $row = $this->db->fetchAssoc($res);
383 
384  return $row['num'];
385  }
Create styles array
The data for the language used.
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 489 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

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

490  {
491  if( $this->sourceQuestionPoolRefIds === null )
492  {
493  $this->sourceQuestionPoolRefIds = ilObject::_getAllReferences($this->getSourceQuestionPoolId());
494  }
495 
497  }
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 330 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

331  {
332  $poolRefs = $this->getSourceQuestionPoolRefIds();
333 
334  if( !count($poolRefs) )
335  {
336  $sourceQuestionPoolSummaryString = sprintf(
337  $lng->txt('tst_dyn_quest_set_src_qpl_summary_string_deleted'),
339  );
340 
341  return $sourceQuestionPoolSummaryString;
342  }
343 
344  foreach($poolRefs as $refId)
345  {
346  if( !$this->tree->isDeleted($refId) )
347  {
348  $sourceQuestionPoolSummaryString = sprintf(
349  $lng->txt('tst_dynamic_question_set_source_questionpool_summary_string'),
353  );
354 
355  return $sourceQuestionPoolSummaryString;
356  }
357  }
358 
359  $sourceQuestionPoolSummaryString = sprintf(
360  $lng->txt('tst_dyn_quest_set_src_qpl_summary_string_trashed'),
363  );
364 
365  return $sourceQuestionPoolSummaryString;
366  }
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 68 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

69  {
70  return $this->sourceQuestionPoolTitle;
71  }
+ 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 145 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $dataArray, setAnswerStatusFilterEnabled(), setOrderingTaxonomyId(), setSourceQuestionPoolId(), setSourceQuestionPoolTitle(), and setTaxonomyFilterEnabled().

Referenced by loadFromDb().

146  {
147  foreach($dataArray as $field => $value)
148  {
149  switch($field)
150  {
151  case 'source_qpl_fi': $this->setSourceQuestionPoolId($value); break;
152  case 'source_qpl_title': $this->setSourceQuestionPoolTitle($value); break;
153  case 'answer_filter_enabled': $this->setAnswerStatusFilterEnabled($value); break;
154  case 'tax_filter_enabled': $this->setTaxonomyFilterEnabled($value); break;
155  case 'order_tax': $this->setOrderingTaxonomyId($value); break;
156  }
157  }
158  }
setTaxonomyFilterEnabled($taxonomyFilterEnabled)
setter for taxonomie filter enabled
setOrderingTaxonomyId($orderingTaxonomyId)
getter for ordering taxonomy id
$dataArray
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 268 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

Referenced by cloneToDbForTestId(), and saveToDb().

269  {
270  $this->db->insert('tst_dyn_quest_set_cfg', array(
271  'test_fi' => array('integer', $testId),
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  ));
278  }
isTaxonomyFilterEnabled()
isser for taxonomie filter enabled
getSourceQuestionPoolTitle()
getter for source question pool title
Create styles array
The data for the language used.
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 531 of file class.ilObjTestDynamicQuestionSetConfig.php.

References isAnswerStatusFilterEnabled(), and isTaxonomyFilterEnabled().

532  {
533  if( $this->isTaxonomyFilterEnabled() )
534  {
535  return true;
536  }
537 
538  if( $this->isAnswerStatusFilterEnabled() )
539  {
540  return true;
541  }
542 
543  return false;
544  }
isTaxonomyFilterEnabled()
isser for taxonomie filter enabled
+ Here is the call graph for this function:

◆ isQuestionSetConfigured()

ilObjTestDynamicQuestionSetConfig::isQuestionSetConfigured ( )

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

Returns
boolean

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

References getSourceQuestionPoolId().

Referenced by doesQuestionSetRelatedDataExist().

286  {
287  return $this->getSourceQuestionPoolId() > 0;
288  }
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 526 of file class.ilObjTestDynamicQuestionSetConfig.php.

527  {
528  return false;
529  }

◆ isTaxonomyFilterEnabled()

ilObjTestDynamicQuestionSetConfig::isTaxonomyFilterEnabled ( )

◆ isValidRequestOnBrokenQuestionSetDepencies()

ilObjTestDynamicQuestionSetConfig::isValidRequestOnBrokenQuestionSetDepencies (   $nextClass,
  $cmd 
)

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

References $cmd, and array.

443  {
444  //vd($nextClass, $cmd);
445 
446  if( !$this->testOBJ->participantDataExist() )
447  {
448  return true;
449  }
450 
451  switch( $nextClass )
452  {
453  case 'ilobjtestdynamicquestionsetconfiggui':
454 
455  case 'ilobjectmetadatagui':
456  case 'ilpermissiongui':
457 
458  return true;
459 
460  case 'ilobjtestgui':
461  case '':
462 
463  $cmds = array(
464  'infoScreen', 'participants', 'npSetFilter', 'npResetFilter',
465  'deleteAllUserResults', 'confirmDeleteAllUserResults',
466  'deleteSingleUserResults', 'confirmDeleteSelectedUserData', 'cancelDeleteSelectedUserData'
467  );
468 
469  if( in_array($cmd, $cmds) )
470  {
471  return true;
472  }
473 
474  break;
475  }
476 
477  return false;
478  }
$cmd
Definition: sahs_server.php:35
Create styles array
The data for the language used.

◆ loadFromDb()

ilObjTestDynamicQuestionSetConfig::loadFromDb ( )

loads the question set config for current test from the database

Returns
boolean

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

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

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

166  {
167  $res = $this->db->queryF(
168  "SELECT * FROM tst_dyn_quest_set_cfg WHERE test_fi = %s",
169  array('integer'), array($this->testOBJ->getTestId())
170  );
171 
172  while( $row = $this->db->fetchAssoc($res) )
173  {
174  $this->initFromArray($row);
175 
176  return true;
177  }
178 
179  return false;
180  }
initFromArray($dataArray)
initialises the current object instance with values from matching properties within the passed array ...
Create styles array
The data for the language used.
+ 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 304 of file class.ilObjTestDynamicQuestionSetConfig.php.

References deleteFromDb().

305  {
306  $this->deleteFromDb();
307  }
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 309 of file class.ilObjTestDynamicQuestionSetConfig.php.

310  {
311  // nothing to do
312  }

◆ saveToDb()

ilObjTestDynamicQuestionSetConfig::saveToDb ( )

saves the question set config for current test to the database

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

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

186  {
187  if( $this->dbRecordExists($this->testOBJ->getTestId()) )
188  {
189  $this->updateDbRecord($this->testOBJ->getTestId());
190  }
191  else
192  {
193  $this->insertDbRecord($this->testOBJ->getTestId());
194  }
195  }
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 94 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $answerStatusFilterEnabled.

Referenced by initFromArray().

95  {
96  $this->answerStatusFilterEnabled = $answerStatusFilterEnabled;
97  }
+ Here is the caller graph for this function:

◆ setOrderingTaxonomyId()

ilObjTestDynamicQuestionSetConfig::setOrderingTaxonomyId (   $orderingTaxonomyId)

getter for ordering taxonomy id

Parameters
integer$orderingTaxonomyId

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

References $orderingTaxonomyId.

Referenced by initFromArray().

135  {
136  $this->orderingTaxonomyId = $orderingTaxonomyId;
137  }
+ Here is the caller graph for this function:

◆ setSourceQuestionPoolId()

ilObjTestDynamicQuestionSetConfig::setSourceQuestionPoolId (   $sourceQuestionPoolId)

getter for source question pool id

Parameters
integer$sourceQuestionPoolId

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

References $sourceQuestionPoolId.

Referenced by initFromArray().

59  {
60  $this->sourceQuestionPoolId = (int)$sourceQuestionPoolId;
61  }
+ Here is the caller graph for this function:

◆ setSourceQuestionPoolTitle()

ilObjTestDynamicQuestionSetConfig::setSourceQuestionPoolTitle (   $sourceQuestionPoolTitle)

getter for source question pool title

Parameters
string$sourceQuestionPoolTitle

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

Referenced by initFromArray().

79  {
80  $this->sourceQuestionPoolTitle = $sourceQuestionPoolTitle;
81  }
+ Here is the caller graph for this function:

◆ setTaxonomyFilterEnabled()

ilObjTestDynamicQuestionSetConfig::setTaxonomyFilterEnabled (   $taxonomyFilterEnabled)

setter for taxonomie filter enabled

Parameters
boolean$taxonomyFilterEnabled

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

References $taxonomyFilterEnabled.

Referenced by initFromArray().

115  {
116  $this->taxonomyFilterEnabled = (bool)$taxonomyFilterEnabled;
117  }
+ 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 246 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

Referenced by saveToDb().

247  {
248  $this->db->update('tst_dyn_quest_set_cfg',
249  array(
250  'source_qpl_fi' => array('integer', $this->getSourceQuestionPoolId()),
251  'source_qpl_title' => array('text', $this->getSourceQuestionPoolTitle()),
252  'answer_filter_enabled' => array('integer', $this->isAnswerStatusFilterEnabled()),
253  'tax_filter_enabled' => array('integer', $this->isTaxonomyFilterEnabled()),
254  'order_tax' => array('integer', $this->getOrderingTaxonomyId())
255  ),
256  array(
257  'test_fi' => array('integer', $testId)
258  )
259  );
260  }
isTaxonomyFilterEnabled()
isser for taxonomie filter enabled
getSourceQuestionPoolTitle()
getter for source question pool title
Create styles array
The data for the language used.
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

◆ $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: