我認爲有一行代碼可以評定學生的答案,但我無法完全找到答案。這裏有三個問題和兩個學生的例子。評分學生的考試
在此先感謝
#the correct answers
key = t(c(1,2,3))
#the student responses
responses = t(data.frame(c(1,2,3),c(1,3,3)))
colnames(responses) =c('v1','v2','v3')
rownames(responses) = c('student1', 'student2')
#the desired graded matrix
graded = t(data.frame(c(T,T,T),c(T,F,T)))
dimnames(graded) = dimnames(responses)
graded
如果你教CS,你可能會對https://cseducators.stackexchange.com/感興趣(但由於它仍處於私人測試版,所以通過https://area51.stackexchange.com/proposals/92460/computer-science-educators進行最簡單的輸入) –