ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 ()
 
 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
 
 $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 94 of file class.ilTestSession.php.

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

Member Function Documentation

◆ activeIDExists()

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

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

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

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

133  {
134  global $ilDB;
135 
136  if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID)
137  {
138  $result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s",
139  array('integer','integer'),
140  array($user_id, $test_id)
141  );
142  if ($result->numRows())
143  {
144  $row = $ilDB->fetchAssoc($result);
145  $this->active_id = $row["active_id"];
146  $this->user_id = $row["user_fi"];
147  $this->anonymous_id = $row["anonymous_id"];
148  $this->test_id = $row["test_fi"];
149  $this->lastsequence = $row["lastindex"];
150  $this->pass = $row["tries"];
151  $this->submitted = ($row["submitted"]) ? TRUE : FALSE;
152  $this->submittedTimestamp = $row["submittimestamp"];
153  $this->tstamp = $row["tstamp"];
154 
155  $this->setLastFinishedPass($row['last_finished_pass']);
156  $this->setObjectiveOrientedContainerId((int)$row['objective_container']);
157 
158  return true;
159  }
160  }
161  return false;
162  }
$_SESSION["AccountId"]
$result
setObjectiveOrientedContainerId($objectiveOriented)
setLastFinishedPass($lastFinishedPass)
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 582 of file class.ilTestSession.php.

References $code.

Referenced by createNewAccessCode().

583  {
584  // create a 5 character code
585  $codestring = self::ACCESS_CODE_CHAR_DOMAIN;
586 
587  mt_srand();
588 
589  $code = "";
590 
591  for($i = 1; $i <= self::ACCESS_CODE_LENGTH; $i++)
592  {
593  $index = mt_rand(0, strlen($codestring)-1);
594  $code .= substr($codestring, $index, 1);
595  }
596 
597  return $code;
598  }
$code
Definition: example_050.php:99
+ Here is the caller graph for this function:

◆ createNewAccessCode()

ilTestSession::createNewAccessCode ( )

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

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

559  {
560  do
561  {
562  $code = $this->buildAccessCode();
563  }
564  while( $this->isAccessCodeUsed($code) );
565 
566  return $code;
567  }
$code
Definition: example_050.php:99
+ Here is the call graph for this function:

◆ doesAccessCodeInSessionExists()

ilTestSession::doesAccessCodeInSessionExists ( )

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

References $_SESSION, and getTestId().

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

549  {
550  if( !is_array($_SESSION[self::ACCESS_CODE_SESSION_INDEX]) )
551  {
552  return false;
553  }
554 
555  return isset($_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()]);
556  }
$_SESSION["AccountId"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAccessCodeFromSession()

ilTestSession::getAccessCodeFromSession ( )

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 null;
538  }
539 
540  if( !isset($_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()]) )
541  {
542  return null;
543  }
544 
545  return $_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()];
546  }
$_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 415 of file class.ilTestSession.php.

References $anonymous_id.

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

416  {
417  return $this->anonymous_id;
418  }
+ Here is the caller graph for this function:

◆ getLastFinishedPass()

ilTestSession::getLastFinishedPass ( )

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

References $lastFinishedPass.

Referenced by increaseTestPass(), and saveToDb().

471  {
473  }
+ Here is the caller graph for this function:

◆ getLastSequence()

ilTestSession::getLastSequence ( )

◆ getObjectiveOrientedContainerId()

ilTestSession::getObjectiveOrientedContainerId ( )

◆ getPass()

ilTestSession::getPass ( )

◆ getRefId()

◆ getSubmittedTimestamp()

ilTestSession::getSubmittedTimestamp ( )

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

References $submittedTimestamp.

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

456  {
458  }
+ Here is the caller graph for this function:

◆ getTestId()

ilTestSession::getTestId ( )

◆ getUserId()

◆ increasePass()

ilTestSession::increasePass ( )

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

Referenced by increaseTestPass().

441  {
442  $this->pass += 1;
443  }
+ Here is the caller graph for this function:

◆ increaseTestPass()

ilTestSession::increaseTestPass ( )

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

References $_SESSION, $ilDB, $ilLog, ilObjTestAccess\_getParticipantId(), ilObjTestAccess\_lookupObjIdForTestId(), ilLPStatusWrapper\_updateStatus(), activeIDExists(), getActiveId(), getAnonymousId(), getLastFinishedPass(), getLastSequence(), getObjectiveOrientedContainerId(), getPass(), getSubmittedTimestamp(), getTestId(), getUserId(), increasePass(), isSubmitted(), and setLastSequence().

