Given a number of answer sheets generated by ConstructAnswerSheet
that have been binded together. And that have a column, versionColName
, that identifies each version. It collects all the answers together and places all the answers together for each exam.
Usage
GenerateShortAnswerSheet(
ExamSheet,
versionColName = "Version",
correctColName = "CorrectChoice"
)
Arguments
- ExamSheet
a exam sheet that contains all versions, similar to
CreateRandomExams
- versionColName
The name of the column in the original exam that contains the version number
- correctColName
The name of the column that contains the last index for the correct tag, or NA if it is not a correct choice.
Value
A data frame
Each row identifies one version of the answer sheet
the first column is the version number, the rest of the columns are the questions,
Details
Note that if the version number is 0, it is ignored, since it understands that version 0 is the reference version.
If the document has more than two layers, keep in mind that it just shows the top most layer numbering and then the inner most number of the correct answers.
Note how this implies as well that an exam with more than one possible answer can not be simplified into a short answer sheet.
IMPORTANTLY, If a certain exam has less answers than other exams, the are just cited sequentially. Which may cause confusion. To clarify. This may happen if a certain question has more than one solution marked as "correct", or if a certain question has no solutions marked as correct. In that case, The short answer sheet just sequentially names all the correct answers, disregarding which questions they are referring to. (This is a very special case that will only come up in a real scenario if you are writing a short answer question in the middle of a multiple choice test. Or if you are writing some questions to have multiple correct answers, but only a few of them, and those questions are not included in all exams... (So evil))
See also
Other Extracting information:
ConstructAnswerSheet()
,
CountNumberOfSections()
,
FindExamAnswers()
Examples
csvfile <- system.file(
"extdata",
"ExampleTables",
"ExampleAnswerSheet.csv",
package = "TexExamRandomizer"
)
testASheet <- read.csv(
csvfile,
header = TRUE,
stringsAsFactors = FALSE,
na.strings = c("", "NA", "Na"),
strip.white = TRUE
)
GenerateShortAnswerSheet(testASheet)
#> Version CorrectChoice 1 CorrectChoice 2 CorrectChoice 3 CorrectChoice 4
#> 1 1 2 3 1 2
#> 2 2 4 2 1 2
#> 3 3 1 3 1 4
#> 4 4 4 4 2 3
#> 5 5 3 1 4 1
#> 6 6 4 4 4 4
#> 7 7 4 3 3 4
#> 8 8 1 1 4 2
#> 9 9 4 3 2 1
#> 10 10 1 4 1 2
#> 11 11 4 1 1 4
#> 12 12 2 3 1 3
#> 13 13 2 3 2 3
#> 14 14 1 4 1 1
#> 15 15 4 2 2 2
#> 16 16 4 4 4 4
#> 17 17 2 4 3 4
#> 18 18 4 1 3 4
#> 19 19 3 3 2 4
#> 20 20 2 3 3 2
#> 21 21 3 4 4 1
#> 22 22 2 3 2 4
#> 23 23 2 3 4 1
#> 24 24 2 1 4 4
#> 25 25 1 2 4 1
#> 26 26 4 1 1 4
#> 27 27 1 3 2 4
#> 28 28 1 1 4 1
#> 29 29 1 4 3 4
#> 30 30 4 3 4 2
#> 31 31 1 2 1 2
#> 32 32 2 2 1 1
#> 33 33 2 2 3 2
#> 34 34 2 3 4 4
#> 35 35 2 1 2 4
#> 36 36 4 1 2 2
#> 37 37 2 2 3 1
#> 38 38 1 4 1 3
#> 39 39 1 4 2 1
#> 40 40 1 2 3 2
#> 41 41 2 3 4 4
#> 42 42 3 1 4 2
#> 43 43 1 2 2 2
#> 44 44 3 4 3 3
#> 45 45 4 4 2 1
#> 46 46 4 1 1 4
#> 47 47 1 3 2 4
#> 48 48 3 2 3 3
#> 49 49 2 3 1 1
#> 50 50 3 2 2 2
#> CorrectChoice 5 CorrectChoice 6 CorrectChoice 7 CorrectChoice 8
#> 1 3 4 2 3
#> 2 3 1 3 3
#> 3 3 2 2 1
#> 4 4 1 2 3
#> 5 2 4 4 4
#> 6 2 2 2 4
#> 7 2 2 3 1
#> 8 1 2 3 3
#> 9 2 3 4 2
#> 10 1 3 4 3
#> 11 4 4 4 1
#> 12 3 4 4 1
#> 13 1 1 2 4
#> 14 2 2 4 4
#> 15 2 1 2 2
#> 16 1 2 3 1
#> 17 3 1 4 1
#> 18 1 4 4 3
#> 19 2 1 2 4
#> 20 4 2 1 1
#> 21 1 1 1 3
#> 22 3 1 4 4
#> 23 3 2 3 2
#> 24 3 1 1 2
#> 25 1 3 3 4
#> 26 2 3 4 3
#> 27 2 2 3 2
#> 28 2 1 1 3
#> 29 2 4 2 3
#> 30 2 1 1 1
#> 31 2 2 4 1
#> 32 3 2 4 3
#> 33 2 4 2 4
#> 34 4 1 2 2
#> 35 4 4 4 4
#> 36 2 2 1 4
#> 37 3 4 4 3
#> 38 2 2 1 2
#> 39 1 2 2 2
#> 40 1 1 3 2
#> 41 3 2 1 2
#> 42 2 1 4 4
#> 43 3 2 4 4
#> 44 1 4 1 2
#> 45 1 2 4 2
#> 46 2 1 2 3
#> 47 3 4 1 3
#> 48 4 2 3 3
#> 49 3 4 4 1
#> 50 1 4 3 4
#> CorrectChoice 9 CorrectChoice 10 CorrectChoice 11 CorrectChoice 12
#> 1 4 4 1 3
#> 2 4 3 3 4
#> 3 3 2 3 1
#> 4 1 3 4 3
#> 5 4 2 4 3
#> 6 2 3 3 2
#> 7 3 4 1 4
#> 8 4 3 2 3
#> 9 3 4 3 4
#> 10 3 3 3 1
#> 11 2 2 4 2
#> 12 4 3 2 4
#> 13 2 3 4 1
#> 14 1 2 3 2
#> 15 4 2 3 3
#> 16 1 3 3 3
#> 17 1 2 1 4
#> 18 2 4 4 1
#> 19 3 4 2 1
#> 20 3 4 3 4
#> 21 4 1 3 4
#> 22 3 4 1 4
#> 23 3 3 4 3
#> 24 4 4 2 1
#> 25 1 4 4 3
#> 26 3 1 4 3
#> 27 4 3 4 4
#> 28 3 4 3 4
#> 29 3 3 3 2
#> 30 4 1 3 2
#> 31 2 1 2 4
#> 32 3 2 1 4
#> 33 1 4 4 2
#> 34 2 4 2 2
#> 35 4 1 3 3
#> 36 3 2 4 4
#> 37 1 4 1 2
#> 38 4 2 4 3
#> 39 3 4 1 1
#> 40 3 3 4 3
#> 41 1 3 2 3
#> 42 2 3 4 4
#> 43 4 1 1 2
#> 44 3 4 1 2
#> 45 2 3 1 2
#> 46 1 3 4 4
#> 47 2 4 1 3
#> 48 3 2 3 1
#> 49 1 4 3 3
#> 50 1 4 4 3
#> CorrectChoice 13 CorrectChoice 14 CorrectChoice 15
#> 1 3 2 3
#> 2 1 4 4
#> 3 2 2 4
#> 4 2 3 4
#> 5 4 3 1
#> 6 4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