1

I wrote a MCQ with an unusually large number of proposed answers (7 answers). I realize that it is not possible to propose more than 5 answers to a question. How can the MCQ be able to offer more than 5 answers?

MCQ

\documentclass[a4paper, 12pt,french]{article}  % Présentation générale et mise en page
\usepackage[margin=5mm]{geometry}
\usepackage{siunitx}
\sisetup{locale=FR}
\usepackage[right]{eurosym}
%macro from  https://tex.stackexchange.com/questions/440382/package-eurosym-how-to-change-the-decimal-separator
\makeatletter
\renewcommand{\EUR}[2][]{%
  \if@EURleft\euro\,\fi
  \num[#1]{#2}%
  \if@EURleft\else\,\euro\fi
}
\makeatother

\usepackage{alterqcm}

\begin{document} \begin{minipage}{.7\textwidth} \begin{alterqcm}[lq=.7\columnwidth,num=false,symb = \dingsquare] \AQquestion{problème 1}{% {1}, {2}, {3}, {4}} \AQquestion{problème 2}{% {1}, {2}, {3}, {4}, {5}} \AQquestion{problème 3 : choices 6 is invisible}{% {1}, {2}, {3}, {4}, {5}, {6}} \AQquestion{problème 4 : choices 6 and 7 are invisible}{% {1}, {2}, {3}, {4}, {5}, {6}, {7}} \end{alterqcm} \end{minipage} \end{document}

AndréC
  • 24,137

1 Answers1

2

This modified \AQquestion command will show up to 7 answers.

a

\documentclass[a4paper, 12pt,french]{article}  % Présentation générale et mise en page
\usepackage[margin=5mm]{geometry}
\usepackage{siunitx}
\sisetup{locale=FR}
\usepackage[right]{eurosym}
%macro from  https://tex.stackexchange.com/questions/440382/package-eurosym-how-to-change-the-decimal-separator
\makeatletter
\renewcommand{\EUR}[2][]{%
    \if@EURleft\euro\,\fi
    \num[#1]{#2}%
    \if@EURleft\else\,\euro\fi
}
\makeatother

\usepackage{alterqcm}

%****************************************************** added <<<<<<<<<<<<< \makeatletter \renewcommand{\AQquestion}[3][]{% \setkeys[AQ]{local}{#1}% \stepcounter{AQ@numquestion}% \setcounter{AQ@numprop}{0} % v0.93 \setcounter{aq@numb}{0}% @for\liste:=#3\do{% \stepcounter{aq@numb}% \begingroup \ifnum\aqlocall@ng=3 \nogreekalph\fi \global\expandafter\let\csname aq@arg\alph{aq@numb}\endcsname\liste \endgroup}% \ifAQ@global@alea\ifAQ@global@VF% \else \aq@n@arg=0 % \loop\ifnum\aq@n@arg<\value{aq@numb}\aq@melange\advance\aq@n@arg by1\repeat\fi \fi \aq@adjust{#2}% \multirow{1}{\cmdAQ@global@lq}[\cmdAQ@local@pq]{% \ifAQ@global@num\aq@style@numquest{\cmdAQ@global@numstyle{AQ@numquestion}.}% \hspace{3pt}\fi% \ifAQ@global@transparent\hrule height0pt depth0pt width\aq@wdquest% \else#2\vss\fi% }% &\setkeys[AQ]{local}{#1}\aq@prop{\aq@arga}{1}\% \ifAQ@global@sep\cline{2-2}\fi% &\setkeys[AQ]{local}{#1}\aq@prop{\aq@argb}{2}\% \ifAQ@global@sep\cline{2-2}\fi% \ifnum\value{aq@numb}=2\hline\else\ifAQ@global@sep\cline{2-2}\fi% &\setkeys[AQ]{local}{#1}\aq@prop{\aq@argc}{3}\% \ifnum\value{aq@numb}=3\hline\else\ifAQ@global@sep\cline{2-2}\fi% &\setkeys[AQ]{local}{#1}\aq@prop{\aq@argd}{4}\% \ifnum\value{aq@numb}=4\hline\else\ifAQ@global@sep\cline{2-2}\fi% &\setkeys[AQ]{local}{#1}\aq@prop{\aq@arge}{5}\% \ifnum\value{aq@numb}=5\hline\else\ifAQ@global@sep\cline{2-2}\fi% &\setkeys[AQ]{local}{#1}\aq@prop{\aq@argf}{6}\% \ifnum\value{aq@numb}=6\hline\else\ifAQ@global@sep\cline{2-2}\fi% &\setkeys[AQ]{local}{#1}\aq@prop{\aq@argg}{7}\% \hline\fi\fi\fi\fi\fi% }% \makeatother %******************************************************

\begin{document}

\begin{minipage}{.7\textwidth}
    \begin{alterqcm}[lq=.7\columnwidth,num=false,symb = \dingsquare]
        \AQquestion{problème 1}{%
            {1},
            {2},
            {3},
            {4}}
        \AQquestion{problème 2}{%
            {1},
            {2},
            {3},
            {4},
            {5}
        }
        \AQquestion{problème 3 : choices 6 is visible}{%
            {1},
            {2},
            {3},
            {4},
            {5},
            {6}}
        \AQquestion{problème 4 : choices 6 and 7 are visible}{%
            {1},
            {2},
            {3},
            {4},
            {5},
            {6},
            {7}}
    \end{alterqcm}
\end{minipage}

\end{document}

Simon Dispa
  • 39,141
  • This is interesting, and limits it to 7 responses. Is it possible to make a loop (foreach or other) that does not limit the number of answers? – AndréC Oct 02 '22 at 19:53
  • @AndréC The answer can be easily expanded to provide students with a reasonable number of responses. – Simon Dispa Oct 02 '22 at 20:02
  • Currently seven, but that's no longer the problem since you can easily extend your code. I'm just wondering on a computational level, if your code can be subject to a loop that works regardless of the number of responses. That is, if it is generalizable. – AndréC Oct 02 '22 at 20:09
  • @AndréC It can be done but this would be a programming question that will merit another question :). – Simon Dispa Oct 02 '22 at 20:12
  • Ok, so I accept your answer and will not go any further. – AndréC Oct 02 '22 at 20:15
  • @AndréC Thank you for your feedback! – Simon Dispa Oct 02 '22 at 20:16