19 declare(strict_types=1);
39 $query =
'SELECT variable, value FROM ' . self::TABLE_NAME .
' WHERE ' 40 .
'question_id = %s AND ' 41 .
'active_id = %s AND ' 44 $result = $this->db->queryF(
46 [
'integer',
'integer',
'integer'],
47 [$question_id, $active_id, $pass]
50 if($result->numRows() === 0) {
55 while ($row = $this->db->fetchAssoc($result)) {
56 $values[$row[
'variable']] = $row[
'value'];
67 $query =
'INSERT INTO ' . self::TABLE_NAME
68 .
' (question_id, active_id, pass, variable, value) ' 69 .
' VALUES (%s,%s,%s,%s,%s)';
71 foreach ($values as $k => $v) {
72 $this->db->manipulateF(
74 [
'integer',
'integer',
'integer',
'text',
'text'],
75 [$question_id, $active_id, $pass, $k, $v]
__construct(protected ilDBInterface $db)
getFor(int $question_id, int $active_id, int $pass)
store(int $question_id, int $active_id, int $pass, array $values)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Stores random-generated parts of questions in order to present the user with a fixed question during ...