%Author1: Ganesh Ashok Satpute
%Webpage: ganeshasatpute.github.io
%Author2: Prof. Syed Abbas, IIT Mandi, India
%This file was used. https://math.mit.edu/~psh/exam/examdoc.pdf
\documentclass[12pt, addpoints]{exam}
% For answers, use the following command.
%\documentclass[12pt, answers, addpoints]{exam}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage[margin=1in]{geometry}
\checkboxchar{$\Box$}
%\usepackage{bbding}
%\usepackage{pifont}
\usepackage{wasysym}
\usepackage[shortlabels]{enumitem}
\renewcommand{\qedsymbol}{$\blacksquare$}
\usepackage{array}
\usepackage{multicol}
\setlength{\columnsep}{1cm}
\usepackage{afterpage}
\usepackage{color}
\newcommand\blankpage{%
\null
\thispagestyle{empty}%
\addtocounter{page}{-1}%
\newpage}
%% https://tex.stackexchange.com/a/203986
% Create a True-False question format
\newcommand*{\TrueFalse}[1]{%
\ifprintanswers
\ifthenelse{\equal{#1}{T}}{%
\textbf{TRUE}\hspace*{14pt}False
}{
True\hspace*{14pt}\textbf{FALSE}
}
\else
{True}\hspace*{20pt}False
\fi
}
%% The following code is based on an answer by Gonzalo Medina
%% https://tex.stackexchange.com/a/13106/39194
\newlength\TFlengthA
\newlength\TFlengthB
\settowidth\TFlengthA{\hspace*{1.16in}}
\newcommand\TFQuestion[2]{%
\setlength\TFlengthB{\linewidth}
\addtolength\TFlengthB{-\TFlengthA}
\parbox[t]{\TFlengthA}{\TrueFalse{#1}}\parbox[t]{\TFlengthB}{#2}}
%%
%%
\pagestyle{headandfoot}
%\extraheadheight{.25in}
\runningheader{\bfseries\large MA-XXX Course Name\\ Prof. FirstName LastName}
{}
{End-semester Exam Name\\ July 4, 1776 }
\firstpagefooter{}{Page \thepage\ of \numpages}{Please go on to the next page\ldots} %
\runningfooter{}{Page \thepage\ of \numpages}{\iflastpage{End of exam.}{Please go on to the next page\ldots}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{center}
\Large University/Institute/College Name\\
Exam Name \\
MA-XXX Course Name\\
Date: \enspace July 4, 1776 \\
Instructor:\enspace Prof. FirstName LastName
\end{center}
\begin{center}
Roll Number\enspace \fillin \hfill Name:\enspace \hrulefill
\end{center}
\begin{center}
\fbox{\fbox{\parbox{5.5in}{\centering
\vspace{0.2in}
\textbf{Please read the following instructions carefully.}
\begin{itemize}
\item You have 90 minutes to complete this exam. This question booklet contains \numquestions\ questions, \numpages\ pages (including the cover) for the total of \numpoints\ points/marks. Check to see if any pages are missing. DO NOT scribble or do rough work or make any stray marks on it. Use separate sheet for rough work.
\item All the questions are compulsory and all the notations have their usual meaning. You can use standard results directly by writing its statement appropriately. \textbf{Read the instructions for individual questions carefully} before answering the questions.
\item More instructions here.
\end{itemize}
}}}
\end{center}
\begin{center}
\gradetable[v][questions] %verticle
%\gradetable[h][questions] % horizontal
\end{center}
\hspace{0.5in}
\begin{questions}
\addpoints
\newpage
\question[5]{Multiple select questions. There may be one or more than one choice(s) that are correct out of the four given choices. The candidate gets \textbf{full credit if he/she selects all the correct answers only and no wrong answers. No partial credits will be awarded.} Select the correct answer \textbf{(\CheckedBox)}.
\begin{parts}
\part One paragraph question \\
\begin{oneparchoices}
\choice Option 1.
\choice Option 2.
\correctchoice Option 3.
\choice Option 4.
\end{oneparchoices}
\part Second question.
\begin{choices}
\choice Option 1.
\choice Option 2.
\correctchoice Option 3.
\choice Option 4.
\end{choices}
\part One paragraph checkbox question \\
\begin{oneparcheckboxes}
\choice Option 1.
\choice Option 2.
\correctchoice Option 3.
\choice Option 4.
\end{oneparcheckboxes}
\part Checkbox.
\begin{checkboxes}
\choice Option 1.
\choice Option 2.
\correctchoice Option 3.
\choice Option 4.
\end{checkboxes}
\end{parts}
%Use https://math.mit.edu/~psh/exam/examdoc.pdf
}
\question[5]{Mark each of the following statements \fbox{TRUE} or \fbox{FALSE}. \textbf{One point/mark will be awarded for each correct answer, and 0.5 point/mark will be deducted for each wrong answer.} Questions that are not attempted will result in zero points/marks. Questions marked as both True and False will be considered as wrong answers.
\begin{parts}
\part \TFQuestion{F}{Question 1}
\part \TFQuestion{F}{Question 2}
\end{parts}
}
\question[5]{Fill in the blanks.
\begin{parts}
\part \fillin[India] is my country.
\part All \fillin[Indian] are my brothers and sisters.
\end{parts}
}
\question[5]{Question with answer line on the right side.
\begin{parts}
\part Question 1 \answerline
\part Question 2 \answerline
\end{parts}
}
\newpage
\question[5]{Write the correct solutions in the provided space. No partial credits will be awarded.
\begin{parts}
\part Question 1: Leaving blank space for a solution.
\vspace*{\stretch{1}}
\part Question 2: Make an empty box for the solution.
\makeemptybox{\stretch{1}}
\part Question 3: Printing line space.
\fillwithlines{\stretch{1}}
\part Question 4: Dotted line for the solution.
\fillwithdottedlines{\stretch{1}}
\part Question 5: Grid for solution\fillwithgrid{\stretch{1}}
\end{parts}
} \label{que-4}
\newpage
\question{Use this if a separate answer sheet is provided. Observe points are in subquestion, not in question.
\begin{parts}
\part[2] Subquestion 1.
\vspace{\stretch{1}}
\part[3] Subquestion 2.
\makeemptybox{\stretch{2}}
\end{parts}
}
\end{questions}
\end{document}