84 $this->anonymous_id = 0;
86 $this->lastsequence = 0;
87 $this->submitted = FALSE;
88 $this->submittedTimestamp =
"";
105 $this->ref_id = $a_val;
126 if (time() -
$_SESSION[
'tst_last_increase_pass'] > 10)
128 $_SESSION[
'tst_last_increase_pass'] = time();
129 $this->tstamp = time();
130 if ($this->active_id > 0)
132 $affectedRows = $ilDB->manipulateF(
"UPDATE tst_active SET lastindex = %s, tries = %s, submitted = %s, submittimestamp = %s, tstamp = %s WHERE active_id = %s",
133 array(
'integer',
'integer',
'integer',
'timestamp',
'integer',
'integer'),
145 include_once(
"./Modules/Test/classes/class.ilObjTestAccess.php");
146 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
154 $next_id = $ilDB->nextId(
'tst_active');
155 $affectedRows = $ilDB->manipulateF(
"INSERT INTO tst_active (active_id, user_fi, anonymous_id, test_fi, lastindex, tries, submitted, submittimestamp, tstamp) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
156 array(
'integer',
'integer',
'text',
'integer',
'integer',
'integer',
'integer',
'timestamp',
'integer'),
169 $this->active_id = $next_id;
172 include_once(
"./Modules/Test/classes/class.ilObjTestAccess.php");
173 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
186 if ($this->active_id > 0)
188 $affectedRows = $ilDB->manipulateF(
"UPDATE tst_active SET lastindex = %s, tries = %s, submitted = %s, submittimestamp = %s, tstamp = %s WHERE active_id = %s",
189 array(
'integer',
'integer',
'integer',
'timestamp',
'integer',
'integer'),
201 include_once(
"./Modules/Test/classes/class.ilObjTestAccess.php");
202 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
209 $next_id = $ilDB->nextId(
'tst_active');
210 $affectedRows = $ilDB->manipulateF(
"INSERT INTO tst_active (active_id, user_fi, anonymous_id, test_fi, lastindex, tries, submitted, submittimestamp, tstamp) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
211 array(
'integer',
'integer',
'text',
'integer',
'integer',
'integer',
'integer',
'timestamp',
'integer'),
224 $this->active_id = $next_id;
227 include_once(
"./Modules/Test/classes/class.ilObjTestAccess.php");
228 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
234 include_once(
"./Services/Tracking/classes/class.ilLearningProgress.php");
252 $result = $ilDB->queryF(
"SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
253 array(
'integer',
'integer',
'text'),
259 $result = $ilDB->queryF(
"SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
260 array(
'integer',
'integer',
'text'),
266 if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
270 $result = $ilDB->queryF(
"SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s",
271 array(
'integer',
'integer'),
275 if ($result->numRows())
277 $row = $ilDB->fetchAssoc($result);
278 $this->active_id =
$row[
"active_id"];
279 $this->user_id =
$row[
"user_fi"];
280 $this->anonymous_id =
$row[
"anonymous_id"];
281 $this->test_id =
$row[
"test_fi"];
282 $this->lastsequence =
$row[
"lastindex"];
283 $this->pass =
$row[
"tries"];
284 $this->submitted = (
$row[
"submitted"]) ? TRUE : FALSE;
285 $this->submittedTimestamp =
$row[
"submittimestamp"];
286 $this->tstamp =
$row[
"tstamp"];
299 $result = $ilDB->queryF(
"SELECT * FROM tst_active WHERE active_id = %s",
303 if ($result->numRows())
305 $row = $ilDB->fetchAssoc($result);
306 $this->active_id =
$row[
"active_id"];
307 $this->user_id =
$row[
"user_fi"];
308 $this->anonymous_id =
$row[
"anonymous_id"];
309 $this->test_id =
$row[
"test_fi"];
310 $this->lastsequence =
$row[
"lastindex"];
311 $this->pass =
$row[
"tries"];
312 $this->submitted = (
$row[
"submitted"]) ? TRUE : FALSE;
313 $this->submittedTimestamp =
$row[
"submittimestamp"];
314 $this->tstamp =
$row[
"tstamp"];
385 $this->submitted = TRUE;
395 $this->submittedTimestamp = date(
'c');