ILIAS  release_4-4 Revision
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 ()
 
 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
 

Detailed Description

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

Member Function Documentation

◆ addItemfeedback()

ilQTIItem::addItemfeedback (   $a_itemfeedback)

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

158  {
159  array_push($this->itemfeedback, $a_itemfeedback);
160  }

◆ addMetadata()

ilQTIItem::addMetadata (   $a_metadata)

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

326  {
327  array_push($this->itemmetadata, $a_metadata);
328  }

◆ addPresentationitem()

ilQTIItem::addPresentationitem (   $a_presentationitem)

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

221  {
222  array_push($this->presentationitem, $a_presentationitem);
223  }

◆ addResprocessing()

ilQTIItem::addResprocessing (   $a_resprocessing)

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

153  {
154  array_push($this->resprocessing, $a_resprocessing);
155  }

◆ addSuggestedSolution()

ilQTIItem::addSuggestedSolution (   $a_solution,
  $a_gap_index 
)

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

321  {
322  array_push($this->suggested_solutions, array("solution" => $a_solution, "gap_index" => $a_gap_index));
323  }

◆ collectResponses()

ilQTIItem::collectResponses ( )

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

References $result.

203  {
204  $result = array();
205  if ($this->presentation != NULL)
206  {
207  }
208  }
$result

◆ determineQuestionType()

ilQTIItem::determineQuestionType ( )

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

References $questiontype, QT_CLOZE, QT_IMAGEMAP, QT_JAVAAPPLET, 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.

226  {
227  switch ($this->questiontype)
228  {
229  case "ORDERING QUESTION":
230  return QT_ORDERING;
231  case "SINGLE CHOICE QUESTION":
232  return QT_MULTIPLE_CHOICE_SR;
233  case "MULTIPLE CHOICE QUESTION":
234  break;
235  case "MATCHING QUESTION":
236  return QT_MATCHING;
237  case "CLOZE QUESTION":
238  return QT_CLOZE;
239  case "IMAGE MAP QUESTION":
240  return QT_IMAGEMAP;
241  case "JAVA APPLET QUESTION":
242  return QT_JAVAAPPLET;
243  case "TEXT QUESTION":
244  return QT_TEXT;
245  case "NUMERIC QUESTION":
246  return QT_NUMERIC;
247  case "TEXTSUBSET QUESTION":
248  return QT_TEXTSUBSET;
249  }
250  if (!$this->presentation) return QT_UNKNOWN;
251  foreach ($this->presentation->order as $entry)
252  {
253  switch ($entry["type"])
254  {
255  case "response":
256  $response = $this->presentation->response[$entry["index"]];
257  switch ($response->getResponsetype())
258  {
259  case RT_RESPONSE_LID:
260  switch ($response->getRCardinality())
261  {
263  return QT_ORDERING;
264  break;
266  return QT_MULTIPLE_CHOICE_SR;
267  break;
269  return QT_MULTIPLE_CHOICE_MR;
270  break;
271  }
272  break;
273  case RT_RESPONSE_XY:
274  return QT_IMAGEMAP;
275  break;
276  case RT_RESPONSE_STR:
277  switch ($response->getRCardinality())
278  {
280  return QT_TEXT;
281  break;
283  return QT_CLOZE;
284  break;
285  }
286  break;
287  case RT_RESPONSE_GRP:
288  return QT_MATCHING;
289  break;
290  default:
291  break;
292  }
293  break;
294  case "material":
295  $material = $this->presentation->material[$entry["index"]];
296  if (count($material->matapplet) > 0) return QT_JAVAAPPLET;
297  break;
298  }
299  }
300  if (strlen($this->questiontype) == 0)
301  {
302  return QT_UNKNOWN;
303  }
304  else
305  {
306  return $this->questiontype;
307  }
308  }
const QT_MATCHING
const RT_RESPONSE_LID
const QT_TEXT
const RT_RESPONSE_STR
const R_CARDINALITY_ORDERED
const RT_RESPONSE_GRP
const QT_IMAGEMAP
const QT_MULTIPLE_CHOICE_SR
const QT_UNKNOWN
const QT_JAVAAPPLET
const QT_NUMERIC
const QT_TEXTSUBSET
const RT_RESPONSE_XY
const QT_CLOZE
const QT_MULTIPLE_CHOICE_MR
const QT_ORDERING
const R_CARDINALITY_SINGLE
const R_CARDINALITY_MULTIPLE

◆ getAuthor()

ilQTIItem::getAuthor ( )

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

References $author.

316  {
317  return $this->author;
318  }

◆ getComment()

ilQTIItem::getComment ( )

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

References $comment.

121  {
122  return $this->comment;
123  }

◆ getDuration()

ilQTIItem::getDuration ( )

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

References $duration.

138  {
139  return $this->duration;
140  }

◆ getIdent()

ilQTIItem::getIdent ( )

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

References $ident.

82  {
83  return $this->ident;
84  }

◆ getLabel()

ilQTIItem::getLabel ( )

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

References $label.

178  {
179  return $this->label;
180  }

◆ getMaxattempts()

ilQTIItem::getMaxattempts ( )

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

References $maxattempts.

168  {
169  return $this->maxattempts;
170  }

◆ getMetadata()

ilQTIItem::getMetadata ( )

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

