ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestSessionDynamicQuestionSet Class Reference
+ Inheritance diagram for ilTestSessionDynamicQuestionSet:
+ Collaboration diagram for ilTestSessionDynamicQuestionSet:

Public Member Functions

 __construct ()
 ilTestSession constructor
 getQuestionSetFilterSelection ()
 loadFromDb ($active_id)
 Loads the session data for a given active id.
 loadTestSession ($test_id, $user_id="", $anonymous_id="")
 saveToDb ()
 getCurrentQuestionId ()
 setCurrentQuestionId ($currentQuestionId)
- Public Member Functions inherited from ilTestSession
 setRefId ($a_val)
 Set Ref id.
 getRefId ()
 Get Ref id.
 increaseTestPass ()
 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 ()

Private Attributes

 $questionSetFilterSelection = null

Additional Inherited Members

- Data Fields inherited from ilTestSession
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 inherited from ilTestSession
 activeIDExists ($user_id, $test_id)

Detailed Description

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

Constructor & Destructor Documentation

ilTestSessionDynamicQuestionSet::__construct ( )

ilTestSession constructor

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

public

Reimplemented from ilTestSession.

Definition at line 24 of file class.ilTestSessionDynamicQuestionSet.php.

{
$this->questionSetFilterSelection = new ilTestDynamicQuestionSetFilterSelection();
}

Member Function Documentation

ilTestSessionDynamicQuestionSet::getCurrentQuestionId ( )

Definition at line 189 of file class.ilTestSessionDynamicQuestionSet.php.

References ilTestSession\getLastSequence().

Referenced by ilTestSequenceDynamicQuestionSet\cleanupQuestions().

{
return $this->getLastSequence();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestSessionDynamicQuestionSet::getQuestionSetFilterSelection ( )
Returns
ilTestDynamicQuestionSetFilterSelection

Definition at line 34 of file class.ilTestSessionDynamicQuestionSet.php.

References $questionSetFilterSelection.

Referenced by saveToDb().

+ Here is the caller graph for this function:

ilTestSessionDynamicQuestionSet::loadFromDb (   $active_id)

Loads the session data for a given active id.

Parameters
integer$active_idThe database id of the test session

Reimplemented from ilTestSession.

Definition at line 39 of file class.ilTestSessionDynamicQuestionSet.php.

References ilTestSession\$active_id, $ilDB, $result, and $row.

{
global $ilDB;
$result = $ilDB->queryF("SELECT * FROM tst_active WHERE active_id = %s",
array('integer'),
array($active_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
$this->active_id = $row["active_id"];
$this->user_id = $row["user_fi"];
$this->anonymous_id = $row["anonymous_id"];
$this->test_id = $row["test_fi"];
$this->lastsequence = $row["lastindex"];
$this->pass = $row["tries"];
$this->submitted = ($row["submitted"]) ? TRUE : FALSE;
$this->submittedTimestamp = $row["submittimestamp"];
$this->tstamp = $row["tstamp"];
$this->questionSetFilterSelection->setTaxonomySelection(unserialize($row['taxfilter']));
$this->questionSetFilterSelection->setAnswerStatusSelection($row['answerstatusfilter']);
$this->questionSetFilterSelection->setAnswerStatusActiveId($row['active_id']);
}
}
ilTestSessionDynamicQuestionSet::loadTestSession (   $test_id,
  $user_id = "",
  $anonymous_id = "" 
)

Reimplemented from ilTestSession.

Definition at line 65 of file class.ilTestSessionDynamicQuestionSet.php.

References $_SESSION, ilTestSession\$anonymous_id, $ilDB, $ilUser, $result, $row, ilTestSession\$test_id, ilTestSession\$user_id, ilTestSession\doesAccessCodeInSessionExists(), ilTestSession\getAccessCodeFromSession(), and ilTestSession\unsetAccessCodeInSession().

{
global $ilDB;
global $ilUser;
if (!$user_id)
{
$user_id = $ilUser->getId();
}
if (($_SESSION["AccountId"] == ANONYMOUS_USER_ID) && $this->doesAccessCodeInSessionExists())
{
$result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
array('integer','integer','text'),
);
}
else if (strlen($anonymous_id))
{
$result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s AND anonymous_id = %s",
array('integer','integer','text'),
);
}
else
{
if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID)
{
return NULL;
}
$result = $ilDB->queryF("SELECT * FROM tst_active WHERE user_fi = %s AND test_fi = %s",
array('integer','integer'),
);
}
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
$this->active_id = $row["active_id"];
$this->user_id = $row["user_fi"];
$this->anonymous_id = $row["anonymous_id"];
$this->test_id = $row["test_fi"];
$this->lastsequence = $row["lastindex"];
$this->pass = $row["tries"];
$this->submitted = ($row["submitted"]) ? TRUE : FALSE;
$this->submittedTimestamp = $row["submittimestamp"];
$this->tstamp = $row["tstamp"];
$this->questionSetFilterSelection->setTaxonomySelection(unserialize($row['taxfilter']));
$this->questionSetFilterSelection->setAnswerStatusSelection($row['answerstatusfilter']);
$this->questionSetFilterSelection->setAnswerStatusActiveId($row['active_id']);
}
elseif( $this->doesAccessCodeInSessionExists() )
{
}
}

