ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
class.assAnswerMatchingTerm.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
12 {
13  protected $arrData;
14 
22  function __construct($text = "", $picture = "", $identifier = "")
23  {
24  if (strlen($identifier) == 0)
25  {
26  mt_srand((double)microtime()*1000000);
27  $identifier = mt_rand(1, 100000);
28  }
29  $this->arrData = array(
30  'text' => $text,
31  'picture' => $picture,
32  'identifier' => $identifier
33  );
34  }
35 
39  public function __get($value)
40  {
41  switch ($value)
42  {
43  case "text":
44  case "picture":
45  if (strlen($this->arrData[$value]))
46  {
47  return $this->arrData[$value];
48  }
49  else
50  {
51  return null;
52  }
53  break;
54  case "identifier":
55  return $this->arrData[$value];
56  break;
57  default:
58  return null;
59  break;
60  }
61  }
62 
66  public function __set($key, $value)
67  {
68  switch ($key)
69  {
70  case "text":
71  case "picture":
72  case "identifier":
73  $this->arrData[$key] = $value;
74  break;
75  default:
76  break;
77  }
78  }
79 }
80 
81 ?>
Class for matching question terms.
__construct($text="", $picture="", $identifier="")
assAnswerMatchingTerm constructor
__set($key, $value)
Object setter.