2 #################################
4 myuw <- read.csv("myuw-COMMLD_570_A_spring_2021_students.csv", stringsAsFactors=FALSE)
6 ## class-level variables
7 question.grades <- c("GOOD"=100, "FAIR"=100-(50/3.3), "WEAK"=100-(50/(3.3)*2))
9 source("../assessment_and_tracking/track_participation.R")
12 rownames(d) <- d$unique.name
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))
20 total.questions.asked <- nrow(call.list)
23 ##########################################################
27 ## print the median number of questions for (a) everybody and (b)
28 ## people that have been present 75% of the time
31 questions.cutoff <- median(d$num.calls)
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)
38 ## number of missing days
39 # missing.days <- nrow(missing.in.class[missing.in.class$unique.name == x.unique.name,])
41 ## return the final score
42 data.frame(unique.name=x.unique.name,
43 part.grade=(base.score))
47 tmp <- do.call("rbind", lapply(d$unique.name, gen.part.grade))
49 d[as.character(tmp$unique.name), "part.grade"] <- tmp$part.grade
51 ## generate the baseline participation grades as per the process above
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)
56 d[sort.list(d$part.4point),]
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")
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],