ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAssSpecificFeedbackIdentifierList Class Reference
+ Inheritance diagram for ilAssSpecificFeedbackIdentifierList:
+ Collaboration diagram for ilAssSpecificFeedbackIdentifierList:

Public Member Functions

 load ($questionId)
 
 current ()
 
 next ()
 
 key ()
 
 valid ()
 
 rewind ()
 

Protected Member Functions

 add (ilAssSpecificFeedbackIdentifier $identifier)
 
 getSpecificFeedbackTableName ()
 

Protected Attributes

 $map = array()
 

Detailed Description

Member Function Documentation

◆ add()

ilAssSpecificFeedbackIdentifierList::add ( ilAssSpecificFeedbackIdentifier  $identifier)
protected
Parameters
ilAssSpecificFeedbackIdentifier$identifier

Definition at line 25 of file class.ilAssSpecificFeedbackIdentifierList.php.

Referenced by load().

26  {
27  $this->map[] = $identifier;
28  }
+ Here is the caller graph for this function:

◆ current()

ilAssSpecificFeedbackIdentifierList::current ( )

◆ getSpecificFeedbackTableName()

ilAssSpecificFeedbackIdentifierList::getSpecificFeedbackTableName ( )
protected

Definition at line 99 of file class.ilAssSpecificFeedbackIdentifierList.php.

References ilAssMultiOptionQuestionFeedback\TABLE_NAME_SPECIFIC_FEEDBACK.

100  {
101  require_once 'Modules/TestQuestionPool/classes/feedback/class.ilAssClozeTestFeedback.php';
103  }
const TABLE_NAME_SPECIFIC_FEEDBACK
table name for specific feedback

◆ key()

ilAssSpecificFeedbackIdentifierList::key ( )
Returns
integer|null

Definition at line 78 of file class.ilAssSpecificFeedbackIdentifierList.php.

Referenced by valid().

+ Here is the caller graph for this function:

◆ load()

ilAssSpecificFeedbackIdentifierList::load (   $questionId)
Parameters
integer$questionId

Definition at line 33 of file class.ilAssSpecificFeedbackIdentifierList.php.

References $DIC, $res, $row, and add().

34  {
35  global $DIC; /* @var ILIAS\DI\Container $DIC */
36 
37  $res = $DIC->database()->queryF(
38  "SELECT feedback_id, question, answer FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
39  array('integer'),
40  array($questionId)
41  );
42 
43  $feedbackIdByAnswerIndexMap = array();
44 
45  while ($row = $DIC->database()->fetchAssoc($res)) {
46  $identifier = new ilAssSpecificFeedbackIdentifier();
47 
48  $identifier->setQuestionId($questionId);
49 
50  $identifier->setQuestionIndex($row['question']);
51  $identifier->setAnswerIndex($row['answer']);
52 
53  $identifier->setFeedbackId($row['feedback_id']);
54 
55  $this->add($identifier);
56  }
57  }
add(ilAssSpecificFeedbackIdentifier $identifier)
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$row
+ Here is the call graph for this function:

◆ next()

ilAssSpecificFeedbackIdentifierList::next ( )

◆ rewind()

ilAssSpecificFeedbackIdentifierList::rewind ( )
Returns
ilAssSpecificFeedbackIdentifier

Definition at line 94 of file class.ilAssSpecificFeedbackIdentifierList.php.

95  {
96  return reset($this->map);
97  }

◆ valid()

ilAssSpecificFeedbackIdentifierList::valid ( )
Returns
bool

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

References key().

87  {
88  return key($this->map) !== null;
89  }
+ Here is the call graph for this function:

Field Documentation

◆ $map

ilAssSpecificFeedbackIdentifierList::$map = array()
protected

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