ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilTestSession Class Reference

Test session handler. More...

+ Inheritance diagram for ilTestSession:
+ Collaboration diagram for ilTestSession:

Public Member Functions

 __construct ()
 ilTestSession constructor More...
 
 setRefId ($a_val)
 Set Ref id. More...
 
 getRefId ()
 Get Ref id. More...
 
 increaseTestPass ()
 
 saveToDb ()
 
 loadTestSession ($test_id, $user_id="", $anonymous_id="")
 
 loadFromDb ($active_id)
 Loads the session data for a given active id. More...
 
 getActiveId ()
 
 setUserId ($user_id)
 
 getUserId ()
 
 setTestId ($test_id)
 
 getTestId ()
 
 setAnonymousId ($anonymous_id)
 
 getAnonymousId ()
 
 setLastSequence ($lastsequence)
 
 getLastSequence ()
 
 setPass ($pass)
 
 getPass ()
 
 increasePass ()
 
 isSubmitted ()
 
 setSubmitted ()
 
 getSubmittedTimestamp ()
 
 setSubmittedTimestamp ()
 
 setLastFinishedPass ($lastFinishedPass)
 
 getLastFinishedPass ()
 
 setObjectiveOrientedContainerId ($objectiveOriented)
 
 getObjectiveOrientedContainerId ()
 
 getLastStartedPass ()
 
 setLastStartedPass ($lastStartedPass)
 
 isObjectiveOriented ()
 
 persistTestStartLock ($testStartLock)
 
 lookupTestStartLock ()
 
 setAccessCodeToSession ($access_code)
 
 unsetAccessCodeInSession ()
 
 getAccessCodeFromSession ()
 
 doesAccessCodeInSessionExists ()
 
 createNewAccessCode ()
 
 isAccessCodeUsed ($code)
 
 isAnonymousUser ()
 

Data Fields

const ACCESS_CODE_SESSION_INDEX = "tst_access_code"
 
const ACCESS_CODE_CHAR_DOMAIN = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
 
const ACCESS_CODE_LENGTH = 5
 
 $active_id
 
 $user_id
 
 $anonymous_id
 
 $test_id
 
 $lastsequence
 
 $submitted
 
 $tstamp
 
 $submittedTimestamp
 

Protected Member Functions

 activeIDExists ($user_id, $test_id)
 

Protected Attributes

 $lastPresentationMode
 

Private Member Functions

 buildAccessCode ()
 

Private Attributes

 $lastFinishedPass
 
 $lastStartedPass
 
 $objectiveOrientedContainerId
 

Detailed Description

Test session handler.

This class manages the test session for a participant

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Version
$Id$

Definition at line 13 of file class.ilTestSession.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestSession::__construct ( )

ilTestSession constructor

The constructor takes possible arguments an creates an instance of the ilTestSession object.

@access public

Reimplemented in ilTestSessionDynamicQuestionSet.

Definition at line 96 of file class.ilTestSession.php.

97 {
98 $this->active_id = 0;
99 $this->user_id = 0;
100 $this->anonymous_id = 0;
101 $this->test_id = 0;
102 $this->lastsequence = 0;
103 $this->lastPresentationMode = null;
104 $this->submitted = FALSE;
105 $this->submittedTimestamp = "";
106 $this->pass = 0;
107 $this->ref_id = 0;
108 $this->tstamp = 0;
109
110 $this->lastStartedPass = null;
111 $this->lastFinishedPass = null;
112 $this->objectiveOrientedContainerId = 0;
113 }

Member Function Documentation

◆ activeIDExists()

ilTestSession::activeIDExists (   $user_id,
  $test_id 
)
protected

Definition at line 135 of file class.ilTestSession.php.

