From 3567e02f940dab925255173b00fa9c7f8c575630 Mon Sep 17 00:00:00 2001 From: Yann Salmon Date: Sat, 23 Oct 2021 15:32:42 +0200 Subject: [PATCH] Classe pour qcm AMC --- latex/ysamc.cls | 98 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 latex/ysamc.cls diff --git a/latex/ysamc.cls b/latex/ysamc.cls new file mode 100644 index 0000000..327041d --- /dev/null +++ b/latex/ysamc.cls @@ -0,0 +1,98 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{ysamc} + +\LoadClass[french,10pt,a4paper]{scrartcl} +\PassOptionsToPackage{french}{babel} + +\RequirePackage[francais,bloc,ensemble]{automultiplechoice} +\RequirePackage{paquets} +\RequirePackage{comment} + +\newif\ifAMC@enonce\AMC@enoncefalse + +\ifAMC@catalog + \newenvironment{enonce}{}{} + \excludecomment{enonce*} + \newenvironment{corrige}{}{} + \excludecomment{corrige*} + \def\enonceonly#1{#1} + \geometry{hmargin=3cm,headheight=0cm,headsep=.3cm,footskip=1cm,top=1.5cm,bottom=1.5cm,left=1.5cm,right=1.5cm} +\else\ifAMC@correc + \excludecomment{enonce} + \excludecomment{enonce*} + \newenvironment{corrige}{}{} + \newenvironment{corrige*}{}{} + \def\enonceonly#1{} + \geometry{hmargin=3cm,headheight=0cm,headsep=.3cm,footskip=1cm,top=1.5cm,bottom=1.5cm,left=1.5cm,right=1.5cm} +\else % enonce + \AMC@enoncetrue + \newenvironment{enonce}{}{} + \newenvironment{enonce*}{}{} + \excludecomment{corrige} + \excludecomment{corrige*} + \def\enonceonly#1{#1} + \geometry{hmargin=3cm,headheight=2cm,headsep=.3cm,footskip=1cm,top=3.5cm,bottom=1.5cm,left=1.5cm,right=1.5cm} +\fi +\fi + + + +\setlength{\columnseprule}{0.5pt} +\parindent=0px + + +\setdefaultgroupmode{withoutreplacement} + +\baremeDefautS{formula=((NBC/NB)-(NMC/NM))*POIDS} +\baremeDefautM{formula=((NBC/NB)-(NMC/NM))*POIDS} + +\AtBeginDocument{% +\AMCboxStyle{shape=oval,width=2ex,height=2ex} +\def\AMCchoiceLabelFormat#1{{\scriptsize\sffamily #1}} +\def\AMCbeginQuestion#1#2{\par\noindent{\bfseries Q. #1} #2\hspace*{1em}} +\def\AMCformQuestion#1{\textbf{Q. #1:}} +\setlength{\AMChorizBoxSep}{.25em} +\setlength{\AMChorizAnswerSep}{1.5em plus 4em} +\AMCsetScoreZoneAnswerSheet{width=1.5em,height=1.5ex,depth=.5ex,position=question} +} + +\def\QOuverte{\AMCOpen{lineup=true,lineuptext={Sur une feuille à part.\\\scriptsize Cadre réservé au correcteur~: }}{\wrongchoice[0]{0}\scoring{0}\wrongchoice[1]{1}\scoring{1}\wrongchoice[2]{2}\scoring{2}\wrongchoice[3]{3}\scoring{3}\wrongchoice[4]{4}\scoring{4}\correctchoice[5]{5}\scoring{5}}} + +\AtEndDocument{% +\ifAMC@enonce +\AMCcleardoublepage + +\begin{copieexamen} +\AMCdebutFormulaire + +\begin{minipage}[t]{.4\textwidth} +Codez votre numéro d'étudiant ci-dessous (centaine, puis dizaine puis unité).\\ +\AMCcodeGridInt[h]{etu}{3} +\end{minipage} +\hfill +\begin{minipage}[t]{.5\textwidth} +Inscrivez votre nom, prénom et classe ci-dessous. +\hfill\\ +\champnom{\fbox{ + \begin{minipage}{\linewidth} + \vspace*{.65cm}\dotfill + + \vspace*{.6cm}\dotfill + \vspace*{1mm} + \end{minipage} + }}\hfill\end{minipage}\hspace*{\fill} + + + +\centerline{Remplissez \textbf{complètement en noir} les cases correspondant à vos réponses.} + +\AMCformulaire@dedanstrue% +\AMC@amclog{AUTOQCM[BR=0]^^J} +\AMC@keepmemorytrue% +\begin{multicols}{3} +\AMC@mem@show% +\end{multicols} + +\end{copieexamen} +\fi +}