ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAssQuestionList Class Reference
+ Inheritance diagram for ilAssQuestionList:
+ Collaboration diagram for ilAssQuestionList:

Public Member Functions

 __construct (ilDBInterface $db, ilLanguage $lng, ilPluginAdmin $pluginAdmin)
 Constructor. More...
 
 getParentObjId ()
 
 setParentObjId ($parentObjId)
 
 getParentObjectType ()
 
 setParentObjectType ($parentObjType)
 
 getParentObjIdsFilter ()
 
 setParentObjIdsFilter ($parentObjIdsFilter)
 
 setQuestionInstanceTypeFilter ($questionInstanceTypeFilter)
 
 getQuestionInstanceTypeFilter ()
 
 setIncludeQuestionIdsFilter ($questionIdsFilter)
 
 getIncludeQuestionIdsFilter ()
 
 getExcludeQuestionIdsFilter ()
 
 setExcludeQuestionIdsFilter ($excludeQuestionIdsFilter)
 
 getQuestionCompletionStatusFilter ()
 
 setQuestionCompletionStatusFilter ($questionCompletionStatusFilter)
 
 addFieldFilter ($fieldName, $fieldValue)
 
 addTaxonomyFilter ($taxId, $taxNodes, $parentObjId, $parentObjType)
 
 setAvailableTaxonomyIds ($availableTaxonomyIds)
 
 getAvailableTaxonomyIds ()
 
 setAnswerStatusActiveId ($answerStatusActiveId)
 
 getAnswerStatusActiveId ()
 
 setAnswerStatusFilter ($answerStatusFilter)
 
 getAnswerStatusFilter ()
 
 setJoinObjectData ($a_val)
 Set if object data table should be joined. More...
 
 getJoinObjectData ()
 Get if object data table should be joined. More...
 
 setForcedQuestionIds ($forcedQuestionIds)
 
 getForcedQuestionIds ()
 
 load ()
 
 getDataArrayForQuestionId ($questionId)
 
 getQuestionDataArray ()
 
 isInList ($questionId)
 
 getTitle ($a_comp_id, $a_item_type, $a_item_id)
 Get title of an assigned item. More...
 

Data Fields

const QUESTION_ANSWER_STATUS_NON_ANSWERED = 'nonAnswered'
 answer status domain for single questions More...
 
const QUESTION_ANSWER_STATUS_WRONG_ANSWERED = 'wrongAnswered'
 
const QUESTION_ANSWER_STATUS_CORRECT_ANSWERED = 'correctAnswered'
 
const ANSWER_STATUS_FILTER_ALL_NON_CORRECT = 'allNonCorrect'
 answer status filter value domain More...
 
const ANSWER_STATUS_FILTER_NON_ANSWERED_ONLY = 'nonAnswered'
 
const ANSWER_STATUS_FILTER_WRONG_ANSWERED_ONLY = 'wrongAnswered'
 
const QUESTION_INSTANCE_TYPE_ORIGINALS = 'QST_INSTANCE_TYPE_ORIGINALS'
 
const QUESTION_INSTANCE_TYPE_DUPLICATES = 'QST_INSTANCE_TYPE_DUPLICATES'
 
const QUESTION_COMPLETION_STATUS_COMPLETE = 'complete'
 
const QUESTION_COMPLETION_STATUS_INCOMPLETE = 'incomplete'
 
const QUESTION_COMPLETION_STATUS_BOTH = 'complete/incomplete'
 

Protected Member Functions

 getTaxItems ($parentType, $parentObjId, $taxId, $taxNode)
 

Protected Attributes

 $db = null
 
 $join_obj_data = true
 
 $questions = array()
 

Private Member Functions

 getParentObjFilterExpression ()
 
 getFieldFilterExpressions ()
 
 getTaxonomyFilterExpressions ()
 
 getQuestionInstanceTypeFilterExpression ()
 
 getQuestionIdsFilterExpressions ()
 
 getParentObjectIdFilterExpression ()
 
 getAnswerStatusFilterExpressions ()
 
 getTableJoinExpression ()
 
 getConditionalFilterExpression ()
 
 getSelectFieldsExpression ()
 
 buildBasicQuery ()
 
 buildQuery ()
 
 loadTaxonomyAssignmentData ($parentObjId, $questionId)
 
 isActiveQuestionType ($questionData)
 
 checkFilters ()
 