136 {
137 global $ilDB;
138
139 if ($GLOBALS['DIC']['ilUser']->getId() != ANONYMOUS_USER_ID)
140 {
141 $result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s",
142 array('integer','integer'),
143 array($user_id, $test_id)
144 );
145 if ($result->numRows())
146 {
147 $row = $ilDB->fetchAssoc($result);
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"];
157
158 $this->setLastStartedPass($row['last_started_pass']);
159 $this->setLastFinishedPass($row['last_finished_pass']);
160 $this->setObjectiveOrientedContainerId((int)$row['objective_container']);
161
162 return true;
163 }
164 }
165 return false;
166 }
$result
setObjectiveOrientedContainerId($objectiveOriented)
setLastFinishedPass($lastFinishedPass)
setLastStartedPass($lastStartedPass)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilDB

References $GLOBALS, $ilDB, $result, $row, $test_id, $user_id, setLastFinishedPass(), setLastStartedPass(), and setObjectiveOrientedContainerId().

Referenced by saveToDb(), and ilTestSessionDynamicQuestionSet\saveToDb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildAccessCode()

ilTestSession::buildAccessCode ( )
private

Definition at line 567 of file class.ilTestSession.php.

568 {
569 // create a 5 character code
570 $codestring = self::ACCESS_CODE_CHAR_DOMAIN;
571
572 mt_srand();
573
574 $code = "";
575
576 for($i = 1; $i <= self::ACCESS_CODE_LENGTH; $i++)
577 {
578 $index = mt_rand(0, strlen($codestring)-1);
579 $code .= substr($codestring, $index, 1);
580 }
581
582 return $code;
583 }
$code
Definition: example_050.php:99

References $code, ACCESS_CODE_CHAR_DOMAIN, and ACCESS_CODE_LENGTH.

Referenced by createNewAccessCode().

+ Here is the caller graph for this function:

◆ createNewAccessCode()

ilTestSession::createNewAccessCode ( )

Definition at line 543 of file class.ilTestSession.php.

544 {
545 do
546 {
547 $code = $this->buildAccessCode();
548 }
549 while( $this->isAccessCodeUsed($code) );
550
551 return $code;
552 }

References $code, buildAccessCode(), and isAccessCodeUsed().

+ Here is the call graph for this function:

◆ doesAccessCodeInSessionExists()

ilTestSession::doesAccessCodeInSessionExists ( )

Definition at line 533 of file class.ilTestSession.php.

534 {
535 if( !is_array($_SESSION[self::ACCESS_CODE_SESSION_INDEX]) )
536 {
537 return false;
538 }
539
540 return isset($_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()]);
541 }
$_SESSION["AccountId"]

References $_SESSION, and getTestId().

Referenced by loadTestSession(), and ilTestSessionDynamicQuestionSet\loadTestSession().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAccessCodeFromSession()

ilTestSession::getAccessCodeFromSession ( )

Definition at line 518 of file class.ilTestSession.php.

519 {
520 if( !is_array($_SESSION[self::ACCESS_CODE_SESSION_INDEX]) )
521 {
522 return null;
523 }
524
525 if( !isset($_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()]) )
526 {
527 return null;
528 }
529
531 }

References $_SESSION, ACCESS_CODE_SESSION_INDEX, and getTestId().

Referenced by loadTestSession(), and ilTestSessionDynamicQuestionSet\loadTestSession().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActiveId()

◆ getAnonymousId()

ilTestSession::getAnonymousId ( )

Definition at line 384 of file class.ilTestSession.php.

385 {
386 return $this->anonymous_id;
387 }

References $anonymous_id.

Referenced by saveToDb(), and ilTestSessionDynamicQuestionSet\saveToDb().

+ Here is the caller graph for this function:

◆ getLastFinishedPass()

ilTestSession::getLastFinishedPass ( )

Definition at line 439 of file class.ilTestSession.php.

440 {
442 }

References $lastFinishedPass.

Referenced by increaseTestPass(), and saveToDb().

+ Here is the caller graph for this function:

◆ getLastSequence()

ilTestSession::getLastSequence ( )

◆ getLastStartedPass()

