Code Duplication    Length = 14-16 lines in 2 locations

main/newscorm/learnpath.class.php 2 locations

@@ 10466-10481 (lines=16) @@
10463
     * Get the items of exercise type
10464
     * @return array The items. Otherwise return false
10465
     */
10466
    public function getExercisesItems()
10467
    {
10468
        $exercises = [];
10469
10470
        foreach ($this->items as $item) {
10471
            if ($item->type != 'quiz') {
10472
                continue;
10473
            }
10474
10475
            $exercises[] = $item;
10476
        }
10477
10478
        array_pop($exercises);
10479
10480
        return $exercises;
10481
    }
10482
10483
    /**
10484
     * Get the item of exercise type (evaluation type)
@@ 10487-10500 (lines=14) @@
10484
     * Get the item of exercise type (evaluation type)
10485
     * @return array The final evaluation. Otherwise return false
10486
     */
10487
    public function getFinalEvaluationItem()
10488
    {
10489
        $exercises = [];
10490
10491
        foreach ($this->items as $item) {
10492
            if ($item->type != 'quiz') {
10493
                continue;
10494
            }
10495
10496
            $exercises[] = $item;
10497
        }
10498
10499
        return array_pop($exercises);
10500
    }
10501
10502
    /**
10503
     * Calculate the total points achieved for the current user in this learning path