-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmidMerge.R
47 lines (34 loc) · 963 Bytes
/
midMerge.R
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
## completely remodeling 2022 Mar 17 (Thu)
## Also dropped some "patch" code for students who bubble their idno wrong
## see content.mk
library(dplyr)
library(shellpipes)
## Pull midterm number from target name
test <- paste0("M", pipeStar())
marks <- rdsRead("marks")
scores <- rdsRead("score")
names(scores)
names(marks)
summary(marks)
scores <- (marks
%>% left_join(scores, by = "idnum")
%>% setNames(sub(test, "", names(.)))
%>% select(Username, idnum, SA, Ver, bubVer, bestVer, verScore, bestScore)
)
## Version problems
print(scores
%>% filter(!is.na(Ver) & ((Ver!=bubVer) | (verScore != bestScore)))
)
## Half tests?
print(filter(scores, is.na(SA) & !is.na(bestScore)))
print(filter(scores, !is.na(SA) & is.na(bestScore)))
scores <- (scores
%>% rename(MC=verScore)
%>% mutate(NULL
, total = ifelse((is.na(MC) & SA==0), 0, MC+SA)
) %>% select(
Username, SA, MC, total
) %>% filter(!is.na(total))
)
summary(scores)
rdsSave(scores)