ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilTestSearch.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
35 include_once 'Services/Search/classes/class.ilAbstractSearch.php';
36 
38 {
44  {
46  }
47 
49  {
50  $this->setFields(array('introduction'));
51 
52  $where = $this->__createWhereCondition(implode(',',$this->getFields()));
53  $locate = $this->__createLocateString();
54 
55  $query = "SELECT obj_fi ".
56  $locate.
57  "FROM tst_tests ".
58  $where;
59 
60  $res = $this->db->query($query);
61  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
62  {
63  $this->search_result->addEntry($row->obj_fi,'tst',$this->__prepareFound($row));
64  }
65  return $this->search_result;
66  }
67  function &__searchTestTitle()
68  {
69  $this->setFields(array('title','description'));
70 
71  $where = $this->__createWhereCondition(implode(',',$this->getFields()));
72  $locate = $this->__createLocateString();
73 
74  $query = "SELECT obj_fi ".
75  $locate.
76  "FROM qpl_questions ".
77  $where;
78 
79  $res = $this->db->query($query);
80  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
81  {
82  $this->search_result->addEntry($row->obj_fi,'qpl',$this->__prepareFound($row));
83  }
84  return $this->search_result;
85  }
87  {
88  $this->setFields(array('introduction'));
89 
90  $where = $this->__createWhereCondition(implode(',',$this->getFields()));
91  $locate = $this->__createLocateString();
92 
93  $query = "SELECT obj_fi ".
94  $locate.
95  "FROM svy_svy ".
96  $where;
97 
98  $res = $this->db->query($query);
99  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
100  {
101  $this->search_result->addEntry($row->obj_fi,'svy',$this->__prepareFound($row));
102  }
103  return $this->search_result;
104  }
106  {
107  $this->setFields(array('title','description'));
108 
109  $where = $this->__createWhereCondition(implode(',',$this->getFields()));
110  $locate = $this->__createLocateString();
111 
112  $query = "SELECT obj_fi ".
113  $locate.
114  "FROM svy_question ".
115  $where;
116 
117  $res = $this->db->query($query);
118  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
119  {
120  $this->search_result->addEntry($row->obj_fi,'spl',$this->__prepareFound($row));
121  }
122  return $this->search_result;
123  }
124 
125 
126  function &performSearch()
127  {
128  $this->__searchTestTitle();
129  $this->__searchTestIntroduction();
130  $this->__searchSurveyTitle();
132 
133  return $this->search_result;
134  }
135 }
136 ?>