ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 $result = $ilDB->queryF(
141 "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 $row = $ilDB->fetchAssoc($result);
147 $this->active_id = $row["active_id"];
148 $this->user_id = $row["user_fi"];
149 $this->anonymous_id = $row["anonymous_id"];
150 $this->test_id = $row["test_fi"];
151 $this->lastsequence = $row["lastindex"];
152 $this->pass = $row["tries"];
153 $this->submitted = ($row["submitted"]) ? true : false;
154 $this->submittedTimestamp = $row["submittimestamp"];
155 $this->tstamp = $row["tstamp"];
156
157 $this->setLastStartedPass($row['last_started_pass']);
158 $this->setLastFinishedPass($row['last_finished_pass']);
159 $this->setObjectiveOrientedContainerId((int) $row['objective_container']);
160
161 return true;
162 }
163 }
164 return false;
165 }
$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 550 of file class.ilTestSession.php.

551 {
552 // create a 5 character code
553 $codestring = self::ACCESS_CODE_CHAR_DOMAIN;
554
555 mt_srand();
556
557 $code = "";
558
559 for ($i = 1; $i <= self::ACCESS_CODE_LENGTH; $i++) {
560 $index = mt_rand(0, strlen($codestring)-1);
561 $code .= substr($codestring, $index, 1);
562 }
563
564 return $code;
565 }
$i
Definition: disco.tpl.php:19
$code
Definition: example_050.php:99
$index
Definition: metadata.php:60

References $code, $i, $index, 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 526 of file class.ilTestSession.php.

527 {
528 do {
529 $code = $this->buildAccessCode();
530 } while ($this->isAccessCodeUsed($code));
531
532 return $code;
533 }

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

+ Here is the call graph for this function:

◆ doesAccessCodeInSessionExists()

ilTestSession::doesAccessCodeInSessionExists ( )

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

518 {
519 if (!is_array($_SESSION[self::ACCESS_CODE_SESSION_INDEX])) {
520 return false;
521 }
522
523 return isset($_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()]);
524 }
$_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 504 of file class.ilTestSession.php.

505 {
506 if (!is_array($_SESSION[self::ACCESS_CODE_SESSION_INDEX])) {
507 return null;
508 }
509
510 if (!isset($_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()])) {
511 return null;
512 }
513
515 }

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 371 of file class.ilTestSession.php.

372 {
373 return $this->anonymous_id;
374 }

References $anonymous_id.

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

+ Here is the caller graph for this function:

◆ getLastFinishedPass()

ilTestSession::getLastFinishedPass ( )

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

427 {
429 }

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 444 of file class.ilTestSession.php.

445 {
447 }

References $lastStartedPass.

Referenced by increaseTestPass().

+ Here is the caller graph for this function:

◆ getObjectiveOrientedContainerId()

ilTestSession::getObjectiveOrientedContainerId ( )

◆ getPass()

ilTestSession::getPass ( )

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

392 {
393 return $this->pass;
394 }

References $pass.

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

+ Here is the caller graph for this function:

◆ getRefId()

ilTestSession::getRefId ( )

Get Ref id.

Returns
integer Ref id

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

131 {
132 return $this->ref_id;
133 }

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

+ Here is the caller graph for this function:

◆ getSubmittedTimestamp()

ilTestSession::getSubmittedTimestamp ( )

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

412 {
414 }

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 351 of file class.ilTestSession.php.

352 {
353 return $this->user_id;
354 }

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 396 of file class.ilTestSession.php.

397 {
398 $this->pass += 1;
399 }

Referenced by increaseTestPass().

+ Here is the caller graph for this function:

◆ increaseTestPass()

ilTestSession::increaseTestPass ( )

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

168 {
169 global $ilDB, $ilLog;
170
171 if (!$this->active_id) {
172 require_once 'Modules/Test/exceptions/class.ilTestException.php';
173 throw new ilTestException('missing active id on test pass increase!');
174 }
175
176 $this->increasePass();
177 $this->setLastSequence(0);
178 $submitted = ($this->isSubmitted()) ? 1 : 0;
179
180 if (!isset($_SESSION[$this->active_id]['tst_last_increase_pass'])) {
181 $_SESSION[$this->active_id]['tst_last_increase_pass'] = 0;
182 }
183
184 // 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)
185 if (time() - $_SESSION[$this->active_id]['tst_last_increase_pass'] > 10) {
186 $_SESSION[$this->active_id]['tst_last_increase_pass'] = time();
187 $this->tstamp = time();
188 $ilDB->update(
189 'tst_active',
190 array(
191 'lastindex' => array('integer', $this->getLastSequence()),
192 'tries' => array('integer', $this->getPass()),
193 'submitted' => array('integer', $submitted),
194 'submittimestamp' => array('timestamp', strlen($this->getSubmittedTimestamp()) ? $this->getSubmittedTimestamp() : null),
195 'tstamp' => array('integer', time()),
196 'last_finished_pass' => array('integer', $this->getLastFinishedPass()),
197 'last_started_pass' => array('integer', $this->getLastStartedPass()),
198 'objective_container' => array('integer', (int) $this->getObjectiveOrientedContainerId())
199 ),
200 array(
201 'active_id' => array('integer', $this->getActiveId())
202 )
203 );
204 }
205 }
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 535 of file class.ilTestSession.php.

