% % Copyright (c) 2007, 2008, 2009 by Theodore P. Pavlic % % This quiz example source code is licensed under the Creative Commons % Attribution-Noncommercial 3.0 United States License. To view a copy of % this license, visit http://creativecommons.org/licenses/by-nc/3.0/us/ % or send a letter to Creative Commons, 171 Second Street, Suite 300, % San Francisco, California, 94105, USA. % % Note that the products of this source code (e.g, a quiz) may or may % not be CC licensed. In particular, the attribution clause of the % Creative Commons license does not apply to quizzes or solution sets % generated from derived work. A course instructor need not give % Theodore P. Pavlic credit on printed quizzes or solution sets % distributed to students. % % Upper-case A B C D E F G H I J K L M N O P Q R S T U V W X Y Z % Lower-case a b c d e f g h i j k l m n o p q r s t u v w x y z % Digits 0 1 2 3 4 5 6 7 8 9 % Exclamation ! Double quote " Hash (number) # % Dollar $ Percent % Ampersand & % Acute accent ' Left paren ( Right paren ) % Asterisk * Plus + Comma , % Minus - Point . Solidus / % Colon : Semicolon ; Less than < % Equals = Greater than > Question mark ? % At @ Left bracket [ Backslash \ % Right bracket ] Circumflex ^ Underscore _ % Grave accent ` Left brace { Vertical bar | % Right brace } Tilde ~ % % ECE 327: Example Quiz % %%faketop{Preamble} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[10pt]{article} \usepackage[margin=1in]{geometry} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Quiz Setup %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\classname}{ECE~327} \newcommand{\weeknum}{0} \newcommand{\labtitle}{Laboratory Title} \newcommand{\classdesc}{Electronic Devices and Circuits Laboratory I} %\newcommand{\quizname}{Week 1 (8:30): Quiz (10 points)} \newcommand{\quizname}{Lab \weeknum: \labtitle{} Quiz (10 points)} %\date{January 6, 2009} \date{} % * Define \solutionset for answer key view (i.e., uncomment line below) % * Undefine \solutionset for problem set view (i.e., comment line) %\newcommand{\solutionset}{} % % ALTERNATIVELY: You can run % % latex "\newcommand{\solutionset}{}\input{this_file}" % % or even % % latex -jobname this_file_solution "\newcommand{\solutionset}{}\input{this_file}" % % To instruct LaTeX to build the solution. That way you don't have to % uncomment the above \newcommand line. You can choose to build the % quiz or solution externally. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%fakesection{Header and Footer Setup} %%....................................................................%% \usepackage{lastpage} \newcommand{\pageoflastpage}{Page {\thepage} of \pageref*{LastPage}} % % Copyright notice on bottom of title page % % Redefine the plain pagestyle for the title page % \makeatletter % \let\oldps@plain\ps@plain % \renewcommand{\ps@plain}{\oldps@plain% % \renewcommand{\@evenfoot}{% % \makebox[0pt][l]{\parbox{3in}{\tiny Copyright \copyright{} 2007--2009 % by Theodore P.~Pavlic\\ % All rights reserved.}}\hss\pageoflastpage\hss}% % \renewcommand{\@oddfoot}{\@evenfoot}} % \makeatother % Use fancy for non-title pages \usepackage{fancyhdr,extramarks} \fancyhead{}\fancyfoot{} % \lhead{\classname{} [\quizname]} \chead{} \rhead{\firstleftxmark} % % Copyright notice on bottom of other pages % \lfoot{\makebox[0pt][l]{\parbox{3in}{\tiny Copyright \copyright{} 2007--2009 % by Theodore P.~Pavlic\\ % All rights reserved.}}} \cfoot{\pageoflastpage} \rfoot{\large Name: \nameline{}} % \pagestyle{fancy} %%....................................................................%% %%fakesection{Sections and Conditional Inclusion Setup} %%....................................................................%% \usepackage{ifthen} \usepackage{comment} % New problems are sections. \let\oldsection\section \makeatletter \renewcommand{\section}[1]{% \extramarks{}{} % Check to see if subtitle provided \ifthenelse{\equal{#1}{}} { % When subtitle is empty, display no problem subtitle \renewcommand{\@seccntformat}[1]{Problem \csname the##1\endcsname} \oldsection[\thesection. Problem \thesection]{#1} } { % Display problem subtitle if given \renewcommand{\@seccntformat}[1]{Problem \csname the##1\endcsname: } \oldsection[\thesection. #1]{#1} } \extramarks{Problem \thesection{} (continued)}{} } \makeatother % Automatic references should use ``Problem'' \newcommand{\sectionautorefname}{Problem} % Removes numbers from subsections and below \setcounter{secnumdepth}{1} %%fakeparagraph{Solution hiding implementation} \ifthenelse{\isundefined{\solutionset}}{ \excludecomment{solution} % Exclude solution \excludecomment{solutionquiet} % Exclude solution \includecomment{problemspace} % Include blank problem space }{ \includecomment{solution} % Include solution \includecomment{solutionquiet} % Include solution \excludecomment{problemspace} % Exclude blank problem space %%% This commented solution environment is simpler % Start each solution environment as a subsection %\specialcomment{solution}{\subsection{Solution}}{} %%% This solution environment is fancy (but not optimal for all %%% cases) % Make a special hruled area for solutions \specialcomment{solution} {\hrulefill{\tiny ~\textsc{Solution}~}\hrulefill\\} {\par\vspace{-0.5\baselineskip}\hrulefill\\} % Get rid of lines for name/table number \newcommand{\nameline}[1][]{Instructor} \newcommand{\tablenumline}[1][]{Solution} } %%....................................................................%% %%fakesection{Other useful packages} %%....................................................................%% % Math support \usepackage{amsmath,amssymb,amsfonts,amsthm} % Drawing support \usepackage{pstricks, pstricks-add, pst-node, pst-circ, pst-plot} % Use subfig for subfigures \usepackage[nearskip=-3pt,captionskip=4pt, listofformat=subsimple,labelformat=simple]{subfig} \captionsetup[subfloat]{listofindent=4em} % Make sure subfigures have parentheses around them everywhere \renewcommand\thesubfigure{(\alph{subfigure})} \newcommand\subfigureautorefname{\figureautorefname} % Prefix the figures/sections/equations with something to make it % obvious they're from the quiz \renewcommand\thetable{Q\weeknum-\arabic{table}} \renewcommand\thefigure{Q\weeknum-\arabic{figure}} \renewcommand\thesection{Q\weeknum-\arabic{section}} \renewcommand\theequation{Q\weeknum-\arabic{equation}} % Reset figure (and tables) and equations every section \numberwithin{figure}{section} \numberwithin{table}{section} \numberwithin{equation}{section} % Graphics, picture, and color support \usepackage{graphicx} \usepackage{caption} \usepackage{xcolor} % Gives more powerful enumeration environments \usepackage{enumitem} \usepackage[% bookmarks=true,bookmarksopen=true, breaklinks=true, colorlinks=true, urlcolor=blue,linkcolor=blue,filecolor=blue, menucolor=blue, pdfpagelabels=true,hypertexnames=true, plainpages=false,naturalnames=false, ]{hyperref} %%....................................................................%% %%fakesection{Useful Macros} %%....................................................................%% % Line for writing name \providecommand{\nameline}[1][2in]{\underline{\hspace{#1}}} % Line for writing table number \providecommand{\tablenumline}[1][0.5in]{\underline{\hspace{#1}}} % Provided unnumbered environment for giving quiz instructions \newtheorem*{quizdesc}{Description} % For additional notes about a solution \newtheorem*{ext}{Extension} % id est \newcommand{\ie}{i.e.} %%....................................................................%% \begin{document} %%fakesection{Title Page Setup} %%....................................................................%% % These macros are defined at the very top of the preamble \title{\vspace{-60pt} % {\large Name: \nameline{} \hfill Table number: \tablenumline{}}\\ ~\\ % \classname: \emph{\classdesc} % } \author{\textbf{\quizname}} \hypersetup{% pdfsubject={\classname: \classdesc}, pdfauthor={Ted Pavlic}, pdftitle={\quizname}, pdfkeywords={quiz, analog, electronics, circuits, class}, } %%....................................................................%% %%faketop{Quiz Content} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%fakesection{Quiz Title Page} %%....................................................................%% \maketitle \hrule % Description of the quiz \begin{quizdesc} Complete this quiz with \textbf{closed book} and \textbf{closed notes}. \end{quizdesc} \hrule %%....................................................................%% \section{Quiz Question with Solution} \label{sec:question_solution} %%....................................................................%% What is $2 + 2$? % It is important that solution/solutionquiet/problemspace environments % are flush with the start of the TeX source line % A problemspace environment is only displayed in the quiz. It is % removed in the solution. \begin{problemspace} % \vfill is a vertical rubber. It will expand to fill as much space % as possible. If there are other \vfills on this page, they'll % split the space between them. \vfill % If you want to have one vertical rubber be ``stronger'' than % another, use %\vspace{\stretch{2}} % instead. In fact, \vfill is equivalent to \vspace{\stretch{1}}. % The number defines the ``tension'' of the rubber. For more space, % increase the number. \end{problemspace} % A solution environment is only displayed in the solution. It is % removed in the quiz. When it is displayed, it has a ``Solution'' % header. \begin{solution} \begin{equation*} 2 + 2 = \boxed{4} \end{equation*} \end{solution} \section{Quiz Question with ``Quiet'' Solution} \label{sec:question_quiet_solution} %%....................................................................%% % Here, we use ``solutionquiet'' to give a solution without any header $5 + 5 = $\,% \begin{problemspace} % Here, we place a 1 inch line for a solution \underline{\hspace{1in}} \end{problemspace} \begin{solutionquiet} % Here, we place our solution centered on a 1 in line \underline{\parbox{1in}{\centerline{\fbox{$10$}}}} \end{solutionquiet} % A little rubber at the end of the page \vspace{\stretch{0.5}} %%....................................................................%% %%fakepart{Section template} % \section{} % \label{sec:} % %%....................................................................%% % %%....................................................................%% \end{document}