ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilTestEvaluation.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
12{
16 protected $db;
17
21 protected $testId;
22
26 public function __construct(ilDB $db, $testId)
27 {
28 $this->db = $db;
29 $this->testId = $testId;
30 }
31
36 public function getAllActivesPasses()
37 {
38 $query = "
39 SELECT active_fi, pass
40 FROM tst_active actives
41 INNER JOIN tst_pass_result passes
42 ON active_fi = active_id
43 WHERE test_fi = %s
44 ";
45
46 $res = $this->db->queryF($query, array('integer'), array($this->testId));
47
48 $passes = array();
49
50 while($row = $this->db->fetchAssoc($res))
51 {
52 if( !isset($passes[$row['active_fi']]) )
53 {
54 $passes[$row['active_fi']] = array();
55 }
56
57 $passes[$row['active_fi']][] = $row['pass'];
58 }
59
60 return $passes;
61 }
62}
Database Wrapper.
Definition: class.ilDB.php:29
__construct(ilDB $db, $testId)