call.list$timestamp <- as.Date(call.list$timestamp)
## class-level variables
-question.grades <- c("PLUS"=100, "CHECK"=100-(50/3.3), "MINUS"=100-(50/(3.3)*2))
-missed.question.penalty <- (50/3.3) * 0.2 ## 1/5 of a full point on the GPA scale
+gpa.point.value <- 50/(4 - 0.7)
+question.grades <- c("PLUS"=100, "CHECK"=100-gpa.point.value, "MINUS"=100-(gpa.point.value*2))
+missed.question.penalty <- gpa.point.value * 0.2 ## 1/5 of a full point on the GPA scale
## inspect set the absence threashold
ggplot(d) + aes(x=absences) + geom_histogram(binwidth=1, fill="white",color="black")
-## absence.threshold <- median(d$absences)
-absence.threshold <- 4 ## TODO talk about this
+absence.threshold <- median(d$absences)
+
## inspect and set the questions cutoff
## questions.cutoff <- median(d$num.calls)
## median(d$num.calls)
## questions.cutoff <- nrow(call.list) / nrow(d) ## TODO talk about this
-## first these are the people were were not called simply because they got unlucky
-
- ## this is the 95% percentile based on simulation in simulation.R
+## this is the 95% percentile based on simulation in simulation.R
questions.cutoff <- 4
## show the distribution of assessments
total.questions.asked <- nrow(call.list)
-## find out how man questions folks have present/absent for
-##########################################################
+## find out how man questions folks have present/absent for.
+##
+## NOTE: this is currently only for informational purposes and is NOT
+## being used to compute grants in any way.
+########################################################################
calls.per.day <- data.frame(day=as.Date(names(table(call.list$timestamp))),
questions.asked=as.numeric(table(call.list$timestamp)))
labels=names(prop.asks.quantiles)[1:(length(prop.asks.quantiles))])
## generate grades
-##########################################################
+########################################################################
## print the median number of questions for (a) everybody and (b)
## people that have been present 75% of the time
tmp <- do.call("rbind", lapply(d$unique.name, gen.part.grade))
d <- merge(d, tmp)
rownames(d) <- d$unique.name
-
-## apply the penality for number of days we called on them and they were gone
-d$part.grade <- d$base.grade - d$missing.in.class.days * missed.question.penalty
-d$part.grade.orig <- d$part.grade
+d$part.grade <- d$base.grade
## first we handle the zeros
## step 1: first double check the people who have zeros and ensure that they didn't "just" get unlucky"
d[d$num.calls == 0,]
## set those people to 0 :(
-d[d$num.calls == 0]
d$part.grade[d$num.calls == 0] <- 0
-## step 2: identify the people who were were not asked "enough" questions but were unlucky/lucky
-## penalized.unique.names <- d$unique.name[d$num.calls < median(d$num.calls) & d$absences > median(d$absences)]
+## step 2: identify the people who were were not asked "enough"
+## questions but were unlucky/lucky
-## first these are the people were were not called simply because they got unlucky
+## first this just prints out are the people were were not called
+## simply because they got unlucky
d[d$num.calls < questions.cutoff & d$absences < absence.threshold,]
-## first these are the people were were not called simply because they got unlucky
+## these are the people were were not called simply unlucky (i.e.,
+## they were not in class very often)
penalized.unique.names <- d$unique.name[d$num.calls < questions.cutoff & d$absences > absence.threshold]
d[d$unique.name %in% penalized.unique.names,]
## now add "zeros" for every questions that is below the normal
-d[as.character(penalized.unique.names),"part.grade"] <- ((
- (questions.cutoff - d[as.character(penalized.unique.names),"num.calls"] * 0) +
- (d[as.character(penalized.unique.names),"num.calls"] * d[as.character(penalized.unique.names),"part.grade"]) )
+d[as.character(penalized.unique.names),"part.grade"] <- (
+ (d[as.character(penalized.unique.names),"num.calls"] * d[as.character(penalized.unique.names),"part.grade"])
/ questions.cutoff)
d[as.character(penalized.unique.names),]
+## apply the penality for number of days we called on them and they were gone
+d$part.grade <- d$part.grade - d$missing.in.class.days * missed.question.penalty
+
## TODO ensure this is right. i think it is
## 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$part.4point <- round((d$part.grade / gpa.point.value) - ((100 / gpa.point.value) - 4), 2)
d[sort.list(d$part.4point, decreasing=TRUE),
c("unique.name", "short.name", "num.calls", "absences", "part.4point")]
-
## writing out data to CSV
d.print <- merge(d, myuw[,c("StudentNo", "FirstName", "LastName", "UWNetID")],
by.x="unique.name", by.y="StudentNo")