Code Duplication    Length = 13-13 lines in 2 locations

main/gradebook/index.php 1 location

@@ 937-949 (lines=13) @@
934
                    $gradebooktable->td_attributes = [
935
                        4 => 'class="text-center"'
936
                    ];
937
                } else {
938
                    $gradebooktable->td_attributes = [
939
                        3 => 'class="text-right"',
940
                        4 => 'class="text-center"',
941
                        5 => 'class="text-center"',
942
                        6 => 'class="text-center"',
943
                        7 => 'class="text-center"'
944
                    ];
945
946
                    if ($action == 'export_table') {
947
                        unset($gradebooktable->td_attributes[7]);
948
                    }
949
                }
950
951
                $table = $gradebooktable->return_table();
952
                $graph = $gradebooktable->getGraph();

main/gradebook/lib/GradebookUtils.php 1 location

@@ 1393-1405 (lines=13) @@
1390
1391
        $gradebooktable->userId = $userId;
1392
1393
        if (api_is_allowed_to_edit()) {
1394
            $gradebooktable->td_attributes = [
1395
                4 => 'class=centered'
1396
            ];
1397
        } else {
1398
            $gradebooktable->td_attributes = [
1399
                3 => 'class=centered',
1400
                4 => 'class=centered',
1401
                5 => 'class=centered',
1402
                6 => 'class=centered',
1403
                7 => 'class=centered'
1404
            ];
1405
        }
1406
1407
        $table = $gradebooktable->return_table();
1408
        $graph = $gradebooktable->getGraph();