$score, 'count' => $row[1]); } if (!$has_score_0) { array_unshift($data, array('score' => 0, 'count' => 0)); } if (!$has_score_100) { $data[] = array('score' => 10000, 'count' => 0); } return $data; } $data = scoreDistributionData(); $pre_data = $data; $suf_data = $data; for ($i = 0; $i < count($data); $i++) { $data[$i]['score'] /= 100; } for ($i = 1; $i < count($data); $i++) { $pre_data[$i]['count'] += $pre_data[$i - 1]['count']; } for ($i = count($data) - 1; $i > 0; $i--) { $suf_data[$i - 1]['count'] += $suf_data[$i]['count']; } $submissions_sort_by_choice = !isset($_COOKIE['submissions-sort-by-code-length']) ? 'time' : 'tot_size'; ?>