\documentclass[printans,sans]{icphexam}
% icphexam_template.tex Version 1.9 23/11/2009 SJS
%    Version 1.3 13 Jan 2008
%    Version 1.4 15 March 2008 to match icphexam.cls of same date
%             This should be backward compatible with source files written
%             against V1.3
%    Version 1.5 6 July 2008 to include cmbright as default font
%    Version 1.6 23 October 2008 to add PRINTANS options
%    Version 1.6a 9 November 2008 added vector options to template only
%    Version 1.7 14 December 2008 added short exam title for header; fixed
%                     linespacing for exam title that splits across lines
%    Version 1.8 17 September 2009 added class option that suppresses
%                     pagebreak after a question; useful for consolidated
%                     answers.
%    Version 1.8.17a  (template only) added extra {} in \vec def'n
%    Version 1.9    Nov 2009 - arev sans serif option added
%
% Class Options are:
%	One of BSc, MSci, MSc, or BScMSci  [default is BScMSci]
%	draftexam   puts header with draft ...
%       Fonts: one of cmbright, mathptmx, sans, arev, or cmr [default is cmbright]
%            Departmental style is sans serif, which can be one of:
%                 cmbright   [default] lightish typeface
%                 sans       requires sfmath.sty; heavier type
%                 arev       requires arev + bera packages; better ells & I's
%            Times roman options remain: cmr standard latex or mathptmx
%       printans - will print anything inside the command \A{} and annotate
%                  with word ANSWER. If hideq not set, it will start on a
%                  newline
%       hideq    - will hide anything inside the command \Q{}
%       nopagebreak - will suppress pagebreak at the end of a question
%
% e.g. \documentclass[draftexam,MSci,sans]{icphexam}
%
% Vector options
% ==============
% Because this behaviour interacts with the fonts,
% the user needs to choose what is best for them by having one of the
% following lines uncommented. Otherwise the latex default \vec{A} will
% produce an over-arrow. House style is bold for vectors
%
 \renewcommand\vec[1]{\ensuremath{\mathbf{#1}}}
% \usepackage{bm}\renewcommand\vec[1]{\ensuremath{\bm{#1}}}
%
% \mathbf is simple, with upright bold vectors; 
% doesn't work so well with Greek in cmbright
% (the default font) but ok with the sans option
%
% \bm is robust and works with all font options and Greek; requires
% the bm package, which should be automatically available on all
% tex installations. Slanted bold vectors
%
% My recommendation would be [sans] and \mathbf 
%
% add any packages you need (e.g., graphicx, etc.) here.
% Since the final version may be latexed by someone else, it is a good
% idea to stick to only basic packages.
%
% \usepackage{graphicx}
%
% Specify Exam Title, Month,  Date/Time and level here:
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\examtitle{A Physics Course}
% for long examtitles, supply an optional argument as a short title, i.e.
% \examtitle[Physics 101]{Physics 101 A course with a very very long coursetitle}
\exammonth{June 2050}
\examtime{Oneday, nth June 2050: hh:mm to HH:MM}
\examlevel{For mth-Year Physics Students}
\examid{xxxx/y/zzz} % for footer; to be supplied by Exam office
\numberofbooks{NN}  % for instructions as text, e.g. \numberofbooks{FOUR}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

% Put instructions about number of questions to answer, etc. in the rubric
% environment; other bits and the General Instructions will be pre-pended
% (e.g., exam title, etc., and appended to it.) Omit rubric environment to
% suppress 1st page.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{rubric}
Answer a lot of questions
\end{rubric}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% The questions go all together in a question environment, so that the structure is
%
%  \section{A}   etc.  [optional]
%  \begin{questions}        % questions will be numbered automatically
%	\begin{question}  % 1st question
%	\end{question}
%	... until the last question, which is given its optional argument
%	\begin{question}
%		\begin{subquestions}
%			\subquestion   % this is just a command
%		    ... and there's a subsubquestion environment as well
%		\end{subquestions}
%	\end{question}
%  \end{questions}
%
%  A command \qmarks is provided that can be used anywhere at the end of a 
%  question or sub(sub) question. The total gets set to zero at the start 
%  of an individual question and accumulates the entries in qmarks to the 
%  end of each question. It can also be used at the end of displayed math
%  of the TeX form $$ ... $$. The LaTeX \[ ... \] throws an error, but works
%  if you type 's' to let latex continue. The same is true within numbered
%  equations \begin{equation} ... \end{equation}. Add \usepackage{leqno} for
%  these so the equation numbers are to the left and the marks on the right.
%  If you have no subquestions, manually set the total number of marks as, eg.
%  \setcounter{nmarks}{25} to get 25 as the total.
%
%  Subquestions and subsubquestions can be interrupted using 
%  \interruptsubq{blah} and \interruptsubsubq{blah} to write a block of text
%  that applies to all the following sub-parts (see the example below)
%
%  \questionendmatter{blah} will put blah after the marks total for a question
%  but on the same page (the end of a question throws a pagebreak by default;
%  this can be suppressed by using the class option nopagebreak)
%
%  \examendmatter{blah} will put blah at the end of the examination, e.g.,
%  for tables or other reference material. This can be used more than once
%  if desired; it also throws a page.
%
%  The last page of the paper has "End of examination paper" in the footer.
%  It is no longer necessary to call out the last question with an optional
%  argument, as in V1.3 of the template. But this footer is triggered by
%  automatically by testing the page number against the last page number.
%  This requires two passes through latex.
%
%  You can include answers in your file, optionally print them and independently
%  optionally not print the questions. These are controlled by class options
%  printans and hideq respectively. The answers go inside a \A{} command and,
%  if you want to hide the questions, you need to put them inside a \Q{} command.
%  These can be used anywhere in your file. \Q simply typesets or not its contents
%  depending on whether hideq is not set or set. \A{text} will omit "text" unless
%  printans is set, in which case it will (1) break to a newline unless hideq is
%  also set (2) typeset "ANSWER: text" and (3) add "ANSWER" to the footer. Typically
%  you might use these in one of several ways:
%
%  use neither \A or \Q - you will then get the question paper
%  use \A - you will then always see your questions, and if printans
%           is set you will also see your answers with modifications to
%           the footer as a reminder
%  use both \Q and \A - you can then choose
%       [ ]  just the question paper
%       [printans]  the questions and answers interspersed
%       [printans,hideq] just the answers
%       [hideq]  typeset only material not contained within a \Q{} command.
%                This may not be very common but could be used, for example,
%                to show only the rubric or end matter or, if not all questions
%                are inside \Q{} commands only that subset of questions.
%                Converseley, if you put the rubric inside \Q{}, then it will
%                not be printed if [hideq] is set, in which case [printans] will
%                result in just the answer sheets.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


  \section{A}              % Optional
  \begin{questions}        % questions will be numbered automatically
	\begin{question}   % 1st question
		Here is a question.
		\begin{subquestions} 
			\subquestion How much is 2+2? \qmarks{2}
			\interruptsubq{For the rest of this question, assume that $\pi=3$}
			\subquestion Show that $\sigma \alpha\cos\theta = 0$? \qmarks{1}
		\end{subquestions}
	\questionendmatter{[You may assume throughout this question that $\int \vec{B}\cdot \vec{dA} = \vec{\beta}+\vec{\Gamma}\cdot \alpha\vec{A} =0$]}
	\end{question}

	\begin{question}
		\begin{subquestions}
		    \subquestion This question has only sub and subsub questions
			\begin{subsubquestions}
				\subsubquestion \Q{1st subsub}\A{1st subsub answer is 42} \qmarks{5}
				\subsubquestion 2nd subsub\label{second} \qmarks{2}
				\interruptsubsubq{The remaining elements of this question are based on A-level physics. Perhaps you should have revised more carefully.}
				\subsubquestion Using the results from (\ref{second}) above, show that $$E=mc^2\qmarks{2}$$
			\end{subsubquestions}
		    \subquestion \Q{Describe briefly your logic.}\A{There is no such thing as logic} \qmarks{3}

		\end{subquestions}
	\end{question}
  \end{questions}

\Q{  % this will exclude this bit of endmatter if hideq option is chosen
\begin{examendmatter}
This equation may be used without proof.\[ A=B\]
\end{examendmatter}
}

\begin{examendmatter}
This is the last bit of endmatter
\end{examendmatter}

\end{document}