165  {
166  global $ilDB, $ilLog;
167 
168  $this->increasePass();
169  $this->setLastSequence(0);
170  $submitted = ($this->isSubmitted()) ? 1 : 0;
171  // 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)
172  if (time() - $_SESSION['tst_last_increase_pass'] > 10)
173  {
174  $_SESSION['tst_last_increase_pass'] = time();
175  $this->tstamp = time();
176  if ($this->active_id > 0)
177  {
178  $ilDB->update('tst_active',
179  array(
180  'lastindex' => array('integer', $this->getLastSequence()),
181  'tries' => array('integer', $this->getPass()),
182  'submitted' => array('integer', $submitted),
183  'submittimestamp' => array('timestamp', strlen($this->getSubmittedTimestamp()) ? $this->getSubmittedTimestamp() : NULL),
184  'tstamp' => array('integer', time()),
185  'last_finished_pass' => array('integer', $this->getLastFinishedPass()),
186  'objective_container' => array('integer', (int)$this->getObjectiveOrientedContainerId())
187  ),
188  array(
189  'active_id' => array('integer', $this->getActiveId())
190  )
191  );
192 
193  // update learning progress
194  include_once("./Modules/Test/classes/class.ilObjTestAccess.php");
195  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
197  ilObjTestAccess::_getParticipantId($this->active_id));
198  }
199  else
200  {
201  if (!$this->activeIDExists($this->getUserId(), $this->getTestId()))
202  {
203  $anonymous_id = ($this->getAnonymousId()) ? $this->getAnonymousId() : NULL;
204  $submittedTs = (strlen($this->getSubmittedTimestamp())) ? $this->getSubmittedTimestamp() : NULL;
205  $next_id = $ilDB->nextId('tst_active');
206 
207  $ilDB->insert('tst_active', array(
208  'active_id' => array('integer', $next_id),
209  'user_fi' => array('integer', $this->getUserId()),
210  'anonymous_id' => array('text', $anonymous_id),
211  'test_fi' => array('integer', $this->getTestId()),
212  'lastindex' => array('integer', $this->getLastSequence()),
213  'tries' => array('integer', $this->getPass()),
214  'submitted' => array('integer', $submitted),
215  'submittimestamp' => array('timestamp', $submittedTs),
216  'tstamp' => array('integer', time()),
217  'objective_container' => array('integer', (int)$this->getObjectiveOrientedContainerId()),
218  ));
219 
220  $this->active_id = $next_id;
221 
222  // update learning progress
223  include_once("./Modules/Test/classes/class.ilObjTestAccess.php");
224  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
226  $this->getUserId());
227  }
228  }
229  }
230  }
$_SESSION["AccountId"]
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
_lookupObjIdForTestId($a_test_id)
Lookup object id for test id.
_getParticipantId($active_id)
Get user id for active id.
global $ilDB
setLastSequence($lastsequence)
activeIDExists($user_id, $test_id)
+ Here is the call graph for this function:

◆ isAccessCodeUsed()

ilTestSession::isAccessCodeUsed (   $code)

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

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

Referenced by createNewAccessCode().

570  {
571  global $ilDB;
572 
573  $query = "SELECT anonymous_id FROM tst_active WHERE test_fi = %s AND anonymous_id = %s";
574 
575  $result = $ilDB->queryF(
576  $query, array('integer', 'text'), array($this->getTestId(), $code)
577  );
578 
579  return ($result->numRows() > 0);
580  }
$result
$code
Definition: example_050.php:99
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAnonymousUser()

ilTestSession::isAnonymousUser ( )

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

References getUserId().

Referenced by ilTestPlayerAbstractGUI\ensureExistingTestSession().

