ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAssSpecificFeedbackIdentifierList Class Reference
+ Inheritance diagram for ilAssSpecificFeedbackIdentifierList:
+ Collaboration diagram for ilAssSpecificFeedbackIdentifierList:

Public Member Functions

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

Protected Member Functions

 add (ilAssSpecificFeedbackIdentifier $identifier)
 
 getSpecificFeedbackTableName ()
 

Protected Attributes

array $map = array()
 

Detailed Description

Member Function Documentation

◆ add()

ilAssSpecificFeedbackIdentifierList::add ( ilAssSpecificFeedbackIdentifier  $identifier)
protected

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

Referenced by load().

34  : void
35  {
36  $this->map[] = $identifier;
37  }
+ Here is the caller graph for this function:

◆ current()

ilAssSpecificFeedbackIdentifierList::current ( )
Returns
false|ilAssSpecificFeedbackIdentifier

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

◆ getSpecificFeedbackTableName()

ilAssSpecificFeedbackIdentifierList::getSpecificFeedbackTableName ( )
protected

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

References ilAssMultiOptionQuestionFeedback\TABLE_NAME_SPECIFIC_FEEDBACK.

92  : string
93  {
94  require_once 'Modules/TestQuestionPool/classes/feedback/class.ilAssClozeTestFeedback.php';
96  }
const TABLE_NAME_SPECIFIC_FEEDBACK
table name for specific feedback

◆ key()

ilAssSpecificFeedbackIdentifierList::key ( )
Returns
int|null|string

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

Referenced by valid().

+ Here is the caller graph for this function:

◆ load()

ilAssSpecificFeedbackIdentifierList::load ( int  $questionId)

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

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

39  : void
40  {
41  global $DIC; /* @var ILIAS\DI\Container $DIC */
42 
43  $res = $DIC->database()->queryF(
44  "SELECT feedback_id, question, answer FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
45  array('integer'),
46  array($questionId)
47  );
48 
49  while ($row = $DIC->database()->fetchAssoc($res)) {
50  $identifier = new ilAssSpecificFeedbackIdentifier();
51 
52  $identifier->setQuestionId($questionId);
53 
54  $identifier->setQuestionIndex($row['question']);
55  $identifier->setAnswerIndex($row['answer']);
56 
57  $identifier->setFeedbackId($row['feedback_id']);
58 
59  $this->add($identifier);
60  }
61  }
$res
Definition: ltiservices.php:69
add(ilAssSpecificFeedbackIdentifier $identifier)
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ next()

ilAssSpecificFeedbackIdentifierList::next ( )
Returns
false|ilAssSpecificFeedbackIdentifier

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

◆ rewind()

ilAssSpecificFeedbackIdentifierList::rewind ( )
Returns
false|ilAssSpecificFeedbackIdentifier

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

88  {
89  return reset($this->map);
90  }

◆ valid()

ilAssSpecificFeedbackIdentifierList::valid ( )

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

References key().

81  : bool
82  {
83  return key($this->map) !== null;
84  }
+ Here is the call graph for this function:

Field Documentation

◆ $map

array ilAssSpecificFeedbackIdentifierList::$map = array()
protected

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