ObtainExamStats {TexExamRandomizer} | R Documentation |
Obtaining exam statistics
Description
This function gets an answer sheet of the original version of the exam as a data frame, and a parsed list, which is obtained from GradeExams
and it outputs the statistics of how many answers are parsed exam, that is graded and obtains from there
Usage
ObtainExamStats(
OriginalExamAnswerSheet,
ExamAnswerParsedList,
names.FullExamOriginalCols
)
Arguments
OriginalExamAnswerSheet |
The answer sheet of the original exam. (In this package the convention is the exam version "0") |
ExamAnswerParsedList |
A parsed list for every student, as outputted by |
names.FullExamOriginalCols |
Names of those columns that in the answer sheet identify for all versions where that item is found on the original columns, (i.e., as ordered from the original version exam) |
Value
Returns the OriginalExamAnswerSheet
with a column added to it, named "ExamAnswerCount
" that counts the number of answers for each question
See Also
Other Grading Exams:
GradeExams()
Examples
asheet_file <-
system.file(
"extdata",
"ExampleTables",
"ExampleAnswerSheet.csv",
package = "TexExamRandomizer")
responses_file <-
system.file(
"extdata",
"ExampleTables",
"ExampleResponses.csv",
package = "TexExamRandomizer")
FullAnswerSheet <-
read.csv(
asheet_file,
header = TRUE,
stringsAsFactors = FALSE,
na.strings = c("", "NA", "Na"),
strip.white = TRUE)
Responses <- read.csv(
responses_file,
header = TRUE,
stringsAsFactors = FALSE,
na.strings = c("", "NA", "Na"),
strip.white = TRUE)
compiledanswers <-
WhichAnswerOriginal(
StudentAnswers = Responses,
FullExamAnswerSheet = FullAnswerSheet,
names.StudentAnswerQCols = grep(
names(Responses),
pattern = "^Q.*[[:digit:]]",
value = TRUE),
names.StudentAnswerExamVersion = grep(
names(Responses),
pattern = "Version",
value = TRUE),
OriginalExamVersion = 0,
names.FullExamVersion = "Version",
names.FullExamOriginalCols = grep(
names(FullAnswerSheet),
pattern = "_original",
value = TRUE),
names.CorrectAndIncorrectCols = c(
"choice",
"CorrectChoice")
)
OriginalAnswerSheet <- FullAnswerSheet[FullAnswerSheet$Version == 0,]
ExamStats <-
ObtainExamStats(
OriginalExamAnswerSheet = OriginalAnswerSheet,
ExamAnswerParsedList = compiledanswers,
names.FullExamOriginalCols = grep(
names(FullAnswerSheet),
pattern = "_original",
value = TRUE)
)
[Package TexExamRandomizer version 1.2.7 Index]