diff --git a/amc-templates/amc_template/README b/amc-templates/amc_template/README
index 09a24d6..61295a7 100644
--- a/amc-templates/amc_template/README
+++ b/amc-templates/amc_template/README
@@ -1,28 +1,28 @@
Quick template user guide:
--------------------------
1) Place your questions in the 'questions/[language]/' subfolder(s).
2) Place your media files (if any) in the 'media/lang/' subfolders.
In your "\includegraphics" commands in your question files, prefix your path with the same folder name. e.g.:
\includegraphics[width=0.5\textwidth]{media/fr/BarreQuiGlisse2.eps}
-3) Edit the 'exam.tex' file and add your questions within the "{document}" envirinment with an "\input" command.
+3) Edit the 'exam.tex' file and add your questions within the "{document}" environment with an "\input" command.
[...]
\begin{document}
\input{./questions/fr/mc1.tex}
\input{./questions/fr/tf1.tex}
\end{document}
4) In a Linux or MacOS terminal :
- run "./build.sh" to build the PDF
- run "./clean.sh" to remove the temporary files and PDF
Notes:
------
* Should you need extra packages, please add them in the file 'packages.tex'
diff --git a/amc-templates/amc_template_al/README b/amc-templates/amc_template_al/README
deleted file mode 100644
index 09a24d6..0000000
--- a/amc-templates/amc_template_al/README
+++ /dev/null
@@ -1,28 +0,0 @@
-Quick template user guide:
---------------------------
-
-1) Place your questions in the 'questions/[language]/' subfolder(s).
-
-2) Place your media files (if any) in the 'media/lang/' subfolders.
-In your "\includegraphics" commands in your question files, prefix your path with the same folder name. e.g.:
-\includegraphics[width=0.5\textwidth]{media/fr/BarreQuiGlisse2.eps}
-
-3) Edit the 'exam.tex' file and add your questions within the "{document}" envirinment with an "\input" command.
-
-[...]
-\begin{document}
-
-\input{./questions/fr/mc1.tex}
-\input{./questions/fr/tf1.tex}
-
-\end{document}
-
-4) In a Linux or MacOS terminal :
-- run "./build.sh" to build the PDF
-- run "./clean.sh" to remove the temporary files and PDF
-
-
-Notes:
-------
-
-* Should you need extra packages, please add them in the file 'packages.tex'
diff --git a/amc-templates/amc_template_al/common_commands.tex b/amc-templates/amc_template_al/common_commands.tex
deleted file mode 100644
index f289990..0000000
--- a/amc-templates/amc_template_al/common_commands.tex
+++ /dev/null
@@ -1,37 +0,0 @@
-%% COMMON COMMANDS (june 2016)
-
-% MATHEMATICAL DISPLAYSTYLE WITH REDUCED VERTICAL SPACE
-\def\centermath#1{\par\smallskip\centerline{$\displaystyle#1$}\smallskip\par}%
-
-% SET SEPARATOR
-\def\mid{\mathrel{:}}
-
-% PARTIAL DERIVATIVES
-\newcommand{\fracpd}[2]{\frac{\partial #1}{\partial #2}} % partielle Ableitung
-\newcommand{\dfracpd}[2]{\dfrac{\partial #1}{\partial #2}} % partielle Ableitung
-
-% FUNCTION DEFINITION
-\def\funcdef#1#2#3#4%{DOMAIN}{IMAGE}{VARIABLE}{FUNCTION}
- {\begin{array}[t]{@{}c@{\,\,}c@{\,\,}l}%
- \displaystyle#1 & \longrightarrow & \displaystyle#2\\%
- \displaystyle#3 & \longmapsto & \displaystyle#4 \end{array}}%
-
-% VECTORS
-\let\vec\boldsymbol%
-% \def\vec#1{\underline{#1}} %% ENGLISH VERSION FOR JAN
-
-% DOUCHET-ZWAHLEN NOTATION (2016)
-\def\ln{\mathop{\rm Log}}%
-\def\arctan{\mathop{\rm Arctg}}%
-
-% VECTOR OPERATORS
-% DIVERGENCE
-\def\div{\mathop{\rm div}}%
-% CURL
-\def\rot{\mathop{\bf rot}}%
-%\def\rot{\mathop{\underline{\rm curl}}}% %% ENGLISH VERSION FOR JAN
-
-% MATRIX ALGEBRA
-% TRANSPOSE
-\def\T{\mathrm T}%
-%\def\T{{\mbox{\scriptsize{\textsf T}}}}% %% GERMAN VERSION FOR AMIN
diff --git a/amc-templates/amc_template_al/exam.pdf b/amc-templates/amc_template_al/exam.pdf
deleted file mode 100644
index 78c4299..0000000
Binary files a/amc-templates/amc_template_al/exam.pdf and /dev/null differ
diff --git a/amc-templates/amc_template_al/exam.tex b/amc-templates/amc_template_al/exam.tex
deleted file mode 100644
index aad313a..0000000
--- a/amc-templates/amc_template_al/exam.tex
+++ /dev/null
@@ -1,44 +0,0 @@
-\documentclass[a4paper]{article}
-\usepackage[utf8]{inputenc} %Unicode
-\usepackage[T1]{fontenc}
-\usepackage{fix-cm}
-\usepackage[lang=FR,bloc,completemulti]{automultiplechoice}
-\input{./packages.tex}
-\input{./common_commands.tex}
-
-\newcommand{\TRUE}{
- \bareme{b=1,m=-1}
- \begin{choiceshoriz}[o]
- \bonne{VRAI}
- \mauvaise{FAUX}
- \end{choiceshoriz}
-\medskip
-}
-
-\newcommand{\FALSE}{
- \bareme{b=1,m=-1}
- \begin{choiceshoriz}[o]
- \mauvaise{VRAI}
- \bonne{FAUX}
- \end{choiceshoriz}
-\medskip
-}
-
-\begin{document}
-
-\input{./questions/fr/al_common-mc01.tex}
-\input{./questions/fr/al_common-mc02.tex}
-\input{./questions/fr/al_common-mc03.tex}
-\input{./questions/fr/al_common-mc05.tex}
-\input{./questions/fr/al_common-mc06.tex}
-\input{./questions/fr/al_common-mc09.tex}
-\input{./questions/fr/al_common-mc15.tex}
-\input{./questions/fr/al_common-mc16.tex}
-\input{./questions/fr/al_common-mc17.tex}
-\input{./questions/fr/al_common-tf01.tex}
-\input{./questions/fr/al_common-tf02.tex}
-\input{./questions/fr/al_common-tf03.tex}
-\input{./questions/fr/al_common-tf04.tex}
-\input{./questions/fr/al_common-tf10.tex}
-
-\end{document}
diff --git a/amc-templates/amc_template_al/questions/fr/al_common-mc01.tex b/amc-templates/amc_template_al/questions/fr/al_common-mc01.tex
deleted file mode 100644
index e7698ca..0000000
--- a/amc-templates/amc_template_al/questions/fr/al_common-mc01.tex
+++ /dev/null
@@ -1,11 +0,0 @@
-\begin{question}{common-mc1} Soit la courbe $\gamma:\mathbb{R}\to\mathbb{R}^3$ d\'efinie par
-\centermath{\gamma(t)=\smash{\bigl(t\cos(t),\,t\sin(t),\,t\,\bigr)^{\!\T}\,.}}
-La longueur de l'arc de la courbe~$\gamma$ reliant les points $A=(0,0,0)$ et $B=(2\pi,0,2\pi)$ est \'egale \`a~:\vspace{-1ex}
-\begin{reponses}
-\bonne{$\displaystyle\int_0^{2\pi}\sqrt{2+t^2\,}\,dt$}
-\mauvaise{$\displaystyle\int_0^{\pi}(2+t^2)\,dt$}
-\mauvaise{$\displaystyle\int_0^{2\pi}2t^2\, dt$}
-\mauvaise{$\displaystyle\int_0^{\pi}\sqrt{2+t^2\,}\,dt$}
-\end{reponses}
-\vspace{-3ex}
-\end{question}
diff --git a/amc-templates/amc_template_al/questions/fr/al_common-mc02.tex b/amc-templates/amc_template_al/questions/fr/al_common-mc02.tex
deleted file mode 100644
index 1f32977..0000000
--- a/amc-templates/amc_template_al/questions/fr/al_common-mc02.tex
+++ /dev/null
@@ -1,11 +0,0 @@
-\begin{question}{common-mc2} Soit $D=\mathbb{R}^{2}\setminus\bigl\{(0,0)\bigr\}$ et la fonction $f\colon D \rightarrow\mathbb{R}$ d\'{e}finie par
-\centermath{f(x,y)=x\cos\!{\left(\dfrac{1}{x^2+y^2}\right)}\,.}\vspace{-1ex}
-Alors\vspace{-1ex}
-\begin{reponses}
-\bonne{$\displaystyle\strut\smash{\lim_{(x,y)\to(0,0)}f(x,y)=0}$}
-\mauvaise{ $\displaystyle\strut\smash{\lim_{(x,y)\to(0,0)}f(x,y)\;}$ n'existe pas}
-\mauvaise{ $\displaystyle\strut\smash{\lim_{(x,y)\to(0,0)}f(x,y)=1}$}
-\mauvaise{ $\displaystyle\strut\smash{\lim_{(x,y)\to(0,0)}f(x,y)=y}$}
-\end{reponses}
-\vspace{-3ex}
-\end{question}
diff --git a/amc-templates/amc_template_al/questions/fr/al_common-mc03.tex b/amc-templates/amc_template_al/questions/fr/al_common-mc03.tex
deleted file mode 100644
index 9ac01f2..0000000
--- a/amc-templates/amc_template_al/questions/fr/al_common-mc03.tex
+++ /dev/null
@@ -1,11 +0,0 @@
-\begin{question}{common-mc3} Soit~$D=\left]0,\infty\right[{\times}\left]0,\infty\right[$ et la fonction $f:D\to\mathbb{R}$ d\'{e}finie par
-\centermath{f(x,y)=\bigl|\ln(x)\ln(y)\bigr|\,.}\vspace{-1ex}
-Alors\vspace{-1ex}
-\begin{reponses}
-\bonne{les d\'eriv\'ees partielles de $f$ existent en~$(1,1)$}
-\mauvaise{la d\'eriv\'ee partielle de $f$ par rapport \`a~$y$ n'existe pas en~$(1,1)$}
-\mauvaise{ $f$ est born\'ee sur~$D$}
-\mauvaise{ $f$ n'est pas continue en $(1,1)$}
-\end{reponses}
-\vspace{-4ex}
-\end{question}
diff --git a/amc-templates/amc_template_al/questions/fr/al_common-mc05.tex b/amc-templates/amc_template_al/questions/fr/al_common-mc05.tex
deleted file mode 100644
index d57e127..0000000
--- a/amc-templates/amc_template_al/questions/fr/al_common-mc05.tex
+++ /dev/null
@@ -1,14 +0,0 @@
-\begin{question}{common-mc5} Soit la fonction $h\colon \mathbb{R}^{2} \rightarrow\mathbb{R}^{3}$ d\'{e}finie par
-\centermath{h(u,v)=\smash{\bigl(u^2\,,\,ve^{-u}\,,\,e^{-2v}\bigr)^{\!\T}}}
-et soit $g\colon \mathbb{R}^{3}\to\mathbb{R}$, $(x,y,z)\mapsto g(x,y,z)$, une fonction de classe $C^1(\mathbb{R}^3)$.
-Alors la d\'{e}riv\'{e}e partielle par rapport \`{a}~$v$ de la fonction
-$\displaystyle f\colon \mathbb{R}^{2}\rightarrow \mathbb{R}$, d\'{e}finie par
-$f(u,v)=g\bigl(h(u,v)\bigr)$, satisfait en~$(u,v)=(1,0)$~:\vspace{-1ex}%
-\begin{reponses}
-\bonne{$\displaystyle\frac{\partial f}{\partial v}(1,0)=e^{-1}\smash{\frac{\partial g}{\partial y}}(1,0,1)-2\frac{\partial g}{\partial z}(1,0,1)$}
-\mauvaise{ $\displaystyle\frac{\partial f}{\partial v}(1,0)=\smash{\frac{\partial g}{\partial y}}(1,0,1)$}
-\mauvaise{ $\displaystyle\frac{\partial f}{\partial v}(1,0)=\frac{\partial g}{\partial x}(1,0,1) - e^{-1}\smash{\frac{\partial g}{\partial y}}(1,0,1)$}
-\mauvaise{ $\displaystyle\frac{\partial f}{\partial v}(1,0)=e^{-1}\frac{\partial g}{\partial x}(1,0,1) - e^{-1}\smash{\frac{\partial g}{\partial y}}(1,0,1)$}
-\end{reponses}
-\vspace{-3ex}
-\end{question}
diff --git a/amc-templates/amc_template_al/questions/fr/al_common-mc06.tex b/amc-templates/amc_template_al/questions/fr/al_common-mc06.tex
deleted file mode 100644
index 8c70e22..0000000
--- a/amc-templates/amc_template_al/questions/fr/al_common-mc06.tex
+++ /dev/null
@@ -1,11 +0,0 @@
-\begin{question}{common-mc6} Soit la fonction $f\colon\mathbb{R}^{2}\rightarrow\mathbb{R}$ d\'{e}finie par
-\centermath{f(x,y)=x^{3}+y^{2}-2x -y}
-et soit le point~${\vec{p}}=(1,-1)$. Alors l'\'equation du plan tangent au graphe de $f$ en $\bigl(\vec{p}\,,\,f(\vec{p})\bigr)$ est~:\vspace{-1ex}
-\begin{reponses}
-\bonne{$z-x+3y+3=0$}
-\mauvaise{$z+2x+y-2=0$}
-\mauvaise{$z+2x+y+1=0$}
-\mauvaise{$z-x+3y-1=0$}
-\end{reponses}
-\vspace{-4ex}
-\end{question}
diff --git a/amc-templates/amc_template_al/questions/fr/al_common-mc09.tex b/amc-templates/amc_template_al/questions/fr/al_common-mc09.tex
deleted file mode 100644
index 33a435e..0000000
--- a/amc-templates/amc_template_al/questions/fr/al_common-mc09.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{question}{common-mc9} Soit la fonction $f\colon{\mathbb{R}}^3\rightarrow\mathbb{R}$ d\'{e}finie par $f(x,y,z)=(x^{2}+y)z+z^2-z\,$. Alors un vecteur $\vec v$ perpendiculaire \`{a} la surface de niveau de $f$ passant par le point $(2,0,-1)$ est~:\vspace{-1ex}
-\begin{reponses}
-\bonne{ $\vec v=\smash{(4,1,-1)^\T}$}
-\mauvaise{$\vec v=\smash{(1,-4,1)^\T}$}
-\mauvaise{ $\vec v=\smash{(-4,1,1)^\T}$}
-\mauvaise{ $\vec v=\smash{(-1,-4,4)^\T}$}
-\end{reponses}
-\vspace{-4ex}
-\end{question}
diff --git a/amc-templates/amc_template_al/questions/fr/al_common-mc15.tex b/amc-templates/amc_template_al/questions/fr/al_common-mc15.tex
deleted file mode 100644
index f9de6d4..0000000
--- a/amc-templates/amc_template_al/questions/fr/al_common-mc15.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{question}{common-mc15} La solution $y(x)$ de l'\'{e}quation diff\'{e}rentielle $x^{2}\,y^{\prime} + 4 \, y^{\prime}-x\,y+x =0$ pour \mbox{$x\in \mathbb{R}$} avec~la condition initiale $y(0)=5$ satisfait aussi~:\vspace{-1ex}
-\begin{reponses}
-\bonne{$\smash{y\bigl(\sqrt{5}\,\bigr)}=7$}
-\mauvaise{$\smash{y\bigl(\sqrt{5}\,\bigr)}=1$}
-\mauvaise{$\smash{y\bigl(\sqrt{5}\,\bigr)}=-7$}
-\mauvaise{$\smash{y\bigl(\sqrt{5}\,\bigr)}=2$}
-\end{reponses}
-\vspace{-4ex}
-\end{question}
diff --git a/amc-templates/amc_template_al/questions/fr/al_common-mc16.tex b/amc-templates/amc_template_al/questions/fr/al_common-mc16.tex
deleted file mode 100644
index 6643d55..0000000
--- a/amc-templates/amc_template_al/questions/fr/al_common-mc16.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{question}{common-mc16} La solution $u(t)$ de l'\'{e}quation diff\'{e}rentielle $u^{\prime\prime}-u^{\prime}-2u=4t-2$ pour $t\in\mathbb{R}$\linebreak avec~les conditions initiales $u(0)=0$ et $u^{\prime}(0)=3$ satisfait aussi~:\vspace{-1ex}
-\begin{reponses}
-\bonne{$u(1)=e^{2}-3e^{-1}$}
-\mauvaise{$u(1)=e^{2}-e^{-1}$}
-\mauvaise{$u(1)=e-e^{-2}$}
-\mauvaise{$u(1)=-2e^{-2}-2e+2$}
-\end{reponses}
-\vspace{-4ex}
-\end{question}
diff --git a/amc-templates/amc_template_al/questions/fr/al_common-mc17.tex b/amc-templates/amc_template_al/questions/fr/al_common-mc17.tex
deleted file mode 100644
index 267adb8..0000000
--- a/amc-templates/amc_template_al/questions/fr/al_common-mc17.tex
+++ /dev/null
@@ -1,11 +0,0 @@
-\begin{question}{common-mc17} Soit~$D=\bigl\{(x,y)\in\mathbb{R}^2\mid x>0\mbox{ et }y>0\bigr\}$ et la fonction $f\colon D\to\mathbb{R}$ d\'efinie par
-\centermath{f(x,y)=\ln(x^{2}+y)\,.}
-Alors la d\'eriv\'ee directionnelle de~$f$ au point~$(2,1)$ suivant le vecteur~$\vec{e}=\bigl(\frac35,\frac45\bigr)$ est \'egale \`a~:\vspace{-1ex}
-\begin{reponses}
-\bonne{$\hphantom{-}\dfrac{16}{25}$}
-\mauvaise{$-\dfrac{16}{25}$}
-\mauvaise{$\hphantom{-}\dfrac{85}{29}$}
-\mauvaise{$-\dfrac{85}{29}$}
-\end{reponses}
-\vspace{-4ex}
-\end{question}
diff --git a/amc-templates/amc_template_al/questions/fr/al_common-tf01.tex b/amc-templates/amc_template_al/questions/fr/al_common-tf01.tex
deleted file mode 100644
index e5e98a8..0000000
--- a/amc-templates/amc_template_al/questions/fr/al_common-tf01.tex
+++ /dev/null
@@ -1,3 +0,0 @@
-\begin{question}{common-tf1} Soient $p,q:I\to\mathbb{R}$ deux fonctions continues d\'efinies sur l'intervalle ouvert~$I\subset\mathbb{R}$ et~soit~$L(u)=u^{\prime\prime}+p\,u^{\prime}+q\,u$. Si $u^{}_{h}$ est une solution de l'\'{e}quation diff\'{e}rentielle $L(u)=0$ sur~$I$\linebreak et~$u^{}_{p}$ est une solution de l'\'{e}quation diff\'{e}rentielle $L(u)=g$ sur~$I$, o\`u~$g(t)=\cos(t^2)$, alors $3u^{}_{p}+u^{}_{h}$ est~solution de l'\'{e}quation diff\'{e}rentielle $L(u)=3g$ sur~$I$.
-\TRUE
-\end{question}
diff --git a/amc-templates/amc_template_al/questions/fr/al_common-tf02.tex b/amc-templates/amc_template_al/questions/fr/al_common-tf02.tex
deleted file mode 100644
index bcf9144..0000000
--- a/amc-templates/amc_template_al/questions/fr/al_common-tf02.tex
+++ /dev/null
@@ -1,3 +0,0 @@
-\begin{question}{common-tf2} Soit une fonction $f\colon\mathbb{R}^{2}\rightarrow\mathbb{R}$ telle que $f(0,0)=1$. Si pour tout $a\in \mathbb{R}$ fix\'{e} on~a~$\displaystyle\lim_{x\to0}f(x,ax)=1$, alors $f$ est continue en $(0,0)$.
-\FALSE
-\end{question}
diff --git a/amc-templates/amc_template_al/questions/fr/al_common-tf03.tex b/amc-templates/amc_template_al/questions/fr/al_common-tf03.tex
deleted file mode 100644
index 6586415..0000000
--- a/amc-templates/amc_template_al/questions/fr/al_common-tf03.tex
+++ /dev/null
@@ -1,5 +0,0 @@
-\begin{question}{common-tf3} Soit $f\colon\mathbb{R}^{2}\rightarrow\mathbb{R}$ une fonction de classe $C^{2}(\mathbb{R}^2)$. Alors, pour tout point $\vec p\in\mathbb{R}^{2}$ on~a~:
-\centermath{\dfrac{\partial^{2}f}{{\partial x}\partial y}(\vec p)
-=\dfrac{\partial^{2}f}{{\partial y}\partial x}(\vec p)}
-\TRUE
-\end{question}
diff --git a/amc-templates/amc_template_al/questions/fr/al_common-tf04.tex b/amc-templates/amc_template_al/questions/fr/al_common-tf04.tex
deleted file mode 100644
index 6bf844c..0000000
--- a/amc-templates/amc_template_al/questions/fr/al_common-tf04.tex
+++ /dev/null
@@ -1,3 +0,0 @@
-\begin{question}{common-tf4} Soit une fonction $f\colon\mathbb{R}^{3}\rightarrow\mathbb{R}$. Si $f$ est diff\'{e}rentiable en tout point de~$\mathbb{R}^{3}$,\linebreak alors~$f$ est de classe $C^{1}(\mathbb{R}^{3})$.
-\FALSE
-\end{question}
diff --git a/amc-templates/amc_template_al/questions/fr/al_common-tf10.tex b/amc-templates/amc_template_al/questions/fr/al_common-tf10.tex
deleted file mode 100644
index d624b1b..0000000
--- a/amc-templates/amc_template_al/questions/fr/al_common-tf10.tex
+++ /dev/null
@@ -1,3 +0,0 @@
-\begin{question}{common-tf10} L'ensemble $D=\bigl\{(x,y,z)\in \mathbb{R}^{3}\mid x>0\,,\ y>0\,,\ z= 0\bigr\}$ est ouvert.
-\FALSE
-\end{question}
diff --git a/amc-templates/amc_template_df.zip b/amc-templates/amc_template_df.zip
deleted file mode 100644
index bb58b95..0000000
Binary files a/amc-templates/amc_template_df.zip and /dev/null differ
diff --git a/amc-templates/amc_template_df/automultiplechoice.sty b/amc-templates/amc_template_df/automultiplechoice.sty
deleted file mode 100644
index a62cd85..0000000
--- a/amc-templates/amc_template_df/automultiplechoice.sty
+++ /dev/null
@@ -1,1719 +0,0 @@
-%%
-%% This is file `automultiplechoice.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% automultiplechoice.dtx (with options: `package')
-%%
-%% Copyright (C) 2008-2015 Alexis Bienvenue
-%%
-%% This file is part of Auto-Multiple-Choice
-%%
-%% Auto-Multiple-Choice is free software: you can redistribute it
-%% and/or modify it under the terms of the GNU General Public License
-%% as published by the Free Software Foundation, either version 2 of
-%% the License, or (at your option) any later version.
-%%
-%% Auto-Multiple-Choice is distributed in the hope that it will be
-%% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
-%% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-%% General Public License for more details.
-%%
-%% You should have received a copy of the GNU General Public License
-%% along with Auto-Multiple-Choice. If not, see
-%% .
-%%
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{automultiplechoice}
-\RequirePackage{xcolor} % \fcolorbox to fill (or not) a box
-\RequirePackage{fancyhdr} % \pagestyle{empty}
-\RequirePackage{bophook} % \AtBeginPage
-\RequirePackage{xkeyval} % \setkeys
-\RequirePackage{rotating} % \rotatebox
-\RequirePackage{fancybox} % \boxput
-\def\AMC@VERSION{AMC 1.3.0 r:6551ff313e87}
-\newwrite\AMC@logfile
-\immediate\openout\AMC@logfile=\jobname.amc
-\def\AMC@amclog#1{\immediate\write\AMC@logfile{#1}}
-\def\AMCmessage#1{\AMC@amclog{AUTOQCM[#1]^^J}}
-\AtBeginDocument{\@ifpackageloaded{bidi}{%
- \PackageInfo{automultiplechoice}{Package bidi loaded: using LR for boxes.}%
- \let\AMC@LR=\LR}%
-{\let\AMC@LR=\relax}}%
-\newcount\AMCload@counter
-\newcount\AMCid@quest\AMCid@quest=-1
-\newcount\AMCid@check
-\newcount\AMCid@etud\AMCid@etud=0
-\newcount\AMCid@etudstart\AMCid@etudstart=0
-\newcount\AMCid@etudfin
-\newcount\AMCnum@copies
-\newif\ifAMC@ordre\AMC@ordrefalse
-\newif\ifAMC@shuffleG\AMC@shuffleGtrue
-\newif\ifAMC@fullGroups\AMC@fullGroupsfalse
-\newif\ifAMC@correchead\AMC@correcheadfalse
-\newif\ifAMC@affichekeys\AMC@affichekeysfalse
-\newif\ifAMC@correc\AMC@correcfalse
-\newif\ifAMC@qbloc\AMC@qblocfalse
-\newif\ifAMC@asqbloc\AMC@asqblocfalse
-\newif\ifAMC@rbloc\AMC@rblocfalse
-\newif\ifAMCcomplete@multi\AMCcomplete@multifalse
-\newif\ifAMCquestionNumber\AMCquestionNumbertrue
-\newif\ifAMC@calibration\AMC@calibrationfalse
-\newif\ifAMC@plain\AMC@plainfalse
-\newif\ifAMCune@bonne
-\newif\ifAMCtype@multi
-\newif\ifAMC@watermark\AMC@watermarktrue
-\newif\ifAMC@inside@box\AMC@inside@boxfalse
-\newif\ifAMC@outside@box\AMC@outside@boxfalse
-\newif\ifAMC@ensemble\AMC@ensemblefalse
-\newif\ifAMC@inside@digit\AMC@inside@digitfalse
-\newif\ifAMCformulaire@dedans\AMCformulaire@dedansfalse
-\newif\ifAMC@zoneformulaire
-\newif\ifAMC@pagelayout\AMC@pagelayouttrue
-\newif\ifAMC@postcorrect\AMC@postcorrectfalse
-\newif\ifAMC@automarks\AMC@automarksfalse
-\newif\ifAMC@invisible\AMC@invisiblefalse
-\let\AMCcompleteMulti=\AMCcomplete@multitrue
-\let\AMCnoCompleteMulti=\AMCcomplete@multifalse
-\def\AMCid@name{}
-\newdimen\AMCformVSpace\AMCformVSpace=1.2ex
-\newdimen\AMCformHSpace\AMCformHSpace=.3em
-\newdimen\AMCinterIrep\AMCinterIrep=\z@
-\newdimen\AMCinterBrep\AMCinterBrep=.5ex
-\newdimen\AMCinterIquest\AMCinterIquest=\z@
-\newdimen\AMCinterBquest\AMCinterBquest=3ex
-\newif\ifAMCids@top
-\newif\ifAMCids@side
-\newdimen\AMCids@width
-\newdimen\AMCids@height
-\define@choicekey*{AMCids}{pos}[\AMCidsVar\AMCidsVarN]{none,top,side}{%
- \ifcase\AMCidsVarN\relax
- \AMCids@topfalse\AMCids@sidefalse
- \or
- \AMCids@toptrue\AMCids@sidefalse
- \or
- \AMCids@topfalse\AMCids@sidetrue
- \fi
-}
-\define@key{AMCids}{width}{\AMCids@width=#1}
-\define@key{AMCids}{height}{\AMCids@height=#1}
-\def\AMCidsPosition#1{\setkeys{AMCids}{#1}}
-\AMCidsPosition{pos=side,width=4cm,height=3ex}
-\def\AMCtext#1#2{\expandafter\def\csname AMC@loc@#1\endcsname{#2}}
-\def\AMClocalized#1{\csname AMC@loc@#1\endcsname}
-\def\AMC@loc@draft{DRAFT}
-\def\AMC@loc@message{For your examination, preferably print
- documents compiled from auto-multiple-choice.}
-\def\AMC@loc@qf#1{\textbf{Question #1:}}
-\def\AMC@loc@q#1#2{\textbf{Question #1} #2}
-\def\AMC@loc@corrected{Corrected}
-\def\AMC@loc@catalog{Catalog}
-\def\AMC@loc@explain{\textit{\textbf{Explanation: }}}
-\def\AMC@loc@none{None of these answers are correct.}
-\def\AMC@loc@question{question}
-\def\AMC@loc@questions{questions}
-\def\AMC@loc@namesurname{Name and surname:}
-\def\AMC@loc@NL{
- \def\AMC@loc@draft{Ontwerp}
- \def\AMC@loc@message{Gebruik bij uw proefwerk bij voorkeur die
- documenten welke door auto-multiple-choice zijn aangemaakt.}
- \def\AMC@loc@qf##1{\textbf{Vraag ##1 :}}
- \def\AMC@loc@q##1##2{\textbf{Vraag ##1} ##2}
- \def\AMC@loc@corrected{Correctie}
- \def\AMC@loc@catalog{Catalogus}
- \def\AMC@loc@none{Geen van de antwoorden is juist.}
- \def\AMC@loc@question{vraag}
- \def\AMC@loc@questions{vragen}
-}
-\def\AMC@loc@FR{
- \def\AMC@loc@draft{PROJET}
- \def\AMC@loc@message{Pour votre examen, imprimez de pr\'ef\'erence
- les documents compil\'es \`a l'aide de auto-multiple-choice.}
- \def\AMC@loc@qf##1{\textbf{Question ##1 :}}
- \def\AMC@loc@q##1##2{\textbf{Question ##1} ##2}
- \def\AMC@loc@corrected{Correction}
- \def\AMC@loc@catalog{Catalogue}
- \def\AMC@loc@explain{\textit{\textbf{Explication : }}}
- \def\AMC@loc@none{Aucune de ces r\'eponses n'est correcte.}
- \def\AMC@loc@question{question}
- \def\AMC@loc@questions{questions}
- \def\AMC@loc@namesurname{Nom et pr\'enom :}
-}
-\def\AMC@loc@DE{
- \def\AMC@loc@draft{ENTWURF}
- \def\AMC@loc@message{Benutzen Sie f\"ur Ihre Pr\"ufung bevorzugt Dokumente die mit
- auto-multiple-choice erstellt wurden.}
- \def\AMC@loc@qf##1{\textbf{Frage ##1 :}}
- \def\AMC@loc@q##1##2{\textbf{Frage ##1} ##2}
- \def\AMC@loc@corrected{Korrektur}
- \def\AMC@loc@catalog{Katalog}
- \def\AMC@loc@explain{\textit{\textbf{Erkl\"arung : }}}
- \def\AMC@loc@none{Keine dieser Antworten ist korrekt.}
- \def\AMC@loc@question{Frage}
- \def\AMC@loc@questions{Fragen}
-}
-\def\AMC@loc@IT{
- \def\AMC@loc@draft{BOZZA}
- \def\AMC@loc@message{Per l'esame, \`e preferibile stampare i documenti
- a partire da auto-multiple-choice.}
- \def\AMC@loc@qf##1{\textbf{Domanda ##1:}}
- \def\AMC@loc@q##1##2{\textbf{Domanda ##1} ##2}
- \def\AMC@loc@corrected{Correzione}
- \def\AMC@loc@catalog{Catalogo}
- \def\AMC@loc@none{Nessuna risposta \`e giusta.}
- \def\AMC@loc@question{domanda}
- \def\AMC@loc@questions{domande}
-}
-\def\AMC@loc@NO{
- \def\AMC@loc@draft{UTKAST}
- \def\AMC@loc@message{Det anbefales {\aa} skrive ut dokumentet
- for gjennomgang \\direkte fra auto-multiple-choice.}
- \def\AMC@loc@qf##1{\textbf{Oppgave ##1 :}}
- \def\AMC@loc@q##1##2{\textbf{Oppgave ##1} ##2}
- \def\AMC@loc@corrected{Rettet}
- \def\AMC@loc@catalog{Katalog}
- \def\AMC@loc@none{Ingen svar er riktige.}
- \def\AMC@loc@question{oppgave}
- \def\AMC@loc@questions{oppgave}
-}
-\def\AMC@loc@PT{
- \def\AMC@loc@draft{RASCUNHO}
- \def\AMC@loc@message{Para o seu exame, use preferencialmente documentos compilados do auto-multiple-choice.}
- \def\AMC@loc@qf##1{\textbf{Quest\~ao ##1:}}
- \def\AMC@loc@q##1##2{\textbf{Quest\~ao ##1} ##2}
- \def\AMC@loc@corrected{Corrigido}
- \def\AMC@loc@catalog{Cat\'alogo}
- \def\AMC@loc@explain{\textit{\textbf{Justifique: }}}
- \def\AMC@loc@none{Nenhuma das respostas apresentadas est\'a correta.}
- \def\AMC@loc@question{Quest\~ao}
- \def\AMC@loc@questions{Quest\~oes}
-}
-\def\AMC@loc@ES{
- \def\AMC@loc@draft{BORRADOR}
- \def\AMC@loc@message{Para revisi\'on, preferentemente imprimir documentos compilados
- desde auto-multiple-choice.}
- \def\AMC@loc@qf##1{\textbf{Pregunta ##1 :}}
- \def\AMC@loc@q##1##2{\textbf{Pregunta ##1} ##2}
- \def\AMC@loc@corrected{Correcci\'on}
- \def\AMC@loc@catalog{Cat\'alogo}
- \def\AMC@loc@none{Ninguna de estas preguntas son correctas.}
- \def\AMC@loc@question{pregunta}
- \def\AMC@loc@questions{preguntas}
-}
-\def\AMC@loc@JA{
- \def\AMC@loc@draft{ドラフト}
- \def\AMC@loc@message{試験の実施には、auto-multiple-choiceでコンパイルされた文書を印刷してください。}
- \def\AMC@loc@qf##1{\textbf{問##1:}}
- \def\AMC@loc@q##1##2{\textbf{問##1} ##2}
- \def\AMC@loc@corrected{模範解答}
- \def\AMC@loc@catalog{問題カタログ}
- \def\AMC@loc@explain{\textit{\textbf{解説: }}}
- \def\AMC@loc@none{該当なし。}
- \def\AMC@loc@question{問}
- \def\AMC@loc@questions{問}
-}
-\AtBeginDocument{\@ifpackageloaded{cleveref}{%
- \crefalias{AMCquestionaff}{question}%
- \crefname{question}{\AMC@loc@question}{\AMC@loc@questions}%
-}{}}%
-\ifx\AMC@SR\undefined\newcount\AMC@SR\fi
-\providecommand\AMC@SRconst{2097152}
-\providecommand\AMC@SRset[1]{\global\AMC@SR#1 \ignorespaces}
-\providecommand\AMC@SRadvance{%
- \begingroup%
- \ifnum\AMC@SR<\AMC@SRconst\relax\AMC@SR@count\z@\else\AMC@SR@count\@ne\fi%
- \ifodd\AMC@SR\advance\AMC@SR@count\@ne\fi%
- \global\divide\AMC@SR\tw@%
- \ifodd\AMC@SR@count\global\advance\AMC@SR\AMC@SRconst\relax\fi%
- \endgroup}
-\providecommand\AMC@SRbit{\AMC@SRadvance\ifodd\AMC@SR1\else0\fi}
-\providecommand\AMC@SRtest[2]{\AMC@SRadvance%
- \ifodd\AMC@SR#2\else#1\fi\ignorespaces}
-\providecommand\AMC@SRvalue{\number\AMC@SR}
-\AMC@SRset{1515}
-\def\AMCrandomseed#1{\AMC@SRset{#1}}
-\newcount\AMC@SR@count
-\def\AMC@SR@time{\AMC@SRset{\time}}
-\newcount\AMC@SRnum
-\def\AMC@SRnextByte{\AMC@SRnum=\z@%
- \AMC@SR@count=20%
- \loop\multiply\AMC@SRnum\tw@%
- \AMC@SRtest{\advance\AMC@SRnum\@ne}{}%
- \ifnum\AMC@SR@count>\@ne\advance\AMC@SR@count\m@ne\repeat%
-}
-\newcommand\AMC@SRmax[1]{\AMC@SRnextByte%
- \AMC@SR@count=\AMC@SRnum%
- \divide\AMC@SR@count by #1\relax%
- \multiply\AMC@SR@count by #1\relax%
- \advance\AMC@SRnum by -\AMC@SR@count%
-}
-\newcount\AMC@sti
-\newcount\AMC@stil
-\newtoks\AMCsw@p@
-\newcommand\AMCsw@p[2]{%
- \global\AMCsw@p@=#1%
- \global#1=#2%
- \global#2=\AMCsw@p@}
-\newcommand{\AMC@shuffletoks}[3][\@ne]{%
- \AMC@sti=#2\relax%
- \AMC@stil=#2\relax%
- \advance\AMC@stil\@ne%
- \advance\AMC@stil -#1\relax%
- \@whilenum\AMC@sti>#1\do{%
- \AMC@SRmax{\AMC@stil}\advance\AMC@SRnum #1\relax%
- \AMCsw@p{\csname #3\romannumeral\AMC@SRnum\endcsname}%
- {\csname #3\romannumeral\AMC@sti\endcsname}%
- \advance\AMC@sti\m@ne\relax%
- \advance\AMC@stil\m@ne\relax%
- }}
-\newcount\AMC@numerotation\AMC@numerotation=\z@%
-\def\AMC@definitnumero#1#2{\AMC@amclog{AUTOQCM[NUM=#1=#2]^^J}%
- \expandafter\global\expandafter\def\csname AMC@numtab@#2\endcsname{#1}}
-\def\AMC@prepare#1{\expandafter\ifx\csname AMC@numtab@#1\endcsname\relax%
- \global\advance\AMC@numerotation\@ne%
- \expandafter\AMC@definitnumero\expandafter{\the\AMC@numerotation}{#1}\fi}
-\def\AMC@unnumero#1{\AMC@prepare{#1}\csname AMC@numtab@#1\endcsname}
-\def\AMC@affecte#1#2{\AMC@prepare{#1}\global#2=\csname AMC@numtab@#1\endcsname}
-\def\AMC@shapename@{\ifAMC@invisible none\else\AMC@shapename\fi}
-\def\AMC@tracepos#1#2{%
- \ifAMC@calibration\ifx\@empty#1\@empty\else%
- \pdfsavepos\protected@write\AMC@XYFILE{}{%
- \string\tracepos%
- {\the\AMCid@etud/\thepage:#2}%
- {\noexpand\number\pdflastxpos sp}%
- {\noexpand\number\pdflastypos sp}%
- {\AMC@shapename}}%
- \fi\fi}
-\def\AMC@traceposx#1#2{%
- \ifAMC@calibration\ifx\@empty#1\@empty\else%
- \pdfsavepos\protected@write\AMC@XYFILE{}{%
- \string\tracepos%
- {\the\AMCid@etud/\thepage:#2}%
- {\noexpand\number\pdflastxpos sp}%
- {0sp}%
- {\AMC@shapename}}%
- \fi\fi}
-\def\AMC@traceposy#1#2{%
- \ifAMC@calibration\ifx\@empty#1\@empty\else%
- \pdfsavepos\protected@write\AMC@XYFILE{}{%
- \string\tracepos%
- {\the\AMCid@etud/\thepage:#2}%
- {0sp}%
- {\noexpand\number\pdflastypos sp}%
- {\AMC@shapename}}%
-\fi\fi}
-\newcommand\AMC@tracebox[3]{%
- \vbox{\AMC@traceposy{#1}{#2}%
- \hbox{\AMC@traceposx{#1}{#2}#3\AMC@traceposx{#1}{#2}}%
- \AMC@traceposy{#1}{#2}}}
-\def\AMC@pagepos{%
- \ifAMC@calibration\protected@write\AMC@XYFILE{}{%
- \string\page%
- {\the\AMCid@etud/\thepage/\the\AMCid@check}%
- {\the\paperwidth}{\the\paperheight}}\fi}
-\newcommand{\AMCdontScan}{\ifAMC@calibration\immediate\write\AMC@XYFILE{\string\dontscan{\the\AMCid@etud,\the\AMCid@quest}}\fi}
-\newcommand{\AMCdontAnnotate}{\ifAMC@calibration\immediate\write\AMC@XYFILE{\string\dontannotate{\the\AMCid@etud,\the\AMCid@quest}}\fi}
-%% \end{macrocode}
-\newwrite\AMC@XYspecial
-\newwrite\AMC@tmpXY
-\newenvironment{amcxyfile}[1]{%
- \openout\AMC@XYspecial#1%
- \let\AMC@tmpXY=\AMC@XYFILE%
- \let\AMC@XYFILE=\AMC@XYspecial%
-}{\let\AMC@XYFILE=\AMC@tmpXY\closeout\AMC@XYspecial}
-\newcommand{\namefield}[1]{\AMC@tracebox{1}{nom}{#1}}
-\let\AMC@new@savebox=\newsavebox
-\let\AMC@save@box=\savebox
-\let\AMC@use@box=\usebox
-\newif\ifAMC@draw@cross
-\newcommand\AMC@setcolors@[2]{%
- \def\AMC@boxcolor@{\AMC@boxcolor}%
- \ifx\@empty#1\@empty \def\AMC@boxcolor@{black}\fi%
- \ifAMC@correc\def\AMC@boxcolor@{black}\fi%
- \def\AMC@fillcolor@{\ifx\@empty#2\@empty white\else\AMC@boxcolor@\fi}%
- \AMC@draw@crossfalse%
- \ifKV@AMCdim@cross\ifx\@empty#2\@empty\else\AMC@draw@crosstrue\fi\fi%
-}
-\newcommand\AMC@answerBox@[4]{%
- \AMC@LR{\hspace{0pt}%
- \lower\AMC@boxeddown\hbox{\csname AMC@shape@\AMC@shapename@\endcsname%
- {\AMCchoiceLabelFormat{#1}}{#2}{#3}{#4}}}%
-}
-\newcommand\AMC@shapeprepare@square{}
-\newcommand\AMC@shape@square[4]{%
- \fboxsep=\z@\fboxrule=\AMC@boxedrule%
- \AMC@setcolors@{#3}{#2}%
- \ifKV@AMCdim@cross\def\AMC@fillcolor@{white}\fi%
- \fcolorbox{\AMC@boxcolor@}{\AMC@fillcolor@}%
- {%
- \boxput*(0,0){%
- \ifAMC@draw@cross\AMC@crosschar\fi%
- }{%
- \vbox to \AMC@boxedheight{%
- \AMC@tracepos{#3}{#4}%
- \vfill%
- \hbox to \AMC@boxedwidth{\hfill%
- \textcolor{\AMC@boxcolor@}{#1}%
- \hfill}\vfill}}%
- \AMC@tracepos{#3}{#4}}%
-}
-\newcommand\AMC@makeovalbox[3]{%
- \AMC@setcolors@{#1}{#2}%
- \ifKV@AMCdim@cross\def\AMC@fillcolor@{white}\fi%
- \AMC@save@box{#3}{%
- \begin{tikzpicture}%
- \useasboundingbox (-0.5\AMC@boxedwidth-0.5\AMC@boxedrule,0.5\AMC@boxedheight+0.5\AMC@boxedrule)
- rectangle (0.5\AMC@boxedwidth+0.5\AMC@boxedrule,-0.5\AMC@boxedheight-0.5\AMC@boxedrule);
- \draw[\AMC@boxcolor@,fill=\AMC@fillcolor@,line width=\AMC@boxedrule,rounded corners=\AMC@oval@radius]
- (-0.5\AMC@boxedwidth,0.5\AMC@boxedheight)
- rectangle (0.5\AMC@boxedwidth,-0.5\AMC@boxedheight);
- \ifAMC@draw@cross
- \draw[\AMC@boxcolor@,line width=\AMC@crossrule]
- (-0.5\AMC@boxedwidth,0.5\AMC@boxedheight) -- (0.5\AMC@boxedwidth,-0.5\AMC@boxedheight)
- (0.5\AMC@boxedwidth,0.5\AMC@boxedheight) -- (-0.5\AMC@boxedwidth,-0.5\AMC@boxedheight);
- \fi
- \end{tikzpicture}}%
-}
-\newcommand\AMC@shapeprepare@oval{%
- \AMC@makeovalbox{1}{}{\AMC@ovalbox@R}%
- \AMC@makeovalbox{1}{1}{\AMC@ovalbox@RF}%
- \AMC@makeovalbox{}{}{\AMC@ovalbox@}%
- \AMC@makeovalbox{}{1}{\AMC@ovalbox@F}%
-}
-\newcommand\AMC@shape@oval[4]{%
- \AMC@setcolors@{#3}{#2}%
- \AMC@tracebox{#3}{#4}{\boxput*(0,0){\textcolor{\AMC@boxcolor@}{#1}}{%
- \ifx\@empty#3\@empty%
- \ifx\@empty#2\@empty%
- \AMC@use@box{\AMC@ovalbox@}%
- \else%
- \AMC@use@box{\AMC@ovalbox@F}%
- \fi%
- \else%
- \ifx\@empty#2\@empty%
- \AMC@use@box{\AMC@ovalbox@R}%
- \else%
- \AMC@use@box{\AMC@ovalbox@RF}%
- \fi%
- \fi%
- }}%
-}
-\newcommand\AMC@shapeprepare@none{}
-\newcommand\AMC@shape@none[4]{ #1 }
-\def\AMCchoiceLabel#1{%
- \ifAMC@inside@digit\arabic{#1}%
- \else\Alph{#1}\fi%
-}
-\def\AMCchoiceLabelFormat#1{#1}
-\newcounter{AMC@ncase}
-\setcounter{AMC@ncase}{0}
-\newcommand\AMC@answerBox[4]{%
- \AMC@answerBox@{\ifx\@empty#1\@empty%
- \AMCchoiceLabel{AMC@ncase}%
- \else #1\fi}{#2}{#3}{#4}}
-\newlength\AMC@boxedrule
-\newlength\AMC@crossrule
-\newlength\AMC@boxeddown
-\newlength\AMC@boxedwidth
-\newlength\AMC@boxedheight
-\newlength\AMC@oval@radius
-\newlength\AMC@outside@sep
-\define@choicekey{AMCdim}{shape}{square,oval,none}{\def\AMC@shapename{#1}}
-\define@key{AMCdim}{size}{\AMC@boxedwidth=#1\AMC@boxedheight=#1}
-\define@key{AMCdim}{height}{\AMC@boxedheight=#1}
-\define@key{AMCdim}{width}{\AMC@boxedwidth=#1}
-\define@key{AMCdim}{rule}{\AMC@boxedrule=#1}
-\define@key{AMCdim}{outsidesep}{\AMC@outside@sep=#1}
-\define@key{AMCdim}{down}{\AMC@boxeddown=#1}
-\define@key{AMCdim}{color}{\def\AMC@boxcolor{#1}}
-\define@boolkey{AMCdim}{cross}[false]{}
-\define@key{AMCdim}{crosschar}[\textbf{\textsf{X}}]{\def\AMC@crosschar{#1}}
-\define@key{AMCdim}{crossrule}[1.5pt]{\AMC@crossrule=#1}
-\def\AMCboxStyle#1{%
- \setkeys{AMCdim}{#1}%
- \ifnum\AMC@boxedwidth<\AMC@boxedheight%
- \AMC@oval@radius=\AMC@boxedwidth\divide\AMC@oval@radius\tw@%
- \else%
- \AMC@oval@radius=\AMC@boxedheight\divide\AMC@oval@radius\tw@%
- \fi%
- \csname AMC@shapeprepare@\AMC@shapename@ \endcsname%
-}
-\AMCboxStyle{shape=square,size=2.5ex,down=.4ex,rule=.5pt,outsidesep=.1em,color=black,cross,crosschar,crossrule}
-\newcommand\AMCboxColor[1]{\AMCboxStyle{color=#1}}
-\let\AMCboxDimensions=\AMCboxStyle
-\def\AMCoutsideLabelFormat#1{#1}
-\newcommand\AMCboxOutsideLetter[2]{#1\nobreak\hspace{.1em}\AMCoutsideLabelFormat{#2}}
-\newcommand\AMC@formBox@[4]{%
- \ifAMC@outside@box% letter to be written outside the box
- \AMCboxOutsideLetter{\AMC@answerBox@{}{#2}{#3}{#4}}{#1}%
- \else%
- \AMC@answerBox@{#1}{#2}{#3}{#4}%
- \fi%
-}
-\newcommand\AMC@formBox[4]{%
- \AMC@formBox@{\ifx\@empty#1\@empty%
- \AMCchoiceLabel{AMC@ncase}%
- \else #1\fi}{#2}{#3}{#4}%
-}
-\newcommand{\AMC@box}[2]{%
- \ifAMC@ensemble%
- \ifAMC@zoneformulaire% for codes inside form sheet
- \protect\AMC@formBox{#1}{#2}{1}{case:\AMCid@name:\the\AMCid@quest,\the\AMCrep@count}%
- \else%
- \ifAMCformulaire@dedans% for answer boxes inside form sheet
- \protect\AMC@formBox{#1}{#2}{1}{case:\AMCid@name:\the\AMCid@quest,\the\AMCrep@count}%
- \else% outside form sheet: not to be read during data capture
- \AMC@answerBox{#1}{#2}{1}{casequestion:\AMCid@name:\the\AMCid@quest,\the\AMCrep@count}%
- \fi\fi%
- \else% no separate sheet for answers: always read
- \ifAMC@inside@box%
- \AMC@answerBox{#1}{#2}{1}{case:\AMCid@name:\the\AMCid@quest,\the\AMCrep@count}%
- \else%
- \AMC@answerBox@{}{#2}{1}{case:\AMCid@name:\the\AMCid@quest,\the\AMCrep@count}%
- \fi%
- \fi%
-}
-\newif\ifAMCsz@logged\AMCsz@loggedfalse
-\newcommand{\AMCscoreZone}[1]{%
- \ifAMC@ensemble%
- \ifAMCformulaire@dedans%
- \AMC@tracebox{1}{score::\the\AMCid@quest,-1}{#1}%
- \else%
- \AMC@tracebox{1}{scorequestion::\the\AMCid@quest,-1}{#1}%
- \fi%
- \else%
- \AMC@tracebox{1}{score::\the\AMCid@quest,-1}{#1}%
- \fi%
- \ifAMCsz@logged\else%
- \AMC@amclog{AUTOQCM[VAR:scorezones=1]^^J}%
- \global\AMCsz@loggedtrue%
- \fi%
-}
-\def\AMCid@checkmax{60}
-\def\AMC@NCBetud{12}
-\def\AMC@NCBpage{6}
-\def\AMC@NCBcheck{6}
-\newlength{\AMC@CBtaille}\setlength{\AMC@CBtaille}{5cm}
-\def\AMC@premierecopie{1}
-\newtoks\AMCbin@sequence
-\newcount\AMCbin@number
-\newcount\AMCbin@ndigits
-\newcount\AMCbin@id
-\newcount\AMCbin@digit
-\def\AMCbin@one{\advance\AMCbin@digit\@ne%
- \AMC@answerBox@{}{1}{1}{chiffre:\the\AMCbin@id,\the\AMCbin@digit}}
-\def\AMCbin@zero{\advance\AMCbin@digit\@ne%
- \AMC@answerBox@{}{}{1}{chiffre:\the\AMCbin@id,\the\AMCbin@digit}}
-\def\AMCbin@begin#1{\AMCbin@id=#1\AMCbin@digit=\z@}
-\newcommand{\AMC@binaryBoxes}[2][1]{%
-{\AMCboxDimensions{shape=square,size=.32cm,down=0pt,rule=.2pt,cross=false}\AMCbin@sequence={}\AMCbin@number=#2\relax%
-\AMCbin@ndigits=\z@%
-\loop%
-\ifnum\AMCbin@number>\z@%
-\advance\AMCbin@ndigits\@ne%
-\ifodd\AMCbin@number\AMCbin@sequence=\expandafter{\expandafter\AMCbin@one\the\AMCbin@sequence}%
-\else\AMCbin@sequence=\expandafter{\expandafter\AMCbin@zero\the\AMCbin@sequence}\fi%
-\divide\AMCbin@number\tw@%
-\repeat%
-\loop\relax%
-\ifnum\AMCbin@ndigits<#1\advance\AMCbin@ndigits\@ne%
-\AMCbin@sequence=\expandafter{\expandafter\AMCbin@zero\the\AMCbin@sequence}\repeat%
-\the\AMCbin@sequence%
-\ifnum\AMCbin@ndigits>#1\PackageError{automultiplechoice}{Too low AMC@NCB value (got #1 but needs \the\AMCbin@ndigits)}{Number of available digits is #1, but needs \the\AMCbin@ndigits}\fi%
-}}
-\def\AMCcurrentenv{document}
-\def\AMCif@env#1{
- \def\AMC@tempenv{#1}%
- \ifx\AMC@tempenv\AMCcurrentenv
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi
-}
-\newcount\AMCtok@k
-\newcount\AMCtok@max
-\newcount\AMCtok@size
-\newcommand{\nouveaugroupe}[2]{%
- \expandafter\ifx\csname #1@k\endcsname\relax%
- \expandafter\newcount\csname #1@k\endcsname%
- \expandafter\newcount\csname AMC#1@j\endcsname%
- \csname #1@k\endcsname=\z@\relax%
- \csname AMC#1@j\endcsname=\z@\relax%
- \setgroupmode{#1}{\AMCdefault@groupmode}%
- \fi%
-}
-\newcommand\AMC@prepare@element[1]{%
- \nouveaugroupe{#1}{}%
- \global\advance\csname #1@k\endcsname\@ne\relax%
- \AMCtok@k=\csname #1@k\endcsname%
- \expandafter\ifx\csname #1@\romannumeral\AMCtok@k\endcsname\relax%
- \expandafter\newtoks\csname #1@\romannumeral\AMCtok@k\endcsname\fi%
-}
-\newcommand{\element}[2]{%
- \AMC@prepare@element{#1}%
- \csname #1@\romannumeral\AMCtok@k\endcsname={#2}%
-}
-\def\AMCdefault@groupmode{fixed}
-\newcommand{\setdefaultgroupmode}[1]{\def\AMCdefault@groupmode{#1}}
-\newcommand{\setgroupmode}[2]{%
- \expandafter\ifx\csname AMCgrouppre@#2\endcsname\relax%
- \PackageError{automultiplechoice}{Unknown group mode for #1 : #2}%
- {You asked to set group '#1' mode to '#2',
- but '#2' is not a valid group mode}%
- \else%
- \expandafter\global\expandafter\def\csname AMC#1@mode\endcsname{#2}%
- \fi%
-}
-\newcommand{\AMCgrouppre@fixed}[3]{%
- \ifnum#3<\z@%
- \csname AMC#1@j\endcsname=\z@%
- \else%
- \csname AMC#1@j\endcsname=#3%
- \fi%
-}
-\newcommand{\AMCgrouppre@withreplacement}[3]{%
- \ifnum#3<\z@%
- \csname AMC#1@j\endcsname=\z@%
- \else%
- \csname AMC#1@j\endcsname=#3%
- \fi%
- \shufflegroup{#1}%
-}
-\newcount\AMC@imax
-\newcommand{\AMCgrouppre@withoutreplacement}[3]{%
- \ifnum#3<\z@%
- \else%
- \csname AMC#1@j\endcsname=#3%
- \fi%
- \ifnum\AMCtok@ik=\AMCloop@k%
- \AMCtok@ik=\z@%
- \fi%
- \ifnum\AMCtok@ik=\z@%
- \shufflegroup{#1}%
- \else%
- \AMC@imax=\AMCloop@k%
- \advance\AMC@imax -#2\relax%
- \ifnum\AMCtok@ik>\AMC@imax%
- \shufflegroupslice{#1}{\@ne}{\AMCtok@ik}%
- \ifnum\AMCtok@ik<\AMCloop@k%
- \advance\AMCtok@ik\@ne%
- \shufflegroupslice{#1}{\AMCtok@ik}{\AMCloop@k}%
- \fi%
- \fi%
- \fi%
-}
-\newcommand{\AMCgrouppre@cyclic}[3]{%
- \ifnum#3<\z@%
- \else%
- \csname AMC#1@j\endcsname=#3%
- \fi%
-}
-\newcommand{\AMCgroup@pre}[4]{%
- \csname AMCgrouppre@#1\endcsname{#2}{#3}{#4}%
-}
-\newcommand{\shufflegroup}[1]{%
- \ifAMC@shuffleG{\AMC@shuffletoks{\number\csname #1@k\endcsname}{#1@}}\fi%
-}
-\newcommand{\shufflegroupslice}[3]{%
- \ifAMC@shuffleG{\AMC@shuffletoks[#2]{#3}{#1@}}\fi%
-}
-\newcount\AMCtok@ik
-\newcount\AMCloop@k
-\newcommand{\AMCgrouploop@prep}[3]{%
- \AMCtok@size=#1\relax%
- \ifAMC@fullGroups\AMCtok@size=\z@\fi%
- \ifnum\AMCtok@size<\@ne%
- \AMCtok@size=\csname #2@k\endcsname%
- \fi%
- \AMCtok@ik=\csname AMC#2@j\endcsname%
- \AMCloop@k=\csname #2@k\endcsname%
- \expandafter\ifx\csname AMC#2@mode\endcsname\relax%
- \PackageError{automultiplechoice}{No group mode for #2}%
- {No mode has been defined for group '#2'. This should not occur...}%
- \fi%
- \AMCgroup@pre{\csname AMC#2@mode\endcsname}{#2}{\the\AMCtok@size}{#3}%
-}
-\newcommand{\AMCgrouploop@next}[1]{%
- \global\advance\csname AMC#1@j\endcsname\@ne\relax%
- \expandafter\ifnum\csname AMC#1@j\endcsname>\AMCloop@k\relax%
- \global\csname AMC#1@j\endcsname=\@ne%
- \fi%
- \AMCtok@ik=\csname AMC#1@j\endcsname%
- \advance\AMCtok@size\m@ne%
-}
-\newcommand{\insertgroupfrom}[3][0]{%
- \AMCgrouploop@prep{#1}{#2}{#3}%
- {\loop%
- \AMCgrouploop@next{#2}%
- {\the\csname #2@\romannumeral\AMCtok@ik\endcsname}%
- \ifnum\AMCtok@size>\z@\repeat}%
-}
-\newcommand{\insertgroup}[2][0]{%
- \insertgroupfrom[#1]{#2}{-1}%
-}
-\newcommand{\cleargroup}[1]{%
- \nouveaugroupe{#1}{}%
- \csname #1@k\endcsname=\z@\relax%
- \csname AMC#1@j\endcsname=\z@\relax%
-}
-\newcommand{\copygroupfrom}[4][0]{%
- \AMCgrouploop@prep{#1}{#2}{#4}%
- {\loop%
- \AMCgrouploop@next{#2}%
- \AMC@prepare@element{#3}%
- \global\csname #3@\romannumeral\AMCtok@k\endcsname=\csname #2@\romannumeral\AMCtok@ik\endcsname%
- \ifnum\AMCtok@size>\z@\repeat}%
-}
-\newcommand{\copygroup}[3][0]{%
- \copygroupfrom[#1]{#2}{#3}{-1}%
-}
-\newcount\AMCrep@count
-\AMCload@counter=199
-\@whilenum\AMCload@counter>0\do{%
- \expandafter\newtoks\csname reponse@\romannumeral\AMCload@counter\endcsname%
- \advance\AMCload@counter\m@ne%
-}
-\newcommand\AMCload@reponse[2]{%
- \advance\AMCload@counter\@ne\relax%
- \csname reponse@\romannumeral\AMCload@counter\endcsname%
- =\expandafter{\expandafter\AMCrep@count\expandafter=#2 #1}%
-}
-\newcommand\AMCrien@deux[2]{#1}
-\def\shuffle@it{\AMC@shuffletoks{\number\AMCload@counter}{reponse@}}
-\newcount\AMCnum@questions
-\newcommand\AMCdump@reponses{%
- \global\AMCnum@questions=\AMCload@counter%
- \@whilenum\AMCload@counter>0\do{%
- \the\csname reponse@\romannumeral\AMCload@counter\endcsname%
- \advance\AMCload@counter\m@ne}}
-\newcommand\AMCrep@init[1]{%
- \ifAMC@ordre\AMCrep@o\else%
- \csname AMCrep@#1\endcsname\fi\AMCload@counter=\z@}
-\newcommand\AMCrep@o{%
- \def\AMCload@@reponse{\AMCrien@deux}\def\AMCrep@fini{}}
-\newcommand\AMCrep@r{%
- \def\AMCload@@reponse{\AMCload@reponse}%
- \def\AMCrep@fini{\shuffle@it\AMCdump@reponses}}
-\newcount\AMCrep@@count
-\newcommand\lastchoices{%
- \AMCrep@@count=\AMCrep@count%
- \AMCrep@fini\AMCrep@init{o}%
- \AMCrep@count=\AMCrep@@count}
-\newcommand\@aucune{\emph{\AMC@loc@none}}
-\newcommand\AMC@fin@rep{%
- \ifAMCcomplete@multi\ifAMCtype@multi%
- \lastchoices\AMCrep@count=-1%
- \ifAMCune@bonne\wrongchoice{\@aucune}\else%
- \ifAMC@postcorrect\wrongchoice{\@aucune}\else\correctchoice{\@aucune}\fi%
- \fi\fi\fi\AMCrep@fini}
-\def\AMCmem@ireData{}
-\def\AMCformBeforeQuestion{\vspace{\AMCformVSpace}\par}
-\def\AMCformAfterQuestion{\ifAMC@asqbloc\egroup\fi}
-\def\AMCformQuestion#1{{\AMC@loc@qf{#1}}}
-\def\AMCformQuestionA#1#2{\setcounter{AMCquestionaff}{#1}%
- \AMCid@quest=#2%
- \setcounter{AMC@ncase}{0}%
- \AMCformBeforeQuestion%
- \ifAMC@asqbloc\vbox\bgroup\fi%
- \ifx\@empty\AMC@sza@callout\@empty\else%
- \csname\AMC@sza@callout\endcsname%
- \fi%
- \AMCformQuestion{#1}%
- \ifx\@empty\AMC@sza@callin\@empty\else%
- \csname\AMC@sza@callin\endcsname%
- \fi%
-}
-\def\AMCformAnswer#1{\hspace{\AMCformHSpace} #1}
-\def\AMCformAnswerA#1{\addtocounter{AMC@ncase}{1}\AMCformAnswer{#1}}
-\newcommand\AMCmem@ireAJ[1]{%
- \ifAMC@ensemble\ifAMC@zoneformulaire\else%
- \begingroup\AMCformulaire@dedanstrue%
- \let\protect\@unexpandable@protect%
- \global\edef\AMCmem@ireData{\AMCmem@ireData #1}%
- \endgroup\fi\fi}
-\newcommand\AMCmem@ireAJRep[1]{%
- \addtocounter{AMC@ncase}{1}\AMCmem@ireAJ{\protect\AMCformAnswerA{#1}}}
-\newcommand\AMCmem@ireQ[2]{\AMCmem@ireAJ{\protect\AMCformQuestionA{#1}{#2}}}
-\def\AMCformBegin{%
- \AMC@zoneformulairetrue\setcounter{section}{0}%
- \ifAMC@ensemble\ifAMC@automarks\pagestyle{AMCpageFull}\fi\fi%
-}
-\newcommand\AMCform{%
- \ifAMC@ensemble\AMCformulaire@dedanstrue\AMCmem@ireData%
- \global\def\AMCmem@ireData{}\fi}
-\newcommand\AMCformS{%
- \ifAMC@ensemble\AMCformulaire@dedanstrue%
- \AMC@amclog{AUTOQCM[BR=0]^^J}\AMCmem@ireData%
- \fi}
-\newcommand{\AMCsection}[1]{\section{#1}\AMCmem@ireAJ{\protect\section{#1}}}
-\newcommand{\AMCsubsection}[1]{\subsection{#1}\AMCmem@ireAJ{\protect\subsection{#1}}}
-\def\AMCBoxedAnswers{\AMC@rbloctrue}
-\newenvironment{choices}[1][r]{%
- \AMCrep@count=\z@\def\une@rep{\AMCrep@itemize}%
- \ifAMC@rbloc\def\une@rep{\AMCrep@bloc}%
- \else\begin{itemize}\setlength{\itemsep}{\AMCinterIrep}\fi%
- \AMCrep@init{#1}}%
- {\AMC@fin@rep\ifAMC@rbloc\else\end{itemize}\fi}
-\newenvironment{choiceshoriz}[1][r]{%
- \AMCrep@count=\z@\def\une@rep{\AMCrep@ligne}\AMCrep@init{#1}%
- \par\begin{center}}%
- {\AMC@fin@rep\end{center}}
-\newenvironment{choicescustom}[1][r]{%
- \AMCrep@count=\z@\def\une@rep{\AMCrep@perso}\AMCrep@init{#1}%
- \AMCbeginAnswer\ignorespaces}%
- {\AMC@fin@rep\AMCendAnswer}
-\newcommand\AMCrep@bloc[2]{\AMCmem@ireAJRep{#1}%
- \par\noindent\begin{minipage}{\linewidth}%
- \begin{itemize}\item[#1] #2\end{itemize}\end{minipage}%
- \vspace{\AMCinterBrep}}
-\newcommand\AMCrep@itemize[2]{\AMCmem@ireAJRep{#1}\item[#1] #2}
-\newcommand\AMCrep@ligne[2]{\AMCmem@ireAJRep{#1}%
- \mbox{#1\hspace*{1em}#2}\hspace{3em plus 4em}}
-\newcommand\AMCrep@perso[2]{\AMCmem@ireAJRep{#1}\AMCanswer{#1}{#2}}
-\def\AMCbeginAnswer{}
-\def\AMCanswer#1#2{#1 #2}
-\def\AMCendAnswer{}
-\newcommand{\correctchoice}[2][]{\global\advance\AMCrep@count\@ne\relax%
- \ifAMC@calibration\AMC@amclog{AUTOQCM[REP=\the\AMCrep@count:B]^^J}\fi%
- \global\AMCune@bonnetrue%
- \AMCload@@reponse{\une@rep{\ifAMC@correc\AMC@box{#1}{1}%
- \else\AMC@box{#1}{}\fi}{#2}}{\the\AMCrep@count}\ignorespaces}
-\newcommand{\wrongchoice}[2][]{\global\advance\AMCrep@count\@ne\relax%
- \ifAMC@calibration\AMC@amclog{AUTOQCM[REP=\the\AMCrep@count:M]^^J}\fi%
- \AMCload@@reponse{\une@rep{\AMC@box{#1}{}}{#2}}{\the\AMCrep@count}%
- \ignorespaces}
-\newcommand{\AMCemptybox}[3]{{%
- \sbox0{}\wd0=#1\ht0=#2\dp0=#3\relax\box0}}
-\newlength\AMC@mn@test
-\newlength\AMC@mn@sep\AMC@mn@sep=4mm
-\newlength\AMC@mn@leftmargin
-\newlength\AMC@mn@rightmargin
-\newcommand\AMCmarginNote[1]{%
- \begin{tikzpicture}[remember picture,overlay]%
- \coordinate (here) at (0,0);%
- \pgfextractx{\AMC@mn@test}{\pgfpointdiff{\pgfpointorigin}%
- {\pgfpointanchor{current page}{center}}}%
- \ifodd\thepage%
- \AMC@mn@leftmargin=\oddsidemargin%
- \AMC@mn@rightmargin=\evensidemargin%
- \else
- \AMC@mn@leftmargin=\evensidemargin%
- \AMC@mn@rightmargin=\oddsidemargin%
- \fi
- \ifdim\AMC@mn@test < 1cm%
- \draw (current page.east |- here)+(-\AMC@mn@rightmargin-1in+\AMC@mn@sep,0pt) node[anchor=text,align=left,text width=\AMC@mn@rightmargin+1in-\AMC@mn@sep]{\strut #1};%
- \else%
- \draw (current page.west |- here)+(0cm,0pt) node[anchor=text,align=right,text width=\AMC@mn@leftmargin+1in-\AMC@mn@sep]{\strut #1};%
- \fi%
- \end{tikzpicture}%
-}
-\newcommand{\AMC@sz@box}{\AMCemptybox{\AMC@sz@width}{\AMC@sz@height}{\AMC@sz@depth}}
-\newcommand{\AMC@sz@callin@question}{\AMCscoreZone{\AMC@sz@box}}
-\newcommand{\AMC@sz@callout@margin}{\hspace{0pt}\marginpar{\AMCscoreZone{\AMC@sz@box}}}
-\newcommand{\AMC@sz@init@margins}{\PackageWarning{automultiplechoice}{Please run twice to get proper margin notes position.}}
-\newcommand{\AMC@sz@callout@margins}{\hspace{0pt}\AMCmarginNote{\AMCscoreZone{\AMC@sz@box}}}
-\newlength\AMC@sz@width
-\newlength\AMC@sz@height
-\newlength\AMC@sz@depth
-\def\AMC@sz@callout{}
-\def\AMC@sz@callin{}
-\define@key{AMCsz}{width}{\AMC@sz@width=#1}
-\define@key{AMCsz}{height}{\AMC@sz@height=#1}
-\define@key{AMCsz}{depth}{\AMC@sz@depth=#1}
-\define@key{AMCsz}{calloutside}{\def\AMC@sz@callout{#1}}
-\define@key{AMCsz}{callinside}{\def\AMC@sz@callin{#1}}
-\define@choicekey{AMCsz}{position}{none,question,margin,margins}{%
- \ifcsname AMC@sz@callout@#1\endcsname%
- \def\AMC@sz@callout{AMC@sz@callout@#1}%
- \else%
- \def\AMC@sz@callout{}%
- \fi%
- \ifcsname AMC@sz@callin@#1\endcsname%
- \def\AMC@sz@callin{AMC@sz@callin@#1}%
- \else%
- \def\AMC@sz@callin{}%
- \fi%
- \ifcsname AMC@sz@init@#1\endcsname%
- \csname AMC@sz@init@#1\endcsname%
- \fi%
-}
-\newcommand{\AMCsetScoreZone}[1]{\setkeys{AMCsz}{#1}}
-\AMCsetScoreZone{width=1.5em,height=1.5ex,depth=.5ex,position=none}
-\newcommand{\AMC@sza@box}{\AMCemptybox{\AMC@sza@width}{\AMC@sza@height}{\AMC@sza@depth}}
-\newcommand{\AMC@sza@init@none}{}
-\newcommand{\AMC@sza@callout@none}{}
-\newcommand{\AMC@sza@callin@none}{}
-\newcommand{\AMC@sza@init@question}{}
-\newcommand{\AMC@sza@callout@question}{}
-\newcommand{\AMC@sza@callin@question}{\AMCscoreZone{\AMC@sza@box}}
-\newcommand{\AMC@sza@init@margin}{}
-\newcommand{\AMC@sza@callout@margin}{\hspace{0pt}\marginpar{\AMCscoreZone{\AMC@sza@box}}}
-\newcommand{\AMC@sza@callin@margin}{}
-\newcommand{\AMC@sza@init@margins}{\PackageWarning{automultiplechoice}{Please run twice to get proper margin notes position.}}
-\newcommand{\AMC@sza@callout@margins}{\hspace{0pt}\AMCmarginNote{\AMCscoreZone{\AMC@sz@box}}}
-\newcommand{\AMC@sza@callin@margins}{}
-\newlength\AMC@sza@width
-\newlength\AMC@sza@height
-\newlength\AMC@sza@depth
-\def\AMC@sza@callout{}
-\def\AMC@sza@callin{}
-\define@key{AMCsza}{width}{\AMC@sza@width=#1}
-\define@key{AMCsza}{height}{\AMC@sza@height=#1}
-\define@key{AMCsza}{depth}{\AMC@sza@depth=#1}
-\define@key{AMCsza}{calloutside}{\def\AMC@sza@callout{#1}}
-\define@key{AMCsza}{callinside}{\def\AMC@sza@callin{#1}}
-\define@choicekey{AMCsza}{position}{none,question,margin,margins}{%
- \ifcsname AMC@sza@callout@#1\endcsname%
- \def\AMC@sza@callout{AMC@sza@callout@#1}%
- \else%
- \def\AMC@sza@callout{}%
- \fi%
- \ifcsname AMC@sza@callin@#1\endcsname%
- \def\AMC@sza@callin{AMC@sza@callin@#1}%
- \else%
- \def\AMC@sza@callin{}%
- \fi%
- \ifcsname AMC@sza@init@#1\endcsname%
- \csname AMC@sza@init@#1\endcsname%
- \fi%
-}
-\newcommand{\AMCsetScoreZoneAnswerSheet}[1]{\setkeys{AMCsza}{#1}}
-\AMCsetScoreZoneAnswerSheet{width=1.5em,height=1.5ex,depth=.5ex,position=none}
-\newcommand{\AMCnoScoreZone}{\AMCsetScoreZone{position=none}\AMCsetScoreZoneAnswerSheet{position=none}}
-\newcounter{AMCquestionaff}
-\newcommand{\AMCnumero}[1]{\setcounter{AMCquestionaff}{#1}\addtocounter{AMCquestionaff}{-1}}
-\newcommand\AMC@stepQuestion{\ifAMCquestionNumber\refstepcounter{AMCquestionaff}\fi}
-\newcommand\AMC@qaff{\arabic{AMCquestionaff}}
-\def\AMCbeforeQuestion{\ifAMC@qbloc\else\par\noindent\fi}
-\def\AMCbeginQuestion#1#2{\noindent\AMC@loc@q{#1}{#2}%
- \ifx\@empty\AMC@sz@callin\@empty\hspace*{1em}\fi%
-}
-\def\multiSymbole{$\clubsuit$}
-\ifx\question\undefined\else\let\question\undefined\fi
-\def\AMCnobloc{\AMC@qblocfalse}
-\def\AMCbloc{\AMC@qbloctrue}
-\newenvironment{question}[2][]{%
- \def\AMCcurrentenv{question}%
- \AMC@stepQuestion%
- \global\def\AMCid@name{#2}\AMC@affecte{#2}{\AMCid@quest}%
- \ifAMC@calibration\AMCmessage{Q=\the\AMCid@quest}\fi%
- \AMCbeforeQuestion%
- \ifx\@empty\AMC@sz@callout\@empty\else%
- \csname\AMC@sz@callout\endcsname%
- \fi%
- \AMCtype@multifalse\ifAMC@qbloc\noindent\begin{minipage}{\linewidth}\fi%
- \ifAMC@affichekeys\index{\texttt{#2}}\fi%
- \AMCbeginQuestion{\ifAMC@affichekeys\ifAMC@ensemble\AMC@qaff\ \fi[\texttt{#2}]\else\AMC@qaff\fi}{#1}%
- \ifx\@empty\AMC@sz@callin\@empty\else%
- \csname\AMC@sz@callin\endcsname%
- \fi%
- \AMCformulaire@dedansfalse\setcounter{AMC@ncase}{0}%
- \AMCmem@ireQ{\arabic{AMCquestionaff}}{\the\AMCid@quest}}%
-{\ifAMC@qbloc\end{minipage}\vspace{\AMCinterBquest}\else\vspace{\AMCinterIquest}\fi\AMCmessage{FQ}\AMCmem@ireAJ{\AMCformAfterQuestion}}
-\newenvironment{questionmult}[1]{%
- \AMCune@bonnefalse\begin{question}[{{\multiSymbole}}]{#1}%
- \AMCtype@multitrue\ifAMC@calibration%
- \AMC@amclog{AUTOQCM[MULT]^^J}\fi}%
-{\end{question}}
-\newenvironment{questionmultx}[1]{%
- \begingroup\def\multiSymbole{}\begin{questionmult}{#1}}%
-{\end{questionmult}\endgroup}
-\newdimen\ouverte@vs
-\newenvironment{questionouverte}[1][3cm]{%
- \AMC@stepQuestion%
- \AMCtype@multifalse\ouverte@vs=#1%
- \ifAMC@qbloc\noindent\begin{minipage}{\linewidth}\fi%
- \AMCbeginQuestion{\AMC@qaff}{}}%
-{\vspace*{\ouverte@vs}\ifAMC@qbloc\end{minipage}\vspace{3ex}\fi}
-\newcommand{\explain}[1]{%
-\ifAMC@correchead%
- \AMCif@env{question}{\par\noindent{\AMC@loc@explain #1}}{\AMC@error@explain}\vspace{1ex}%
-\else%
- \AMCif@env{question}{}{\AMC@error@explain}%
-\fi%
-}
-\def\scoring#1{\ifAMC@calibration\AMC@amclog{AUTOQCM[B=#1]^^J}\fi}
-\def\scoringDefaultS#1{\ifAMC@calibration\AMC@amclog{AUTOQCM[BDS=#1]^^J}\fi}
-\def\scoringDefaultM#1{\ifAMC@calibration\AMC@amclog{AUTOQCM[BDM=#1]^^J}\fi}
-\def\QuestionIndicative{\ifAMC@calibration\AMC@amclog{AUTOQCM[INDIC]^^J}\fi}
-\newcount\AMC@chiffres
-\newdimen\AMCcodeHspace\AMCcodeHspace=.5em
-\newdimen\AMCcodeVspace\AMCcodeVspace=.5em
-\newcommand{\AMCcode}[2]{%
-{\def\AMCbeginQuestion##1##2{}\def\AMCbeforeQuestion{}\AMCnoScoreZone%
- \AMCquestionNumberfalse%
- \setlength{\parindent}{0pt}%
- \def\AMCbeginAnswer{\hspace{0pt}%
- \vbox\bgroup}%
- \def\AMCendAnswer{\vspace{-\AMCcodeVspace}\egroup%
- \hspace{\AMCcodeHspace}}%
- \def\AMCanswer##1##2{\hbox{\ifAMC@ensemble ##1\else%
- \ifAMC@inside@box ##1\else{\AMCboxOutsideLetter{##1}{##2}}\fi\fi\hspace*{\fill}}%
- \vspace{\AMCcodeVspace}}%
- \AMCnobloc%
- \AMC@chiffres=#2\loop%
- \begin{question}{#1[\the\AMC@chiffres]}\QuestionIndicative%
- \begin{choicescustom}[o]\scoring{auto=0}%
- \wrongchoice[0]{0}%
- \wrongchoice[1]{1}%
- \wrongchoice[2]{2}%
- \wrongchoice[3]{3}%
- \wrongchoice[4]{4}%
- \wrongchoice[5]{5}%
- \wrongchoice[6]{6}%
- \wrongchoice[7]{7}%
- \wrongchoice[8]{8}%
- \wrongchoice[9]{9}%
- \end{choicescustom}%
- \end{question}%
- \advance\AMC@chiffres\m@ne\ifnum\AMC@chiffres>0\repeat%
- \hspace{-\AMCcodeHspace}%
-}}
-\newcommand{\AMCcodeH}[2]{%
-{\def\AMCbeginQuestion##1##2{}\def\AMCbeforeQuestion{}\AMCnoScoreZone%
- \AMCquestionNumberfalse%
- \setlength{\parindent}{0pt}%
- \def\AMCbeginAnswer{\hbox\bgroup}%
- \def\AMCendAnswer{\egroup\vspace{\AMCcodeVspace}\par}%
- \def\AMCanswer##1##2{\hbox{\ifAMC@ensemble ##1\else%
- \ifAMC@inside@box ##1\else{\AMCboxOutsideLetter{##1}{##2}}\fi\fi}%
- \hspace{\AMCcodeHspace}}%
- \AMCnobloc%
- \AMC@chiffres=#2\loop%
- \begin{question}{#1[\the\AMC@chiffres]}\QuestionIndicative%
- \begin{choicescustom}[o]\scoring{auto=0}%
- \wrongchoice[0]{0}%
- \wrongchoice[1]{1}%
- \wrongchoice[2]{2}%
- \wrongchoice[3]{3}%
- \wrongchoice[4]{4}%
- \wrongchoice[5]{5}%
- \wrongchoice[6]{6}%
- \wrongchoice[7]{7}%
- \wrongchoice[8]{8}%
- \wrongchoice[9]{9}%
- \end{choicescustom}%
- \end{question}%
- \advance\AMC@chiffres\m@ne\ifnum\AMC@chiffres>0\repeat%
-}}
-\newcommand\AMCformatChoices[4]{%
- \global\AMCrep@count=\z@%
- \AMCmem@ireAJ{\global\AMCrep@count=\z@%
- \protect #1{#3}{#4}{\AMCid@name}{\the\AMCid@quest}}%
- \ifAMC@ensemble%
- #2{#3}{#4}{\AMCid@name}{\the\AMCid@quest}%
- \AMC@amclog{AUTOQCM[QPART]^^J}%
- \else%
- #1{#3}{#4}{\AMCid@name}{\the\AMCid@quest}%
- \fi%
-}
-\newcommand{\AMCnumeric@char}[2]{%
- \global\advance\AMCrep@count\@ne\relax%
- \AMC@amclog{AUTOQCM[REP=\the\AMCrep@count:\ifx#2\@empty\@empty M\else B\fi]^^J}%
- \ifAMC@correc%
- \protect\AMC@formBox@{#1}{#2}{1}{case:\AMCid@name:\the\AMCid@quest,\the\AMCrep@count}%
- \else%
- \protect\AMC@formBox@{#1}{}{1}{case:\AMCid@name:\the\AMCid@quest,\the\AMCrep@count}%
- \fi%
-}
-\newdimen\AMCnumeric@Hspace\AMCnumeric@Hspace=.5em
-\newdimen\AMCnumeric@Vspace\AMCnumeric@Vspace=1ex
-\newcommand{\AMCnumeric@digit}[2]{%
- \ifnum\AMC@chiffres=#1%
- \AMCnumeric@char{\the\AMC@chiffres}{1}%
- \else%
- \AMCnumeric@char{\the\AMC@chiffres}{}%
- \fi%
-}
-\newcommand{\AMCsignV}[1]{%
- \ifnum#1<\z@%
- \hbox{\AMCnumeric@char{$+$}{}}\vspace{\AMCnumeric@Vspace}
- \AMC@amclog{AUTOQCM[B=set.intS=1]^^J}%
- \hbox{\AMCnumeric@char{$-$}{1}}
- \AMC@amclog{AUTOQCM[B=set.intS=-1]^^J}%
- \global\multiply#1\m@ne%
- \else%
- \hbox{\AMCnumeric@char{$+$}{1}}\vspace{\AMCnumeric@Vspace}
- \AMC@amclog{AUTOQCM[B=set.intS=1]^^J}%
- \hbox{\AMCnumeric@char{$-$}{}}
- \AMC@amclog{AUTOQCM[B=set.intS=-1]^^J}%
- \fi%
-}
-\newcommand{\AMCnumericH}[3]{%
- \ifKV@AMCNumeric@nozero\AMC@chiffres=1\else\AMC@chiffres=0\fi%
- \loop%
- \AMCnumeric@digit{#2}{#3}%
- \AMC@amclog{AUTOQCM[B=set.#1=\the\AMC@chiffres]^^J}%
- \advance\AMC@chiffres\@ne%
- \ifnum\AMC@chiffres<#3\relax\hspace{\AMCnumeric@Hspace}\repeat%
-}
-\newcommand{\AMCnumericV}[3]{%
- \ifKV@AMCNumeric@nozero\AMC@chiffres=1\else\AMC@chiffres=0\fi%
- \loop%
- \vbox{\hbox{\AMCnumeric@digit{#2}{#3}}}%
- \AMC@amclog{AUTOQCM[B=set.#1=\the\AMC@chiffres]^^J}%
- \advance\AMC@chiffres\@ne%
- \ifnum\AMC@chiffres<#3\relax\vspace{\AMCnumeric@Vspace}\repeat%
-}
-\newcount\AMC@numeric@lastdigit%
-\newcommand{\AMCnumericVR}[3]{%
- \ifKV@AMCNumeric@nozero\AMC@numeric@lastdigit=1%
- \else\AMC@numeric@lastdigit=0\fi%
- \AMC@chiffres=#3\advance\AMC@chiffres\m@ne\loop%
- \vbox{\hbox{\AMCnumeric@digit{#2}{#3}}}%
- \AMC@amclog{AUTOQCM[B=set.#1=\the\AMC@chiffres]^^J}%
- \ifnum\AMC@chiffres>\AMC@numeric@lastdigit%
- \advance\AMC@chiffres\m@ne%
- \vspace{\AMCnumeric@Vspace}\repeat%
-}
-\newcount\AMC@integer@modulo
-\newcommand\AMC@calcmodulo[2]{%
- \AMC@integer@modulo=#1\divide\AMC@integer@modulo\AMC@numeric@base%
- \multiply\AMC@integer@modulo\AMC@numeric@base%
- \multiply\AMC@integer@modulo\m@ne\advance\AMC@integer@modulo by #1\relax%
- #2=\AMC@integer@modulo%
-}
-\newcount\AMC@numeric@integer
-\newcount\AMC@numeric@calcdigit
-\newcommand\AMC@calcdigit[3]{%
- \AMC@numeric@integer=#1%
- \AMC@numeric@calcdigit=#2%
- \ifnum#2>\z@\loop{%
- \global\divide\AMC@numeric@integer\AMC@numeric@base}%
- \advance\AMC@numeric@calcdigit\m@ne%
- \ifnum\AMC@numeric@calcdigit>\z@\repeat%
- \fi%
- \AMC@calcmodulo{\the\AMC@numeric@integer}{#3}%
-}
-\newcommand\AMCsignificantDigits[4][10]{%
- \FPifzero{#3}%
- #4\z@%
- \else%
- \AMCsignificantDigits@nonnull[#1]{#2}{#3}{#4}
- \AMC@givesign{#3}{#4}%
- \fi%
-}
-\newcommand\AMC@givesign[2]{%
- \FPifpos{#1}\else\multiply#2\m@ne\fi%
-}
-\newcommand\AMCsignificantDigits@nonnull[4][10]{%
- \FPabs\AMC@FP@x{#3}%
- \AMC@numeric@calcdigit=#2%
- \AMC@numeric@integer=1%
- \loop\multiply\AMC@numeric@integer by #1\advance\AMC@numeric@calcdigit\m@ne%
- \ifnum\AMC@numeric@calcdigit>\z@\repeat%
- \loop\FPiflt\AMC@FP@x{\the\AMC@numeric@integer}\else%
- \FPeval\AMC@FP@x{AMC@FP@x / #1}\repeat%
- \divide\AMC@numeric@integer by #1\relax%
- \loop\FPiflt\AMC@FP@x{\the\AMC@numeric@integer}%
- \FPeval\AMC@FP@x{AMC@FP@x * #1}\repeat%
- \FPround\AMC@FP@x\AMC@FP@x0\relax%
- \AMC@numeric@calcdigit=\AMC@FP@x%
- \multiply\AMC@numeric@integer by #1\relax%
- \ifnum\AMC@numeric@calcdigit<\AMC@numeric@integer\else%
- \divide\AMC@numeric@calcdigit by #1\relax\fi%
- #4=\AMC@numeric@calcdigit%
-}
-\def\AMCdecimalPoint{\raisebox{1ex}{\bf .}}
-\def\AMCntextSign{}
-\def\AMCntextGoto{}
-\def\AMCntextVHead#1{\emph{b#1}}
-\def\AMCncol@Border{lightgray}
-\def\AMCncol@Background{white}
-\def\AMCncol@BorderWidth{1mm}
-\newcount\AMC@numeric@digits
-\newcount\AMC@numeric@decd
-\newcount\AMC@numeric@value
-\newcount\AMC@numeric@x
-\newcount\AMC@numeric@base
-\define@key{AMCNumeric}{Tsign}{\def\AMCntextSign{#1}}
-\define@key{AMCNumeric}{Tpoint}{\def\AMCdecimalPoint{#1}}
-\define@key{AMCNumeric}{vspace}{\AMCnumeric@Vspace=#1}
-\define@key{AMCNumeric}{hspace}{\AMCnumeric@Hspace=#1}
-\define@key{AMCNumeric}{bordercol}{\def\AMCncol@Border{#1}}
-\define@key{AMCNumeric}{borderwidth}{\def\AMCncol@BorderWidth{#1}}
-\define@key{AMCNumeric}{backgroundcol}{\def\AMCncol@Background{#1}}
-\define@key{AMCNumeric}{digits}[3]{\AMC@numeric@digits=#1}
-\define@key{AMCNumeric}{decimals}[0]{\AMC@numeric@decd=#1}
-\define@key{AMCNumeric}{base}[10]{\AMC@numeric@base=#1}
-\define@boolkey{AMCNumeric}{sign}[true]{}
-\define@boolkey{AMCNumeric}{strict}[false]{}
-\define@boolkey{AMCNumeric}{scoring}[true]{}
-\define@boolkey{AMCNumeric}{vertical}[false]{}
-\define@boolkey{AMCNumeric}{reverse}[true]{}
-\define@boolkey{AMCNumeric}{vhead}[false]{}
-\define@boolkey{AMCNumeric}{nozero}[false]{}
-\define@boolkey{AMCNumeric}{significant}[false]{}
-\define@key{AMCNumeric}{scoreexact}[2]{\def\AMC@numeric@scoreexact{#1}}
-\define@key{AMCNumeric}{scoreapprox}[1]{\def\AMC@numeric@scoreapprox{#1}}
-\newcount\AMC@numeric@exact
-\newcount\AMC@numeric@approx
-\define@key{AMCNumeric}{exact}[0]{\AMC@numeric@exact=#1}
-\define@key{AMCNumeric}{approx}[0]{\AMC@numeric@approx=#1}
-\setkeys{AMCNumeric}{digits,decimals,base,sign,strict,scoring,vertical,
- reverse,vhead,scoreexact,scoreapprox,exact,approx,
- nozero,significant}
-\newcommand\AMCnumericOpts[1]{\setkeys{AMCNumeric}{#1}}
-\newcommand\AMCnumericShow[4]{%
- \ifAMC@ensemble\def\AMCid@name{#3}\AMCid@quest=#4\fi%
- \ifAMC@ensemble\ifAMCformulaire@dedans%
- \AMC@amclog{AUTOQCM[Q=\the\AMCid@quest]^^J}
- \fi\fi%
- {\setkeys{AMCNumeric}{#2}%
- \ifnum\AMC@numeric@decd>\z@%
- \FPeval\AMC@numeric@eval{round(#1 * \the\AMC@numeric@base^\the\AMC@numeric@decd,0)}
- \AMC@numeric@value=\AMC@numeric@eval%
- \else%
- \ifKV@AMCNumeric@significant%
- \AMCsignificantDigits[\the\AMC@numeric@base]{\AMC@numeric@digits}{#1}{\AMC@numeric@value}%
- \else%
- \AMC@numeric@value=#1%
- \fi%
- \fi%
- \ifKV@AMCNumeric@scoring%
- \AMC@amclog{AUTOQCM[B=haut=,mz=,formula=(Vdifference<=\the\AMC@numeric@exact?%
- \AMC@numeric@scoreexact:%
- \ifnum\AMC@numeric@approx>\z@%
- (Vdifference<=\the\AMC@numeric@approx?\AMC@numeric@scoreapprox:0)%
- \else%
- 0%
- \fi)]^^J}%
- \fi%
- \def\AMC@numeric@compute{}%
- \AMC@numeric@x=\AMC@numeric@digits\loop{%
- \ifKV@AMCNumeric@strict%
- \AMC@amclog{AUTOQCM[B=requires.int\@Alph\AMC@numeric@x=1]^^J}%
- \else%
- \AMC@amclog{AUTOQCM[B=default.int\@Alph\AMC@numeric@x=0]^^J}%
- \fi%
- \global\edef\AMC@numeric@compute{%
- \ifnum\AMC@numeric@x=\AMC@numeric@digits\else%
- (\AMC@numeric@compute)*\the\AMC@numeric@base+\fi%
- int\@Alph\AMC@numeric@x}%
- }\advance\AMC@numeric@x\m@ne\ifnum\AMC@numeric@x>0\repeat%
- \ifKV@AMCNumeric@sign%
- \ifKV@AMCNumeric@strict%
- \AMC@amclog{AUTOQCM[B=requires.intS=1]^^J}%
- \else%
- \AMC@amclog{AUTOQCM[B=default.intS=1]^^J}%
- \fi%
- \global\edef\AMC@numeric@compute{(\AMC@numeric@compute)*(intS)}%
- \fi%
- \AMC@amclog{AUTOQCM[B=set.intV=\the\AMC@numeric@value,%
- set.intX=\AMC@numeric@compute]^^J}%
- \ifKV@AMCNumeric@significant%
- \AMC@amclog{AUTOQCM[B=set.Vdifference="min( abs((intV)-(intX)) , abs(\the\AMC@numeric@base * (intV) - (intX)) , abs((intV) - \the\AMC@numeric@base * (intX)) )"]^^J}%
- \else%
- \AMC@amclog{AUTOQCM[B=set.Vdifference=abs((intV)-(intX))]^^J}%
- \fi%
- \vspace{1.5ex}\par{%
- \fboxrule=\AMCncol@BorderWidth%
- \fcolorbox{\AMCncol@Border}{\AMCncol@Background}{%
- \ifKV@AMCNumeric@sign%
- \vbox{%
- \ifx\AMCntextSign\@empty\@empty\else%
- \hbox{\AMCntextSign}\vspace{\AMCnumeric@Vspace}\fi%
- \AMCsignV{\AMC@numeric@value}}\hspace{.5em}%
- \vrule%
- \hspace{.5em}%
- \fi%
-\advance\AMC@numeric@digits\m@ne%
-\advance\AMC@numeric@decd\m@ne%
- \ifKV@AMCNumeric@vertical%
- \hbox{%
- \loop{%
- \ifnum\AMC@numeric@digits=\AMC@numeric@decd\relax%
- \hbox{\AMCdecimalPoint}%
- \fi%
- \AMC@calcdigit{\the\AMC@numeric@value}%
- {\the\AMC@numeric@digits}{\AMC@numeric@x}%
- \hbox{\vbox{%
- \ifKV@AMCNumeric@vhead%
- \vbox{\hbox{\AMCntextVHead{\the\AMC@numeric@digits}}}%
- \vspace{\AMCnumeric@Vspace}%
- \fi%
- {\advance\AMC@numeric@digits\@ne%
- \ifKV@AMCNumeric@reverse%
- \AMCnumericVR{int\@Alph\AMC@numeric@digits}%
- {\the\AMC@numeric@x}{\AMC@numeric@base}%
- \else%
- \AMCnumericV{int\@Alph\AMC@numeric@digits}%
- {\the\AMC@numeric@x}{\AMC@numeric@base}%
- \fi}%
- }}%
- }\ifnum\AMC@numeric@digits>\z@%
- \hspace{\AMCnumeric@Hspace}%
- \advance\AMC@numeric@digits\m@ne\repeat%
- }%
- \else%
- \hbox{\vbox{%
- \loop{%
- \ifnum\AMC@numeric@digits=\AMC@numeric@decd\relax%
- \hbox{\AMCdecimalPoint}%
- \fi%
- \AMC@calcdigit{\the\AMC@numeric@value}%
- {\the\AMC@numeric@digits}{\AMC@numeric@x}%
- \hbox{%
- {\advance\AMC@numeric@digits\@ne%
- \AMCnumericH{int\@Alph\AMC@numeric@digits}%
- {\the\AMC@numeric@x}{\AMC@numeric@base}%
- }}%
- }\ifnum\AMC@numeric@digits>\z@%
- \vspace{\AMCnumeric@Vspace}\par%
- \advance\AMC@numeric@digits\m@ne\repeat%
- }}%
- \fi%
- }%
- }%
- \ifAMC@ensemble\else\vspace{1.5ex}\par\fi%
- \ifAMC@ensemble\ifAMCformulaire@dedans%
- \AMC@amclog{AUTOQCM[FQ]^^J}%
- \fi\fi%
- }%
-}
-\newcommand\AMCnumericHide[4]{%
- \setkeys{AMCNumeric}{#2}%
- \AMCntextGoto%
- \ifAMC@qbloc\else\vspace{1.5ex}\par\fi%
-}
-\def\AMCnumericChoices{\AMCformatChoices{\AMCnumericShow}{\AMCnumericHide}}
-\def\AMCIntervalFormat#1#2{[#1,\,#2[}
-\def\AMC@intervx#1#2{\AMC@CI@cas{\AMCIntervalFormat{#1}{#2}}}
-\def\AMCIntervals#1#2#3#4{%
-\FPeval\AMC@CI@a{clip(#2)}%
-\let\AMC@CI@cas=\wrongchoice%
-\loop%
- \FPeval\AMC@CI@b{clip(AMC@CI@a + #4)}%
- \FPiflt{#1}\AMC@CI@b\let\AMC@CI@cas=\correctchoice\fi%
- \FPiflt{#1}\AMC@CI@a\let\AMC@CI@cas=\wrongchoice\fi%
- \@expandtwoargs\AMC@intervx{\AMC@CI@a}{\AMC@CI@b}%
-\FPiflt\AMC@CI@b{#3}%
- \FPset\AMC@CI@a{\AMC@CI@b}%
-\repeat}
-\def\AMCotextGoto{}
-\def\AMCotextReserved{}
-\def\AMCocol@Background{lightgray}
-\def\AMCocol@BoxFrameRule{white}
-\def\AMCocol@FrameRule{black}
-\def\AMCocol@Foreground{}
-\def\AMCopen@answer{}
-\def\AMCopen@question{}
-\define@key{AMCOpen}{backgroundcol}{\def\AMCocol@Background{#1}}
-\define@key{AMCOpen}{foregroundcol}{\def\AMCocol@Foreground{#1}}
-\define@key{AMCOpen}{Treserved}{\def\AMCotextReserved{#1}}
-\define@key{AMCOpen}{question}[\AMCid@name]{\def\AMCopen@question{#1}}
-\define@key{AMCOpen}{answer}{\def\AMCopen@answer{#1}}
-\define@key{AMCOpen}{contentcommand}[AMCopen@lines]{\def\AMCopen@contentcommand{#1}}
-\newdimen\AMCopen@Hspace\AMCopen@Hspace=.5em
-\define@key{AMCOpen}{hspace}{\AMCopen@Hspace=#1}
-\def\AMCopen@Width{.95\linewidth}
-\define@key{AMCOpen}{width}{\def\AMCopen@Width{#1}}
-\newdimen\AMCopen@LineHeight\AMCopen@LineHeight=1cm
-\define@key{AMCOpen}{lineheight}{\AMCopen@LineHeight=#1}
-\newcount\AMCopen@Lines\AMCopen@Lines=1
-\define@key{AMCOpen}{lines}{\AMCopen@Lines=#1}
-\newdimen\AMCopen@boxmargin\AMCopen@boxmargin=3pt
-\define@key{AMCOpen}{boxmargin}{\AMCopen@boxmargin=#1}
-\newdimen\AMCopen@boxframerule\AMCopen@boxframerule=1pt
-\define@key{AMCOpen}{boxframerule}{\AMCopen@boxframerule=#1}
-\define@key{AMCOpen}{boxframerulecol}{\def\AMCocol@BoxFrameRule{#1}}
-\define@key{AMCOpen}{framerulecol}{\def\AMCocol@FrameRule{#1}}
-\newdimen\AMCopen@framerule\AMCopen@framerule=1pt
-\define@key{AMCOpen}{framerule}{\AMCopen@framerule=#1}
-\define@boolkey{AMCOpen}{dots}[true]{}
-\define@boolkey{AMCOpen}{scan}[true]{}
-\define@boolkey{AMCOpen}{annotate}[false]{}
-\define@boolkey{AMCOpen}{lineup}[false]{}
-\setkeys{AMCOpen}{dots,scan,annotate,lineup,contentcommand}
-\newcommand\AMCopenOpts[1]{\setkeys{AMCOpen}{#1}}
-\newcommand\AMCopen@lines{%
- \begin{minipage}{\AMCopen@Width}%
- \loop\vspace{\AMCopen@LineHeight}
- \hspace*{.5em}\ifAMC@correc\smash{\AMCopen@answer}\def\AMCopen@answer{}\fi%
- \ifKV@AMCOpen@dots%
- \dotfill\hspace*{.5em}
- \fi
- \ifnum\AMCopen@Lines>\@ne\par\advance\AMCopen@Lines\m@ne\repeat%
- \end{minipage}
-}
-\newcommand\AMCopenShow[4]{
- \ifAMC@ensemble\def\AMCid@name{#3}\AMCid@quest=#4\fi%
- \ifAMC@ensemble\ifAMCformulaire@dedans%
- \AMC@amclog{AUTOQCM[Q=\the\AMCid@quest]^^J}%
- \fi\fi%
- {\setkeys{AMCOpen}{#1}%
- \ifKV@AMCOpen@lineup%
- \ifAMC@ensemble\else\par\fi%
- \ifAMC@correc\smash{\AMCopen@answer}\fi\dotfill%
- \else%
- \hspace*{.5em}\linebreak[1]\hspace*{\fill}%
- \fi%
- {\AMCnoCompleteMulti%
- \def\AMCbeginAnswer{}\def\AMCendAnswer{}%
- \def\AMCanswer##1##2{\ifAMC@ensemble ##1\else%
- \ifAMC@inside@box ##1\else{\AMCboxOutsideLetter{##1}{##2}}\fi\fi%
- \hspace{\AMCopen@Hspace}}%
- \fboxsep=\AMCopen@boxmargin%
- \fboxrule=\AMCopen@boxframerule%
- \fcolorbox{\AMCocol@BoxFrameRule}{\AMCocol@Background}{%
- \ifAMC@ensemble\AMCopen@question%
- \ifx\@empty\AMCopen@question\@empty\else\hspace{\AMCopen@Hspace}\fi%
- \fi%
- \begin{choicescustom}[o]%
- \ifx\AMCocol@Foreground\@empty\@empty\else%
- \def\AMC@boxcolor{\AMCocol@Foreground}%
- \fi%
- #2%
- \ifKV@AMCOpen@scan\else\AMCdontScan\fi%
- \ifKV@AMCOpen@annotate\else\AMCdontAnnotate\fi%
- \end{choicescustom}%
- \ifx\@empty\AMCotextReserved\@empty%
- \hspace{-\AMCopen@Hspace}%
- \else%
- \ifx\AMCocol@Foreground\@empty\@empty%
- \AMCotextReserved%
- \else%
- \textcolor{\AMCocol@Foreground}{\AMCotextReserved}%
- \fi%
- \fi%
- }}%
- \ifKV@AMCOpen@lineup\else%
- \par\nobreak\noindent%
- \hspace*{\fill}{%
- \fboxrule=\AMCopen@framerule%
- \fcolorbox{\AMCocol@FrameRule}{white}{%
- \csname\AMCopen@contentcommand\endcsname
- }}%
- \vspace{7mm}\par%
- \fi%
- }%
- \ifAMC@ensemble\ifAMCformulaire@dedans%
- \AMC@amclog{AUTOQCM[FQ]^^J}%
- \fi\fi%
-}
-\newcommand\AMCopenHide[4]{%
- \AMCotextGoto%
- \ifAMC@qbloc\else\vspace{1.5ex}\par\fi%
-}
-\def\AMCOpen{\AMCformatChoices{\AMCopenShow}{\AMCopenHide}}
-\def\AMCbotextGoto{}
-\def\AMCbo@help{}
-\define@key{AMCBoxOnly}{help}{\def\AMCbo@help{#1}}
-\define@boolkey{AMCBoxOnly}{ordered}[false]{}
-\setkeys{AMCBoxOnly}{ordered}
-\newcommand\AMCboOpts[1]{\setkeys{AMCBoxOnly}{#1}}
-\newcommand\AMCboShow[4]{%
- \ifAMC@ensemble\def\AMCid@name{#3}\AMCid@quest=#4\fi%
- \ifAMC@ensemble\ifAMCformulaire@dedans%
- \AMC@amclog{AUTOQCM[Q=\the\AMCid@quest]^^J}%
- \fi\fi%
- {\setkeys{AMCBoxOnly}{#1}%
- \def\AMCbeginAnswer{}\def\AMCendAnswer{}%
- \def\AMCanswer##1##2{\hspace{\AMCformHSpace} \ifAMC@ensemble ##1\else%
- \ifAMC@inside@box ##1\else{\AMCboxOutsideLetter{##1}{##2}}\fi\fi%
- }%
- \ifAMC@ensemble\AMCbo@help\fi%
- \ifKV@AMCBoxOnly@ordered%
- \begin{choicescustom}[o]%
- \else%
- \begin{choicescustom}%
- \fi%
- #2
- \end{choicescustom}%
- }%
- \ifAMC@ensemble\ifAMCformulaire@dedans%
- \AMC@amclog{AUTOQCM[FQ]^^J}%
- \fi\fi%
-}
-\newcommand\AMCboHide[4]{
- \AMCbotextGoto%
- \ifAMC@qbloc\else\vspace{1.5ex}\par\fi%
-}
-\def\AMCBoxOnly{\AMCformatChoices{\AMCboShow}{\AMCboHide}}
-\DeclareFontShape{OT1}{cmr}{b}{n}{<35->cmr17}{}
-\def\AMC@watertext{\AMC@loc@draft}
-\newcommand\AMCw@termark{%
- \setlength{\@tempdimb}{.5\paperwidth}%
- \setlength{\@tempdimc}{-.5\paperheight}%
- \put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){%
- \makebox(0,0){\rotatebox{45}{\AMC@LR{%
- \textcolor[gray]{0.8}{
- \fontencoding{OT1}\fontfamily{cmr}
- \fontseries{b}\fontshape{n}
- \fontsize{90pt}{120pt}
- \selectfont
- \AMC@watertext}}}}}}
-\newcommand\AMCw@terprint[1]{%
- \setbox\@tempboxa\vbox to \z@{%
- \vbox{%
- \hbox to \z@{%
- #1\hss}}\vss}
- \dp\@tempboxa\z@
- \box\@tempboxa}
-\def\AMCcercle#1#2{%
- {\setlength{\unitlength}{1mm}%
- \begin{picture}(#1,#1)(-#2,-#2)\thinlines\circle*{#1}\end{picture}}}
-\def\m@rqueCalage{\AMCcercle{3.6}{1.8}}
-\def\m@rque#1{\AMC@tracebox{1}{#1}{\m@rqueCalage}}
-\def\he@dtaille#1{\vbox to 1cm{#1}}
-\def\he@dbas#1{\he@dtaille{\vspace*{\fill}#1}}
-\def\he@dhaut#1{\he@dtaille{#1\vspace*{\fill}}}
-\def\AMC@intituleHead{\AMC@loc@corrected}
-\def\AMC@note{}
-\def\AMCsetFoot#1{\def\AMC@note{#1}}
-\newcommand\AMCStudentNumber{\the\AMC@etud}
-\newcommand\AMCIDBoxesA{\AMCbin@begin{1}\AMC@binaryBoxes[\AMC@NCBetud]{\the\AMCid@etud}}
-\newcommand\AMCIDBoxesB{\AMCbin@begin{2}\AMC@binaryBoxes[\AMC@NCBpage]{\thepage}}
-\newcommand\AMCIDBoxesC{\AMCbin@begin{3}\AMC@binaryBoxes[\AMC@NCBcheck]{\the\AMCid@check}}
-\newcommand\AMCIDBoxesABC{%
- \hbox{\vbox{\noindent\AMCIDBoxesA\\
- \noindent\AMCIDBoxesB\AMCIDBoxesC}}%
-}
-\AtBeginPage{\ifAMC@pagelayout\global\advance\AMCid@check\m@ne%
- \ifnum\AMCid@check<1\global\AMCid@check=\AMCid@checkmax\fi%
- \AMC@pagepos%
- \ifAMC@watermark\ifAMC@correchead\else\AMCw@terprint{\AMCw@termark}%
- \fi\fi\fi}
-\fancypagestyle{AMCpageHeadOnly}{%
- \fancyhf{}\fancyhead[C]{\textsc{\AMC@intituleHead}}%
- \renewcommand{\headrulewidth}{0pt}%
- \renewcommand{\footrulewidth}{0pt}%
-}
-\fancypagestyle{AMCpageFull}{%
- \fancyhf{}%
- \fancyhead[L]{\AMC@LR{\he@dbas{\leavevmode\m@rque{positionHG}}}}%
- \fancyhead[R]{\AMC@LR{\he@dbas{\leavevmode\m@rque{positionHD}}}}%
- \fancyfoot[L]{\AMC@LR{\leavevmode\m@rque{positionBG}}}%
- \fancyfoot[R]{\AMC@LR{\leavevmode\m@rque{positionBD}}}%
- \fancyhead[C]{\AMC@LR{\he@dhaut{%
- \begin{minipage}[b]{\AMC@CBtaille}\AMCboxColor{black}%
- \ifAMCids@top\vbox to \AMCids@height{\texttt{+\the\AMCid@etud/\thepage/\the\AMCid@check+}}\fi%
- \AMCIDBoxesABC
- \end{minipage}%
- \ifAMCids@side\hbox to \AMCids@width{\hspace*{\fill}%
- \texttt{+\the\AMCid@etud/\thepage/\the\AMCid@check+}}\fi%
- }}}%
- \fancyhfoffset[EOLR]{5mm}%
- \fancyfoot[C]{\AMC@note}%
- \renewcommand{\headrulewidth}{0pt}%
- \renewcommand{\footrulewidth}{0pt}%
-}
-\newcommand\AMCsubjectPageTag{%
- \fbox{\texttt{\the\AMCid@etud:\thepage}}%
-}
-\fancypagestyle{AMCpageNoMarks}{%
- \fancyhf{}%
- \fancyhead[R]{\AMCsubjectPageTag}%
- \fancyfoot[C]{\AMC@note}%
- \renewcommand{\headrulewidth}{0pt}%
- \renewcommand{\footrulewidth}{0pt}%
-}
-\fancypagestyle{AMCpageEmpty}{%
- \fancyhf{}%
- \renewcommand{\headrulewidth}{0pt}%
- \renewcommand{\footrulewidth}{0pt}%
-}
-\AtBeginDocument{%
- \ifAMC@pagelayout%
- \ifAMC@correchead
- \pagestyle{AMCpageHeadOnly}
- \else
- \pagestyle{AMCpageFull}
- \fi
- \fi
-}
-\newcommand{\onecopy}[2]{%
- \ifx\AMCNombreCopies\undefined\AMCnum@copies=#1%
- \else\AMCnum@copies=\AMCNombreCopies\fi%
- \AMC@amclog{AUTOQCM[TOTAL=\the\AMCnum@copies]^^J}%
- \AMCid@etud=\AMCid@etudstart%
- \ifnum\AMCid@etud=0\AMCid@etud=\AMC@premierecopie\fi%
- \AMCid@etudfin=\AMCnum@copies%
- \advance\AMCid@etudfin\AMCid@etud\relax%
- \ifAMC@correchead\AMCid@etudfin=\AMC@premierecopie\fi
- \loop{%
- \AMC@zoneformulairefalse\setcounter{page}{1}\setcounter{section}{0}%
- \ifAMC@ensemble\ifAMC@automarks\pagestyle{AMCpageNoMarks}\fi\fi%
- \AMCnumero{1}%
- \ifAMC@calibration\AMC@amclog{AUTOQCM[ETU=\the\AMCid@etud]^^J}\fi%
- #2\clearpage}\advance\AMCid@etud\@ne\ifnum\AMCid@etud<\AMCid@etudfin\repeat%
- \global\AMCid@etudstart=\AMCid@etud%
-}
-\def\AMCcleardoublepage{\ifodd\thepage\clearpage%
- \ifAMC@automarks\pagestyle{AMCpageEmpty}\fi%
- ~\fi\clearpage}
-\newcommand{\AMCaddpagesto}[1]{%
- \@whilenum\thepage<#1\do{%
- \clearpage~%
- \ifnum\thepage<#1%
- \ifAMC@automarks\pagestyle{AMCpageEmpty}\fi%
- \fi%
- }%
-}
-\def\exemplairepair{\ifodd\AMCid@etud}
-\newcommand\AMCstudentlabel[1]{\the\AMCid@etud-#1}
-\def\AMClabel#1{\expandafter\label{\AMCstudentlabel{#1}}}
-\def\AMCref#1{\expandafter\ref{\AMCstudentlabel{#1}}}
-\def\AMCpageref#1{\expandafter\pageref{\AMCstudentlabel{#1}}}
-\newcommand{\AMCqlabel}[1]{%
- \AMClabel{#1}%
-}
-\newcommand{\AMCassociation}[1]{%
- \ifAMC@calibration\protected@write\AMC@XYFILE{}{%
- \string\association{\the\AMCid@etud}{#1}%
- }\fi%
-}
-\def\AMC@lang@code{}
-\DeclareOptionX{noshuffle}{\AMC@ordretrue}
-\DeclareOptionX{noshufflegroups}{\AMC@shuffleGfalse}
-\DeclareOptionX{fullgroups}{\AMC@fullGroupstrue}
-\DeclareOptionX{answers}{\AMC@correcheadtrue\AMC@correctrue}
-\DeclareOptionX{indivanswers}{\AMC@correctrue}
-\DeclareOptionX{box}{\AMC@qbloctrue}
-\DeclareOptionX{asbox}{\AMC@asqbloctrue}
-\DeclareOptionX{separateanswersheet}{\AMC@ensembletrue}
-\DeclareOptionX{digits}{\AMC@inside@digittrue}
-\DeclareOptionX{ordre}{\AMC@ordretrue}
-\DeclareOptionX{correc}{\AMC@correcheadtrue\AMC@correctrue}
-\DeclareOptionX{modele}{\AMC@correcheadtrue\AMC@correcfalse\AMC@ordretrue}
-\DeclareOptionX{correcindiv}{\AMC@correctrue}
-\DeclareOptionX{init}{\AMC@SR@time}
-\DeclareOptionX{bloc}{\AMC@qbloctrue}
-\DeclareOptionX{completemulti}{\AMCcomplete@multitrue}
-\DeclareOptionX{insidebox}{\AMC@inside@boxtrue}
-\DeclareOptionX{ensemble}{\AMC@ensembletrue}
-\DeclareOptionX{chiffres}{\AMC@inside@digittrue}
-\DeclareOptionX{outsidebox}{\AMC@outside@boxtrue}
-\DeclareOptionX{calibration}{\AMC@calibrationtrue}
-\DeclareOptionX{nowatermark}{\AMC@watermarkfalse}
-\newcommand\AMC@catalogMode{%
- \AMC@watermarkfalse\AMC@correcheadtrue%
- \AMC@correctrue\AMC@ordretrue\AMC@shuffleGfalse%
- \AMC@fullGroupstrue%
- \def\AMC@intituleHead{\AMC@loc@catalog}\AMC@affichekeystrue}
-\DeclareOptionX{catalog}{\AMC@catalogMode}
-\DeclareOptionX{francais}{\def\AMC@lang@code{FR}\AMC@loc@FR}
-\DeclareOptionX{lang}{\def\AMC@lang@code{#1}\csname AMC@loc@#1\endcsname}
-\DeclareOptionX{versionA}{%
- \def\AMCid@checkmax{31}\def\AMC@NCBetud{9}\def\AMC@NCBpage{4}%
- \def\AMC@NCBcheck{5}\setlength{\AMC@CBtaille}{4cm}%
- \def\AMC@premierecopie{100}}
-\DeclareOptionX{plain}{\AMC@plaintrue}
-\DeclareOptionX{nopage}{\AMC@pagelayoutfalse}
-\DeclareOptionX{postcorrect}{\AMC@postcorrecttrue}
-\DeclareOptionX{automarks}{\AMC@automarkstrue}
-\newif\ifAMCneeds@storebox\AMCneeds@storeboxfalse
-\DeclareOptionX{storebox}{\AMCneeds@storeboxtrue}
-\ProcessOptionsX
-
-\ifAMCneeds@storebox
- \RequirePackage{storebox}\AtBeginDocument{{}}%
-\fi
-\AtBeginDocument{
- \ifAMCneeds@storebox
- \let\AMC@new@savebox=\newstorebox%
- \let\AMC@save@box=\storebox%
- \let\AMC@use@box=\usestorebox%
- \fi
- \AMC@new@savebox{\AMC@ovalbox@R}
- \AMC@new@savebox{\AMC@ovalbox@RF}
- \AMC@new@savebox{\AMC@ovalbox@}
- \AMC@new@savebox{\AMC@ovalbox@F}
-}
-\def\AMC@error@explain{\PackageError{automultiplechoice}{
- Command \protect\explain\space can only be used inside\MessageBreak question like environments}{Something's gone wrong.\MessageBreak \space \space Try typing \space \space to proceed, ignoring \protect\explain.
-}}
-\ifAMC@plain
-\else
- \IfFileExists{environ.sty}{\RequirePackage{environ}}{}
- \ifx\eTeXversion\@undefined
- \else
- \RequirePackage{etex}
- \fi
-\fi
-\@ifpackageloaded{environ}{%
- \ifx\NewEnviron\undefined\PackageWarning{automultiplechoice}%
- {Package environ loaded but too old version:
- environnement examcopy/copieexamen will NOT be defined.}%
- \else\NewEnviron{examcopy}[1][5]{\onecopy{#1}{\BODY}}\fi}%
-{\PackageWarning{automultiplechoice}%
- {Package environ not loaded: environnement
- examcopy/copieexamen will NOT be defined.}}
-\ifx\SujetExterne\undefined\else
-\message{***SUJET***^^J}
-\AMC@calibrationtrue\AMC@correcfalse\AMC@correcheadfalse\AMC@watermarkfalse
-\fi
-\ifx\ScoringExterne\undefined\else
-\message{***SCORING***^^J}
-\AMC@calibrationtrue\AMC@correcfalse\AMC@correcheadfalse\AMC@watermarkfalse\AMC@invisibletrue
-\fi
-\ifx\CorrigeExterne\undefined\else
-\message{***CORRIGE***^^J}
-\AMC@calibrationfalse\AMC@correcheadtrue\AMC@correctrue\AMC@watermarkfalse
-\fi
-\ifx\CorrigeIndivExterne\undefined\else
-\message{***CORRIGE***^^J}
-\AMC@calibrationfalse\AMC@correcheadfalse\AMC@correctrue\AMC@watermarkfalse
-\fi
-\ifx\CatalogExterne\undefined\else
-\message{***CATALOG***^^J}
-\AMC@catalogMode
-\fi
-\ifx\NoWatermarkExterne\undefined\else
-\AMC@watermarkfalse
-\fi
-\@ifpackageloaded{geometry}{}{\usepackage{geometry}}
-\ifAMC@pagelayout
- \ifAMC@correchead
- \geometry{hmargin=3cm,vmargin={1cm,1cm},includeheadfoot,headheight=1cm,footskip=1cm}
- \else
- \geometry{hmargin=3cm,headheight=2cm,headsep=.3cm,footskip=1cm,top=3.5cm,bottom=2.5cm}
- \fi
- \ifAMC@watermark
- \ifAMC@correchead\else
- \def\AMC@note{\begin{minipage}{0.65\linewidth}
- \AMC@LR{\textcolor{blue}{\AMC@loc@message}}
- \end{minipage}
- }
- \fi
- \fi
-\fi
-\AMCid@check=\AMCid@checkmax\advance\AMCid@check\@ne
-\ifAMC@ensemble\AMC@amclog{AUTOQCM[VAR:ensemble=1]^^J}\fi
-\ifAMC@inside@box\AMC@amclog{AUTOQCM[VAR:insidebox=1]^^J}\fi
-\ifAMC@outside@box\AMC@amclog{AUTOQCM[VAR:outsidebox=1]^^J}\fi
-\ifAMC@postcorrect\AMC@amclog{AUTOQCM[VAR:postcorrect=1]^^J}\fi
-\ifAMC@calibration
-\newwrite\AMC@XYFILE%
-\immediate\openout\AMC@XYFILE\jobname.xy%
-\immediate\write\AMC@XYFILE{\string\version{\AMC@VERSION}}
-\immediate\write\AMC@XYFILE{\string\with{codedigit=squarebrackets}}
-\immediate\write\AMC@XYFILE{\string\with{version=\AMC@VERSION}}
-\immediate\write\AMC@XYFILE{\string\with{ensemble=\ifAMC@ensemble yes\else no\fi}}
-\immediate\write\AMC@XYFILE{\string\with{insidebox=\ifAMC@inside@box yes\else no\fi}}
-\immediate\write\AMC@XYFILE{\string\with{ousidebox=\ifAMC@outside@box yes\else no\fi}}
-\immediate\write\AMC@XYFILE{\string\with{postcorrect=\ifAMC@postcorrect yes\else no\fi}}
-\immediate\write\AMC@XYFILE{\string\with{lang=\AMC@lang@code}}
-\fi
-\let\reponses=\choices\let\endreponses=\endchoices
-\let\reponseshoriz=\choiceshoriz\let\endreponseshoriz=\endchoiceshoriz
-\let\reponsesperso=\choicescustom\let\endreponsesperso=\endchoicescustom
-\let\bonne=\correctchoice
-\let\mauvaise=\wrongchoice
-\let\bareme=\scoring
-\let\baremeDefautM=\scoringDefaultM
-\let\baremeDefautS=\scoringDefaultS
-\def\exemplaire{\AMC@loc@FR\onecopy}
-\@ifpackageloaded{environ}{%
- \let\copieexamen=\examcopy\let\endcopieexamen=\endexamcopy}{}
-\let\melangegroupe=\shufflegroup
-\let\restituegroupe=\insertgroup
-\let\alafin=\lastchoices
-\let\formulaire=\AMCform
-\let\AMCdebutFormulaire=\AMCformBegin
-\let\champnom=\namefield
-\let\choixIntervalles=\AMCIntervals
-\endinput
-%%
-%% End of file `automultiplechoice.sty'.
diff --git a/amc-templates/amc_template_df/build.sh b/amc-templates/amc_template_df/build.sh
deleted file mode 100755
index ee3bbd6..0000000
--- a/amc-templates/amc_template_df/build.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-pdflatex -halt-on-error -interaction batchmode exam.tex > /dev/null 2>&1 && rm -f exam.amc exam.aux exam.log && echo "OK" && exit 0
-
-# Otherwise run pdflatex in interactive mode
-rm -f exam.amc exam.aux exam.log
-echo "An error occured. Starting over in interactive mode."
-echo -n "Press ENTER to continue, Ctrl-C to exit."
-read ans
-pdflatex exam.tex
diff --git a/amc-templates/amc_template_df/clean.sh b/amc-templates/amc_template_df/clean.sh
deleted file mode 100755
index 6f1de77..0000000
--- a/amc-templates/amc_template_df/clean.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-rm -f exam.amc exam.aux exam.log exam.pdf
-exit 0
diff --git a/amc-templates/amc_template_df/exam.pdf b/amc-templates/amc_template_df/exam.pdf
deleted file mode 100644
index ccea6cc..0000000
Binary files a/amc-templates/amc_template_df/exam.pdf and /dev/null differ
diff --git a/amc-templates/amc_template_df/media/en/mc8_tree.png b/amc-templates/amc_template_df/media/en/mc8_tree.png
deleted file mode 100644
index 31005b4..0000000
Binary files a/amc-templates/amc_template_df/media/en/mc8_tree.png and /dev/null differ
diff --git a/amc-templates/amc_template_df/packages.tex b/amc-templates/amc_template_df/packages.tex
deleted file mode 100644
index 11fbbe8..0000000
--- a/amc-templates/amc_template_df/packages.tex
+++ /dev/null
@@ -1,24 +0,0 @@
-%% Extra packages
-
-%% CSV file access
-\usepackage{csvsimple}
-
-%% Multicolumn formatting
-\usepackage{multicol}
-
-%% Math packages
-\usepackage{graphicx}
-\usepackage{amsmath}
-\usepackage{mathrsfs}
-\usepackage{euscript}
-\usepackage{epsfig}
-\usepackage{ifthen}
-\usepackage{amsfonts}
-\usepackage{amssymb}
-
-%% Graphics
-\usepackage{graphicx}
-\graphicspath{ {media/} }
-
-%% Drawing
-\usepackage{tikz}
diff --git a/amc-templates/amc_template_df/questions/en/mc1.tex b/amc-templates/amc_template_df/questions/en/mc1.tex
deleted file mode 100644
index d4ca5d0..0000000
--- a/amc-templates/amc_template_df/questions/en/mc1.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{question}{mc1}
-The four pillars of evolution are:
-\begin{reponses}
-\bonne{Population, Diversity, Heredity, Selection}
-\mauvaise{Population, Adaptation, Selection, Diversity}
-\mauvaise{Selection, Generation, Improvement, Heredity}
-\mauvaise{Diversity, Heredity, Selection, Genotype}
-\end{reponses}
-\end{question}
diff --git a/amc-templates/amc_template_df/questions/en/mc10.tex b/amc-templates/amc_template_df/questions/en/mc10.tex
deleted file mode 100644
index 11b0657..0000000
--- a/amc-templates/amc_template_df/questions/en/mc10.tex
+++ /dev/null
@@ -1,10 +0,0 @@
-\begin{question}{mc9}
-In proportionate selection, what is the probability of reproduction $p_{i}$ of an individual i with fitness $f_{i}$?
-\begin{reponses}
-\bonne{$p_{i}=\frac{f_{i}}{\Sigma{i}{N} f_{i}}$}
-\mauvaise{$p_{i} = \frac{ p_{i}} {f_{i}}$}
-\mauvaise{$p_{i}=\frac{f_{i}}{\Sigma{i}{N} p_{i}}$}
-\mauvaise{$p_{i} = f_{i}$}
-\end{reponses}
-\end{question}
-
diff --git a/amc-templates/amc_template_df/questions/en/mc11.tex b/amc-templates/amc_template_df/questions/en/mc11.tex
deleted file mode 100644
index 63eb190..0000000
--- a/amc-templates/amc_template_df/questions/en/mc11.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{question}{mc11}
-Which statement is true about tournament selection and selection pressure?
-\begin{reponses}
-\bonne{Larger tournament size generates stronger selection pressure}
-\mauvaise{Tournament of the best individuals generates the strongest selection pressure}
-\mauvaise{Tournament size has no effect on selection pressure}
-\mauvaise{Smaller tournament size generates stronger selection pressure}
-\end{reponses}
-\end{question}
diff --git a/amc-templates/amc_template_df/questions/en/mc12.tex b/amc-templates/amc_template_df/questions/en/mc12.tex
deleted file mode 100644
index cb93515..0000000
--- a/amc-templates/amc_template_df/questions/en/mc12.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{question}{mc12}
-A fitness landscape is:
-\begin{reponses}
-\bonne{The distribution of fitness values for each possible combination of genes }
-\mauvaise{A method to compare different evolutionary methods}
-\mauvaise{A measure of population diversity}
-\mauvaise{A plot of the average and best population fitness}
-\end{reponses}
-\end{question}
diff --git a/amc-templates/amc_template_df/questions/en/mc13.tex b/amc-templates/amc_template_df/questions/en/mc13.tex
deleted file mode 100644
index 0de9731..0000000
--- a/amc-templates/amc_template_df/questions/en/mc13.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{question}{mc13}
-What is the correct relationship between population diversity and evolutionary progress in Artificial Evolution?
-\begin{reponses}
-\bonne{Reducing population diversity can prevent further evolutionary progress}
-\mauvaise{Small population diversity is useful for evolutionary optimisation}
-\mauvaise{Evolutionary progress is difficult if population diversity is too large}
-\mauvaise{Population diversity has no effect on evolutionary progress}
-\end{reponses}
-\end{question}
diff --git a/amc-templates/amc_template_df/questions/en/mc14.tex b/amc-templates/amc_template_df/questions/en/mc14.tex
deleted file mode 100644
index b43d036..0000000
--- a/amc-templates/amc_template_df/questions/en/mc14.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{question}{mc14}
-What is best Evolutionary Algorithm (EA) for any type of problem?
-\begin{reponses}
-\bonne{There is no best EA for any type of problem}
-\mauvaise{Genetic Algorithm}
-\mauvaise{Genetic Programming}
-\mauvaise{Competitive coevolution}
-\end{reponses}
-\end{question}
diff --git a/amc-templates/amc_template_df/questions/en/mc2.tex b/amc-templates/amc_template_df/questions/en/mc2.tex
deleted file mode 100644
index eb74996..0000000
--- a/amc-templates/amc_template_df/questions/en/mc2.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{question}{mc2}
-Which statement is correct about genotype/phenotype and selection?
-\begin{reponses}
-\bonne{Selection operates on the phenotype, not directly on the genotype}
-\mauvaise{Selection operates on the genotype, not directly on the phenotype}
-\mauvaise{Selection operates independently on the genotype and on the phenotype}
-\mauvaise{Phenotype and genotype are not directly affected by selection}
-\end{reponses}
-\end{question}
diff --git a/amc-templates/amc_template_df/questions/en/mc3.tex b/amc-templates/amc_template_df/questions/en/mc3.tex
deleted file mode 100644
index 0f7a9ec..0000000
--- a/amc-templates/amc_template_df/questions/en/mc3.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{question}{mc3}
-What are the main steps of generation cycles in evolutionary computation?
-\begin{reponses}
-\bonne{Evaluation, Selection, Reproduction, Mutation}
-\mauvaise{Initialization, Evaluation, Selection, Reproduction}
-\mauvaise{Selection, Reproduction, Mutation, Generation}
-\mauvaise{Evaluation, Selection, Mutation, Diversity}
-\end{reponses}
-\end{question}
diff --git a/amc-templates/amc_template_df/questions/en/mc4.tex b/amc-templates/amc_template_df/questions/en/mc4.tex
deleted file mode 100644
index 6d4706d..0000000
--- a/amc-templates/amc_template_df/questions/en/mc4.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{question}{mc4}
-Which statement about natural evolution (NE) and artificial evolution (AE) is correct?
-\begin{reponses}
-\bonne{The fitness is computed differently in NE and in AE}
-\mauvaise{In NE there is no difference between genotype and phenotype}
-\mauvaise{NE and AE are both optimisation processes}
-\mauvaise{In AE it is not necessary to use a population}
-\end{reponses}
-\end{question}
diff --git a/amc-templates/amc_template_df/questions/en/mc5.tex b/amc-templates/amc_template_df/questions/en/mc5.tex
deleted file mode 100644
index e7cc094..0000000
--- a/amc-templates/amc_template_df/questions/en/mc5.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{question}{mc5}
-The genetic string 102010 has:
-\begin{reponses}
-\bonne{length 6 and cardinality 3}
-\mauvaise{length 3 and cardinality 3}
-\mauvaise{length 6 and cardinality 2}
-\mauvaise{length 3 and cardinality 2}
-\end{reponses}
-\end{question}
diff --git a/amc-templates/amc_template_df/questions/en/mc6.tex b/amc-templates/amc_template_df/questions/en/mc6.tex
deleted file mode 100644
index 9ce0dfc..0000000
--- a/amc-templates/amc_template_df/questions/en/mc6.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{question}{mc6}
-Which genetic code represents a valid job schedule for a company where six different jobs must be organized in morning, afternoon, and night shifts?
-\begin{reponses}
-\bonne{001012}
-\mauvaise{030303}
-\mauvaise{123123}
-\mauvaise{010203}
-\end{reponses}
-\end{question}
diff --git a/amc-templates/amc_template_df/questions/en/mc7.tex b/amc-templates/amc_template_df/questions/en/mc7.tex
deleted file mode 100644
index 145d174..0000000
--- a/amc-templates/amc_template_df/questions/en/mc7.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{question}{mc7}
-Which genetic code represents a valid job schedule for a company where six different jobs must be organized in morning, afternoon, and night shifts?
-\begin{reponses}
-\bonne{001012}
-\mauvaise{030303}
-\mauvaise{123123}
-\mauvaise{010203}
-\end{reponses}
-\end{question}
diff --git a/amc-templates/amc_template_df/questions/en/mc8.tex b/amc-templates/amc_template_df/questions/en/mc8.tex
deleted file mode 100644
index f7e00c1..0000000
--- a/amc-templates/amc_template_df/questions/en/mc8.tex
+++ /dev/null
@@ -1,14 +0,0 @@
-\begin{question}{mc8}
-To which expression does this tree-based representation correspond?
-
-\begin{center}
-\includegraphics[width=0.2\textwidth]{media/en/mc8_tree.png}
-\end{center}
-
-\begin{reponses}
-\bonne{min+(i/255)*(max-min)}
-\mauvaise{min*(i/255)*(max-min)}
-\mauvaise{min+(255/i)*(max-min)}
-\mauvaise{min+i/255*max-min}
-\end{reponses}
-\end{question}
diff --git a/amc-templates/amc_template_df/questions/en/mc9.tex b/amc-templates/amc_template_df/questions/en/mc9.tex
deleted file mode 100644
index 11b0657..0000000
--- a/amc-templates/amc_template_df/questions/en/mc9.tex
+++ /dev/null
@@ -1,10 +0,0 @@
-\begin{question}{mc9}
-In proportionate selection, what is the probability of reproduction $p_{i}$ of an individual i with fitness $f_{i}$?
-\begin{reponses}
-\bonne{$p_{i}=\frac{f_{i}}{\Sigma{i}{N} f_{i}}$}
-\mauvaise{$p_{i} = \frac{ p_{i}} {f_{i}}$}
-\mauvaise{$p_{i}=\frac{f_{i}}{\Sigma{i}{N} p_{i}}$}
-\mauvaise{$p_{i} = f_{i}$}
-\end{reponses}
-\end{question}
-
diff --git a/amc-templates/amc_template_al.zip b/amc-templates/amc_template_extra_section.zip
similarity index 52%
rename from amc-templates/amc_template_al.zip
rename to amc-templates/amc_template_extra_section.zip
index 7647355..9f43635 100644
Binary files a/amc-templates/amc_template_al.zip and b/amc-templates/amc_template_extra_section.zip differ
diff --git a/amc-templates/amc_template_df/README b/amc-templates/amc_template_extra_section/README
similarity index 79%
rename from amc-templates/amc_template_df/README
rename to amc-templates/amc_template_extra_section/README
index 09a24d6..5b82ad5 100644
--- a/amc-templates/amc_template_df/README
+++ b/amc-templates/amc_template_extra_section/README
@@ -1,28 +1,31 @@
Quick template user guide:
--------------------------
1) Place your questions in the 'questions/[language]/' subfolder(s).
2) Place your media files (if any) in the 'media/lang/' subfolders.
In your "\includegraphics" commands in your question files, prefix your path with the same folder name. e.g.:
\includegraphics[width=0.5\textwidth]{media/fr/BarreQuiGlisse2.eps}
-3) Edit the 'exam.tex' file and add your questions within the "{document}" envirinment with an "\input" command.
+3) Place your open questions in 'extra_section.tex' file.
+
+4) Edit the 'exam.tex' file and add your questions within the "{document}" envirinment with an "\input" command.
[...]
\begin{document}
\input{./questions/fr/mc1.tex}
\input{./questions/fr/tf1.tex}
+\input{./extra_section.tex}
\end{document}
-4) In a Linux or MacOS terminal :
+5) In a Linux or MacOS terminal :
- run "./build.sh" to build the PDF
- run "./clean.sh" to remove the temporary files and PDF
Notes:
------
* Should you need extra packages, please add them in the file 'packages.tex'
diff --git a/amc-templates/amc_template_al/automultiplechoice.sty b/amc-templates/amc_template_extra_section/automultiplechoice.sty
similarity index 100%
rename from amc-templates/amc_template_al/automultiplechoice.sty
rename to amc-templates/amc_template_extra_section/automultiplechoice.sty
diff --git a/amc-templates/amc_template_al/build.sh b/amc-templates/amc_template_extra_section/build.sh
similarity index 100%
rename from amc-templates/amc_template_al/build.sh
rename to amc-templates/amc_template_extra_section/build.sh
diff --git a/amc-templates/amc_template_al/clean.sh b/amc-templates/amc_template_extra_section/clean.sh
similarity index 100%
rename from amc-templates/amc_template_al/clean.sh
rename to amc-templates/amc_template_extra_section/clean.sh
diff --git a/amc-templates/amc_template_df/exam.tex b/amc-templates/amc_template_extra_section/exam.tex
similarity index 53%
rename from amc-templates/amc_template_df/exam.tex
rename to amc-templates/amc_template_extra_section/exam.tex
index a53c5ce..54630aa 100644
--- a/amc-templates/amc_template_df/exam.tex
+++ b/amc-templates/amc_template_extra_section/exam.tex
@@ -1,44 +1,33 @@
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc} %Unicode
\usepackage[T1]{fontenc}
\usepackage{fix-cm}
\usepackage[lang=FR,bloc,completemulti]{automultiplechoice}
\input{./packages.tex}
\newcommand{\TRUE}{
\bareme{b=1,m=-1}
\begin{choiceshoriz}[o]
\bonne{VRAI}
\mauvaise{FAUX}
\end{choiceshoriz}
\medskip
}
\newcommand{\FALSE}{
\bareme{b=1,m=-1}
\begin{choiceshoriz}[o]
\mauvaise{VRAI}
\bonne{FAUX}
\end{choiceshoriz}
\medskip
}
\begin{document}
-\input{./questions/en/mc1.tex}
-\input{./questions/en/mc2.tex}
-\input{./questions/en/mc3.tex}
-\input{./questions/en/mc4.tex}
-\input{./questions/en/mc5.tex}
-\input{./questions/en/mc6.tex}
-\input{./questions/en/mc7.tex}
-\input{./questions/en/mc8.tex}
-\input{./questions/en/mc9.tex}
-\input{./questions/en/mc10.tex}
-\input{./questions/en/mc11.tex}
-\input{./questions/en/mc12.tex}
-\input{./questions/en/mc13.tex}
-\input{./questions/en/mc14.tex}
+\input{./questions/fr/mc1.tex}
+\input{./questions/fr/tf1.tex}
+\input{./extra_section.tex}
\end{document}
diff --git a/amc-templates/amc_template_extra_section/extra_section.tex b/amc-templates/amc_template_extra_section/extra_section.tex
new file mode 100644
index 0000000..fa42bcb
--- /dev/null
+++ b/amc-templates/amc_template_extra_section/extra_section.tex
@@ -0,0 +1,207 @@
+\setlength{\parindent}{0pt}%
+\newpage
+
+%****************************************
+% Groups of boxes correctors
+%****************************************
+% Single points
+
+\newcommand{\openquestionmax}{1}
+
+\newcommand{\correctorPointsPerGroup}[1]{
+\renewcommand{\openquestionmax}{#1}
+}
+
+\newcommand{\correctorChoices}{\correctchoice[0]{}\scoring{b=0}\correctchoice[Y]{}\scoring{b=\openquestionmax/4}\correctchoice[X]{}\scoring{b=\openquestionmax/2}\correctchoice[W]{}\scoring{b=\openquestionmax*3/4}\correctchoice[V]{\qquad}\scoring{b=\openquestionmax}}
+
+\newcommand{\correctorOne}[3][0]{
+\par
+\noindent
+\begin{questionmultx}{#2}\bareme{MAX=\openquestionmax}
+#3~\\
+\noindent\AMCOpen{lines=#1,boxframerulecol=lightgray,framerulecol=white}{\correctorChoices\makebox[218.6pt][c]{}}
+\end{questionmultx}
+\vspace{-55pt}~
+\par
+}
+
+\newcommand{\correctorTwo}[3][0]{
+\par
+\noindent\begin{questionmultx}{#2}\bareme{MAX=\openquestionmax*2}
+#3~\\
+\noindent\AMCOpen{lines=#1,boxframerulecol=lightgray,framerulecol=white}{\correctorChoices\correctorChoices\makebox[109.8pt][c]{}}
+\end{questionmultx}
+\vspace{-55pt}~
+\par
+}
+
+\newcommand{\correctorThree}[3][0]{
+\par
+\noindent
+\begin{questionmultx}{#2}\bareme{MAX=\openquestionmax*3}
+#3~\\
+\noindent\AMCOpen{lines=#1,boxframerulecol=lightgray,framerulecol=white}{\correctorChoices\correctorChoices\correctorChoices\makebox[1pt][c]{}}
+\end{questionmultx}
+\vspace{-55pt}~
+\par
+}
+
+%****************************************
+% Open question corrector boxes
+%****************************************
+\newcommand{\correctorChoicesEight}{
+\wrongchoice[0]{\tiny{0}}\scoring{0}
+\wrongchoice[Y]{\tiny{1}}\scoring{1}
+\wrongchoice[X]{\tiny{2}}\scoring{2}
+\wrongchoice[W]{\tiny{3}}\scoring{3}
+\wrongchoice[V]{\tiny{4}}\scoring{4}
+\wrongchoice[U]{\tiny{5}}\scoring{5}
+\wrongchoice[T]{\tiny{6}}\scoring{6}
+\wrongchoice[S]{\tiny{7}}\scoring{7}
+\correctchoice[R]{\tiny{8}\qquad}\scoring{8}}
+\newcommand{\correctorEight}[3][0]{%
+\par
+\noindent
+\begin{question}{#2}\bareme{MAX=8}
+#3~\\
+\noindent\AMCOpen{lines=#1,boxframerulecol=lightgray,framerulecol=white}{\correctorChoicesEight\makebox[48.6pt][c]{}}
+\end{question}
+\vspace{-55pt}~
+\par
+}
+
+
+\newcommand{\correctorStop}{
+
+
+\noindent
+}
+
+%% OpenBox commands ============================
+\newcommand{\OpenBox}[1]{
+\noindent
+ \fbox{
+ \centering
+ \begin{minipage}{1.0\textwidth}
+~
+ \vspace{#1}
+~
+ \end{minipage}
+ }
+}
+
+\newcommand{\FullPageOpenBox}{
+ \clearpage
+ \OpenBox{23cm}
+}
+
+%% OpenGrid commands ============================
+\newcommand{\OpenGrid}[1]{
+\noindent
+\begin{tikzpicture}
+\draw[step=.5cm,lightgray]
+(0cm,0cm) grid (15.5cm,#1);
+\end{tikzpicture}
+}
+
+\newcommand{\FullPageOpenGrid}{
+ \clearpage
+ \OpenGrid{23cm}
+}
+
+\newcommand{\FullPageOpenGridForever}{
+ \loop \ifnum \thepage < \totalPages \FullPageOpenGrid \repeat
+}
+
+\newcommand{\FullPageOpenBoxForever}{
+ \loop \ifnum \thepage < \totalPages \FullPageOpenBox \repeat
+}
+
+%*******************************************************************%
+% Suppress begin-question texts
+\renewcommand{\AMCbeginQuestion}[2]{\QuestionText{#1}}
+\def\QuestionText{\TEXT}
+\def\TEXT#1{}
+\def\NOTEXT#1{}
+\setlength{\parindent}{0pt}%
+%*******************************************************************%
+
+\subsection*{Deuxi\`eme partie, question de type ouvert}
+
+\noindent
+R\'epondre dans l’espace d\'edi\'e. Votre r\'eponse doit \^etre soigneusement justifi\'ee,
+toutes les \'etapes de votre raisonnement doivent figurer dans votre r\'eponse. Laisser libres les cases \`a cocher\,: elles sont r\'eserv\'ees au correcteur.
+
+
+\bigskip
+
+
+%% Leave at least 2 empty lines after the \bigskip
+%*******************************************************************%
+% Question A - 5 points
+%*******************************************************************%
+
+\begin{description}
+\addtocounter{AMCquestionaff}{1}
+\item[Question~\theAMCquestionaff :] \textit{Cette question est not\'ee sur 5 points.}
+\end{description}
+\correctorPointsPerGroup{5/3}
+\correctorThree{q-open-A}{~}
+\correctorStop
+
+Soit $\Psi : \R_3[x]\to \R_3[x]$ l'application d\'efinie par
+$$\Psi(p)(x) = (x-1)p'(x)\text{.}$$
+
+\begin{itemize}
+ \item [1.] Montrer que $\Psi$ est lin\'eaire.
+ \item [2.] Calculer la matrice $[\Psi]_{E,E}$ de $\Psi$ par rapport \`a la base canonique $E = (1,x, x^2, x^3)$.
+ \item [3.] Calculer le rang de $\Psi$.
+\end{itemize}
+
+\OpenGrid{15cm}
+\FullPageOpenGrid
+\FullPageOpenGrid
+%*******************************************************************%
+
+%*******************************************************************%
+% Question B - 6 points
+%*******************************************************************%
+
+\begin{description}
+\item[Question~\theAMCquestionaff :] \textit{Cette question est not\'ee sur 6 points.}
+\end{description}
+\correctorPointsPerGroup{6/3}
+\correctorThree{q-open-B}{~}
+\correctorStop
+
+\noindent Soient $V$ un $K$-espace vectoriel de dimension finie, et $X,Y$ deux sous-espaces vectoriels de $V$
+tels que $\operatorname{dim}(X) \geq \operatorname{dim}(Y)$. Montrer qu'il existe une application lin\'eaire $T : V\to V$ telle que $T(X) = Y$.
+
+\vskip 5pt
+\OpenGrid{19cm}
+\FullPageOpenGrid
+ \FullPageOpenGrid
+%***************************
+
+% Question C - 6points
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{description}
+\item[Question~\theAMCquestionaff :] \textit{Cette question est not\'ee sur 6 points.}
+\end{description}
+\correctorPointsPerGroup{6/3}
+\correctorThree{q-open-C}{~}
+\correctorStop
+
+Soit $\alpha\in \C$.
+
+\begin{itemize}
+\item [1.] Trouver la formule explicite pour les éléments de la matrice $A_n = \begin{pmatrix}\alpha &1\\ 0 &\alpha\end{pmatrix}^{n}$, o\`u $n \geq 1$ est un entier. Montrer la formule par r\'eccurence.
+% \item [1.] Trouver la formule pour $\begin{pmatrix}\alpha &1\\ 0 &\alpha\end{pmatrix}^{n}$, o\`u $n \geq 1$ est un entier. Montrer la formule par r\'eccurance.
+ \item [2.] On pose $\alpha = 1+\textrm{i}$. Calculer $\alpha^{99}$ et $\alpha^{100}$.
+ \item [3.] Calculer $\begin{pmatrix} 1+\textrm{i} &1\\ 0 &1+\textrm{i}\end{pmatrix}^{100}$.
+\end{itemize}
+
+
+\OpenGrid{17cm}
+ \FullPageOpenGrid
+ \FullPageOpenGrid
\ No newline at end of file
diff --git a/amc-templates/amc_template_al/media/fr/BarreQuiGlisse2-eps-converted-to.pdf b/amc-templates/amc_template_extra_section/media/fr/BarreQuiGlisse2-eps-converted-to.pdf
similarity index 100%
rename from amc-templates/amc_template_al/media/fr/BarreQuiGlisse2-eps-converted-to.pdf
rename to amc-templates/amc_template_extra_section/media/fr/BarreQuiGlisse2-eps-converted-to.pdf
diff --git a/amc-templates/amc_template_al/media/fr/BarreQuiGlisse2.eps b/amc-templates/amc_template_extra_section/media/fr/BarreQuiGlisse2.eps
similarity index 100%
rename from amc-templates/amc_template_al/media/fr/BarreQuiGlisse2.eps
rename to amc-templates/amc_template_extra_section/media/fr/BarreQuiGlisse2.eps
diff --git a/amc-templates/amc_template_al/packages.tex b/amc-templates/amc_template_extra_section/packages.tex
similarity index 100%
rename from amc-templates/amc_template_al/packages.tex
rename to amc-templates/amc_template_extra_section/packages.tex
diff --git a/amc-templates/amc_template_extra_section/questions/fr/mc1.tex b/amc-templates/amc_template_extra_section/questions/fr/mc1.tex
new file mode 100644
index 0000000..49df274
--- /dev/null
+++ b/amc-templates/amc_template_extra_section/questions/fr/mc1.tex
@@ -0,0 +1,15 @@
+\begin{question}{identifiant-question-1}
+Une barre $[p,q]$ dans $\mathbb{R}^2$ de longueur 2 et de milieu $m$ glisse telle que $p$ reste sur l'axe $Ox_1$ et $q$ sur la droite $D$ passant par $O$ et $(1,2)$. Initialement $p$ et $q$ se trouvent en $(2,0)$ et $(0,0)$ respectivement. Param\'etrer la trajectoire $\gamma(t)$ d\'ecrite par le point $m$ en fonction de l'angle $t$ (l'angle $t$ est consid\'er\'e non orient\'e et varie entre $0$ et $\pi/2$).
+
+\begin{center}
+\includegraphics[width=0.5\textwidth]{media/fr/BarreQuiGlisse2.eps}
+\end{center}
+
+\begin{reponses}
+\mauvaise{$\gamma(\theta) = (\cos(t) + 2\sin(t), 1-\cos(t))$}
+\mauvaise{$\gamma(\theta) = (\cos(t)+\sin(t), 1-\cos(t))$}
+\mauvaise{$\gamma(\theta) = (\cos(t)+2\sin(t), \sin(t))$}
+\bonne{$\gamma(t) = (\sin(t) + \cos(t), \sin(t))$}
+\end{reponses}
+
+\end{question}
diff --git a/amc-templates/amc_template_extra_section/questions/fr/tf1.tex b/amc-templates/amc_template_extra_section/questions/fr/tf1.tex
new file mode 100644
index 0000000..9dd704b
--- /dev/null
+++ b/amc-templates/amc_template_extra_section/questions/fr/tf1.tex
@@ -0,0 +1,4 @@
+\begin{question}{tf1}
+La courbe $\gamma(t) = \big(\sin^2(t), \cos^2(t)\big)$, $t \in {]}{-}\frac{\pi}{2}, \frac{\pi}{2}{[}$ est r\'eguli\`ere.
+\FALSE
+\end{question}
diff --git a/bin/bamc b/bin/bamc
index 02dd6e8..32de6b6 100755
--- a/bin/bamc
+++ b/bin/bamc
@@ -1,39 +1,40 @@
#!/bin/bash
# Set SNAME, SDIR and SPATH
if [ -h $0 ]; then SNAME=$(readlink $0); else SNAME=$0; fi
SDIR=$(dirname $SNAME)
if [[ "$SDIR" =~ ^/ ]]; then SPATH=$SDIR; else SPATH=$(realpath $(dirname $0)/$SDIR); fi
# Set DIR_LIB
DIR_LIB=$(realpath $SPATH/../lib/bash)
+echo $DIR_LIB
# Source libs
source $DIR_LIB/tools.sh
source $DIR_LIB/colors.sh
source $DIR_LIB/io.sh
source $DIR_LIB/debugging.sh
source $DIR_LIB/cmdline_parser.sh
source $DIR_LIB/bamc_configuration.sh
source $DIR_LIB/bamc_sanity.sh
source $DIR_LIB/bamc_help.sh
source $DIR_LIB/bamc_workspace.sh
source $DIR_LIB/bamc_questions.sh
source $DIR_LIB/bamc_exams.sh
source $DIR_LIB/bamc_templates.sh
source $DIR_LIB/bamc_projects.sh
source $DIR_LIB/bamc_students.sh
source $DIR_LIB/bamc_amc-commands.sh
# Set some variables
DEFAULT_ITEMS=$(get_exam_list)
DEFAULT_ACTIONS="help"
CALLBACK_PREFIX="action_"
# Run!
run $@
# RIP
exit $?
#EOF
diff --git a/data/templates/chemistry/de/first_page.tex b/data/templates/chemistry/de/first_page.tex
index f6ef531..b7e6630 100644
--- a/data/templates/chemistry/de/first_page.tex
+++ b/data/templates/chemistry/de/first_page.tex
@@ -1,54 +1,56 @@
% First page - GERMAN
\noindent
\begin{minipage}[c]{350pt}
\bf \prof~-~\ExamName~-~\SECTION \\
~ \\
\bf \ExamDate~-~Dauer: \Time
\end{minipage}
\begin{minipage}[c]{100pt}
\includegraphics[scale=0.24]{Logo_EPFL}
\end{minipage}
\vfill
\begin{minipage}[c]{\textwidth}
\noindent
\hfill\fontsize{100}{120}{\selectfont{\ID{}}}\hfill
\vspace{1cm}
\par
\noindent
-\hfill\fontsize{40}{48}{\selectfont{\NAME{}}}\hfill~
+\begin{center}
+\fontsize{40}{48}{\selectfont{\NAME{}}}
+\end{center}
\end{minipage}
\vfill
\noindent
\namefield{SCIPER: {\Large \bf \SCIPER{} }} \\
~ \\
\noindent
\textbf{Drehen Sie diese Seite nicht um, bevor Sie dazu aufgefordert werden.}
\textbf{Jedes Blatt hat eine Vorder- und eine R\"uckseite. Es gibt \totalPages\ Seiten, die letzten sind m\"oglicherweise leer.}
\textbf{L\"osen Sie nicht die Heftklammer.}
\begin{itemize}
\item[-] Legen Sie Ihren Studentenausweis auf den Tisch.
\item[-] Es sind \textbf{keine} Unterlagen zugelassen.
\item[-] Die Nutzung eines \textbf{Taschenrechners} oder jedes anderen elektronischen Hilfsmittels ist w\"ahrend der Pr\"ufung nicht gestattet.
\item[-] F\"ur die \textbf{Multiple Choice} Fragen erh\"alt man:
\begin{itemize}
\item [$+3$] Punkte, wenn die Antwort korrekt ist,
\item [0] Punkte, wenn die Frage nicht beantwortet ist oder mehrere M\"oglichkeiten angekreuzt sind, und
\item [$-1$] Punkt, wenn die Antwort falsch ist.
\end{itemize}
\item [-] F\"ur die \textbf{Wahr/Falsch }Fragen erh\"alt man:
\begin{itemize}
\item [$+1$] Punkt, wenn die Antwort korrekt ist,
\item [0] Punkte, wenn die Frage nicht beantwortet ist oder mehrere M\"oglichkeiten angekreuzt sind, und
\item [$-1$] Punkt, wenn die Antwort falsch ist.
\end{itemize}
\item[-] Benutzen Sie einen \textbf{Kugelschreiber} und falls n\"otig l\"oschen Sie mit Tipp-Ex sorgf\"altig aus.
\item[-] Beachten Sie bitte diese Richtlinien bei der Markierung \textbf{der Antworten}:
\end{itemize}
\hfill \includegraphics[scale=0.2]{good_bad_square} \hfill
% End of first page
diff --git a/data/templates/chemistry/en/first_page.tex b/data/templates/chemistry/en/first_page.tex
index aaccd14..5cf904e 100644
--- a/data/templates/chemistry/en/first_page.tex
+++ b/data/templates/chemistry/en/first_page.tex
@@ -1,55 +1,57 @@
% First page - ENGLISH
\noindent
\begin{minipage}[c]{350pt}
\bf \prof~-~\ExamName~-~\SECTION \\
~ \\
\bf \ExamDate~-~duration : \Time
\end{minipage}
\begin{minipage}[c]{100pt}
\includegraphics[scale=0.24]{Logo_EPFL}
\end{minipage}
\vfill
\begin{minipage}[c]{\textwidth}
\noindent
\hfill\fontsize{100}{120}{\selectfont{\ID{}}}\hfill
\vspace{1cm}
\par
\noindent
-\hfill\fontsize{40}{48}{\selectfont{\NAME{}}}\hfill~
+\begin{center}
+\fontsize{40}{48}{\selectfont{\NAME{}}}
+\end{center}
\end{minipage}
\vfill
\noindent
\namefield{SCIPER: {\Large \bf \SCIPER{} }} \\
~ \\
\noindent
\textbf{Do not turn the page before the start of the exam.}
\textbf{This document is double-sided, has \totalPages\ pages, the last ones possibly blank.}
\textbf{Do not unstaple.}
\medskip
\begin{itemize}
\item[-] Place your student card on your table.
\item[-] \textbf{No other paper materials} are allowed to be used during the exam.
\item[-] Using a \textbf{calculator} or any electronic device is not permitted during the exam.
\item[-] For the \textbf{multiple choice} questions, we give
\begin{itemize}
\item [$+3$] points if your answer is correct,
\item [$0$ ] points if you give no answer or more than one,
\item [$-1$] points if your answer is incorrect.
\end{itemize}
\item[-] For the \textbf{true/false} questions, we give
\begin{itemize}
\item [$+1$] points if your answer is correct,
\item [$0$ ] points if you give no answer or more than one,
\item [$-1$] points if your answer is incorrect.
\end{itemize}
\item[-] Use a \textbf{ballpen} and clearly erase with \textbf{correction fluid} if necessary.
\item[-] Observe these guidelines when \textbf{recording your answers}:
\end{itemize}
\hfill \includegraphics[scale=0.2]{good_bad_square} \hfill
% End of first page
diff --git a/data/templates/chemistry/fr/first_page.tex b/data/templates/chemistry/fr/first_page.tex
index 7197eae..57d6556 100644
--- a/data/templates/chemistry/fr/first_page.tex
+++ b/data/templates/chemistry/fr/first_page.tex
@@ -1,62 +1,64 @@
% First page - FRENCH
\noindent
\begin{minipage}[c]{350pt}
\bf\ExamName~-~\SECTION \\ %\prof
~ \\
\bf \ExamDate~-~durée : \Time
\end{minipage}
\begin{minipage}[c]{100pt}
\includegraphics[scale=0.24]{Logo_EPFL}
\end{minipage}
\vfill
\begin{minipage}[c]{\textwidth}
\noindent
\hfill\fontsize{100}{120}{\selectfont{\SEQ{}}}\hfill
\vspace{1cm}
\par
\noindent
\hfill\fontsize{40}{48}{\selectfont{\ROOM{}}}\hfill~
\vspace{1cm}
\par
\noindent
\centering
-\fontsize{40}{48}{\selectfont{\NAME{}}}~
+\begin{center}
+\fontsize{40}{48}{\selectfont{\NAME{}}}
+\end{center}
\end{minipage}
\vfill
\noindent
signature : $_{\rule{3cm}{0.1mm}}$\\
\\
\\
\noindent
\namefield{SCIPER: {\Large \bf \SCIPER{} }} - ID: {\Large \bf \ID{} }\\
~ \\
\noindent
\textbf{Attendez le d\'ebut de l'\'epreuve avant de tourner la page.}
\textbf{Ce document est imprim\'e recto-verso, il contient \totalPages\ pages, les derni\`eres pouvant \^etre vides.}
\textbf{Ne pas d\'egrafer.}
\medskip
\begin{itemize}
\item[-] Posez votre carte d'\'etudiant sur la table.
\item[-] L'utilisation d'une \textbf{calculatrice} et de tout outil \'electronique est interdite pendant l'\'epreuve.
%\item[-] Pour les questions \`a \textbf{choix multiple}, on comptera:
% \begin{itemize}
% \item [$+3$] points si la r\'eponse est correcte,
% \item [0] point si la question n'est pas r\'epondue ou s'il y a plusieurs croix,
% \item [$-1$] point si la r\'eponse est incorrecte.
% \end{itemize}
%\item [-]Pour les questions de type \textbf{vrai-faux}, on comptera:
% \begin{itemize}
% \item [$+1$] point si la r\'eponse est correcte,
% \item [0] point si la question n'est pas r\'epondue ou s'il y a plusieurs croix,
% \item [$-1$] point si la r\'eponse est incorrecte.
% \end{itemize}
\item[-] Utilisez un \textbf{stylo} et effacez proprement avec du \textbf{correcteur blanc} si n\'ecessaire.
\item[-] Respectez les consignes suivantes pour \textbf{marquer vos réponses} :
\end{itemize}
\hfill \includegraphics[scale=0.2]{good_bad_square} \hfill
%% End of first page
diff --git a/data/templates/linear-algebra/de/first_page.tex b/data/templates/linear-algebra/de/first_page.tex
index 1aa53bc..a77a9d6 100644
--- a/data/templates/linear-algebra/de/first_page.tex
+++ b/data/templates/linear-algebra/de/first_page.tex
@@ -1,49 +1,51 @@
% First page - GERMAN
\noindent
\begin{minipage}[c]{350pt}
\bf \prof~-~\ExamName~-~\SECTION \\
~ \\
\bf \ExamDate~-~Dauer: \Time
\end{minipage}
\begin{minipage}[c]{100pt}
\includegraphics[scale=0.24]{Logo_EPFL}
\end{minipage}
\vfill
\begin{minipage}[c]{\textwidth}
\noindent
\hfill\fontsize{100}{120}{\selectfont{\ID{}}}\hfill
\vspace{1cm}
\par
\noindent
-\hfill\fontsize{40}{48}{\selectfont{\NAME{}}}\hfill~
+\begin{center}
+\fontsize{40}{48}{\selectfont{\NAME{}}}
+\end{center}
\end{minipage}
\vfill
\noindent
\namefield{SCIPER: {\Large \bf \SCIPER{} }}%SIGNATURE \hfill Unterschrift:~\textcolor{light-Gray}{\rule{5cm}{1.5cm}}
\\ ~ \\
\noindent
\textbf{Drehen Sie diese Seite nicht um, bevor Sie dazu aufgefordert werden.}
\textbf{Jedes Blatt hat eine Vorder- und eine R\"uckseite. Es gibt \totalPages\ Seiten, die letzten sind m\"oglicherweise leer.}
\textbf{L\"osen Sie nicht die Heftklammern.}
\begin{itemize}
\item[--] Legen Sie Ihren Studentenausweis auf den Tisch.
\item[--] Es sind \textbf{keine} weiteren Unterlagen zugelassen.
\item[--] Die Nutzung eines \textbf{Taschenrechners} oder jedes anderen elektronischen Hilfsmittels ist w\"ahrend der Pr\"ufung nicht gestattet.
\item[--] F\"ur die \textbf{Multiple Choice} Fragen erh\"alt man:
\begin{itemize}
\item [$+3$] Punkte, wenn die Antwort richtig ist,
\item [$0$] Punkte, wenn die Frage nicht beantwortet ist oder mehrere M\"oglichkeiten angekreuzt sind, und
\item [$-1$] Punkt, wenn die Antwort falsch ist.
\end{itemize}
\item[--] Benutzen Sie einen \textbf{Kugelschreiber mit schwarzer oder blauer Tinte} und verwenden Sie Korrekturfl\"ussigkeit (z.B. Tipp-Ex) um bei Bedarf Ihre Antwort zu \"andern.
\item[--] Falls eine Fragestellung einen Fehler enth{\"a}lt, darf der/die Unterrichtende die entsprechende Frage annulieren.
\item[--] Beachten Sie bitte die unten stehenden Richtlinien zum Markieren \textbf{der Antworten}:
\end{itemize}
\hfill \includegraphics[scale=0.2]{good_bad_square} \hfill
% End of first page
diff --git a/data/templates/linear-algebra/en/first_page.tex b/data/templates/linear-algebra/en/first_page.tex
index e93aceb..fb7ffd5 100644
--- a/data/templates/linear-algebra/en/first_page.tex
+++ b/data/templates/linear-algebra/en/first_page.tex
@@ -1,50 +1,52 @@
% First page - ENGLISH
\noindent
\begin{minipage}[c]{350pt}
\bf \prof~-~\ExamName~-~\SECTION \\
~ \\
\bf \ExamDate~-~duration: \Time
\end{minipage}
\begin{minipage}[c]{100pt}
\includegraphics[scale=0.24]{Logo_EPFL}
\end{minipage}
\vfill
\begin{minipage}[c]{\textwidth}
\noindent
\hfill\fontsize{100}{120}{\selectfont{\ID{}}}\hfill
\vspace{1cm}
\par
\noindent
-\hfill\fontsize{40}{48}{\selectfont{\NAME{}}}\hfill~
+\begin{center}
+\fontsize{40}{48}{\selectfont{\NAME{}}}
+\end{center}
\end{minipage}
\vfill
\noindent
\namefield{SCIPER: {\Large \bf \SCIPER{} }}%SIGNATURE \hfill Signature:~\textcolor{light-Gray}{\rule{5cm}{1.5cm}}
\\ ~ \\
\noindent
\textbf{Do not turn the page before the start of the exam.}
\textbf{This document is double-sided, has \totalPages\ pages, the last ones possibly blank.}
\textbf{Do not unstaple.}
\medskip
\begin{itemize}
\item[--] Place your student card on your table.
\item[--] \textbf{No other paper materials} are allowed to be used during the exam.
\item[--] Using a \textbf{calculator} or any electronic device is not permitted during the exam.
\item[--] For the \textbf{multiple choice} questions, we give
\begin{itemize}
\item [$+3$] points if your answer is correct,
\item [$0$] points if you give no answer or more than one,
\item [$-1$] points if your answer is incorrect.
\end{itemize}
\item[--] Use a \textbf{black or dark blue ballpen} and clearly erase with \textbf{correction fluid} if necessary.
\item[--] If a question is wrong, the teacher may decide to nullify it.
\item[--] Observe these guidelines when \textbf{recording your answers}:
\end{itemize}
\hfill \includegraphics[scale=0.2]{good_bad_square} \hfill
% End of first page
diff --git a/data/templates/linear-algebra/fr/first_page.tex b/data/templates/linear-algebra/fr/first_page.tex
index 2bae247..990c5ac 100644
--- a/data/templates/linear-algebra/fr/first_page.tex
+++ b/data/templates/linear-algebra/fr/first_page.tex
@@ -1,50 +1,53 @@
% First page - FRENCH
\noindent
\begin{minipage}[c]{350pt}
\bf \prof~-~\ExamName~-~\SECTION \\
~ \\
\bf \ExamDate~-~durée\,: \Time
\end{minipage}
\begin{minipage}[c]{100pt}
\includegraphics[scale=0.24]{Logo_EPFL}
\end{minipage}
\vfill
\begin{minipage}[c]{\textwidth}
\noindent
\hfill\fontsize{100}{120}{\selectfont{\ID{}}}\hfill
\vspace{1cm}
\par
\noindent
-\hfill\fontsize{40}{48}{\selectfont{\NAME{}}}\hfill~
+\begin{center}
+\fontsize{40}{48}{\selectfont{\NAME{}}}
+\end{center}
+%\hfill\fontsize{40}{48}{\selectfont{\NAME{}}}\hfill~
\end{minipage}
\vfill
\noindent
\namefield{SCIPER\,: {\Large \bf \SCIPER{} }}%SIGNATURE \hfill Signature\,:~\textcolor{light-Gray}{\rule{5cm}{1.5cm}}
\\ ~ \\
\noindent
\textbf{Attendez le d\'ebut de l'\'epreuve avant de tourner la page.}
\textbf{Ce document est imprim\'e recto-verso, il contient \totalPages\ pages, les derni\`eres pouvant \^etre vides.}
\textbf{Ne~pas d\'egrafer.}
\medskip
\begin{itemize}
\item[--] Posez votre carte d'\'etudiant sur la table.
\item[--] \textbf{Aucun} document n'est autoris\'{e}.
\item[--] L'utilisation d'une \textbf{calculatrice} et de tout outil \'electronique est interdite pendant l'\'epreuve.
\item[--] Pour les questions \`a \textbf{choix multiple}, on comptera\,:
\begin{itemize}
\item [$+3$] points si la r\'eponse est correcte,
\item [$0$] point si la question n'est pas r\'epondue ou s'il y a plusieurs croix,
\item [$-1$] point si la r\'eponse est incorrecte.
\end{itemize}
\item[--] Utilisez un \textbf{stylo} \`a encre \textbf{noire ou bleu fonc\'e} et effacez proprement avec du\linebreak\textbf{correcteur blanc} si n\'ecessaire.
\item[--] Si une question est erronée, l'enseignant se réserve le droit de l'annuler.
\item[--] Respectez les consignes suivantes pour \textbf{marquer vos réponses}\,:
\end{itemize}
\hfill \includegraphics[scale=0.2]{good_bad_square} \hfill
%% End of first page
diff --git a/data/templates/maths/de/first_page.tex b/data/templates/maths/de/first_page.tex
index 978c660..d42ddd3 100644
--- a/data/templates/maths/de/first_page.tex
+++ b/data/templates/maths/de/first_page.tex
@@ -1,55 +1,57 @@
% First page - GERMAN
\noindent
\begin{minipage}[c]{350pt}
\bf \prof~-~\ExamName~-~\SECTION \\
~ \\
\bf \ExamDate~-~Dauer: \Time
\end{minipage}
\begin{minipage}[c]{100pt}
\includegraphics[scale=0.24]{Logo_EPFL}
\end{minipage}
\vfill
\begin{minipage}[c]{\textwidth}
\noindent
\hfill\fontsize{100}{120}{\selectfont{\ID{}}}\hfill
\vspace{1cm}
\par
\noindent
-\hfill\fontsize{40}{48}{\selectfont{\NAME{}}}\hfill~
+\begin{center}
+\fontsize{40}{48}{\selectfont{\NAME{}}}
+\end{center}
\end{minipage}
\vfill
\noindent
\namefield{SCIPER: {\Large \bf \SCIPER{} }}%SIGNATURE \hfill Unterschrift:~\textcolor{light-Gray}{\rule{5cm}{1.5cm}}
\\ ~ \\
\noindent
\textbf{Drehen Sie diese Seite nicht um, bevor Sie dazu aufgefordert werden.}
\textbf{Jedes Blatt hat eine Vorder- und eine R\"uckseite. Es gibt \totalPages\ Seiten, die letzten sind m\"oglicherweise leer.}
\textbf{L\"osen Sie nicht die Heftklammern.}
\begin{itemize}
\item[--] Legen Sie Ihren Studentenausweis auf den Tisch.
\item[--] Es sind \textbf{keine} weiteren Unterlagen zugelassen.
\item[--] Die Nutzung eines \textbf{Taschenrechners} oder jedes anderen elektronischen Hilfsmittels ist w\"ahrend der Pr\"ufung nicht gestattet.
\item[--] F\"ur die \textbf{Multiple Choice} Fragen erh\"alt man:
\begin{itemize}
\item [$+3$] Punkte, wenn die Antwort richtig ist,
\item [$0$] Punkte, wenn die Frage nicht beantwortet ist oder mehrere M\"oglichkeiten angekreuzt sind, und
\item [$-1$] Punkt, wenn die Antwort falsch ist.
\end{itemize}
\item[--] F\"ur die \textbf{Wahr/Falsch }Fragen erh\"alt man:
\begin{itemize}
\item [$+1$] Punkt, wenn die Antwort richtig ist,
\item [$0$] Punkte, wenn die Frage nicht beantwortet ist oder mehrere M\"oglichkeiten angekreuzt sind, und
\item [$-1$] Punkt, wenn die Antwort falsch ist.
\end{itemize}
\item[--] Benutzen Sie einen \textbf{Kugelschreiber mit schwarzer oder blauer Tinte} und verwenden Sie Korrekturfl\"ussigkeit (z.B. Tipp-Ex) um bei Bedarf Ihre Antwort zu \"andern.
\item[--] Falls eine Fragestellung einen Fehler enth{\"a}lt, darf der/die Unterrichtende die entsprechende Frage annulieren.
\item[--] Beachten Sie bitte die unten stehenden Richtlinien zum Markieren \textbf{der Antworten}:
\end{itemize}
\hfill \includegraphics[scale=0.2]{good_bad_square} \hfill
% End of first page
diff --git a/data/templates/maths/en/first_page.tex b/data/templates/maths/en/first_page.tex
index 618f488..333a1ce 100644
--- a/data/templates/maths/en/first_page.tex
+++ b/data/templates/maths/en/first_page.tex
@@ -1,56 +1,58 @@
% First page - ENGLISH
\noindent
\begin{minipage}[c]{350pt}
\bf \prof~-~\ExamName~-~\SECTION \\
~ \\
\bf \ExamDate~-~duration: \Time
\end{minipage}
\begin{minipage}[c]{100pt}
\includegraphics[scale=0.24]{Logo_EPFL}
\end{minipage}
\vfill
\begin{minipage}[c]{\textwidth}
\noindent
\hfill\fontsize{100}{120}{\selectfont{\ID{}}}\hfill
\vspace{1cm}
\par
\noindent
-\hfill\fontsize{40}{48}{\selectfont{\NAME{}}}\hfill~
+\begin{center}
+\fontsize{40}{48}{\selectfont{\NAME{}}}
+\end{center}
\end{minipage}
\vfill
\noindent
\namefield{SCIPER: {\Large \bf \SCIPER{} }}%SIGNATURE \hfill Signature:~\textcolor{light-Gray}{\rule{5cm}{1.5cm}}
\\ ~ \\
\noindent
\textbf{Do not turn the page before the start of the exam.}
\textbf{This document is double-sided, has \totalPages\ pages, the last ones possibly blank.}
\textbf{Do not unstaple.}
\medskip
\begin{itemize}
\item[--] Place your student card on your table.
\item[--] \textbf{No other paper materials} are allowed to be used during the exam.
\item[--] Using a \textbf{calculator} or any electronic device is not permitted during the exam.
\item[--] For the \textbf{multiple choice} questions, we give
\begin{itemize}
\item [$+3$] points if your answer is correct,
\item [$0$] points if you give no answer or more than one,
\item [$-1$] points if your answer is incorrect.
\end{itemize}
\item[--] For the \textbf{true/false} questions, we give
\begin{itemize}
\item [$+1$] points if your answer is correct,
\item [$0$] points if you give no answer or more than one,
\item [$-1$] points if your answer is incorrect.
\end{itemize}
\item[--] Use a \textbf{black or dark blue ballpen} and clearly erase with \textbf{correction fluid} if necessary.
\item[--] If a question is wrong, the teacher may decide to nullify it.
\item[--] Observe these guidelines when \textbf{recording your answers}:
\end{itemize}
\hfill \includegraphics[scale=0.2]{good_bad_square} \hfill
% End of first page
diff --git a/data/templates/maths/fr/first_page.tex b/data/templates/maths/fr/first_page.tex
index 48bf326..9d70926 100644
--- a/data/templates/maths/fr/first_page.tex
+++ b/data/templates/maths/fr/first_page.tex
@@ -1,56 +1,58 @@
% First page - FRENCH
\noindent
\begin{minipage}[c]{350pt}
\bf \prof~-~\ExamName~-~\SECTION \\
~ \\
\bf \ExamDate~-~durée\,: \Time
\end{minipage}
\begin{minipage}[c]{100pt}
\includegraphics[scale=0.24]{Logo_EPFL}
\end{minipage}
\vfill
\begin{minipage}[c]{\textwidth}
\noindent
\hfill\fontsize{100}{120}{\selectfont{\ID{}}}\hfill
\vspace{1cm}
\par
\noindent
-\hfill\fontsize{40}{48}{\selectfont{\NAME{}}}\hfill~
+\begin{center}
+\fontsize{40}{48}{\selectfont{\NAME{}}}
+\end{center}
\end{minipage}
\vfill
\noindent
\namefield{SCIPER\,: {\Large \bf \SCIPER{} }}%SIGNATURE \hfill Signature\,:~\textcolor{light-Gray}{\rule{5cm}{1.5cm}}
\\ ~ \\
\noindent
\textbf{Attendez le d\'ebut de l'\'epreuve avant de tourner la page.}
\textbf{Ce document est imprim\'e recto-verso, il contient \totalPages\ pages, les derni\`eres pouvant \^etre vides.}
\textbf{Ne~pas d\'egrafer.}
\medskip
\begin{itemize}
\item[--] Posez votre carte d'\'etudiant sur la table.
\item[--] \textbf{Aucun} document n'est autoris\'{e}.
\item[--] L'utilisation d'une \textbf{calculatrice} et de tout outil \'electronique est interdite pendant l'\'epreuve.
\item[--] Pour les questions \`a \textbf{choix multiple}, on comptera\,:
\begin{itemize}
\item [$+3$] points si la r\'eponse est correcte,
\item [$0$] point si la question n'est pas r\'epondue ou s'il y a plusieurs croix,
\item [$-1$] point si la r\'eponse est incorrecte.
\end{itemize}
\item[--]Pour les questions de type \textbf{vrai-faux}, on comptera\,:
\begin{itemize}
\item [$+1$] point si la r\'eponse est correcte,
\item [$0$] point si la question n'est pas r\'epondue ou s'il y a plusieurs croix,
\item [$-1$] point si la r\'eponse est incorrecte.
\end{itemize}
\item[--] Utilisez un \textbf{stylo} \`a encre \textbf{noire ou bleu fonc\'e} et effacez proprement avec du\linebreak\textbf{correcteur blanc} si n\'ecessaire.
\item[--] Si une question est erronée, l'enseignant se réserve le droit de l'annuler.
\item[--] Respectez les consignes suivantes pour \textbf{marquer vos réponses}\,:
\end{itemize}
\hfill \includegraphics[scale=0.2]{good_bad_square} \hfill
%% End of first page
diff --git a/lib/bash/bamc_students.sh b/lib/bash/bamc_students.sh
index 4a151d7..5eec010 100644
--- a/lib/bash/bamc_students.sh
+++ b/lib/bash/bamc_students.sh
@@ -1,143 +1,144 @@
#!/bin/bash
function action_students() {
local rc=0 item
while [ $# -gt 0 ]; do
item=$1
assert_exam $item; if [ $? -ne 0 ]; then ((rc++)); shift; continue; fi
assert_project $item; if [ $? -ne 0 ]; then ((rc++)); shift; continue; fi
assert_template; if [ $? -ne 0 ]; then ((rc++)); shift; continue; fi
perma "Preparing student list for '$item'"
local exam=$DIR_WORKSPACE/$DIR_EXAMS/$item
local project=$DIR_WORKSPACE/$DIR_PROJECTS/$item
local lang=$(get_lang $item)
local conf=$exam/$FILE_EXAM
local IFS=$'\n' key_val
# First page of the list
verbose "Adding cover page"
cp $DIR_DATA/list/$lang/list.tex $project/list.tex
for key_val in $(cat $conf); do
pattern="#$(echo $key_val | cut -d ':' -f 1)#"
string=$(echo $key_val | cut -d ':' -f 2-)
replace_in_file $pattern $string $project/list.tex
done
# Rows (list content)
local rows=$project/rows.tex
rm -f $rows
local i=0 tab=1 prev_section='' line id name sciper section comment
# Autodetect colums
local COLS=$(head -n 1 $project/$FILE_STUDENTS)
local COL_ID=$( echo $COLS | tr ',' '\n' | grep -n "^ID$" | cut -d ':' -f 1)
local COL_SEQ=$( echo $COLS | tr ',' '\n' | grep -n "^SEQ$" | cut -d ':' -f 1)
local COL_ROOM=$( echo $COLS | tr ',' '\n' | grep -n "^ROOM$" | cut -d ':' -f 1)
local COL_NAME=$( echo $COLS | tr ',' '\n' | grep -n "^NAME$" | cut -d ':' -f 1)
local COL_SCIPER=$( echo $COLS | tr ',' '\n' | grep -n "^SCIPER$" | cut -d ':' -f 1)
local COL_EMAIL=$( echo $COLS | tr ',' '\n' | grep -n "^EMAIL$" | cut -d ':' -f 1)
local COL_STATUS=$( echo $COLS | tr ',' '\n' | grep -n "^STATUS$" | cut -d ':' -f 1)
local COL_SECTION=$(echo $COLS | tr ',' '\n' | grep -n "^SECTION$" | cut -d ':' -f 1)
for line in $(tail -n +2 $project/$FILE_STUDENTS); do
((i++))
# id field
id=$(echo $line | cut -d ',' -f $COL_ID)
id=$(printf "%3s" $id)
id=$(echo $id | sed "s/ /~/g")
# name field
name=$(echo $line | cut -d ',' -f $COL_NAME)
if [ $(echo -n $name | wc -c) -gt 30 ]; then name=$(echo $name | cut -c 1-$LIST_MAX_CHAR)"…"; fi
# sciper, section and comment field
sciper=$(echo $line | cut -d ',' -f $COL_SCIPER)
section=$(echo $line | cut -d ',' -f $COL_SECTION)
comment=$(echo $line | cut -d ',' -f $COL_STATUS)
if [ -n "$COL_ROOM" ]; then room=$(echo $line | cut -d ',' -f $COL_ROOM); fi
if [ -n "$COL_SEQ" ]; then seq=$( echo $line | cut -d ',' -f $COL_SEQ) ; fi
# Special cases
if [ "$comment" == "n/a" ]; then comment=''; fi
if [ "$comment" == "OK" ]; then comment=''; fi
# add local SEQ/ROOM if known
if [ -n "$seq" ]; then
if [ -n "$comment" ]; then
comment="\#$seq @ $room / $comment"
else
comment="\#$seq @ $room"
fi
fi
-
+
# Final formatting
name=$(printf "%-30s" $name)
name=$(echo $name | sed "s/ /~/g")
# Do we need to start a new table ? (first page or new page)
if [ $tab -eq 1 ]; then
verbose "Starting new table (at student #$id)"
cat $DIR_DATA/list/$lang/start_tab.tex >> $rows
tab=0
fi
# Need for a new table ??
if [ "$section" != "$prev_section" ]; then
if [ $i -ne 1 ]; then
verbose "This is a different section, starting new table (at student #$id)"
cat $DIR_DATA/list/$lang/end_tab.tex >> $rows
cat $DIR_DATA/list/$lang/start_tab.tex >> $rows
i=1
fi
prev_section=$section
fi
# Insert row in tex file
echo "\texttt{$id} & \texttt{$sciper} & \texttt{$section} & \texttt{$name} & & & {\tiny \texttt{$comment}} "'\\ \hline' >> $rows
# Page is complete ?
if [ $(($i % 50)) -eq 0 ]; then
verbose "Page is full after $i students (at student #$id)"
cat $DIR_DATA/list/$lang/end_tab.tex >> $rows
tab=1
fi
done
# Finish table if needed
if [ $(($i % 50)) -ne 0 ]; then
verbose "Closing table after last student (at student #$id)"
cat $DIR_DATA/list/$lang/end_tab.tex >> $rows
fi
# Compile list.tex
local cwd=$(pwd)
cd $project
# Run pdflatex twice to get total number of pages
#pdflatex list.tex > /dev/null 2>&1 && pdflatex list.tex > /dev/null 2>&1
- pdflatex -interaction=nonstopmode list.tex > /dev/null 2>&1
+ pdflatex -interaction=nonstopmode list.tex > /dev/null 2>&1 && pdflatex -interaction=nonstopmode list.tex > /dev/null 2>&1
+
if [ $? -eq 0 ]; then pdflatex -interaction=nonstopmode list.tex > /dev/null 2>&1; fi
cd $cwd
check_file_exists $project/list.pdf
if [ $? -ne 0 ]; then error "List not generated"; ((rc++)); shift; continue; fi
# Prepare output dir
mkdir -p $DIR_WORKSPACE/$DIR_STUDENTS
# Copy PDF and CSV file
cp $project/list.pdf $DIR_WORKSPACE/$DIR_STUDENTS/STUDENTS-$item-${lang}.pdf
cp $project/$FILE_STUDENTS $DIR_WORKSPACE/$DIR_STUDENTS/STUDENTS-$item-${lang}.csv
# Move on to the next item
shift
done
return $rc
}
# EOF
diff --git a/local/stats/amcstats b/local/stats/amcstats
index 2933968..a98b788 100755
--- a/local/stats/amcstats
+++ b/local/stats/amcstats
@@ -1,273 +1,274 @@
#!/usr/bin/env php
Notes:
- Script has be be executable (chmod +x).
- INPUT: total points for the student as first parameter (can be negative if negative marking has been used)
- OUTPUT: non-rounded mark, with '.' as decimal separator
";
exit;
}
if (!empty($options['current-dir'])) {
$total_points = $options['current-dir'];
$filename = array();
foreach(scandir('./') as $f) if (preg_match('/\.csv$/', $f)) $filename[] = $f;
if (count($filename)) {
$csv = "";
$first = true;
foreach($filename as $f) {
if (!$first) $csv .= ',';
$csv .= ucfirst(preg_replace('/\.csv$/', '', $f));
$csv .= "/$f/$total_points";
$first = false;
}
} else {
echo "No AMC stat files found in this directory.\n";
exit;
}
}
$only_questions = null;
if (!empty($options['only-questions'])) {
$filename = $options['only-questions'];
if(!is_file($filename)) {
echo "File not found: $filename\n";
exit;
}
$only_questions = file($filename, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
}
$external = null;
if (!empty($options['external'])) {
$external = $options['external'];
if(!is_file($external)) {
echo "External script/exec not found: $external\n";
exit;
}
}
$inverse_filter = false;
if (array_key_exists('inverse-filter', $options)) {
$inverse_filter = true;
}
if (!empty($options['csv'])) $csv = $options['csv'];
if (!empty($options['sample'])) $samples = explode(',', $options['sample']); else $samples = array( 'global');
if (!empty($options['type'])) $types = explode(',', $options['type']); else $types = array( 'average' );
// Create ExamCalcs object
$Global = new ExamCalcs();
// Load files
$loaded = array();
foreach(explode(',', $csv) as $file_info) {
$details = explode('/', $file_info);
if (count($details) < 3 ) {
echo "CSV file list should look like: tournesol/tournesol.csv/30[,favre@favre.csv@29,...]\n";
exit;
}
$name = $details[0];
$filename = $details[1];
$total = $details[2];
if(!is_file($filename)) {
echo "File not found: $filename\n";
exit;
}
if (in_array($filename, $loaded)) {
echo "Trying to load $filename a second time...\n";
exit;
}
$Global->addFile($name, $filename, $total, $only_questions, $inverse_filter, $external);
$loaded[] = $filename;
}
foreach ($types as $type) {
// Build samples
foreach ($samples as $sample) {
// Print header
$sample_header = strtoupper($sample);
switch ($type) {
case 'average':
printAverage($sample_header);
break;
case 'dist':
case 'dist_percentage':
printDistribution($sample_header);
break;
case 'marks':
break;
}
// Build samples
$Samples = array();
switch ($sample) {
case 'global':
$Samples['global'] = new ExamCalcs($Global->getDataSet());
break;
case 'sections':
foreach ($Global->getSections() as $section) {
$tmpSample = new ExamCalcs($Global->getDataSet());
$tmpSample->filterBySections($section);
$Samples[$section] = $tmpSample;
}
break;
case 'profs':
foreach ($Global->getTeachers() as $prof) {
$tmpSample = new ExamCalcs($Global->getDataSet());
$tmpSample->filterByTeachers($prof);
$Samples[$prof] = $tmpSample;
}
break;
}
// Print stats
$is_first = true;
foreach ($Samples as $name => $S) {
+
if (!$is_first) echo "\n"; else $is_first = false;
$stats = $S->getStats();
switch ($type) {
case 'average':
printAverage($name, $stats);
break;
case 'dist_percentage':
printDistribution($name, $stats, true);
break;
case 'dist':
printDistribution($name, $stats);
break;
case 'discrimination':
echo "\"STATS ON QUESTIONS: ".strtoupper($name)."\"\n";
try {
$S->printStatsOnCommonItems();
} catch (Exception $e) {
echo "\"Not enough data\"\n";
}
break;
case 'marks':
$marks = $S->getMarks();
foreach ($marks as $student) {
echo implode(';', $student)."\n";
}
break;
case 'questions':
$questions = $S->getQuestions();
foreach ($questions as $student) {
echo implode(';', $student)."\n";
}
break;
}
}
}
}
exit;
?>
diff --git a/local/stats/lib/lib_amcstats.php b/local/stats/lib/lib_amcstats.php
index c7e9557..6a26c7c 100755
--- a/local/stats/lib/lib_amcstats.php
+++ b/local/stats/lib/lib_amcstats.php
@@ -1,629 +1,630 @@
filename = $filename;
$this->teacher = $teacher;
$this->exam_points = $exam_points;
$raw_data = file($this->filename, FILE_IGNORE_NEW_LINES);
$this->raw_data = array();
foreach($raw_data as $line) {
- $line = array_map("clean_array", explode(';', $line));
+ $line = array_map("clean_array", explode(';', $line));
$line = array_map("decimal_conversion", $line);
$this->raw_data[] = $line;
- }
+ }
$this->parseHeader();
$this->parseStudents($only_questions, $inverse_filter, $external);
}
public function getStudents() {
return $this->students;
}
protected function parseHeader() {
- foreach($this->raw_data[0] as $col_id => $value) {
+ foreach($this->raw_data[0] as $col_id => $value) {
// Analyse header from CSV file, based on content
$item = array();
switch ($value) {
case "ID":
case "NAME":
case "EMAIL":
case "SECTION":
case "Mark":
$item['name'] = $value;
$item['type'] = "info";
break;
case "SCIPER":
$item['name'] = $value;
$item['type'] = "unique_id";
break;
default:
$item['name'] = $value;
if (preg_match('/^TICKED:/', $value)) {
$item['name'] = preg_replace('/^TICKED:/', '', $value);
$item['type'] = "ticked";
} else {
$item['type'] = "question";
$item['subtype'] = $this->guessSubtype($col_id);
}
}
// Stats will be computed at a later stage
$item['stats'] = null;
$this->columns[] = $item;
}
}
protected function guessSubtype($col_id) {
$subtype = null;
$min_points = 0;
$max_points = 0;
$decimal = false;
+
foreach($this->raw_data as $line) {
if (preg_match('/\./', $line[$col_id])) $decimal = true;
if ($line[$col_id] > $max_points) $max_points = $line[$col_id];
}
// This only works for MATHS exams...
if ($decimal or $max_points > 3) {
// Only open questions have decimal points
return 'open';
}
+
if ($max_points == 3) return 'mc';
if ($max_points == 1) return 'tf';
return 'unknown';
}
protected function getColIdByName($name) {
foreach ($this->columns as $id => $col) if ($col['name'] == $name) return $id;
throw new Exception('Column not found: '.$name);
}
protected function getColIdsByType($type, $name = null) {
$ids = array();
if (is_null($name)) {
foreach ($this->columns as $id => $col) if ($col['type'] == $type) $ids[] = $id;
} else {
foreach ($this->columns as $id => $col) if ($col['type'] == $type and $col['name'] == $name) $ids[] = $id;
}
if (count($ids) == 0) {
if (is_null($name)) throw new Exception('Column type not found: '.$type);
throw new Exception('Column type not found: '.$type.'/'.$name);
}
if (count($ids) == 1) return $ids[0];
return $ids;
}
protected function getQuestionNameByColId($id) {
if (array_key_exists($id, $this->columns) and $this->columns[$id]['type'] == 'question')
return $this->columns[$id]['name'];
throw new Exception('Column not found, or is not a question: '.$id);
}
protected function getMaximumPointsByColId($id) {
$maximum = 0.0;
foreach($this->raw_data as $student) if ((float)$student[$id] > $maximum) $maximum = (float)$student[$id];
return $maximum;
}
protected function parseStudents($only_questions, $inverse_filter, $external) {
foreach($this->raw_data as $line => $student) {
if ($line == 0) continue; // skip header
$data = array('teacher' => $this->teacher);
foreach(array('ID', 'SCIPER', 'NAME', 'EMAIL', 'SECTION') as $key) {
$data[$key] = $student[$this->getColIdByName($key)];
}
// Get points
$points = array();
$data['items'] = array();
foreach($this->getColIdsByType('question') as $col) {
$item = array();
$item['name'] = $this->getQuestionNameByColId($col);
// Should we filter this question ?
if (is_null($only_questions)
or (!$inverse_filter and in_array($item['name'], $only_questions))
or ($inverse_filter and !in_array($item['name'], $only_questions))
) {
// Take this question into account
$item['points'] = (float)$student[$col];
$item['max_points'] = $this->getMaximumPointsByColId($col);
if ($item['max_points'] == 0) {
// Cancelled question ? Count it right for everyone
$item['right'] = 1;
} else {
$item['right'] = max((float)($item['points']/$item['max_points']), 0.0);
}
$points[] = $item['points'];
$item['ticked'] = $student[$this->getColIdsByType('ticked', $item['name'])];
$item['type'] = $this->columns[$col]['type'];
$item['subtype'] = $this->columns[$col]['subtype'];
$data['items'][] = $item;
}
}
$data['total'] = array_sum($points);
$data['present'] = (int)(array_sum(array_map("square", $points))>0);
$data['exam_points'] = $this->exam_points;
-
// Compute marks
if ($data['present']) {
$data['positive_total'] = (float)max($data['total'], 0.0);
if (is_null($external)) {
$data['mark6'] = (float)min($data['positive_total']/($this->exam_points)*5.0+1, 6.0);
} else {
$output = array();
exec("./".$external." ".$data['total'], $output);
$data['mark6'] = (float)trim($output[0]);
}
$data['quarter_mark6'] = (float)round($data['mark6']*4.0, 0)/4.0;
} else {
$data['positive_total'] = 'n/a';
$data['mark6'] = 'abs';
$data['quarter_mark6'] = 'abs';
}
if (preg_match('/^FAKE/', $data['SCIPER'])) {
if ($data['present']) $data['type'] = 'unregistered';
else $data['type'] = 'unused';
} else $data['type'] = 'student';
$this->students[] = $data;
}
}
}
// Compare students on total (higher to lower)
function cmp_total($a, $b)
{
if ($a['total'] == $b['total']) {
return 0;
}
return ($a['total'] < $b['total']) ? 1 : -1;
}
class ExamCalcs {
protected $dataset = null;
protected $tmp_dataset = null;
public function __construct($dataset = null) {
$this->dataset = array();
if (!is_null($dataset)) $this->dataset = $dataset;
}
public function addFile($teacher, $teacher_file, $max_points, $only_questions = null, $inverse_filter = false, $external = null) {
#echo "Adding $teacher ($teacher_file) to the dataset ($max_points points).\n";
$AR = new AmcReader($teacher_file, $teacher, $max_points, $only_questions, $inverse_filter, $external);
$this->addDataSet($AR->getStudents());
}
public function addDataSet($data) {
foreach ($data as $student) $this->dataset[] = $student;
}
public function filterBySections($sections, $update = true) {
$dataset = array();
foreach ($this->dataset as $student) {
if (is_array($sections)) {
if (in_array($student['SECTION'], $sections))
$dataset[] = $student;
} else {
if ($student['SECTION'] == $sections)
$dataset[] = $student;
}
}
if ($update) $this->dataset = $dataset;
return $dataset;
}
public function filterByTeachers($teachers, $update = true) {
$dataset = array();
foreach ($this->dataset as $student) {
if (is_array($teachers)) {
if (in_array($student['teacher'], $teachers))
$dataset[] = $student;
} else {
if ($student['teacher'] == $teachers)
$dataset[] = $student;
}
}
if ($update) $this->dataset = $dataset;
return $dataset;
}
public function getTeachers() {
$teachers = array();
foreach ($this->dataset as $student) {
if (!in_array($student['teacher'], $teachers)) $teachers[] = $student['teacher'];
}
return $teachers;
}
public function getSections() {
$sections = array();
foreach ($this->dataset as $student) {
$section = $student['SECTION'];
if (!in_array($section, $sections) and $section != 'XXX') $sections[] = $section;
}
return $sections;
}
public function printStatsOnCommonItems() {
// Sort dataset by points
$dataset = $this->sortByTotalPoints(false);
if (count($dataset) < 3) throw new Exception('Dataset is too small.');
// Get items from the first student
$items = array();
foreach ($this->dataset[0]['items'] as $item) $items[] = $item['name'];
foreach ($dataset as $student) {
// Get items for current student
$tmp_items = array();
foreach ($student['items'] as $item) $tmp_items[] = $item['name'];
// Keep only items in both '$items' AND '$tmp_items'
$items = array_intersect($items, $tmp_items);
}
// Now, filter items in the dataset
$filtered_dataset = array();
foreach ($dataset as $student) {
if (!$student['present']) continue;
$filtered_items = array();
foreach ($student['items'] as $item) {
if (in_array($item['name'], $items)) $filtered_items[] = $item;
}
if (count($filtered_items)) {
$student['items'] = $filtered_items;
$filtered_dataset[] = $student;
}
}
$dataset = $filtered_dataset;
if (count($dataset) < 3) throw new Exception('Dataset is too small.');
// Compute limits
$nb_students = count($dataset);
$twenty_seven = (int)($nb_students*27.0/100);
$upper_stop = $twenty_seven-1;
$lower_start = $nb_students-$twenty_seven+1;
#echo "$nb_students / $twenty_seven / 0 -> $upper_stop / $lower_start -> $nb_students \n";
$stats = array();
foreach ($dataset as $i => $student) {
foreach ($student['items'] as $item) {
$name = $item['name'];
if (!array_key_exists($name, $stats))
$stats[$name] = array( '27%' => $twenty_seven,
'upper' => 0,
'lower' => 0,
'valid' => null,
'ticked'=> null,
'ticked_count'=> 0,
'empty_count'=> 0,
'type' => null,
'subtype' => null,
'max_points' => null,
);
$stats[$name]['max_points'] = $item['max_points'];
$stats[$name]['type'] = $item['type'];
$stats[$name]['subtype'] = $item['subtype'];
// Initialise 'ticked' table
if (is_null($stats[$name]['ticked'])) {
switch ($stats[$name]['subtype']) {
case 'mc':
$stats[$name]['ticked'] = array( 'A' => 0, 'B' => 0, 'C' => 0, 'D' => 0, 'multiple' => 0);
break;
case 'tf':
$stats[$name]['ticked'] = array( 'TRUE' => 0, 'FALSE' => 0, 'multiple' => 0);
break;
default:
$stats[$name]['ticked'] = array();
break;
}
}
// Count right answers
if ($item['right'] > 0) {
// Save valid answer
if (is_null($stats[$name]['valid'])) {
switch ($stats[$name]['subtype']) {
case 'tf':
if ($item['ticked'] == 'A')
$stats[$name]['valid'] = 'TRUE';
else
$stats[$name]['valid'] = 'FALSE';
break;
case 'mc':
$stats[$name]['valid'] = $item['ticked'];
break;
case 'open':
$stats[$name]['valid'] = 'n/a';
break;
default:
$stats[$name]['valid'] = 'n/a';
break;
}
}
// 'upper 27%' and 'lower 27%' counters
switch ($stats[$name]['subtype']) {
case 'mc':
case 'tf':
if ($i <= $upper_stop) $stats[$name]['upper']++;
if ($i >= $lower_start) $stats[$name]['lower']++;
break;
case 'open':
if ($i <= $upper_stop) $stats[$name]['upper'] += $item['points'];
if ($i >= $lower_start) $stats[$name]['lower'] += $item['points'];
break;
}
}
// Count empty answers
if (empty($item['ticked'])) {
$stats[$name]['empty_count']++;
} else {
// Stats on non-empty answers
$stats[$name]['ticked_count']++;
if (strlen($item['ticked']) > 1) {
$stats[$name]['ticked'] = $this->createAndIncrement($stats[$name]['ticked'], 'multiple');
} else {
switch ($item['subtype']) {
case 'tf':
if ($item['ticked'] == 'A') $field = 'TRUE';
if ($item['ticked'] == 'B') $field = 'FALSE';
$stats[$name]['ticked'] = $this->createAndIncrement($stats[$name]['ticked'], $field);
break;
case 'mc':
$stats[$name]['ticked'] = $this->createAndIncrement($stats[$name]['ticked'], $item['ticked']);
break;
default:
$stats[$name]['ticked'] = $this->createAndIncrement($stats[$name]['ticked'], $item['ticked']);
break;
}
}
}
}
}
// Compute more stats
$tmp = array();
foreach ($stats as $name => $stat) {
// Discrimination index
// For open questions, change the '27%' value.
if ($stat['subtype'] == 'open') $stat['27%'] = $stat['27%']*$stat['max_points'];
$stat['DI'] = ($stat['upper']-$stat['lower'])/(1.0*$stat['27%']);
// Calculate percentages
$ticked_percentage = array();
foreach ($stat['ticked'] as $t => $n) {
$ticked_percentage[$t] = array( 'n' => $n, '%' => (float)(100.0*$n/$stat['ticked_count']), 'valid' => (int)($t == $stat['valid']));
}
$stat['ticked'] = $ticked_percentage;
$tmp[$name] = $stat;
}
$stats = $tmp;
// Print CSV
$previous_subtype = null;
$header = '"question_id","subtype","27 %","upper","lower","DI","count","valid"';
foreach ($stats as $name => $stat) {
if ($stat['subtype'] != $previous_subtype) {
#if (!is_null($previous_subtype)) echo "\n";
echo $header;
if ($stat['subtype'] != 'open') {
foreach ($stat['ticked'] as $answer => $data) echo ",\"[$answer] count\"";
foreach ($stat['ticked'] as $answer => $data) echo ",\"[$answer] %\"";
}
echo "\n";
$previous_subtype = $stat['subtype'];
}
echo "$name,{$stat['subtype']},{$stat['27%']},{$stat['upper']},{$stat['lower']},{$stat['DI']},{$stat['ticked_count']}";
if ($stat['subtype'] == 'open') {
echo ",\"n/a\"";
} else {
foreach ($stat['ticked'] as $answer => $data) if ($data['valid'] == 1) echo ",\"$answer\"";
foreach ($stat['ticked'] as $answer => $data) echo ",{$data['n']}";
foreach ($stat['ticked'] as $answer => $data) echo ",{$data['%']}";
}
echo "\n";
}
}
public function sortByTotalPoints($update = true) {
if ($update) {
usort($this->dataset, "cmp_total");
return $this->dataset;
} else {
$dataset = $this->dataset;
usort($dataset, "cmp_total");
return $dataset;
}
}
public function getDataSet() {
return $this->dataset;
}
protected function createAndIncrement($table, $field, $increment = 1) {
if (!array_key_exists($field, $table)) {
$table[$field] = 0;
}
$table[$field] += $increment;
return $table;
}
public function getMarks() {
$marks = array();
foreach($this->dataset as $student) {
$tmp = array();
$tmp['teacher'] = $student['teacher'];
$tmp['ID'] = $student['ID'];
$tmp['SECTION'] = $student['SECTION'];
$tmp['exam_points'] = $student['exam_points'];
$tmp['total'] = $student['total'];
$tmp['present'] = $student['present'];
$tmp['SCIPER'] = $student['SCIPER'];
$tmp['quarter_mark6'] = $student['quarter_mark6'];
$marks[] = $tmp;
}
return $marks;
}
public function getQuestions() {
$questions = array();
foreach($this->dataset as $student) {
//print_r($student['items']);
$tmp = array();
$tmp['teacher'] = $student['teacher'];
$tmp['ID'] = $student['ID'];
$tmp['SECTION'] = $student['SECTION'];
$tmp['SCIPER'] = $student['SCIPER'];
if (!$student['present']) {
$tmp['present'] = "ABS";
} else {
$tmp['present'] = 1;
}
$tmp['exam_points'] = $student['exam_points'];
$tmp['total'] = $student['total'];
# Stats on questions
$tmp['nb_questions'] = count($student['items']);
$tmp['not_answered'] = 0;
$tmp['right'] = 0;
$tmp['wrong'] = 0;
foreach($student['items'] as $question) {
if (empty($question['ticked'])) {
// Question was not answered
$tmp['not_answered'] += 1;
} else {
if ($question['right']) $tmp['right'] += 1; else $tmp['wrong'] += 1;
}
}
$questions[] = $tmp;
}
return $questions;
}
public function getStats() {
$stats = array();
# Presence
$stats['presence'] = array();
$marks = array();
$stats['quarter_mark6'] = array( 'n' => 0, 'tot' => 0, 'average' => null, 'stddev' => null, 'median' => null);
foreach($this->dataset as $student) {
// Presence
$stats['presence'] = $this->createAndIncrement($stats['presence'], 'total');
switch ($student['type']) {
case 'student':
if ($student['present']) {
$stats['presence'] = $this->createAndIncrement($stats['presence'], 'present');
} else {
$stats['presence'] = $this->createAndIncrement($stats['presence'], 'absent');
}
break;
case 'unused':
$stats['presence'] = $this->createAndIncrement($stats['presence'], 'unsused');
break;
default:
$stats['presence'] = $this->createAndIncrement($stats['presence'], 'unknown');
}
// Average
if ($student['present']) $marks[] = $student['quarter_mark6'];
}
$stats['quarter_mark6']['n'] = count($marks);
if ($stats['quarter_mark6']['n'] > 0) {
$stats['quarter_mark6']['tot'] = array_sum($marks);
$stats['quarter_mark6']['average'] = $stats['quarter_mark6']['tot']/$stats['quarter_mark6']['n'];
$stats['quarter_mark6']['stddev'] = stats_standard_deviation($marks);
if (count($marks) >=3) {
sort($marks);
$stats['quarter_mark6']['median'] = $marks[round(count($marks)/2)];
} else {
$stats['quarter_mark6']['median'] = 'n/a';
}
} else {
$stats['quarter_mark6']['tot'] = 0;
$stats['quarter_mark6']['average'] = 0;
$stats['quarter_mark6']['stddev'] = 0;
$stats['quarter_mark6']['median'] = 0;
}
// Distribution (of marks)
$distribution = array();
for ($m = 1.0 ; $m <= 6.0 ; $m += 0.25) $distribution[(string)$m] = 0;
$stats['distribution_total'] = 0;
foreach ($marks as $mark) {
$distribution[(string)$mark]++;
$stats['distribution_total']++;
}
$stats['distribution'] = $distribution;
$stats['distribution_percentage'] = array();
if ($stats['quarter_mark6']['n']) {
foreach ($stats['distribution'] as $mark => $count) $stats['distribution_percentage'][$mark] = $count*100.0/$stats['distribution_total'];
} else {
$stats['distribution_percentage'] = $stats['distribution'];
}
return($stats);
}
}
?>