Private Attributes

 $lng = null
 
 $pluginAdmin = null
 
 $parentObjIdsFilter = array()
 
 $parentObjId = null
 
 $parentObjType = 'qpl'
 
 $availableTaxonomyIds = array()
 
 $fieldFilters = array()
 
 $taxFilters = array()
 
 $taxParentIds = array()
 
 $taxParentTypes = array()
 
 $answerStatusActiveId = null
 
 $forcedQuestionIds = array()
 
 $answerStatusFilter = null
 
 $questionInstanceTypeFilter = self::QUESTION_INSTANCE_TYPE_ORIGINALS
 
 $includeQuestionIdsFilter = null
 
 $excludeQuestionIdsFilter = null
 
 $questionCompletionStatusFilter = self::QUESTION_COMPLETION_STATUS_BOTH
 

Detailed Description

Definition at line 16 of file class.ilAssQuestionList.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionList::__construct ( ilDBInterface  $db,
ilLanguage  $lng,
ilPluginAdmin  $pluginAdmin 
)

Constructor.

Parameters
ilDBInterface$db
ilLanguage$lng
ilPluginAdmin$pluginAdmin

Definition at line 161 of file class.ilAssQuestionList.php.

References $db, $lng, and $pluginAdmin.

162  {
163  $this->db = $db;
164  $this->lng = $lng;
165  $this->pluginAdmin = $pluginAdmin;
166  }

Member Function Documentation

◆ addFieldFilter()

ilAssQuestionList::addFieldFilter (   $fieldName,
  $fieldValue 
)

Definition at line 244 of file class.ilAssQuestionList.php.

245  {
246  $this->fieldFilters[$fieldName] = $fieldValue;
247  }

◆ addTaxonomyFilter()

ilAssQuestionList::addTaxonomyFilter (   $taxId,
  $taxNodes,
  $parentObjId,
  $parentObjType 
)

Definition at line 249 of file class.ilAssQuestionList.php.

References $parentObjId, and $parentObjType.

250  {
251  $this->taxFilters[$taxId] = $taxNodes;
252  $this->taxParentIds[$taxId] = $parentObjId;
253  $this->taxParentTypes[$taxId] = $parentObjType;
254  }

◆ buildBasicQuery()

ilAssQuestionList::buildBasicQuery ( )
private

Definition at line 605 of file class.ilAssQuestionList.php.

Referenced by buildQuery().

606  {
607  return "
608  {$this->getSelectFieldsExpression()}
609 
610  FROM qpl_questions
611 
612  {$this->getTableJoinExpression()}
613 
614  WHERE qpl_questions.tstamp > 0
615  ";
616  }
+ Here is the caller graph for this function:

◆ buildQuery()

ilAssQuestionList::buildQuery ( )
private

Definition at line 618 of file class.ilAssQuestionList.php.

References $query, buildBasicQuery(), and getForcedQuestionIds().

Referenced by load().

619  {
620  $query = $this->buildBasicQuery() . "
621  {$this->getConditionalFilterExpression()}
622  ";
623 
624  if (count($this->getForcedQuestionIds())) {
625  $query .= "
626  UNION {$this->buildBasicQuery()}
627  AND {$this->db->in('qpl_questions.question_id', $this->getForcedQuestionIds(), false, 'integer')}
628  ";
629  }
630 
631  return $query;
632  }
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkFilters()

ilAssQuestionList::checkFilters ( )
private

Definition at line 743 of file class.ilAssQuestionList.php.

References getAnswerStatusActiveId(), and getAnswerStatusFilter().

Referenced by load().

