ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilTestEvaluationPassData.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 {
42 
48  private $workingtime;
49 
55  private $questioncount;
56 
62  private $maxpoints;
63 
69  private $reachedpoints;
70 
77 
83  var $pass;
84 
85  public function __sleep()
86  {
87  return array('answeredQuestions', 'pass', 'nrOfAnsweredQuestions', 'reachedpoints',
88  'maxpoints', 'questioncount', 'workingtime');
89  }
90 
97  {
98  $this->answeredQuestions = array();
99  }
100 
101  public function getNrOfAnsweredQuestions()
102  {
104  }
105 
107  {
108  $this->nrOfAnsweredQuestions = $nrOfAnsweredQuestions;
109  }
110 
111  public function getReachedPoints()
112  {
113  return $this->reachedpoints;
114  }
115 
117  {
118  $this->reachedpoints = $reachedpoints;
119  }
120 
121  public function getMaxPoints()
122  {
123  return $this->maxpoints;
124  }
125 
126  public function setMaxPoints($maxpoints)
127  {
128  $this->maxpoints = $maxpoints;
129  }
130 
131  public function getQuestionCount()
132  {
133  return $this->questioncount;
134  }
135 
137  {
138  $this->questioncount = $questioncount;
139  }
140 
141  public function getWorkingTime()
142  {
143  return $this->workingtime;
144  }
145 
146  public function setWorkingTime($workingtime)
147  {
148  $this->workingtime = $workingtime;
149  }
150 
151  public function getPass()
152  {
153  return $this->pass;
154  }
155 
156  public function setPass($a_pass)
157  {
158  $this->pass = $a_pass;
159  }
160 
162  {
164  }
165 
166  function addAnsweredQuestion($question_id, $max_points, $reached_points, $sequence = NULL)
167  {
168  array_push($this->answeredQuestions, array("id" => $question_id, "points" => round($max_points, 2), "reached" => round($reached_points, 2), "sequence" => $sequence));
169  }
170 
171  function &getAnsweredQuestion($index)
172  {
173  if (array_key_exists($index, $this->answeredQuestions))
174  {
175  return $this->answeredQuestions[$index];
176  }
177  else
178  {
179  return NULL;
180  }
181  }
182 
183  function &getAnsweredQuestionByQuestionId($question_id)
184  {
185  foreach ($this->answeredQuestions as $question)
186  {
187  if ($question["id"] == $question_id)
188  {
189  return $question;
190  }
191  }
192  return NULL;
193  }
194 
196  {
197  return count($this->answeredQuestions);
198  }
199 
200 } // END ilTestEvaluationPassData
201 
202 ?>