forked from UO-BRT/orext-score-reports
-
Notifications
You must be signed in to change notification settings - Fork 0
/
score-report.Rmd
331 lines (282 loc) · 8.94 KB
/
score-report.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
---
title: "Unofficial Student Report"
date: "`r Sys.Date()`"
output:
pagedown::html_paged:
self_contained: true
css: [score-report-style.css]
number_sections: false
fig_caption: false
links-to-footnotes: false
fig_caption: false
params:
ssid: 9878654321.0
year: "2018-19"
name: "Susan B. Anthony"
grade: 5
content: "Science"
birthdate: "9/1/2002"
testdate: "3/13/2019"
assessor: "Daniel Anderson"
school_id: 1234
school_name: "Apple High School"
district_id: 5678
district_name: "Cherry SD"
county_name: "Grape"
score: 510.0
---
```{r dev = "svglite", setup, include=FALSE}
knitr::opts_chunk$set(
echo = FALSE,
message = FALSE,
warning = FALSE,
dev = "svglite",
fig.showtext = TRUE
)
library(ggplot2)
library(showtext)
font_add(
"OpenSans",
"/usr/share/fonts/TTF/OpenSans-Regular.ttf"
)
```
<html lang="en">
<div class = "bottom-box">
a
</div>
<div class = "grid-container">
<div class = "info-box1">
## Dear Parents/Guardians,
These results provide information about where your student is performing on grade level standards, and/or expectations, and skills. A student’s overall score and corresponding achievement levels are displayed in the line graph.
Oregon teachers and administrators have worked to implement more challenging, relevant, and engaging English and math standards in every K-12 classroom. These standards identify what students should know or be able to do to graduate high school on a path ready for college and career.
If you have questions about these results or how to best support your child, please contact your child’s school.
</div>
<div class = "info-box2">
<div class = "grid-state-logo">
<div class = "oregon-logo">
<img src = "oregon.png"
alt = "State of Oregon (geographic line art)"
height = "100" />
</div>
<div class = "ode-description">
<div class = "year">
`r params$year`
</div>
<div class = "osa">
OREGON STATEWIDE ASSESSMENT
</div>
</div> <!-- ode-description -->
</div> <!-- grid-state-logo -->
<div class = "name">
`r params$name`
</div>
<div class = "student-data nohead">
```{r }
stu_data <- data.frame(
var = c("SSID", "Grade", "Birthdate", "Test Date",
"Assessor", "School", "District", "County"),
id = c(rep(NA_integer_, 5),
params$school_id, params$district_id, NA_integer_),
values = with(params,
c(ssid, grade, birthdate, testdate,
assessor, school_name, district_name, county_name)
)
)
options(knitr.kable.NA = "")
knitr::kable(stu_data)
```
</div>
</div> <!-- info-box2 -->
</div> <!-- grid-box -->
<div class = "bottom-box">
a
</div>
<div id="background">
<p id="bg-text">Unofficial</p>
</div>
<div class = "score-box">
<div class = "nohead">
```{r summary-tbl}
cuts <- data.frame(
content = c(rep(c("ELA", "Math"), each = 7),
rep("Science", 3)),
grade = c(rep(c(3:8, 11), 2), c(5, 8, 11)),
c1 = c(192, 200, 202, 205, 208, 213, 899,
192, 193, 193, 204, 207, 208, 901,
506, 810, 901),
c2 = c(213, 213, 220, 220, 222, 224, 920,
201, 206, 206, 208, 209, 212, 907,
517, 820, 914),
c3 = c(228, 228, 232, 233, 236, 236, 927,
218, 219, 220, 222, 223, 226, 922,
530, 831, 929)
)
which_tbl <- cuts$grade == params$grade & cuts$content == params$content
tbl <- cuts[which_tbl, ]
cut_tbl <- data.frame(
grade = ifelse(
params$grade > 8,
"High School Range",
paste("Grade", params$grade)
),
l1 = paste("Level 1<br>Less than", tbl$c1),
l2 = paste0("Level 2<br>", paste(tbl$c1, "-", tbl$c2 - 1)),
l3 = paste0("Level 3<br>", paste(tbl$c2, "-", tbl$c3 - 1)),
l4 = paste0("Level 4<br>", paste(tbl$c3, "or more"))
)
knitr::kable(
cut_tbl,
caption = "Your child's scores and achievement levels"
)
```
```{r plot, fig.height = 1, out.width='743px', dpi = 600, fig.cap="A line plot showing the student's score relative to performance levels 1-4."}
assign_amo <- function(c1, c2, c3, score) {
tests <- c(
score < c1,
score >= c1 & score < c2,
score >= c2 & score < c3,
score >= c3
)
c(1, 2, 3, 4)[tests]
}
rescale01 <- function(x, rng) {
rng <- range(x, na.rm = TRUE)
(x - rng[1]) / (rng[2] - rng[1])
}
minmaxes <- data.frame(
grade = c(rep(c(3:8, 11, 12), 2), c(5, 8, 11, 12)),
content = rep(c("ELA", "Math", "Science"), c(8, 8, 4)),
min = c(
rep(c(140, 145, 145, 155, 155, 160, 850, 850), 2), c(450, 750, 850, 850)
),
max = c(
rep(c(245, 260, 260, 260, 260, 260, 960, 960), 2), c(560, 860, 960, 960)
)
)
row_select <- (minmaxes$grade == params$grade) &
(minmaxes$content == params$content)
score_min <- minmaxes[row_select, "min"]
score_max <- minmaxes[row_select, "max"]
full_scores <- data.frame(
score = seq(score_min, score_max),
amo = vapply(seq(score_min, score_max),
assign_amo,
c1 = tbl$c1,
c2 = tbl$c2,
c3 = tbl$c3,
FUN.VALUE = double(1))
)
rescaled_within <- tapply(full_scores$score, full_scores$amo, rescale01)
full_scores$rescaled <- unlist(rescaled_within)
content <- ifelse(
tolower(params$content) == "ela",
"English Language Arts\nOverall Score",
ifelse(
tolower(params$content) == "math",
"Mathematics \nOverall Score",
"Science \nOverall Score"
)
)
plot_d <- data.frame(
content = content,
score = ifelse(as.numeric(params$score) < score_min, score_min, ifelse(
as.numeric(params$score) > score_max, score_max, params$score
)
)
)
plot_d <- merge(plot_d, full_scores, by = "score", all.x = TRUE)
# add a bit of padding around the cut scores
plot_d$rescaled <- ifelse(
plot_d$rescaled == 1, 0.95, ifelse(
plot_d$rescaled == 0, 0.05, plot_d$rescaled
)
)
plot_d$location <- plot_d$amo + plot_d$rescaled
plot_d$location <- ifelse(plot_d$location >= 4.85, 4.85, plot_d$location)
plot_d$location <- ifelse(plot_d$location <= 1.15, 1.15, plot_d$location)
ggplot(plot_d, aes(x = location, y = 1)) +
geom_segment(
x = 1,
xend = 5,
y = 1,
yend = 1,
arrow = arrow(
length = unit(0.3, "cm"),
ends = "both",
type = "closed"
),
) +
geom_vline(xintercept = 2:4,
linetype = "dashed") +
geom_point(
shape = 23,
fill = "#57cc99",
color = "#000000",
size = 5
) +
geom_label(
label = params$score,
y = 1.03,
family = "OpenSans"
) +
scale_x_continuous(
limits = c(1, 5),
name = "",
breaks = NULL
) +
scale_y_continuous(
name = plot_d$content,
breaks = NULL
) +
theme(
axis.title.y = element_text(angle = 0, vjust = 0.5, hjust = 0, size = 10,
margin = unit(c(0, -.6, 0, 0), "cm"),
family = "OpenSans"
),
panel.background = element_rect(fill = "#FFFFFF"),
plot.margin = unit(c(0, -0.6, 0, 0.1), "cm")
)
```
</div>
</div>
```{r }
pld_text <- function(amo) {
switch(
amo,
`1` = "limited to no mastery",
`2` = "inconsistent or partial mastery",
`3` = "adept knowledge and skills",
`4` = "exceptional knowledge and skills"
)
}
amo <- assign_amo(
c1 = tbl$c1,
c2 = tbl$c2,
c3 = tbl$c3,
as.numeric(params$score)
)
txt <- pld_text(amo)
```
<div class = "descriptive-text">
The student demonstrates `r txt` when presented with test items linked to grade level content; i.e., content that has been reduced in depth, breadth, and complexity. Specific information regarding your student's performance in each domain of this assessment are located in the Achievement/Performance Standards section on the Statewide Alternate Assessment website: https://www.oregon.gov/ode/educator-resources/assessment/AltAssessment/. Note: Because your child participated in the Extended Assessment, these results cannot be used to compare your child's performance with that of students who are in the same enrolled grade but taking the general assessment.
ODE worked with partners at the University of Oregon at Behavioral Research & Teaching, along with education and community partners, to develop parent assessment literacy training modules found at: https://www.oregon.gov/ode/educator-resources/assessment/Pages/asmtlit.aspx
</div>
```{r colorfun}
color_tbl <- function(amo) {
n <- amo + 1
topline <- paste0(
".score-box > div > table > tbody > tr > td:nth-child(", n, ") {"
)
body <- paste0(
"background-color: #57cc99;}"
)
paste0(topline, body)
}
```
<style>
`r color_tbl(amo)`
</style>
<div class = "footer-text">
## About scale scores and achievement standards
Student results are reported on scales that vary by test subject. Standards have been established with respect to these score s that identify your child’s achievement level. A description of this achievement level is provided below the score(s). For more information on scores and achievement standards, see https://www.oregon.gov/ode/educator-resources/standards/Pages/Achievement-Performance-Standards.aspx.
</div>