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)) {
83 $this->passes[$row[
'pass']] = $row;
96 SELECT last_finished_pass FROM tst_active WHERE active_id = %s 99 $res = $this->db->queryF(
105 while ($row = $this->db->fetchAssoc(
$res)) {
135 return $closedPasses;
144 return $reportablePasses;
156 $reportablePasses = array();
158 foreach ($existingPasses as
$pass) {
160 $reportablePasses[] =
$pass;
164 return $reportablePasses;
169 $closedPasses = array();
171 foreach ($existingPasses as
$pass) {
173 $closedPasses[] =
$pass;
177 return $closedPasses;
184 foreach ($existingPasses as
$pass) {
185 if ($lastPass === null || $pass > $lastPass) {
195 switch ($this->testOBJ->getScoreReporting()) {
206 if (
$pass < $lastPass) {
227 throw new ilTestException(
'invalid object state: last finished pass was not set!');
248 $reg =
'/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/';
249 $date = $this->testOBJ->getReportingDate();
252 if (!preg_match($reg, $date, $matches)) {
256 $repTS = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
258 return time() >= $repTS;
263 if (!$this->testOBJ->getEnableProcessingTime()) {
267 $startingTime = $this->testOBJ->getStartingTimeOfUser($this->
getActiveId(),
$pass);
269 if ($startingTime ===
false) {
273 return $this->testOBJ->isMaxProcessingTimeReached($startingTime, $this->
getActiveId());
293 if (!isset($this->testPassedOnceCache[
$activeId])) {
294 $this->testPassedOnceCache[
$activeId] =
false;
296 $res = $DIC->database()->queryF(
297 "SELECT passed_once FROM tst_result_cache WHERE active_fi = %s",
302 while ($row = $DIC->database()->fetchAssoc(
$res)) {
303 $this->testPassedOnceCache[
$activeId] = (bool) $row[
'passed_once'];
307 return $this->testPassedOnceCache[
$activeId];
fetchClosedPasses($existingPasses)
const SCORE_REPORTING_AFTER_PASSED
__construct(ilDBInterface $db, ilObjTest $testOBJ)
checkLastFinishedPassInitialised()
Base Exception for all Exceptions relating to Modules/Test.
const SCORE_REPORTING_IMMIDIATLY
foreach($_POST as $key=> $value) $res
setLastFinishedPass($lastFinishedPass)
fetchReportablePasses($existingPasses)
getLastFinishedPassTimestamp()
isProcessingTimeReached($pass)
const SCORE_REPORTING_FINISHED
const SCORE_REPORTING_DATE
hasTestPassedOnce($activeId)
isReportablePass($lastPass, $pass)
fetchLastPass($existingPasses)