ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAssQuestionHintTracking Class Reference
+ Collaboration diagram for ilAssQuestionHintTracking:

Static Public Member Functions

static requestsExist ($questionId, $activeId, $pass)
 Returns the fact wether there exists hint requests for the given question relating to the given testactive and testpass or not.
static getNumExistingRequests ($questionId, $activeId, $pass)
 Returns the number existing hint requests for the given question relating to the given testactive and testpass or not.
static requestsPossible ($questionId, $activeId, $pass)
 Returns the fact wether (further) hint requests are possible for the given question relating to the given testactive and testpass or not.
static isRequested ($hintId, $activeId, $pass)
 Returns the fact wether the hint for given id is requested for the given testactive and testpass.
static getNextRequestableHint ($questionId, $activeId, $pass)
 Returns the next requestable hint for given question relating to given testactive and testpass.
static getRequestedHintsList ($questionId, $activeId, $pass)
 Returns an object of class ilAssQuestionHintList containing objects of class ilAssQuestionHint for all allready requested hints relating to the given question, testactive and testpass.
static storeRequest (ilAssQuestionHint $questionHint, $questionId, $activeId, $pass)
 Tracks the given hint as requested for the given question, testactive and testpass.
static getRequestStatisticDataByQuestionAndTestpass ($questionId, $activeId, $pass)
 Returns a question hint request statistic data container containing the statistics for all requests relating to given ...
static deleteRequestsByQuestionIds ($questionIds)
 Deletes all hint requests relating to a question included in given question ids.
static deleteRequestsByActiveIds ($activeIds)
 Deletes all hint requests relating to a testactive included in given active ids.

Detailed Description

Definition at line 15 of file class.ilAssQuestionHintTracking.php.

Member Function Documentation

static ilAssQuestionHintTracking::deleteRequestsByActiveIds (   $activeIds)
static

Deletes all hint requests relating to a testactive included in given active ids.

public ilDB $ilDB

Parameters
array[integer]$activeIds

Definition at line 360 of file class.ilAssQuestionHintTracking.php.

References $query.

Referenced by ilObjTest\removeAllTestEditings(), ilObjTest\removeTestResults(), and ilObjTest\removeTestResultsForUser().

{
global $ilDB;
$__active_fi__IN__activeIds = $ilDB->in('qhtr_active_fi', $activeIds, false, 'integer');
$query = "
DELETE FROM qpl_hint_tracking
WHERE $__active_fi__IN__activeIds
";
$ilDB->manipulate($query);
}

+ Here is the caller graph for this function:

static ilAssQuestionHintTracking::deleteRequestsByQuestionIds (   $questionIds)
static

Deletes all hint requests relating to a question included in given question ids.

public ilDB $ilDB

Parameters
array[integer]$questionIds

Definition at line 338 of file class.ilAssQuestionHintTracking.php.

References $query.

Referenced by assQuestion\delete(), and ilObjTest\removeAllTestEditings().

{
global $ilDB;
$__question_fi__IN__questionIds = $ilDB->in('qhtr_question_fi', $questionIds, false, 'integer');
$query = "
DELETE FROM qpl_hint_tracking
WHERE $__question_fi__IN__questionIds
";
$ilDB->manipulate($query);
}

+ Here is the caller graph for this function:

static ilAssQuestionHintTracking::getNextRequestableHint (   $questionId,
  $activeId,
  $pass 
)
static

Returns the next requestable hint for given question relating to given testactive and testpass.

public ilDB $ilDB

Parameters
integer$questionId
integer$activeId
integer$pass
Returns
ilAssQuestionHint $nextRequestableHint
Exceptions
ilTestException

Definition at line 171 of file class.ilAssQuestionHintTracking.php.

References $pass, $query, $res, $row, and ilAssQuestionHint\getInstanceById().

Referenced by ilAssQuestionHintRequestGUI\confirmRequestCmd(), and ilAssQuestionHintRequestGUI\performRequestCmd().

