Code Duplication    Length = 12-12 lines in 2 locations

src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php 2 locations

@@ 756-767 (lines=12) @@
753
                            WHERE c_id = $courseId AND question_id = ".$obj->id;
754
                    $db_result2 = Database::query($sql);
755
                    if (Database::num_rows($db_result2)) {
756
                        while ($obj2 = Database::fetch_object($db_result2)) {
757
                            $question->add_answer(
758
                                $obj2->id,
759
                                $obj2->answer,
760
                                $obj2->correct,
761
                                $obj2->comment,
762
                                $obj2->ponderation,
763
                                $obj2->position,
764
                                $obj2->hotspot_coordinates,
765
                                $obj2->hotspot_type
766
                            );
767
                        }
768
                        $orphanQuestionIds[] = $obj->id;
769
                    }
770
                    $this->course->add_resource($question);
@@ 846-857 (lines=12) @@
843
                );
844
                $sql = 'SELECT * FROM '.$table_ans.' WHERE question_id = '.$obj->id;
845
                $db_result2 = Database::query($sql);
846
                while ($obj2 = Database::fetch_object($db_result2)) {
847
                    $question->add_answer(
848
                        $obj2->id,
849
                        $obj2->answer,
850
                        $obj2->correct,
851
                        $obj2->comment,
852
                        $obj2->ponderation,
853
                        $obj2->position,
854
                        $obj2->hotspot_coordinates,
855
                        $obj2->hotspot_type
856
                    );
857
                }
858
                $this->course->add_resource($question);
859
            }
860
        }