Code Duplication    Length = 25-25 lines in 2 locations

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

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