%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Codage "A"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newlength\LDFtemp
\newlength\AMCcodeAspace
\setlength{\AMCcodeAspace}{2\AMCcodeHspace}%\advance\AMCcodeAspace\AMCcodeAspace
\makeatletter
\newcommand{\AMCcodeA}[2]{% #1 : name for the "question" e.g. etu ; #2 : unused, just to ease AMCcodeA substitution to \AMCcode or AMCcodeH
{\def\AMCbeginQuestion##1##2{}%
 \setlength{\parindent}{0pt}%
 \def\AMCbeginAnswer{}
 \def\AMCendAnswer{\vspace{\AMCcodeVspace}\par}%
 \def\AMCanswer##1##2{##1\ifAMC@ensemble\else%
   \ifAMC@inside@box\else\hspace{\AMCcodeBoxSep}\textbf{##2}\settowidth{\LDFtemp}{\textbf{##2}}\hspace{-\LDFtemp}\fi\fi%
%   \ifAMC@inside@box\else\hspace{\AMCcodeBoxSep}\smash{\textbf{##2}}\fi\fi%
   \hspace{\AMCcodeAspace}}%
 \AMCnobloc%
 \AMC@chiffres=#2%
 \newcount\LDFcol
 \newcount\LDFcolA
 \newcount\LDFlig
 \newcount\LDFligQ
 \newcount\LDFligMax
 \newcount\LDFscore
 \LDFlig=65% point de départ du nom de case : A
 \LDFligQ=0
 \LDFligMax=101% i.e. 6 lignes (65+6*6=101)
 \loop%
 {\begin{questionmult}{#1.\the\LDFligQ}\QuestionIndicative\AMCnoCompleteMulti%
   \begin{choicescustom}[o]
	 \LDFcol=\LDFlig
	 \LDFcolA=0
	 \advance\LDFlig by 6 %6 taille du carré
	 \LDFscore=1% redémarrage à chaque ligne
     \loop%
	     \wrongchoice[\the\LDFcolA]{\ifnum\LDFcol>9\char\else\fi\the\LDFcol}\scoring{b=0,m=\the\LDFscore}
     \advance\LDFscore\LDFscore% double LDFscore
	 \advance\LDFcol1% incremente LDFcol de 1
	 \advance\LDFcolA1% incremente LDFcolA de 1
	 \ifnum\LDFcol<91\else\LDFcol=0\LDFlig=4\fi% si LDFcol dépasse Z, on continue avec 0
	 \ifnum\LDFcol<\LDFlig\repeat
   \end{choicescustom}%
 \end{questionmult}}%
  \advance\LDFligQ by 1
  \ifnum\LDFlig>9\advance\LDFlig by 6\multiply\LDFscore by 64%
  \else\advance\LDFlig by 6\advance\LDFscore by 1\fi
  \ifnum\LDFlig<95\else\LDFlig=4\LDFscore=5\LDFligMax=10\fi
 \ifnum\LDFlig<\LDFligMax\repeat%
 \vspace{-\AMCcodeVspace}%
}}
\makeatother

