ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.assMark.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 require_once './Modules/Test/classes/inc.AssessmentConstants.php';
5 
14 class ASS_Mark {
23 
32 
40  var $minimum_level = 0;
41 
49  var $passed;
50 
61  function ASS_Mark(
62  $short_name = "",
63  $official_name = "",
64  $minimum_level = 0,
65  $passed = 0
66  )
67  {
68  $this->setShortName($short_name);
71  $this->setPassed($passed);
72  }
73 
83  function getShortName() {
84  return $this->short_name;
85  }
86 
96  function getPassed()
97  {
98  return $this->passed;
99  }
100 
110  function getOfficialName() {
111  return $this->official_name;
112  }
113 
123  function getMinimumLevel() {
124  return $this->minimum_level;
125  }
126 
136  function setShortName($short_name = "") {
137  $this->short_name = $short_name;
138  }
139 
149  function setPassed($passed = 0) {
150  $this->passed = $passed;
151  }
152 
163  $this->official_name = $official_name;
164  }
165 
176  {
177  $minimum_level = (float) $minimum_level;
178  /*
179  * Due to a defect in import, non-numeric levels get casted
180  * to zero using the above statement. Accordingly, no exception
181  * is thrown. @todo Get this clean.
182  if (!is_numeric($minimum_level))
183  {
184  throw new Exception ('Markstep: minimum level must be numeric.');
185  }
186  else
187  */
188  if (($minimum_level >= 0) && ($minimum_level <= 100))
189  {
190  $this->minimum_level = $minimum_level;
191  }
192  else
193  {
194  throw new Exception ('Markstep: minimum level must be between 0 and 100');
195  }
196  }
197 }