ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilQTIItem Class Reference
+ Collaboration diagram for ilQTIItem:

Public Member Functions

 ilQTIItem ()
 
 setIdent ($a_ident)
 
 getIdent ()
 
 setTitle ($a_title)
 
 getTitle ()
 
 setComment ($a_comment)
 
 getComment ()
 
 setDuration ($a_duration)
 
 getDuration ()
 
 setQuestiontext ($a_questiontext)
 
 getQuestiontext ()
 
 addResprocessing ($a_resprocessing)
 
 addItemfeedback ($a_itemfeedback)
 
 setMaxattempts ($a_maxattempts)
 
 getMaxattempts ()
 
 setLabel ($a_label)
 
 getLabel ()
 
 setXmllang ($a_xmllang)
 
 getXmllang ()
 
 setPresentation ($a_presentation)
 
 getPresentation ()
 
 collectResponses ()
 
 setQuestiontype ($a_questiontype)
 
 getQuestiontype ()
 
 addPresentationitem ($a_presentationitem)
 
 determineQuestionType ()
 
 setAuthor ($a_author)
 
 getAuthor ()
 
 getIliasSourceVersion ()
 
 setIliasSourceVersion ($iliasSourceVersion)
 
 getIliasSourceNic ()
 
 setIliasSourceNic ($iliasSourceNic)
 
 addSuggestedSolution ($a_solution, $a_gap_index)
 
 addMetadata ($a_metadata)
 
 getMetadata ()
 
 getMetadataEntry ($a_label)
 

Data Fields

 $ident
 
 $title
 
 $maxattempts
 
 $label
 
 $xmllang
 
 $comment
 
 $ilias_version
 
 $author
 
 $questiontype
 
 $duration
 
 $questiontext
 
 $resprocessing
 
 $itemfeedback
 
 $presentation
 
 $presentationitem
 
 $suggested_solutions
 
 $itemmetadata
 

Protected Attributes

 $iliasSourceVersion
 
 $iliasSourceNic
 

Detailed Description

Definition at line 51 of file class.ilQTIItem.php.

Member Function Documentation

◆ addItemfeedback()

ilQTIItem::addItemfeedback (   $a_itemfeedback)

Definition at line 170 of file class.ilQTIItem.php.

171 {
172 array_push($this->itemfeedback, $a_itemfeedback);
173 }

◆ addMetadata()

ilQTIItem::addMetadata (   $a_metadata)

Definition at line 374 of file class.ilQTIItem.php.

375 {
376 array_push($this->itemmetadata, $a_metadata);
377 }

◆ addPresentationitem()

ilQTIItem::addPresentationitem (   $a_presentationitem)

Definition at line 233 of file class.ilQTIItem.php.

234 {
235 array_push($this->presentationitem, $a_presentationitem);
236 }

◆ addResprocessing()

ilQTIItem::addResprocessing (   $a_resprocessing)

Definition at line 165 of file class.ilQTIItem.php.

166 {
167 array_push($this->resprocessing, $a_resprocessing);
168 }

◆ addSuggestedSolution()

ilQTIItem::addSuggestedSolution (   $a_solution,
  $a_gap_index 
)

Definition at line 369 of file class.ilQTIItem.php.

370 {
371 array_push($this->suggested_solutions, array("solution" => $a_solution, "gap_index" => $a_gap_index));
372 }

◆ collectResponses()

ilQTIItem::collectResponses ( )

Definition at line 215 of file class.ilQTIItem.php.

216 {
217 $result = array();
218 if ($this->presentation != NULL)
219 {
220 }
221 }
$result

References $result.

◆ determineQuestionType()

ilQTIItem::determineQuestionType ( )

Definition at line 238 of file class.ilQTIItem.php.

