5 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHint.php';
39 public function rewind() {
return reset($this->questionHints); }
47 public function next() {
return next($this->questionHints); }
55 public function key() {
return key($this->questionHints); }
63 public function valid() {
return key($this->questionHints) !== null; }
80 $this->questionHints[] = $questionHint;
92 foreach($this as $questionHint)
96 if( $questionHint->getId() == $hintId )
102 require_once
'Modules/TestQuestionPool/exceptions/class.ilTestQuestionPoolException.php';
116 foreach($this as $questionHint)
120 if( $questionHint->getId() == $hintId )
142 foreach($this as $questionHint)
146 $questionHint->setIndex(++$counter);
147 $questionHint->save();
155 foreach($questionHintList as $questionHint)
159 $questionHint->setId(null);
160 $questionHint->setQuestionId($duplicateQuestionId);
162 $questionHint->save();
175 $tableData = array();
177 foreach($this as $questionHint)
181 $tableData[] = array(
182 'hint_id' => $questionHint->getId(),
183 'hint_index' => $questionHint->getIndex(),
184 'hint_points' => $questionHint->getPoints(),
185 'hint_text' => $questionHint->getText()
214 WHERE qht_question_fi = %s
216 ORDER BY qht_hint_index ASC
219 $res = $ilDB->queryF(
220 $query, array(
'integer'), array((
int)$questionId)
223 $questionHintList =
new self();
225 while(
$row = $ilDB->fetchAssoc(
$res) )
231 $questionHintList->addHint($questionHint);
234 return $questionHintList;
250 $qht_hint_id__IN__hintIds = $ilDB->in(
'qht_hint_id', $hintIds,
false,
'integer');
261 WHERE $qht_hint_id__IN__hintIds
263 ORDER BY qht_hint_index ASC
268 $questionHintList =
new self();
270 while(
$row = $ilDB->fetchAssoc(
$res) )
276 $questionHintList->addHint($questionHint);
279 return $questionHintList;
298 SELECT 1 + COALESCE( MAX(qht_hint_index), 0 ) next_index
302 WHERE qht_question_fi = %s
305 $res = $ilDB->queryF(
306 $query, array(
'integer'), array((
int)$questionId)
311 return $row[
'next_index'];
324 $__qht_question_fi__IN__questionIds = $ilDB->in(
'qht_question_fi', $questionIds,
false,
'integer');
327 DELETE FROM qpl_hints
328 WHERE $__qht_question_fi__IN__questionIds
331 return $ilDB->manipulate(
$query);