ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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 45 of file class.ilQTIItem.php.

Member Function Documentation

◆ addItemfeedback()

ilQTIItem::addItemfeedback (   $a_itemfeedback)

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

165  {
166  array_push($this->itemfeedback, $a_itemfeedback);
167  }

◆ addMetadata()

ilQTIItem::addMetadata (   $a_metadata)

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

367  {
368  array_push($this->itemmetadata, $a_metadata);
369  }

◆ addPresentationitem()

ilQTIItem::addPresentationitem (   $a_presentationitem)

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

228  {
229  array_push($this->presentationitem, $a_presentationitem);
230  }

◆ addResprocessing()

ilQTIItem::addResprocessing (   $a_resprocessing)

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

160  {
161  array_push($this->resprocessing, $a_resprocessing);
162  }

◆ addSuggestedSolution()

ilQTIItem::addSuggestedSolution (   $a_solution,
  $a_gap_index 
)

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

362  {
363  array_push($this->suggested_solutions, array("solution" => $a_solution, "gap_index" => $a_gap_index));
364  }

◆ collectResponses()

ilQTIItem::collectResponses ( )

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

References $result.

210  {
211  $result = array();
212  if ($this->presentation != NULL)
213  {
214  }
215  }
$result

◆ determineQuestionType()

ilQTIItem::determineQuestionType ( )

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

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

233  {
234  switch ($this->questiontype)
235  {
236  case "ORDERING QUESTION":
237  return QT_ORDERING;
238  case "KPRIM CHOICE QUESTION":
239  return QT_KPRIM_CHOICE;
240  case "SINGLE CHOICE QUESTION":
241  return QT_MULTIPLE_CHOICE_SR;
242  case "MULTIPLE CHOICE QUESTION":
243  break;
244  case "MATCHING QUESTION":
245  return QT_MATCHING;
246  case "CLOZE QUESTION":
247  return QT_CLOZE;
248  case "IMAGE MAP QUESTION":
249  return QT_IMAGEMAP;
250  case "JAVA APPLET QUESTION":
251  return QT_JAVAAPPLET;
252  case "TEXT QUESTION":
253  return QT_TEXT;
254  case "NUMERIC QUESTION":
255  return QT_NUMERIC;
256  case "TEXTSUBSET QUESTION":
257  return QT_TEXTSUBSET;
258  }
259  if (!$this->presentation) return QT_UNKNOWN;
260  foreach ($this->presentation->order as $entry)
261  {
262  switch ($entry["type"])
263  {
264  case "response":
265  $response = $this->presentation->response[$entry["index"]];
266  switch ($response->getResponsetype())
267  {
268  case RT_RESPONSE_LID:
269  switch ($response->getRCardinality())
270  {
272  return QT_ORDERING;
273  break;
275  return QT_MULTIPLE_CHOICE_SR;
276  break;
278  return QT_MULTIPLE_CHOICE_MR;
279  break;
280  }
281  break;
282  case RT_RESPONSE_XY:
283  return QT_IMAGEMAP;
284  break;
285  case RT_RESPONSE_STR:
286  switch ($response->getRCardinality())
287  {
289  return QT_TEXT;
290  break;
292  return QT_CLOZE;
293  break;
294  }
295  break;
296  case RT_RESPONSE_GRP:
297  return QT_MATCHING;
298  break;
299  default:
300  break;
301  }
302  break;
303  case "material":
304  $material = $this->presentation->material[$entry["index"]];
305  if (count($material->matapplet) > 0) return QT_JAVAAPPLET;
306  break;
307  }
308  }
309  if (strlen($this->questiontype) == 0)
310  {
311  return QT_UNKNOWN;
312  }
313  else
314  {
315  return $this->questiontype;
316  }
317  }
const QT_MATCHING
const RT_RESPONSE_LID
const QT_TEXT
const RT_RESPONSE_STR
const R_CARDINALITY_ORDERED
const RT_RESPONSE_GRP
const QT_KPRIM_CHOICE
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 324 of file class.ilQTIItem.php.

References $author.

325  {
326  return $this->author;
327  }

◆ getComment()

ilQTIItem::getComment ( )

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

References $comment.

128  {
129  return $this->comment;
130  }

◆ getDuration()

ilQTIItem::getDuration ( )

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

References $duration.

145  {
146  return $this->duration;
147  }

◆ getIdent()

ilQTIItem::getIdent ( )

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

References $ident.

89  {
90  return $this->ident;
91  }

◆ getIliasSourceNic()

ilQTIItem::getIliasSourceNic ( )
Returns
null

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

References $iliasSourceNic.

349  {
350  return $this->iliasSourceNic;
351  }

◆ getIliasSourceVersion()

ilQTIItem::getIliasSourceVersion ( )
Returns
string

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

References $iliasSourceVersion.

333  {
335  }

◆ getLabel()

ilQTIItem::getLabel ( )

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

References $label.

185  {
186  return $this->label;
187  }

◆ getMaxattempts()

ilQTIItem::getMaxattempts ( )

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

References $maxattempts.

175  {
176  return $this->maxattempts;
177  }

◆ getMetadata()

ilQTIItem::getMetadata ( )

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

References $itemmetadata.

372  {
373  return $this->itemmetadata;
374  }

◆ getMetadataEntry()

ilQTIItem::getMetadataEntry (   $a_label)

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

Referenced by assQuestionImport\addGeneralMetadata().

