4 require_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 135 $res = $ilDB->queryF(
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 173 $res = $ilDB->queryF(
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 218 $res = $ilDB->queryF(
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 260 $res = $ilDB->queryF(
261 $query, array(
'integer',
'integer',
'integer'),
267 while(
$row = $ilDB->fetchAssoc(
$res) )
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 329 $res = $ilDB->queryF(
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;
361 $__question_fi__IN__questionIds = $ilDB->in(
'qhtr_question_fi', $questionIds,
false,
'integer');
364 DELETE FROM qpl_hint_tracking 365 WHERE $__question_fi__IN__questionIds 368 $ilDB->manipulate(
$query);
382 $__active_fi__IN__activeIds = $ilDB->in(
'qhtr_active_fi', $activeIds,
false,
'integer');
385 DELETE FROM qpl_hint_tracking 386 WHERE $__active_fi__IN__activeIds 389 $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)
deleteRequestsByActiveIds($activeIds)
Deletes all hint requests relating to a testactive included in given active ids.
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.
deleteRequestsByQuestionIds($questionIds)
Deletes all hint requests relating to a question included in given question ids.
requestsExist()
Returns the fact wether there exists hint requests for the given question relating to the given testa...