]> code.communitydata.science - coldcallbot-discord.git/blob - assessment_and_tracking/compute_final_case_grades.R
initial version of commit updating coldcall.py
[coldcallbot-discord.git] / assessment_and_tracking / compute_final_case_grades.R
1 ## load in the data
2 #################################
3
4 myuw <- read.csv("myuw-COMMLD_570_A_spring_2021_students.csv", stringsAsFactors=FALSE)
5
6 ## class-level variables
7 question.grades <- c("GOOD"=100, "FAIR"=100-(50/3.3), "WEAK"=100-(50/(3.3)*2))
8
9 source("../assessment_and_tracking/track_participation.R")
10 setwd("case_grades")
11
12 rownames(d) <- d$unique.name
13
14 ## show the distribution of assessments
15 table(call.list$assessment)
16 prop.table(table(call.list$assessment))
17 table(call.list$answered)
18 prop.table(table(call.list$answered))
19
20 total.questions.asked <- nrow(call.list)
21
22 ## generate grades
23 ##########################################################
24
25 d$part.grade <- NA
26
27 ## print the median number of questions for (a) everybody and (b)
28 ## people that have been present 75% of the time
29 median(d$num.calls)
30
31 questions.cutoff <- median(d$num.calls)
32
33 ## helper function to generate average grade minus number of missing
34 gen.part.grade <- function (x.unique.name) {
35     q.scores <- question.grades[call.list$assessment[call.list$unique.name == x.unique.name]]
36     base.score <- mean(q.scores, na.rm=TRUE)
37
38     ## number of missing days
39     # missing.days <- nrow(missing.in.class[missing.in.class$unique.name == x.unique.name,])
40
41     ## return the final score
42     data.frame(unique.name=x.unique.name,
43                part.grade=(base.score))
44 }
45
46
47 tmp <- do.call("rbind", lapply(d$unique.name, gen.part.grade))
48
49 d[as.character(tmp$unique.name), "part.grade"] <- tmp$part.grade
50
51 ## generate the baseline participation grades as per the process above
52
53 ## map part grades back to 4.0 letter scale and points
54 d$part.4point <-round((d$part.grade / (50/3.3)) - 2.6, 2)
55
56 d[sort.list(d$part.4point),]
57
58
59 ## writing out data
60 d.print <- merge(d, myuw[,c("StudentNo", "FirstName", "LastName", "UWNetID")],
61            by.x="student.num", by.y="StudentNo")
62 write.csv(d.print, file="final_participation_grades.csv")
63
64 ## library(rmarkdown)
65
66 ## for (x.unique.name in d$unique.name) {
67 ##     render(input="../../assessment_and_tracking/student_report_template.Rmd",
68 ##            output_format="html_document",
69 ##            output_file=paste("../data/case_grades/student_reports/",
70 ##                              d.print$UWNetID[d.print$unique.name == x.unique.name],
71 ##                              sep=""))
72 ## }

Community Data Science Collective || Want to submit a patch?