601  {
602  return $this->getUserId() == ANONYMOUS_USER_ID;
603  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isObjectiveOriented()

ilTestSession::isObjectiveOriented ( )

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

References getObjectiveOrientedContainerId().

486  {
487  return (bool)$this->getObjectiveOrientedContainerId();
488  }
+ Here is the call graph for this function:

◆ isSubmitted()

ilTestSession::isSubmitted ( )

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

References $submitted.

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

446  {
447  return $this->submitted;
448  }
+ 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 360 of file class.ilTestSession.php.

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

361  {
362  global $ilDB;
363  $result = $ilDB->queryF("SELECT * FROM tst_active WHERE active_id = %s",
364  array('integer'),
365  array($active_id)
366  );
367  if ($result->numRows())
368  {
369  $row = $ilDB->fetchAssoc($result);
370  $this->active_id = $row["active_id"];
371  $this->user_id = $row["user_fi"];
372  $this->anonymous_id = $row["anonymous_id"];
373  $this->test_id = $row["test_fi"];
374  $this->lastsequence = $row["lastindex"];
375  $this->pass = $row["tries"];
376  $this->submitted = ($row["submitted"]) ? TRUE : FALSE;
377  $this->submittedTimestamp = $row["submittimestamp"];
378  $this->tstamp = $row["tstamp"];
379 
380  $this->setLastFinishedPass($row['last_finished_pass']);
381  $this->setObjectiveOrientedContainerId((int)$row['objective_container']);
382  }
383  }
$result
setObjectiveOrientedContainerId($objectiveOriented)
setLastFinishedPass($lastFinishedPass)
global $ilDB
+ Here is the call graph for this function:

◆ loadTestSession()

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

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

References $_SESSION, $ilDB, $ilUser, $result, $row, doesAccessCodeInSessionExists(), getAccessCodeFromSession(), setLastFinishedPass(), setObjectiveOrientedContainerId(), and unsetAccessCodeInSession().

300  {
301  global $ilDB;
302  global $ilUser;
303 
304  if (!$user_id)
305  {
306  $user_id = $ilUser->getId();
307  }
308  if (($_SESSION["AccountId"] == ANONYMOUS_USER_ID) && $this->doesAccessCodeInSessionExists())
309  {
310  $result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
311  array('integer','integer','text'),
312  array($user_id, $test_id, $this->getAccessCodeFromSession())
313  );
314  }
315  else if (strlen($anonymous_id))
316  {
317  $result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
318  array('integer','integer','text'),
320  );
321  }
322  else
323  {
324  if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID)
325  {
326  return NULL;
327  }
328  $result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s",
329  array('integer','integer'),
330  array($user_id, $test_id)
331  );
332  }
333  if ($result->numRows())
334  {
335  $row = $ilDB->fetchAssoc($result);
336  $this->active_id = $row["active_id"];
337  $this->user_id = $row["user_fi"];
338  $this->anonymous_id = $row["anonymous_id"];
339  $this->test_id = $row["test_fi"];
340  $this->lastsequence = $row["lastindex"];
341  $this->pass = $row["tries"];
342  $this->submitted = ($row["submitted"]) ? TRUE : FALSE;
343  $this->submittedTimestamp = $row["submittimestamp"];
344  $this->tstamp = $row["tstamp"];
345 
346  $this->setLastFinishedPass($row['last_finished_pass']);
347  $this->setObjectiveOrientedContainerId((int)$row['objective_container']);
348  }
349  elseif( $this->doesAccessCodeInSessionExists() )
350  {
351  $this->unsetAccessCodeInSession();
352  }
353  }
$_SESSION["AccountId"]
$result
setObjectiveOrientedContainerId($objectiveOriented)
setLastFinishedPass($lastFinishedPass)
global $ilUser
Definition: imgupload.php:15
global $ilDB
+ Here is the call graph for this function:

◆ lookupTestStartLock()

ilTestSession::lookupTestStartLock ( )

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

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

502  {
503  global $ilDB;
504 
505  $res = $ilDB->queryF(
506  "SELECT start_lock FROM tst_active WHERE active_id = %s",
507  array('integer'), array($this->getActiveId())
508  );
509 
510  while($row = $ilDB->fetchAssoc($res))
511  {
512  return $row['start_lock'];
513  }
514 
515  return null;
516  }
global $ilDB
+ Here is the call graph for this function:

◆ persistTestStartLock()

ilTestSession::persistTestStartLock (   $testStartLock)

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

References $ilDB, and getActiveId().

491  {
492  global $ilDB;
493 
494  $ilDB->update(
495  'tst_active',
496  array('start_lock' => array('text', $testStartLock)),
497  array('active_id' => array('integer', $this->getActiveId()))
498  );
499  }
global $ilDB
+ Here is the call graph for this function:

◆ saveToDb()

ilTestSession::saveToDb ( )

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

References $ilDB, $ilLog, ilObjTestAccess\_getParticipantId(), ilObjTestAccess\_lookupObjIdForTestId(), ilLearningProgress\_tracProgress(), ilLPStatusWrapper\_updateStatus(), activeIDExists(), getActiveId(), getAnonymousId(), getLastFinishedPass(), getLastSequence(), getObjectiveOrientedContainerId(), getPass(), getRefId(), getSubmittedTimestamp(), getTestId(), getUserId(), and isSubmitted().

Referenced by ilTestPlayerAbstractGUI\ensureExistingTestSession().

