4 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHint.php';
38 public function rewind() {
return reset($this->questionHints); }
46 public function next() {
return next($this->questionHints); }
54 public function key() {
return key($this->questionHints); }
62 public function valid() {
return key($this->questionHints) !== null; }
79 $this->questionHints[] = $questionHint;
91 foreach($this as $questionHint)
95 if( $questionHint->getId() == $hintId )
101 require_once
'Modules/TestQuestionPool/exceptions/class.ilTestQuestionPoolException.php';
115 foreach($this as $questionHint)
119 if( $questionHint->getId() == $hintId )
141 foreach($this as $questionHint)
145 $questionHint->setIndex(++
$counter);
146 $questionHint->save();
163 $questionHintList = self::getListByQuestionId($originalQuestionId);
165 foreach($questionHintList as $questionHint)
169 $originalHintId = $questionHint->getId();
171 $questionHint->setId(null);
172 $questionHint->setQuestionId($duplicateQuestionId);
174 $questionHint->save();
176 $duplicateHintId = $questionHint->getId();
178 $hintIds[$originalHintId] = $duplicateHintId;
193 $tableData =
array();
195 foreach($this as $questionHint)
199 $tableData[] =
array(
200 'hint_id' => $questionHint->getId(),
201 'hint_index' => $questionHint->getIndex(),
202 'hint_points' => $questionHint->getPoints(),
203 'hint_text' => $questionHint->getText()
232 WHERE qht_question_fi = %s 234 ORDER BY qht_hint_index ASC 237 $res = $ilDB->queryF(
241 $questionHintList =
new self();
243 while(
$row = $ilDB->fetchAssoc(
$res) )
249 $questionHintList->addHint($questionHint);
252 return $questionHintList;
268 $qht_hint_id__IN__hintIds = $ilDB->in(
'qht_hint_id', $hintIds,
false,
'integer');
279 WHERE $qht_hint_id__IN__hintIds 281 ORDER BY qht_hint_index ASC 286 $questionHintList =
new self();
288 while(
$row = $ilDB->fetchAssoc(
$res) )
294 $questionHintList->addHint($questionHint);
297 return $questionHintList;
316 SELECT 1 + COALESCE( MAX(qht_hint_index), 0 ) next_index 320 WHERE qht_question_fi = %s 323 $res = $ilDB->queryF(
329 return $row[
'next_index'];
342 $__qht_question_fi__IN__questionIds = $ilDB->in(
'qht_question_fi', $questionIds,
false,
'integer');
345 DELETE FROM qpl_hints 346 WHERE $__qht_question_fi__IN__questionIds 349 return $ilDB->manipulate(
$query);
static getListByQuestionId($questionId)
instantiates a question hint list for the passed question id
rewind()
iterator interface method
static deleteHintsByQuestionIds($questionIds)
Deletes all question hints relating to questions included in given question ids.
static getListByHintIds($hintIds)
instantiates a question hint list for the passed hint ids
hintExists($hintId)
checks wether a question hint object relating to the passed id exists or not
static getNextIndexByQuestionId($questionId)
determines the next index to be used for a new hint that is to be added to the list of existing hints...
key()
iterator interface method
Create styles array
The data for the language used.
static duplicateListForQuestion($originalQuestionId, $duplicateQuestionId)
duplicates a hint list from given original question id to given duplicate question id and returns an ...
next()
iterator interface method
reIndex()
re-indexes the list's hints sequentially by current order (starting with index "1") ...
valid()
iterator interface method
static assignDbRow(self $questionHint, $hintDbRow)
assigns the field elements of passed hint db row array to the corresponding hint object properties of...
addHint(ilAssQuestionHint $questionHint)
adds a question hint object to the current list instance
current()
iterator interface method
__construct()
Constructor.
getTableData()
returns an array with data of the hints in this list that is adopted to be used as table gui data ...
getHint($hintId)
returns the question hint object relating to the passed hint id