Code Duplication    Length = 25-25 lines in 2 locations

main/exercice/export/exercise_import.inc.php 2 locations

@@ 352-376 (lines=25) @@
349
        $grant_parent_element = "";
350
    }
351
352
    if ($record_item_body) {
353
354
        if ((!in_array($current_element, $non_HTML_tag_to_avoid))) {
355
            $current_question_item_body .= "<" . $name;
356
            foreach ($attributes as $attribute_name => $attribute_value) {
357
                $current_question_item_body .= " " . $attribute_name . "=\"" . $attribute_value . "\"";
358
            }
359
            $current_question_item_body .= ">";
360
        } else {
361
            //in case of FIB question, we replace the IMS-QTI tag b y the correct answer between "[" "]",
362
            //we first save with claroline tags ,then when the answer will be parsed, the claroline tags will be replaced
363
364
            if ($current_element == 'INLINECHOICEINTERACTION') {
365
                $current_question_item_body .= "**claroline_start**" . $attributes['RESPONSEIDENTIFIER'] . "**claroline_end**";
366
            }
367
            if ($current_element == 'TEXTENTRYINTERACTION') {
368
                $correct_answer_value = $exercise_info['question'][$current_question_ident]['correct_answers'][$current_answer_id];
369
                $current_question_item_body .= "[" . $correct_answer_value . "]";
370
371
            }
372
            if ($current_element == 'BR') {
373
                $current_question_item_body .= "<br />";
374
            }
375
        }
376
    }
377
378
    switch ($current_element) {
379
        case 'ASSESSMENTITEM':
@@ 630-654 (lines=25) @@
627
    }
628
629
630
    if ($record_item_body) {
631
632
        if ((!in_array($current_element, $non_HTML_tag_to_avoid))) {
633
            $current_question_item_body .= "<" . $name;
634
            foreach ($attributes as $attribute_name => $attribute_value) {
635
                $current_question_item_body .= " " . $attribute_name . "=\"" . $attribute_value . "\"";
636
            }
637
            $current_question_item_body .= ">";
638
        } else {
639
            //in case of FIB question, we replace the IMS-QTI tag b y the correct answer between "[" "]",
640
            //we first save with claroline tags ,then when the answer will be parsed, the claroline tags will be replaced
641
642
            if ($current_element == 'INLINECHOICEINTERACTION') {
643
                $current_question_item_body .= "**claroline_start**" . $attributes['RESPONSEIDENTIFIER'] . "**claroline_end**";
644
            }
645
            if ($current_element == 'TEXTENTRYINTERACTION') {
646
                $correct_answer_value = $exercise_info['question'][$current_question_ident]['correct_answers'][$current_answer_id];
647
                $current_question_item_body .= "[" . $correct_answer_value . "]";
648
649
            }
650
            if ($current_element == 'BR') {
651
                $current_question_item_body .= "<br />";
652
            }
653
        }
654
    }
655
656
    switch ($current_element) {
657
        case 'ASSESSMENT':