% Exam Template Probability and Statistics courses
%
% Using Philip Hirschhorn's exam.cls: http://www-math.mit.edu/~psh/#ExamCls
%
% run pdflatex on a finished exam at least three times to do the grading table on front page.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% These lines can probably stay unchanged, although you can remove the last
% two packages if you're not making pictures with tikz.
\documentclass[12pt]{exam}
    % \printanswers   %    <=========  Comment this to print exam without answers
    \newcommand{\gradingnote}[1]{}
    %\newcommand{\gradingnote}[1]{\hfill {\color{red} \textit{Grading note: } #1}}
    
    \newboolean{addsolutionspace}
    \setboolean{addsolutionspace}{true}
\RequirePackage{amssymb, amsfonts, amsmath, latexsym, verbatim, xspace, setspace}
\RequirePackage{tikz, graphicx}
\usepackage{color}
\usepackage{multirow, hhline, array, arydshln, blkarray}
\usepackage{txfonts}
\usepackage{hhline, bigstrut}
%\usepackage{calculator, calculus}
\usepackage{soul}
\usetikzlibrary{patterns, plotmarks}
\usepackage{hyperref}
\usepackage{enumerate}
\usepackage{pgfplots, pgfplotstable}
\usepackage[normalem]{ulem}
\useunder{\uline}{\ul}{}
% By default LaTeX uses large margins.  This doesn't work well on exams; problems
% end up in the "middle" of the page, reducing the amount of space for students
% to work on them.
\usepackage[margin=1in]{geometry}
\newboolean{hasattachment}\setboolean{hasattachment}{false}
\newboolean{openbook}\setboolean{openbook}{false}
\newboolean{opennotes}\setboolean{opennotes}{false}
\newboolean{calculator}\setboolean{calculator}{false}
%\newcommand\openbooktrue{\setboolean{openbook}{true}}
%patch the exam package and change the format of the grade table.
\usepackage{etoolbox}
\makeatletter
\patchcmd{\questions}
  {\def\@currentlabel{\thequestiontitle}}
  {\def\@currentlabel{\thequestion}}
  {}
  {}
\makeatother
% ======================================
		% Here's where you edit the Class, Exam, Date, etc.
		\newcommand{\term}{Semester II Academic Year 2020-2021}
		\newcommand{\classcode}{19Q1}
		\newcommand{\formajor}{\quad Statistics and Finance}
		\newcommand{\examnum}{Final Exam}
		\newcommand{\examdate}{27/06/2021}
		\newcommand{\timelimit}{\quad 120 Minutes}
		\newcommand{\weight}{100}
		\newcommand{\numberpage}{5}
		\newcommand{\numberquestion}{5}
		\newcommand{\numberpoint}{100} 
		 
		\newcommand{\class}{\classcode -- \classtitle}
		\newcommand{\classShort}{\classcode}
	
		%% == comment the following lines if needed
		\hasattachmenttrue  
		% \openbooktrue
		% \opennotestrue
		\calculatortrue
% ======================================
% For an exam, single spacing is most appropriate
\singlespacing
% \onehalfspacing
% \doublespacing
% For an exam, we generally want to turn off paragraph indentation
\parindent 0ex
\everymath{\displaystyle}
\begin{document}
\include{Uni_FINexam_header}
%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  questions 
\pgfplotsset{compat=1.17}
%
%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{questions}
%\qformat{Question \thequestion: \thequestiontitle\dotfill\thepoints}
\qformat{{\bf Problem \thequestion}: (\thequestiontitle) \ \  [\totalpoints \ points] \hfill}
%\qformat{{\bf Problem \thequestion}: \ \  [\thepoints] \hfill}
	\titledquestion{Question One} %for multiple choice question
        \begin{parts}
            \part[5] Sub-question 1
        		\begin{checkboxes}
        			\choice Choice 1
        			\choice Choice 2
        			\CorrectChoice Choice 3
        			\CorrectChoice Choice 4
        		\end{checkboxes}
                
            \part[10] Sub-question 2 %for multiple choice question for short answer and essay
        	\begin{solution}
        		Open end question
        	\end{solution}
        \end{parts}
\fillwithdottedlines{\stretch{1}}
            
	\titledquestion{Question Two} 
        \begin{parts}
            \part[5] Sub-question 1
            \smallskip
            \newline
        		\begin{oneparcheckboxes}
        			\choice Choice 1
        			\choice Choice 2
        			\CorrectChoice Choice 3
        			\CorrectChoice Choice 4
        		\end{oneparcheckboxes}
                
            \part[12] Sub-question 2
        	\begin{solution}
        		Open end question
        	\end{solution}
        \end{parts}
\fillwithdottedlines{\stretch{1}}
\end{questions}
\end{document}