100 $this->anonymous_id = 0;
102 $this->lastsequence = 0;
103 $this->lastPresentationMode = null;
104 $this->submitted =
false;
105 $this->submittedTimestamp =
"";
110 $this->lastStartedPass = null;
111 $this->lastFinishedPass = null;
112 $this->objectiveOrientedContainerId = 0;
122 $this->ref_id = $a_val;
132 return $this->ref_id;
138 $ilDB = $DIC[
'ilDB'];
140 if (
$GLOBALS[
'DIC'][
'ilUser']->getId() != ANONYMOUS_USER_ID) {
142 "SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s",
143 array(
'integer',
'integer'),
148 $this->active_id =
$row[
"active_id"];
149 $this->user_id =
$row[
"user_fi"];
150 $this->anonymous_id =
$row[
"anonymous_id"];
151 $this->test_id =
$row[
"test_fi"];
152 $this->lastsequence =
$row[
"lastindex"];
153 $this->pass =
$row[
"tries"];
154 $this->submitted = (
$row[
"submitted"]) ?
true :
false;
155 $this->submittedTimestamp =
$row[
"submittimestamp"];
156 $this->tstamp =
$row[
"tstamp"];
171 $ilDB = $DIC[
'ilDB'];
174 if (!$this->active_id) {
175 require_once
'Modules/Test/exceptions/class.ilTestException.php';
183 if (!isset(
$_SESSION[$this->active_id][
'tst_last_increase_pass'])) {
190 $this->tstamp = time();
195 'tries' => array(
'integer', $this->
getPass()),
198 'tstamp' => array(
'integer', time()),
204 'active_id' => array(
'integer', $this->
getActiveId())
213 $ilDB = $DIC[
'ilDB'];
217 if ($this->active_id > 0) {
222 'tries' => array(
'integer', $this->
getPass()),
225 'tstamp' => array(
'integer', time() - 10),
227 'last_started_pass' => array(
'integer', $this->
getPass()),
231 'active_id' => array(
'integer', $this->
getActiveId())
238 $next_id =
$ilDB->nextId(
'tst_active');
242 'active_id' => array(
'integer', $next_id),
243 'user_fi' => array(
'integer', $this->
getUserId()),
245 'test_fi' => array(
'integer', $this->
getTestId()),
247 'tries' => array(
'integer', $this->
getPass()),
250 'tstamp' => array(
'integer', time() - 10),
252 'last_started_pass' => array(
'integer', $this->
getPass()),
256 $this->active_id = $next_id;
264 $ilDB = $DIC[
'ilDB'];
272 "SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
273 array(
'integer',
'integer',
'text'),
278 "SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
279 array(
'integer',
'integer',
'text'),
283 if (
$GLOBALS[
'DIC'][
'ilUser']->getId() == ANONYMOUS_USER_ID) {
287 "SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s",
288 array(
'integer',
'integer'),
298 $this->active_id =
$row[
"active_id"];
299 $this->user_id =
$row[
"user_fi"];
300 $this->anonymous_id =
$row[
"anonymous_id"];
301 $this->test_id =
$row[
"test_fi"];
302 $this->lastsequence =
$row[
"lastindex"];
303 $this->pass =
$row[
"tries"];
304 $this->submitted = (
$row[
"submitted"]) ?
true :
false;
305 $this->submittedTimestamp =
$row[
"submittimestamp"];
306 $this->tstamp =
$row[
"tstamp"];
324 $ilDB = $DIC[
'ilDB'];
326 "SELECT * FROM tst_active WHERE active_id = %s",
332 $this->active_id =
$row[
"active_id"];
333 $this->user_id =
$row[
"user_fi"];
334 $this->anonymous_id =
$row[
"anonymous_id"];
335 $this->test_id =
$row[
"test_fi"];
336 $this->lastsequence =
$row[
"lastindex"];
337 $this->pass =
$row[
"tries"];
338 $this->submitted = (
$row[
"submitted"]) ?
true :
false;
339 $this->submittedTimestamp =
$row[
"submittimestamp"];
340 $this->tstamp =
$row[
"tstamp"];
415 $this->submitted =
true;
425 $this->submittedTimestamp = strftime(
"%Y-%m-%d %H:%M:%S");
440 $this->objectiveOrientedContainerId = $objectiveOriented;
472 $ilDB = $DIC[
'ilDB'];
476 array(
'start_lock' => array(
'text', $testStartLock)),
477 array(
'active_id' => array(
'integer', $this->
getActiveId()))
484 $ilDB = $DIC[
'ilDB'];
487 "SELECT start_lock FROM tst_active WHERE active_id = %s",
493 return $row[
'start_lock'];
501 if (!is_array(
$_SESSION[self::ACCESS_CODE_SESSION_INDEX])) {
502 $_SESSION[self::ACCESS_CODE_SESSION_INDEX] = array();
515 if (!is_array(
$_SESSION[self::ACCESS_CODE_SESSION_INDEX])) {
528 if (!is_array(
$_SESSION[self::ACCESS_CODE_SESSION_INDEX])) {
547 $ilDB = $DIC[
'ilDB'];
549 $query =
"SELECT anonymous_id FROM tst_active WHERE test_fi = %s AND anonymous_id = %s";
553 array(
'integer',
'text'),
557 return (
$result->numRows() > 0);
563 $codestring = self::ACCESS_CODE_CHAR_DOMAIN;
569 for (
$i = 1;
$i <= self::ACCESS_CODE_LENGTH;
$i++) {
570 $index = mt_rand(0, strlen($codestring) - 1);
579 return $this->
getUserId() == ANONYMOUS_USER_ID;
615 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
620 if (count($testPassesSelector->getReportablePasses()) == 1) {
const ACCESS_CODE_CHAR_DOMAIN
$objectiveOrientedContainerId
getAccessCodeFromSession()
setObjectiveOrientedContainerId($objectiveOriented)
setRefId($a_val)
Set Ref id.
__construct()
ilTestSession constructor
doesAccessCodeInSessionExists()
setAnonymousId($anonymous_id)
getObjectiveOrientedContainerId()
Base Exception for all Exceptions relating to Modules/Test.
const ACCESS_CODE_SESSION_INDEX
setAccessCodeToSession($access_code)
loadFromDb($active_id)
Loads the session data for a given active id.
reportableResultsAvailable(ilObjTest $testOBJ)
setLastFinishedPass($lastFinishedPass)
foreach($_POST as $key=> $value) $res
$reportableResultsAvailable
setLastStartedPass($lastStartedPass)
unsetAccessCodeInSession()
hasSinglePassReportable(ilObjTest $testObj)
persistTestStartLock($testStartLock)
setLastSequence($lastsequence)
activeIDExists($user_id, $test_id)
canShowTestResults(ilTestSession $testSession)
loadTestSession($test_id, $user_id="", $anonymous_id="")
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.