ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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
 getFeedbackGeneric ($item)
 fromXML (&$item, $questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping)
 Creates a question from a QTI file.

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)
 getTstImportArchivDirectory ()
 returns the full path to extracted tst import archiv (tst import dir + tst archiv subdir)
 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

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:
class.assQuestionImport.php 44245 2013-08-17 11:15:45Z mbecker

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

Member Function Documentation

assQuestionImport::assQuestionImport ( $a_object)

assQuestionImport constructor

Parameters
object$a_objectThe question object public

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

{
$this->object =& $a_object;
}
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().

{
$additionalContentEditingMode = $qtiItem->getMetadataEntry('additional_cont_edit_mode');
if( !$this->object->isValidAdditionalContentEditingMode($additionalContentEditingMode) )
{
}
return $additionalContentEditingMode;
}

+ Here is the caller graph for this function:

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

Reimplemented in assMatchingQuestionImport, assClozeTestImport, assFormulaQuestionImport, assImagemapQuestionImport, assJavaAppletImport, assNumericImport, assOrderingHorizontalImport, assOrderingQuestionImport, assSingleChoiceImport, assTextQuestionImport, assTextSubsetImport, assErrorTextImport, assFileUploadImport, and assFlashQuestionImport.

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

{
}
assQuestionImport::getFeedbackGeneric (   $item)

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

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

{
$feedbacksgeneric = array();
foreach ($item->resprocessing as $resprocessing)
{
foreach ($resprocessing->respcondition as $respcondition)
{
foreach ($respcondition->displayfeedback as $feedbackpointer)
{
if (strlen($feedbackpointer->getLinkrefid()))
{
foreach ($item->itemfeedback as $ifb)
{
if (strcmp($ifb->getIdent(), "response_allcorrect") == 0)
{
// found a feedback for the identifier
if (count($ifb->material))
{
foreach ($ifb->material as $material)
{
$feedbacksgeneric[1] = $material;
}
}
if ((count($ifb->flow_mat) > 0))
{
foreach ($ifb->flow_mat as $fmat)
{
if (count($fmat->material))
{
foreach ($fmat->material as $material)
{
$feedbacksgeneric[1] = $material;
}
}
}
}
}
else if (strcmp($ifb->getIdent(), "response_onenotcorrect") == 0)
{
// found a feedback for the identifier
if (count($ifb->material))
{
foreach ($ifb->material as $material)
{
$feedbacksgeneric[0] = $material;
}
}
if ((count($ifb->flow_mat) > 0))
{
foreach ($ifb->flow_mat as $fmat)
{
if (count($fmat->material))
{
foreach ($fmat->material as $material)
{
$feedbacksgeneric[0] = $material;
}
}
}
}
}
}
}
}
}
}
// handle the import of media objects in XHTML code
foreach ($feedbacksgeneric as $correctness => $material)
{
$m = $this->object->QTIMaterialToString($material);
$feedbacksgeneric[$correctness] = $m;
}
return $feedbacksgeneric;
}

+ Here is the caller graph for this function:

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

{
include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
return ilObjQuestionPool::_getImportDirectory() . '/' . $_SESSION["qpl_import_subdir"];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

{
include_once "./Modules/Test/classes/class.ilObjTest.php";
return ilObjTest::_getImportDirectory() . '/' . $_SESSION["tst_import_subdir"];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

assQuestionImport::$object

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


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