536 {
537 global $ilDB;
538
539 $query = "SELECT anonymous_id FROM tst_active WHERE test_fi = %s AND anonymous_id = %s";
540
541 $result = $ilDB->queryF(
542 $query,
543 array('integer', 'text'),
544 array($this->getTestId(), $code)
545 );
546
547 return ($result->numRows() > 0);
548 }
$query

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 567 of file class.ilTestSession.php.

568 {
569 return $this->getUserId() == ANONYMOUS_USER_ID;
570 }

References getUserId().

+ Here is the call graph for this function:

◆ isObjectiveOriented()

ilTestSession::isObjectiveOriented ( )

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

458 {
459 return (bool) $this->getObjectiveOrientedContainerId();
460 }

References getObjectiveOrientedContainerId().

+ Here is the call graph for this function:

◆ isSubmitted()

ilTestSession::isSubmitted ( )

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

402 {
403 return $this->submitted;
404 }

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 315 of file class.ilTestSession.php.

316 {
317 global $ilDB;
318 $result = $ilDB->queryF(
319 "SELECT * FROM tst_active WHERE active_id = %s",
320 array('integer'),
321 array($active_id)
322 );
323 if ($result->numRows()) {
324 $row = $ilDB->fetchAssoc($result);
325 $this->active_id = $row["active_id"];
326 $this->user_id = $row["user_fi"];
327 $this->anonymous_id = $row["anonymous_id"];
328 $this->test_id = $row["test_fi"];
329 $this->lastsequence = $row["lastindex"];
330 $this->pass = $row["tries"];
331 $this->submitted = ($row["submitted"]) ? true : false;
332 $this->submittedTimestamp = $row["submittimestamp"];
333 $this->tstamp = $row["tstamp"];
334
335 $this->setLastStartedPass($row['last_started_pass']);
336 $this->setLastFinishedPass($row['last_finished_pass']);
337 $this->setObjectiveOrientedContainerId((int) $row['objective_container']);
338 }
339 }

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 256 of file class.ilTestSession.php.

257 {
258 global $ilDB;
259 global $ilUser;
260
261 if (!$user_id) {
262 $user_id = $ilUser->getId();
263 }
264 if (($GLOBALS['DIC']['ilUser']->getId() == ANONYMOUS_USER_ID) && $this->doesAccessCodeInSessionExists()) {
265 $result = $ilDB->queryF(
266 "SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
267 array('integer','integer','text'),
269 );
270 } elseif (strlen($anonymous_id)) {
271 $result = $ilDB->queryF(
272 "SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
273 array('integer','integer','text'),
275 );
276 } else {
277 if ($GLOBALS['DIC']['ilUser']->getId() == ANONYMOUS_USER_ID) {
278 return null;
279 }
280 $result = $ilDB->queryF(
281 "SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s",
282 array('integer','integer'),
283 array($user_id, $test_id)
284 );
285 }
286
287 // TODO bheyser: Refactor
288 $this->user_id = $user_id;
289
290 if ($result->numRows()) {
291 $row = $ilDB->fetchAssoc($result);
292 $this->active_id = $row["active_id"];
293 $this->user_id = $row["user_fi"];
294 $this->anonymous_id = $row["anonymous_id"];
295 $this->test_id = $row["test_fi"];
296 $this->lastsequence = $row["lastindex"];
297 $this->pass = $row["tries"];
298 $this->submitted = ($row["submitted"]) ? true : false;
299 $this->submittedTimestamp = $row["submittimestamp"];
300 $this->tstamp = $row["tstamp"];
301
302 $this->setLastStartedPass($row['last_started_pass']);
303 $this->setLastFinishedPass($row['last_finished_pass']);
304 $this->setObjectiveOrientedContainerId((int) $row['objective_container']);
305 } elseif ($this->doesAccessCodeInSessionExists()) {
307 }
308 }
$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 473 of file class.ilTestSession.php.

474 {
475 global $ilDB;
476
477 $res = $ilDB->queryF(
478 "SELECT start_lock FROM tst_active WHERE active_id = %s",
479 array('integer'),
480 array($this->getActiveId())
481 );
482
483 while ($row = $ilDB->fetchAssoc($res)) {
484 return $row['start_lock'];
485 }
486
487 return null;
488 }
foreach($_POST as $key=> $value) $res

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

+ Here is the call graph for this function:

◆ persistTestStartLock()

ilTestSession::persistTestStartLock (   $testStartLock)

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

