ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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)
 
 getFirstQuestionPoolRefIdByObjId (int $pool_obj_id)
 
 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 411 of file class.ilObjTestDynamicQuestionSetConfig.php.

References getSourceQuestionPoolId(), and getSourceQuestionPoolRefIds().

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

◆ areDepenciesInVulnerableState()

ilObjTestDynamicQuestionSetConfig::areDepenciesInVulnerableState ( )

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

References getSourceQuestionPoolId(), and getSourceQuestionPoolRefIds().

385  {
386  if (!$this->getSourceQuestionPoolId()) {
387  return false;
388  }
389 
390  $poolRefs = $this->getSourceQuestionPoolRefIds();
391 
392  foreach ($poolRefs as $refId) {
393  if (!$this->tree->isDeleted($refId)) {
394  return false;
395  }
396  }
397 
398  return true;
399  }
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 317 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

318  {
319  $this->loadFromDb();
320  $this->cloneToDbForTestId($cloneTestOBJ->getTestId());
321  }
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 197 of file class.ilObjTestDynamicQuestionSetConfig.php.

References insertDbRecord().

Referenced by cloneQuestionSetRelatedData().

198  {
199  $this->insertDbRecord($testId);
200  }
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 224 of file class.ilObjTestDynamicQuestionSetConfig.php.

References $res, and $row.

Referenced by saveToDb().

225  {
226  $res = $this->db->queryF(
227  "SELECT COUNT(*) cnt FROM tst_dyn_quest_set_cfg WHERE test_fi = %s",
228  array('integer'),
229  array($testId)
230  );
231 
232  $row = $this->db->fetchAssoc($res);
233 
234  return (bool) $row['cnt'];
235  }
foreach($_POST as $key=> $value) $res
$row
+ 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 207 of file class.ilObjTestDynamicQuestionSetConfig.php.

Referenced by removeQuestionSetRelatedData().

208  {
209  $aff = $this->db->manipulateF(
210  "DELETE FROM tst_dyn_quest_set_cfg WHERE test_fi = %s",
211  array('integer'),
212  array($this->testOBJ->getTestId())
213  );
214 
215  return (bool) $aff;
216  }
+ 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 293 of file class.ilObjTestDynamicQuestionSetConfig.php.

References isQuestionSetConfigured().

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

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

427  {
428  $msg = sprintf(
429  $lng->txt('tst_dyn_quest_set_pool_deleted'),
431  );
432 
433  return $msg;
434  }
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 401 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

402  {
403  $msg = sprintf(
404  $lng->txt('tst_dyn_quest_set_pool_trashed'),
406  );
407 
408  return $msg;
409  }
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 471 of file class.ilObjTestDynamicQuestionSetConfig.php.

472  {
473  return array(
474  'settings', 'manscoring', 'scoringadjust', 'statistics', 'history', 'export'
475  );
476  }

◆ 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 493 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

Referenced by ilObjTest\getPoolQuestionChangeListeners().

494  {
495  $query = "
496  SELECT obj_fi
497  FROM tst_dyn_quest_set_cfg
498  INNER JOIN tst_tests
499  ON tst_tests.test_id = tst_dyn_quest_set_cfg.test_fi
500  WHERE source_qpl_fi = %s
501  ";
502 
503  $res = $db->queryF($query, array('integer'), array($poolObjId));
504 
505  require_once 'Modules/Test/classes/class.ilDynamicTestQuestionChangeListener.php';
506  $questionChangeListener = new ilDynamicTestQuestionChangeListener($db);
507 
508  while ($row = $db->fetchAssoc($res)) {
509  $questionChangeListener->addTestObjId($row['obj_fi']);
510  }
511 
512  return $questionChangeListener;
513  }
foreach($_POST as $key=> $value) $res
queryF($query, $types, $values)
$query
$row
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 533 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

534  {
535  $refId = current(ilObject::_getAllReferences($this->getSourceQuestionPoolId()));
536  $href = ilLink::_getLink($refId, 'qpl');
538 
539  return "<a href=\"$href\" alt=\"$title\">$title</a>";
540  }
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 366 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

Referenced by getSourceQuestionPoolSummaryString().

367  {
368  $query = "
369  SELECT COUNT(*) num from qpl_questions
370  WHERE obj_fi = %s AND original_id IS NULL
371  ";
372 
373  $res = $this->db->queryF(
374  $query,
375  array('integer'),
376  array($this->getSourceQuestionPoolId())
377  );
378 
379  $row = $this->db->fetchAssoc($res);
380 
381  return $row['num'];
382  }
foreach($_POST as $key=> $value) $res
$query
$row
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 480 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

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

481  {
482  if ($this->sourceQuestionPoolRefIds === null) {
483  $this->sourceQuestionPoolRefIds = ilObject::_getAllReferences($this->getSourceQuestionPoolId());
484  }
485 
487  }
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 328 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

