0

I am trying to make an exam using mainly the enumerate command; however, I keep getting an error. I've a tried adding a \begin{enumerate} before the question and two \end{enumerates}, which produces an output, but the listing starts from the beginning with each question: a, a, a, a and etc... Below is the tex and the cls that I am using. Any help would be much appreciated.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%
% SIIT Exam Class
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{siitexam}[2014/05/20 v1.0 SIIT Exam]
% Developed by Steven Gordon
% http://sandilands.info/sgordon/
% $Revision: 854 $
% $Date: 2010-12-02 18:26:52 +0700 (Thu, 02 Dec 2010) $
% $Author: sgordon $
% $URL: https://sandilands.info/svn/Common/Styles/siitassess/siitexam.cls $

% Use the article class
\LoadClass[12pt,onecolumn,twoside,a4paper]{article}

% Required packages
\RequirePackage{fancyhdr} % Needed for headers and footers
\RequirePackage{qvariants} % Needed for question variants

% Page layout (25mm margins around text)
\setlength{\hoffset}{-2mm}
\setlength{\voffset}{-12mm}
\setlength{\oddsidemargin}{0mm}
\setlength{\evensidemargin}{0mm}
\setlength{\topmargin}{0mm}
\setlength{\textheight}{246mm}
\setlength{\textwidth}{159mm}
\setlength{\marginparsep}{2mm}
\setlength{\marginparwidth}{20mm}
\setlength{\headheight}{6mm}
\setlength{\headsep}{6mm}


% Set the counters to appropriate format for questions and subquestions
\renewcommand{\thesection}{Section \arabic{section}}
\renewcommand{\labelenumi}{(\alph{enumi})}
\renewcommand{\labelenumii}{\roman{enumii}.}

