4require_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
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
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
219 $query, array(
'integer',
'integer',
'integer'),
223 while(
$row = $ilDB->fetchAssoc(
$res) )
230 require_once
'Modules/Test/exceptions/class.ilTestNoNextRequestableHintExistsException.php';
233 "no next hint found for questionId={$this->getQuestionId()}, activeId={$this->getActiveId()}, pass={$this->getPass()}"
253 FROM qpl_hint_tracking
255 WHERE qhtr_question_fi = %s
256 AND qhtr_active_fi = %s
261 $query, array(
'integer',
'integer',
'integer'),
269 $hintIds[] =
$row[
'qhtr_hint_fi'];
274 return $requestedHintsList;
289 $trackId =
$ilDB->nextId(
'qpl_hint_tracking');
291 $ilDB->insert(
'qpl_hint_tracking', array(
292 'qhtr_track_id' => array(
'integer', $trackId),
293 'qhtr_active_fi' => array(
'integer', $this->
getActiveId()),
294 'qhtr_pass' => array(
'integer', $this->
getPass()),
295 'qhtr_question_fi' => array(
'integer', $this->
getQuestionId()),
296 'qhtr_hint_fi' => array(
'integer', $questionHint->
getId()),
316 SELECT COUNT(qhtr_track_id) requests_count,
317 SUM(qht_hint_points) requests_points
319 FROM qpl_hint_tracking
322 ON qht_hint_id = qhtr_hint_fi
324 WHERE qhtr_question_fi = %s
325 AND qhtr_active_fi = %s
330 $query, array(
'integer',
'integer',
'integer'),
336 if(
$row[
'requests_points'] ===
null )
338 $row[
'requests_points'] = 0;
341 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticData.php';
344 $requestsStatisticData->setRequestsCount(
$row[
'requests_count']);
345 $requestsStatisticData->setRequestsPoints(
$row[
'requests_points']);
347 return $requestsStatisticData;
356 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticRegister.php';
357 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticData.php';
359 global
$DIC; $db =
$DIC->database();
362 SELECT qhtr_pass requests_pass,
363 qhtr_question_fi requests_question,
364 COUNT(qhtr_track_id) requests_count,
365 SUM(qht_hint_points) requests_points
367 FROM qpl_hint_tracking
370 ON qht_hint_id = qhtr_hint_fi
372 WHERE qhtr_active_fi = %s
374 GROUP BY qhtr_pass, qhtr_question_fi
383 while(
$row = $db->fetchAssoc(
$res) )
385 if(
$row[
'requests_points'] ===
null )
387 $row[
'requests_points'] = 0;
391 $requestsStatisticData->setRequestsCount(
$row[
'requests_count']);
392 $requestsStatisticData->setRequestsPoints(
$row[
'requests_points']);
394 $register->addRequestByTestPassIndexAndQuestionId(
$row[
'requests_pass'],
$row[
'requests_question'], $requestsStatisticData);
404 public static function deleteRequestsByQuestionIds($questionIds)
411 $__question_fi__IN__questionIds =
$ilDB->in(
'qhtr_question_fi', $questionIds,
false,
'integer');
414 DELETE FROM qpl_hint_tracking
415 WHERE $__question_fi__IN__questionIds
432 $__active_fi__IN__activeIds =
$ilDB->in(
'qhtr_active_fi', $activeIds,
false,
'integer');
435 DELETE FROM qpl_hint_tracking
436 WHERE $__active_fi__IN__activeIds
An exception for terminatinating execution or to throw for unit testing.
static getListByHintIds($hintIds)
instantiates a question hint list for the passed hint ids
static deleteRequestsByActiveIds($activeIds)
Deletes all hint requests relating to a testactive included in given active ids.
__construct($questionId, $activeId, $pass)
isRequested($hintId)
Returns the fact wether the hint for given id is requested for the given testactive and testpass.
getRequestStatisticDataByQuestionAndTestpass()
Returns a question hint request statistic data container containing the statistics for all requests r...
getNextRequestableHint()
Returns the next requestable hint for given question relating to given testactive and testpass.
requestsPossible()
Returns the fact wether (further) hint requests are possible for the given question relating to the g...
storeRequest(ilAssQuestionHint $questionHint)
Tracks the given hint as requested for the given question, testactive and testpass.
static getRequestRequestStatisticDataRegisterByActiveId($activeId)
getRequestedHintsList()
Returns an object of class ilAssQuestionHintList containing objects of class ilAssQuestionHint for al...
getNumExistingRequests()
Returns the number existing hint requests for the given question relating to the given testactive and...
setQuestionId($questionId)
requestsExist()
Returns the fact wether there exists hint requests for the given question relating to the given testa...
static getInstanceById($hintId)
creates a hint object instance, loads the persisted hint dataset identified by passed hint id from da...
getId()
returns the hint id