ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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, ilDB $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
 
 loadFromDb ()
 loads the question set config for current test from the database More...
 
 saveToDb ()
 saves the question set config for current test to the database More...
 
 cloneToDbForTestId ($testId)
 saves the question set config for test with given id to the database More...
 
 deleteFromDb ()
 deletes the question set config for current test from the database More...
 
 areDepenciesInVulnerableState ()
 
 getDepenciesInVulnerableStateMessage (ilLanguage $lng)
 
 areDepenciesBroken ()
 
 getDepenciesBrokenMessage (ilLanguage $lng)
 
 isValidRequestOnBrokenQuestionSetDepencies ($nextClass, $cmd)
 
 getHiddenTabsOnBrokenDepencies ()
 
 isQuestionSetConfigured ()
 
 doesQuestionSetRelatedDataExist ()
 checks wether question set config related data exists or not More...
 
 removeQuestionSetRelatedData ()
 removes all question set config related data More...
 
 resetQuestionSetRelatedTestSettings ()
 resets all test settings that depends on a non changed question set config More...
 
 cloneQuestionSetRelatedData (ilObjTest $cloneTestOBJ)
 removes all question set config related data for cloned/copied test More...
 
 getQuestionPoolPathString ($poolId)
 
 isResultTaxonomyFilterSupported ()
 

Static Public Member Functions

static getPoolQuestionChangeListener (ilDB $db, $poolObjId)
 

Private Member Functions

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

Private Attributes

 $sourceQuestionPoolId = null
 
 $answerStatusFilterEnabled = null
 
 $taxonomyFilterEnabled = null
 
 $orderingTaxonomyId = null
 
 $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 416 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

References getSourceQuestionPoolId(), and getSourceQuestionPoolRefIds().

+ Here is the call graph for this function:

◆ areDepenciesInVulnerableState()

ilObjTestDynamicQuestionSetConfig::areDepenciesInVulnerableState ( )

Reimplemented from ilTestQuestionSetConfig.

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

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 }

References 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 319 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

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

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 }

References $res, and $row.

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

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 }

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

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

434 {
435 $msg = sprintf(
436 $lng->txt('tst_dyn_quest_set_pool_deleted'), $this->getSourceQuestionPoolTitle()
437 );
438
439 return $msg;
440 }
global $lng
Definition: privfeed.php:40

References $lng.

◆ getDepenciesInVulnerableStateMessage()

ilObjTestDynamicQuestionSetConfig::getDepenciesInVulnerableStateMessage ( ilLanguage  $lng)

Reimplemented from ilTestQuestionSetConfig.

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

408 {
409 $msg = sprintf(
410 $lng->txt('tst_dyn_quest_set_pool_trashed'), $this->getSourceQuestionPoolTitle()
411 );
412
413 return $msg;
414 }

References $lng.

◆ getHiddenTabsOnBrokenDepencies()

ilObjTestDynamicQuestionSetConfig::getHiddenTabsOnBrokenDepencies ( )

Reimplemented from ilTestQuestionSetConfig.

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

481 {
482 return array(
483 'settings', 'manscoring', 'scoringadjust', 'statistics', 'history', 'export'
484 );
485 }

◆ 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 ( ilDB  $db,
  $poolObjId 
)
static
Parameters
integer$poolObjId
Returns
\ilDynamicTestQuestionChangeListener

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

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 }

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

Referenced by ilObjTest\getPoolQuestionChangeListeners().

+ Here is the caller graph for this function:

◆ getSourceQuestionPoolId()

◆ getSourceQuestionPoolLink()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolLink ( )

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

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

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

+ Here is the call graph for this function:

◆ getSourceQuestionPoolNumQuestions()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolNumQuestions ( )
private
Returns
integer

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

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 }

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

+ Here is the call graph for this function:

◆ getSourceQuestionPoolRefIds()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolRefIds ( )

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

490 {
491 if( $this->sourceQuestionPoolRefIds === null )
492 {
493 $this->sourceQuestionPoolRefIds = ilObject::_getAllReferences($this->getSourceQuestionPoolId());
494 }
495
497 }

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

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'),
338 $this->getSourceQuestionPoolTitle()
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'),
350 $this->getSourceQuestionPoolTitle(),
351 $this->getQuestionPoolPathString($this->getSourceQuestionPoolId()),
352 $this->getSourceQuestionPoolNumQuestions()
353 );
354
355 return $sourceQuestionPoolSummaryString;
356 }
357 }
358
359 $sourceQuestionPoolSummaryString = sprintf(
360 $lng->txt('tst_dyn_quest_set_src_qpl_summary_string_trashed'),
361 $this->getSourceQuestionPoolTitle(),
362 $this->getSourceQuestionPoolNumQuestions()
363 );
364
365 return $sourceQuestionPoolSummaryString;
366 }

References $lng, 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 {
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
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 268 of file class.ilObjTestDynamicQuestionSetConfig.php.

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

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

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 }

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

286 {
287 return $this->getSourceQuestionPoolId() > 0;
288 }

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

527 {
528 return false;
529 }

◆ isTaxonomyFilterEnabled()

ilObjTestDynamicQuestionSetConfig::isTaxonomyFilterEnabled ( )

isser for taxonomie filter enabled

Returns
boolean

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

References $taxonomyFilterEnabled.

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

+ Here is the caller graph for this function:

◆ isValidRequestOnBrokenQuestionSetDepencies()

ilObjTestDynamicQuestionSetConfig::isValidRequestOnBrokenQuestionSetDepencies (   $nextClass,
  $cmd 
)

Reimplemented from ilTestQuestionSetConfig.

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

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

References $cmd.

◆ loadFromDb()

ilObjTestDynamicQuestionSetConfig::loadFromDb ( )

loads the question set config for current test from the database

Returns
boolean

Reimplemented from ilTestQuestionSetConfig.

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

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

References $res, $row, 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 304 of file class.ilObjTestDynamicQuestionSetConfig.php.

305 {
306 $this->deleteFromDb();
307 }
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 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

Reimplemented from ilTestQuestionSetConfig.

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

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

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 }

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: