This still needs to be check over but this is new code to build the final grades. Current threshold for minimum questions comes from 1000 simulated classes (simulation.R).
25 lines
731 B
R
25 lines
731 B
R
weight.fac <- 2
|
|
num.calls <- 373
|
|
num.students <- 76
|
|
|
|
gen.calls.per.students <- function (x) {
|
|
raw.weights <<- rep(1, num.students)
|
|
names(raw.weights) <- seq(1, num.students)
|
|
|
|
table(sapply(1:num.calls, function (i) {
|
|
probs <- raw.weights / sum(raw.weights)
|
|
selected <- sample(names(raw.weights), 1, prob=probs)
|
|
## update the raw.weights
|
|
raw.weights[selected] <<- raw.weights[selected] / weight.fac
|
|
#print(raw.weights)
|
|
return(selected)
|
|
}))
|
|
}
|
|
|
|
|
|
simulated.call.list <- unlist(lapply(1:1000, gen.calls.per.students))
|
|
hist(simulated.call.list)
|
|
|
|
quantile(simulated.call.list, probs=seq(0,1,by=0.01))
|
|
quantile(simulated.call.list, probs=0.05)
|