# Counting and displaying the total number of marks per section/subsection

I am using the exam package to compile a test booklet for learners. Each chapter is set as a subsection. and I'm wondering how to count and display the total number of marks to provide the totals on each section

Below is my MWE

\documentclass[12pt,addpoints,answers]{exam}
\usepackage{titlesec}
\newcommand{\subsectionbreak}{\clearpage}
\begin{document}

\subsection{\textbf{Ecology}}
\begin{questions}
\question  Food webs in hot deserts are much simpler than those of other areas, such as temperate woodlands or coral reefs. The physical conditions in deserts are so extreme that few organisms can survive. However, there are plants and animals that have special adaptations to withstand big changes in temperature and lack of rainfall. Desert plants provide shade and food for herbivorous animals, such as insects, lizards and rodents. Snakes, scorpions and spiders feed on the herbivores. Animals such as the fennec fox and hawks feed as top carnivores.
\begin{parts}
\part[5]  State the term that best describes each of the following.
\begin{subparts}
\subpart  Organisms, such as desert plants, that form the first trophic level in a food web.
\subpart  All the fennec foxes living in one area at the same time.
\subpart  All the different species that inhabit a desert at the same time.
\subpart  A natural unit, such as a desert, consisting of all the living organisms and the physical environment interacting together to give a stable system.
\subpart  Herbivorous animals, such as lizards and rodents, which are prey for carnivores
\end{subparts}
\part[2]  Using information from the passage, explain the term habitat.
\part[3]  Explain how the leaves of desert plants may be adapted for survival in areas with little rainfall.
\end{parts}
\end{questions}

\subsection{\textbf{Transport in Animals}}
\begin{questions}
\question Fig. \ref{fig:capillary} is a drawing made from an electron micrograph of a longitudinal section of a capillary in muscle tissue.
\begin{figure}[h]
\centering
\includegraphics[width=0.97\linewidth]{fig/capillary.png}
\caption{}
\label{fig:capillary}
\end{figure}
\begin{parts}
\part[3]  Name the organelles D, E and F.
\part[4] Explain how oxygen and glucose move from the blood inside the capillary to the tissue fluid in the muscle.
\part[3] Describe how the structure of the wall of a vein differs from that of a capillary.
\end{parts}
\end{questions}
\subsection{\textbf{Cell Structure and Function}}
\begin{questions}
\question \begin{parts}
\part[4] Chloroplasts absorb phosphate ions from the surrounding cytoplasm. Suggest four ways in which chloroplasts use phosphate ions.
\part[4] Starch grains in plant cells contain both amylose and amylopectin. Explain how both of these substances are formed from glucose in plant cells.
\part[3] State three functions of the water stored in the vacuoles of plant cells.
\end{parts}
\end{questions}
\end{document}

• This doesn't compile for me, even aside from that I don't have.
– TH.
Mar 17, 2018 at 18:28
• @TH. its compiling well for me Mar 20, 2018 at 3:59
• That should have read "even aside from the figure that I don't have." Looking at it again, \numpoint is undefined. Perhaps you have a different exam.cls than I have?
– TH.
Mar 20, 2018 at 20:53
• You might want to add \usepackage[demo]{graphicx}, and remove the backtick before the first \subsection`. May 31, 2018 at 17:04