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

Public Member Functions

 __construct ($userId, $questionId)
 init ()
 getUserId ()
 getQuestionId ()
 setInstantResponseActive ($instantResponseActive)
 isInstantResponseActive ()
 setParticipantsSolution ($participantSolution)
 getParticipantsSolution ()
 getNumRequestedHints ()
 isHintRequested ($hintId)
 addRequestedHint ($hintId)
 getRequestedHints ()
 resetRequestedHints ()

Data Fields

const SESSION_BASEINDEX = 'ilAssQuestionPreviewSessions'
const SESSION_SUBINDEX_INSTANT_RESPONSE_ACTIVE = 'instantResponseActive'
const SESSION_SUBINDEX_PARTICIPANT_SOLUTION = 'participantSolution'
const SESSION_SUBINDEX_REQUESTED_HINTS = 'requestedHints'

Private Member Functions

 getSessionContextIndex ()
 saveSessionValue ($subIndex, $value)
 readSessionValue ($subIndex)

Private Attributes

 $userId
 $questionId

Detailed Description

Definition at line 11 of file class.ilAssQuestionPreviewSession.php.

Constructor & Destructor Documentation

ilAssQuestionPreviewSession::__construct (   $userId,
  $questionId 
)

Definition at line 22 of file class.ilAssQuestionPreviewSession.php.

References $questionId, and $userId.

{
$this->userId = $userId;
$this->questionId = $questionId;
}

Member Function Documentation

ilAssQuestionPreviewSession::addRequestedHint (   $hintId)

Definition at line 111 of file class.ilAssQuestionPreviewSession.php.

References readSessionValue(), and saveSessionValue().

{
$requestedHints = $this->readSessionValue(self::SESSION_SUBINDEX_REQUESTED_HINTS);
$requestedHints[$hintId] = $hintId;
$this->saveSessionValue(self::SESSION_SUBINDEX_REQUESTED_HINTS, $requestedHints);
}

+ Here is the call graph for this function:

ilAssQuestionPreviewSession::getNumRequestedHints ( )

Definition at line 100 of file class.ilAssQuestionPreviewSession.php.

References readSessionValue().

{
return count($this->readSessionValue(self::SESSION_SUBINDEX_REQUESTED_HINTS));
}

+ Here is the call graph for this function:

ilAssQuestionPreviewSession::getQuestionId ( )

Definition at line 60 of file class.ilAssQuestionPreviewSession.php.

References $questionId.

{
}
ilAssQuestionPreviewSession::getRequestedHints ( )

Definition at line 118 of file class.ilAssQuestionPreviewSession.php.

References readSessionValue().

{
return $this->readSessionValue(self::SESSION_SUBINDEX_REQUESTED_HINTS);
}

+ Here is the call graph for this function:

ilAssQuestionPreviewSession::getSessionContextIndex ( )
private

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

Referenced by init(), readSessionValue(), and saveSessionValue().

{
return "u{$this->userId}::q{$this->questionId}";
}

+ Here is the caller graph for this function:

ilAssQuestionPreviewSession::getUserId ( )

Definition at line 55 of file class.ilAssQuestionPreviewSession.php.

References $userId.

Referenced by assFileUpload\savePreviewData().

{
return $this->userId;
}

+ Here is the caller graph for this function:

ilAssQuestionPreviewSession::init ( )

Definition at line 28 of file class.ilAssQuestionPreviewSession.php.

References $_SESSION, getSessionContextIndex(), SESSION_BASEINDEX, SESSION_SUBINDEX_INSTANT_RESPONSE_ACTIVE, and SESSION_SUBINDEX_PARTICIPANT_SOLUTION.

{
if( !isset($_SESSION[self::SESSION_BASEINDEX]) || !is_array($_SESSION[self::SESSION_BASEINDEX]) )
{
}
if( !isset($baseSession[$this->getSessionContextIndex()]) )
{
$baseSession[$this->getSessionContextIndex()] = array();
}
$contextSession = &$baseSession[$this->getSessionContextIndex()];
if( !isset($contextSession[self::SESSION_SUBINDEX_INSTANT_RESPONSE_ACTIVE]) )
{
}
if( !isset($contextSession[self::SESSION_SUBINDEX_PARTICIPANT_SOLUTION]) )
{
}
}

+ Here is the call graph for this function:

ilAssQuestionPreviewSession::isHintRequested (   $hintId)

Definition at line 105 of file class.ilAssQuestionPreviewSession.php.

References readSessionValue().

{
$requestedHints = $this->readSessionValue(self::SESSION_SUBINDEX_REQUESTED_HINTS);
return isset($requestedHints[$hintId]);
}

+ Here is the call graph for this function:

ilAssQuestionPreviewSession::isInstantResponseActive ( )

Definition at line 85 of file class.ilAssQuestionPreviewSession.php.

References readSessionValue().

{
return $this->readSessionValue(self::SESSION_SUBINDEX_INSTANT_RESPONSE_ACTIVE);
}

+ Here is the call graph for this function:

ilAssQuestionPreviewSession::readSessionValue (   $subIndex)
private

Definition at line 75 of file class.ilAssQuestionPreviewSession.php.

References $_SESSION, getSessionContextIndex(), and SESSION_BASEINDEX.

Referenced by addRequestedHint(), getNumRequestedHints(), getParticipantsSolution(), getRequestedHints(), isHintRequested(), and isInstantResponseActive().

{
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAssQuestionPreviewSession::resetRequestedHints ( )

Definition at line 123 of file class.ilAssQuestionPreviewSession.php.

References saveSessionValue().

{
$this->saveSessionValue(self::SESSION_SUBINDEX_REQUESTED_HINTS, array());
}

+ Here is the call graph for this function:

ilAssQuestionPreviewSession::saveSessionValue (   $subIndex,
  $value 
)
private

Definition at line 70 of file class.ilAssQuestionPreviewSession.php.

References $_SESSION, getSessionContextIndex(), and SESSION_BASEINDEX.

Referenced by addRequestedHint(), resetRequestedHints(), setInstantResponseActive(), and setParticipantsSolution().

{
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAssQuestionPreviewSession::setInstantResponseActive (   $instantResponseActive)

Definition at line 80 of file class.ilAssQuestionPreviewSession.php.

References saveSessionValue().

{
$this->saveSessionValue(self::SESSION_SUBINDEX_INSTANT_RESPONSE_ACTIVE, $instantResponseActive);
}

+ Here is the call graph for this function:

ilAssQuestionPreviewSession::setParticipantsSolution (   $participantSolution)

Field Documentation

ilAssQuestionPreviewSession::$questionId
private

Definition at line 20 of file class.ilAssQuestionPreviewSession.php.

Referenced by __construct(), and getQuestionId().

ilAssQuestionPreviewSession::$userId
private

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

Referenced by __construct(), and getUserId().

const ilAssQuestionPreviewSession::SESSION_BASEINDEX = 'ilAssQuestionPreviewSessions'

Definition at line 13 of file class.ilAssQuestionPreviewSession.php.

Referenced by init(), readSessionValue(), and saveSessionValue().

const ilAssQuestionPreviewSession::SESSION_SUBINDEX_INSTANT_RESPONSE_ACTIVE = 'instantResponseActive'

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

Referenced by init().

const ilAssQuestionPreviewSession::SESSION_SUBINDEX_PARTICIPANT_SOLUTION = 'participantSolution'

Definition at line 16 of file class.ilAssQuestionPreviewSession.php.

Referenced by init().

const ilAssQuestionPreviewSession::SESSION_SUBINDEX_REQUESTED_HINTS = 'requestedHints'

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


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