% Question numbering
\newcommand{\question}[1]{\section{\textmd{[#1 points]}}}
\newcommand{\mcquestion}[1]{%
\renewcommand{\thesection}{Multiple Choice Questions}
\renewcommand{\labelenumi}{\arabic{enumi}.}
\renewcommand{\labelenumii}{(\alph{enumii})}
\section{\textmd{[#1 marks]}}}

% Exam instructions (to be edited in .tex file)
\newcommand{\examinstructions}[1]{}

% Document information
\newcommand{\docversion}[1]{\def\@docversion{#1}}
\newcommand{\docnumber}[1]{\def\@docnumber{#1}}
\newcommand{\docfile}[1]{\def\@docfile{#1}}
\newcommand{\docdate}[1]{\def\@docdate{#1}}
\newcommand{\instructor}[1]{\def\@instructor{#1}}
\newcommand{\exam}[1]{\def\@exam{#1}}
\newcommand{\coursecode}[1]{\def\@coursecode{#1}}
\newcommand{\coursetitle}[1]{\def\@coursetitle{#1}}
\newcommand{\courseshort}[1]{\def\@courseshort{#1}}
\newcommand{\semester}[1]{\def\@semester{#1}}
\newcommand{\academicyear}[1]{\def\@academicyear{#1}}
\newcommand{\testdate}[1]{\def\@testdate{#1}}

% Some commonly used phrases/names
\newcommand{\siit}{University of Missouri}
\newcommand{\tu}{St. Louis}

% Title page
\renewcommand{\maketitle}{%

% Header/footer for title page
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyhead[LO,LE]{Name \ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots\ldots $\;$ Date:  \ldots\ldots\ldots\ldots\ldots }
\fancyhead[RO,RE]{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

% The title page
\begin{center}
{\Large\textbf{\siit}}\\
\vspace*{2mm}
{\Large\textbf{\tu}}\\
\vspace*{5mm}
{\textbf{\@exam: Semester \@semester, \@academicyear}}\\
\end{center}
\begin{description}
\item[Course Title:] \@coursecode\ \@coursetitle
\item[Instructor:] \@instructor
\item[Date/Time:] \@testdate
\end{description}
\hrule
\paragraph{Instructions:}
\examinstructions
\newpage

% Header/foot for rest of document
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyhead[LO,LE]{\itshape\footnotesize{\siit}}
\fancyhead[RO,RE]{\itshape\footnotesize{\@coursecode}}
\fancyfoot[LO,LE]{\itshape\footnotesize{\@courseshort}}
\fancyfoot[CO,CE]{\itshape\footnotesize{}}
\fancyfoot[RO,RE]{\itshape\footnotesize{\thepage}}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
}

% Summary document information



documentclass{siitexam}
\usepackage{graphicx}

% If SVN is being used, uncomment the following \usepackage and \SVN lines
%\usepackage{svn}
%\usepackage{xstring}
%\SVN $Revision: 855 $
%\SVN $Author: sgordon $
%\SVN $Date: 2012-10-17 20:06:42 +0700 (Wed, 17 Oct 2012) $
%\SVN $URL: https://sandilands.info/svn/Common/Styles/siitassess/exam.tex $


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%
% Document Information
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

%% The variant determines if the answer ('ans') or question ('a') sheet is
%% produced as output. The variant selected ('ans' or 'a') will determine
%% the sheet output to the PDF when running latex. (Un)comment as necessary.
\renewcommand{\variant}{ans} % Answer sheet
%\renewcommand{\variant}{a} % Question sheet

% Set the title, author and course information
\coursecode{PS 1100}
\coursetitle{Introduction to American Government}
\courseshort{Introduction to American Government}
\instructor{John D'Attoma}
\semester{Fall}
\academicyear{2014}


% Set the exam title and date
\exam{Exam 1\ifthenelse{\equal{\variant}{ans}}{ Answers}{}}
\testdate{Wednesday, September 17, 2014}

% Set the document version and date

% If SVN is being used, uncomment the following 3 lines (and edit the URL)
%\docversion{\SVNRevision}
%\docdate{\SVNDate}
%\docfile{\StrBehind{\SVNURL}{https://sandilands.info/svn/}}

% Set the path to search for images/figures 
\graphicspath{{../../Figures/out/}{../../Common/Figures/}}
\DeclareGraphicsExtensions{.pdf,.eps,.png}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%
% Title Page
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

% Edit the exam instructions if necessary (especially number of pages)
\renewcommand{\examinstructions}{%
\begin{itemize}

\item Students are not allowed to be out of the exam room during examination. Going to the restroom may result in score deduction.

\item Turn off all communication devices (mobile phone etc.) and leave them at the front of the examination room.

\item Write your name and Date on the front page and on any separate sheets.

%\item The space on the back of each page can be used if necessary.

\item The examination paper is not allowed to be taken out of the examination room. A violation may result in score deduction.


\end{itemize}
\ifthenelse{\equal{\variant}{ans}}{}
}

\begin{document}
\maketitle
\clearpage


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%
\question{50}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

True False. Use your scantron sheets to fill in A for true and B for false. 1 point for a correct answer. 0 marks for an incorrect answer or no answer.

Multiple choice; Each question is worth 2 points each. 


\begin{enumerate}

\item   
A custom, practice, or organization, often embedded in rule of law, is called:  
\begin{enumerate}
\item A policy
\item \qansmc{An institution}
\item A legal procedure
\item A rule 
\end{enumerate}

\item The rule of an elite few for their own interests.

\begin{enumerate}
\item   Monarchy
\item   Polis
\item   Democracy
\item   \qansmc{Oligarchy}
\end{enumerate}


\item
A republic combines principles from monarchy, aristocracy, and democracy.

\begin{enumerate}
    \item   True
\item   False

Answer:     True
\end{enumerate}


    \item Adam Smith and John Locke were British intellectuals that influenced American thought.
\begin{enumerate}

    \item   True
\item   False
\textbf{Answer:     True}
\end{enumerate}

\item The principles of equality and tolerance were central to early American social thinking because these principles were central to the doctrines of most of the major religious traditions in North America at the time.
\begin{enumerate}
 \item True
\item   False
\end{enumerate}

Answer:     False

\end{document}

  • I tried but several files are missing (siitexam.cls,qvariants.sty); also, you should make your example shorter, there are two many unecessary lines (see Minimal Working Example). – anderstood Sep 9 '14 at 17:51
  • Thanks for the heads-up on the minimal working example. Here is the link to the other files. I'm still having trouble with the numbering. Thanks. sandilands.info/sgordon/latex-class-for-quiz-exam-thesis-siit – John D'Attoma Sep 10 '14 at 19:56
2

You are missing a

\end{enumerate}

between the last "Answer: False" and "\end{document}". That is, the file should finish with:

...
Answer: False
\end{enumerate}
\end{document}

Also, you are missing a backslash (\) in the documentclass:

\documentclass{siitexam}

I copied everything from the start of your example until before the documentclass line into john.cls, and then from the documentclass line to the end, with my above suggested fixes, into john.tex and it compiles successfully. (Of course I also have the qvariants.sty file). The two pages produced are below:

enter image description here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.