ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSCORM2004MapInfo.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2008 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 
24 
36 {
37 
38 
39 
40  //db fields
41  private $id = null;
42  private $seqNodeId = null;
43  private $targetObjectiveID = null;
44  private $readSatisfiedStatus = true;
45  private $readNormalizedMeasure = true;
46  private $writeSatisfiedStatus = false;
47  private $writeNormalizedMeasure = false;
52  function ilSCORM2004MapInfo()
53  {
55  $this->setNodeName("mapinfo");
56  }
57 
58 
59  // **********************
60  // GETTER METHODS
61  // **********************
62 
63  public function getSeqNodeId()
64  {
65  return $this->seqNodeId;
66  }
67 
68  public function getId()
69  {
70  return $this->id;
71  }
72 
73  public function getTargetObjectiveID()
74  {
76  }
77 
78  public function getReadSatisfiedStatus()
79  {
81  }
82 
83  public function getReadNormalizedMeasure()
84  {
86  }
87 
88  public function getWriteSatisfiedStatus()
89  {
91  }
92 
93  public function getWriteNormalizedMeasure()
94  {
96  }
97 
98  // **********************
99  // Setter METHODS
100  // **********************
101 
102  public function setSeqNodeId($a_seqnodeid)
103  {
104  $this->seqNodeId = $a_seqnodeid;
105  }
106 
107  public function setId($a_id)
108  {
109  $this->id = $a_id;
110  }
111 
112  public function setTargetObjectiveID($a_id)
113  {
114  $this->targetObjectiveID = $a_id;
115  }
116 
117  public function setReadSatisfiedStatus($a_status)
118  {
119  $this->readSatisfiedStatus = $a_status;
120  }
121 
122  public function setReadNormalizedMeasure($a_measure)
123  {
124  $this->readNormalizedMeasure = $a_measure;
125  }
126 
127  public function setWriteSatisfiedStatus($a_status)
128  {
129  $this->writeSatisfiedStatus = $a_status ;
130  }
131 
132  public function setWriteNormalizedMeasure($a_measure)
133  {
134  $this->writeNormalizedMeasure = $a_measure;
135  }
136 
137 
138  // **********************
139  // Standard DB Operations for Object
140  // **********************
141 
142  public function insert($a_insert_node = false)
143  {
144  if ($a_insert_node==true) {$this->setSeqNodeId(parent::insert());}
145  $sql = "INSERT INTO sahs_sc13_seq_mapinfo (seqnodeid,targetobjectiveid,readsatisfiedstatus,readnormalizedmeasure,writesatisfiedstatus,writemormalizedmeasure)".
146  " values(".
147  $this->db->quote($this->seqNodeId, "integer").",".
148  $this->db->quote($this->targetObjectiveID, "text").",".
149  $this->db->quote($this->readSatisfiedStatus, "integer").",".
150  $this->db->quote($this->readNormalizedMeasure, "integer").",".
151  $this->db->quote($this->writeSatisfiedStatus, "integer").",".
152  $this->db->quote($this->writeNormalizedMeasure, "integer").");";
153  $result = $this->db->manipulate($sql);
154  return true;
155  }
156 
157  static function fetchmapInfo($a_seq_node_id)
158  {
159  global $ilDB;
160 
161  $sql = "SELECT * FROM sahs_sc13_seq_mapinfo WHERE seqnodeid=".
162  $ilDB->quote($a_seq_node_id, "integer").";";
163  $result = $ilDB->query($sql);
164  $row = $ilDB->fetchAssoc($result);
165  $obj = new ilSCORM2004MapInfo();
166  $obj->setSeqNodeId($row["seqnodeid"]);
167  $obj->setTargetObjectiveID($row["targetobjectiveid"]);
168  $obj->setReadSatisfiedStatus($row["readsatisfiedstatus"]);
169  $obj->setReadNormalizedMeasure($row["readnormalizedmeasure"]);
170  $obj->setWriteSatisfiedStatus($row["writesatisfiedstatus"]);
171  $obj->setWriteNormalizedMeasure($row["writemormalizedmeasure"]);
172  /*foreach ($row as $key=>$value) {
173  $method = "set".ucwords($key);
174  if (method_exists($obj,$method)) {$obj->$method($value);}
175  }*/
176  return $obj;
177  }
178 
179 
180 }
181 ?>