1---
2version: 0.1.0
3precision: 2
4---
5# draftply Pro — Grade Distribution
6# "How did the class actually do?" — not just the average.
7
8scores = [58, 62, 64, 67, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80, 81,
9 82, 83, 84, 85, 86, 88, 89, 91, 93, 96]
10
11n = len(scores)
12"Number of students": n
13"Mean": mean(scores)
14"Median": median(scores)
15"Std deviation": std(scores)
16
17# Quartiles — the boundary each quarter of the class falls into.
18"25th percentile": percentile(scores, 25)
19"75th percentile": percentile(scores, 75)
20
21# Pass rate at a 60-point boundary.
22pass_mark = 60
23passed(x) = x >= pass_mark
24n_passed = len(filter(passed, scores))
25
26"Students who passed": n_passed
27"Pass rate (%)": n_passed / n * 100
28
29hist(scores, 8, "Grade distribution", "score", "students")
30