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

@@ 1442-1454 (lines=13) @@
1439
1440
        $gradebooktable->userId = $userId;
1441
1442
        if (api_is_allowed_to_edit()) {
1443
            $gradebooktable->td_attributes = [
1444
                4 => 'class=centered'
1445
            ];
1446
        } else {
1447
            $gradebooktable->td_attributes = [
1448
                3 => 'class=centered',
1449
                4 => 'class=centered',
1450
                5 => 'class=centered',
1451
                6 => 'class=centered',
1452
                7 => 'class=centered'
1453
            ];
1454
        }
1455
1456
        $table = $gradebooktable->return_table();
1457
        $graph = $gradebooktable->getGraph();