ConstructAnswerSheet | R Documentation |
Constructs an answer sheet given a document as generated by StructureDocument
by finding in the items the correct and wrong tags and describing where it found them.
Note that you must provide the document part only, StructureDocument
gives back a $preamble
and $document
.
If wrongTag
is left NULL
, the answer sheet only shows information of the correct answers.
This answer sheet provides information for what answers are correct or incorrect, as well as their position within the original document, before any shuffling was done. (It uses the names of the document to decide whether the document was shuffled or not, since subsetting a list removes all attributes except for the names, this is the "safest" way to do it)
The intent of this function is to make it easy to find the answers for a randomized version of an exam.
ConstructAnswerSheet(Document, correctTag, wrongTag = NULL)
Document |
Document, as defined in |
correctTag |
Tag to identify the correct items. |
wrongTag |
Tag that identifies the wrong items. |
The tags are just command of the type "\Tag
" that must be found somewhere that is not commented out inside the last item at the end of the tree structure. Usually you will want to use the tags that already identify the document items for this.
(For example, in the exam class, the tags \choice
and \CorrectChoice
could be used naturally, without having to introduce extra commands in the document)
Data Frame. With the following columns
Just an index running from 1 to n
, where n
is the numbe of rows
Four columns,
<name of section>_original
Contains an integer identifying the numbering of this section in the original layer, as identified by the naming convention
<name of section command>_original
Contains an integer identifying the numbering of this item in the original section, as identified by the naming convention
<name of section>
Contains an integer identifying the numbering of this section in the current layer, as identified by the ordering of the document inputted on this function
<name of section command>
Contains an integer identifying the numbering of this item in the current section, as identified by the ordering of the document inputted on this function
5 columns if the wrongTag is not NULL, 4 columns otherwise,
<name of section>_original
Contains an integer identifying the numbering of this section in the original layer, as identified by the naming convention
<name of section command>_original
Contains an integer identifying the numbering of this item in the original section, as identified by the naming convention
<name of section>
Contains an integer identifying the numbering of this section in the current layer, as identified by the ordering of the document inputted on this function
<correctTag>
Contains an integer identifying the numbering of this item in the current section, , as identified by the ordering of the document inputted on this function
If the correctTag
wasn't found in this item, it will show NA
instead. (This will only happen if wrongTag
is not NULL
, since otherwise this elements are omitted)
<wrongTag>
Contains an integer identifying the numbering of this item in the current section, as identified by the ordering of the document inputted on this function
If the wrongTag
wasn't found in this item, it will show NA
instead. (This will only happen if wrongTag
is not NULL
, since otherwise this elements are omitted)
FindExamAnswers
for the exact underlying messy algorithm that controls how the table is created.
Other Extracting information:
CountNumberOfSections()
,
FindExamAnswers()
,
GenerateShortAnswerSheet()
ConstructAnswerSheet(
TexExamRandomizer::testdoc$document,
"CorrectChoice",
"choice"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.