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.

public

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.

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

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

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'),
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)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
setLastFinishedPass($lastFinishedPass)
setLastStartedPass($lastStartedPass)
Create styles array
The data for the language used.
global $ilDB
+ 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.

References $code, $i, and $index.

Referenced by createNewAccessCode().

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  }
$code
Definition: example_050.php:99
$index
Definition: metadata.php:60
$i
Definition: disco.tpl.php:19
+ Here is the caller graph for this function:

◆ createNewAccessCode()

ilTestSession::createNewAccessCode ( )

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

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

527  {
528  do {
529  $code = $this->buildAccessCode();
530  } while ($this->isAccessCodeUsed($code));
531 
532  return $code;
533  }
$code
Definition: example_050.php:99
+ Here is the call graph for this function:

◆ doesAccessCodeInSessionExists()

ilTestSession::doesAccessCodeInSessionExists ( )

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

References $_SESSION, and getTestId().

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

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"]
+ 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.

References $_SESSION, and getTestId().

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

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 
514  return $_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()];
515  }
$_SESSION["AccountId"]
+ 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.

References $anonymous_id.

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

372  {
373  return $this->anonymous_id;
374  }
+ Here is the caller graph for this function:

◆ getLastFinishedPass()

ilTestSession::getLastFinishedPass ( )

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

References $lastFinishedPass.

Referenced by increaseTestPass(), and saveToDb().

427  {
429  }
+ 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.

References $lastStartedPass.

Referenced by increaseTestPass().

445  {
446  return $this->lastStartedPass;
447  }
+ Here is the caller graph for this function:

◆ getObjectiveOrientedContainerId()

ilTestSession::getObjectiveOrientedContainerId ( )

◆ getPass()

ilTestSession::getPass ( )

◆ getRefId()

◆ getSubmittedTimestamp()

ilTestSession::getSubmittedTimestamp ( )

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

References $submittedTimestamp.

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

412  {
414  }
+ Here is the caller graph for this function:

◆ getTestId()

ilTestSession::getTestId ( )

◆ getUserId()

◆ increasePass()

ilTestSession::increasePass ( )

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

Referenced by increaseTestPass().

397  {
398  $this->pass += 1;
399  }
+ Here is the caller graph for this function:

◆ increaseTestPass()

ilTestSession::increaseTestPass ( )

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

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

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  }
$_SESSION["AccountId"]
Base Exception for all Exceptions relating to Modules/Test.
Create styles array
The data for the language used.
global $ilDB
setLastSequence($lastsequence)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:

◆ isAccessCodeUsed()

ilTestSession::isAccessCodeUsed (   $code)

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

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

Referenced by createNewAccessCode().

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  }
$result
$code
Definition: example_050.php:99
$query
Create styles array
The data for the language used.
global $ilDB
+ 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.

References getUserId().

Referenced by ilTestPlayerAbstractGUI\ensureExistingTestSession().

568  {
569  return $this->getUserId() == ANONYMOUS_USER_ID;
570  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isObjectiveOriented()

ilTestSession::isObjectiveOriented ( )

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

References getObjectiveOrientedContainerId().

458  {
459  return (bool) $this->getObjectiveOrientedContainerId();
460  }
+ Here is the call graph for this function:

◆ isSubmitted()

ilTestSession::isSubmitted ( )

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

References $submitted.

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

402  {
403  return $this->submitted;
404  }
+ 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

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

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

316  {
317  global $ilDB;
318  $result = $ilDB->queryF(
319  "SELECT * FROM tst_active WHERE active_id = %s",
320  array('integer'),
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  }
$result
setObjectiveOrientedContainerId($objectiveOriented)
setLastFinishedPass($lastFinishedPass)
setLastStartedPass($lastStartedPass)
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ loadTestSession()

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

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

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

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'),
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()) {
306  $this->unsetAccessCodeInSession();
307  }
308  }
$result
setObjectiveOrientedContainerId($objectiveOriented)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
setLastFinishedPass($lastFinishedPass)
setLastStartedPass($lastStartedPass)
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ lookupTestStartLock()

ilTestSession::lookupTestStartLock ( )

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

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

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
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ persistTestStartLock()

ilTestSession::persistTestStartLock (   $testStartLock)

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

References $ilDB, array, and getActiveId().

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  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ saveToDb()

ilTestSession::saveToDb ( )

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

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

Referenced by ilTestPlayerAbstractGUI\ensureExistingTestSession().

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  }
Create styles array
The data for the language used.
global $ilDB
activeIDExists($user_id, $test_id)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAccessCodeToSession()

ilTestSession::setAccessCodeToSession (   $access_code)

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

References $_SESSION, array, and getTestId().

491  {
492  if (!is_array($_SESSION[self::ACCESS_CODE_SESSION_INDEX])) {
493  $_SESSION[self::ACCESS_CODE_SESSION_INDEX] = array();
494  }
495 
496  $_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()] = $access_code;
497  }
$_SESSION["AccountId"]
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ setAnonymousId()

ilTestSession::setAnonymousId (   $anonymous_id)

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

References $anonymous_id.

Referenced by ilTestPlayerAbstractGUI\ensureExistingTestSession().

367  {
368  $this->anonymous_id = $anonymous_id;
369  }
+ Here is the caller graph for this function:

◆ setLastFinishedPass()

ilTestSession::setLastFinishedPass (   $lastFinishedPass)

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

References $lastFinishedPass.

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

422  {
423  $this->lastFinishedPass = $lastFinishedPass;
424  }
+ Here is the caller graph for this function:

◆ setLastSequence()

ilTestSession::setLastSequence (   $lastsequence)

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

References $lastsequence.

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

377  {
378  $this->lastsequence = $lastsequence;
379  }
+ Here is the caller graph for this function:

◆ setLastStartedPass()

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

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

References $lastStartedPass.

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

453  {
454  $this->lastStartedPass = $lastStartedPass;
455  }
+ Here is the caller graph for this function:

◆ setObjectiveOrientedContainerId()

ilTestSession::setObjectiveOrientedContainerId (   $objectiveOriented)

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

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

432  {
433  $this->objectiveOrientedContainerId = $objectiveOriented;
434  }
+ Here is the caller graph for this function:

◆ setPass()

ilTestSession::setPass (   $pass)

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

References $pass.

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

◆ 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.

References $test_id.

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

◆ setUserId()

ilTestSession::setUserId (   $user_id)

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

References $user_id.

Referenced by ilTestPlayerAbstractGUI\ensureExistingTestSession().

347  {
348  $this->user_id = $user_id;
349  }
+ Here is the caller graph for this function:

◆ unsetAccessCodeInSession()

ilTestSession::unsetAccessCodeInSession ( )

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

References $_SESSION, and getTestId().

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

500  {
501  unset($_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()]);
502  }
$_SESSION["AccountId"]
+ 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.

◆ ACCESS_CODE_LENGTH

const ilTestSession::ACCESS_CODE_LENGTH = 5

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

◆ ACCESS_CODE_SESSION_INDEX

const ilTestSession::ACCESS_CODE_SESSION_INDEX = "tst_access_code"

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


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