Typesetting choices-in-a-table

Added by Will Ursus almost 10 years ago

I'm wondering how I can typeset choices as in the example below:

Which row in the table is correct about a uniform circular motion:
     ________________________________
    |   |  velocity  | acceleration  |
     --------------------------------.
    | A |  changing  |  constant     |
     --------------------------------.
    | B |  constant  |  changing     |
     --------------------------------.
    | C |  constant  |  constant     |
     --------------------------------.
    | D |  changing  |  changing     |
     --------------------------------.

I would also like the choice-shuffling feature to be preserved. Is it possible to be implemented withing current codes?


Replies (4)

RE: Typesetting choices-in-a-table - Added by Stefan Reinsberg almost 10 years ago

A not-so-pretty solution is this:

\begin{question}{Q1}
Which row in the table is correct about a uniform circular motion:\\

\hspace{1cm}velocity {\hskip 4em} acceleration
\begin{choices}
\wrongchoice{changing {\hskip 4em} constant}
\wrongchoice{constant {\hskip 4em} constant}
\wrongchoice{constant {\hskip 4em} changing}
\correctchoice{changing {\hskip 4em} changing}
\end{choices}
\end{question}

This will shuffle but maintain alignment in a very fragile way.
It might be better for your students to read actual sentence that you have in mind. That will be as unambiguous as can be:

\begin{question}{Q2}
Far uniform circular motion\\
\begin{choices}
\wrongchoice{velocity changes and acceleration is constant.}
\wrongchoice{velocity is constant and acceleration is constant.}
\wrongchoice{velocity is constant and acceleration is constant.}
\correctchoice{velocity changes and acceleration changes.}
\end{choices}
\end{question}

My attempts to interleave the tabbing or tabular environment with the question environment were quickly frustrated and I decided this is just as good. Of course, there might be questions where sentences are not ideal. In those circumstances you can typeset the question in a table format first, label the columns and then ask for the correct column in a horizontal fashion:

\begin{question}{Q3}
Which row in the table is correct about a uniform circular motion:\\
\begin{tabular}{r|r|r}
& velocity & acceleration\\
\hline
A & changing & constant \\
B & constant & constant \\
C & constant & changing \\
D & changing & changing \\
\end{tabular}\\
\begin{choiceshoriz}
\wrongchoice{A}
\wrongchoice{B}
\wrongchoice{C}
\correctchoice{D}
\end{choiceshoriz}
\end{question}

There you go - three methods to choose from, nothing quite like what you had in mind ;-)

RE: Typesetting choices-in-a-table - Added by Will Ursus almost 10 years ago

Thank you very much for the advices. Indeed I've implemented the 2nd and 3rd myself and couldn't be satisfied.

I first went with the 3rd method. It worked with choice-shuffling turned off, as the order of the choices is determined in the question body. Shuffling the choices simply breaks the correspondence. Alternatively I coded the choices as
\wrongchoice[A]{}\wrongchoice[B]{}\wrongchoice[C]{}\correctchoice[D]{}
and allowed shuffling, with choices displayed like [B][A][D][C] or [D][C][A][B] etc. Somehow weird on exam papers.

Right now I'm settled with the 2nd method. Cumbersome at times, this method has natural shuffling and I don't need to worry about breaking things.

Maybe the perfect solution is to create a new environment like "choicescustom" in the package source. I'm looking at the .sty file, but have no idea how to do it at this point.

RE: Typesetting choices-in-a-table - Added by Nikola Z. Guscic over 9 years ago

Regarding third method, have you considered using numbers as opposed to letters? Rows in the table could be named 1,2,3 and 4, and answers cold be coded \wrongchoice{1} or \wrongchoice[1$^st$ row} etc.

RE: Typesetting choices-in-a-table - Added by Will Ursus over 9 years ago

This is a good one. :-)

Natural and proper with minimal redundancy.

Nikola Z. Guscic wrote:

Regarding third method, have you considered using numbers as opposed to letters? Rows in the table could be named 1,2,3 and 4, and answers cold be coded wrongchoice{1} or wrongchoice[1$^st$ row} etc.

(1-4/4)