Code Duplication    Length = 17-18 lines in 8 locations

main/newscorm/learnpath.class.php 8 locations

@@ 6497-6514 (lines=18) @@
6494
6495
        $result = Database::query($sql);
6496
        $arrLP = array ();
6497
        while ($row = Database :: fetch_array($result)) {
6498
            $arrLP[] = array (
6499
                'id' => $row['id'],
6500
                'item_type' => $row['item_type'],
6501
                'title' => $row['title'],
6502
                'path' => $row['path'],
6503
                'description' => $row['description'],
6504
                'parent_item_id' => $row['parent_item_id'],
6505
                'previous_item_id' => $row['previous_item_id'],
6506
                'next_item_id' => $row['next_item_id'],
6507
                'display_order' => $row['display_order'],
6508
                'max_score' => $row['max_score'],
6509
                'min_score' => $row['min_score'],
6510
                'mastery_score' => $row['mastery_score'],
6511
                'prerequisite' => $row['prerequisite'],
6512
                'max_time_allowed' => $row['max_time_allowed']
6513
            );
6514
        }
6515
6516
        $this->tree_array($arrLP);
6517
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 6743-6760 (lines=18) @@
6740
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
6741
        $result = Database::query($sql);
6742
        $arrLP = array ();
6743
        while ($row = Database :: fetch_array($result)) {
6744
            $arrLP[] = array (
6745
                'id' => $row['id'],
6746
                'item_type' => $row['item_type'],
6747
                'title' => $row['title'],
6748
                'path' => $row['path'],
6749
                'description' => $row['description'],
6750
                'parent_item_id' => $row['parent_item_id'],
6751
                'previous_item_id' => $row['previous_item_id'],
6752
                'next_item_id' => $row['next_item_id'],
6753
                'display_order' => $row['display_order'],
6754
                'max_score' => $row['max_score'],
6755
                'min_score' => $row['min_score'],
6756
                'mastery_score' => $row['mastery_score'],
6757
                'prerequisite' => $row['prerequisite'],
6758
                'max_time_allowed' => $row['max_time_allowed']
6759
            );
6760
        }
6761
6762
        $legend = '<legend>';
6763
        if ($action == 'add')
@@ 6919-6935 (lines=17) @@
6916
        $result = Database::query($sql);
6917
        $arrLP = array();
6918
6919
        while ($row = Database :: fetch_array($result)) {
6920
            $arrLP[] = array (
6921
                'id' => $row['id'],
6922
                'item_type' => $row['item_type'],
6923
                'title' => $row['title'],
6924
                'path' => $row['path'],
6925
                'description' => $row['description'],
6926
                'parent_item_id' => $row['parent_item_id'],
6927
                'previous_item_id' => $row['previous_item_id'],
6928
                'next_item_id' => $row['next_item_id'],
6929
                'display_order' => $row['display_order'],
6930
                'max_score' => $row['max_score'],
6931
                'min_score' => $row['min_score'],
6932
                'mastery_score' => $row['mastery_score'],
6933
                'prerequisite' => $row['prerequisite']
6934
            );
6935
        }
6936
6937
        $this->tree_array($arrLP);
6938
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 7119-7135 (lines=17) @@
7116
7117
        $arrLP = array ();
7118
7119
        while ($row = Database :: fetch_array($result)) {
7120
            $arrLP[] = array (
7121
                'id' => $row['id'],
7122
                'item_type' => $row['item_type'],
7123
                'title' => $row['title'],
7124
                'path' => $row['path'],
7125
                'description' => $row['description'],
7126
                'parent_item_id' => $row['parent_item_id'],
7127
                'previous_item_id' => $row['previous_item_id'],
7128
                'next_item_id' => $row['next_item_id'],
7129
                'display_order' => $row['display_order'],
7130
                'max_score' => $row['max_score'],
7131
                'min_score' => $row['min_score'],
7132
                'mastery_score' => $row['mastery_score'],
7133
                'prerequisite' => $row['prerequisite']
7134
            );
7135
        }
