ILIAS  Release_3_10_x_branch Revision 61812
 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

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 34 of file class.assQuestionImport.php.

Member Function Documentation

assQuestionImport::assQuestionImport ( $a_object)

assQuestionImport constructor

Parameters
object$a_objectThe question object public

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

{
$this->object =& $a_object;
}
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 assClozeTestImport, assImagemapQuestionImport, assJavaAppletImport, assMatchingQuestionImport, assNumericImport, assOrderingQuestionImport, assSingleChoiceImport, assTextQuestionImport, assTextSubsetImport, and assFlashQuestionImport.

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

{
}
assQuestionImport::getFeedbackGeneric (   $item)

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

Referenced by 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:

Field Documentation

assQuestionImport::$object

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


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