ilTestSession::getLastStartedPass ( )
Returns
int

Definition at line 457 of file class.ilTestSession.php.

458 {
460 }

References $lastStartedPass.

Referenced by increaseTestPass().

+ Here is the caller graph for this function:

◆ getObjectiveOrientedContainerId()

ilTestSession::getObjectiveOrientedContainerId ( )

◆ getPass()

ilTestSession::getPass ( )

Definition at line 404 of file class.ilTestSession.php.

405 {
406 return $this->pass;
407 }

References $pass.

Referenced by increaseTestPass(), saveToDb(), ilTestSessionDynamicQuestionSet\saveToDb(), ilTestRandomQuestionSetBuilder\storeQuestion(), and ilLOTestQuestionAdapter\updateQuestionResult().

+ Here is the caller graph for this function:

◆ getRefId()

◆ getSubmittedTimestamp()

ilTestSession::getSubmittedTimestamp ( )

Definition at line 424 of file class.ilTestSession.php.

425 {
427 }

References $submittedTimestamp.

Referenced by increaseTestPass(), saveToDb(), and ilTestSessionDynamicQuestionSet\saveToDb().

+ Here is the caller graph for this function:

◆ getTestId()

ilTestSession::getTestId ( )

◆ getUserId()

ilTestSession::getUserId ( )

Definition at line 364 of file class.ilTestSession.php.

365 {
366 return $this->user_id;
367 }

References $user_id.

Referenced by ilLOTestQuestionAdapter\getInstance(), isAnonymousUser(), ilLOTestQuestionAdapter\notifyTestStart(), saveToDb(), and ilTestSessionDynamicQuestionSet\saveToDb().

+ Here is the caller graph for this function:

◆ increasePass()

ilTestSession::increasePass ( )

Definition at line 409 of file class.ilTestSession.php.

410 {
411 $this->pass += 1;
412 }

Referenced by increaseTestPass().

+ Here is the caller graph for this function:

◆ increaseTestPass()

ilTestSession::increaseTestPass ( )

Definition at line 168 of file class.ilTestSession.php.

169 {
170 global $ilDB, $ilLog;
171
172 if( !$this->active_id )
173 {
174 require_once 'Modules/Test/exceptions/class.ilTestException.php';
175 throw new ilTestException('missing active id on test pass increase!');
176 }
177
178 $this->increasePass();
179 $this->setLastSequence(0);
180 $submitted = ($this->isSubmitted()) ? 1 : 0;
181
182 if( !isset($_SESSION[$this->active_id]['tst_last_increase_pass']) )
183 {
184 $_SESSION[$this->active_id]['tst_last_increase_pass'] = 0;
185 }
186
187 // there has to be at least 10 seconds between new test passes (to ensure that noone double clicks the finish button and increases the test pass by more than 1)
188 if (time() - $_SESSION[$this->active_id]['tst_last_increase_pass'] > 10)
189 {
190 $_SESSION[$this->active_id]['tst_last_increase_pass'] = time();
191 $this->tstamp = time();
192 $ilDB->update('tst_active',
193 array(
194 'lastindex' => array('integer', $this->getLastSequence()),
195 'tries' => array('integer', $this->getPass()),
196 'submitted' => array('integer', $submitted),
197 'submittimestamp' => array('timestamp', strlen($this->getSubmittedTimestamp()) ? $this->getSubmittedTimestamp() : NULL),
198 'tstamp' => array('integer', time()),
199 'last_finished_pass' => array('integer', $this->getLastFinishedPass()),
200 'last_started_pass' => array('integer', $this->getLastStartedPass()),
201 'objective_container' => array('integer', (int)$this->getObjectiveOrientedContainerId())
202 ),
203 array(
204 'active_id' => array('integer', $this->getActiveId())
205 )
206 );
207 }
208 }
Base Exception for all Exceptions relating to Modules/Test.
setLastSequence($lastsequence)

