4 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintList.php';
30 if( self::getNumExistingRequests($questionId, $activeId,
$pass) > 0 )
55 SELECT COUNT(qhtr_track_id) cnt
57 FROM qpl_hint_tracking
59 WHERE qhtr_question_fi = %s
60 AND qhtr_active_fi = %s
65 $query, array(
'integer',
'integer',
'integer'), array($questionId, $activeId,
$pass)
90 SELECT COUNT(qht_hint_id) cnt_available,
91 COUNT(qhtr_track_id) cnt_requested
95 LEFT JOIN qpl_hint_tracking
96 ON qhtr_hint_fi = qht_hint_id
97 AND qhtr_active_fi = %s
100 WHERE qht_question_fi = %s
103 $res = $ilDB->queryF(
104 $query, array(
'integer',
'integer',
'integer'), array($activeId,
$pass, $questionId)
109 if(
$row[
'cnt_available'] >
$row[
'cnt_requested'] )
134 SELECT COUNT(qhtr_track_id) cnt
136 FROM qpl_hint_tracking
138 WHERE qhtr_hint_fi = %s
139 AND qhtr_active_fi = %s
143 $res = $ilDB->queryF(
144 $query, array(
'integer',
'integer',
'integer'), array($hintId, $activeId,
$pass)
149 if(
$row[
'cnt'] > 0 )
179 LEFT JOIN qpl_hint_tracking
180 ON qhtr_hint_fi = qht_hint_id
181 AND qhtr_active_fi = %s
184 WHERE qht_question_fi = %s
185 AND qhtr_track_id IS NULL
187 ORDER BY qht_hint_index ASC
192 $res = $ilDB->queryF(
193 $query, array(
'integer',
'integer',
'integer'), array($activeId,
$pass, $questionId)
196 while(
$row = $ilDB->fetchAssoc(
$res) )
203 throw new ilTestException(
"no next hint found for questionId=$questionId, activeId=$activeId, pass=$pass");
226 FROM qpl_hint_tracking
228 WHERE qhtr_question_fi = %s
229 AND qhtr_active_fi = %s
233 $res = $ilDB->queryF(
234 $query, array(
'integer',
'integer',
'integer'), array($questionId, $activeId,
$pass)
239 while(
$row = $ilDB->fetchAssoc(
$res) )
241 $hintIds[] =
$row[
'qhtr_hint_fi'];
246 return $requestedHintsList;
265 $trackId = $ilDB->nextId(
'qpl_hint_tracking');
267 $ilDB->insert(
'qpl_hint_tracking', array(
268 'qhtr_track_id' => array(
'integer', $trackId),
269 'qhtr_active_fi' => array(
'integer', $activeId),
270 'qhtr_pass' => array(
'integer',
$pass),
271 'qhtr_question_fi' => array(
'integer', $questionId),
272 'qhtr_hint_fi' => array(
'integer', $questionHint->
getId()),
296 SELECT COUNT(qhtr_track_id) requests_count,
297 SUM(qht_hint_points) requests_points
299 FROM qpl_hint_tracking
302 ON qht_hint_id = qhtr_hint_fi
304 WHERE qhtr_question_fi = %s
305 AND qhtr_active_fi = %s
309 $res = $ilDB->queryF(
310 $query, array(
'integer',
'integer',
'integer'), array($questionId, $activeId,
$pass)
315 if(
$row[
'requests_points'] === null )
317 $row[
'requests_points'] = 0;
320 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticData.php';
323 $requestsStatisticData->setRequestsCount(
$row[
'requests_count']);
324 $requestsStatisticData->setRequestsPoints(
$row[
'requests_points']);
326 return $requestsStatisticData;
341 $__question_fi__IN__questionIds = $ilDB->in(
'qhtr_question_fi', $questionIds,
false,
'integer');
344 DELETE FROM qpl_hint_tracking
345 WHERE $__question_fi__IN__questionIds
348 $ilDB->manipulate(
$query);
363 $__active_fi__IN__activeIds = $ilDB->in(
'qhtr_active_fi', $activeIds,
false,
'integer');
366 DELETE FROM qpl_hint_tracking
367 WHERE $__active_fi__IN__activeIds
370 $ilDB->manipulate(
$query);