239 {
240 switch ($this->questiontype)
241 {
242 case "ORDERING QUESTION":
243 return QT_ORDERING;
244 case "KPRIM CHOICE QUESTION":
245 return QT_KPRIM_CHOICE;
246 case "LONG MENU QUESTION":
247 return QT_LONG_MENU;
248 case "SINGLE CHOICE QUESTION":
250 case "MULTIPLE CHOICE QUESTION":
251 break;
252 case "MATCHING QUESTION":
253 return QT_MATCHING;
254 case "CLOZE QUESTION":
255 return QT_CLOZE;
256 case "IMAGE MAP QUESTION":
257 return QT_IMAGEMAP;
258 case "JAVA APPLET QUESTION":
259 return QT_JAVAAPPLET;
260 case "TEXT QUESTION":
261 return QT_TEXT;
262 case "NUMERIC QUESTION":
263 return QT_NUMERIC;
264 case "TEXTSUBSET QUESTION":
265 return QT_TEXTSUBSET;
266 }
267 if (!$this->presentation) return QT_UNKNOWN;
268 foreach ($this->presentation->order as $entry)
269 {
270 switch ($entry["type"])
271 {
272 case "response":
273 $response = $this->presentation->response[$entry["index"]];
274 switch ($response->getResponsetype())
275 {
276 case RT_RESPONSE_LID:
277 switch ($response->getRCardinality())
278 {
280 return QT_ORDERING;
281 break;
284 break;
287 break;
288 }
289 break;
290 case RT_RESPONSE_XY:
291 return QT_IMAGEMAP;
292 break;
293 case RT_RESPONSE_STR:
294 switch ($response->getRCardinality())
295 {
297 return QT_TEXT;
298 break;
300 return QT_CLOZE;
301 break;
302 }
303 break;
304 case RT_RESPONSE_GRP:
305 return QT_MATCHING;
306 break;
307 default:
308 break;
309 }
310 break;
311 case "material":
312 $material = $this->presentation->material[$entry["index"]];
313 if (count($material->matapplet) > 0) return QT_JAVAAPPLET;
314 break;
315 }
316 }
317 if (strlen($this->questiontype) == 0)
318 {
319 return QT_UNKNOWN;
320 }
321 else
322 {
323 return $this->questiontype;
324 }
325 }
const QT_CLOZE
const QT_IMAGEMAP
const QT_TEXTSUBSET
const QT_JAVAAPPLET
const QT_UNKNOWN
const QT_KPRIM_CHOICE
const QT_MULTIPLE_CHOICE_MR
const QT_MATCHING
const QT_ORDERING
const QT_NUMERIC
const QT_MULTIPLE_CHOICE_SR
const QT_LONG_MENU
const QT_TEXT
const RT_RESPONSE_LID
const RT_RESPONSE_XY
const R_CARDINALITY_SINGLE
const RT_RESPONSE_STR
const R_CARDINALITY_ORDERED
const RT_RESPONSE_GRP
const R_CARDINALITY_MULTIPLE

References $questiontype, QT_CLOZE, QT_IMAGEMAP, QT_JAVAAPPLET, QT_KPRIM_CHOICE, QT_LONG_MENU, QT_MATCHING, QT_MULTIPLE_CHOICE_MR, QT_MULTIPLE_CHOICE_SR, QT_NUMERIC, QT_ORDERING, QT_TEXT, QT_TEXTSUBSET, QT_UNKNOWN, R_CARDINALITY_MULTIPLE, R_CARDINALITY_ORDERED, R_CARDINALITY_SINGLE, RT_RESPONSE_GRP, RT_RESPONSE_LID, RT_RESPONSE_STR, and RT_RESPONSE_XY.

◆ getAuthor()

ilQTIItem::getAuthor ( )

Definition at line 332 of file class.ilQTIItem.php.

333 {
334 return $this->author;
335 }

References $author.

◆ getComment()

ilQTIItem::getComment ( )

Definition at line 133 of file class.ilQTIItem.php.

134 {
135 return $this->comment;
136 }

References $comment.

◆ getDuration()

ilQTIItem::getDuration ( )

Definition at line 150 of file class.ilQTIItem.php.

151 {
152 return $this->duration;
153 }

References $duration.

◆ getIdent()

ilQTIItem::getIdent ( )

Definition at line 94 of file class.ilQTIItem.php.

95 {
96 return $this->ident;
97 }

References $ident.

◆ getIliasSourceNic()

ilQTIItem::getIliasSourceNic ( )
Returns
null

Definition at line 356 of file class.ilQTIItem.php.

357 {
359 }

References $iliasSourceNic.

◆ getIliasSourceVersion()

ilQTIItem::getIliasSourceVersion ( )
Returns
string

Definition at line 340 of file class.ilQTIItem.php.

341 {
343 }

References $iliasSourceVersion.

◆ getLabel()

ilQTIItem::getLabel ( )

Definition at line 190 of file class.ilQTIItem.php.

191 {
192 return $this->label;
193 }

