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 101 array(
'integer',
'integer',
'integer'),
121 $ilDB = $DIC[
'ilDB'];
124 SELECT COUNT(qht_hint_id) cnt_available, 125 COUNT(qhtr_track_id) cnt_requested 129 LEFT JOIN qpl_hint_tracking 130 ON qhtr_hint_fi = qht_hint_id 131 AND qhtr_active_fi = %s 134 WHERE qht_question_fi = %s 139 array(
'integer',
'integer',
'integer'),
145 if (
$row[
'cnt_available'] >
$row[
'cnt_requested']) {
164 $ilDB = $DIC[
'ilDB'];
167 SELECT COUNT(qhtr_track_id) cnt 169 FROM qpl_hint_tracking 171 WHERE qhtr_hint_fi = %s 172 AND qhtr_active_fi = %s 178 array(
'integer',
'integer',
'integer'),
184 if (
$row[
'cnt'] > 0) {
203 $ilDB = $DIC[
'ilDB'];
210 LEFT JOIN qpl_hint_tracking 211 ON qhtr_hint_fi = qht_hint_id 212 AND qhtr_active_fi = %s 215 WHERE qht_question_fi = %s 216 AND qhtr_track_id IS NULL 218 ORDER BY qht_hint_index ASC 225 array(
'integer',
'integer',
'integer'),
235 require_once
'Modules/Test/exceptions/class.ilTestNoNextRequestableHintExistsException.php';
238 "no next hint found for questionId={$this->getQuestionId()}, activeId={$this->getActiveId()}, pass={$this->getPass()}" 254 $ilDB = $DIC[
'ilDB'];
259 FROM qpl_hint_tracking 261 WHERE qhtr_question_fi = %s 262 AND qhtr_active_fi = %s 268 array(
'integer',
'integer',
'integer'),
275 $hintIds[] =
$row[
'qhtr_hint_fi'];
280 return $requestedHintsList;
294 $ilDB = $DIC[
'ilDB'];
296 $trackId =
$ilDB->nextId(
'qpl_hint_tracking');
298 $ilDB->insert(
'qpl_hint_tracking', array(
299 'qhtr_track_id' => array(
'integer', $trackId),
300 'qhtr_active_fi' => array(
'integer', $this->
getActiveId()),
301 'qhtr_pass' => array(
'integer', $this->
getPass()),
302 'qhtr_question_fi' => array(
'integer', $this->
getQuestionId()),
303 'qhtr_hint_fi' => array(
'integer', $questionHint->
getId()),
321 $ilDB = $DIC[
'ilDB'];
324 SELECT COUNT(qhtr_track_id) requests_count, 325 SUM(qht_hint_points) requests_points 327 FROM qpl_hint_tracking 330 ON qht_hint_id = qhtr_hint_fi 332 WHERE qhtr_question_fi = %s 333 AND qhtr_active_fi = %s 339 array(
'integer',
'integer',
'integer'),
345 if (
$row[
'requests_points'] === null) {
346 $row[
'requests_points'] = 0;
349 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticData.php';
352 $requestsStatisticData->setRequestsCount(
$row[
'requests_count']);
353 $requestsStatisticData->setRequestsPoints(
$row[
'requests_points']);
355 return $requestsStatisticData;
364 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticRegister.php';
365 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticData.php';
368 $db = $DIC->database();
371 SELECT qhtr_pass requests_pass, 372 qhtr_question_fi requests_question, 373 COUNT(qhtr_track_id) requests_count, 374 SUM(qht_hint_points) requests_points 376 FROM qpl_hint_tracking 379 ON qht_hint_id = qhtr_hint_fi 381 WHERE qhtr_active_fi = %s 383 GROUP BY qhtr_pass, qhtr_question_fi 394 while (
$row = $db->fetchAssoc(
$res)) {
395 if (
$row[
'requests_points'] === null) {
396 $row[
'requests_points'] = 0;
400 $requestsStatisticData->setRequestsCount(
$row[
'requests_count']);
401 $requestsStatisticData->setRequestsPoints(
$row[
'requests_points']);
403 $register->addRequestByTestPassIndexAndQuestionId(
$row[
'requests_pass'],
$row[
'requests_question'], $requestsStatisticData);
413 public static function deleteRequestsByQuestionIds($questionIds)
419 $ilDB = $DIC[
'ilDB'];
421 $__question_fi__IN__questionIds =
$ilDB->in(
'qhtr_question_fi', $questionIds,
false,
'integer');
424 DELETE FROM qpl_hint_tracking 425 WHERE $__question_fi__IN__questionIds 441 $ilDB = $DIC[
'ilDB'];
443 $__active_fi__IN__activeIds =
$ilDB->in(
'qhtr_active_fi', $activeIds,
false,
'integer');
446 DELETE FROM qpl_hint_tracking 447 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
foreach($_POST as $key=> $value) $res
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...