377  {
378  foreach ($this->itemmetadata as $metadata)
379  {
380  if (strcmp($metadata["label"], $a_label) == 0)
381  {
382  return $metadata["entry"];
383  }
384  }
385  return null;
386  }
+ Here is the caller graph for this function:

◆ getPresentation()

ilQTIItem::getPresentation ( )

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

References $presentation.

205  {
206  return $this->presentation;
207  }

◆ getQuestiontext()

ilQTIItem::getQuestiontext ( )

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

References $questiontext.

155  {
156  return $this->questiontext;
157  }

◆ getQuestiontype()

ilQTIItem::getQuestiontype ( )

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

References $questiontype.

223  {
224  return $this->questiontype;
225  }

◆ getTitle()

ilQTIItem::getTitle ( )

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

References $title.

99  {
100  return $this->title;
101  }

◆ getXmllang()

ilQTIItem::getXmllang ( )

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

References $xmllang.

195  {
196  return $this->xmllang;
197  }

◆ ilQTIItem()

ilQTIItem::ilQTIItem ( )

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

70  {
71  $this->response = array();
72  $this->resprocessing = array();
73  $this->itemfeedback = array();
74  $this->presentation = NULL;
75  $this->presentationitem = array();
76  $this->suggested_solutions = array();
77  $this->itemmetadata = array();
78 
79  $this->iliasSourceVersion = null;
80  $this->iliasSourceNic = null;
81  }

◆ setAuthor()

ilQTIItem::setAuthor (   $a_author)

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

320  {
321  $this->author = $a_author;
322  }

◆ setComment()

ilQTIItem::setComment (   $a_comment)

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

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

◆ setDuration()

ilQTIItem::setDuration (   $a_duration)

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

133  {
134  if (preg_match("/P(\d+)Y(\d+)M(\d+)DT(\d+)H(\d+)M(\d+)S/", $a_duration, $matches))
135  {
136  $this->duration = array(
137  "h" => $matches[4],
138  "m" => $matches[5],
139  "s" => $matches[6]
140  );
141  }
142  }

◆ setIdent()

ilQTIItem::setIdent (   $a_ident)

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

84  {
85  $this->ident = $a_ident;
86  }

◆ setIliasSourceNic()

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

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

References $iliasSourceNic.

357  {
358  $this->iliasSourceNic = $iliasSourceNic;
359  }

◆ setIliasSourceVersion()

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

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

References $iliasSourceVersion.

341  {
342  $this->iliasSourceVersion = $iliasSourceVersion;
343  }

◆ setLabel()

ilQTIItem::setLabel (   $a_label)

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

180  {
181  $this->label = $a_label;
182  }

◆ setMaxattempts()

ilQTIItem::setMaxattempts (   $a_maxattempts)

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

170  {
171  $this->maxattempts = $a_maxattempts;
172  }

◆ setPresentation()

ilQTIItem::setPresentation (   $a_presentation)

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

200  {
201  $this->presentation = $a_presentation;
202  }

◆ setQuestiontext()

ilQTIItem::setQuestiontext (   $a_questiontext)

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

150  {
151  $this->questiontext = $a_questiontext;
152  }

◆ setQuestiontype()

ilQTIItem::setQuestiontype (   $a_questiontype)

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

218  {
219  $this->questiontype = $a_questiontype;
220  }

◆ setTitle()

ilQTIItem::setTitle (   $a_title)

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

94  {
95  $this->title = $a_title;
96  }

◆ setXmllang()

ilQTIItem::setXmllang (   $a_xmllang)

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

190  {
191  $this->xmllang = $a_xmllang;
192  }

Field Documentation

◆ $author

ilQTIItem::$author

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

Referenced by getAuthor().

◆ $comment

ilQTIItem::$comment

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

Referenced by getComment().

◆ $duration

ilQTIItem::$duration

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

Referenced by getDuration().

◆ $ident

ilQTIItem::$ident

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

Referenced by getIdent().

◆ $ilias_version

ilQTIItem::$ilias_version

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

◆ $iliasSourceNic

ilQTIItem::$iliasSourceNic
protected

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

Referenced by getIliasSourceNic(), and setIliasSourceNic().

◆ $iliasSourceVersion

ilQTIItem::$iliasSourceVersion
protected

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

Referenced by getIliasSourceVersion(), and setIliasSourceVersion().

◆ $itemfeedback

ilQTIItem::$itemfeedback

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

◆ $itemmetadata

ilQTIItem::$itemmetadata

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

Referenced by getMetadata().

◆ $label

ilQTIItem::$label

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

Referenced by getLabel().

◆ $maxattempts

ilQTIItem::$maxattempts

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

Referenced by getMaxattempts().

◆ $presentation

ilQTIItem::$presentation

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

Referenced by getPresentation().

◆ $presentationitem

ilQTIItem::$presentationitem

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

◆ $questiontext

ilQTIItem::$questiontext

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

Referenced by getQuestiontext().

◆ $questiontype

ilQTIItem::$questiontype

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

Referenced by determineQuestionType(), and getQuestiontype().

◆ $resprocessing

ilQTIItem::$resprocessing

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

◆ $suggested_solutions

ilQTIItem::$suggested_solutions

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

◆ $title

ilQTIItem::$title

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

Referenced by getTitle().

◆ $xmllang

ilQTIItem::$xmllang

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

Referenced by getXmllang().


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