100 $ilDB = $DIC[
'ilDB'];
103 SELECT COUNT(qhtr_track_id) cnt 105 FROM qpl_hint_tracking 107 WHERE qhtr_question_fi = %s 108 AND qhtr_active_fi = %s 114 array(
'integer',
'integer',
'integer'),
134 $ilDB = $DIC[
'ilDB'];
137 SELECT COUNT(qht_hint_id) cnt_available, 138 COUNT(qhtr_track_id) cnt_requested 142 LEFT JOIN qpl_hint_tracking 143 ON qhtr_hint_fi = qht_hint_id 144 AND qhtr_active_fi = %s 147 WHERE qht_question_fi = %s 152 array(
'integer',
'integer',
'integer'),
158 if ($row[
'cnt_available'] > $row[
'cnt_requested']) {
177 $ilDB = $DIC[
'ilDB'];
180 SELECT COUNT(qhtr_track_id) cnt 182 FROM qpl_hint_tracking 184 WHERE qhtr_hint_fi = %s 185 AND qhtr_active_fi = %s 191 array(
'integer',
'integer',
'integer'),
197 if ($row[
'cnt'] > 0) {
216 $ilDB = $DIC[
'ilDB'];
223 LEFT JOIN qpl_hint_tracking 224 ON qhtr_hint_fi = qht_hint_id 225 AND qhtr_active_fi = %s 228 WHERE qht_question_fi = %s 229 AND qhtr_track_id IS NULL 231 ORDER BY qht_hint_index ASC 238 array(
'integer',
'integer',
'integer'),
248 require_once
'Modules/Test/exceptions/class.ilTestNoNextRequestableHintExistsException.php';
251 "no next hint found for questionId={$this->getQuestionId()}, activeId={$this->getActiveId()}, pass={$this->getPass()}" 267 $ilDB = $DIC[
'ilDB'];
272 FROM qpl_hint_tracking 274 WHERE qhtr_question_fi = %s 275 AND qhtr_active_fi = %s 281 array(
'integer',
'integer',
'integer'),
288 $hintIds[] = $row[
'qhtr_hint_fi'];
293 return $requestedHintsList;
307 $ilDB = $DIC[
'ilDB'];
309 $trackId =
$ilDB->nextId(
'qpl_hint_tracking');
311 $ilDB->insert(
'qpl_hint_tracking', array(
312 'qhtr_track_id' => array(
'integer', $trackId),
313 'qhtr_active_fi' => array(
'integer', $this->
getActiveId()),
314 'qhtr_pass' => array(
'integer', $this->
getPass()),
315 'qhtr_question_fi' => array(
'integer', $this->
getQuestionId()),
316 'qhtr_hint_fi' => array(
'integer', $questionHint->
getId()),
334 $ilDB = $DIC[
'ilDB'];
337 SELECT COUNT(qhtr_track_id) requests_count, 338 SUM(qht_hint_points) requests_points 340 FROM qpl_hint_tracking 343 ON qht_hint_id = qhtr_hint_fi 345 WHERE qhtr_question_fi = %s 346 AND qhtr_active_fi = %s 352 array(
'integer',
'integer',
'integer'),
358 if ($row[
'requests_points'] === null) {
359 $row[
'requests_points'] = 0;
362 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticData.php';
365 $requestsStatisticData->setRequestsCount($row[
'requests_count']);
366 $requestsStatisticData->setRequestsPoints($row[
'requests_points']);
368 return $requestsStatisticData;
377 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticRegister.php';
378 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticData.php';
381 $db = $DIC->database();
384 SELECT qhtr_pass requests_pass, 385 qhtr_question_fi requests_question, 386 COUNT(qhtr_track_id) requests_count, 387 SUM(qht_hint_points) requests_points 389 FROM qpl_hint_tracking 392 ON qht_hint_id = qhtr_hint_fi 394 WHERE qhtr_active_fi = %s 396 GROUP BY qhtr_pass, qhtr_question_fi 407 while ($row = $db->fetchAssoc(
$res)) {
408 if ($row[
'requests_points'] === null) {
409 $row[
'requests_points'] = 0;
413 $requestsStatisticData->setRequestsCount($row[
'requests_count']);
414 $requestsStatisticData->setRequestsPoints($row[
'requests_points']);
416 $register->addRequestByTestPassIndexAndQuestionId($row[
'requests_pass'], $row[
'requests_question'], $requestsStatisticData);
426 public static function deleteRequestsByQuestionIds($questionIds):
void 432 $ilDB = $DIC[
'ilDB'];
434 $__question_fi__IN__questionIds =
$ilDB->in(
'qhtr_question_fi', $questionIds,
false,
'integer');
437 DELETE FROM qpl_hint_tracking 438 WHERE $__question_fi__IN__questionIds 454 $ilDB = $DIC[
'ilDB'];
456 $__active_fi__IN__activeIds =
$ilDB->in(
'qhtr_active_fi', $activeIds,
false,
'integer');
459 DELETE FROM qpl_hint_tracking 460 WHERE $__active_fi__IN__activeIds
getNumExistingRequests()
Returns the number existing hint requests for the given question relating to the given testactive and...
static getInstanceById($hintId)
creates a hint object instance, loads the persisted hint dataset identified by passed hint id from da...
getRequestedHintsList()
Returns an object of class ilAssQuestionHintList containing objects of class ilAssQuestionHint for al...
__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...
setQuestionId($questionId)
static getRequestRequestStatisticDataRegisterByActiveId($activeId)
requestsPossible()
Returns the fact wether (further) hint requests are possible for the given question relating to the g...
getId()
returns the hint id
getNextRequestableHint()
Returns the next requestable hint for given question relating to given testactive and testpass...
static getListByHintIds($hintIds)
instantiates a question hint list for the passed hint ids
storeRequest(ilAssQuestionHint $questionHint)
Tracks the given hint as requested for the given question, testactive and testpass.
static deleteRequestsByActiveIds($activeIds)
Deletes all hint requests relating to a testactive included in given active ids.
requestsExist()
Returns the fact wether there exists hint requests for the given question relating to the given testa...