Code Duplication    Length = 17-18 lines in 8 locations

main/lp/learnpath.class.php 8 locations

@@ 6921-6938 (lines=18) @@
6918
6919
        $result = Database::query($sql);
6920
        $arrLP = array();
6921
        while ($row = Database::fetch_array($result)) {
6922
            $arrLP[] = array(
6923
                'id' => $row['id'],
6924
                'item_type' => $row['item_type'],
6925
                'title' => $row['title'],
6926
                'path' => $row['path'],
6927
                'description' => $row['description'],
6928
                'parent_item_id' => $row['parent_item_id'],
6929
                'previous_item_id' => $row['previous_item_id'],
6930
                'next_item_id' => $row['next_item_id'],
6931
                'display_order' => $row['display_order'],
6932
                'max_score' => $row['max_score'],
6933
                'min_score' => $row['min_score'],
6934
                'mastery_score' => $row['mastery_score'],
6935
                'prerequisite' => $row['prerequisite'],
6936
                'max_time_allowed' => $row['max_time_allowed']
6937
            );
6938
        }
6939
6940
        $this->tree_array($arrLP);
6941
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 7134-7151 (lines=18) @@
7131
                WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id;
7132
        $result = Database::query($sql);
7133
        $arrLP = array();
7134
        while ($row = Database::fetch_array($result)) {
7135
            $arrLP[] = array(
7136
                'id' => $row['id'],
7137
                'item_type' => $row['item_type'],
7138
                'title' => $row['title'],
7139
                'path' => $row['path'],
7140
                'description' => $row['description'],
7141
                'parent_item_id' => $row['parent_item_id'],
7142
                'previous_item_id' => $row['previous_item_id'],
7143
                'next_item_id' => $row['next_item_id'],
7144
                'display_order' => $row['display_order'],
7145
                'max_score' => $row['max_score'],
7146
                'min_score' => $row['min_score'],
7147
                'mastery_score' => $row['mastery_score'],
7148
                'prerequisite' => $row['prerequisite'],
7149
                'max_time_allowed' => $row['max_time_allowed']
7150
            );
7151
        }
7152
7153
        $legend = '<legend>';
