Code Duplication    Length = 13-14 lines in 2 locations

main/newscorm/learnpath.class.php 2 locations

@@ 5020-5032 (lines=13) @@
5017
                error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' is object', 0);
5018
            }
5019
            switch ($this->get_type()) {
5020
                case '3' :
5021
                    if ($this->items[$this->last]->get_type() != 'au') {
5022
                        if ($this->debug > 2) {
5023
                            error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' in lp_type 3 is <> au', 0);
5024
                        }
5025
                        $this->items[$this->last]->close();
5026
                        //$this->autocomplete_parents($this->last);
5027
                        //$this->update_queue[$this->last] = $this->items[$this->last]->get_status();
5028
                    } else {
5029
                        if ($this->debug > 2) {
5030
                            error_log('New LP - In learnpath::stop_previous_item() - Item is an AU, saving is managed by AICC signals', 0);
5031
                        }
5032
                    }
5033
                case '2' :
5034
                    if ($this->items[$this->last]->get_type() != 'sco') {
5035
                        if ($this->debug > 2) {
@@ 5033-5046 (lines=14) @@
5030
                            error_log('New LP - In learnpath::stop_previous_item() - Item is an AU, saving is managed by AICC signals', 0);
5031
                        }
5032
                    }
5033
                case '2' :
5034
                    if ($this->items[$this->last]->get_type() != 'sco') {
5035
                        if ($this->debug > 2) {
5036
                            error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' in lp_type 2 is <> sco', 0);
5037
                        }
5038
                        $this->items[$this->last]->close();
5039
                        //$this->autocomplete_parents($this->last);
5040
                        //$this->update_queue[$this->last] = $this->items[$this->last]->get_status();
5041
                    } else {
5042
                        if ($this->debug > 2) {
5043
                            error_log('New LP - In learnpath::stop_previous_item() - Item is a SCO, saving is managed by SCO signals', 0);
5044
                        }
5045
                    }
5046
                    break;
5047
                case '1' :
5048
                default :
5049
                    if ($this->debug > 2) {