ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ()
 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...
 
 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 ( )

Reimplemented from ilTestQuestionSetConfig.

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

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

References getSourceQuestionPoolId(), and getSourceQuestionPoolRefIds().

+ Here is the call graph for this function:

◆ areDepenciesInVulnerableState()

ilObjTestDynamicQuestionSetConfig::areDepenciesInVulnerableState ( )

Reimplemented from ilTestQuestionSetConfig.

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

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 }
$refId
Definition: xapitoken.php:42

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

+ 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

Reimplemented from ilTestQuestionSetConfig.

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

318 {
319 $this->loadFromDb();
320 $this->cloneToDbForTestId($cloneTestOBJ->getTestId());
321 }
cloneToDbForTestId($testId)
saves the question set config for test with given id to the database
loadFromDb()
loads the question set config for current test from the database
getTestId()
Gets the database id of the additional test data.

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

+ 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

Reimplemented from ilTestQuestionSetConfig.

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

198 {
199 $this->insertDbRecord($testId);
200 }
insertDbRecord($testId)
inserts a new record for the question set config for the current test into the database

References insertDbRecord().

Referenced by cloneQuestionSetRelatedData().

+ 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.

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

References $res.

Referenced by saveToDb().

+ Here is the caller graph for this function:

◆ deleteFromDb()

ilObjTestDynamicQuestionSetConfig::deleteFromDb ( )

deletes the question set config for current test from the database

Returns
boolean

Reimplemented from ilTestQuestionSetConfig.

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

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 }

Referenced by removeQuestionSetRelatedData().

+ 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

Reimplemented from ilTestQuestionSetConfig.

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

294 {
295 return $this->isQuestionSetConfigured();
296 }
isQuestionSetConfigured()
returns the fact wether a useable question set config exists or not

References isQuestionSetConfigured().

+ Here is the call graph for this function:

◆ getDepenciesBrokenMessage()

ilObjTestDynamicQuestionSetConfig::getDepenciesBrokenMessage ( ilLanguage  $lng)

Reimplemented from ilTestQuestionSetConfig.

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

427 {
428 $msg = sprintf(
429 $lng->txt('tst_dyn_quest_set_pool_deleted'),
430 $this->getSourceQuestionPoolTitle()
431 );
432
433 return $msg;
434 }
$lng

References $lng.

◆ getDepenciesInVulnerableStateMessage()

ilObjTestDynamicQuestionSetConfig::getDepenciesInVulnerableStateMessage ( ilLanguage  $lng)

Reimplemented from ilTestQuestionSetConfig.

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

402 {
403 $msg = sprintf(
404 $lng->txt('tst_dyn_quest_set_pool_trashed'),
405 $this->getSourceQuestionPoolTitle()
406 );
407
408 return $msg;
409 }

References $lng.

◆ getHiddenTabsOnBrokenDepencies()

ilObjTestDynamicQuestionSetConfig::getHiddenTabsOnBrokenDepencies ( )

Reimplemented from ilTestQuestionSetConfig.

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
\ilDynamicTestQuestionChangeListener

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

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 }
$query

References ilTestQuestionSetConfig\$db, $query, and $res.

Referenced by ilObjTest\getPoolQuestionChangeListeners().

+ Here is the caller graph for this function:

◆ getSourceQuestionPoolId()

◆ getSourceQuestionPoolLink()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolLink ( )

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

534 {
536 $href = ilLink::_getLink($refId, 'qpl');
537 $title = $this->getSourceQuestionPoolTitle();
538
539 return "<a href=\"$href\" alt=\"$title\">$title</a>";
540 }
getSourceQuestionPoolTitle()
getter for source question pool title
static _getAllReferences($a_id)
get all reference ids of object

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

+ Here is the call graph for this function:

◆ getSourceQuestionPoolNumQuestions()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolNumQuestions ( )
private
Returns
integer

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

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 }

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

+ Here is the call graph for this function:

◆ getSourceQuestionPoolRefIds()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolRefIds ( )

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

481 {
482 if ($this->sourceQuestionPoolRefIds === null) {
483 $this->sourceQuestionPoolRefIds = ilObject::_getAllReferences($this->getSourceQuestionPoolId());
484 }
485
487 }

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

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

