73 lines
2.2 KiB
R
73 lines
2.2 KiB
R
## load in the data
|
|
#################################
|
|
|
|
myuw <- read.csv("myuw-COMMLD_570_A_spring_2021_students.csv", stringsAsFactors=FALSE)
|
|
|
|
## class-level variables
|
|
question.grades <- c("GOOD"=100, "FAIR"=100-(50/3.3), "WEAK"=100-(50/(3.3)*2))
|
|
|
|
source("../assessment_and_tracking/track_participation.R")
|
|
setwd("case_grades")
|
|
|
|
rownames(d) <- d$unique.name
|
|
|
|
## show the distribution of assessments
|
|
table(call.list$assessment)
|
|
prop.table(table(call.list$assessment))
|
|
table(call.list$answered)
|
|
prop.table(table(call.list$answered))
|
|
|
|
total.questions.asked <- nrow(call.list)
|
|
|
|
## generate grades
|
|
##########################################################
|
|
|
|
d$part.grade <- NA
|
|
|
|
## print the median number of questions for (a) everybody and (b)
|
|
## people that have been present 75% of the time
|
|
median(d$num.calls)
|
|
|
|
questions.cutoff <- median(d$num.calls)
|
|
|
|
## helper function to generate average grade minus number of missing
|
|
gen.part.grade <- function (x.unique.name) {
|
|
q.scores <- question.grades[call.list$assessment[call.list$unique.name == x.unique.name]]
|
|
base.score <- mean(q.scores, na.rm=TRUE)
|
|
|
|
## number of missing days
|
|
# missing.days <- nrow(missing.in.class[missing.in.class$unique.name == x.unique.name,])
|
|
|
|
## return the final score
|
|
data.frame(unique.name=x.unique.name,
|
|
part.grade=(base.score))
|
|
}
|
|
|
|
|
|
tmp <- do.call("rbind", lapply(d$unique.name, gen.part.grade))
|
|
|
|
d[as.character(tmp$unique.name), "part.grade"] <- tmp$part.grade
|
|
|
|
## generate the baseline participation grades as per the process above
|
|
|
|
## map part grades back to 4.0 letter scale and points
|
|
d$part.4point <-round((d$part.grade / (50/3.3)) - 2.6, 2)
|
|
|
|
d[sort.list(d$part.4point),]
|
|
|
|
|
|
## writing out data
|
|
d.print <- merge(d, myuw[,c("StudentNo", "FirstName", "LastName", "UWNetID")],
|
|
by.x="student.num", by.y="StudentNo")
|
|
write.csv(d.print, file="final_participation_grades.csv")
|
|
|
|
## library(rmarkdown)
|
|
|
|
## for (x.unique.name in d$unique.name) {
|
|
## render(input="../../assessment_and_tracking/student_report_template.Rmd",
|
|
## output_format="html_document",
|
|
## output_file=paste("../data/case_grades/student_reports/",
|
|
## d.print$UWNetID[d.print$unique.name == x.unique.name],
|
|
## sep=""))
|
|
## }
|