ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 
 isPreviousQuestionsListEnabled ()
 
 setPreviousQuestionsListEnabled ($previousQuestionsListEnabled)
 
 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 ($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 ()
 
- 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 ($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
 
 $previousQuestionsListEnabled = 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 440 of file class.ilObjTestDynamicQuestionSetConfig.php.

441 {
442 if( !$this->getSourceQuestionPoolId() )
443 {
444 return false;
445 }
446
447 $poolRefs = $this->getSourceQuestionPoolRefIds();
448
449 if( count($poolRefs) )
450 {
451 return false;
452 }
453
454 return true;
455 }
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 411 of file class.ilObjTestDynamicQuestionSetConfig.php.

412 {
413 if( !$this->getSourceQuestionPoolId() )
414 {
415 return false;
416 }
417
418 $poolRefs = $this->getSourceQuestionPoolRefIds();
419
420 foreach( $poolRefs as $refId )
421 {
422 if( !$this->tree->isDeleted($refId) )
423 {
424 return false;
425 }
426 }
427
428 return true;
429 }

References getSourceQuestionPoolId(), and getSourceQuestionPoolRefIds().

+ Here is the call graph for this function:

◆ cloneQuestionSetRelatedData()

ilObjTestDynamicQuestionSetConfig::cloneQuestionSetRelatedData (   $cloneTestOBJ)

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

Parameters
ilObjTest$cloneTestOBJ

Reimplemented from ilTestQuestionSetConfig.

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

344 {
345 $this->loadFromDb();
346 $this->cloneToDbForTestId($cloneTestOBJ->getTestId());
347 }
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

References cloneToDbForTestId(), 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 224 of file class.ilObjTestDynamicQuestionSetConfig.php.

225 {
226 $this->insertDbRecord($testId);
227 }
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 250 of file class.ilObjTestDynamicQuestionSetConfig.php.

251 {
252 $res = $this->db->queryF(
253 "SELECT COUNT(*) cnt FROM tst_dyn_quest_set_cfg WHERE test_fi = %s",
254 array('integer'), array($testId)
255 );
256
257 $row = $this->db->fetchAssoc($res);
258
259 return (bool)$row['cnt'];
260 }

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

235 {
236 $aff = $this->db->manipulateF(
237 "DELETE FROM tst_dyn_quest_set_cfg WHERE test_fi = %s",
238 array('integer'), array($this->testOBJ->getTestId())
239 );
240
241 return (bool)$aff;
242 }

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

320 {
321 return $this->isQuestionSetConfigured();
322 }
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 457 of file class.ilObjTestDynamicQuestionSetConfig.php.

458 {
459 $msg = sprintf(
460 $lng->txt('tst_dyn_quest_set_pool_deleted'), $this->getSourceQuestionPoolTitle()
461 );
462
463 return $msg;
464 }
global $lng
Definition: privfeed.php:40

References $lng.

◆ getDepenciesInVulnerableStateMessage()

ilObjTestDynamicQuestionSetConfig::getDepenciesInVulnerableStateMessage ( ilLanguage  $lng)

Reimplemented from ilTestQuestionSetConfig.

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

432 {
433 $msg = sprintf(
434 $lng->txt('tst_dyn_quest_set_pool_trashed'), $this->getSourceQuestionPoolTitle()
435 );
436
437 return $msg;
438 }

References $lng.

◆ getHiddenTabsOnBrokenDepencies()

ilObjTestDynamicQuestionSetConfig::getHiddenTabsOnBrokenDepencies ( )

Reimplemented from ilTestQuestionSetConfig.

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

505 {
506 return array(
507 'settings', 'manscoring', 'scoringadjust', 'statistics', 'history', 'export'
508 );
509 }

◆ getOrderingTaxonomyId()

ilObjTestDynamicQuestionSetConfig::getOrderingTaxonomyId ( )

setter for ordering taxonomy id

Returns
integer $orderingTaxonomyId

Definition at line 129 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 527 of file class.ilObjTestDynamicQuestionSetConfig.php.

528 {
529 $query = "
530 SELECT obj_fi
531 FROM tst_dyn_quest_set_cfg
532 INNER JOIN tst_tests
533 ON tst_tests.test_id = tst_dyn_quest_set_cfg.test_fi
534 WHERE source_qpl_fi = %s
535 ";
536
537 $res = $db->queryF($query, array('integer'), array($poolObjId));
538
539 require_once 'Modules/Test/classes/class.ilDynamicTestQuestionChangeListener.php';
540 $questionChangeListener = new ilDynamicTestQuestionChangeListener($db);
541
542 while( $row = $db->fetchAssoc($res) )
543 {
544 $questionChangeListener->addTestObjId( $row['obj_fi'] );
545 }
546
547 return $questionChangeListener;
548 }

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

Referenced by ilObjTest\getPoolQuestionChangeListeners().

+ Here is the caller graph for this function:

◆ getSourceQuestionPoolId()

◆ getSourceQuestionPoolNumQuestions()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolNumQuestions ( )
private
Returns
integer

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

396 {
397 $query = "
398 SELECT COUNT(*) num from qpl_questions
399 WHERE obj_fi = %s AND original_id IS NULL
400 ";
401
402 $res = $this->db->queryF(
403 $query, array('integer'), array($this->getSourceQuestionPoolId())
404 );
405
406 $row = $this->db->fetchAssoc($res);
407
408 return $row['num'];
409 }

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

+ Here is the call graph for this function:

◆ getSourceQuestionPoolRefIds()

ilObjTestDynamicQuestionSetConfig::getSourceQuestionPoolRefIds ( )

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

514 {
515 if( $this->sourceQuestionPoolRefIds === null )
516 {
517 $this->sourceQuestionPoolRefIds = ilObject::_getAllReferences($this->getSourceQuestionPoolId());
518 }
519
521 }
static _getAllReferences($a_id)
get all reference ids of object

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

355 {
356 $poolRefs = $this->getSourceQuestionPoolRefIds();
357
358 if( !count($poolRefs) )
359 {
360 $sourceQuestionPoolSummaryString = sprintf(
361 $lng->txt('tst_dyn_quest_set_src_qpl_summary_string_deleted'),
362 $this->getSourceQuestionPoolTitle()
363 );
364
365 return $sourceQuestionPoolSummaryString;
366 }
367
368 foreach($poolRefs as $refId)
369 {
370 if( !$this->tree->isDeleted($refId) )
371 {
372 $sourceQuestionPoolSummaryString = sprintf(
373 $lng->txt('tst_dynamic_question_set_source_questionpool_summary_string'),
374 $this->getSourceQuestionPoolTitle(),
375 $this->getQuestionPoolPathString($this->getSourceQuestionPoolId()),
376 $this->getSourceQuestionPoolNumQuestions()
377 );
378
379 return $sourceQuestionPoolSummaryString;
380 }
381 }
382
383 $sourceQuestionPoolSummaryString = sprintf(
384 $lng->txt('tst_dyn_quest_set_src_qpl_summary_string_trashed'),
385 $this->getSourceQuestionPoolTitle(),
386 $this->getSourceQuestionPoolNumQuestions()
387 );
388
389 return $sourceQuestionPoolSummaryString;
390 }

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

74 {
75 return $this->sourceQuestionPoolTitle;
76 }

Referenced by 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 166 of file class.ilObjTestDynamicQuestionSetConfig.php.

167 {
168 foreach($dataArray as $field => $value)
169 {
170 switch($field)
171 {
172 case 'source_qpl_fi': $this->setSourceQuestionPoolId($value); break;
173 case 'source_qpl_title': $this->setSourceQuestionPoolTitle($value); break;
174 case 'answer_filter_enabled': $this->setAnswerStatusFilterEnabled($value); break;
175 case 'tax_filter_enabled': $this->setTaxonomyFilterEnabled($value); break;
176 case 'order_tax': $this->setOrderingTaxonomyId($value); break;
177 case 'prev_quest_list_enabled': $this->setPreviousQuestionsListEnabled($value); break;
178 }
179 }
180 }
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(), setPreviousQuestionsListEnabled(), 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 291 of file class.ilObjTestDynamicQuestionSetConfig.php.

292 {
293 $this->db->insert('tst_dyn_quest_set_cfg', array(
294 'test_fi' => array('integer', $testId),
295 'source_qpl_fi' => array('integer', $this->getSourceQuestionPoolId()),
296 'source_qpl_title' => array('text', $this->getSourceQuestionPoolTitle()),
297 'answer_filter_enabled' => array('integer', $this->isAnswerStatusFilterEnabled()),
298 'tax_filter_enabled' => array('integer', $this->isTaxonomyFilterEnabled()),
299 'order_tax' => array('integer', $this->getOrderingTaxonomyId()),
300 'prev_quest_list_enabled' => array('integer', $this->isPreviousQuestionsListEnabled())
301 ));
302 }
getSourceQuestionPoolTitle()
getter for source question pool title
isTaxonomyFilterEnabled()
isser for taxonomie filter enabled

References getOrderingTaxonomyId(), getSourceQuestionPoolId(), getSourceQuestionPoolTitle(), isAnswerStatusFilterEnabled(), isPreviousQuestionsListEnabled(), 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 555 of file class.ilObjTestDynamicQuestionSetConfig.php.

556 {
557 if( $this->isTaxonomyFilterEnabled() )
558 {
559 return true;
560 }
561
562 if( $this->isAnswerStatusFilterEnabled() )
563 {
564 return true;
565 }
566
567 return false;
568 }

References isAnswerStatusFilterEnabled(), and isTaxonomyFilterEnabled().

+ Here is the call graph for this function:

◆ isPreviousQuestionsListEnabled()

ilObjTestDynamicQuestionSetConfig::isPreviousQuestionsListEnabled ( )
Returns
boolean

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

References $previousQuestionsListEnabled.

Referenced by insertDbRecord(), and updateDbRecord().

+ Here is the caller 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 309 of file class.ilObjTestDynamicQuestionSetConfig.php.

310 {
311 return $this->getSourceQuestionPoolId() > 0;
312 }

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

551 {
552 return false;
553 }

◆ isTaxonomyFilterEnabled()

ilObjTestDynamicQuestionSetConfig::isTaxonomyFilterEnabled ( )

isser for taxonomie filter enabled

Returns
boolean

Definition at line 109 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 466 of file class.ilObjTestDynamicQuestionSetConfig.php.

467 {
468 //vd($nextClass, $cmd);
469
470 if( !$this->testOBJ->participantDataExist() )
471 {
472 return true;
473 }
474
475 switch( $nextClass )
476 {
477 case 'ilobjtestdynamicquestionsetconfiggui':
478
479 case 'ilmdeditorgui':
480 case 'ilpermissiongui':
481
482 return true;
483
484 case 'ilobjtestgui':
485 case '':
486
487 $cmds = array(
488 'infoScreen', 'participants', 'npSetFilter', 'npResetFilter',
489 'deleteAllUserResults', 'confirmDeleteAllUserResults',
490 'deleteSingleUserResults', 'confirmDeleteSelectedUserData', 'cancelDeleteSelectedUserData'
491 );
492
493 if( in_array($cmd, $cmds) )
494 {
495 return true;
496 }
497
498 break;
499 }
500
501 return false;
502 }
$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 187 of file class.ilObjTestDynamicQuestionSetConfig.php.

188 {
189 $res = $this->db->queryF(
190 "SELECT * FROM tst_dyn_quest_set_cfg WHERE test_fi = %s",
191 array('integer'), array($this->testOBJ->getTestId())
192 );
193
194 while( $row = $this->db->fetchAssoc($res) )
195 {
196 $this->initFromArray($row);
197
198 return true;
199 }
200
201 return false;
202 }
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 328 of file class.ilObjTestDynamicQuestionSetConfig.php.

329 {
330 $this->deleteFromDb();
331 }
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 333 of file class.ilObjTestDynamicQuestionSetConfig.php.

334 {
335 // nothing to do
336 }

◆ saveToDb()

ilObjTestDynamicQuestionSetConfig::saveToDb ( )

saves the question set config for current test to the database

Reimplemented from ilTestQuestionSetConfig.

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

208 {
209 if( $this->dbRecordExists($this->testOBJ->getTestId()) )
210 {
211 $this->updateDbRecord($this->testOBJ->getTestId());
212 }
213 else
214 {
215 $this->insertDbRecord($this->testOBJ->getTestId());
216 }
217 }
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 99 of file class.ilObjTestDynamicQuestionSetConfig.php.

100 {
101 $this->answerStatusFilterEnabled = $answerStatusFilterEnabled;
102 }

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

140 {
141 $this->orderingTaxonomyId = $orderingTaxonomyId;
142 }

References $orderingTaxonomyId.

Referenced by initFromArray().

+ Here is the caller graph for this function:

◆ setPreviousQuestionsListEnabled()

ilObjTestDynamicQuestionSetConfig::setPreviousQuestionsListEnabled (   $previousQuestionsListEnabled)
Parameters
boolean$previousQuestionsListEnabled

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

156 {
157 $this->previousQuestionsListEnabled = $previousQuestionsListEnabled;
158 }

References $previousQuestionsListEnabled.

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

64 {
65 $this->sourceQuestionPoolId = (int)$sourceQuestionPoolId;
66 }

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

84 {
85 $this->sourceQuestionPoolTitle = $sourceQuestionPoolTitle;
86 }

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

120 {
121 $this->taxonomyFilterEnabled = (bool)$taxonomyFilterEnabled;
122 }

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

269 {
270 $this->db->update('tst_dyn_quest_set_cfg',
271 array(
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 'prev_quest_list_enabled' => array('integer', $this->isPreviousQuestionsListEnabled())
278 ),
279 array(
280 'test_fi' => array('integer', $testId)
281 )
282 );
283 }

References getOrderingTaxonomyId(), getSourceQuestionPoolId(), getSourceQuestionPoolTitle(), isAnswerStatusFilterEnabled(), isPreviousQuestionsListEnabled(), 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

◆ $previousQuestionsListEnabled

ilObjTestDynamicQuestionSetConfig::$previousQuestionsListEnabled = 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: