4require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintList.php';
89 SELECT COUNT(qhtr_track_id) cnt
91 FROM qpl_hint_tracking
93 WHERE qhtr_question_fi = %s
94 AND qhtr_active_fi = %s
100 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
137 array(
'integer',
'integer',
'integer'),
143 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
175 array(
'integer',
'integer',
'integer'),
181 if (
$row[
'cnt'] > 0) {
206 LEFT JOIN qpl_hint_tracking
207 ON qhtr_hint_fi = qht_hint_id
208 AND qhtr_active_fi = %s
211 WHERE qht_question_fi = %s
212 AND qhtr_track_id IS NULL
214 ORDER BY qht_hint_index ASC
221 array(
'integer',
'integer',
'integer'),
225 while (
$row = $ilDB->fetchAssoc(
$res)) {
231 require_once
'Modules/Test/exceptions/class.ilTestNoNextRequestableHintExistsException.php';
234 "no next hint found for questionId={$this->getQuestionId()}, activeId={$this->getActiveId()}, pass={$this->getPass()}"
254 FROM qpl_hint_tracking
256 WHERE qhtr_question_fi = %s
257 AND qhtr_active_fi = %s
263 array(
'integer',
'integer',
'integer'),
270 $hintIds[] =
$row[
'qhtr_hint_fi'];
275 return $requestedHintsList;
290 $trackId =
$ilDB->nextId(
'qpl_hint_tracking');
292 $ilDB->insert(
'qpl_hint_tracking', array(
293 'qhtr_track_id' => array(
'integer', $trackId),
294 'qhtr_active_fi' => array(
'integer', $this->
getActiveId()),
295 'qhtr_pass' => array(
'integer', $this->
getPass()),
296 'qhtr_question_fi' => array(
'integer', $this->
getQuestionId()),
297 'qhtr_hint_fi' => array(
'integer', $questionHint->
getId()),
317 SELECT COUNT(qhtr_track_id) requests_count,
318 SUM(qht_hint_points) requests_points
320 FROM qpl_hint_tracking
323 ON qht_hint_id = qhtr_hint_fi
325 WHERE qhtr_question_fi = %s
326 AND qhtr_active_fi = %s
332 array(
'integer',
'integer',
'integer'),
338 if (
$row[
'requests_points'] ===
null) {
339 $row[
'requests_points'] = 0;
342 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticData.php';
345 $requestsStatisticData->setRequestsCount(
$row[
'requests_count']);
346 $requestsStatisticData->setRequestsPoints(
$row[
'requests_points']);
348 return $requestsStatisticData;
357 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticRegister.php';
358 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticData.php';
361 $db =
$DIC->database();
364 SELECT qhtr_pass requests_pass,
365 qhtr_question_fi requests_question,
366 COUNT(qhtr_track_id) requests_count,
367 SUM(qht_hint_points) requests_points
369 FROM qpl_hint_tracking
372 ON qht_hint_id = qhtr_hint_fi
374 WHERE qhtr_active_fi = %s
376 GROUP BY qhtr_pass, qhtr_question_fi
387 while (
$row = $db->fetchAssoc(
$res)) {
388 if (
$row[
'requests_points'] ===
null) {
389 $row[
'requests_points'] = 0;
393 $requestsStatisticData->setRequestsCount(
$row[
'requests_count']);
394 $requestsStatisticData->setRequestsPoints(
$row[
'requests_points']);
396 $register->addRequestByTestPassIndexAndQuestionId(
$row[
'requests_pass'],
$row[
'requests_question'], $requestsStatisticData);
406 public static function deleteRequestsByQuestionIds($questionIds)
413 $__question_fi__IN__questionIds =
$ilDB->in(
'qhtr_question_fi', $questionIds,
false,
'integer');
416 DELETE FROM qpl_hint_tracking
417 WHERE $__question_fi__IN__questionIds
434 $__active_fi__IN__activeIds =
$ilDB->in(
'qhtr_active_fi', $activeIds,
false,
'integer');
437 DELETE FROM qpl_hint_tracking
438 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
foreach($_POST as $key=> $value) $res