68 return is_array($this->passes);
80 SELECT DISTINCT tst_pass_result.* FROM tst_pass_result 81 LEFT JOIN tst_test_result 82 ON tst_pass_result.pass = tst_test_result.pass 83 AND tst_pass_result.active_fi = tst_test_result.active_fi 84 WHERE tst_pass_result.active_fi = %s 85 ORDER BY tst_pass_result.pass 88 $res = $this->db->queryF(
94 $this->passes = array();
96 while ($row = $this->db->fetchAssoc(
$res)) {
97 $this->passes[$row[
'pass']] = $row;
110 SELECT last_finished_pass FROM tst_active WHERE active_id = %s 113 $res = $this->db->queryF(
119 while ($row = $this->db->fetchAssoc(
$res)) {
149 return $closedPasses;
158 return $reportablePasses;
170 $reportablePasses = array();
172 foreach ($existingPasses as $pass) {
174 $reportablePasses[] = $pass;
178 return $reportablePasses;
183 $closedPasses = array();
185 foreach ($existingPasses as $pass) {
187 $closedPasses[] = $pass;
191 return $closedPasses;
198 foreach ($existingPasses as $pass) {
199 if ($lastPass === null || $pass > $lastPass) {
209 switch ($this->testOBJ->getScoreReporting()) {
220 if ($pass < $lastPass) {
241 throw new ilTestException(
'invalid object state: last finished pass was not set!');
262 $reporting_date = $this->testOBJ->getScoreSettings()->getResultSummarySettings()->getReportingDate();
268 if (!$this->testOBJ->getEnableProcessingTime()) {
272 $startingTime = $this->testOBJ->getStartingTimeOfUser($this->
getActiveId(), $pass);
274 if ($startingTime ===
false) {
278 return $this->testOBJ->isMaxProcessingTimeReached($startingTime, $this->
getActiveId());
287 if ($last_finished_pass === null || $last_finished_pass === -1) {
292 if (!isset(
$passes[$last_finished_pass])) {
295 return $passes[$last_finished_pass][
'tstamp'];
302 if (!isset($this->testPassedOnceCache[
$activeId])) {
303 $this->testPassedOnceCache[
$activeId] =
false;
305 $res = $DIC->database()->queryF(
306 "SELECT passed_once FROM tst_result_cache WHERE active_fi = %s",
311 while ($row = $DIC->database()->fetchAssoc(
$res)) {
312 $this->testPassedOnceCache[
$activeId] = (bool) $row[
'passed_once'];
316 return $this->testPassedOnceCache[
$activeId];
fetchClosedPasses($existingPasses)
const SCORE_REPORTING_AFTER_PASSED
__construct(ilDBInterface $db, ilObjTest $testOBJ)
checkLastFinishedPassInitialised()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const SCORE_REPORTING_IMMIDIATLY
setLastFinishedPass($lastFinishedPass)
fetchReportablePasses($existingPasses)
getLastFinishedPassTimestamp()
isProcessingTimeReached($pass)
const SCORE_REPORTING_FINISHED
const SCORE_REPORTING_DATE
hasTestPassedOnce($activeId)
isReportablePass($lastPass, $pass)
fetchLastPass($existingPasses)