Grading Exams

This vignette describes how to grade an exam using the script found on the exec/ folder. You can find where this script is found by typing on an R terminal.

    system.file("exec", package = "TexExamRandomizer")

Format of the student's answers

When you collect the responses from the student, you should follow the following prescriptions:

(@) The actual answers to each question should be an integer number, (1 being the first choice). They should be written in the order that they are presented in the student's exam. The columns should be called "Question 1", "Question 2", etc. (Or "Q 1", "Q2", etc). * If a certain question is left unanswered, give it the value 0 in the table. (@) If you want to give extra points, add a column called "Extra Points" with the added points. (@) You require a column called "Version", where the version number for each exam is written. (@) All other columns will be placed on the output "_Graded.csv" table.

responses.file <- system.file("extdata", "ExampleTables", "ExampleResponses.csv", package = "TexExamRandomizer")
responsesTable <- read.csv(responses.file, header = TRUE)
responsesTable$ExtraPoints <-, size = nrow(responsesTable), replace = TRUE)
kable(responsesTable[1:5,], caption = "Example responses format")

Format of the answer sheet

When you created the exams by using the examrandomizer script, it will generate a fullanswersheet.csv file. When grading, it assumes that the "correctTag" and the "wrongTag" are respectively "choice" and "CorrectChoice".

If that is not the case in your structure, simply change the names to "choice" and "CorrectChoice" of those columns.

answer.file <- system.file("extdata", "ExampleTables", "ExampleAnswerSheet.csv", package = "TexExamRandomizer")
answersTable <- read.csv(answer.file, header = TRUE)
kable(answersTable[1:5,], caption = "Answer sheet, the last two rows must be named \"choice\" and \"CorrectChoice\"")

(But if you really want to change that assumption, you can access the script and edit ASHEET_COLCORRECT and ASHEET_COLINCORRECT)

What if I wrote some questions wrong and I noticed too late? I already printed the exams

If for some reason you relize one question is incorrectly written, but it is too late to rewrite the exam, find the original answer sheet in the fullanswersheet.csv (The rows with version number 0). Then, remove the lines from the answer sheet that refer to the original question you want to ignore. (Keep a backup of the answer sheet just in case).

When the students answer the exam. Tell them to write any answer in that question, it will be ignored by the program.

Grading the exam

You can specify directly the responses from the students (--resp) and the answer sheet (--answer).

gradeexamrandomizer --resp <student responses csv> --answer <fullanswersheet csv>

If you have both of those files on the same directory and you make sure their name is somehow similar to "responses*.csv" and "answer*.csv", you can write the shorthand version.

gradeexamrandomizer --dir <dirname>

The output will be two csv files in the same directory where the students' responses file is found, called *_Graded.csv and *_Stats.csv.

graded.file <- system.file("extdata", "ExampleTables", "Example_Graded.csv", package = "TexExamRandomizer")
gradedTable <- read.csv(graded.file, header = TRUE)
kable(gradedTable[1:5,], caption = "Output graded file")
stats.file <- system.file("extdata", "ExampleTables", "Example_Stats.csv", package = "TexExamRandomizer")
statsTable <- read.csv(stats.file, header = TRUE)
kable(statsTable[1:5,], caption = "Output stats (It simply counts how many times each choice was chosen by every student)")

How is the grade calculated

In the output *_Graded.csv table, as you can see in the example above, there will be 5 rows added to the output:

Try the TexExamRandomizer package in your browser

Any scripts or data that you put into this service are public.

TexExamRandomizer documentation built on May 2, 2019, 3:18 a.m.