Code Duplication    Length = 8-9 lines in 2 locations

main/gradebook/lib/results_data_generator.class.php 1 location

@@ 166-173 (lines=8) @@
163
        return api_strcmp($item1['firstname'], $item2['firstname']);
164
    }
165
166
    function sort_by_score($item1, $item2)
167
    {
168
        if ($item1['percentage_score'] == $item2['percentage_score']) {
169
            return 0;
170
        } else {
171
            return ($item1['percentage_score'] < $item2['percentage_score'] ? -1 : 1);
172
        }
173
    }
174
175
    function sort_by_mask ($item1, $item2)
176
    {

main/gradebook/lib/scoredisplay.class.php 1 location

@@ 562-570 (lines=9) @@
559
     * @param array $item2
560
     * @return int
561
     */
562
    private function sort_display($item1, $item2)
563
    {
564
        if ($item1['score'] === $item2['score']) {
565
566
            return 0;
567
        } else {
568
            return ($item1['score'] < $item2['score'] ? -1 : 1);
569
        }
570
    }
571
}
572