Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 459-467 (lines=9) @@
456
                                $temp[] = $title = Security::remove_XSS($title);
457
                                $temp[] = Security::remove_XSS(learnpathItem::humanize_status($lesson_status, false, $type));
458
459
                                if ($row['item_type'] == 'quiz') {
460
                                    if (!$is_allowed_to_edit && $result_disabled_ext_all) {
461
                                        $temp[] = '/';
462
                                    } else {
463
                                        $temp[] = ($score == 0 ? '0/' . $maxscore : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1)));
464
                                    }
465
                                } else {
466
                                    $temp[] = ($score == 0 ? '/' : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1)));
467
                                }
468
                                $temp[] = $time;
469
                                $csv_content[] = $temp;
470
                            }
@@ 812-820 (lines=9) @@
809
                            $temp[] = api_html_entity_decode($title, ENT_QUOTES);
810
                            $temp[] = api_html_entity_decode($lesson_status, ENT_QUOTES);
811
812
                            if ($row['item_type'] == 'quiz') {
813
                                if (!$is_allowed_to_edit && $result_disabled_ext_all) {
814
                                    $temp[] = '/';
815
                                } else {
816
                                    $temp[] = ($score == 0 ? '0/' . $maxscore : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1)));
817
                                }
818
                            } else {
819
                                $temp[] = ($score == 0 ? '/' : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1)));
820
                            }
821
                            $temp[] = $time;
822
                            $csv_content[] = $temp;
823
                        }