463 {
464 global $ilDB;
465
466 $ilDB->update(
467 'tst_active',
468 array('start_lock' => array('text', $testStartLock)),
469 array('active_id' => array('integer', $this->getActiveId()))
470 );
471 }

References $ilDB, and getActiveId().

+ Here is the call graph for this function:

◆ saveToDb()

ilTestSession::saveToDb ( )

Reimplemented in ilTestSessionDynamicQuestionSet.

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

208 {
209 global $ilDB, $ilLog;
210
211 $submitted = ($this->isSubmitted()) ? 1 : 0;
212 if ($this->active_id > 0) {
213 $ilDB->update(
214 'tst_active',
215 array(
216 'lastindex' => array('integer', $this->getLastSequence()),
217 'tries' => array('integer', $this->getPass()),
218 'submitted' => array('integer', $submitted),
219 'submittimestamp' => array('timestamp', (strlen($this->getSubmittedTimestamp())) ? $this->getSubmittedTimestamp() : null),
220 'tstamp' => array('integer', time()-10),
221 'last_finished_pass' => array('integer', $this->getLastFinishedPass()),
222 'last_started_pass' => array('integer', $this->getPass()),
223 'objective_container' => array('integer', (int) $this->getObjectiveOrientedContainerId())
224 ),
225 array(
226 'active_id' => array('integer', $this->getActiveId())
227 )
228 );
229 } else {
230 if (!$this->activeIDExists($this->getUserId(), $this->getTestId())) {
231 $anonymous_id = ($this->getAnonymousId()) ? $this->getAnonymousId() : null;
232
233 $next_id = $ilDB->nextId('tst_active');
234 $ilDB->insert(
235 'tst_active',
236 array(
237 'active_id' => array('integer', $next_id),
238 'user_fi' => array('integer', $this->getUserId()),
239 'anonymous_id' => array('text', $anonymous_id),
240 'test_fi' => array('integer', $this->getTestId()),
241 'lastindex' => array('integer', $this->getLastSequence()),
242 'tries' => array('integer', $this->getPass()),
243 'submitted' => array('integer', $submitted),
244 'submittimestamp' => array('timestamp', (strlen($this->getSubmittedTimestamp())) ? $this->getSubmittedTimestamp() : null),
245 'tstamp' => array('integer', time()-10),
246 'last_finished_pass' => array('integer', $this->getLastFinishedPass()),
247 'last_started_pass' => array('integer', $this->getPass()),
248 'objective_container' => array('integer', (int) $this->getObjectiveOrientedContainerId())
249 )
250 );
251 $this->active_id = $next_id;
252 }
253 }
254 }
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 490 of file class.ilTestSession.php.

491 {
492 if (!is_array($_SESSION[self::ACCESS_CODE_SESSION_INDEX])) {
494 }
495
496 $_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()] = $access_code;
497 }

References $_SESSION, ACCESS_CODE_SESSION_INDEX, and getTestId().

+ Here is the call graph for this function:

◆ setAnonymousId()

ilTestSession::setAnonymousId (   $anonymous_id)

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

367 {
368 $this->anonymous_id = $anonymous_id;
369 }

References $anonymous_id.

◆ setLastFinishedPass()

ilTestSession::setLastFinishedPass (   $lastFinishedPass)

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

422 {
423 $this->lastFinishedPass = $lastFinishedPass;
424 }

References $lastFinishedPass.

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

+ Here is the caller graph for this function:

◆ setLastSequence()

ilTestSession::setLastSequence (   $lastsequence)

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

377 {
378 $this->lastsequence = $lastsequence;
379 }

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 452 of file class.ilTestSession.php.

453 {
454 $this->lastStartedPass = $lastStartedPass;
455 }

References $lastStartedPass.

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

+ Here is the caller graph for this function:

◆ setObjectiveOrientedContainerId()

ilTestSession::setObjectiveOrientedContainerId (   $objectiveOriented)

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

432 {
433 $this->objectiveOrientedContainerId = $objectiveOriented;
434 }

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

+ Here is the caller graph for this function:

◆ setPass()

ilTestSession::setPass (   $pass)

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

387 {
388 $this->pass = $pass;
389 }

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 406 of file class.ilTestSession.php.

407 {
408 $this->submitted = true;
409 }

◆ setSubmittedTimestamp()

ilTestSession::setSubmittedTimestamp ( )

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

417 {
418 $this->submittedTimestamp = strftime("%Y-%m-%d %H:%M:%S");
419 }

◆ setTestId()

ilTestSession::setTestId (   $test_id)

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

357 {
358 $this->test_id = $test_id;
359 }

References $test_id.

◆ setUserId()

ilTestSession::setUserId (   $user_id)

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

347 {
348 $this->user_id = $user_id;
349 }

References $user_id.

◆ unsetAccessCodeInSession()

ilTestSession::unsetAccessCodeInSession ( )

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

500 {
501 unset($_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()]);
502 }

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: