5 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintList.php';
31 if( self::getNumExistingRequests($questionId, $activeId,
$pass) > 0 )
56 SELECT COUNT(qhtr_track_id) cnt
58 FROM qpl_hint_tracking
60 WHERE qhtr_question_fi = %s
61 AND qhtr_active_fi = %s
66 $query, array(
'integer',
'integer',
'integer'), array($questionId, $activeId,
$pass)
91 SELECT COUNT(qht_hint_id) cnt_available,
92 COUNT(qhtr_track_id) cnt_requested
96 LEFT JOIN qpl_hint_tracking
97 ON qhtr_hint_fi = qht_hint_id
98 AND qhtr_active_fi = %s
101 WHERE qht_question_fi = %s
104 $res = $ilDB->queryF(
105 $query, array(
'integer',
'integer',
'integer'), array($activeId,
$pass, $questionId)
110 if(
$row[
'cnt_available'] >
$row[
'cnt_requested'] )
135 SELECT COUNT(qhtr_track_id) cnt
137 FROM qpl_hint_tracking
139 WHERE qhtr_hint_fi = %s
140 AND qhtr_active_fi = %s
144 $res = $ilDB->queryF(
145 $query, array(
'integer',
'integer',
'integer'), array($hintId, $activeId,
$pass)
150 if(
$row[
'cnt'] > 0 )
180 LEFT JOIN qpl_hint_tracking
181 ON qhtr_hint_fi = qht_hint_id
182 AND qhtr_active_fi = %s
185 WHERE qht_question_fi = %s
186 AND qhtr_track_id IS NULL
188 ORDER BY qht_hint_index ASC
193 $res = $ilDB->queryF(
194 $query, array(
'integer',
'integer',
'integer'), array($activeId,
$pass, $questionId)
197 while(
$row = $ilDB->fetchAssoc(
$res) )
204 throw new ilTestException(
"no next hint found for questionId=$questionId, activeId=$activeId, pass=$pass");
227 FROM qpl_hint_tracking
229 WHERE qhtr_question_fi = %s
230 AND qhtr_active_fi = %s
234 $res = $ilDB->queryF(
235 $query, array(
'integer',
'integer',
'integer'), array($questionId, $activeId,
$pass)
240 while(
$row = $ilDB->fetchAssoc(
$res) )
242 $hintIds[] =
$row[
'qhtr_hint_fi'];
247 return $requestedHintsList;
266 $trackId = $ilDB->nextId(
'qpl_hint_tracking');
268 $ilDB->insert(
'qpl_hint_tracking', array(
269 'qhtr_track_id' => array(
'integer', $trackId),
270 'qhtr_active_fi' => array(
'integer', $activeId),
271 'qhtr_pass' => array(
'integer',
$pass),
272 'qhtr_question_fi' => array(
'integer', $questionId),
273 'qhtr_hint_fi' => array(
'integer', $questionHint->
getId()),
297 SELECT COUNT(qhtr_track_id) requests_count,
298 SUM(qht_hint_points) requests_points
300 FROM qpl_hint_tracking
303 ON qht_hint_id = qhtr_hint_fi
305 WHERE qhtr_question_fi = %s
306 AND qhtr_active_fi = %s
310 $res = $ilDB->queryF(
311 $query, array(
'integer',
'integer',
'integer'), array($questionId, $activeId,
$pass)
316 if(
$row[
'requests_points'] === null )
318 $row[
'requests_points'] = 0;
321 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticData.php';
324 $requestsStatisticData->setRequestsCount(
$row[
'requests_count']);
325 $requestsStatisticData->setRequestsPoints(
$row[
'requests_points']);
327 return $requestsStatisticData;
342 $__question_fi__IN__questionIds = $ilDB->in(
'qhtr_question_fi', $questionIds,
false,
'integer');
345 DELETE FROM qpl_hint_tracking
346 WHERE $__question_fi__IN__questionIds
349 $ilDB->manipulate(
$query);
364 $__active_fi__IN__activeIds = $ilDB->in(
'qhtr_active_fi', $activeIds,
false,
'integer');
367 DELETE FROM qpl_hint_tracking
368 WHERE $__active_fi__IN__activeIds
371 $ilDB->manipulate(
$query);