64        $this->anonymous_id = 0;
 
   66        $this->lastsequence = 0;
 
   67        $this->lastPresentationMode = 
null;
 
   68        $this->submitted = 
false;
 
   69        $this->submittedTimestamp = 
"";
 
   74        $this->lastStartedPass = 
null;
 
   75        $this->lastFinishedPass = 
null;
 
   76        $this->objectiveOrientedContainerId = 0;
 
   81        $this->ref_id = $a_val;
 
   95            $result = 
$ilDB->queryF(
 
   96                "SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s",
 
   97                array(
'integer',
'integer'),
 
  100            if ($result->numRows()) {
 
  101                $row = 
$ilDB->fetchAssoc($result);
 
  102                $this->active_id = (
int) $row[
"active_id"];
 
  103                $this->user_id = (
int) $row[
"user_fi"];
 
  104                $this->anonymous_id = $row[
"anonymous_id"];
 
  105                $this->test_id = (
int) $row[
"test_fi"];
 
  106                $this->lastsequence = (
int) $row[
"lastindex"];
 
  107                $this->pass = (
int) $row[
"tries"];
 
  108                $this->submitted = ($row[
"submitted"]) ? 
true : 
false;
 
  109                $this->submittedTimestamp = (string) $row[
"submittimestamp"];
 
  110                $this->tstamp = (
int) $row[
"tstamp"];
 
  126        $ilLog = 
$DIC[
'ilLog'];
 
  128        if (!$this->active_id) {
 
  129            require_once 
'Modules/Test/exceptions/class.ilTestException.php';
 
  137        if (!isset($active[
'tst_last_increase_pass']) || $active[
'tst_last_increase_pass'] !== 
null) {
 
  138            $active[
'tst_last_increase_pass'] = 0;
 
  144        if (time() - $active[
'tst_last_increase_pass'] > 10) {
 
  145            $active[
'tst_last_increase_pass'] = time();
 
  147            $this->tstamp = time();
 
  152                        'tries' => array(
'integer', $this->
getPass()),
 
  155                        'tstamp' => array(
'integer', time()),
 
  161                        'active_id' => array(
'integer', $this->
getActiveId())
 
  171        $ilLog = 
$DIC[
'ilLog'];
 
  174        if ($this->active_id > 0) {
 
  179                    'tries' => array(
'integer', $this->
getPass()),
 
  182                    'tstamp' => array(
'integer', time() - 10),
 
  184                    'last_started_pass' => array(
'integer', $this->
getPass()),
 
  188                    'active_id' => array(
'integer', $this->
getActiveId())
 
  195                $next_id = 
$ilDB->nextId(
'tst_active');
 
  199                        'active_id' => array(
'integer', $next_id),
 
  200                        'user_fi' => array(
'integer', $this->
getUserId()),
 
  202                        'test_fi' => array(
'integer', $this->
getTestId()),
 
  204                        'tries' => array(
'integer', $this->
getPass()),
 
  207                        'tstamp' => array(
'integer', time() - 10),
 
  209                        'last_started_pass' => array(
'integer', $this->
getPass()),
 
  213                $this->active_id = $next_id;
 
  228            $result = 
$ilDB->queryF(
 
  229                "SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
 
  230                array(
'integer',
'integer',
'text'),
 
  234            $result = 
$ilDB->queryF(
 
  235                "SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
 
  236                array(
'integer',
'integer',
'text'),
 
  243            $result = 
$ilDB->queryF(
 
  244                "SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s",
 
  245                array(
'integer',
'integer'),
 
  253        if ($result->numRows()) {
 
  254            $row = 
$ilDB->fetchAssoc($result);
 
  255            $this->active_id = $row[
"active_id"];
 
  256            $this->user_id = $row[
"user_fi"];
 
  257            $this->anonymous_id = $row[
"anonymous_id"];
 
  258            $this->test_id = $row[
"test_fi"];
 
  259            $this->lastsequence = $row[
"lastindex"];
 
  260            $this->pass = $row[
"tries"];
 
  261            $this->submitted = ($row[
"submitted"]) ? 
true : 
false;
 
  262            $this->submittedTimestamp = $row[
"submittimestamp"];
 
  263            $this->tstamp = $row[
"tstamp"];
 
  282        $result = 
$ilDB->queryF(
 
  283            "SELECT * FROM tst_active WHERE active_id = %s",
 
  287        if ($result->numRows()) {
 
  288            $row = 
$ilDB->fetchAssoc($result);
 
  289            $this->active_id = $row[
"active_id"];
 
  290            $this->user_id = $row[
"user_fi"];
 
  291            $this->anonymous_id = $row[
"anonymous_id"];
 
  292            $this->test_id = $row[
"test_fi"];
 
  293            $this->lastsequence = $row[
"lastindex"];
 
  294            $this->pass = $row[
"tries"];
 
  295            $this->submitted = ($row[
"submitted"]) ? 
true : 
false;
 
  296            $this->submittedTimestamp = $row[
"submittimestamp"];
 
  297            $this->tstamp = $row[
"tstamp"];
 
  379        $this->submitted = 
true;
 
  389        $this->submittedTimestamp = date(
'Y-m-d H:i:s');
 
  404        $this->objectiveOrientedContainerId = $objectiveOriented;
 
  440            array(
'start_lock' => array(
'text', $testStartLock)),
 
  441            array(
'active_id' => array(
'integer', $this->
getActiveId()))
 
  451            "SELECT start_lock FROM tst_active WHERE active_id = %s",
 
  457            return $row[
'start_lock'];
 
  469        $session_code[$this->
getTestId()] = $access_code;
 
  477        unset($session_code[$this->
getTestId()]);
 
  488        if (!isset($session_code[$this->
getTestId()])) {
 
  492        return $session_code[$this->
getTestId()];
 
  501        if (!isset($session_code[$this->
getTestId()])) {
 
  505        return isset($session_code[$this->
getTestId()]);
 
  522        $query = 
"SELECT anonymous_id FROM tst_active WHERE test_fi = %s AND anonymous_id = %s";
 
  524        $result = 
$ilDB->queryF(
 
  526            array(
'integer', 
'text'),
 
  530        return ($result->numRows() > 0);
 
  543            $index = mt_rand(0, strlen($codestring) - 1);
 
  544            $code .= substr($codestring, 
$index, 1);
 
  601        require_once 
'Modules/Test/classes/class.ilTestPassesSelector.php';
 
  603        $testPassesSelector->setActiveId($this->
getActiveId());
 
  606        if (count($testPassesSelector->getReportablePasses()) == 1) {
 
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
 
canShowTestResults(ilTestSession $testSession)
 
static get(string $a_var)
 
static set(string $a_var, $a_val)
Set a value.
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
activeIDExists($user_id, $test_id)
 
setAccessCodeToSession($access_code)
 
$reportableResultsAvailable
 
persistTestStartLock($testStartLock)
 
setPasswordChecked(bool $value)
 
string $lastPresentationMode
 
__construct()
ilTestSession constructor
 
getAccessCodeFromSession()
 
setAnonymousId($anonymous_id)
 
string $submittedTimestamp
 
int $objectiveOrientedContainerId
 
setObjectiveOrientedContainerId($objectiveOriented)
 
const ACCESS_CODE_SESSION_INDEX
 
loadTestSession($test_id, $user_id="", $anonymous_id="")
 
loadFromDb($active_id)
Loads the session data for a given active id.
 
getObjectiveOrientedContainerId()
 
setLastSequence($lastsequence)
 
const ACCESS_CODE_CHAR_DOMAIN
 
setLastFinishedPass($lastFinishedPass)
 
doesAccessCodeInSessionExists()
 
reportableResultsAvailable(ilObjTest $testOBJ)
 
setLastStartedPass($lastStartedPass)
 
unsetAccessCodeInSession()
 
hasSinglePassReportable(ilObjTest $testObj)