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'),
472 return $poolInfoLabel;
initFromArray($dataArray)
Creates a path for a start and endnode.
setOriginalTaxonomyFilter($filter=array())
set the original taxonomy filter condition
getPoolInfoLabel(ilLanguage $lng)
setOriginalTaxonomyFilterFromDbValue($value)
get the original taxonomy filter from database value
getMappedTaxonomyId($originalTaxonomyId)
setPoolRefId(?int $poolRefId)
setQuestionAmount($questionAmount)
__construct(ilDBInterface $db, ilObjTest $testOBJ)
setMappedTaxonomyFilterFromDbValue($value)
get the original taxonomy filter from database value
setTypeFilterFromDbValue($value)
get the question type filter from database value
setMappedTaxonomyFilter($filter=array())
set the original taxonomy filter condition
foreach($_POST as $key=> $value) $res
getOriginalTaxonomyFilterForDbValue()
get the original taxonomy filter for insert into the database
setPoolQuestionCount($poolQuestionCount)
static _lookupObjId($a_id)
getMappedTaxNodeId($originalTaxNodeId)
cloneToDbForTestId($testId)
mapTaxonomyFilter(ilQuestionPoolDuplicatedTaxonomiesKeysMap $taxonomiesKeysMap)
set the mapped taxonomy filter from original by applying a keys map
setTypeFilter($typeFilter=array())
setSequencePosition($sequencePosition)
getTypeFilterForDbValue()
get the question type filter for insert into the database
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...
getMappedTaxonomyFilterForDbValue()
get the original taxonomy filter for insert into the database
getMappedTaxonomyFilter()
get the mapped taxonomy filter conditions
getOriginalTaxonomyFilter()
get the original taxonomy filter conditions