4 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintList.php';
90 SELECT COUNT(qhtr_track_id) cnt
92 FROM qpl_hint_tracking
94 WHERE qhtr_question_fi = %s
95 AND qhtr_active_fi = %s
100 $query, array(
'integer',
'integer',
'integer'),
122 SELECT COUNT(qht_hint_id) cnt_available,
123 COUNT(qhtr_track_id) cnt_requested
127 LEFT JOIN qpl_hint_tracking
128 ON qhtr_hint_fi = qht_hint_id
129 AND qhtr_active_fi = %s
132 WHERE qht_question_fi = %s
135 $res = $ilDB->queryF(
136 $query, array(
'integer',
'integer',
'integer'),
142 if(
$row[
'cnt_available'] >
$row[
'cnt_requested'] )
164 SELECT COUNT(qhtr_track_id) cnt
166 FROM qpl_hint_tracking
168 WHERE qhtr_hint_fi = %s
169 AND qhtr_active_fi = %s
173 $res = $ilDB->queryF(
179 if(
$row[
'cnt'] > 0 )
205 LEFT JOIN qpl_hint_tracking
206 ON qhtr_hint_fi = qht_hint_id
207 AND qhtr_active_fi = %s
210 WHERE qht_question_fi = %s
211 AND qhtr_track_id IS NULL
213 ORDER BY qht_hint_index ASC
218 $res = $ilDB->queryF(
219 $query, array(
'integer',
'integer',
'integer'),
223 while(
$row = $ilDB->fetchAssoc(
$res) )
231 "no next hint found for questionId={$this->getQuestionId()}, activeId={$this->getActiveId()}, pass={$this->getPass()}"
251 FROM qpl_hint_tracking
253 WHERE qhtr_question_fi = %s
254 AND qhtr_active_fi = %s
258 $res = $ilDB->queryF(
259 $query, array(
'integer',
'integer',
'integer'),
265 while(
$row = $ilDB->fetchAssoc(
$res) )
267 $hintIds[] =
$row[
'qhtr_hint_fi'];
272 return $requestedHintsList;
287 $trackId = $ilDB->nextId(
'qpl_hint_tracking');
289 $ilDB->insert(
'qpl_hint_tracking', array(
290 'qhtr_track_id' => array(
'integer', $trackId),
291 'qhtr_active_fi' => array(
'integer', $this->
getActiveId()),
292 'qhtr_pass' => array(
'integer', $this->
getPass()),
293 'qhtr_question_fi' => array(
'integer', $this->
getQuestionId()),
294 'qhtr_hint_fi' => array(
'integer', $questionHint->
getId()),
314 SELECT COUNT(qhtr_track_id) requests_count,
315 SUM(qht_hint_points) requests_points
317 FROM qpl_hint_tracking
320 ON qht_hint_id = qhtr_hint_fi
322 WHERE qhtr_question_fi = %s
323 AND qhtr_active_fi = %s
327 $res = $ilDB->queryF(
328 $query, array(
'integer',
'integer',
'integer'),
334 if(
$row[
'requests_points'] === null )
336 $row[
'requests_points'] = 0;
339 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticData.php';
342 $requestsStatisticData->setRequestsCount(
$row[
'requests_count']);
343 $requestsStatisticData->setRequestsPoints(
$row[
'requests_points']);
345 return $requestsStatisticData;
359 $__question_fi__IN__questionIds = $ilDB->in(
'qhtr_question_fi', $questionIds,
false,
'integer');
362 DELETE FROM qpl_hint_tracking
363 WHERE $__question_fi__IN__questionIds
366 $ilDB->manipulate(
$query);
380 $__active_fi__IN__activeIds = $ilDB->in(
'qhtr_active_fi', $activeIds,
false,
'integer');
383 DELETE FROM qpl_hint_tracking
384 WHERE $__active_fi__IN__activeIds
387 $ilDB->manipulate(
$query);