\documentclass[a4paper]{article}

\usepackage[utf8x]{inputenc}    
\usepackage[T1]{fontenc}

\usepackage{fp}
\usepackage[box,completemulti]{automultiplechoice}    
\begin{document}

\element{gr}{
  \begin{question}{prez}    
    Among the following persons, which one has ever been a President of the French Republic?
    \begin{choices}
      \correctchoice{René Coty}
      \wrongchoice{Alain Prost}
      \wrongchoice{Marcel Proust}
      \wrongchoice{Claude Monet}
    \end{choices}
  \end{question}
}

\element{gr}{
  \begin{questionmultx}{integral}
    % random parameters:
    % c is -1, -0.5, 0.5 or 1.5
    \FPeval\INTc{clip(max(-1.0,trunc(random * 4,0)-1.5))}
    % a is in 0.6..0.9
    \FPeval\INTa{clip(trunc(6+random*4,0)/10)}
    % b is in 1.6..1.9
    \FPeval\INTb{clip(trunc(16+random*4,0)/10)}
    % computes integral
    \FPifeq{\INTc}{-1}
      \FPeval\INTi{ INTb*ln(INTb)-INTa*ln(INTa)-INTb+INTa }
    \else
      \FPeval\INTi{ (INTb^(INTc+1)-INTa^(INTc+1))/(INTc+1) }
    \fi
    % shows question
    Compute
    \[ \int_{\INTa}^{\INTb} x^{\INTc}\,dx \,.\]
    \AMCnumericChoices{\INTi}{digits=3,decimals=2,sign=true,exact=1,scoreexact=3,approx=2,scoreapprox=1}
  \end{questionmultx}
}

\onecopy{10}{    

%%% beginning of the test sheet header:    

\noindent{\bf QCM  \hfill TEST}

\vspace*{.5cm}
\begin{minipage}{.4\linewidth}
\centering\large\bf Test\\ Examination on Jan., 1st, 2008\end{minipage}
\namefield{\fbox{    
                \begin{minipage}{.5\linewidth}
                  Firstname and lastname:

                  \vspace*{.5cm}\dotfill
                  \vspace*{1mm}
                \end{minipage}
         }}

\begin{center}\em
Duration : 10 minutes.

  No documents allowed. The use of electronic calculators is allowed.


  Questions using the sign \multiSymbole{} may have
  zero, one or several correct answers.  Other questions have a single correct answer.

  Negative points may be attributed to \emph{very
    bad} answers.
\end{center}
\vspace{1ex}

%%% end of the header

\shufflegroup{gr}
\insertgroup{gr}

\clearpage    

}   

\end{document}
