98                $this->anonymous_id = 0;
 
  100                $this->lastsequence = 0;
 
  101                $this->lastPresentationMode = 
null;
 
  102                $this->submitted = FALSE;
 
  103                $this->submittedTimestamp = 
"";
 
  108                $this->lastFinishedPass = 
null;
 
  109                $this->objectiveOrientedContainerId = 0;
 
  119                $this->ref_id = $a_val;
 
  136                if (
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID)
 
  138                        $result = 
$ilDB->queryF(
"SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s",
 
  139                                array(
'integer',
'integer'),
 
  145                                $this->active_id = 
$row[
"active_id"];
 
  146                                $this->user_id = 
$row[
"user_fi"];
 
  147                                $this->anonymous_id = 
$row[
"anonymous_id"];
 
  148                                $this->test_id = 
$row[
"test_fi"];
 
  149                                $this->lastsequence = 
$row[
"lastindex"];
 
  150                                $this->pass = 
$row[
"tries"];
 
  151                                $this->submitted = (
$row[
"submitted"]) ? TRUE : FALSE;
 
  152                                $this->submittedTimestamp = 
$row[
"submittimestamp"];
 
  153                                $this->tstamp = 
$row[
"tstamp"];
 
  172                if (time() - 
$_SESSION[
'tst_last_increase_pass'] > 10)
 
  174                        $_SESSION[
'tst_last_increase_pass'] = time();
 
  175                        $this->tstamp = time();
 
  176                        if ($this->active_id > 0)
 
  178                                $ilDB->update(
'tst_active',
 
  181                                                'tries' => array(
'integer', $this->
getPass()),
 
  184                                                'tstamp' => array(
'integer', time()),
 
  189                                                'active_id' => array(
'integer', $this->
getActiveId())
 
  194                                include_once(
"./Modules/Test/classes/class.ilObjTestAccess.php");
 
  195                                include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
 
  205                                        $next_id = 
$ilDB->nextId(
'tst_active');
 
  207                                        $ilDB->insert(
'tst_active', array(
 
  208                                                'active_id' => array(
'integer', $next_id),
 
  209                                                'user_fi' => array(
'integer', $this->
getUserId()),
 
  211                                                'test_fi' => array(
'integer', $this->
getTestId()),
 
  213                                                'tries' => array(
'integer', $this->
getPass()),
 
  215                                                'submittimestamp' => array(
'timestamp', $submittedTs),
 
  216                                                'tstamp' => array(
'integer', time()),
 
  220                                        $this->active_id = $next_id;
 
  223                                        include_once(
"./Modules/Test/classes/class.ilObjTestAccess.php");
 
  224                                        include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
 
  237                if ($this->active_id > 0)
 
  239                        $ilDB->update(
'tst_active',
 
  242                                        'tries' => array(
'integer', $this->
getPass()),
 
  245                                        'tstamp' => array(
'integer', time()-10),
 
  250                                        'active_id' => array(
'integer', $this->
getActiveId())
 
  255                        include_once(
"./Modules/Test/classes/class.ilObjTestAccess.php");
 
  256                        include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
 
  266                                $next_id = 
$ilDB->nextId(
'tst_active');
 
  267                                $ilDB->insert(
'tst_active',
 
  269                                                'active_id' => array(
'integer', $next_id),
 
  270                                                'user_fi' => array(
'integer', $this->
getUserId()),
 
  272                                                'test_fi' => array(
'integer', $this->
getTestId()),
 
  274                                                'tries' => array(
'integer', $this->
getPass()),
 
  277                                                'tstamp' => array(
'integer', time()-10),
 
  282                                $this->active_id = $next_id;
 
  285                                include_once(
"./Modules/Test/classes/class.ilObjTestAccess.php");
 
  286                                include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
 
  291                include_once 
'./Modules/Test/classes/class.ilObjTestAccess.php';
 
  292                include_once(
"./Services/Tracking/classes/class.ilLearningProgress.php");
 
  310                        $result = $ilDB->queryF(
"SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
 
  311                                array(
'integer',
'integer',
'text'),
 
  317                        $result = 
$ilDB->queryF(
"SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
 
  318                                array(
'integer',
'integer',
'text'),
 
  324                        if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
 
  328                        $result = 
$ilDB->queryF(
"SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s",
 
  329                                array(
'integer',
'integer'),
 
  336                        $this->active_id = 
$row[
"active_id"];
 
  337                        $this->user_id = 
$row[
"user_fi"];
 
  338                        $this->anonymous_id = 
$row[
"anonymous_id"];
 
  339                        $this->test_id = 
$row[
"test_fi"];
 
  340                        $this->lastsequence = 
$row[
"lastindex"];
 
  341                        $this->pass = 
$row[
"tries"];
 
  342                        $this->submitted = (
$row[
"submitted"]) ? TRUE : FALSE;
 
  343                        $this->submittedTimestamp = 
$row[
"submittimestamp"];
 
  344                        $this->tstamp = 
$row[
"tstamp"];
 
  363                $result = 
$ilDB->queryF(
"SELECT * FROM tst_active WHERE active_id = %s", 
 
  370                        $this->active_id = 
$row[
"active_id"];
 
  371                        $this->user_id = 
$row[
"user_fi"];
 
  372                        $this->anonymous_id = 
$row[
"anonymous_id"];
 
  373                        $this->test_id = 
$row[
"test_fi"];
 
  374                        $this->lastsequence = 
$row[
"lastindex"];
 
  375                        $this->pass = 
$row[
"tries"];
 
  376                        $this->submitted = (
$row[
"submitted"]) ? TRUE : FALSE;
 
  377                        $this->submittedTimestamp = 
$row[
"submittimestamp"];
 
  378                        $this->tstamp = 
$row[
"tstamp"];
 
  452                $this->submitted = TRUE;
 
  462                $this->submittedTimestamp = strftime(
"%Y-%m-%d %H:%M:%S");
 
  477                $this->objectiveOrientedContainerId = $objectiveOriented;
 
  496                        array(
'start_lock' => array(
'text', $testStartLock)),
 
  497                        array(
'active_id' => array(
'integer', $this->
getActiveId()))
 
  506                        "SELECT start_lock FROM tst_active WHERE active_id = %s",
 
  510                while(
$row = $ilDB->fetchAssoc(
$res))
 
  512                        return $row[
'start_lock'];
 
  520                if (!is_array(
$_SESSION[self::ACCESS_CODE_SESSION_INDEX]))
 
  535                if( !is_array(
$_SESSION[self::ACCESS_CODE_SESSION_INDEX]) )
 
  550                if( !is_array(
$_SESSION[self::ACCESS_CODE_SESSION_INDEX]) )
 
  573                $query = 
"SELECT anonymous_id FROM tst_active WHERE test_fi = %s AND anonymous_id = %s";
 
  579                return (
$result->numRows() > 0);
 
  593                        $index = mt_rand(0, strlen($codestring)-1);
 
  594                        $code .= substr($codestring, $index, 1);
 
  602                return $this->
getUserId() == ANONYMOUS_USER_ID;
 
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
_getParticipantId($active_id)
Get user id for active id.
_lookupObjIdForTestId($a_test_id)
Lookup object id for test id.
activeIDExists($user_id, $test_id)
setAccessCodeToSession($access_code)
persistTestStartLock($testStartLock)
__construct()
ilTestSession constructor
getAccessCodeFromSession()
setAnonymousId($anonymous_id)
setRefId($a_val)
Set Ref id.
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)
$objectiveOrientedContainerId
const ACCESS_CODE_CHAR_DOMAIN
setLastFinishedPass($lastFinishedPass)
doesAccessCodeInSessionExists()
unsetAccessCodeInSession()