References $_SESSION, $active_id, $ilDB, $ilLog, $submitted, getActiveId(), getLastFinishedPass(), getLastSequence(), getLastStartedPass(), getObjectiveOrientedContainerId(), getPass(), getSubmittedTimestamp(), increasePass(), isSubmitted(), and setLastSequence().

+ Here is the call graph for this function:

◆ isAccessCodeUsed()

ilTestSession::isAccessCodeUsed (   $code)

Definition at line 554 of file class.ilTestSession.php.

555 {
556 global $ilDB;
557
558 $query = "SELECT anonymous_id FROM tst_active WHERE test_fi = %s AND anonymous_id = %s";
559
560 $result = $ilDB->queryF(
561 $query, array('integer', 'text'), array($this->getTestId(), $code)
562 );
563
564 return ($result->numRows() > 0);
565 }

References $code, $ilDB, $query, $result, and getTestId().

Referenced by createNewAccessCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAnonymousUser()

ilTestSession::isAnonymousUser ( )

Definition at line 585 of file class.ilTestSession.php.

586 {
587 return $this->getUserId() == ANONYMOUS_USER_ID;
588 }

References getUserId().

+ Here is the call graph for this function:

◆ isObjectiveOriented()

ilTestSession::isObjectiveOriented ( )

Definition at line 470 of file class.ilTestSession.php.

471 {
472 return (bool)$this->getObjectiveOrientedContainerId();
473 }

References getObjectiveOrientedContainerId().

+ Here is the call graph for this function:

◆ isSubmitted()

ilTestSession::isSubmitted ( )

Definition at line 414 of file class.ilTestSession.php.

415 {
416 return $this->submitted;
417 }

References $submitted.

Referenced by increaseTestPass(), saveToDb(), and ilTestSessionDynamicQuestionSet\saveToDb().

+ Here is the caller graph for this function:

◆ loadFromDb()

ilTestSession::loadFromDb (   $active_id)

Loads the session data for a given active id.

Parameters
integer$active_idThe database id of the test session

Reimplemented in ilTestSessionDynamicQuestionSet.

Definition at line 328 of file class.ilTestSession.php.

329 {
330 global $ilDB;
331 $result = $ilDB->queryF("SELECT * FROM tst_active WHERE active_id = %s",
332 array('integer'),
333 array($active_id)
334 );
335 if ($result->numRows())
336 {
337 $row = $ilDB->fetchAssoc($result);
338 $this->active_id = $row["active_id"];
339 $this->user_id = $row["user_fi"];
340 $this->anonymous_id = $row["anonymous_id"];
341 $this->test_id = $row["test_fi"];
342 $this->lastsequence = $row["lastindex"];
343 $this->pass = $row["tries"];
344 $this->submitted = ($row["submitted"]) ? TRUE : FALSE;
345 $this->submittedTimestamp = $row["submittimestamp"];
346 $this->tstamp = $row["tstamp"];
347
348 $this->setLastStartedPass($row['last_started_pass']);
349 $this->setLastFinishedPass($row['last_finished_pass']);
350 $this->setObjectiveOrientedContainerId((int)$row['objective_container']);
351 }
352 }

References $active_id, $ilDB, $result, $row, setLastFinishedPass(), setLastStartedPass(), and setObjectiveOrientedContainerId().

+ Here is the call graph for this function:

◆ loadTestSession()

ilTestSession::loadTestSession (   $test_id,
  $user_id = "",
  $anonymous_id = "" 
)

Reimplemented in ilTestSessionDynamicQuestionSet.

Definition at line 262 of file class.ilTestSession.php.