{
global $ilDB;
$query = "
SELECT qht_hint_id
FROM qpl_hints
LEFT JOIN qpl_hint_tracking
ON qhtr_hint_fi = qht_hint_id
AND qhtr_active_fi = %s
AND qhtr_pass = %s
WHERE qht_question_fi = %s
AND qhtr_track_id IS NULL
ORDER BY qht_hint_index ASC
";
$ilDB->setLimit(1);
$res = $ilDB->queryF(
$query, array('integer', 'integer', 'integer'), array($activeId, $pass, $questionId)
);
while( $row = $ilDB->fetchAssoc($res) )
{
$nextHint = ilAssQuestionHint::getInstanceById($row['qht_hint_id']);
return $nextHint;
}
throw new ilTestException("no next hint found for questionId=$questionId, activeId=$activeId, pass=$pass");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilAssQuestionHintTracking::getNumExistingRequests (   $questionId,
  $activeId,
  $pass 
)
static

Returns the number existing hint requests for the given question relating to the given testactive and testpass or not.

public ilDB $ilDB

Parameters
integer$questionId
integer$activeId
integer$pass
Returns
integer $numExisingRequests

Definition at line 51 of file class.ilAssQuestionHintTracking.php.

References $pass, $query, $res, and $row.

Referenced by ilAssQuestionHintRequestGUI\showHintCmd().

{
global $ilDB;
$query = "
SELECT COUNT(qhtr_track_id) cnt
FROM qpl_hint_tracking
WHERE qhtr_question_fi = %s
AND qhtr_active_fi = %s
AND qhtr_pass = %s
";
$res = $ilDB->queryF(
$query, array('integer', 'integer', 'integer'), array($questionId, $activeId, $pass)
);
$row = $ilDB->fetchAssoc($res);
return $row['cnt'];
}

+ Here is the caller graph for this function:

static ilAssQuestionHintTracking::getRequestedHintsList (   $questionId,
  $activeId,
  $pass 
)
static

Returns an object of class ilAssQuestionHintList containing objects of class ilAssQuestionHint for all allready requested hints relating to the given question, testactive and testpass.

public ilDB $ilDB

Parameters
integer$questionId
integer$activeId
integer$pass
Returns
ilAssQuestionHintList $requestedHintsList

Definition at line 220 of file class.ilAssQuestionHintTracking.php.

References $pass, $query, $res, $row, and ilAssQuestionHintList\getListByHintIds().

Referenced by ilAssQuestionHintRequestGUI\showListCmd().

{
global $ilDB;
$query = "
SELECT qhtr_hint_fi
FROM qpl_hint_tracking
WHERE qhtr_question_fi = %s
AND qhtr_active_fi = %s
AND qhtr_pass = %s
";
$res = $ilDB->queryF(
$query, array('integer', 'integer', 'integer'), array($questionId, $activeId, $pass)
);
$hintIds = array();
while( $row = $ilDB->fetchAssoc($res) )
{
$hintIds[] = $row['qhtr_hint_fi'];
}
$requestedHintsList = ilAssQuestionHintList::getListByHintIds($hintIds);
return $requestedHintsList;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilAssQuestionHintTracking::getRequestStatisticDataByQuestionAndTestpass (   $questionId,
  $activeId,
  $pass 
)
static

Returns a question hint request statistic data container containing the statistics for all requests relating to given ...

  • question
  • testactive
  • testpass

public ilDB $ilDB

Parameters
integer$questionId
integer$activeId
integer$pass
Returns
ilAssQuestionHintRequestStatisticData $requestsStatisticData

Definition at line 292 of file class.ilAssQuestionHintTracking.php.

References $pass, $query, $res, and $row.

Referenced by assQuestion\calculateResultsFromSolution(), and assQuestion\getAdjustedReachedPoints().

{
global $ilDB;
$query = "
SELECT COUNT(qhtr_track_id) requests_count,
SUM(qht_hint_points) requests_points
FROM qpl_hint_tracking
INNER JOIN qpl_hints
ON qht_hint_id = qhtr_hint_fi
WHERE qhtr_question_fi = %s
AND qhtr_active_fi = %s
AND qhtr_pass = %s
";
$res = $ilDB->queryF(
$query, array('integer', 'integer', 'integer'), array($questionId, $activeId, $pass)
);
$row = $ilDB->fetchAssoc($res);
if( $row['requests_points'] === null )
{
$row['requests_points'] = 0;
}
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestStatisticData.php';
$requestsStatisticData = new ilAssQuestionHintRequestStatisticData();
$requestsStatisticData->setRequestsCount($row['requests_count']);
$requestsStatisticData->setRequestsPoints($row['requests_points']);
return $requestsStatisticData;
}

+ Here is the caller graph for this function:

static ilAssQuestionHintTracking::isRequested (   $hintId,
  $activeId,
  $pass 
)
static

Returns the fact wether the hint for given id is requested for the given testactive and testpass.

public ilDB $ilDB

Parameters
integer$hintId
integer$activeId
integer$pass
Returns
boolean $isRequested

Definition at line 130 of file class.ilAssQuestionHintTracking.php.

References $pass, $query, $res, and $row.

Referenced by ilAssQuestionHintRequestGUI\showHintCmd().

{
global $ilDB;
$query = "
SELECT COUNT(qhtr_track_id) cnt
FROM qpl_hint_tracking
WHERE qhtr_hint_fi = %s
AND qhtr_active_fi = %s
AND qhtr_pass = %s
";
$res = $ilDB->queryF(
$query, array('integer', 'integer', 'integer'), array($hintId, $activeId, $pass)
);
$row = $ilDB->fetchAssoc($res);
if( $row['cnt'] > 0 )
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

static ilAssQuestionHintTracking::requestsExist (   $questionId,
  $activeId,
  $pass 
)
static

Returns the fact wether there exists hint requests for the given question relating to the given testactive and testpass or not.

public ilDB $ilDB

Parameters
integer$questionId
integer$activeId
integer$pass
Returns
boolean $requestsExist

Definition at line 29 of file class.ilAssQuestionHintTracking.php.

References $pass.

Referenced by ilTestOutputGUI\fillQuestionRelatedNavigation().

{
if( self::getNumExistingRequests($questionId, $activeId, $pass) > 0 )
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

static ilAssQuestionHintTracking::requestsPossible (   $questionId,
  $activeId,
  $pass 
)
static

Returns the fact wether (further) hint requests are possible for the given question relating to the given testactive and testpass or not.

public ilDB $ilDB

Parameters
integer$questionId
integer$activeId
integer$pass
Returns
boolean $requestsPossible

Definition at line 86 of file class.ilAssQuestionHintTracking.php.

References $pass, $query, $res, and $row.

Referenced by ilTestOutputGUI\fillQuestionRelatedNavigation().

{
global $ilDB;
$query = "
SELECT COUNT(qht_hint_id) cnt_available,
COUNT(qhtr_track_id) cnt_requested
FROM qpl_hints
LEFT JOIN qpl_hint_tracking
ON qhtr_hint_fi = qht_hint_id
AND qhtr_active_fi = %s
AND qhtr_pass = %s
WHERE qht_question_fi = %s
";
$res = $ilDB->queryF(
$query, array('integer', 'integer', 'integer'), array($activeId, $pass, $questionId)
);
$row = $ilDB->fetchAssoc($res);
if( $row['cnt_available'] > $row['cnt_requested'] )
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

static ilAssQuestionHintTracking::storeRequest ( ilAssQuestionHint  $questionHint,
  $questionId,
  $activeId,
  $pass 
)
static

Tracks the given hint as requested for the given question, testactive and testpass.

public ilDB $ilDB

Parameters
ilAssQuestionHint$questionHint
integer$questionId
integer$activeId
integer$pass

Definition at line 262 of file class.ilAssQuestionHintTracking.php.

References $pass, and ilAssQuestionHint\getId().

Referenced by ilAssQuestionHintRequestGUI\performRequestCmd().

{
global $ilDB;
$trackId = $ilDB->nextId('qpl_hint_tracking');
$ilDB->insert('qpl_hint_tracking', array(
'qhtr_track_id' => array('integer', $trackId),
'qhtr_active_fi' => array('integer', $activeId),
'qhtr_pass' => array('integer', $pass),
'qhtr_question_fi' => array('integer', $questionId),
'qhtr_hint_fi' => array('integer', $questionHint->getId()),
));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: