<reponame>Submitty/InstructorTools
\documentclass[11pt]{article}

\usepackage{pdfpages,fancyvrb,fancyhdr,multirow,comment}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PAGE DIMENSIONS
\textwidth  7.5in
\oddsidemargin -0.5in
\evensidemargin -0.5in
\footskip 0.3in
\textheight 9.9in
\topmargin -1in

\input{student_variables.tex}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% blank lines if names are not pre-printed on exams
\newcommand{\fillinname}
{
\begin{minipage}{3.2in}
\begin{tabular}{lr}
{\em Name:} & \rule{2.5in}{0.4pt} \vspace{0.2in} \\ 
{\em RCS ID:} & \rule{2.5in}{0.4pt} \vspace{0.2in} \\ 
{\em Section:} & \rule{2.5in}{0.4pt}
\end{tabular}
\end{minipage}
}


\beginnone
\else

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% helper function that use the data to print the student name
\newcommand{\studentname}
{
\renewcommand{\arraystretch}{1.5}
\begin{tabular}{|@{\hspace{0.1in}}l@{\hspace{0.1in}}|@{\hspace{0.1in}}l@{\hspace{0.1in}}|}
\hline
\multirow{2}{2.4in}
{\bf \Large \studentfirstname ~ \studentlastname}
&
\studentemail
\\
%
&
lab section: \studentlabsection
\\
%
\hline
%
\begin{minipage}{2.5in}
\begin{tabular}{ll}
\vspace{-0.08in}
room:& \studentroom \\
\vspace{-0.08in}
zone:& \studentzone \\
\vspace{-0.08in}
row:& \studentrow \\
\vspace{-0.08in}
seat:& \studentseat
\end{tabular}
\medskip \end{minipage}  &
\begin{minipage}{2in} \smallskip \studenttime \smallskip \end{minipage}
\\
\hline
%
\end{tabular}
\renewcommand{\arraystretch}{1.0}
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% helper function that use the data to only print the zone

\newcommand{\zoneonly}
{
\fillinname
\hfill
\begin{minipage}{1.5in}
\renewcommand{\arraystretch}{1.5}
{\bf \Large \studentfirstname ~ \studentlastname} \vspace{0.1in} \\
\begin{tabular}{ll}
\vspace{-0.08in}
room:& \studentroom \\
\vspace{-0.08in}
zone:& \studentzone \\
\vspace{-0.08in}
row:& \studentrow \\
\vspace{-0.08in}
seat:& \studentseat 
\end{tabular}
\renewcommand{\arraystretch}{1.0}
\end{minipage}
}

\fi




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Name in the upper right corner of every page (except cover sheet)

\pagestyle{fancy}
\lhead{}
\beginnone
\rhead{\vspace{0.2in}{\em Name: \rule{4cm}{0.4pt} }}
\else
\rhead{\vspace{0.2in}\studentfirstname ~ \studentlastname ~ \studentemail}
\fi
\renewcommand{\headrulewidth}{0pt}

\pagenumbering{gobble}
\begin{document}
\vspace*{0.6in}
\thispagestyle{plain}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The cover sheet

% with no name or zone
\beginnone
\begin{minipage}{5.3in}
\fillinname
\end{minipage}
\fi
%
% with both a name and a zone
\beginzoneandname
\begin{minipage}{5.3in}
\studentname
\end{minipage}
\fi
%
% with only a zone
\beginzoneonly
\begin{minipage}{5.3in}
\zoneonly
\end{minipage}
\fi
%
% and the qr code
\hfill
\begin{minipage}{2.0in}
\includegraphics[width=2.0in]{\qrcode}
\end{minipage}

\newpage

~

\end{document}

