ILIAS  release_8 Revision v8.23
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, ilComponentRepository $component_repository, 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)
 
 getFirstQuestionPoolRefIdByObjId (int $pool_obj_id)
 
 isResultTaxonomyFilterSupported ()
 

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
ilTree $tree
 
ilDBInterface $db
 
ilComponentRepository $component_repository
 
ilObjTest $testOBJ
 

Detailed Description

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

Member Function Documentation

◆ areDepenciesBroken()

ilObjTestDynamicQuestionSetConfig::areDepenciesBroken ( )

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

References getSourceQuestionPoolId(), and getSourceQuestionPoolRefIds().

424  : bool
425  {
426  if (!$this->getSourceQuestionPoolId()) {
427  return false;
428  }
429 
430  $poolRefs = $this->getSourceQuestionPoolRefIds();
431 
432  if (count($poolRefs)) {
433  return false;
434  }
435 
436  return true;
437  }
getSourceQuestionPoolId()
getter for source question pool id
+ Here is the call graph for this function:

◆ areDepenciesInVulnerableState()

ilObjTestDynamicQuestionSetConfig::areDepenciesInVulnerableState ( )

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

References $refId, getSourceQuestionPoolId(), and getSourceQuestionPoolRefIds().

397  : bool
398  {
399  if (!$this->getSourceQuestionPoolId()) {
400  return false;
401  }
402 
403  $poolRefs = $this->getSourceQuestionPoolRefIds();
404 
405  foreach ($poolRefs as $refId) {
406  if (!$this->tree->isDeleted($refId)) {
407  return false;
408  }
409  }
410 
411  return true;
412  }
$refId
Definition: xapitoken.php:58
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 330 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

331  {
332  $this->loadFromDb();
333  $this->cloneToDbForTestId($cloneTestOBJ->getTestId());
334  }
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 210 of file class.ilObjTestDynamicQuestionSetConfig.php.

References insertDbRecord().

Referenced by cloneQuestionSetRelatedData().

211  {
212  $this->insertDbRecord($testId);
213  }
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 237 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $res.

Referenced by saveToDb().

237  : bool
238  {
239  $res = $this->db->queryF(
240  "SELECT COUNT(*) cnt FROM tst_dyn_quest_set_cfg WHERE test_fi = %s",
241  array('integer'),
242  array($testId)
243  );
244 
245  $row = $this->db->fetchAssoc($res);
246 
247  return (bool) $row['cnt'];
248  }
$res
Definition: ltiservices.php:69
+ 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 220 of file class.ilObjTestDynamicQuestionSetConfig.php.

Referenced by removeQuestionSetRelatedData().

220  : bool
221  {
222  $aff = $this->db->manipulateF(
223  "DELETE FROM tst_dyn_quest_set_cfg WHERE test_fi = %s",
224  array('integer'),
225  array($this->testOBJ->getTestId())
226  );
227 
228  return (bool) $aff;
229  }
+ 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 306 of file class.ilObjTestDynamicQuestionSetConfig.php.

References isQuestionSetConfigured().

306  : bool
307  {
308  return $this->isQuestionSetConfigured();
309  }
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 439 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

