54 return is_array($this->passes);
66 SELECT DISTINCT tst_pass_result.* FROM tst_pass_result
67 LEFT JOIN tst_test_result
68 ON tst_pass_result.pass = tst_test_result.pass
69 AND tst_pass_result.active_fi = tst_test_result.active_fi
70 WHERE tst_pass_result.active_fi = %s
71 ORDER BY tst_pass_result.pass
74 $res = $this->db->queryF(
80 $this->passes = array();
82 while (
$row = $this->db->fetchAssoc(
$res)) {
96 SELECT last_finished_pass FROM tst_active WHERE active_id = %s
99 $res = $this->db->queryF(
105 while (
$row = $this->db->fetchAssoc(
$res)) {
130 return $closedPasses;
139 return $reportablePasses;
151 $reportablePasses = array();
153 foreach ($existingPasses as
$pass) {
155 $reportablePasses[] =
$pass;
159 return $reportablePasses;
164 $closedPasses = array();
166 foreach ($existingPasses as
$pass) {
168 $closedPasses[] =
$pass;
172 return $closedPasses;
179 foreach ($existingPasses as
$pass) {
180 if ($lastPass ===
null ||
$pass > $lastPass) {
190 switch ($this->testOBJ->getScoreReporting()) {
201 if (
$pass < $lastPass) {
222 throw new ilTestException(
'invalid object state: last finished pass was not set!');
243 $reg =
'/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/';
244 $date = $this->testOBJ->getReportingDate();
247 if (!preg_match($reg, $date, $matches)) {
251 $repTS = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
253 return time() >= $repTS;
258 if (!$this->testOBJ->getEnableProcessingTime()) {
262 $startingTime = $this->testOBJ->getStartingTimeOfUser($this->
getActiveId(),
$pass);
264 if ($startingTime ===
false) {
268 return $this->testOBJ->isMaxProcessingTimeReached($startingTime, $this->
getActiveId());
288 if (!isset($this->testPassedOnceCache[
$activeId])) {
289 $this->testPassedOnceCache[
$activeId] =
false;
292 "SELECT passed_once FROM tst_result_cache WHERE active_fi = %s",
298 $this->testPassedOnceCache[
$activeId] = (bool)
$row[
'passed_once'];
302 return $this->testPassedOnceCache[
$activeId];
An exception for terminatinating execution or to throw for unit testing.
const SCORE_REPORTING_IMMIDIATLY
const SCORE_REPORTING_FINISHED
const SCORE_REPORTING_AFTER_PASSED
const SCORE_REPORTING_DATE
Base Exception for all Exceptions relating to Modules/Test.
fetchLastPass($existingPasses)
isProcessingTimeReached($pass)
__construct(ilDBInterface $db, ilObjTest $testOBJ)
checkLastFinishedPassInitialised()
getLastFinishedPassTimestamp()
setLastFinishedPass($lastFinishedPass)
hasTestPassedOnce($activeId)
fetchClosedPasses($existingPasses)
fetchReportablePasses($existingPasses)
isReportablePass($lastPass, $pass)
foreach($_POST as $key=> $value) $res