ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
assQuestionImport Class Reference

Class for question imports. More...

+ Inheritance diagram for assQuestionImport:
+ Collaboration diagram for assQuestionImport:

Public Member Functions

 assQuestionImport (&$a_object)
 assQuestionImport constructor More...
 
 getFeedbackGeneric ($item)
 
 fromXML (&$item, $questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping)
 Creates a question from a QTI file. More...
 

Data Fields

 $object
 

Protected Member Functions

 addGeneralMetadata (ilQTIItem $item)
 
 getQplImportArchivDirectory ()
 returns the full path to extracted qpl import archiv (qpl import dir + qpl archiv subdir) More...
 
 getTstImportArchivDirectory ()
 returns the full path to extracted tst import archiv (tst import dir + tst archiv subdir) More...
 
 fetchAdditionalContentEditingModeInformation ($qtiItem)
 fetches the "additional content editing mode" information from qti item and falls back to ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT when no or invalid information is given More...
 

Detailed Description

Class for question imports.

assQuestionImport is a basis class question imports

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Version
$Id$

Definition at line 15 of file class.assQuestionImport.php.

Member Function Documentation

◆ addGeneralMetadata()

◆ assQuestionImport()

assQuestionImport::assQuestionImport ( $a_object)

assQuestionImport constructor

Parameters
object$a_objectThe question object public

Definition at line 32 of file class.assQuestionImport.php.

33  {
34  $this->object =& $a_object;
35  }

◆ fetchAdditionalContentEditingModeInformation()

assQuestionImport::fetchAdditionalContentEditingModeInformation (   $qtiItem)
finalprotected

fetches the "additional content editing mode" information from qti item and falls back to ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT when no or invalid information is given

protected

Parameters
type$qtiItem
Returns
string $additionalContentEditingMode

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

References assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT.

Referenced by assErrorTextImport\fromXML(), assFlashQuestionImport\fromXML(), assFileUploadImport\fromXML(), assSingleChoiceImport\fromXML(), assOrderingQuestionImport\fromXML(), assOrderingHorizontalImport\fromXML(), assNumericImport\fromXML(), assMultipleChoiceImport\fromXML(), assTextSubsetImport\fromXML(), assJavaAppletImport\fromXML(), assImagemapQuestionImport\fromXML(), assFormulaQuestionImport\fromXML(), assClozeTestImport\fromXML(), assTextQuestionImport\fromXML(), and assMatchingQuestionImport\fromXML().

165  {
166  $additionalContentEditingMode = $qtiItem->getMetadataEntry('additional_cont_edit_mode');
167 
168  if( !$this->object->isValidAdditionalContentEditingMode($additionalContentEditingMode) )
169  {
170  $additionalContentEditingMode = assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT;
171  }
172 
173  return $additionalContentEditingMode;
174  }
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
+ Here is the caller graph for this function:

◆ fromXML()

assQuestionImport::fromXML ( $item,
  $questionpool_id,
$tst_id,
$tst_object,
$question_counter,
$import_mapping 
)

Creates a question from a QTI file.

Receives parameters from a QTI parser and creates a valid ILIAS question object

Parameters
object$itemThe QTI item object
integer$questionpool_idThe id of the parent questionpool
integer$tst_idThe id of the parent test if the question is part of a test
object$tst_objectA reference to the parent test object
integer$question_counterA reference to a question counter to count the questions of an imported question pool
array$import_mappingAn array containing references to included ILIAS objects public

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

126  {
127  }

◆ getFeedbackGeneric()

assQuestionImport::getFeedbackGeneric (   $item)

Definition at line 37 of file class.assQuestionImport.php.

Referenced by assFileUploadImport\fromXML(), and assFlashQuestionImport\fromXML().