References $label.

◆ getMaxattempts()

ilQTIItem::getMaxattempts ( )

Definition at line 180 of file class.ilQTIItem.php.

181 {
182 return $this->maxattempts;
183 }

References $maxattempts.

◆ getMetadata()

ilQTIItem::getMetadata ( )

Definition at line 379 of file class.ilQTIItem.php.

380 {
381 return $this->itemmetadata;
382 }

References $itemmetadata.

◆ getMetadataEntry()

ilQTIItem::getMetadataEntry (   $a_label)

Definition at line 384 of file class.ilQTIItem.php.

385 {
386 foreach ($this->itemmetadata as $metadata)
387 {
388 if (strcmp($metadata["label"], $a_label) == 0)
389 {
390 return $metadata["entry"];
391 }
392 }
393 return null;
394 }

Referenced by assQuestionImport\addGeneralMetadata().

+ Here is the caller graph for this function:

◆ getPresentation()

ilQTIItem::getPresentation ( )

Definition at line 210 of file class.ilQTIItem.php.

211 {
212 return $this->presentation;
213 }

References $presentation.

◆ getQuestiontext()

ilQTIItem::getQuestiontext ( )

Definition at line 160 of file class.ilQTIItem.php.

161 {
162 return $this->questiontext;
163 }

References $questiontext.

◆ getQuestiontype()

ilQTIItem::getQuestiontype ( )

Definition at line 228 of file class.ilQTIItem.php.

229 {
230 return $this->questiontype;
231 }

References $questiontype.

◆ getTitle()

ilQTIItem::getTitle ( )

Definition at line 104 of file class.ilQTIItem.php.

105 {
106 return $this->title;
107 }

References $title.

◆ getXmllang()

ilQTIItem::getXmllang ( )

Definition at line 200 of file class.ilQTIItem.php.

201 {
202 return $this->xmllang;
203 }

References $xmllang.

◆ ilQTIItem()

ilQTIItem::ilQTIItem ( )

Definition at line 75 of file class.ilQTIItem.php.

76 {
77 $this->response = array();
78 $this->resprocessing = array();
79 $this->itemfeedback = array();
80 $this->presentation = NULL;
81 $this->presentationitem = array();
82 $this->suggested_solutions = array();
83 $this->itemmetadata = array();
84
85 $this->iliasSourceVersion = null;
86 $this->iliasSourceNic = null;
87 }

◆ setAuthor()

ilQTIItem::setAuthor (   $a_author)

Definition at line 327 of file class.ilQTIItem.php.

328 {
329 $this->author = $a_author;
330 }

◆ setComment()

ilQTIItem::setComment (   $a_comment)

Definition at line 109 of file class.ilQTIItem.php.

110 {
111 if (preg_match("/(.*?)\=(.*)/", $a_comment, $matches))
112 {
113 // special comments written by ILIAS
114 switch ($matches[1])
115 {
116 case "ILIAS Version":
117 $this->ilias_version = $matches[2];
118 return;
119 break;
120 case "Questiontype":
121 $this->questiontype = $matches[2];
122 return;
123 break;
124 case "Author":
125 $this->author = $matches[2];
126 return;
127 break;
128 }
129 }
130 $this->comment = $a_comment;
131 }

◆ setDuration()

ilQTIItem::setDuration (   $a_duration)

Definition at line 138 of file class.ilQTIItem.php.

139 {
140 if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $a_duration, $matches))
141 {
142 $this->duration = array(
143 "h" => $matches[4],
144 "m" => $matches[5],
145 "s" => $matches[6]
146 );
147 }
148 }

◆ setIdent()

ilQTIItem::setIdent (   $a_ident)

Definition at line 89 of file class.ilQTIItem.php.

90 {
91 $this->ident = $a_ident;
92 }

◆ setIliasSourceNic()

ilQTIItem::setIliasSourceNic (   $iliasSourceNic)
Parameters
null$iliasSourceNic

Definition at line 364 of file class.ilQTIItem.php.

365 {
366 $this->iliasSourceNic = $iliasSourceNic;
367 }

References $iliasSourceNic.

◆ setIliasSourceVersion()

ilQTIItem::setIliasSourceVersion (   $iliasSourceVersion)
Parameters
string$iliasSourceVersion

Definition at line 348 of file class.ilQTIItem.php.

349 {
350 $this->iliasSourceVersion = $iliasSourceVersion;
351 }

References $iliasSourceVersion.

◆ setLabel()

ilQTIItem::setLabel (   $a_label)

Definition at line 185 of file class.ilQTIItem.php.

186 {
187 $this->label = $a_label;
188 }

◆ setMaxattempts()

ilQTIItem::setMaxattempts (   $a_maxattempts)

Definition at line 175 of file class.ilQTIItem.php.

176 {
177 $this->maxattempts = $a_maxattempts;
178 }

◆ setPresentation()

ilQTIItem::setPresentation (   $a_presentation)

Definition at line 205 of file class.ilQTIItem.php.

206 {
207 $this->presentation = $a_presentation;
208 }

◆ setQuestiontext()

ilQTIItem::setQuestiontext (   $a_questiontext)

Definition at line 155 of file class.ilQTIItem.php.

156 {
157 $this->questiontext = $a_questiontext;
158 }

◆ setQuestiontype()

ilQTIItem::setQuestiontype (   $a_questiontype)

Definition at line 223 of file class.ilQTIItem.php.

224 {
225 $this->questiontype = $a_questiontype;
226 }

◆ setTitle()

ilQTIItem::setTitle (   $a_title)

Definition at line 99 of file class.ilQTIItem.php.

100 {
101 $this->title = $a_title;
102 }

◆ setXmllang()

ilQTIItem::setXmllang (   $a_xmllang)

Definition at line 195 of file class.ilQTIItem.php.

196 {
197 $this->xmllang = $a_xmllang;
198 }

Field Documentation

◆ $author

ilQTIItem::$author

Definition at line 61 of file class.ilQTIItem.php.

Referenced by getAuthor().

◆ $comment

ilQTIItem::$comment

Definition at line 59 of file class.ilQTIItem.php.

Referenced by getComment().

◆ $duration

ilQTIItem::$duration

Definition at line 63 of file class.ilQTIItem.php.

Referenced by getDuration().

◆ $ident

ilQTIItem::$ident

Definition at line 53 of file class.ilQTIItem.php.

Referenced by getIdent().

◆ $ilias_version

ilQTIItem::$ilias_version

Definition at line 60 of file class.ilQTIItem.php.

◆ $iliasSourceNic

ilQTIItem::$iliasSourceNic
protected

Definition at line 73 of file class.ilQTIItem.php.

Referenced by getIliasSourceNic(), and setIliasSourceNic().

◆ $iliasSourceVersion

ilQTIItem::$iliasSourceVersion
protected

Definition at line 72 of file class.ilQTIItem.php.

Referenced by getIliasSourceVersion(), and setIliasSourceVersion().

◆ $itemfeedback

ilQTIItem::$itemfeedback

Definition at line 66 of file class.ilQTIItem.php.

◆ $itemmetadata

ilQTIItem::$itemmetadata

Definition at line 70 of file class.ilQTIItem.php.

Referenced by getMetadata().

◆ $label

ilQTIItem::$label

Definition at line 56 of file class.ilQTIItem.php.

Referenced by getLabel().

◆ $maxattempts

ilQTIItem::$maxattempts

Definition at line 55 of file class.ilQTIItem.php.

Referenced by getMaxattempts().

◆ $presentation

ilQTIItem::$presentation

Definition at line 67 of file class.ilQTIItem.php.

Referenced by getPresentation().

◆ $presentationitem

ilQTIItem::$presentationitem

Definition at line 68 of file class.ilQTIItem.php.

◆ $questiontext

ilQTIItem::$questiontext

Definition at line 64 of file class.ilQTIItem.php.

Referenced by getQuestiontext().

◆ $questiontype

ilQTIItem::$questiontype

Definition at line 62 of file class.ilQTIItem.php.

Referenced by determineQuestionType(), and getQuestiontype().

◆ $resprocessing

ilQTIItem::$resprocessing

Definition at line 65 of file class.ilQTIItem.php.

◆ $suggested_solutions

ilQTIItem::$suggested_solutions

Definition at line 69 of file class.ilQTIItem.php.

◆ $title

ilQTIItem::$title

Definition at line 54 of file class.ilQTIItem.php.

Referenced by getTitle().

◆ $xmllang

ilQTIItem::$xmllang

Definition at line 57 of file class.ilQTIItem.php.

Referenced by getXmllang().


The documentation for this class was generated from the following file: