4 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
34 $this->
object = $a_object;
39 $feedbacksgeneric =
array();
40 foreach ($item->resprocessing as $resprocessing) {
41 foreach ($resprocessing->respcondition as $respcondition) {
42 foreach ($respcondition->displayfeedback as $feedbackpointer) {
43 if (strlen($feedbackpointer->getLinkrefid())) {
44 foreach ($item->itemfeedback as $ifb) {
45 if (strcmp($ifb->getIdent(),
"response_allcorrect") == 0) {
47 if (count($ifb->material)) {
48 foreach ($ifb->material as $material) {
49 $feedbacksgeneric[1] = $material;
52 if ((count($ifb->flow_mat) > 0)) {
53 foreach ($ifb->flow_mat as $fmat) {
54 if (count($fmat->material)) {
55 foreach ($fmat->material as $material) {
56 $feedbacksgeneric[1] = $material;
61 } elseif (strcmp($ifb->getIdent(),
"response_onenotcorrect") == 0) {
63 if (count($ifb->material)) {
64 foreach ($ifb->material as $material) {
65 $feedbacksgeneric[0] = $material;
68 if ((count($ifb->flow_mat) > 0)) {
69 foreach ($ifb->flow_mat as $fmat) {
70 if (count($fmat->material)) {
71 foreach ($fmat->material as $material) {
72 $feedbacksgeneric[0] = $material;
84 foreach ($feedbacksgeneric as $correctness => $material) {
85 $m = $this->
object->QTIMaterialToString($material);
86 $feedbacksgeneric[$correctness] =
$m;
88 return $feedbacksgeneric;
98 return (
int) str_replace($prefix,
'', $feedbackIdent);
108 $feedbacks =
array();
110 foreach ($item->itemfeedback as $ifb) {
111 if ($ifb->getIdent() ==
'response_allcorrect' || $ifb->getIdent() ==
'response_onenotcorrect') {
115 if ($ifb->getIdent() == $prefix .
'allcorrect' || $ifb->getIdent() == $prefix .
'onenotcorrect') {
119 if (substr($ifb->getIdent(), 0, strlen($prefix)) != $prefix) {
123 $ident = $ifb->getIdent();
127 if (count($ifb->material)) {
128 foreach ($ifb->material as $material) {
129 $feedbacks[$ident] = $material;
133 if ((count($ifb->flow_mat) > 0)) {
134 foreach ($ifb->flow_mat as $fmat) {
135 if (count($fmat->material)) {
136 foreach ($fmat->material as $material) {
137 $feedbacks[$ident] = $material;
144 foreach ($feedbacks as $ident => $material) {
145 $m = $this->
object->QTIMaterialToString($material);
146 $feedbacks[$ident] =
$m;
165 public function fromXML(&$item, $questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping)
186 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
195 include_once
"./Modules/Test/classes/class.ilObjTest.php";
201 $reg =
'/<img.*src=".*\\/mm_(\\d+)\\/(.*?)".*>/m';
204 if (preg_match_all($reg,
$text, $matches)) {
205 for (
$i = 0, $max = count($matches[1]);
$i < $max;
$i++) {
206 $mobSrcId = $matches[1][
$i];
207 $mobSrcName = $matches[2][
$i];
208 $mobSrcLabel =
'il_' . $sourceNic .
'_mob_' . $mobSrcId;
210 if (!is_array(
$_SESSION[
"import_mob_xhtml"])) {
215 "mob" => $mobSrcLabel,
"uri" =>
'objects/' . $mobSrcLabel .
'/' . $mobSrcName
220 include_once
"./Services/RTE/classes/class.ilRTE.php";
235 $additionalContentEditingMode = $qtiItem->getMetadataEntry(
'additional_cont_edit_mode');
237 if (!$this->
object->isValidAdditionalContentEditingMode($additionalContentEditingMode)) {
241 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.