ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilTestEvaluation.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
28 {
29  protected $db;
30 
34  protected $testId;
35 
42  {
43  $this->db = $db;
44  $this->testId = $testId;
45  }
46 
51  public function getAllActivesPasses(): array
52  {
53  $query = "
54  SELECT active_fi, pass
55  FROM tst_active actives
56  INNER JOIN tst_pass_result passes
57  ON active_fi = active_id
58  WHERE test_fi = %s
59  ";
60 
61  $res = $this->db->queryF($query, array('integer'), array($this->testId));
62 
63  $passes = array();
64 
65  while ($row = $this->db->fetchAssoc($res)) {
66  if (!isset($passes[$row['active_fi']])) {
67  $passes[$row['active_fi']] = array();
68  }
69 
70  $passes[$row['active_fi']][] = $row['pass'];
71  }
72 
73  return $passes;
74  }
75 }
$res
Definition: ltiservices.php:69
__construct(ilDBInterface $db, $testId)
ilTestEvaluation constructor.