263 {
264 global $ilDB;
265 global $ilUser;
266
267 if (!$user_id)
268 {
269 $user_id = $ilUser->getId();
270 }
271 if (($GLOBALS['DIC']['ilUser']->getId() == ANONYMOUS_USER_ID) && $this->doesAccessCodeInSessionExists())
272 {
273 $result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
274 array('integer','integer','text'),
276 );
277 }
278 else if (strlen($anonymous_id))
279 {
280 $result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
281 array('integer','integer','text'),
283 );
284 }
285 else
286 {
287 if ($GLOBALS['DIC']['ilUser']->getId() == ANONYMOUS_USER_ID)
288 {
289 return NULL;
290 }
291 $result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s",
292 array('integer','integer'),
293 array($user_id, $test_id)
294 );
295 }
296
297 // TODO bheyser: Refactor
298 $this->user_id = $user_id;
299
300 if ($result->numRows())
301 {
302 $row = $ilDB->fetchAssoc($result);
303 $this->active_id = $row["active_id"];
304 $this->user_id = $row["user_fi"];
305 $this->anonymous_id = $row["anonymous_id"];
306 $this->test_id = $row["test_fi"];
307 $this->lastsequence = $row["lastindex"];
308 $this->pass = $row["tries"];
309 $this->submitted = ($row["submitted"]) ? TRUE : FALSE;
310 $this->submittedTimestamp = $row["submittimestamp"];
311 $this->tstamp = $row["tstamp"];
312
313 $this->setLastStartedPass($row['last_started_pass']);
314 $this->setLastFinishedPass($row['last_finished_pass']);
315 $this->setObjectiveOrientedContainerId((int)$row['objective_container']);
316 }
317 elseif( $this->doesAccessCodeInSessionExists() )
318 {
320 }
321 }
$ilUser
Definition: imgupload.php:18

References $anonymous_id, $GLOBALS, $ilDB, $ilUser, $result, $row, $test_id, $user_id, doesAccessCodeInSessionExists(), getAccessCodeFromSession(), setLastFinishedPass(), setLastStartedPass(), setObjectiveOrientedContainerId(), and unsetAccessCodeInSession().

+ Here is the call graph for this function:

◆ lookupTestStartLock()

ilTestSession::lookupTestStartLock ( )

Definition at line 486 of file class.ilTestSession.php.

487 {
488 global $ilDB;
489
490 $res = $ilDB->queryF(
491 "SELECT start_lock FROM tst_active WHERE active_id = %s",
492 array('integer'), array($this->getActiveId())
493 );
494
495 while($row = $ilDB->fetchAssoc($res))
496 {
497 return $row['start_lock'];
498 }
499
500 return null;
501 }

References $ilDB, $res, $row, and getActiveId().

+ Here is the call graph for this function:

◆ persistTestStartLock()

ilTestSession::persistTestStartLock (   $testStartLock)

Definition at line 475 of file class.ilTestSession.php.

476 {
477 global $ilDB;
478
479 $ilDB->update(
480 'tst_active',
481 array('start_lock' => array('text', $testStartLock)),
482 array('active_id' => array('integer', $this->getActiveId()))
483 );
484 }

References $ilDB, and getActiveId().

+ Here is the call graph for this function:

◆ saveToDb()

ilTestSession::saveToDb ( )

Reimplemented in ilTestSessionDynamicQuestionSet.

Definition at line 210 of file class.ilTestSession.php.

