\documentclass[a4paper]{article}

\usepackage[francais,bloc,completemulti]{automultiplechoice}
\usepackage[french]{babel}

\usepackage[locale = FR, detect-all, quotient-mode = fraction, parse-numbers = false]{siunitx}
\selectlanguage{french}%

\usepackage{fp}


\ExplSyntaxOn

%%% BUG FIX
%\sys_gset_rand_seed:n {42}

\edef\rdseed{\sys_rand_seed:}
\ExplSyntaxOn
\title{\rdseed}


\FPseed42
\ExplSyntaxOn
\NewExpandableDocumentCommand \randomint { m m } { \fp_eval:n { randint( #1, #2) }}

% if #1 == n, will have 1/n chance to have not the ggod ansver
\NewExpandableDocumentCommand \RandomCorrectWrong { O{4} +m +m } {
	\ifthenelse{\randomint{1}{#1}<#1}{\bonne{#2}}{\mauvaise{#3}}
}
\NewEnviron{qcm}[1]{%
	\def\arg{#1}%
	\expandafter\element\expandafter\arg\expandafter{\BODY\par}}

\ExplSyntaxOff	
\begin{qcm}{all}
	\begin{questionmult}{2024-02-06-001}
		À quelle angle en radian correspond $\SI{180}{\degres}$?
		\begin{reponseshoriz}
			\mauvaise{$ \SI{ \frac{\pi}{6} }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{4} }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{3} }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{2} }{\radian} $}
			\mauvaise{$ \SI{ \frac{3\,\pi}{4} }{\radian} $}
			\RandomCorrectWrong[2]{$ \SI{ \pi}{\radian} $}{$ \SI{ 180 }{\radian} $}
			\mauvaise{$ \SI{ 2\,\pi }{\radian} $}
			\mauvaise{$ \SI{ 180\,\pi }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{180} }{\radian} $}
		\end{reponseshoriz}
	\end{questionmult}
\end{qcm}
\begin{qcm}{all}
	\begin{questionmult}{2024-02-06-002}
		À quelle angle en radian correspond $\SI{180}{\degres}$?
		\begin{reponseshoriz}
			\mauvaise{$ \SI{ \frac{\pi}{6} }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{4} }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{3} }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{2} }{\radian} $}
			\mauvaise{$ \SI{ \frac{3\,\pi}{4} }{\radian} $}
			\RandomCorrectWrong[2]{$ \SI{ \pi}{\radian} $}{$ \SI{ 180 }{\radian} $}
			\mauvaise{$ \SI{ 2\,\pi }{\radian} $}
			\mauvaise{$ \SI{ 180\,\pi }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{180} }{\radian} $}
		\end{reponseshoriz}
	\end{questionmult}
\end{qcm}
\begin{qcm}{all}
	\begin{questionmult}{2024-02-06-003}
		À quelle angle en radian correspond $\SI{180}{\degres}$?
		\begin{reponseshoriz}
			\mauvaise{$ \SI{ \frac{\pi}{6} }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{4} }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{3} }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{2} }{\radian} $}
			\mauvaise{$ \SI{ \frac{3\,\pi}{4} }{\radian} $}
			\RandomCorrectWrong[2]{$ \SI{ \pi}{\radian} $}{$ \SI{ 180 }{\radian} $}
			\mauvaise{$ \SI{ 2\,\pi }{\radian} $}
			\mauvaise{$ \SI{ 180\,\pi }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{180} }{\radian} $}
		\end{reponseshoriz}
	\end{questionmult}
\end{qcm}
\begin{qcm}{all}
	\begin{questionmult}{2024-02-06-004}
		À quelle angle en radian correspond $\SI{180}{\degres}$?
		\begin{reponseshoriz}
			\mauvaise{$ \SI{ \frac{\pi}{6} }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{4} }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{3} }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{2} }{\radian} $}
			\mauvaise{$ \SI{ \frac{3\,\pi}{4} }{\radian} $}
			\RandomCorrectWrong[2]{$ \SI{ \pi}{\radian} $}{$ \SI{ 180 }{\radian} $}
			\mauvaise{$ \SI{ 2\,\pi }{\radian} $}
			\mauvaise{$ \SI{ 180\,\pi }{\radian} $}
			\mauvaise{$ \SI{ \frac{\pi}{180} }{\radian} $}
		\end{reponseshoriz}
	\end{questionmult}
\end{qcm}
\begin{document}
\setdefaultgroupmode{withoutreplacement}%
%%% fabrication des copies
\exemplaire{10}{
\champnom{\Large \textbf \rdseed}

\bigskip
	
\restituegroupe{all}

}
\end{document}
