Code Duplication    Length = 25-25 lines in 2 locations

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

@@ 361-385 (lines=25) @@
358
        $grant_parent_element = "";
359
    }
360
361
    if ($record_item_body) {
362
363
        if ((!in_array($current_element, $non_HTML_tag_to_avoid))) {
364
            $current_question_item_body .= "<" . $name;
365
            foreach ($attributes as $attribute_name => $attribute_value) {
366
                $current_question_item_body .= " " . $attribute_name . "=\"" . $attribute_value . "\"";
367
            }
368
            $current_question_item_body .= ">";
369
        } else {
370
            //in case of FIB question, we replace the IMS-QTI tag b y the correct answer between "[" "]",
371
            //we first save with claroline tags ,then when the answer will be parsed, the claroline tags will be replaced
372
373
            if ($current_element == 'INLINECHOICEINTERACTION') {
374
                $current_question_item_body .= "**claroline_start**" . $attributes['RESPONSEIDENTIFIER'] . "**claroline_end**";
375
            }
376
            if ($current_element == 'TEXTENTRYINTERACTION') {
377
                $correct_answer_value = $exercise_info['question'][$current_question_ident]['correct_answers'][$current_answer_id];
378
                $current_question_item_body .= "[" . $correct_answer_value . "]";
379
380
            }
381
            if ($current_element == 'BR') {
382
                $current_question_item_body .= "<br />";
383
            }
384
        }
385
    }
386
387
    switch ($current_element) {
388
        case 'ASSESSMENTITEM':
@@ 647-671 (lines=25) @@
644
    }
645
646
647
    if ($record_item_body) {
648
649
        if ((!in_array($current_element, $non_HTML_tag_to_avoid))) {
650
            $current_question_item_body .= "<" . $name;
651
            foreach ($attributes as $attribute_name => $attribute_value) {
652
                $current_question_item_body .= " " . $attribute_name . "=\"" . $attribute_value . "\"";
653
            }
654
            $current_question_item_body .= ">";
655
        } else {
656
            //in case of FIB question, we replace the IMS-QTI tag b y the correct answer between "[" "]",
657
            //we first save with claroline tags ,then when the answer will be parsed, the claroline tags will be replaced
658
659
            if ($current_element == 'INLINECHOICEINTERACTION') {
660
                $current_question_item_body .= "**claroline_start**" . $attributes['RESPONSEIDENTIFIER'] . "**claroline_end**";
661
            }
662
            if ($current_element == 'TEXTENTRYINTERACTION') {
663
                $correct_answer_value = $exercise_info['question'][$current_question_ident]['correct_answers'][$current_answer_id];
664
                $current_question_item_body .= "[" . $correct_answer_value . "]";
665
666
            }
667
            if ($current_element == 'BR') {
668
                $current_question_item_body .= "<br />";
669
            }
670
        }
671
    }
672
673
    switch ($current_element) {
674
        case 'ASSESSMENT':