38  {
39  $feedbacksgeneric = array();
40  foreach ($item->resprocessing as $resprocessing)
41  {
42  foreach ($resprocessing->respcondition as $respcondition)
43  {
44  foreach ($respcondition->displayfeedback as $feedbackpointer)
45  {
46  if (strlen($feedbackpointer->getLinkrefid()))
47  {
48  foreach ($item->itemfeedback as $ifb)
49  {
50  if (strcmp($ifb->getIdent(), "response_allcorrect") == 0)
51  {
52  // found a feedback for the identifier
53  if (count($ifb->material))
54  {
55  foreach ($ifb->material as $material)
56  {
57  $feedbacksgeneric[1] = $material;
58  }
59  }
60  if ((count($ifb->flow_mat) > 0))
61  {
62  foreach ($ifb->flow_mat as $fmat)
63  {
64  if (count($fmat->material))
65  {
66  foreach ($fmat->material as $material)
67  {
68  $feedbacksgeneric[1] = $material;
69  }
70  }
71  }
72  }
73  }
74  else if (strcmp($ifb->getIdent(), "response_onenotcorrect") == 0)
75  {
76  // found a feedback for the identifier
77  if (count($ifb->material))
78  {
79  foreach ($ifb->material as $material)
80  {
81  $feedbacksgeneric[0] = $material;
82  }
83  }
84  if ((count($ifb->flow_mat) > 0))
85  {
86  foreach ($ifb->flow_mat as $fmat)
87  {
88  if (count($fmat->material))
89  {
90  foreach ($fmat->material as $material)
91  {
92  $feedbacksgeneric[0] = $material;
93  }
94  }
95  }
96  }
97  }
98  }
99  }
100  }
101  }
102  }
103  // handle the import of media objects in XHTML code
104  foreach ($feedbacksgeneric as $correctness => $material)
105  {
106  $m = $this->object->QTIMaterialToString($material);
107  $feedbacksgeneric[$correctness] = $m;
108  }
109  return $feedbacksgeneric;
110  }
+ Here is the caller graph for this function:

◆ getQplImportArchivDirectory()

assQuestionImport::getQplImportArchivDirectory ( )
protected

returns the full path to extracted qpl import archiv (qpl import dir + qpl archiv subdir)

Definition at line 140 of file class.assQuestionImport.php.

References $_SESSION, and ilObjQuestionPool\_getImportDirectory().

Referenced by assErrorTextImport\fromXML(), assFlashQuestionImport\fromXML(), assFileUploadImport\fromXML(), assSingleChoiceImport\fromXML(), assOrderingQuestionImport\fromXML(), assOrderingHorizontalImport\fromXML(), assNumericImport\fromXML(), assClozeTestImport\fromXML(), assTextSubsetImport\fromXML(), assJavaAppletImport\fromXML(), assImagemapQuestionImport\fromXML(), assMultipleChoiceImport\fromXML(), assTextQuestionImport\fromXML(), and assMatchingQuestionImport\fromXML().

141  {
142  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
143  return ilObjQuestionPool::_getImportDirectory() . '/' . $_SESSION["qpl_import_subdir"];
144  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
_getImportDirectory()
get import directory of lm
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTstImportArchivDirectory()

assQuestionImport::getTstImportArchivDirectory ( )
protected

returns the full path to extracted tst import archiv (tst import dir + tst archiv subdir)

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

References $_SESSION, and ilObjTest\_getImportDirectory().

Referenced by assErrorTextImport\fromXML(), assFlashQuestionImport\fromXML(), assFileUploadImport\fromXML(), assSingleChoiceImport\fromXML(), assOrderingQuestionImport\fromXML(), assOrderingHorizontalImport\fromXML(), assNumericImport\fromXML(), assClozeTestImport\fromXML(), assTextSubsetImport\fromXML(), assJavaAppletImport\fromXML(), assImagemapQuestionImport\fromXML(), assMultipleChoiceImport\fromXML(), assTextQuestionImport\fromXML(), and assMatchingQuestionImport\fromXML().

150  {
151  include_once "./Modules/Test/classes/class.ilObjTest.php";
152  return ilObjTest::_getImportDirectory() . '/' . $_SESSION["tst_import_subdir"];
153  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
_getImportDirectory()
Get the import directory location of the test.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $object

assQuestionImport::$object

Definition at line 24 of file class.assQuestionImport.php.


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