7154
        if ($action == 'add') {
@@ 7311-7327 (lines=17) @@
7308
                    lp_id = " . $this->lp_id;
7309
        $result = Database::query($sql);
7310
        $arrLP = array();
7311
        while ($row = Database::fetch_array($result)) {
7312
            $arrLP[] = array(
7313
                'id' => $row['id'],
7314
                'item_type' => $row['item_type'],
7315
                'title' => $row['title'],
7316
                'path' => $row['path'],
7317
                'description' => $row['description'],
7318
                'parent_item_id' => $row['parent_item_id'],
7319
                'previous_item_id' => $row['previous_item_id'],
7320
                'next_item_id' => $row['next_item_id'],
7321
                'display_order' => $row['display_order'],
7322
                'max_score' => $row['max_score'],
7323
                'min_score' => $row['min_score'],
7324
                'mastery_score' => $row['mastery_score'],
7325
                'prerequisite' => $row['prerequisite']
7326
            );
7327
        }
7328
7329
        $this->tree_array($arrLP);
7330
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 7518-7534 (lines=17) @@
7515
        $result = Database::query($sql);
7516
7517
        $arrLP = array();
7518
        while ($row = Database::fetch_array($result)) {
7519
            $arrLP[] = array(
7520
                'id' => $row['id'],
7521
                'item_type' => $row['item_type'],
7522
                'title' => $row['title'],
7523
                'path' => $row['path'],
7524
                'description' => $row['description'],
7525
                'parent_item_id' => $row['parent_item_id'],
7526
                'previous_item_id' => $row['previous_item_id'],
7527
                'next_item_id' => $row['next_item_id'],
7528
                'display_order' => $row['display_order'],
7529
                'max_score' => $row['max_score'],
7530
                'min_score' => $row['min_score'],
7531
                'mastery_score' => $row['mastery_score'],
7532
                'prerequisite' => $row['prerequisite']
7533
            );
7534
        }
7535
7536
        $this->tree_array($arrLP);
7537
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 7740-7756 (lines=17) @@
7737
        $result = Database::query($sql);
7738
        $arrLP = [];
7739
7740
        while ($row = Database::fetch_array($result)) {
7741
            $arrLP[] = array(
7742
                'id' => $row['id'],
7743
                'item_type' => $row['item_type'],
7744
                'title' => $row['title'],
7745
                'path' => $row['path'],
7746
                'description' => $row['description'],
7747
                'parent_item_id' => $row['parent_item_id'],
7748
                'previous_item_id' => $row['previous_item_id'],
7749
                'next_item_id' => $row['next_item_id'],
7750
                'max_score' => $row['max_score'],
7751
                'min_score' => $row['min_score'],
7752
                'mastery_score' => $row['mastery_score'],
7753
                'prerequisite' => $row['prerequisite'],
7754
                'display_order' => $row['display_order']
7755
            );
7756
        }
7757
7758
        $this->tree_array($arrLP);
7759
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 8004-8020 (lines=17) @@
8001
8002
        $result = Database::query($sql);
8003
        $arrLP = array();
8004
        while ($row = Database::fetch_array($result)) {
8005
            $arrLP[] = array(
8006
                'id' => $row['id'],
8007
                'item_type' => $row['item_type'],
8008
                'title' => $row['title'],
8009
                'path' => $row['path'],
8010
                'description' => $row['description'],
8011
                'parent_item_id' => $row['parent_item_id'],
8012
                'previous_item_id' => $row['previous_item_id'],
8013
                'next_item_id' => $row['next_item_id'],
8014
                'display_order' => $row['display_order'],
8015
                'max_score' => $row['max_score'],
8016
                'min_score' => $row['min_score'],
8017
                'mastery_score' => $row['mastery_score'],
8018
                'prerequisite' => $row['prerequisite']
8019
            );
8020
        }
8021
8022
        $this->tree_array($arrLP);
8023
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 8371-8387 (lines=17) @@
8368
        $result = Database::query($sql);
8369
        $arrLP = array();
8370
8371
        while ($row = Database::fetch_array($result)) {
8372
            $arrLP[] = array(
8373
                'id' => $row['id'],
8374
                'item_type' => $row['item_type'],
8375
                'title' => $row['title'],
8376
                'path' => $row['path'],
8377
                'description' => $row['description'],
8378
                'parent_item_id' => $row['parent_item_id'],
8379
                'previous_item_id' => $row['previous_item_id'],
8380
                'next_item_id' => $row['next_item_id'],
8381
                'display_order' => $row['display_order'],
8382
                'max_score' => $row['max_score'],
8383
                'min_score' => $row['min_score'],
8384
                'mastery_score' => $row['mastery_score'],
8385
                'prerequisite' => $row['prerequisite']
8386
            );
8387
        }
8388
8389
        $this->tree_array($arrLP);
8390
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 8576-8592 (lines=17) @@
8573
8574
        $result = Database::query($sql);
8575
        $arrLP = array();
8576
        while ($row = Database::fetch_array($result)) {
8577
            $arrLP[] = array(
8578
                'id' => $row['id'],
8579
                'item_type' => $row['item_type'],
8580
                'title' => $row['title'],
8581
                'path' => $row['path'],
8582
                'description' => $row['description'],
8583
                'parent_item_id' => $row['parent_item_id'],
8584
                'previous_item_id' => $row['previous_item_id'],
8585
                'next_item_id' => $row['next_item_id'],
8586
                'display_order' => $row['display_order'],
8587
                'max_score' => $row['max_score'],
8588
                'min_score' => $row['min_score'],
8589
                'mastery_score' => $row['mastery_score'],
8590
                'prerequisite' => $row['prerequisite']
8591
            );
8592
        }
8593
8594
        $this->tree_array($arrLP);
8595
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;