Code Duplication    Length = 7-7 lines in 2 locations

main/inc/lib/tracking.lib.php 2 locations

@@ 403-409 (lines=7) @@
400
                            $maxscore = $row['mymaxscore'];
401
                        } else {
402
                            if ($row['item_type'] == 'sco') {
403
                                if (!empty($row['myviewmaxscore']) && $row['myviewmaxscore'] > 0) {
404
                                    $maxscore = $row['myviewmaxscore'];
405
                                } elseif ($row['myviewmaxscore'] === '') {
406
                                    $maxscore = 0;
407
                                } else {
408
                                    $maxscore = $row['mymaxscore'];
409
                                }
410
                            } else {
411
                                $maxscore = $row['mymaxscore'];
412
                            }
@@ 641-647 (lines=7) @@
638
                        $maxscore = $row['mymaxscore'];
639
                    } else {
640
                        if ($row['item_type'] == 'sco') {
641
                            if (!empty($row['myviewmaxscore']) and $row['myviewmaxscore'] > 0) {
642
                                $maxscore = $row['myviewmaxscore'];
643
                            } elseif ($row['myviewmaxscore'] === '') {
644
                                $maxscore = 0;
645
                            } else {
646
                                $maxscore = $row['mymaxscore'];
647
                            }
648
                        } else {
649
                            if ($row['item_type'] == 'quiz') {
650
                                // Get score and total time from last attempt of a exercise en lp.