0

Background: I want to create a multiple choice exam in two versions, where the order of the choices differ. That is, both versions have the same questions and a list of answer options, but these options are shown in a different order. I would like to do this in a single document without more complex solutions like the esami package.

Idea: I thought that maybe I could create a boolean \newif which distinguishes between the two exam versions and then specify an item's optional argument depending on this if. But I fail to then sort by this optional argument. So maybe I need to pursue some completely different approach?

MWE: (compiles but does not do what I want, yet)

\documentclass{article} \newif\ifexamAB \examABtrue % \examABfalse \begin{document} Here is the question. \begin{enumerate} \item[\ifexamAB 2 \else 3 \fi] Some answer % Maybe I could specify this for each answer and then sort the printed list by this argument? \item Another answer \item Yet another answer \end{enumerate} \end{document} 

Edit: I understand there are solutions to randomise the order of list elements, and I understand that a manual reshuffling produces orders biased in certain ways. Nevertheless, for organisational reasons, I need to specify the order of items manually, instead of it being randomised. Hence, neither the randomlist nor the expl3 approach described here seem to work for me.

7
  • 1
    This question is similar to: Random items from enumerate/itemize. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented Jul 4 at 8:54
  • There is also a package randomlist, see for example tex.stackexchange.com/a/456411. Commented Jul 4 at 8:55
  • there is a class that specifically does this, which I used to use to do precisely this, though I have not needed to do it for a long time. I think it was examdesign.cls. note that there are good reasons to randomise the ordering of multiple choice options in questions, since people tend to assign correct answers to particular places in the order. Commented Jul 4 at 9:20
  • Thank you for the suggestions! I did look into randomlist and the alternative approach using expl3. But both seem to focus on random orders as opposed to manually specified ones. I understand randomisation may be preferable for psychological/behavioral reasons, but for organisational reasons (grading procedure, layout requirements, etc.) I prefer the order to be specified manually. Hence, I would very much appreciate a pointer on how to implement this. Commented Jul 4 at 10:10
  • @Bernd I see, that is indeed different. In that case a variant of tex.stackexchange.com/questions/128297/… may be what you are looking for Commented Jul 4 at 10:35

1 Answer 1

3

Do you envision something like this?

\documentclass{article} \usepackage{enumitem} \usepackage[left=2cm, right=2cm, top=2cm, bottom=2cm]{geometry} % Set global indentation for the document \setlength{\parindent}{0pt} % Remove paragraph indentation \setlength{\leftskip}{1em} % Indent entire document content 1em from left % Define the document type (change this to A, B, or C) \def\doctype{A} % Define ordering patterns (a,b,c,d correspond to arguments #1,#2,#3,#4) \def\orderA#1#2#3#4{\item #1 \item #2 \item #3 \item #4} % a,b,c,d \def\orderB#1#2#3#4{\item #1 \item #3 \item #2 \item #4} % a,c,b,d \def\orderC#1#2#3#4{\item #2 \item #1 \item #4 \item #3} % b,a,d,c % Counter for automatic question numbering \newcounter{questionnumber} % All-in-one command for questions with automatic numbering and reordering \newcommand{\questionExam}[5]{% \stepcounter{questionnumber}% \textbf{Question \arabic{questionnumber}.} #1 \begin{enumerate}[label=(\alph*), leftmargin=5em, itemsep=0.2em] \csname order\doctype\endcsname{#2}{#3}{#4}{#5}% \end{enumerate} } \begin{document} \section*{Exam Type \doctype} \questionExam{What is the capital of France?}{Paris}{London}{Berlin}{Madrid} \questionExam{Which planet is closest to the Sun?}{Mercury}{Venus}{Earth}{Mars} \questionExam{What is 2 + 2?}{4}{3}{5}{6} \end{document} 

For other type, just change the \doctype into B or C or whatever.

2
  • Nice solution (upvoted). However, it may lack some flexibility in setting a specific order for a question, if you predefine all 24 possible orders and have to look up which one corresponds to the order you want for a question then you probably easily lose track of what is going on. For this setting the order as an argument to the \item command as the OP shows in their question would be easier. Commented Jul 4 at 11:57
  • If we want different ordering for different question, then categorizing the exam type into A, B, or C is not the right path. Technically we can put type directly to the question itself. The way the item is printed is by using \csname order\doctype\endcsname; we can change it to order#6. Then instead of defining orderA, orderB etc, we create order12345, order12354, and the other 22 possible ordering. The sixth parameter is for the type of the ordering, e.g {12345}. This is the safest method (than parsing). The down side is, for 5 or 6 ordering, the permutation become too much. Commented Jul 4 at 13:02

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.