211 {
212 global $ilDB, $ilLog;
213
214 $submitted = ($this->isSubmitted()) ? 1 : 0;
215 if ($this->active_id > 0)
216 {
217 $ilDB->update('tst_active',
218 array(
219 'lastindex' => array('integer', $this->getLastSequence()),
220 'tries' => array('integer', $this->getPass()),
221 'submitted' => array('integer', $submitted),
222 'submittimestamp' => array('timestamp', (strlen($this->getSubmittedTimestamp())) ? $this->getSubmittedTimestamp() : NULL),
223 'tstamp' => array('integer', time()-10),
224 'last_finished_pass' => array('integer', $this->getLastFinishedPass()),
225 'last_started_pass' => array('integer', $this->getPass()),
226 'objective_container' => array('integer', (int)$this->getObjectiveOrientedContainerId())
227 ),
228 array(
229 'active_id' => array('integer', $this->getActiveId())
230 )
231 );
232 }
233 else
234 {
235 if (!$this->activeIDExists($this->getUserId(), $this->getTestId()))
236 {
237 $anonymous_id = ($this->getAnonymousId()) ? $this->getAnonymousId() : NULL;
238
239 $next_id = $ilDB->nextId('tst_active');
240 $ilDB->insert('tst_active',
241 array(
242 'active_id' => array('integer', $next_id),
243 'user_fi' => array('integer', $this->getUserId()),
244 'anonymous_id' => array('text', $anonymous_id),
245 'test_fi' => array('integer', $this->getTestId()),
246 'lastindex' => array('integer', $this->getLastSequence()),
247 'tries' => array('integer', $this->getPass()),
248 'submitted' => array('integer', $submitted),
249 'submittimestamp' => array('timestamp', (strlen($this->getSubmittedTimestamp())) ? $this->getSubmittedTimestamp() : NULL),
250 'tstamp' => array('integer', time()-10),
251 'last_finished_pass' => array('integer', $this->getLastFinishedPass()),
252 'last_started_pass' => array('integer', $this->getPass()),
253 'objective_container' => array('integer', (int)$this->getObjectiveOrientedContainerId())
254 )
255 );
256 $this->active_id = $next_id;
257
258 }
259 }
260 }
activeIDExists($user_id, $test_id)

References $anonymous_id, $ilDB, $ilLog, $submitted, activeIDExists(), getActiveId(), getAnonymousId(), getLastFinishedPass(), getLastSequence(), getObjectiveOrientedContainerId(), getPass(), getSubmittedTimestamp(), getTestId(), getUserId(), and isSubmitted().

+ Here is the call graph for this function:

◆ setAccessCodeToSession()

ilTestSession::setAccessCodeToSession (   $access_code)

Definition at line 503 of file class.ilTestSession.php.

504 {
505 if (!is_array($_SESSION[self::ACCESS_CODE_SESSION_INDEX]))
506 {
508 }
509
510 $_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()] = $access_code;
511 }

References $_SESSION, ACCESS_CODE_SESSION_INDEX, and getTestId().

+ Here is the call graph for this function:

◆ setAnonymousId()

ilTestSession::setAnonymousId (   $anonymous_id)

Definition at line 379 of file class.ilTestSession.php.

380 {
381 $this->anonymous_id = $anonymous_id;
382 }

References $anonymous_id.

◆ setLastFinishedPass()

ilTestSession::setLastFinishedPass (   $lastFinishedPass)

Definition at line 434 of file class.ilTestSession.php.

435 {
436 $this->lastFinishedPass = $lastFinishedPass;
437 }

References $lastFinishedPass.

Referenced by activeIDExists(), loadFromDb(), and loadTestSession().

+ Here is the caller graph for this function:

◆ setLastSequence()

ilTestSession::setLastSequence (   $lastsequence)

Definition at line 389 of file class.ilTestSession.php.

390 {
391 $this->lastsequence = $lastsequence;
392 }

References $lastsequence.

Referenced by increaseTestPass(), and ilTestSessionDynamicQuestionSet\setCurrentQuestionId().

+ Here is the caller graph for this function:

◆ setLastStartedPass()

ilTestSession::setLastStartedPass (   $lastStartedPass)
Parameters
int$lastStartedPass

Definition at line 465 of file class.ilTestSession.php.

466 {
467 $this->lastStartedPass = $lastStartedPass;
468 }

References $lastStartedPass.

Referenced by activeIDExists(), loadFromDb(), and loadTestSession().

+ Here is the caller graph for this function:

◆ setObjectiveOrientedContainerId()

ilTestSession::setObjectiveOrientedContainerId (   $objectiveOriented)

Definition at line 444 of file class.ilTestSession.php.

