Code Duplication    Length = 17-18 lines in 8 locations

main/newscorm/learnpath.class.php 8 locations

@@ 6467-6484 (lines=18) @@
6464
6465
        $result = Database::query($sql);
6466
        $arrLP = array ();
6467
        while ($row = Database :: fetch_array($result)) {
6468
            $arrLP[] = array (
6469
                'id' => $row['id'],
6470
                'item_type' => $row['item_type'],
6471
                'title' => $row['title'],
6472
                'path' => $row['path'],
6473
                'description' => $row['description'],
6474
                'parent_item_id' => $row['parent_item_id'],
6475
                'previous_item_id' => $row['previous_item_id'],
6476
                'next_item_id' => $row['next_item_id'],
6477
                'display_order' => $row['display_order'],
6478
                'max_score' => $row['max_score'],
6479
                'min_score' => $row['min_score'],
6480
                'mastery_score' => $row['mastery_score'],
6481
                'prerequisite' => $row['prerequisite'],
6482
                'max_time_allowed' => $row['max_time_allowed']
6483
            );
6484
        }
6485
6486
        $this->tree_array($arrLP);
6487
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 6708-6725 (lines=18) @@
6705
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
6706
        $result = Database::query($sql);
6707
        $arrLP = array ();
6708
        while ($row = Database :: fetch_array($result)) {
6709
            $arrLP[] = array (
6710
                'id' => $row['id'],
6711
                'item_type' => $row['item_type'],
6712
                'title' => $row['title'],
6713
                'path' => $row['path'],
6714
                'description' => $row['description'],
6715
                'parent_item_id' => $row['parent_item_id'],
6716
                'previous_item_id' => $row['previous_item_id'],
6717
                'next_item_id' => $row['next_item_id'],
6718
                'display_order' => $row['display_order'],
6719
                'max_score' => $row['max_score'],
6720
                'min_score' => $row['min_score'],
6721
                'mastery_score' => $row['mastery_score'],
6722
                'prerequisite' => $row['prerequisite'],
6723
                'max_time_allowed' => $row['max_time_allowed']
6724
            );
6725
        }
6726
6727
        $legend = '<legend>';
6728
        if ($action == 'add')
@@ 6886-6902 (lines=17) @@
6883
        $result = Database::query($sql);
6884
        $arrLP = array();
6885
6886
        while ($row = Database :: fetch_array($result)) {
6887
            $arrLP[] = array (
6888
                'id' => $row['id'],
6889
                'item_type' => $row['item_type'],
6890
                'title' => $row['title'],
6891
                'path' => $row['path'],
6892
                'description' => $row['description'],
6893
                'parent_item_id' => $row['parent_item_id'],
6894
                'previous_item_id' => $row['previous_item_id'],
6895
                'next_item_id' => $row['next_item_id'],
6896
                'display_order' => $row['display_order'],
6897
                'max_score' => $row['max_score'],
6898
                'min_score' => $row['min_score'],
6899
                'mastery_score' => $row['mastery_score'],
6900
                'prerequisite' => $row['prerequisite']
6901
            );
6902
        }
6903
6904
        $this->tree_array($arrLP);
6905
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 7077-7093 (lines=17) @@
7074
7075
        $arrLP = array ();
7076
7077
        while ($row = Database :: fetch_array($result)) {
7078
            $arrLP[] = array (
7079
                'id' => $row['id'],
7080
                'item_type' => $row['item_type'],
7081
                'title' => $row['title'],
7082
                'path' => $row['path'],
7083
                'description' => $row['description'],
7084
                'parent_item_id' => $row['parent_item_id'],
7085
                'previous_item_id' => $row['previous_item_id'],
7086
                'next_item_id' => $row['next_item_id'],
7087
                'display_order' => $row['display_order'],
7088
                'max_score' => $row['max_score'],
7089
                'min_score' => $row['min_score'],
7090
                'mastery_score' => $row['mastery_score'],
7091
                'prerequisite' => $row['prerequisite']
7092
            );
7093
        }