329  {
330  $poolRefs = $this->getSourceQuestionPoolRefIds();
331 
332  if (!count($poolRefs)) {
333  $sourceQuestionPoolSummaryString = sprintf(
334  $lng->txt('tst_dyn_quest_set_src_qpl_summary_string_deleted'),
336  );
337 
338  return $sourceQuestionPoolSummaryString;
339  }
340 
341  foreach ($poolRefs as $refId) {
342  if (!$this->tree->isDeleted($refId)) {
343  $sourceQuestionPoolSummaryString = sprintf(
344  $lng->txt('tst_dynamic_question_set_source_questionpool_summary_string'),
348  );
349 
350  return $sourceQuestionPoolSummaryString;
351  }
352  }
353 
354  $sourceQuestionPoolSummaryString = sprintf(
355  $lng->txt('tst_dyn_quest_set_src_qpl_summary_string_trashed'),
358  );
359 
360  return $sourceQuestionPoolSummaryString;
361  }
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 setAnswerStatusFilterEnabled(), setOrderingTaxonomyId(), setSourceQuestionPoolId(), setSourceQuestionPoolTitle(), and setTaxonomyFilterEnabled().

Referenced by loadFromDb().

146  {
147  foreach ($dataArray as $field => $value) {
148  switch ($field) {
149  case 'source_qpl_fi': $this->setSourceQuestionPoolId($value); break;
150  case 'source_qpl_title': $this->setSourceQuestionPoolTitle($value); break;
151  case 'answer_filter_enabled': $this->setAnswerStatusFilterEnabled($value); break;
152  case 'tax_filter_enabled': $this->setTaxonomyFilterEnabled($value); break;
153  case 'order_tax': $this->setOrderingTaxonomyId($value); break;
154  }
155  }
156  }
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 266 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

Referenced by cloneToDbForTestId(), and saveToDb().

267  {
268  $this->db->insert('tst_dyn_quest_set_cfg', array(
269  'test_fi' => array('integer', $testId),
270  'source_qpl_fi' => array('integer', $this->getSourceQuestionPoolId()),
271  'source_qpl_title' => array('text', $this->getSourceQuestionPoolTitle()),
272  'answer_filter_enabled' => array('integer', $this->isAnswerStatusFilterEnabled()),
273  'tax_filter_enabled' => array('integer', $this->isTaxonomyFilterEnabled()),
274  'order_tax' => array('integer', $this->getOrderingTaxonomyId())
275  ));
276  }
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 520 of file class.ilObjTestDynamicQuestionSetConfig.php.

References isAnswerStatusFilterEnabled(), and isTaxonomyFilterEnabled().

521  {
522  if ($this->isTaxonomyFilterEnabled()) {
523  return true;
524  }
525 
526  if ($this->isAnswerStatusFilterEnabled()) {
527  return true;
528  }
529 
530  return false;
531  }
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 283 of file class.ilObjTestDynamicQuestionSetConfig.php.

References getSourceQuestionPoolId().

Referenced by doesQuestionSetRelatedDataExist().

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

516  {
517  return false;
518  }

◆ isTaxonomyFilterEnabled()

ilObjTestDynamicQuestionSetConfig::isTaxonomyFilterEnabled ( )

◆ isValidRequestOnBrokenQuestionSetDepencies()

ilObjTestDynamicQuestionSetConfig::isValidRequestOnBrokenQuestionSetDepencies (   $nextClass,
  $cmd 
)

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

437  {
438  //vd($nextClass, $cmd);
439 
440  if (!$this->testOBJ->participantDataExist()) {
441  return true;
442  }
443 
444  switch ($nextClass) {
445  case 'ilobjtestdynamicquestionsetconfiggui':
446 
447  case 'ilobjectmetadatagui':
448  case 'ilpermissiongui':
449 
450  return true;
451 
452  case 'ilobjtestgui':
453  case '':
454 
455  $cmds = array(
456  'infoScreen', 'participants', 'npSetFilter', 'npResetFilter',
457  'deleteAllUserResults', 'confirmDeleteAllUserResults',
458  'deleteSingleUserResults', 'confirmDeleteSelectedUserData', 'cancelDeleteSelectedUserData'
459  );
460 
461  if (in_array($cmd, $cmds)) {
462  return true;
463  }
464 
465  break;
466  }
467 
468  return false;
469  }

◆ loadFromDb()

ilObjTestDynamicQuestionSetConfig::loadFromDb ( )

loads the question set config for current test from the database

Returns
boolean

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

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

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

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

References deleteFromDb().

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

308  {
309  // nothing to do
310  }

◆ saveToDb()

ilObjTestDynamicQuestionSetConfig::saveToDb ( )

saves the question set config for current test to the database

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

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

184  {
185  if ($this->dbRecordExists($this->testOBJ->getTestId())) {
186  $this->updateDbRecord($this->testOBJ->getTestId());
187  } else {
188  $this->insertDbRecord($this->testOBJ->getTestId());
189  }
190  }
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 243 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

Referenced by saveToDb().

244  {
245  $this->db->update(
246  'tst_dyn_quest_set_cfg',
247  array(
248  'source_qpl_fi' => array('integer', $this->getSourceQuestionPoolId()),
249  'source_qpl_title' => array('text', $this->getSourceQuestionPoolTitle()),
250  'answer_filter_enabled' => array('integer', $this->isAnswerStatusFilterEnabled()),
251  'tax_filter_enabled' => array('integer', $this->isTaxonomyFilterEnabled()),
252  'order_tax' => array('integer', $this->getOrderingTaxonomyId())
253  ),
254  array(
255  'test_fi' => array('integer', $testId)
256  )
257  );
258  }
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: