ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilQTIMaterial.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
33{
34 public $label;
35 public $flow;
36 public $comment;
37 public $mattext;
38 public $matemtext;
39 public $matimage;
40 public $mataudio;
41 public $matvideo;
42 public $matapplet;
44 public $matref;
45 public $matbreak;
48 public $materials;
49
50 public function __construct()
51 {
52 $this->flow = 0;
53 $this->altmaterial = array();
54 $this->materials = array();
55 }
56
57 public function addMattext($a_mattext)
58 {
59 array_push($this->materials, array("material" => $a_mattext, "type" => "mattext"));
60 }
61
62 public function addMatimage($a_matimage)
63 {
64 array_push($this->materials, array("material" => $a_matimage, "type" => "matimage"));
65 }
66
67 public function addMatemtext($a_matemtext)
68 {
69 array_push($this->materials, array("material" => $a_matemtext, "type" => "matemtext"));
70 }
71
72 public function addMataudio($a_mataudio)
73 {
74 array_push($this->materials, array("material" => $a_mataudio, "type" => "mataudio"));
75 }
76
77 public function addMatvideo($a_matvideo)
78 {
79 array_push($this->materials, array("material" => $a_matvideo, "type" => "matvideo"));
80 }
81
82 public function addMatapplet($a_matapplet)
83 {
84 array_push($this->materials, array("material" => $a_matapplet, "type" => "matapplet"));
85 }
86
87 public function addMatapplication($a_matapplication)
88 {
89 array_push($this->materials, array("material" => $a_matapplication, "type" => "matapplication"));
90 }
91
92 public function addMatref($a_matref)
93 {
94 array_push($this->materials, array("material" => $a_matref, "type" => "matref"));
95 }
96
97 public function addMatbreak($a_matbreak)
98 {
99 array_push($this->materials, array("material" => $a_matbreak, "type" => "matbreak"));
100 }
101
102 public function addMat_extension($a_mat_extension)
103 {
104 array_push($this->materials, array("material" => $a_mat_extension, "type" => "mat_extension"));
105 }
106
107 public function addAltmaterial($a_altmaterial)
108 {
109 array_push($this->materials, array("material" => $a_altmaterial, "type" => "altmaterial"));
110 }
111
112 public function getMaterialCount()
113 {
114 return count($this->materials);
115 }
116
117 public function getMaterial($a_index)
118 {
119 if (array_key_exists($a_index, $this->materials)) {
120 return $this->materials[$a_index];
121 } else {
122 return false;
123 }
124 }
125
126 public function setFlow($a_flow)
127 {
128 $this->flow = $a_flow;
129 }
130
131 public function getFlow()
132 {
133 return $this->flow;
134 }
135
136 public function setLabel($a_label)
137 {
138 $this->label = $a_label;
139 }
140
141 public function getLabel()
142 {
143 return $this->label;
144 }
145
146 public function extractText()
147 {
148 $text = "";
149 if ($this->getMaterialCount()) {
150 foreach ($this->materials as $mat) {
151 if (strcmp($mat["type"], "mattext") == 0) {
152 $text .= $mat["material"];
153 }
154 }
155 }
156 return $text;
157 }
158}
An exception for terminatinating execution or to throw for unit testing.
addMatimage($a_matimage)
addAltmaterial($a_altmaterial)
addMatapplication($a_matapplication)
addMatapplet($a_matapplet)
addMat_extension($a_mat_extension)
addMataudio($a_mataudio)
addMattext($a_mattext)
addMatemtext($a_matemtext)
addMatvideo($a_matvideo)
addMatbreak($a_matbreak)
$text
Definition: errorreport.php:18