233  {
234  global $ilDB, $ilLog;
235 
236  $submitted = ($this->isSubmitted()) ? 1 : 0;
237  if ($this->active_id > 0)
238  {
239  $ilDB->update('tst_active',
240  array(
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  'objective_container' => array('integer', (int)$this->getObjectiveOrientedContainerId())
248  ),
249  array(
250  'active_id' => array('integer', $this->getActiveId())
251  )
252  );
253 
254  // update learning progress
255  include_once("./Modules/Test/classes/class.ilObjTestAccess.php");
256  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
259  }
260  else
261  {
262  if (!$this->activeIDExists($this->getUserId(), $this->getTestId()))
263  {
264  $anonymous_id = ($this->getAnonymousId()) ? $this->getAnonymousId() : NULL;
265 
266  $next_id = $ilDB->nextId('tst_active');
267  $ilDB->insert('tst_active',
268  array(
269  'active_id' => array('integer', $next_id),
270  'user_fi' => array('integer', $this->getUserId()),
271  'anonymous_id' => array('text', $anonymous_id),
272  'test_fi' => array('integer', $this->getTestId()),
273  'lastindex' => array('integer', $this->getLastSequence()),
274  'tries' => array('integer', $this->getPass()),
275  'submitted' => array('integer', $submitted),
276  'submittimestamp' => array('timestamp', (strlen($this->getSubmittedTimestamp())) ? $this->getSubmittedTimestamp() : NULL),
277  'tstamp' => array('integer', time()-10),
278  'last_finished_pass' => array('integer', $this->getLastFinishedPass()),
279  'objective_container' => array('integer', (int)$this->getObjectiveOrientedContainerId())
280  )
281  );
282  $this->active_id = $next_id;
283 
284  // update learning progress
285  include_once("./Modules/Test/classes/class.ilObjTestAccess.php");
286  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
288  $this->getUserId());
289  }
290  }
291  include_once './Modules/Test/classes/class.ilObjTestAccess.php';
292  include_once("./Services/Tracking/classes/class.ilLearningProgress.php");
295  $this->getRefId(),
296  'tst');
297  }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
_lookupObjIdForTestId($a_test_id)
Lookup object id for test id.
getRefId()
Get Ref id.
_getParticipantId($active_id)
Get user id for active id.
global $ilDB
activeIDExists($user_id, $test_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAccessCodeToSession()

ilTestSession::setAccessCodeToSession (   $access_code)

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

References $_SESSION, and getTestId().

519  {
520  if (!is_array($_SESSION[self::ACCESS_CODE_SESSION_INDEX]))
521  {
522  $_SESSION[self::ACCESS_CODE_SESSION_INDEX] = array();
523  }
524 
525  $_SESSION[self::ACCESS_CODE_SESSION_INDEX][$this->getTestId()] = $access_code;
526  }
$_SESSION["AccountId"]
+ Here is the call graph for this function:

◆ setAnonymousId()

ilTestSession::setAnonymousId (   $anonymous_id)

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

References $anonymous_id.

Referenced by ilTestPlayerAbstractGUI\ensureExistingTestSession().

411  {
412  $this->anonymous_id = $anonymous_id;
413  }
+ Here is the caller graph for this function:

◆ setLastFinishedPass()

ilTestSession::setLastFinishedPass (   $lastFinishedPass)

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

References $lastFinishedPass.

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

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

◆ setLastSequence()

ilTestSession::setLastSequence (   $lastsequence)

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

References $lastsequence.

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

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

◆ setObjectiveOrientedContainerId()

ilTestSession::setObjectiveOrientedContainerId (   $objectiveOriented)

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

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

476  {
477  $this->objectiveOrientedContainerId = $objectiveOriented;
478  }
+ Here is the caller graph for this function:

◆ setPass()

ilTestSession::setPass (   $pass)

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

References $pass.

431  {
432  $this->pass = $pass;
433  }

◆ setRefId()

ilTestSession::setRefId (   $a_val)

Set Ref id.

Parameters
integerRef id

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

118  {
119  $this->ref_id = $a_val;
120  }

◆ setSubmitted()

ilTestSession::setSubmitted ( )

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

451  {
452  $this->submitted = TRUE;
453  }

◆ setSubmittedTimestamp()

ilTestSession::setSubmittedTimestamp ( )

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

461  {
462  $this->submittedTimestamp = strftime("%Y-%m-%d %H:%M:%S");
463  }

◆ setTestId()

ilTestSession::setTestId (   $test_id)

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

References $test_id.

401  {
402  $this->test_id = $test_id;
403  }

◆ setUserId()

ilTestSession::setUserId (   $user_id)

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

References $user_id.

Referenced by ilTestPlayerAbstractGUI\ensureExistingTestSession().

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

◆ unsetAccessCodeInSession()

ilTestSession::unsetAccessCodeInSession ( )

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

References $_SESSION, and getTestId().

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

529  {
530  unset($_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:

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().

◆ $objectiveOrientedContainerId

ilTestSession::$objectiveOrientedContainerId
private

Definition at line 84 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: