2

I use the exam class for writing my exam ctan exam

The problem regards the counting of points when you have several exercises (so several question environments)

Normally you have solutions in the exam class but I may use this options in a wrong way.

You can find below a basic example which didn't work... exercices have same points and gradingtable.

\documentclass[a4paper,11pt]{exam}                                                   
%\printanswers % pour imprimer les réponses (corrigé)
\noprintanswers % Pour ne pas imprimer les réponses (énoncé)
\addpoints % Pour compter les points
\pointsinrightmargin % Pour avoir les points dans la marge à droite
\usepackage{lmodern}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}

\begin{document}

\textbf{Exercice 1 : \pointsinrange{ex1} pts}

\begin{questions}
  \begingradingrange{ex1}
  \question[1] question1
  \question[2] question2
  \question 
  \begin{parts}
    \part[1] question3a
    \part[2] question3.b
   \end{parts}
   \endgradingrange{ex1}
\end{questions}

\partialgradetable{ex1}[h][questions]

\textbf{Exercice 2 : \pointsinrange{ex2} pts}

\begin{questions}
  \begingradingrange{ex2}
  \question[2] question1
  \question[1] question2
  \question 
  \begin{parts}
    \part[2] question3a
    \part[3] question3.b
  \end{parts}
  \endgradingrange{ex2}
\end{questions}

\partialgradetable{ex2}[h][questions]

\end{document}

The problem is that each exercise has the same points attributed to it and grading table whereas there are different affectations for questions...

pdf capture of problem

(I have just merge my 2 accounts)

The grading table for exercise 1 should be :

normal grading table for ex1

Thank you in advance ;)

Benoit

  • 1
    If you look the first grading table it is the points of exercice two normally with affectation the first grading table should be : Question 1 2 3 Total Points 1 2 3 6 – Benoit Landrieu Oct 28 '14 at 16:41
  • This has also been posted at LaTeX-community. – Johannes_B Oct 28 '14 at 16:56
  • @Johannes_B do I have to delete from LaTeX-community ? – Benoit Landrieu Oct 28 '14 at 17:04
  • I'm not sure you should have multiple question environments in one document with exam class - it does not seem to support more than one. Could you put each exercise in a separate document? Or perhaps just have a single question environment so that the question numbers continue across each "exercise". – Thruston Oct 28 '14 at 17:08
  • No, of course not. – Johannes_B Oct 28 '14 at 17:13
2

This is similar to the answer provided by the OP, but allows for multiple questions to appear in each \partialgradetable. The problem was having multiple question environments. The tables are correct if you have multiple grading ranges between one set of \begin{questions} and \end{questions}.

\documentclass[a4paper,11pt]{exam}                                                   
%\printanswers % pour imprimer les réponses (corrigé)
\noprintanswers % Pour ne pas imprimer les réponses (énoncé)
\addpoints % Pour compter les points
\pointsinrightmargin % Pour avoir les points dans la marge à droite
\usepackage{lmodern}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}

\begin{document}
\begin{questions}
\uplevel{\textbf{Exercise 1 : \pointsinrange{ex1} pts}}
\begingradingrange{ex1}
  \question[1] question1
  \question[2] question2
  \question 
  \begin{parts}
    \part[1] question3a
    \part[2] question3.b
   \end{parts}
\endgradingrange{ex1}

\partialgradetable{ex1}[h][questions]

\uplevel{\textbf{Exercise 2 : \pointsinrange{ex2} pts}}
\begingradingrange{ex2}
  \question[2] question1
  \question[1] question2
  \question 
  \begin{parts}
    \part[2] question3a
    \part[3] question3.b
  \end{parts}
\endgradingrange{ex2}
\end{questions}
\partialgradetable{ex2}[h][questions]

\end{document}
| improve this answer | |
  • I have just compiled your version and the gradingtable are the same for both exercises... – Benoit Landrieu Oct 30 '14 at 21:00
  • @BenoitLandrieu Restarting the question numbering with \setcounter{question}{0} caused both grading tables to be the same. I've removed that command from my answer, and it should compile correctly now. – erik Oct 31 '14 at 18:39
1
    \documentclass[a4paper,11pt]{exam}                                                   
%\printanswers % pour imprimer les réponses (corrigé)
\noprintanswers % Pour ne pas imprimer les réponses (énoncé)
\addpoints % Pour compter les points
\pointsinrightmargin % Pour avoir les points dans la marge à droite
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[francais]{babel}
%-----------------------------------------------
\renewcommand{\thesubpart}{\alph{subpart}}
\renewcommand{\thepartno}{\arabic{partno}}
\renewcommand{\questionlabel}{\textbf{Exercice \thequestion:}}
\renewcommand{\partlabel}{\thepartno.}
\renewcommand{\subpartlabel}{(\thesubpart)}
%-----------------------------------------------

\begin{document}

\begin{questions}
  \begingradingrange{ex1}
  \question \pointsinrange{ex1} pts
  \begin{parts}
    \part[1] question1
    \part[2] question2
    \part
    \begin{subparts}
      \subpart[1] question3a
      \subpart[2] question3.b
    \end{subparts}
  \end{parts}
  \endgradingrange{ex1}

  \partialgradetable{ex1}[h][questions]

  \begingradingrange{ex2}
  \question \pointsinrange{ex2} pts
  \begin{parts}
    \part[2] question1
    \part[2] question2
    \part
    \begin{subparts}
      \subpart[2] question3a
      \subpart[1] question3.b
      \subpart[2] question3.c
    \end{subparts}
  \end{parts}
  \endgradingrange{ex2}

  \partialgradetable{ex2}[h][questions]

\end{questions}
\end{document}

Thanks to touhami from http://forum.mathematex.net/latex-f6/class-exam-avec-exercices-gestions-points-range-t16068.html

Benoit

| improve this answer | |
  • I found a very similar method, but it allows you to have more than one entry in the \partialgradetable. Also, you don't have to change the appearance of all the parts and subparts. Please see my answer for details. – erik Oct 28 '14 at 20:15
  • Can you post the solution to LaTeX-community as well? Please also inform @touhami about crossposting. This is showing respect to the fellow users. Thanks. – Johannes_B Oct 29 '14 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.