445 {
446 $this->objectiveOrientedContainerId = $objectiveOriented;
447 }

Referenced by activeIDExists(), loadFromDb(), and loadTestSession().

+ Here is the caller graph for this function:

◆ setPass()

ilTestSession::setPass (   $pass)

Definition at line 399 of file class.ilTestSession.php.

400 {
401 $this->pass = $pass;
402 }

References $pass.

◆ setRefId()

ilTestSession::setRefId (   $a_val)

Set Ref id.

Parameters
integerRef id

Definition at line 120 of file class.ilTestSession.php.

121 {
122 $this->ref_id = $a_val;
123 }

◆ setSubmitted()

ilTestSession::setSubmitted ( )

Definition at line 419 of file class.ilTestSession.php.

420 {
421 $this->submitted = TRUE;
422 }

◆ setSubmittedTimestamp()

ilTestSession::setSubmittedTimestamp ( )

Definition at line 429 of file class.ilTestSession.php.

430 {
431 $this->submittedTimestamp = strftime("%Y-%m-%d %H:%M:%S");
432 }

◆ setTestId()

ilTestSession::setTestId (   $test_id)

Definition at line 369 of file class.ilTestSession.php.

370 {
371 $this->test_id = $test_id;
372 }

References $test_id.

◆ setUserId()

ilTestSession::setUserId (   $user_id)

Definition at line 359 of file class.ilTestSession.php.

360 {
361 $this->user_id = $user_id;
362 }

References $user_id.

◆ unsetAccessCodeInSession()

ilTestSession::unsetAccessCodeInSession ( )

Definition at line 513 of file class.ilTestSession.php.

514 {
515 unset($_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()]);
516 }

References $_SESSION, and getTestId().

Referenced by loadTestSession(), and ilTestSessionDynamicQuestionSet\loadTestSession().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $active_id

ilTestSession::$active_id

◆ $anonymous_id

◆ $lastFinishedPass

ilTestSession::$lastFinishedPass
private

Definition at line 82 of file class.ilTestSession.php.

Referenced by getLastFinishedPass(), and setLastFinishedPass().

◆ $lastPresentationMode

ilTestSession::$lastPresentationMode
protected

Definition at line 59 of file class.ilTestSession.php.

◆ $lastsequence

ilTestSession::$lastsequence

Definition at line 54 of file class.ilTestSession.php.

Referenced by getLastSequence(), and setLastSequence().

◆ $lastStartedPass

ilTestSession::$lastStartedPass
private

Definition at line 84 of file class.ilTestSession.php.

Referenced by getLastStartedPass(), and setLastStartedPass().

◆ $objectiveOrientedContainerId

ilTestSession::$objectiveOrientedContainerId
private

Definition at line 86 of file class.ilTestSession.php.

Referenced by getObjectiveOrientedContainerId().

◆ $submitted

ilTestSession::$submitted

◆ $submittedTimestamp

ilTestSession::$submittedTimestamp

Definition at line 80 of file class.ilTestSession.php.

Referenced by getSubmittedTimestamp().

◆ $test_id

◆ $tstamp

ilTestSession::$tstamp

Definition at line 73 of file class.ilTestSession.php.

◆ $user_id

◆ ACCESS_CODE_CHAR_DOMAIN

const ilTestSession::ACCESS_CODE_CHAR_DOMAIN = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

Definition at line 17 of file class.ilTestSession.php.

Referenced by buildAccessCode().

◆ ACCESS_CODE_LENGTH

const ilTestSession::ACCESS_CODE_LENGTH = 5

Definition at line 19 of file class.ilTestSession.php.

Referenced by buildAccessCode().

◆ ACCESS_CODE_SESSION_INDEX

const ilTestSession::ACCESS_CODE_SESSION_INDEX = "tst_access_code"

Definition at line 15 of file class.ilTestSession.php.

Referenced by getAccessCodeFromSession(), and setAccessCodeToSession().


The documentation for this class was generated from the following file: