Choices in tabular environment (Bug #56)


Added by Hiroto Kagotani about 13 years ago. Updated about 13 years ago.


Status:Closed Start date:05/02/2012
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:-
Target version:-

Description

I want to align choices on a table using tabular environment.
But when I create the following question, I get error messages from AMC:
Answer number ID used several times for the same question: 1
...

\begin{questionmult}{table}\AMCnoCompleteMulti
  Answer this question.

  \begin{choicescustom}[o]
    \begin{tabular}{|p{5cm}|p{5cm}|}
      \hline
      \wrongchoice{wrong 1} & \correctchoice{correct 2} \\
      \hline
      \correctchoice{correct 3} & \wrongchoice{wrong 4} \\
      \hline
    \end{tabular}
  \end{choicescustom}
\end{questionmult}

History

Updated by Hiroto Kagotani about 13 years ago

I simply added \global to counter increments.
Is that correct?

--- automultiplechoice.sty.orig 2012-05-02 10:55:07.000000000 +0900
+++ automultiplechoice.sty      2012-05-02 13:39:48.000000000 +0900
@@ -485,12 +485,12 @@
 \def\AMCbeginAnswer{}
 \def\AMCanswer#1#2{#1 #2}
 \def\AMCendAnswer{}
-\newcommand{\correctchoice}[2][]{\advance\AMCrep@count\@ne\relax%
+\newcommand{\correctchoice}[2][]{\global\advance\AMCrep@count\@ne\relax%
   \ifAMC@calibration\AMC@amclog{AUTOQCM[REP=\the\AMCrep@count:B]^^J}\fi%
   \global\AMCune@bonnetrue%
   \AMCload@@reponse{\une@rep{\ifAMC@correc\AMC@marque{#1}{1}%
       \else\AMC@marque{#1}{}\fi}{#2}}{\the\AMCrep@count}\ignorespaces}
-\newcommand{\wrongchoice}[2][]{\advance\AMCrep@count\@ne\relax%
+\newcommand{\wrongchoice}[2][]{\global\advance\AMCrep@count\@ne\relax%
   \ifAMC@calibration\AMC@amclog{AUTOQCM[REP=\the\AMCrep@count:M]^^J}\fi%
   \AMCload@@reponse{\une@rep{\AMC@marque{#1}{}}{#2}}{\the\AMCrep@count}%
   \ignorespaces}

Updated by Alexis Bienvenüe about 13 years ago

Yes, I think there is no drawback.

Updated by Hiroto Kagotani about 13 years ago

Committed as revision r1046.

Updated by Alexis Bienvenüe about 13 years ago

  • Status changed from New to Closed

Also available in: Atom PDF