+ Here is the call graph for this function:

ilTestSessionDynamicQuestionSet::saveToDb ( )

Reimplemented from ilTestSession.

Definition at line 122 of file class.ilTestSessionDynamicQuestionSet.php.

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

{
global $ilDB, $ilLog;
$submitted = ($this->isSubmitted()) ? 1 : 0;
if ($this->active_id > 0)
{
$affectedRows = $ilDB->update('tst_active',
array(
'lastindex' => array('integer', $this->getLastSequence()),
'tries' => array('integer', $this->getPass()),
'submitted' => array('integer', $submitted),
'submittimestamp' => array('timestamp', (strlen($this->getSubmittedTimestamp())) ? $this->getSubmittedTimestamp() : NULL),
'tstamp' => array('integer', time()-10),
'taxfilter' => array('text', serialize($this->getQuestionSetFilterSelection()->getTaxonomySelection())),
'answerstatusfilter' => array('text', $this->getQuestionSetFilterSelection()->getAnswerStatusSelection())
),
array(
'active_id' => array('integer', $this->getActiveId())
)
);
// update learning progress
include_once("./Modules/Test/classes/class.ilObjTestAccess.php");
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
}
else
{
if (!$this->activeIDExists($this->getUserId(), $this->getTestId()))
{
$anonymous_id = ($this->getAnonymousId()) ? $this->getAnonymousId() : NULL;
$next_id = $ilDB->nextId('tst_active');
$affectedRows = $ilDB->insert('tst_active',
array(
'active_id' => array('integer', $next_id),
'user_fi' => array('integer', $this->getUserId()),
'anonymous_id' => array('text', $anonymous_id),
'test_fi' => array('integer', $this->getTestId()),
'lastindex' => array('integer', $this->getLastSequence()),
'tries' => array('integer', $this->getPass()),
'submitted' => array('integer', $submitted),
'submittimestamp' => array('timestamp', (strlen($this->getSubmittedTimestamp())) ? $this->getSubmittedTimestamp() : NULL),
'tstamp' => array('integer', time()-10),
'taxfilter' => array('text', serialize($this->getQuestionSetFilterSelection()->getTaxonomySelection())),
'answerstatusfilter' => array('text', $this->getQuestionSetFilterSelection()->getAnswerStatusSelection())
)
);
$this->active_id = $next_id;
// update learning progress
include_once("./Modules/Test/classes/class.ilObjTestAccess.php");
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
$this->getUserId());
}
}
include_once("./Services/Tracking/classes/class.ilLearningProgress.php");
$this->getRefId(),
'tst');
}

+ Here is the call graph for this function:

ilTestSessionDynamicQuestionSet::setCurrentQuestionId (   $currentQuestionId)

Definition at line 194 of file class.ilTestSessionDynamicQuestionSet.php.

References ilTestSession\setLastSequence().

Referenced by ilTestSequenceDynamicQuestionSet\cleanupQuestions().

{
$this->setLastSequence((int)$currentQuestionId);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilTestSessionDynamicQuestionSet::$questionSetFilterSelection = null
private

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