7094
7095
        $this->tree_array($arrLP);
7096
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 7276-7292 (lines=17) @@
7273
        $result = Database::query($sql);
7274
        $arrLP = array ();
7275
7276
        while ($row = Database :: fetch_array($result)) {
7277
            $arrLP[] = array(
7278
                'id' => $row['id'],
7279
                'item_type' => $row['item_type'],
7280
                'title' => $row['title'],
7281
                'path' => $row['path'],
7282
                'description' => $row['description'],
7283
                'parent_item_id' => $row['parent_item_id'],
7284
                'previous_item_id' => $row['previous_item_id'],
7285
                'next_item_id' => $row['next_item_id'],
7286
                'max_score' => $row['max_score'],
7287
                'min_score' => $row['min_score'],
7288
                'mastery_score' => $row['mastery_score'],
7289
                'prerequisite' => $row['prerequisite'],
7290
                'display_order' => $row['display_order']
7291
            );
7292
        }
7293
7294
        $this->tree_array($arrLP);
7295
@@ 7520-7536 (lines=17) @@
7517
7518
        $result = Database::query($sql);
7519
        $arrLP = array ();
7520
        while ($row = Database :: fetch_array($result)) {
7521
            $arrLP[] = array(
7522
                'id' => $row['id'],
7523
                'item_type' => $row['item_type'],
7524
                'title' => $row['title'],
7525
                'path' => $row['path'],
7526
                'description' => $row['description'],
7527
                'parent_item_id' => $row['parent_item_id'],
7528
                'previous_item_id' => $row['previous_item_id'],
7529
                'next_item_id' => $row['next_item_id'],
7530
                'display_order' => $row['display_order'],
7531
                'max_score' => $row['max_score'],
7532
                'min_score' => $row['min_score'],
7533
                'mastery_score' => $row['mastery_score'],
7534
                'prerequisite' => $row['prerequisite']
7535
            );
7536
        }
7537
7538
        $this->tree_array($arrLP);
7539
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 7811-7827 (lines=17) @@
7808
        $result = Database::query($sql);
7809
        $arrLP = array();
7810
7811
        while ($row = Database :: fetch_array($result)) {
7812
            $arrLP[] = array(
7813
                'id' => $row['id'],
7814
                'item_type' => $row['item_type'],
7815
                'title' => $row['title'],
7816
                'path' => $row['path'],
7817
                'description' => $row['description'],
7818
                'parent_item_id' => $row['parent_item_id'],
7819
                'previous_item_id' => $row['previous_item_id'],
7820
                'next_item_id' => $row['next_item_id'],
7821
                'display_order' => $row['display_order'],
7822
                'max_score' => $row['max_score'],
7823
                'min_score' => $row['min_score'],
7824
                'mastery_score' => $row['mastery_score'],
7825
                'prerequisite' => $row['prerequisite']
7826
            );
7827
        }
7828
7829
        $this->tree_array($arrLP);
7830
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
@@ 8002-8018 (lines=17) @@
7999
8000
        $result = Database::query($sql);
8001
        $arrLP = array();
8002
        while ($row = Database :: fetch_array($result)) {
8003
            $arrLP[] = array (
8004
                'id' => $row['id'],
8005
                'item_type' => $row['item_type'],
8006
                'title' => $row['title'],
8007
                'path' => $row['path'],
8008
                'description' => $row['description'],
8009
                'parent_item_id' => $row['parent_item_id'],
8010
                'previous_item_id' => $row['previous_item_id'],
8011
                'next_item_id' => $row['next_item_id'],
8012
                'display_order' => $row['display_order'],
8013
                'max_score' => $row['max_score'],
8014
                'min_score' => $row['min_score'],
8015
                'mastery_score' => $row['mastery_score'],
8016
                'prerequisite' => $row['prerequisite']
8017
            );
8018
        }
8019
8020
        $this->tree_array($arrLP);
8021
        $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;