439  : string
440  {
441  $msg = sprintf(
442  $lng->txt('tst_dyn_quest_set_pool_deleted'),
444  );
445 
446  return $msg;
447  }
txt(string $a_topic, string $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...
getSourceQuestionPoolTitle()
getter for source question pool title
+ Here is the call graph for this function:

◆ getDepenciesInVulnerableStateMessage()

ilObjTestDynamicQuestionSetConfig::getDepenciesInVulnerableStateMessage ( ilLanguage  $lng)

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

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

414  : string
415  {
416  $msg = sprintf(
417  $lng->txt('tst_dyn_quest_set_pool_trashed'),
419  );
420 
421  return $msg;
422  }
txt(string $a_topic, string $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...
getSourceQuestionPoolTitle()
getter for source question pool title
+ Here is the call graph for this function:

◆ getHiddenTabsOnBrokenDepencies()

ilObjTestDynamicQuestionSetConfig::getHiddenTabsOnBrokenDepencies ( )

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

484  : array
485  {
486  return array(
487  'settings', 'manscoring', 'scoringadjust', 'statistics', 'history', 'export'
488  );
489  }

◆ getOrderingTaxonomyId()

ilObjTestDynamicQuestionSetConfig::getOrderingTaxonomyId ( )

setter for ordering taxonomy id

Returns
integer $orderingTaxonomyId

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

References $orderingTaxonomyId.

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

+ Here is the caller graph for this function:

◆ getSourceQuestionPoolId()

◆ getSourceQuestionPoolLink()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolLink ( )

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

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

520  : string
521  {
523  $href = ilLink::_getLink($refId, 'qpl');
524  $title = $this->getSourceQuestionPoolTitle();
525 
526  return "<a href=\"$href\" alt=\"$title\">$title</a>";
527  }
static _getAllReferences(int $id)
get all reference ids for object ID
$refId
Definition: xapitoken.php:58
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 379 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

Referenced by getSourceQuestionPoolSummaryString().

379  : int
380  {
381  $query = "
382  SELECT COUNT(*) num from qpl_questions
383  WHERE obj_fi = %s AND original_id IS NULL
384  ";
385 
386  $res = $this->db->queryF(
387  $query,
388  array('integer'),
389  array($this->getSourceQuestionPoolId())
390  );
391 
392  $row = $this->db->fetchAssoc($res);
393 
394  return $row['num'];
395  }
$res
Definition: ltiservices.php:69
$query
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 493 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

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

493  : array
494  {
495  if ($this->sourceQuestionPoolRefIds === null) {
496  $this->sourceQuestionPoolRefIds = ilObject::_getAllReferences($this->getSourceQuestionPoolId());
497  }
498 
500  }
static _getAllReferences(int $id)
get all reference ids for object ID
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 341 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

341  : string
342  {
343  $poolRefs = $this->getSourceQuestionPoolRefIds();
344 
345  if (!count($poolRefs)) {
346  $sourceQuestionPoolSummaryString = sprintf(
347  $lng->txt('tst_dyn_quest_set_src_qpl_summary_string_deleted'),
349  );
350 
351  return $sourceQuestionPoolSummaryString;
352  }
353 
354  foreach ($poolRefs as $refId) {
355  if (!$this->tree->isDeleted($refId)) {
356  $sourceQuestionPoolSummaryString = sprintf(
357  $lng->txt('tst_dynamic_question_set_source_questionpool_summary_string'),
361  );
362 
363  return $sourceQuestionPoolSummaryString;
364  }
365  }
366 
367  $sourceQuestionPoolSummaryString = sprintf(
368  $lng->txt('tst_dyn_quest_set_src_qpl_summary_string_trashed'),
371  );
372 
373  return $sourceQuestionPoolSummaryString;
374  }
txt(string $a_topic, string $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...
$refId
Definition: xapitoken.php:58
getSourceQuestionPoolTitle()
getter for source question pool title
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 81 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

81  : string
82  {
83  return $this->sourceQuestionPoolTitle;
84  }
+ 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 158 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

Referenced by loadFromDb().

159  {
160  foreach ($dataArray as $field => $value) {
161  switch ($field) {
162  case 'source_qpl_fi': $this->setSourceQuestionPoolId($value); break;
163  case 'source_qpl_title': $this->setSourceQuestionPoolTitle($value); break;
164  case 'answer_filter_enabled': $this->setAnswerStatusFilterEnabled($value); break;
165  case 'tax_filter_enabled': $this->setTaxonomyFilterEnabled($value); break;
166  case 'order_tax': $this->setOrderingTaxonomyId($value); break;
167  }
168  }
169  }
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 279 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

Referenced by cloneToDbForTestId(), and saveToDb().

280  {
281  $this->db->insert('tst_dyn_quest_set_cfg', array(
282  'test_fi' => array('integer', $testId),
283  'source_qpl_fi' => array('integer', $this->getSourceQuestionPoolId()),
284  'source_qpl_title' => array('text', $this->getSourceQuestionPoolTitle()),
285  'answer_filter_enabled' => array('integer', $this->isAnswerStatusFilterEnabled()),
286  'tax_filter_enabled' => array('integer', $this->isTaxonomyFilterEnabled()),
287  'order_tax' => array('integer', $this->getOrderingTaxonomyId())
288  ));
289  }
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 507 of file class.ilObjTestDynamicQuestionSetConfig.php.

References isAnswerStatusFilterEnabled(), and isTaxonomyFilterEnabled().

507  : bool
508  {
509  if ($this->isTaxonomyFilterEnabled()) {
510  return true;
511  }
512 
513  if ($this->isAnswerStatusFilterEnabled()) {
514  return true;
515  }
516 
517  return false;
518  }
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 296 of file class.ilObjTestDynamicQuestionSetConfig.php.

References getSourceQuestionPoolId().

Referenced by doesQuestionSetRelatedDataExist().

296  : bool
297  {
298  return $this->getSourceQuestionPoolId() > 0;
299  }
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 502 of file class.ilObjTestDynamicQuestionSetConfig.php.

502  : bool
503  {
504  return false;
505  }

◆ isTaxonomyFilterEnabled()

ilObjTestDynamicQuestionSetConfig::isTaxonomyFilterEnabled ( )

isser for taxonomie filter enabled

Returns
boolean

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

References $taxonomyFilterEnabled.

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

+ Here is the caller graph for this function:

◆ isValidRequestOnBrokenQuestionSetDepencies()

ilObjTestDynamicQuestionSetConfig::isValidRequestOnBrokenQuestionSetDepencies (   $nextClass,
  $cmd 
)

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

449  : bool
450  {
451  //vd($nextClass, $cmd);
452 
453  if (!$this->testOBJ->participantDataExist()) {
454  return true;
455  }
456 
457  switch ($nextClass) {
458  case 'ilobjtestdynamicquestionsetconfiggui':
459 
460  case 'ilobjectmetadatagui':
461  case 'ilpermissiongui':
462 
463  return true;
464 
465  case 'ilobjtestgui':
466  case '':
467 
468  $cmds = array(
469  'infoScreen', 'participants', 'npSetFilter', 'npResetFilter',
470  'deleteAllUserResults', 'confirmDeleteAllUserResults',
471  'deleteSingleUserResults', 'confirmDeleteSelectedUserData', 'cancelDeleteSelectedUserData'
472  );
473 
474  if (in_array($cmd, $cmds)) {
475  return true;
476  }
477 
478  break;
479  }
480 
481  return false;
482  }

◆ loadFromDb()

ilObjTestDynamicQuestionSetConfig::loadFromDb ( )

loads the question set config for current test from the database

Returns
boolean

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

References $res, and initFromArray().

Referenced by ilObjTest\buildStatisticsAccessFilteredParticipantList(), cloneQuestionSetRelatedData(), and ilTestResultsGUI\executeCommand().

176  : bool
177  {
178  $res = $this->db->queryF(
179  "SELECT * FROM tst_dyn_quest_set_cfg WHERE test_fi = %s",
180  array('integer'),
181  array($this->testOBJ->getTestId())
182  );
183 
184  while ($row = $this->db->fetchAssoc($res)) {
185  $this->initFromArray($row);
186 
187  return true;
188  }
189 
190  return false;
191  }
$res
Definition: ltiservices.php:69
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 315 of file class.ilObjTestDynamicQuestionSetConfig.php.

References deleteFromDb().

315  : void
316  {
317  $this->deleteFromDb();
318  }
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 320 of file class.ilObjTestDynamicQuestionSetConfig.php.

321  {
322  // nothing to do
323  }

◆ saveToDb()

ilObjTestDynamicQuestionSetConfig::saveToDb ( )

saves the question set config for current test to the database

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

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

197  {
198  if ($this->dbRecordExists($this->testOBJ->getTestId())) {
199  $this->updateDbRecord($this->testOBJ->getTestId());
200  } else {
201  $this->insertDbRecord($this->testOBJ->getTestId());
202  }
203  }
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 107 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $answerStatusFilterEnabled.

Referenced by initFromArray().

108  {
109  $this->answerStatusFilterEnabled = $answerStatusFilterEnabled;
110  }
+ Here is the caller graph for this function:

◆ setOrderingTaxonomyId()

ilObjTestDynamicQuestionSetConfig::setOrderingTaxonomyId (   $orderingTaxonomyId)

getter for ordering taxonomy id

Parameters
integer$orderingTaxonomyId

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

References $orderingTaxonomyId.

Referenced by initFromArray().

148  {
149  $this->orderingTaxonomyId = $orderingTaxonomyId;
150  }
+ Here is the caller graph for this function:

◆ setSourceQuestionPoolId()

ilObjTestDynamicQuestionSetConfig::setSourceQuestionPoolId (   $sourceQuestionPoolId)

getter for source question pool id

Parameters
integer$sourceQuestionPoolId

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

References $sourceQuestionPoolId, and ILIAS\Repository\int().

Referenced by initFromArray().

72  {
73  $this->sourceQuestionPoolId = (int) $sourceQuestionPoolId;
74  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSourceQuestionPoolTitle()

ilObjTestDynamicQuestionSetConfig::setSourceQuestionPoolTitle (   $sourceQuestionPoolTitle)

getter for source question pool title

Parameters
string$sourceQuestionPoolTitle

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

Referenced by initFromArray().

92  {
93  $this->sourceQuestionPoolTitle = $sourceQuestionPoolTitle;
94  }
+ Here is the caller graph for this function:

◆ setTaxonomyFilterEnabled()

ilObjTestDynamicQuestionSetConfig::setTaxonomyFilterEnabled (   $taxonomyFilterEnabled)

setter for taxonomie filter enabled

Parameters
boolean$taxonomyFilterEnabled

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

References $taxonomyFilterEnabled.

Referenced by initFromArray().

128  {
129  $this->taxonomyFilterEnabled = (bool) $taxonomyFilterEnabled;
130  }
+ 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 256 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

Referenced by saveToDb().

257  {
258  $this->db->update(
259  'tst_dyn_quest_set_cfg',
260  array(
261  'source_qpl_fi' => array('integer', $this->getSourceQuestionPoolId()),
262  'source_qpl_title' => array('text', $this->getSourceQuestionPoolTitle()),
263  'answer_filter_enabled' => array('integer', $this->isAnswerStatusFilterEnabled()),
264  'tax_filter_enabled' => array('integer', $this->isTaxonomyFilterEnabled()),
265  'order_tax' => array('integer', $this->getOrderingTaxonomyId())
266  ),
267  array(
268  'test_fi' => array('integer', $testId)
269  )
270  );
271  }
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

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