ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

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  }

Member Function Documentation

◆ addItemfeedback()

ilQTIItem::addItemfeedback (   $a_itemfeedback)

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

168  {
169  array_push($this->itemfeedback, $a_itemfeedback);
170  }

◆ addMetadata()

ilQTIItem::addMetadata (   $a_metadata)

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

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

◆ addPresentationitem()

ilQTIItem::addPresentationitem (   $a_presentationitem)

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

230  {
231  array_push($this->presentationitem, $a_presentationitem);
232  }

◆ addResprocessing()

ilQTIItem::addResprocessing (   $a_resprocessing)

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

163  {
164  array_push($this->resprocessing, $a_resprocessing);
165  }

◆ addSuggestedSolution()

ilQTIItem::addSuggestedSolution (   $a_solution,
  $a_gap_index 
)

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

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

◆ collectResponses()

ilQTIItem::collectResponses ( )

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

References $result.

213  {
214  $result = array();
215  if ($this->presentation != null) {
216  }
217  }
$result

◆ determineQuestionType()

ilQTIItem::determineQuestionType ( )

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

References $questiontype, $response, 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.

235  {
236  switch ($this->questiontype) {
237  case "ORDERING QUESTION":
238  return QT_ORDERING;
239  case "KPRIM CHOICE QUESTION":
240  return QT_KPRIM_CHOICE;
241  case "LONG MENU QUESTION":
242  return QT_LONG_MENU;
243  case "SINGLE CHOICE QUESTION":
244  return QT_MULTIPLE_CHOICE_SR;
245  case "MULTIPLE CHOICE QUESTION":
246  break;
247  case "MATCHING QUESTION":
248  return QT_MATCHING;
249  case "CLOZE QUESTION":
250  return QT_CLOZE;
251  case "IMAGE MAP QUESTION":
252  return QT_IMAGEMAP;
253  case "JAVA APPLET QUESTION":
254  return QT_JAVAAPPLET;
255  case "TEXT QUESTION":
256  return QT_TEXT;
257  case "NUMERIC QUESTION":
258  return QT_NUMERIC;
259  case "TEXTSUBSET QUESTION":
260  return QT_TEXTSUBSET;
261  }
262  if (!$this->presentation) {
263  return QT_UNKNOWN;
264  }
265  foreach ($this->presentation->order as $entry) {
266  switch ($entry["type"]) {
267  case "response":
268  $response = $this->presentation->response[$entry["index"]];
269  switch ($response->getResponsetype()) {
270  case RT_RESPONSE_LID:
271  switch ($response->getRCardinality()) {
273  return QT_ORDERING;
274  break;
276  return QT_MULTIPLE_CHOICE_SR;
277  break;
279  return QT_MULTIPLE_CHOICE_MR;
280  break;
281  }
282  break;
283  case RT_RESPONSE_XY:
284  return QT_IMAGEMAP;
285  break;
286  case RT_RESPONSE_STR:
287  switch ($response->getRCardinality()) {
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 (is_array($material->matapplet) && count($material->matapplet) > 0) {
306  return QT_JAVAAPPLET;
307  }
308  break;
309  }
310  }
311  if (strlen($this->questiontype) == 0) {
312  return QT_UNKNOWN;
313  } else {
314  return $this->questiontype;
315  }
316  }
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
$response
const QT_ORDERING
const R_CARDINALITY_SINGLE
const R_CARDINALITY_MULTIPLE

◆ getAuthor()

ilQTIItem::getAuthor ( )

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

References $author.

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

◆ getComment()

ilQTIItem::getComment ( )

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

References $comment.

132  {
133  return $this->comment;
134  }

◆ getDuration()

ilQTIItem::getDuration ( )

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

References $duration.

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

◆ 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 347 of file class.ilQTIItem.php.

References $iliasSourceNic.

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

◆ getIliasSourceVersion()

ilQTIItem::getIliasSourceVersion ( )
Returns
string

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

References $iliasSourceVersion.

332  {
334  }

◆ getLabel()

ilQTIItem::getLabel ( )

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

References $label.

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

◆ getMaxattempts()

ilQTIItem::getMaxattempts ( )

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

References $maxattempts.

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

◆ getMetadata()

ilQTIItem::getMetadata ( )

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

References $itemmetadata.

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

◆ getMetadataEntry()

ilQTIItem::getMetadataEntry (   $a_label)

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

References $metadata.

Referenced by assQuestionImport\addGeneralMetadata().

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

◆ getPresentation()

ilQTIItem::getPresentation ( )

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

References $presentation.

208  {
209  return $this->presentation;
210  }

◆ getQuestiontext()

ilQTIItem::getQuestiontext ( )

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

References $questiontext.

158  {
159  return $this->questiontext;
160  }

◆ getQuestiontype()

ilQTIItem::getQuestiontype ( )

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

References $questiontype.

225  {
226  return $this->questiontype;
227  }

◆ 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 197 of file class.ilQTIItem.php.

References $xmllang.

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

◆ setAuthor()

ilQTIItem::setAuthor (   $a_author)

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

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

◆ 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  // special comments written by ILIAS
113  switch ($matches[1]) {
114  case "ILIAS Version":
115  $this->ilias_version = $matches[2];
116  return;
117  break;
118  case "Questiontype":
119  $this->questiontype = $matches[2];
120  return;
121  break;
122  case "Author":
123  $this->author = $matches[2];
124  return;
125  break;
126  }
127  }
128  $this->comment = $a_comment;
129  }
comment()
Definition: comment.php:2
+ Here is the call graph for this function:

◆ setDuration()

ilQTIItem::setDuration (   $a_duration)

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

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

◆ 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 355 of file class.ilQTIItem.php.

References $iliasSourceNic.

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

◆ setIliasSourceVersion()

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

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

References $iliasSourceVersion.

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

◆ setLabel()

ilQTIItem::setLabel (   $a_label)

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

183  {
184  $this->label = $a_label;
185  }

◆ setMaxattempts()

ilQTIItem::setMaxattempts (   $a_maxattempts)

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

173  {
174  $this->maxattempts = $a_maxattempts;
175  }

◆ setPresentation()

ilQTIItem::setPresentation (   $a_presentation)

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

203  {
204  $this->presentation = $a_presentation;
205  }

◆ setQuestiontext()

ilQTIItem::setQuestiontext (   $a_questiontext)

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

153  {
154  $this->questiontext = $a_questiontext;
155  }

◆ setQuestiontype()

ilQTIItem::setQuestiontype (   $a_questiontype)

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

220  {
221  $this->questiontype = $a_questiontype;
222  }

◆ 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 192 of file class.ilQTIItem.php.

193  {
194  $this->xmllang = $a_xmllang;
195  }

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: