Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00032 class ilQTIMaterial
00033 {
00034 var $label;
00035 var $flow;
00036 var $comment;
00037 var $mattext;
00038 var $matemtext;
00039 var $matimage;
00040 var $mataudio;
00041 var $matvideo;
00042 var $matapplet;
00043 var $matapplication;
00044 var $matref;
00045 var $matbreak;
00046 var $mat_extension;
00047 var $altmaterial;
00048 var $materials;
00049
00050 function ilQTIMaterial()
00051 {
00052 $this->flow = 0;
00053 $this->altmaterial = array();
00054 $this->materials = array();
00055 }
00056
00057 function addMattext($a_mattext)
00058 {
00059 array_push($this->materials, array("material" => $a_mattext, "type" => "mattext"));
00060 }
00061
00062 function addMatimage($a_matimage)
00063 {
00064 array_push($this->materials, array("material" => $a_matimage, "type" => "matimage"));
00065 }
00066
00067 function addMatemtext($a_matemtext)
00068 {
00069 array_push($this->materials, array("material" => $a_matemtext, "type" => "matemtext"));
00070 }
00071
00072 function addMataudio($a_mataudio)
00073 {
00074 array_push($this->materials, array("material" => $a_mataudio, "type" => "mataudio"));
00075 }
00076
00077 function addMatvideo($a_matvideo)
00078 {
00079 array_push($this->materials, array("material" => $a_matvideo, "type" => "matvideo"));
00080 }
00081
00082 function addMatapplet($a_matapplet)
00083 {
00084 array_push($this->materials, array("material" => $a_matapplet, "type" => "matapplet"));
00085 }
00086
00087 function addMatapplication($a_matapplication)
00088 {
00089 array_push($this->materials, array("material" => $a_matapplication, "type" => "matapplication"));
00090 }
00091
00092 function addMatref($a_matref)
00093 {
00094 array_push($this->materials, array("material" => $a_matref, "type" => "matref"));
00095 }
00096
00097 function addMatbreak($a_matbreak)
00098 {
00099 array_push($this->materials, array("material" => $a_matbreak, "type" => "matbreak"));
00100 }
00101
00102 function addMat_extension($a_mat_extension)
00103 {
00104 array_push($this->materials, array("material" => $a_mat_extension, "type" => "mat_extension"));
00105 }
00106
00107 function addAltmaterial($a_altmaterial)
00108 {
00109 array_push($this->materials, array("material" => $a_altmaterial, "type" => "altmaterial"));
00110 }
00111
00112 function getMaterialCount()
00113 {
00114 return count($this->materials);
00115 }
00116
00117 function getMaterial($a_index)
00118 {
00119 if (array_key_exists($a_index, $this->materials))
00120 {
00121 return $this->materials[$a_index];
00122 }
00123 else
00124 {
00125 return FALSE;
00126 }
00127 }
00128
00129 function setFlow($a_flow)
00130 {
00131 $this->flow = $a_flow;
00132 }
00133
00134 function getFlow()
00135 {
00136 return $this->flow;
00137 }
00138
00139 function setLabel($a_label)
00140 {
00141 $this->label = $a_label;
00142 }
00143
00144 function getLabel()
00145 {
00146 return $this->label;
00147 }
00148
00149 function extractText()
00150 {
00151 $text = "";
00152 if ($this->getMaterialCount())
00153 {
00154 foreach ($this->materials as $mat)
00155 {
00156 if (strcmp($mat["type"], "mattext") == 0)
00157 {
00158 $text .= $mat["material"];
00159 }
00160 }
00161 }
00162 return $text;
00163 }
00164 }
00165 ?>