\documentclass[12pt,a4paper]{article}
\usepackage{xsim}
\usepackage{tasks}
\NewTasksEnvironment[
label = \textbf{\Alph*.},
label-width = 15pt
]{choice}[\choice](4)
\DeclareExerciseEnvironmentTemplate{item}
{\description\item[\GetExerciseName~\GetExerciseProperty{counter}]}
{\enddescription}
\DeclareExerciseEnvironmentTemplate{space}
{\textbf{\GetExerciseProperty{counter}} }
{\quad}
\newcommand*\answer[1]{%
\xdef\multichoicehook{\ifx\multichoicehook\empty\else\multichoicehook, \fi\noexpand{\Alph{task}}}
\XSIMexpandcode{%
\SetExerciseProperty{solution-body}{\multichoicehook}}%
#1}
\DeclareExerciseCollection{Section1}
\xsimsetup{
exercise/template = item ,
solution/template = space ,
exercise/name = Q. ,
exercise/the-counter = \arabic{exercise}. ,
exercise/collect ,
random/sort = false,
exercise/begin-hook ={\let\multichoicehook\empty}
}
\begin{document}
\section{Section 1}
\collectexercises{Section1}
Il y a 2 réponses vraies par question, mais c'est toujours la dernière qui est reprise dans la liste des réponses!
\begin{exercise}
Lesquels donnent un résultat égale à $-6$?
\begin{choice}(2)
\choice \answer $-6 \times 1$
\choice $-3 \times -2$
\choice $-6 \times -1$
\choice \answer $3 \times -2$
\end{choice}
% Here the only fourth choice's answer key (the second correct one here "D") is diplayed in answers section
@sc-log : j'ai édité votre question. Il y manquait notamment un mot : j'espère que c'est « à la fin de chaque chapitre » qu'un QCM d'auto-évaluation est fourni. Ce pourrait évidemment être à la fin de chaque page, de chaque section...
Merci beaucoup @Pathe, j'ai aussi réduit le code, prière de jeter un coup d'oeil.
J'ai écourté la première version de mon message en essayant de rendre celui-ci plus clair et concis ; j'ai également fourni un ECM.
@touhami et @denis, merci de tout intérêt que vous porterez à ma requête. J'ai confiance en vos compétences en Latex.