40 #private $originalFilterTaxId = null;
42 #private $originalFilterTaxNodeId = null;
44 #private $mappedFilterTaxId = null;
46 #private $mappedFilterTaxNodeId = null;
151 $this->originalTaxonomyFilter = $filter;
161 return empty($this->originalTaxonomyFilter) ? null : serialize($this->originalTaxonomyFilter);
171 $this->originalTaxonomyFilter = empty($value) ? array() : unserialize($value);
189 $this->mappedTaxonomyFilter = $filter;
198 return empty($this->mappedTaxonomyFilter) ? null : serialize($this->mappedTaxonomyFilter);
207 $this->mappedTaxonomyFilter = empty($value) ? array() : unserialize($value);
217 $this->mappedTaxonomyFilter = array();
218 foreach ($this->originalTaxonomyFilter as $taxId => $nodeIds) {
219 $mappedNodeIds = array();
220 foreach ($nodeIds as $nodeId) {
223 $this->mappedTaxonomyFilter[$taxonomiesKeysMap->
getMappedTaxonomyId($taxId)] = $mappedNodeIds;
243 return empty($this->typeFilter) ? null : serialize($this->typeFilter);
252 $this->typeFilter = empty($value) ? array() : unserialize($value);
324 foreach ($dataArray as $field => $value) {
326 case 'def_id': $this->
setId($value);
break;
327 case 'pool_fi': $this->
setPoolId($value);
break;
328 case 'pool_ref_id': $this->
setPoolRefId($value ? (
int) $value :
null);
break;
330 case 'pool_path': $this->
setPoolPath($value);
break;
333 #case 'origin_tax_fi': $this->setOriginalFilterTaxId($value); break;
334 #case 'origin_node_fi': $this->setOriginalFilterTaxNodeId($value); break;
335 #case 'mapped_tax_fi': $this->setMappedFilterTaxId($value); break;
336 #case 'mapped_node_fi': $this->setMappedFilterTaxNodeId($value); break;
353 $res = $this->db->queryF(
354 "SELECT * FROM tst_rnd_quest_set_qpls WHERE def_id = %s",
359 while (
$row = $this->db->fetchAssoc(
$res)) {
370 if ($this->
getId()) {
384 $this->db->manipulateF(
385 "DELETE FROM tst_rnd_quest_set_qpls WHERE def_id = %s",
387 array($this->
getId())
397 'tst_rnd_quest_set_qpls',
399 'test_fi' => array(
'integer', $testId),
400 'pool_fi' => array(
'integer', $this->
getPoolId()),
401 'pool_ref_id' => array(
'integer', $this->
getPoolRefId()),
403 'pool_path' => array(
'text', $this->
getPoolPath()),
406 #
'origin_tax_fi' => array(
'integer', $this->getOriginalFilterTaxId()),
407 #
'origin_node_fi' => array(
'integer', $this->getOriginalFilterTaxNodeId()),
408 #
'mapped_tax_fi' => array(
'integer', $this->getMappedFilterTaxId()),
409 #
'mapped_node_fi' => array(
'integer', $this->getMappedFilterTaxNodeId()),
418 'def_id' => array(
'integer', $this->
getId())
428 $nextId = $this->db->nextId(
'tst_rnd_quest_set_qpls');
430 $this->db->insert(
'tst_rnd_quest_set_qpls', array(
431 'def_id' => array(
'integer', $nextId),
432 'test_fi' => array(
'integer', $testId),
433 'pool_fi' => array(
'integer', $this->
getPoolId()),
434 'pool_ref_id' => array(
'integer', $this->
getPoolRefId()),
436 'pool_path' => array(
'text', $this->
getPoolPath()),
439 #
'origin_tax_fi' => array(
'integer', $this->getOriginalFilterTaxId()),
440 #
'origin_node_fi' => array(
'integer', $this->getOriginalFilterTaxNodeId()),
441 #
'mapped_tax_fi' => array(
'integer', $this->getMappedFilterTaxId()),
442 #
'mapped_node_fi' => array(
'integer', $this->getMappedFilterTaxNodeId()),
451 $this->
setId($nextId);
461 $path->enableTextOnly(
true);
465 $poolInfoLabel = sprintf(
466 $lng->txt(
'tst_dynamic_question_set_source_questionpool_summary_string'),
467 $this->getPoolTitle(),
469 $this->getPoolQuestionCount()
472 return $poolInfoLabel;
An exception for terminatinating execution or to throw for unit testing.
static _lookupObjId($a_id)
Creates a path for a start and endnode.
getMappedTaxonomyId($originalTaxonomyId)
getMappedTaxNodeId($originalTaxNodeId)
setQuestionAmount($questionAmount)
getMappedTaxonomyFilter()
get the mapped taxonomy filter conditions
setPoolQuestionCount($poolQuestionCount)
getOriginalTaxonomyFilterForDbValue()
get the original taxonomy filter for insert into the database
setTypeFilterFromDbValue($value)
get the question type filter from database value
setSequencePosition($sequencePosition)
initFromArray($dataArray)
mapTaxonomyFilter(ilQuestionPoolDuplicatedTaxonomiesKeysMap $taxonomiesKeysMap)
set the mapped taxonomy filter from original by applying a keys map
setOriginalTaxonomyFilter($filter=array())
set the original taxonomy filter condition
setMappedTaxonomyFilter($filter=array())
set the original taxonomy filter condition
cloneToDbForTestId($testId)
setTypeFilter($typeFilter=array())
getMappedTaxonomyFilterForDbValue()
get the original taxonomy filter for insert into the database
__construct(ilDBInterface $db, ilObjTest $testOBJ)
setOriginalTaxonomyFilterFromDbValue($value)
get the original taxonomy filter from database value
setMappedTaxonomyFilterFromDbValue($value)
get the original taxonomy filter from database value
setPoolRefId(?int $poolRefId)
getPoolInfoLabel(ilLanguage $lng)
getOriginalTaxonomyFilter()
get the original taxonomy filter conditions
getTypeFilterForDbValue()
get the question type filter for insert into the database
foreach($_POST as $key=> $value) $res