Generate LaTeX Code for Auto-Multiple-Choice (AMC)

Generate code for use with the Optical Mark Recognition free software Auto Multiple Choice (AMC). More specifically, this package provides functions that use as input the question and answer texts, and output the LaTeX code for AMC.

AMCTestmakeR provides functions to be used with the free Optical Mark Recognition (OMR) software Auto Multiple Choice.

It's main purpose is to facilitate working with R and AMC in parallel, but it can also be used to transform a spreadsheet into an AMC questionnaire easily.

So far, the features are limited to generating AMC-LaTeX code questions for Multiple Choice Questionnaires (single and multiple answer). Hopefully, it's how most people use Auto Multiple Choice.

From CRAN

Install the library with install.packages("AMCTestmakeR"), and load it with:

From Github

If you don't have devtools, install it with install.packages("devtools") first.

Install the development version with devtools::install_github("nilsmy/AMCTestmakeR").

Basic Use : Generating questions

Generating code for one question

Let's say that we have a simple question to add: - How much is 1 + 1? - The correct answer is 2 (if you didn't get this one, you're probably at the wrong place) - The incorrect ones are 3 and 11

Or, more simply AMCcreatequestions("How much is $1+1$?",2,list(3, 11)).

Writing questions to a .tex file

R escapes different characters than LaTeX, so doing a copy-and-paste of the console output will require than you tweak things a bit.

Instead of doing that, I recommend to use the optional argument writefile = TRUE to write the generated code into a file. The default creates a questions.tex file in the working directory, but you can indicate another path with filepath, and append to an existing file -- rather than overwriting the existing file -- with append = TRUE).

Generating code for multiple questions

If you have an entire questionnaire to generate, the AMCcreatequestions can use vectors for many of its arguments.

Let's first create 3 questions, putting the questions and answers in vectors.

Note that the third question has only 2 incorrect answers: AMCTestmakeR will simply skip missing values (NA and "").

Like before, copy-paste is not optimal, as R escapes different characters than LaTeX. Using writefile = TRUE is more convenient to take care of this and translate R text into LaTeX (see above for details). Also, consider using the function AMCcreatetest() to handle the full test creation (described later as Suggested Workflow 1).

Changing the element

The element in AMC corresponds to a group of questions. They can for example correspond to different learning outcomes or chapters of a book. AMC is able to randomize questions within elements.

Provide a character value or vector to the argument element to define it. If you provide a value, all questions will have this value as element. If you provide a vector, each question will have its corresponding element.

The default element is general.

Changing the question codes

In AMC, each question should have a unique code.

The code can be provided in AMCTestmakeR through the argument code (like for the element argument, a character value or vector can be used).

A lazy version of this is, instead of codes, to input a code prefix with the codeprefix argument. Unique codes will be generated by the function by incrementing numbers after the prefix.

When your questions are ready and the AMCcreatequestions() gives a satisfactory result. I suggest to directly use AMCcreatetest() to create the other .tex files and to have a fully working test easily (Workflow 1).

Workflow 1: Creating the test files from scratch with AMCcreatetest()

AMCTestmakeR can create a test from scratch with the function AMCcreatetest(). It creates 3 .tex files (groups.tex, questions.tex, elements.tex) that can be directly used in the AMC project folder.

The first arguments of this function are passed to the AMCcreatequestions() function (see above for how to use it). The rest of the arguments are used to set test options (like fontsize, separateanswersheet, title, identifier, etc.). See the function documentation for a full list of options. If you don't pass any option (except for the questions of course), you should have a useable -- albeit not customized -- test.

More options

Separate answer sheets, font size, title, instructions, etc.

When working on the questions, I suggest to work using AMCcreatequestions() with the default output as notes (to check the result without opening a separate .tex file). Once your questions are ready, I suggest to switch to AMCcreatequestions(), using the same beginning arguments, and changing the rest.

Workflow 2: Doing things manually with your own template and AMCcreateelements()

If you want to customize more, you can do things step by step. If doing that, I highly recommend starting by reading the AMC documentation.

When using AMCcreatequestions() to create a questionnaire in AMC, I suggest to create, with writefile = TRUE, the questions in a separate questions file (e.g. questions.tex) in your AMC project folder.

From there, in your main .tex document (usually, that's named groups.tex by AMC), add \input{questions.tex} at the beginning (but still after your \begin{document}).

Then, where you want to place the different elements, in your main .tex, add \insertgroup{element} for each of them. Before the \insertgroup{} command, you can use \shufflegroup{element} to shuffle the questions within the element.

The AMCcreateelements() function

If you have many elements in your document, and therefore many \insertgroup{} (and \shufflegroup{}) to insert, you may want to use the function AMCcreateelements() function. It will show as a console message (which you can, this time, easily copy-and-paste into your main .tex document) the commands to insert (and shuffle, if desired, through the shufflequestions argument) the elements:

Note that, if the same element is input multiple times (which often happens if you pass to this function the same vector of elements as the one used in AMCcreatequestions()), it is not a problem, since only unique values are output:

Future features

Auto multiple choice s a great freeware that is able to do a lot more that what AMCTestmakeR helps for, so I will try to add the most helpful features here soon. This software feels the In any case, I strongly encourage to read the documentation of how to use LaTeX in Auto Multiple Choice to get a sense of its many possibilities.

AMCTestmakeR 1.0.0

• Fixed bugs that resulted in compilation issues in AMC.

AMCTestmakeR 0.1.0

• Initial release.

Reference manual

install.packages("AMCTestmakeR")

1.0.0 by Nils Myszkowski, 7 months ago

Browse source code at https://github.com/cran/AMCTestmakeR

Authors: Nils Myszkowski

Documentation:   PDF Manual