ILIAS  release_8 Revision v8.24
class.ilTestEvaluation.php
Go to the documentation of this file.
1<?php
2
26{
27 protected $db;
28
32 protected $testId;
33
40 {
41 $this->db = $db;
42 $this->testId = $testId;
43 }
44
49 public function getAllActivesPasses(): array
50 {
51 $query = "
52 SELECT active_fi, pass
53 FROM tst_active actives
54 INNER JOIN tst_pass_result passes
55 ON active_fi = active_id
56 WHERE test_fi = %s
57 ";
58
59 $res = $this->db->queryF($query, array('integer'), array($this->testId));
60
61 $passes = array();
62
63 while ($row = $this->db->fetchAssoc($res)) {
64 if (!isset($passes[$row['active_fi']])) {
65 $passes[$row['active_fi']] = array();
66 }
67
68 $passes[$row['active_fi']][] = $row['pass'];
69 }
70
71 return $passes;
72 }
73}
__construct(ilDBInterface $db, $testId)
ilTestEvaluation constructor.
Interface ilDBInterface.
$res
Definition: ltiservices.php:69
$query