744  {
745  if (strlen($this->getAnswerStatusFilter()) && !$this->getAnswerStatusActiveId()) {
746  require_once 'Modules/TestQuestionPool/exceptions/class.ilTestQuestionPoolException.php';
747 
748  throw new ilTestQuestionPoolException(
749  'No active id given! You cannot use the answer status filter without giving an active id.'
750  );
751  }
752  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAnswerStatusActiveId()

ilAssQuestionList::getAnswerStatusActiveId ( )

Definition at line 271 of file class.ilAssQuestionList.php.

References $answerStatusActiveId.

Referenced by checkFilters(), getSelectFieldsExpression(), and getTableJoinExpression().

272  {
274  }
+ Here is the caller graph for this function:

◆ getAnswerStatusFilter()

ilAssQuestionList::getAnswerStatusFilter ( )

Definition at line 281 of file class.ilAssQuestionList.php.

References $answerStatusFilter.

Referenced by checkFilters(), and getAnswerStatusFilterExpressions().

282  {
284  }
+ Here is the caller graph for this function:

◆ getAnswerStatusFilterExpressions()

ilAssQuestionList::getAnswerStatusFilterExpressions ( )
private

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

References array, and getAnswerStatusFilter().

Referenced by getConditionalFilterExpression().

494  {
495  $expressions = array();
496 
497  switch ($this->getAnswerStatusFilter()) {
498  case self::ANSWER_STATUS_FILTER_ALL_NON_CORRECT:
499 
500  $expressions[] = '
501  (tst_test_result.question_fi IS NULL OR tst_test_result.points < qpl_questions.points)
502  ';
503  break;
504 
505  case self::ANSWER_STATUS_FILTER_NON_ANSWERED_ONLY:
506 
507  $expressions[] = 'tst_test_result.question_fi IS NULL';
508  break;
509 
510  case self::ANSWER_STATUS_FILTER_WRONG_ANSWERED_ONLY:
511 
512  $expressions[] = 'tst_test_result.question_fi IS NOT NULL';
513  $expressions[] = 'tst_test_result.points < qpl_questions.points';
514  break;
515  }
516 
517  return $expressions;
518  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAvailableTaxonomyIds()

ilAssQuestionList::getAvailableTaxonomyIds ( )

Definition at line 261 of file class.ilAssQuestionList.php.

References $availableTaxonomyIds.

Referenced by loadTaxonomyAssignmentData().

262  {
264  }
+ Here is the caller graph for this function:

◆ getConditionalFilterExpression()

ilAssQuestionList::getConditionalFilterExpression ( )
private

Definition at line 545 of file class.ilAssQuestionList.php.

References array, getAnswerStatusFilterExpressions(), getFieldFilterExpressions(), getParentObjectIdFilterExpression(), getParentObjFilterExpression(), getQuestionIdsFilterExpressions(), getQuestionInstanceTypeFilterExpression(), and getTaxonomyFilterExpressions().

546  {
547  $CONDITIONS = array();
548 
549  if ($this->getQuestionInstanceTypeFilterExpression() !== null) {
550  $CONDITIONS[] = $this->getQuestionInstanceTypeFilterExpression();
551  }
552 
553  if ($this->getParentObjFilterExpression() !== null) {
554  $CONDITIONS[] = $this->getParentObjFilterExpression();
555  }
556 
557  if ($this->getParentObjectIdFilterExpression() !== null) {
558  $CONDITIONS[] = $this->getParentObjectIdFilterExpression();
559  }
560 
561  $CONDITIONS = array_merge(
562  $CONDITIONS,
564  $this->getFieldFilterExpressions(),
567  );
568 
569  $CONDITIONS = implode(' AND ', $CONDITIONS);
570 
571  return strlen($CONDITIONS) ? 'AND ' . $CONDITIONS : '';
572  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getDataArrayForQuestionId()

ilAssQuestionList::getDataArrayForQuestionId (   $questionId)

Definition at line 706 of file class.ilAssQuestionList.php.

707  {
708  return $this->questions[$questionId];
709  }

◆ getExcludeQuestionIdsFilter()

ilAssQuestionList::getExcludeQuestionIdsFilter ( )

Definition at line 224 of file class.ilAssQuestionList.php.

References $excludeQuestionIdsFilter.

Referenced by getQuestionIdsFilterExpressions().

+ Here is the caller graph for this function:

◆ getFieldFilterExpressions()

ilAssQuestionList::getFieldFilterExpressions ( )
private

Definition at line 335 of file class.ilAssQuestionList.php.

References array.

Referenced by getConditionalFilterExpression().

336  {
337  $expressions = array();
338 
339  foreach ($this->fieldFilters as $fieldName => $fieldValue) {
340  switch ($fieldName) {
341  case 'title':
342  case 'description':
343  case 'author':
344 
345  $expressions[] = $this->db->like('qpl_questions.' . $fieldName, 'text', "%%$fieldValue%%");
346  break;
347 
348  case 'type':
349 
350  $expressions[] = "qpl_qst_type.type_tag = {$this->db->quote($fieldValue, 'text')}";
351  break;
352 
353  case 'question_id':
354  if ($fieldValue != "" && !is_array($fieldValue)) {
355  $fieldValue = array($fieldValue);
356  }
357  $expressions[] = $this->db->in("qpl_questions.question_id", $fieldValue, false, "integer");
358  break;
359 
360  case 'parent_title':
361  if ($this->join_obj_data) {
362  $expressions[] = $this->db->like('object_data.title', 'text', "%%$fieldValue%%");
363  }
364  break;
365  }
366  }
367 
368  return $expressions;
369  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getForcedQuestionIds()

ilAssQuestionList::getForcedQuestionIds ( )
Returns
array

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

References $forcedQuestionIds.

Referenced by buildQuery().

318  {
320  }
+ Here is the caller graph for this function:

◆ getIncludeQuestionIdsFilter()

ilAssQuestionList::getIncludeQuestionIdsFilter ( )

Definition at line 219 of file class.ilAssQuestionList.php.

References $includeQuestionIdsFilter.

Referenced by getQuestionIdsFilterExpressions().

+ Here is the caller graph for this function:

◆ getJoinObjectData()

ilAssQuestionList::getJoinObjectData ( )

Get if object data table should be joined.

Returns
bool join object_data

Definition at line 301 of file class.ilAssQuestionList.php.

References $join_obj_data.

302  {
303  return $this->join_obj_data;
304  }

◆ getParentObjectIdFilterExpression()

ilAssQuestionList::getParentObjectIdFilterExpression ( )
private

Definition at line 484 of file class.ilAssQuestionList.php.

Referenced by getConditionalFilterExpression().

485  {
486  if ($this->parentObjId) {
487  return "qpl_questions.obj_fi = {$this->db->quote($this->parentObjId, 'integer')}";
488  }
489 
490  return null;
491  }
+ Here is the caller graph for this function:

◆ getParentObjectType()

ilAssQuestionList::getParentObjectType ( )

Definition at line 178 of file class.ilAssQuestionList.php.

References $parentObjType.

179  {
180  return $this->parentObjType;
181  }

◆ getParentObjFilterExpression()

ilAssQuestionList::getParentObjFilterExpression ( )
private

Definition at line 322 of file class.ilAssQuestionList.php.

References getParentObjId(), and getParentObjIdsFilter().

Referenced by getConditionalFilterExpression().

323  {
324  if ($this->getParentObjId()) {
325  return 'qpl_questions.obj_fi = ' . $this->db->quote($this->getParentObjId(), 'integer');
326  }
327 
328  if (count($this->getParentObjIdsFilter())) {
329  return $this->db->in('qpl_questions.obj_fi', $this->getParentObjIdsFilter(), false, 'integer');
330  }
331 
332  return null;
333  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParentObjId()

ilAssQuestionList::getParentObjId ( )

Definition at line 168 of file class.ilAssQuestionList.php.

References $parentObjId.

Referenced by getParentObjFilterExpression(), and ilTestSkillEvaluation\init().

169  {
170  return $this->parentObjId;
171  }
+ Here is the caller graph for this function:

◆ getParentObjIdsFilter()

ilAssQuestionList::getParentObjIdsFilter ( )
Returns
array

Definition at line 191 of file class.ilAssQuestionList.php.

References $parentObjIdsFilter.

Referenced by getParentObjFilterExpression().

192  {
194  }
+ Here is the caller graph for this function:

◆ getQuestionCompletionStatusFilter()

ilAssQuestionList::getQuestionCompletionStatusFilter ( )

◆ getQuestionDataArray()

ilAssQuestionList::getQuestionDataArray ( )

◆ getQuestionIdsFilterExpressions()

ilAssQuestionList::getQuestionIdsFilterExpressions ( )
private

Definition at line 453 of file class.ilAssQuestionList.php.

References array, getExcludeQuestionIdsFilter(), and getIncludeQuestionIdsFilter().

Referenced by getConditionalFilterExpression().

454  {
455  $expressions = array();
456 
457  if (is_array($this->getIncludeQuestionIdsFilter())) {
458  $expressions[] = $this->db->in(
459  'qpl_questions.question_id',
461  false,
462  'integer'
463  );
464  }
465 
466  if (is_array($this->getExcludeQuestionIdsFilter())) {
467  $IN = $this->db->in(
468  'qpl_questions.question_id',
470  true,
471  'integer'
472  );
473 
474  if ($IN == ' 1=2 ') {
475  $IN = ' 1=1 ';
476  } // required for ILIAS < 5.0
477 
478  $expressions[] = $IN;
479  }
480 
481  return $expressions;
482  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionInstanceTypeFilter()

ilAssQuestionList::getQuestionInstanceTypeFilter ( )

Definition at line 209 of file class.ilAssQuestionList.php.

References $questionInstanceTypeFilter.

Referenced by getQuestionInstanceTypeFilterExpression().

+ Here is the caller graph for this function:

◆ getQuestionInstanceTypeFilterExpression()

ilAssQuestionList::getQuestionInstanceTypeFilterExpression ( )
private

Definition at line 438 of file class.ilAssQuestionList.php.

References getQuestionInstanceTypeFilter().

Referenced by getConditionalFilterExpression().

439  {
440  switch ($this->getQuestionInstanceTypeFilter()) {
441  case self::QUESTION_INSTANCE_TYPE_ORIGINALS:
442 
443  return 'qpl_questions.original_id IS NULL';
444 
445  case self::QUESTION_INSTANCE_TYPE_DUPLICATES:
446 
447  return 'qpl_questions.original_id IS NOT NULL';
448  }
449 
450  return null;
451  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectFieldsExpression()

ilAssQuestionList::getSelectFieldsExpression ( )
private

Definition at line 574 of file class.ilAssQuestionList.php.

References array, and getAnswerStatusActiveId().

575  {
576  $selectFields = array(
577  'qpl_questions.*',
578  'qpl_qst_type.type_tag',
579  'qpl_qst_type.plugin',
580  'qpl_qst_type.plugin_name',
581  'qpl_questions.points max_points'
582  );
583 
584  if ($this->join_obj_data) {
585  $selectFields[] = 'object_data.title parent_title';
586  }
587 
588  if ($this->getAnswerStatusActiveId()) {
589  $selectFields[] = 'tst_test_result.points reached_points';
590  $selectFields[] = "CASE
591  WHEN tst_test_result.points IS NULL THEN '" . self::QUESTION_ANSWER_STATUS_NON_ANSWERED . "'
592  WHEN tst_test_result.points < qpl_questions.points THEN '" . self::QUESTION_ANSWER_STATUS_WRONG_ANSWERED . "'
593  ELSE '" . self::QUESTION_ANSWER_STATUS_CORRECT_ANSWERED . "'
594  END question_answer_status
595  ";
596  }
597 
598  $selectFields = implode(",\n\t\t\t\t", $selectFields);
599 
600  return "
601  SELECT {$selectFields}
602  ";
603  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getTableJoinExpression()

ilAssQuestionList::getTableJoinExpression ( )
private

Definition at line 520 of file class.ilAssQuestionList.php.

References getAnswerStatusActiveId().

521  {
522  $tableJoin = "
523  INNER JOIN qpl_qst_type
524  ON qpl_qst_type.question_type_id = qpl_questions.question_type_fi
525  ";
526 
527  if ($this->join_obj_data) {
528  $tableJoin .= "
529  INNER JOIN object_data
530  ON object_data.obj_id = qpl_questions.obj_fi
531  ";
532  }
533 
534  if ($this->getAnswerStatusActiveId()) {
535  $tableJoin .= "
536  LEFT JOIN tst_test_result
537  ON tst_test_result.question_fi = qpl_questions.question_id
538  AND tst_test_result.active_fi = {$this->db->quote($this->getAnswerStatusActiveId(), 'integer')}
539  ";
540  }
541 
542  return $tableJoin;
543  }
+ Here is the call graph for this function:

◆ getTaxItems()

ilAssQuestionList::getTaxItems (   $parentType,
  $parentObjId,
  $taxId,
  $taxNode 
)
protected
Parameters
string$parentType
int$parentObjId
int$taxId
int$taxNode
Returns
array

Definition at line 421 of file class.ilAssQuestionList.php.

References $parentObjId.

Referenced by getTaxonomyFilterExpressions().

422  {
423  $taxTree = new ilTaxonomyTree($taxId);
424 
425  $taxNodeAssignment = new ilTaxNodeAssignment(
426  $parentType,
427  $parentObjId,
428  'quest',
429  $taxId
430  );
431 
432  $subNodes = $taxTree->getSubTreeIds($taxNode);
433  $subNodes[] = $taxNode;
434 
435  return $taxNodeAssignment->getAssignmentsOfNode($subNodes);
436  }
Taxonomy node <-> item assignment.
+ Here is the caller graph for this function:

◆ getTaxonomyFilterExpressions()

ilAssQuestionList::getTaxonomyFilterExpressions ( )
private

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

References array, and getTaxItems().

Referenced by getConditionalFilterExpression().

372  {
373  $expressions = array();
374 
375  require_once 'Services/Taxonomy/classes/class.ilTaxonomyTree.php';
376  require_once 'Services/Taxonomy/classes/class.ilTaxNodeAssignment.php';
377 
378  foreach ($this->taxFilters as $taxId => $taxNodes) {
379  $questionIds = array();
380 
381  $forceBypass = true;
382 
383  foreach ($taxNodes as $taxNode) {
384  $forceBypass = false;
385 
386  $taxItemsByTaxParent = $this->getTaxItems(
387  $this->taxParentTypes[$taxId],
388  $this->taxParentIds[$taxId],
389  $taxId,
390  $taxNode
391  );
392 
393  $taxItemsByParent = $this->getTaxItems(
394  $this->parentObjType,
395  $this->parentObjId,
396  $taxId,
397  $taxNode
398  );
399 
400  $taxItems = array_merge($taxItemsByTaxParent, $taxItemsByParent);
401  foreach ($taxItems as $taxItem) {
402  $questionIds[$taxItem['item_id']] = $taxItem['item_id'];
403  }
404  }
405 
406  if (!$forceBypass) {
407  $expressions[] = $this->db->in('question_id', $questionIds, false, 'integer');
408  }
409  }
410 
411  return $expressions;
412  }
getTaxItems($parentType, $parentObjId, $taxId, $taxNode)
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTitle()

ilAssQuestionList::getTitle (   $a_comp_id,
  $a_item_type,
  $a_item_id 
)

Get title of an assigned item.

(is used from ilObjTaxonomyGUI when item sorting is activated)

Parameters
string$a_comp_id('qpl' in our context)
string$a_item_type('quest' in our context)
integer$a_item_id(questionId in our context)

Implements ilTaxAssignedItemInfo.

Definition at line 730 of file class.ilAssQuestionList.php.

731  {
732  if ($a_comp_id != 'qpl' || $a_item_type != 'quest' || !(int) $a_item_id) {
733  return '';
734  }
735 
736  if (!isset($this->questions[$a_item_id])) {
737  return '';
738  }
739 
740  return $this->questions[$a_item_id]['title'];
741  }

◆ isActiveQuestionType()

ilAssQuestionList::isActiveQuestionType (   $questionData)
private

Definition at line 693 of file class.ilAssQuestionList.php.

References IL_COMP_MODULE.

Referenced by load().

694  {
695  if (!isset($questionData['plugin'])) {
696  return false;
697  }
698 
699  if (!$questionData['plugin']) {
700  return true;
701  }
702 
703  return $this->pluginAdmin->isActive(IL_COMP_MODULE, 'TestQuestionPool', 'qst', $questionData['plugin_name']);
704  }
const IL_COMP_MODULE
+ Here is the caller graph for this function:

◆ isInList()

ilAssQuestionList::isInList (   $questionId)

Definition at line 716 of file class.ilAssQuestionList.php.

717  {
718  return isset($this->questions[$questionId]);
719  }

◆ load()

ilAssQuestionList::load ( )

Definition at line 634 of file class.ilAssQuestionList.php.

References $query, $res, $row, buildQuery(), checkFilters(), ilAssQuestionType\completeMissingPluginName(), isActiveQuestionType(), and loadTaxonomyAssignmentData().

635  {
636  $this->checkFilters();
637 
638  $query = $this->buildQuery();
639 
640  #vd($query);
641 
642  $res = $this->db->query($query);
643 
644  //echo $this->db->db->last_query;
645 
646  #vd($this->db->db->last_query);
647 
648  while ($row = $this->db->fetchAssoc($res)) {
650 
651  if (!$this->isActiveQuestionType($row)) {
652  continue;
653  }
654 
655  $row['taxonomies'] = $this->loadTaxonomyAssignmentData($row['obj_fi'], $row['question_id']);
656 
657  $row['ttype'] = $this->lng->txt($row['type_tag']);
658 
659  $this->questions[ $row['question_id'] ] = $row;
660  }
661  }
isActiveQuestionType($questionData)
static completeMissingPluginName($questionTypeData)
foreach($_POST as $key=> $value) $res
$query
loadTaxonomyAssignmentData($parentObjId, $questionId)
+ Here is the call graph for this function:

◆ loadTaxonomyAssignmentData()

ilAssQuestionList::loadTaxonomyAssignmentData (   $parentObjId,
  $questionId 
)
private

Definition at line 663 of file class.ilAssQuestionList.php.

References $parentObjId, array, and getAvailableTaxonomyIds().

Referenced by load().

664  {
665  $taxAssignmentData = array();
666 
667  foreach ($this->getAvailableTaxonomyIds() as $taxId) {
668  require_once 'Services/Taxonomy/classes/class.ilTaxonomyTree.php';
669  require_once 'Services/Taxonomy/classes/class.ilTaxNodeAssignment.php';
670 
671  $taxTree = new ilTaxonomyTree($taxId);
672 
673  $taxAssignment = new ilTaxNodeAssignment('qpl', $parentObjId, 'quest', $taxId);
674 
675  $assignments = $taxAssignment->getAssignmentsOfItem($questionId);
676 
677  foreach ($assignments as $assData) {
678  if (!isset($taxAssignmentData[ $assData['tax_id'] ])) {
679  $taxAssignmentData[ $assData['tax_id'] ] = array();
680  }
681 
682  $nodeData = $taxTree->getNodeData($assData['node_id']);
683 
684  $assData['node_lft'] = $nodeData['lft'];
685 
686  $taxAssignmentData[ $assData['tax_id'] ][ $assData['node_id'] ] = $assData;
687  }
688  }
689 
690  return $taxAssignmentData;
691  }
Taxonomy node <-> item assignment.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAnswerStatusActiveId()

ilAssQuestionList::setAnswerStatusActiveId (   $answerStatusActiveId)

Definition at line 266 of file class.ilAssQuestionList.php.

References $answerStatusActiveId.

267  {
268  $this->answerStatusActiveId = $answerStatusActiveId;
269  }

◆ setAnswerStatusFilter()

ilAssQuestionList::setAnswerStatusFilter (   $answerStatusFilter)

Definition at line 276 of file class.ilAssQuestionList.php.

References $answerStatusFilter.

277  {
278  $this->answerStatusFilter = $answerStatusFilter;
279  }

◆ setAvailableTaxonomyIds()

ilAssQuestionList::setAvailableTaxonomyIds (   $availableTaxonomyIds)

Definition at line 256 of file class.ilAssQuestionList.php.

References $availableTaxonomyIds.

257  {
258  $this->availableTaxonomyIds = $availableTaxonomyIds;
259  }

◆ setExcludeQuestionIdsFilter()

ilAssQuestionList::setExcludeQuestionIdsFilter (   $excludeQuestionIdsFilter)

Definition at line 229 of file class.ilAssQuestionList.php.

References $excludeQuestionIdsFilter.

230  {
231  $this->excludeQuestionIdsFilter = $excludeQuestionIdsFilter;
232  }

◆ setForcedQuestionIds()

ilAssQuestionList::setForcedQuestionIds (   $forcedQuestionIds)
Parameters
array$forcedQuestionIds

Definition at line 309 of file class.ilAssQuestionList.php.

References $forcedQuestionIds.

310  {
311  $this->forcedQuestionIds = $forcedQuestionIds;
312  }

◆ setIncludeQuestionIdsFilter()

ilAssQuestionList::setIncludeQuestionIdsFilter (   $questionIdsFilter)

Definition at line 214 of file class.ilAssQuestionList.php.

215  {
216  $this->includeQuestionIdsFilter = $questionIdsFilter;
217  }

◆ setJoinObjectData()

ilAssQuestionList::setJoinObjectData (   $a_val)

Set if object data table should be joined.

Parameters
bool$a_valjoin object_data

Definition at line 291 of file class.ilAssQuestionList.php.

292  {
293  $this->join_obj_data = $a_val;
294  }

◆ setParentObjectType()

ilAssQuestionList::setParentObjectType (   $parentObjType)

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

References $parentObjType.

184  {
185  $this->parentObjType = $parentObjType;
186  }

◆ setParentObjId()

ilAssQuestionList::setParentObjId (   $parentObjId)

Definition at line 173 of file class.ilAssQuestionList.php.

References $parentObjId.

Referenced by ilCopySelfAssQuestionTableGUI\getQuestions().

174  {
175  $this->parentObjId = $parentObjId;
176  }
+ Here is the caller graph for this function:

◆ setParentObjIdsFilter()

ilAssQuestionList::setParentObjIdsFilter (   $parentObjIdsFilter)
Parameters
array$parentObjIdsFilter

Definition at line 199 of file class.ilAssQuestionList.php.

References $parentObjIdsFilter.

200  {
201  $this->parentObjIdsFilter = $parentObjIdsFilter;
202  }

◆ setQuestionCompletionStatusFilter()

ilAssQuestionList::setQuestionCompletionStatusFilter (   $questionCompletionStatusFilter)

Definition at line 239 of file class.ilAssQuestionList.php.

References $questionCompletionStatusFilter.

240  {
241  $this->questionCompletionStatusFilter = $questionCompletionStatusFilter;
242  }

◆ setQuestionInstanceTypeFilter()

ilAssQuestionList::setQuestionInstanceTypeFilter (   $questionInstanceTypeFilter)

Definition at line 204 of file class.ilAssQuestionList.php.

References $questionInstanceTypeFilter.

205  {
206  $this->questionInstanceTypeFilter = $questionInstanceTypeFilter;
207  }

Field Documentation

◆ $answerStatusActiveId

ilAssQuestionList::$answerStatusActiveId = null
private

◆ $answerStatusFilter

ilAssQuestionList::$answerStatusFilter = null
private

Definition at line 133 of file class.ilAssQuestionList.php.

Referenced by getAnswerStatusFilter(), and setAnswerStatusFilter().

◆ $availableTaxonomyIds

ilAssQuestionList::$availableTaxonomyIds = array()
private

Definition at line 65 of file class.ilAssQuestionList.php.

Referenced by getAvailableTaxonomyIds(), and setAvailableTaxonomyIds().

◆ $db

ilAssQuestionList::$db = null
protected

Definition at line 23 of file class.ilAssQuestionList.php.

Referenced by __construct().

◆ $excludeQuestionIdsFilter

ilAssQuestionList::$excludeQuestionIdsFilter = null
private

◆ $fieldFilters

ilAssQuestionList::$fieldFilters = array()
private

Definition at line 72 of file class.ilAssQuestionList.php.

◆ $forcedQuestionIds

ilAssQuestionList::$forcedQuestionIds = array()
private

Definition at line 105 of file class.ilAssQuestionList.php.

Referenced by getForcedQuestionIds(), and setForcedQuestionIds().

◆ $includeQuestionIdsFilter

ilAssQuestionList::$includeQuestionIdsFilter = null
private

Definition at line 139 of file class.ilAssQuestionList.php.

Referenced by getIncludeQuestionIdsFilter().

◆ $join_obj_data

ilAssQuestionList::$join_obj_data = true
protected

Definition at line 111 of file class.ilAssQuestionList.php.

Referenced by getJoinObjectData().

◆ $lng

ilAssQuestionList::$lng = null
private

Definition at line 30 of file class.ilAssQuestionList.php.

Referenced by __construct().

◆ $parentObjId

ilAssQuestionList::$parentObjId = null
private

◆ $parentObjIdsFilter

ilAssQuestionList::$parentObjIdsFilter = array()
private

Definition at line 44 of file class.ilAssQuestionList.php.

Referenced by getParentObjIdsFilter(), and setParentObjIdsFilter().

◆ $parentObjType

ilAssQuestionList::$parentObjType = 'qpl'
private

◆ $pluginAdmin

ilAssQuestionList::$pluginAdmin = null
private

Definition at line 37 of file class.ilAssQuestionList.php.

Referenced by __construct().

◆ $questionCompletionStatusFilter

ilAssQuestionList::$questionCompletionStatusFilter = self::QUESTION_COMPLETION_STATUS_BOTH
private

◆ $questionInstanceTypeFilter

ilAssQuestionList::$questionInstanceTypeFilter = self::QUESTION_INSTANCE_TYPE_ORIGINALS
private

◆ $questions

ilAssQuestionList::$questions = array()
protected

Definition at line 152 of file class.ilAssQuestionList.php.

Referenced by getQuestionDataArray().

◆ $taxFilters

ilAssQuestionList::$taxFilters = array()
private

Definition at line 79 of file class.ilAssQuestionList.php.

◆ $taxParentIds

ilAssQuestionList::$taxParentIds = array()
private

Definition at line 86 of file class.ilAssQuestionList.php.

◆ $taxParentTypes

ilAssQuestionList::$taxParentTypes = array()
private

Definition at line 93 of file class.ilAssQuestionList.php.

◆ ANSWER_STATUS_FILTER_ALL_NON_CORRECT

const ilAssQuestionList::ANSWER_STATUS_FILTER_ALL_NON_CORRECT = 'allNonCorrect'

◆ ANSWER_STATUS_FILTER_NON_ANSWERED_ONLY

const ilAssQuestionList::ANSWER_STATUS_FILTER_NON_ANSWERED_ONLY = 'nonAnswered'

◆ ANSWER_STATUS_FILTER_WRONG_ANSWERED_ONLY

const ilAssQuestionList::ANSWER_STATUS_FILTER_WRONG_ANSWERED_ONLY = 'wrongAnswered'

◆ QUESTION_ANSWER_STATUS_CORRECT_ANSWERED

const ilAssQuestionList::QUESTION_ANSWER_STATUS_CORRECT_ANSWERED = 'correctAnswered'

◆ QUESTION_ANSWER_STATUS_NON_ANSWERED

const ilAssQuestionList::QUESTION_ANSWER_STATUS_NON_ANSWERED = 'nonAnswered'

answer status domain for single questions

Definition at line 117 of file class.ilAssQuestionList.php.

Referenced by ilTestPlayerDynamicQuestionSetGUI\buildQuestionSetAnswerStatisticRowArray().

◆ QUESTION_ANSWER_STATUS_WRONG_ANSWERED

const ilAssQuestionList::QUESTION_ANSWER_STATUS_WRONG_ANSWERED = 'wrongAnswered'

◆ QUESTION_COMPLETION_STATUS_BOTH

const ilAssQuestionList::QUESTION_COMPLETION_STATUS_BOTH = 'complete/incomplete'

Definition at line 144 of file class.ilAssQuestionList.php.

◆ QUESTION_COMPLETION_STATUS_COMPLETE

const ilAssQuestionList::QUESTION_COMPLETION_STATUS_COMPLETE = 'complete'

Definition at line 142 of file class.ilAssQuestionList.php.

◆ QUESTION_COMPLETION_STATUS_INCOMPLETE

const ilAssQuestionList::QUESTION_COMPLETION_STATUS_INCOMPLETE = 'incomplete'

Definition at line 143 of file class.ilAssQuestionList.php.

◆ QUESTION_INSTANCE_TYPE_DUPLICATES

◆ QUESTION_INSTANCE_TYPE_ORIGINALS


The documentation for this class was generated from the following file: