42 public function init(): void
59 return "u{$this->userId}::q{$this->questionId}";
83 $this->
saveSessionValue(self::SESSION_SUBINDEX_INSTANT_RESPONSE_ACTIVE, $instantResponseActive);
88 return $this->
readSessionValue(self::SESSION_SUBINDEX_INSTANT_RESPONSE_ACTIVE);
93 $this->
saveSessionValue(self::SESSION_SUBINDEX_PARTICIPANT_SOLUTION, $participantSolution);
98 return $this->
readSessionValue(self::SESSION_SUBINDEX_PARTICIPANT_SOLUTION) == [] ? null : $this->
readSessionValue(self::SESSION_SUBINDEX_PARTICIPANT_SOLUTION);
113 if (!is_array($hints)) {
117 return count($hints);
123 $requestedHints = $this->
readSessionValue(self::SESSION_SUBINDEX_REQUESTED_HINTS);
124 return isset($requestedHints[$hintId]);
133 $requestedHints[$hintId] = $hintId;
134 $this->
saveSessionValue(self::SESSION_SUBINDEX_REQUESTED_HINTS, $requestedHints);
159 return $val === [] ? null : $val;
181 if (!isset($contextSession[self::SESSION_SUBINDEX_INSTANT_RESPONSE_ACTIVE])) {
182 $contextSession[self::SESSION_SUBINDEX_INSTANT_RESPONSE_ACTIVE] = 0;
185 if (!isset($contextSession[self::SESSION_SUBINDEX_PARTICIPANT_SOLUTION])) {
186 $contextSession[self::SESSION_SUBINDEX_PARTICIPANT_SOLUTION] = null;
189 if (!isset($contextSession[self::SESSION_SUBINDEX_RANDOMIZER_SEED])) {
190 $contextSession[self::SESSION_SUBINDEX_RANDOMIZER_SEED] = null;
static get(string $a_var)
isInstantResponseActive()
const SESSION_SUBINDEX_INSTANT_RESPONSE_ACTIVE
const SESSION_SUBINDEX_PARTICIPANT_SOLUTION
getParticipantsSolution()
setParticipantsSolution($participantSolution)
const SESSION_SUBINDEX_RANDOMIZER_SEED
readSessionValue($subIndex)
setInstantResponseActive($instantResponseActive)
const SESSION_SUBINDEX_REQUESTED_HINTS
ensureSessionStructureExists()
issetSessionValue($subIndex)
saveSessionValue($subIndex, $value)
__construct($userId, $questionId)
static set(string $a_var, $a_val)
Set a value.
addRequestedHint($hintId)