ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilQTIItem Class Reference
+ Collaboration diagram for ilQTIItem:

Public Member Functions

 __construct ()
 
 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.

Constructor & Destructor Documentation

◆ __construct()

ilQTIItem::__construct ( )

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

References array.

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  }
Create styles array
The data for the language used.

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.

References array.

370  {
371  array_push($this->suggested_solutions, array("solution" => $a_solution, "gap_index" => $a_gap_index));
372  }
Create styles array
The data for the language used.

◆ collectResponses()

ilQTIItem::collectResponses ( )

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

References $result, and array.

216  {
217  $result = array();
218  if ($this->presentation != NULL)
219  {
220  }
221  }
$result
Create styles array
The data for the language used.

◆ determineQuestionType()

ilQTIItem::determineQuestionType ( )

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

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.

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":
249  return QT_MULTIPLE_CHOICE_SR;
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;
283  return QT_MULTIPLE_CHOICE_SR;
284  break;
286  return QT_MULTIPLE_CHOICE_MR;
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_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_LONG_MENU
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 332 of file class.ilQTIItem.php.

References $author.

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

◆ getComment()

ilQTIItem::getComment ( )

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

References $comment.

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

◆ getDuration()

ilQTIItem::getDuration ( )

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

References $duration.

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

◆ getIdent()

ilQTIItem::getIdent ( )

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

References $ident.

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

◆ getIliasSourceNic()

ilQTIItem::getIliasSourceNic ( )
Returns
null

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

References $iliasSourceNic.

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

◆ getIliasSourceVersion()

ilQTIItem::getIliasSourceVersion ( )
Returns
string

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

References $iliasSourceVersion.

341  {
343  }

◆ getLabel()

ilQTIItem::getLabel ( )

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

References $label.

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

◆ getMaxattempts()

ilQTIItem::getMaxattempts ( )

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

References $maxattempts.

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

◆ getMetadata()

ilQTIItem::getMetadata ( )

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

References $itemmetadata.

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

◆ getMetadataEntry()

ilQTIItem::getMetadataEntry (   $a_label)

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

Referenced by assQuestionImport\addGeneralMetadata().

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  }
+ Here is the caller graph for this function:

◆ getPresentation()

ilQTIItem::getPresentation ( )

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

References $presentation.

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

◆ getQuestiontext()

ilQTIItem::getQuestiontext ( )

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

References $questiontext.

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

◆ getQuestiontype()

ilQTIItem::getQuestiontype ( )

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

References $questiontype.

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

◆ getTitle()

ilQTIItem::getTitle ( )

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

References $title.

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

◆ getXmllang()

ilQTIItem::getXmllang ( )

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

References $xmllang.

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

◆ 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.

References comment().

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  }
comment()
Definition: comment.php:2
+ Here is the call graph for this function:

◆ setDuration()

ilQTIItem::setDuration (   $a_duration)

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

References array.

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  }
Create styles array
The data for the language used.

◆ 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.

References $iliasSourceNic.

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

◆ setIliasSourceVersion()

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

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

References $iliasSourceVersion.

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

◆ 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: