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             [
'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             [
'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             [
'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             [
'integer', 
'integer', 
'integer'],
   249             "no next hint found for questionId={$this->getQuestionId()}, activeId={$this->getActiveId()}, pass={$this->getPass()}"   265         $ilDB = $DIC[
'ilDB'];
   270                         FROM            qpl_hint_tracking   272                         WHERE           qhtr_question_fi = %s   273                         AND                     qhtr_active_fi = %s   279             [
'integer', 
'integer', 
'integer'],
   286             $hintIds[] = $row[
'qhtr_hint_fi'];
   291         return $requestedHintsList;
   305         $ilDB = $DIC[
'ilDB'];
   307         $trackId = 
$ilDB->nextId(
'qpl_hint_tracking');
   309         $ilDB->insert(
'qpl_hint_tracking', [
   310             'qhtr_track_id' => [
'integer', $trackId],
   311             'qhtr_active_fi' => [
'integer', $this->
getActiveId()],
   312             'qhtr_pass' => [
'integer', $this->
getPass()],
   314             'qhtr_hint_fi' => [
'integer', $questionHint->
getId()],
   332         $ilDB = $DIC[
'ilDB'];
   335                         SELECT          COUNT(qhtr_track_id) requests_count,   336                                                 SUM(qht_hint_points) requests_points   338                         FROM            qpl_hint_tracking   341                         ON                      qht_hint_id = qhtr_hint_fi   343                         WHERE           qhtr_question_fi = %s   344                         AND                     qhtr_active_fi = %s   350             [
'integer', 
'integer', 
'integer'],
   356         if ($row[
'requests_points'] === null) {
   357             $row[
'requests_points'] = 0;
   361         $requestsStatisticData->setRequestsCount($row[
'requests_count']);
   362         $requestsStatisticData->setRequestsPoints($row[
'requests_points']);
   364         return $requestsStatisticData;
   374         $db = $DIC->database();
   377                         SELECT          qhtr_pass requests_pass,   378                                                 qhtr_question_fi requests_question,   379                                                 COUNT(qhtr_track_id) requests_count,   380                                                 SUM(qht_hint_points) requests_points   382                         FROM            qpl_hint_tracking   385                         ON                      qht_hint_id = qhtr_hint_fi   387                         WHERE           qhtr_active_fi = %s   389                         GROUP BY        qhtr_pass, qhtr_question_fi   400         while ($row = $db->fetchAssoc(
$res)) {
   401             if ($row[
'requests_points'] === null) {
   402                 $row[
'requests_points'] = 0;
   406             $requestsStatisticData->setRequestsCount($row[
'requests_count']);
   407             $requestsStatisticData->setRequestsPoints($row[
'requests_points']);
   409             $register->addRequestByTestPassIndexAndQuestionId($row[
'requests_pass'], $row[
'requests_question'], $requestsStatisticData);
   419     public static function deleteRequestsByQuestionIds($questionIds): 
void   425         $ilDB = $DIC[
'ilDB'];
   427         $__question_fi__IN__questionIds = 
$ilDB->in(
'qhtr_question_fi', $questionIds, 
false, 
'integer');
   430                         DELETE FROM     qpl_hint_tracking   431                         WHERE           $__question_fi__IN__questionIds   434         $ilDB->manipulate($query);
   447         $ilDB = $DIC[
'ilDB'];
   449         $__active_fi__IN__activeIds = 
$ilDB->in(
'qhtr_active_fi', $activeIds, 
false, 
'integer');
   452                         DELETE FROM     qpl_hint_tracking   453                         WHERE           $__active_fi__IN__activeIds   456         $ilDB->manipulate($query);
 
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...