References $itemmetadata.

331  {
332  return $this->itemmetadata;
333  }

◆ getMetadataEntry()

ilQTIItem::getMetadataEntry (   $a_label)

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

Referenced by assQuestionImport\addGeneralMetadata().

336  {
337  foreach ($this->itemmetadata as $metadata)
338  {
339  if (strcmp($metadata["label"], $a_label) == 0)
340  {
341  return $metadata["entry"];
342  }
343  }
344  return null;
345  }
+ Here is the caller graph for this function:

◆ getPresentation()

ilQTIItem::getPresentation ( )

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

References $presentation.

198  {
199  return $this->presentation;
200  }

◆ getQuestiontext()

ilQTIItem::getQuestiontext ( )

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

References $questiontext.

148  {
149  return $this->questiontext;
150  }

◆ getQuestiontype()

ilQTIItem::getQuestiontype ( )

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

References $questiontype.

216  {
217  return $this->questiontype;
218  }

◆ getTitle()

ilQTIItem::getTitle ( )

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

References $title.

92  {
93  return $this->title;
94  }

◆ getXmllang()

ilQTIItem::getXmllang ( )

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

References $xmllang.

188  {
189  return $this->xmllang;
190  }

◆ ilQTIItem()

ilQTIItem::ilQTIItem ( )

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

66  {
67  $this->response = array();
68  $this->resprocessing = array();
69  $this->itemfeedback = array();
70  $this->presentation = NULL;
71  $this->presentationitem = array();
72  $this->suggested_solutions = array();
73  $this->itemmetadata = array();
74  }

◆ setAuthor()

ilQTIItem::setAuthor (   $a_author)

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

311  {
312  $this->author = $a_author;
313  }

◆ setComment()

ilQTIItem::setComment (   $a_comment)

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

97  {
98  if (preg_match("/(.*?)\=(.*)/", $a_comment, $matches))
99  {
100  // special comments written by ILIAS
101  switch ($matches[1])
102  {
103  case "ILIAS Version":
104  $this->ilias_version = $matches[2];
105  return;
106  break;
107  case "Questiontype":
108  $this->questiontype = $matches[2];
109  return;
110  break;
111  case "Author":
112  $this->author = $matches[2];
113  return;
114  break;
115  }
116  }
117  $this->comment = $a_comment;
118  }

◆ setDuration()

ilQTIItem::setDuration (   $a_duration)

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

126  {
127  if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $a_duration, $matches))
128  {
129  $this->duration = array(
130  "h" => $matches[4],
131  "m" => $matches[5],
132  "s" => $matches[6]
133  );
134  }
135  }

◆ setIdent()

ilQTIItem::setIdent (   $a_ident)

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

77  {
78  $this->ident = $a_ident;
79  }

◆ setLabel()

ilQTIItem::setLabel (   $a_label)

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

173  {
174  $this->label = $a_label;
175  }

◆ setMaxattempts()

ilQTIItem::setMaxattempts (   $a_maxattempts)

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

163  {
164  $this->maxattempts = $a_maxattempts;
165  }

◆ setPresentation()

ilQTIItem::setPresentation (   $a_presentation)

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

193  {
194  $this->presentation = $a_presentation;
195  }

◆ setQuestiontext()

ilQTIItem::setQuestiontext (   $a_questiontext)

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

143  {
144  $this->questiontext = $a_questiontext;
145  }

◆ setQuestiontype()

ilQTIItem::setQuestiontype (   $a_questiontype)

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

211  {
212  $this->questiontype = $a_questiontype;
213  }

◆ setTitle()

ilQTIItem::setTitle (   $a_title)

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

87  {
88  $this->title = $a_title;
89  }

◆ setXmllang()

ilQTIItem::setXmllang (   $a_xmllang)

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

183  {
184  $this->xmllang = $a_xmllang;
185  }

Field Documentation

◆ $author

ilQTIItem::$author

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

Referenced by getAuthor().

◆ $comment

ilQTIItem::$comment

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

Referenced by getComment().

◆ $duration

ilQTIItem::$duration

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

Referenced by getDuration().

◆ $ident

ilQTIItem::$ident

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

Referenced by getIdent().

◆ $ilias_version

ilQTIItem::$ilias_version

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

◆ $itemfeedback

ilQTIItem::$itemfeedback

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

◆ $itemmetadata

ilQTIItem::$itemmetadata

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

Referenced by getMetadata().

◆ $label

ilQTIItem::$label

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

Referenced by getLabel().

◆ $maxattempts

ilQTIItem::$maxattempts

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

Referenced by getMaxattempts().

◆ $presentation

ilQTIItem::$presentation

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

Referenced by getPresentation().

◆ $presentationitem

ilQTIItem::$presentationitem

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

◆ $questiontext

ilQTIItem::$questiontext

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

Referenced by getQuestiontext().

◆ $questiontype

ilQTIItem::$questiontype

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

Referenced by determineQuestionType(), and getQuestiontype().

◆ $resprocessing

ilQTIItem::$resprocessing

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

◆ $suggested_solutions

ilQTIItem::$suggested_solutions

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

◆ $title

ilQTIItem::$title

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

Referenced by getTitle().

◆ $xmllang

ilQTIItem::$xmllang

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

Referenced by getXmllang().


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