+ 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.

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'),
335 $this->getSourceQuestionPoolTitle()
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'),
345 $this->getSourceQuestionPoolTitle(),
346 $this->getQuestionPoolPathString($this->getSourceQuestionPoolId()),
347 $this->getSourceQuestionPoolNumQuestions()
348 );
349
350 return $sourceQuestionPoolSummaryString;
351 }
352 }
353
354 $sourceQuestionPoolSummaryString = sprintf(
355 $lng->txt('tst_dyn_quest_set_src_qpl_summary_string_trashed'),
356 $this->getSourceQuestionPoolTitle(),
357 $this->getSourceQuestionPoolNumQuestions()
358 );
359
360 return $sourceQuestionPoolSummaryString;
361 }

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

+ 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.

69 {
70 return $this->sourceQuestionPoolTitle;
71 }

Referenced by getSourceQuestionPoolLink(), insertDbRecord(), and updateDbRecord().

+ 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.

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
setSourceQuestionPoolId($sourceQuestionPoolId)
getter for source question pool id
setOrderingTaxonomyId($orderingTaxonomyId)
getter for ordering taxonomy id
setSourceQuestionPoolTitle($sourceQuestionPoolTitle)
getter for source question pool title

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

Referenced by loadFromDb().

+ 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.

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

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

Referenced by cloneToDbForTestId(), and saveToDb().

+ 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.

521 {
522 if ($this->isTaxonomyFilterEnabled()) {
523 return true;
524 }
525
526 if ($this->isAnswerStatusFilterEnabled()) {
527 return true;
528 }
529
530 return false;
531 }

References isAnswerStatusFilterEnabled(), and isTaxonomyFilterEnabled().

+ 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

Reimplemented from ilTestQuestionSetConfig.

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

284 {
285 return $this->getSourceQuestionPoolId() > 0;
286 }

References getSourceQuestionPoolId().

Referenced by doesQuestionSetRelatedDataExist().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isResultTaxonomyFilterSupported()

ilObjTestDynamicQuestionSetConfig::isResultTaxonomyFilterSupported ( )

Reimplemented from ilTestQuestionSetConfig.

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

516 {
517 return false;
518 }

◆ isTaxonomyFilterEnabled()

ilObjTestDynamicQuestionSetConfig::isTaxonomyFilterEnabled ( )

◆ isValidRequestOnBrokenQuestionSetDepencies()

ilObjTestDynamicQuestionSetConfig::isValidRequestOnBrokenQuestionSetDepencies (   $nextClass,
  $cmd 
)

Reimplemented from ilTestQuestionSetConfig.

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

Reimplemented from ilTestQuestionSetConfig.

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

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

References $res, and initFromArray().

Referenced by cloneQuestionSetRelatedData().

+ 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)

Reimplemented from ilTestQuestionSetConfig.

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

303 {
304 $this->deleteFromDb();
305 }
deleteFromDb()
deletes the question set config for current test from the database

References deleteFromDb().

+ Here is the call graph for this function:

◆ resetQuestionSetRelatedTestSettings()

ilObjTestDynamicQuestionSetConfig::resetQuestionSetRelatedTestSettings ( )

resets all test settings that depends on a non changed question set config

Reimplemented from ilTestQuestionSetConfig.

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

Reimplemented from ilTestQuestionSetConfig.

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

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
dbRecordExists($testId)
checks wether a question set config for current test exists in the database

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

+ Here is the call graph for this function:

◆ setAnswerStatusFilterEnabled()

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

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

95 {
96 $this->answerStatusFilterEnabled = $answerStatusFilterEnabled;
97 }

References $answerStatusFilterEnabled.

Referenced by initFromArray().

+ 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.

135 {
136 $this->orderingTaxonomyId = $orderingTaxonomyId;
137 }

References $orderingTaxonomyId.

Referenced by initFromArray().

+ 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.

59 {
60 $this->sourceQuestionPoolId = (int) $sourceQuestionPoolId;
61 }

References $sourceQuestionPoolId.

Referenced by initFromArray().

+ 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.

79 {
80 $this->sourceQuestionPoolTitle = $sourceQuestionPoolTitle;
81 }

Referenced by initFromArray().

+ 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.

115 {
116 $this->taxonomyFilterEnabled = (bool) $taxonomyFilterEnabled;
117 }

References $taxonomyFilterEnabled.

Referenced by initFromArray().

+ 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.

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 }

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

Referenced by saveToDb().

+ 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: