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 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(
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(
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(
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),
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(
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 418 $ilDB->manipulate(
$query);
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 439 $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.
Create styles array
The data for the language used.
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...