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.

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, 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  {
141  $result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s",
142  array('integer','integer'),
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)
$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 567 of file class.ilTestSession.php.

References $code.

Referenced by createNewAccessCode().

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
+ Here is the caller graph for this function:

◆ createNewAccessCode()

ilTestSession::createNewAccessCode ( )

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

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

544  {
545  do
546  {
547  $code = $this->buildAccessCode();
548  }
549  while( $this->isAccessCodeUsed($code) );
550 
551  return $code;
552  }
$code
Definition: example_050.php:99
+ Here is the call graph for this function:

◆ doesAccessCodeInSessionExists()

ilTestSession::doesAccessCodeInSessionExists ( )

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

References $_SESSION, and getTestId().

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

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

References $_SESSION, and getTestId().

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

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 
530  return $_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()];
531  }
$_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 384 of file class.ilTestSession.php.

References $anonymous_id.

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

385  {
386  return $this->anonymous_id;
387  }
+ Here is the caller graph for this function:

◆ getLastFinishedPass()

ilTestSession::getLastFinishedPass ( )

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

References $lastFinishedPass.

Referenced by increaseTestPass(), and saveToDb().

440  {
442  }
+ 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.

References $lastStartedPass.

Referenced by increaseTestPass().

458  {
459  return $this->lastStartedPass;
460  }
+ Here is the caller graph for this function:

◆ getObjectiveOrientedContainerId()

ilTestSession::getObjectiveOrientedContainerId ( )

◆ getPass()

ilTestSession::getPass ( )

◆ getRefId()

◆ getSubmittedTimestamp()

ilTestSession::getSubmittedTimestamp ( )

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

References $submittedTimestamp.

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

425  {
427  }
+ Here is the caller graph for this function:

◆ getTestId()

ilTestSession::getTestId ( )

◆ getUserId()

◆ increasePass()

ilTestSession::increasePass ( )

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

Referenced by increaseTestPass().

410  {
411  $this->pass += 1;
412  }
+ Here is the caller graph for this function:

◆ increaseTestPass()

ilTestSession::increaseTestPass ( )

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

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

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  }
$_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 554 of file class.ilTestSession.php.

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

Referenced by createNewAccessCode().

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  }
$result
$code
Definition: example_050.php:99
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 585 of file class.ilTestSession.php.

References getUserId().

Referenced by ilTestPlayerAbstractGUI\ensureExistingTestSession().

586  {
587  return $this->getUserId() == ANONYMOUS_USER_ID;
588  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isObjectiveOriented()

ilTestSession::isObjectiveOriented ( )

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

References getObjectiveOrientedContainerId().

471  {
472  return (bool)$this->getObjectiveOrientedContainerId();
473  }
+ Here is the call graph for this function:

◆ isSubmitted()

ilTestSession::isSubmitted ( )

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

References $submitted.

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

415  {
416  return $this->submitted;
417  }
+ 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 328 of file class.ilTestSession.php.

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

329  {
330  global $ilDB;
331  $result = $ilDB->queryF("SELECT * FROM tst_active WHERE active_id = %s",
332  array('integer'),
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  }
$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 262 of file class.ilTestSession.php.

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

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'),
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  {
319  $this->unsetAccessCodeInSession();
320  }
321  }
$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 486 of file class.ilTestSession.php.

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

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

References $ilDB, array, and getActiveId().

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

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

Referenced by ilTestPlayerAbstractGUI\ensureExistingTestSession().

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

References $_SESSION, array, and getTestId().

504  {
505  if (!is_array($_SESSION[self::ACCESS_CODE_SESSION_INDEX]))
506  {
507  $_SESSION[self::ACCESS_CODE_SESSION_INDEX] = array();
508  }
509 
510  $_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()] = $access_code;
511  }
$_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 379 of file class.ilTestSession.php.

References $anonymous_id.

Referenced by ilTestPlayerAbstractGUI\ensureExistingTestSession().

380  {
381  $this->anonymous_id = $anonymous_id;
382  }
+ Here is the caller graph for this function:

◆ setLastFinishedPass()

ilTestSession::setLastFinishedPass (   $lastFinishedPass)

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

References $lastFinishedPass.

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

435  {
436  $this->lastFinishedPass = $lastFinishedPass;
437  }
+ Here is the caller graph for this function:

◆ setLastSequence()

ilTestSession::setLastSequence (   $lastsequence)

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

References $lastsequence.

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

390  {
391  $this->lastsequence = $lastsequence;
392  }
+ Here is the caller graph for this function:

◆ setLastStartedPass()

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

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

References $lastStartedPass.

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

466  {
467  $this->lastStartedPass = $lastStartedPass;
468  }
+ Here is the caller graph for this function:

◆ setObjectiveOrientedContainerId()

ilTestSession::setObjectiveOrientedContainerId (   $objectiveOriented)

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

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

445  {
446  $this->objectiveOrientedContainerId = $objectiveOriented;
447  }
+ Here is the caller graph for this function:

◆ setPass()

ilTestSession::setPass (   $pass)

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

References $pass.

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

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

References $test_id.

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

◆ setUserId()

ilTestSession::setUserId (   $user_id)

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

References $user_id.

Referenced by ilTestPlayerAbstractGUI\ensureExistingTestSession().

360  {
361  $this->user_id = $user_id;
362  }
+ Here is the caller graph for this function:

◆ unsetAccessCodeInSession()

ilTestSession::unsetAccessCodeInSession ( )

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

References $_SESSION, and getTestId().

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

514  {
515  unset($_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()]);
516  }
$_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

ilTestSession::$test_id

◆ $tstamp

ilTestSession::$tstamp

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

◆ $user_id

ilTestSession::$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: