Code Duplication    Length = 14-14 lines in 2 locations

main/lp/learnpath.class.php 2 locations

@@ 5191-5204 (lines=14) @@
5188
                error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' is object', 0);
5189
            }
5190
            switch ($this->get_type()) {
5191
                case '3':
5192
                    if ($this->items[$this->last]->get_type() != 'au') {
5193
                        if ($this->debug > 2) {
5194
                            error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' in lp_type 3 is <> au', 0);
5195
                        }
5196
                        $this->items[$this->last]->close();
5197
                        //$this->autocomplete_parents($this->last);
5198
                        //$this->update_queue[$this->last] = $this->items[$this->last]->get_status();
5199
                    } else {
5200
                        if ($this->debug > 2) {
5201
                            error_log('New LP - In learnpath::stop_previous_item() - Item is an AU, saving is managed by AICC signals', 0);
5202
                        }
5203
                    }
5204
                    break;
5205
                case '2':
5206
                    if ($this->items[$this->last]->get_type() != 'sco') {
5207
                        if ($this->debug > 2) {
@@ 5205-5218 (lines=14) @@
5202
                        }
5203
                    }
5204
                    break;
5205
                case '2':
5206
                    if ($this->items[$this->last]->get_type() != 'sco') {
5207
                        if ($this->debug > 2) {
5208
                            error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' in lp_type 2 is <> sco', 0);
5209
                        }
5210
                        $this->items[$this->last]->close();
5211
                        //$this->autocomplete_parents($this->last);
5212
                        //$this->update_queue[$this->last] = $this->items[$this->last]->get_status();
5213
                    } else {
5214
                        if ($this->debug > 2) {
5215
                            error_log('New LP - In learnpath::stop_previous_item() - Item is a SCO, saving is managed by SCO signals', 0);
5216
                        }
5217
                    }
5218
                    break;
5219
                case '1':
5220
                default:
5221
                    if ($this->debug > 2) {