7136
7137
        $this->tree_array($arrLP);
7138
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 7344-7360 (lines=17) @@
7341
        $result = Database::query($sql);
7342
        $arrLP = array ();
7343
7344
        while ($row = Database :: fetch_array($result)) {
7345
            $arrLP[] = array(
7346
                'id' => $row['id'],
7347
                'item_type' => $row['item_type'],
7348
                'title' => $row['title'],
7349
                'path' => $row['path'],
7350
                'description' => $row['description'],
7351
                'parent_item_id' => $row['parent_item_id'],
7352
                'previous_item_id' => $row['previous_item_id'],
7353
                'next_item_id' => $row['next_item_id'],
7354
                'max_score' => $row['max_score'],
7355
                'min_score' => $row['min_score'],
7356
                'mastery_score' => $row['mastery_score'],
7357
                'prerequisite' => $row['prerequisite'],
7358
                'display_order' => $row['display_order']
7359
            );
7360
        }
7361
7362
        $this->tree_array($arrLP);
7363
@@ 7588-7604 (lines=17) @@
7585
7586
        $result = Database::query($sql);
7587
        $arrLP = array ();
7588
        while ($row = Database :: fetch_array($result)) {
7589
            $arrLP[] = array(
7590
                'id' => $row['id'],
7591
                'item_type' => $row['item_type'],
7592
                'title' => $row['title'],
7593
                'path' => $row['path'],
7594
                'description' => $row['description'],
7595
                'parent_item_id' => $row['parent_item_id'],
7596
                'previous_item_id' => $row['previous_item_id'],
7597
                'next_item_id' => $row['next_item_id'],
7598
                'display_order' => $row['display_order'],
7599
                'max_score' => $row['max_score'],
7600
                'min_score' => $row['min_score'],
7601
                'mastery_score' => $row['mastery_score'],
7602
                'prerequisite' => $row['prerequisite']
7603
            );
7604
        }
7605
7606
        $this->tree_array($arrLP);
7607
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 7881-7897 (lines=17) @@
7878
        $result = Database::query($sql);
7879
        $arrLP = array();
7880
7881
        while ($row = Database :: fetch_array($result)) {
7882
            $arrLP[] = array(
7883
                'id' => $row['id'],
7884
                'item_type' => $row['item_type'],
7885
                'title' => $row['title'],
7886
                'path' => $row['path'],
7887
                'description' => $row['description'],
7888
                'parent_item_id' => $row['parent_item_id'],
7889
                'previous_item_id' => $row['previous_item_id'],
7890
                'next_item_id' => $row['next_item_id'],
7891
                'display_order' => $row['display_order'],
7892
                'max_score' => $row['max_score'],
7893
                'min_score' => $row['min_score'],
7894
                'mastery_score' => $row['mastery_score'],
7895
                'prerequisite' => $row['prerequisite']
7896
            );
7897
        }
7898
7899
        $this->tree_array($arrLP);
7900
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 8090-8106 (lines=17) @@
8087
8088
        $result = Database::query($sql);
8089
        $arrLP = array();
8090
        while ($row = Database :: fetch_array($result)) {
8091
            $arrLP[] = array (
8092
                'id' => $row['id'],
8093
                'item_type' => $row['item_type'],
8094
                'title' => $row['title'],
8095
                'path' => $row['path'],
8096
                'description' => $row['description'],
8097
                'parent_item_id' => $row['parent_item_id'],
8098
                'previous_item_id' => $row['previous_item_id'],
8099
                'next_item_id' => $row['next_item_id'],
8100
                'display_order' => $row['display_order'],
8101
                'max_score' => $row['max_score'],
8102
                'min_score' => $row['min_score'],
8103
                'mastery_score' => $row['mastery_score'],
8104
                'prerequisite' => $row['prerequisite']
8105
            );
8106
        }
8107
8108
        $this->tree_array($arrLP);
8109
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;