4 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
34 $this->
object = $a_object;
39 $feedbacksgeneric =
array();
40 foreach ($item->resprocessing as $resprocessing)
42 foreach ($resprocessing->respcondition as $respcondition)
44 foreach ($respcondition->displayfeedback as $feedbackpointer)
46 if (strlen($feedbackpointer->getLinkrefid()))
48 foreach ($item->itemfeedback as $ifb)
50 if (strcmp($ifb->getIdent(),
"response_allcorrect") == 0)
53 if (count($ifb->material))
55 foreach ($ifb->material as $material)
57 $feedbacksgeneric[1] = $material;
60 if ((count($ifb->flow_mat) > 0))
62 foreach ($ifb->flow_mat as $fmat)
64 if (count($fmat->material))
66 foreach ($fmat->material as $material)
68 $feedbacksgeneric[1] = $material;
74 else if (strcmp($ifb->getIdent(),
"response_onenotcorrect") == 0)
77 if (count($ifb->material))
79 foreach ($ifb->material as $material)
81 $feedbacksgeneric[0] = $material;
84 if ((count($ifb->flow_mat) > 0))
86 foreach ($ifb->flow_mat as $fmat)
88 if (count($fmat->material))
90 foreach ($fmat->material as $material)
92 $feedbacksgeneric[0] = $material;
104 foreach ($feedbacksgeneric as $correctness => $material)
106 $m = $this->
object->QTIMaterialToString($material);
107 $feedbacksgeneric[$correctness] = $m;
109 return $feedbacksgeneric;
119 return (
int)str_replace($prefix,
'', $feedbackIdent);
129 $feedbacks =
array();
131 foreach ($item->itemfeedback as $ifb)
133 if( $ifb->getIdent() ==
'response_allcorrect' || $ifb->getIdent() ==
'response_onenotcorrect' )
138 if( $ifb->getIdent() == $prefix.
'allcorrect' || $ifb->getIdent() == $prefix.
'onenotcorrect' )
143 if( substr($ifb->getIdent(), 0, strlen($prefix)) != $prefix )
148 $ident = $ifb->getIdent();
152 if (count($ifb->material))
154 foreach ($ifb->material as $material)
156 $feedbacks[$ident] = $material;
160 if ((count($ifb->flow_mat) > 0))
162 foreach ($ifb->flow_mat as $fmat)
164 if (count($fmat->material))
166 foreach ($fmat->material as $material)
168 $feedbacks[$ident] = $material;
175 foreach($feedbacks as $ident => $material)
177 $m = $this->
object->QTIMaterialToString($material);
178 $feedbacks[$ident] = $m;
197 function fromXML(&$item, $questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping)
214 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
223 include_once
"./Modules/Test/classes/class.ilObjTest.php";
229 $reg =
'/<img.*src=".*\\/mm_(\\d+)\\/(.*?)".*>/m';
232 if( preg_match_all($reg,
$text, $matches) )
234 for($i = 0, $max = count($matches[1]); $i < $max; $i++)
236 $mobSrcId = $matches[1][$i];
237 $mobSrcName = $matches[2][$i];
238 $mobSrcLabel =
'il_'.$sourceNic.
'_mob_'.$mobSrcId;
240 if (!is_array(
$_SESSION[
"import_mob_xhtml"]))
246 "mob" => $mobSrcLabel,
"uri" =>
'objects/'.$mobSrcLabel.
'/'.$mobSrcName
251 include_once
"./Services/RTE/classes/class.ilRTE.php";
266 $additionalContentEditingMode = $qtiItem->getMetadataEntry(
'additional_cont_edit_mode');
268 if( !$this->
object->isValidAdditionalContentEditingMode($additionalContentEditingMode) )
273 return $additionalContentEditingMode;
getFeedbackAnswerSpecific(ilQTIItem $item, $prefix='response_')
addGeneralMetadata(ilQTIItem $item)
processNonAbstractedImageReferences($text, $sourceNic)
fetchAdditionalContentEditingModeInformation($qtiItem)
fetches the "additional content editing mode" information from qti item and falls back to ADDITIONAL_...
getQplImportArchivDirectory()
returns the full path to extracted qpl import archiv (qpl import dir + qpl archiv subdir) ...
getMetadataEntry($a_label)
fromXML(&$item, $questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping)
Creates a question from a QTI file.
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
getFeedbackGeneric($item)
Create styles array
The data for the language used.
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
Create new PHPExcel object
obj_idprivate
getTstImportArchivDirectory()
returns the full path to extracted tst import archiv (tst import dir + tst archiv subdir) ...
static _getImportDirectory()
get import directory of lm
__construct($a_object)
assQuestionImport constructor
Class for question imports.
fetchIndexFromFeedbackIdent($feedbackIdent, $prefix='response_')
static _getImportDirectory()
Get the import directory location of the test.