diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/mi-solns/examples |
Initial commit
Diffstat (limited to 'macros/latex/contrib/mi-solns/examples')
-rw-r--r-- | macros/latex/contrib/mi-solns/examples/create-db.tex | 92 | ||||
-rw-r--r-- | macros/latex/contrib/mi-solns/examples/mi-solns-eq.tex | 159 | ||||
-rw-r--r-- | macros/latex/contrib/mi-solns/examples/mi-solns-eqe.tex | 202 | ||||
-rw-r--r-- | macros/latex/contrib/mi-solns/examples/use-db.tex | 23 |
4 files changed, 476 insertions, 0 deletions
diff --git a/macros/latex/contrib/mi-solns/examples/create-db.tex b/macros/latex/contrib/mi-solns/examples/create-db.tex new file mode 100644 index 0000000000..2a55c1e8e8 --- /dev/null +++ b/macros/latex/contrib/mi-solns/examples/create-db.tex @@ -0,0 +1,92 @@ +\documentclass{article} +\usepackage[designiv,forcolorpaper]{web} +\usepackage{exerquiz} + +\usepackage{mi-solns} +\declSOLOut{poems.lst} + +%\copySolnsOff + +% This formatting is optional, the purpose of this file is to create +% the poems.lst file, which is to be input by another file. +\renewcommand\exlabel{Poet} +\renewcommand\exlabelformat{{\scshape\exlabel:}} +\renewcommand\exsllabelformat{\protect\textbf{\exlabelsol\ \currentpoet}} +\renewcommand\exsllabelformatwp + {\protect\textbf{\currentpoet: \currenttitle}} +\renewcommand\exsectitle{List of \exlabel s and their Poems} +\partsformat{} +\def\currentPoet#1{\def\currentpoet{#1}} +\def\currentTitle#1{\def\currenttitle{#1}} +\partsitemsep{6pt} + +\begin{document} + +\currentPoet{Ogden Nash} +\begin{exercise*} +\textbf{Ogden Nash} +\begin{parts} +\item \currentTitle{First Limerick}\textbf{First Limerick} +\insExSoln{First Limerick} +\mrkForIns{First Limerick} +\begin{solution}[] +\begin{quote}\obeylines +An old person of Troy +Is so prudish and coy +That it doesn't know yet +If it's a girl or a boy. +\end{quote} +\end{solution} + +\item \currentTitle{The Lama}\textbf{The Lama} +\insExSoln{The Lama} +\mrkForIns{The Lama} +\begin{solution}[] +\begin{quote}\obeylines +The one-l lama, +He's a priest, +The two-l llama, +He's a beast. +And I will bet +A silk pajama +There isn't any +Three-l lllama\footnote{\raggedright The author here is referring to a three-alarm fire, called a ``three-alarmer''.} +\end{quote} +\end{solution} +\end{parts} +\end{exercise*} + +\currentPoet{Edward R. Sill} +\begin{exercise*} +\textbf{Edward R. Sill} +\begin{parts} +\item \currentTitle{Opportunity}\textbf{Opportunity} +\insExSoln{Opportunity} +\mrkForIns{Opportunity} +\begin{solution}[] +\begin{quote}\obeylines +This I beheld, or dreamed it in a dream:--- +There spread a cloud of dust along a plain; +And underneath the cloud, or in it, raged +A furious battle, and men yelled, and swords +Shocked upon swords and shields. A prince's banner +Wavered then staggered backward, hemmed by foes.\vspace{\baselineskip} + +A craven hung along the battle's edge, +And thought, ``Had I a sword of keener steal--- +That blue blade that the king's son bears---but this +Blunt thing!''---he snapped and flung it from his hand. +And lowering crept away and left the field.\vspace{\baselineskip} + +Then came the king's son, wounded, sore bestead, +And weaponless, and saw the broken sword, +Hilt-buried in the dry and trodden sand, +And ran and snatched it, and with battle-shout, +Lifted afresh he hewed his enemy down, +And saved a great cause that heroic day. +\end{quote} +\end{solution} +\end{parts} +\end{exercise*} + +\end{document} diff --git a/macros/latex/contrib/mi-solns/examples/mi-solns-eq.tex b/macros/latex/contrib/mi-solns/examples/mi-solns-eq.tex new file mode 100644 index 0000000000..d6cc6b31ab --- /dev/null +++ b/macros/latex/contrib/mi-solns/examples/mi-solns-eq.tex @@ -0,0 +1,159 @@ +\documentclass{article} +\usepackage[designiv,forcolorpaper]{web} +\usepackage{exerquiz} +\usepackage{mi-solns} + +\def\cs#1{\texttt{\char`\\#1}} +\let\pkg\textsf +\let\env\texttt + +%\copySolnsOff +%\readSolnsOff + +\noSolnOpt + +\declCQSolStr{\textit{Solution}}\declCQQuesStr{\textit{Question}} + +\begin{document} + +\section{Introduction} + +\noindent +\textbf{The Problem.} For a document that uses \pkg{exerquiz} or \pkg{eqexam}, can a solution +that is marked in some way be reproduced in another part of the +document?\medskip + +\noindent\textbf{The Solution.} We require copies of \cs{jobname.sol} and +\cs{jobname.qsl} be made; these are named \cs{jobname-cpy.sol} and +\cs{jobname-cpy.qsl} (default names), and they are created at the end of each +compile. This file is closed when you compile again and hence can be input. +The switch for the compiler must be \texttt{--shell-escape} for those using +MiK\TeX. When a copy of a solution is needed, one of these two files are +input with the appropriate redefinitions. The solution has been formalized +into a new package \pkg{ci-solns}. + +\section{Exercises} + +Below are two extracted solutions from the exercises in this section. +\begin{itemize} + + \item The solution to Exercise~2 is\\[6pt]\textsl{\insExSoln{dps}} True this! + + \item The question of Exercise~2 is enclosed in the \env{cq} environment. + The question to the solution is typeset automatically, as above. The solution to + Exercise~2 again, this time without the question, we pass the special command + \cs{ignoreterminex}: \textsl{\insExSoln[\ignoreterminex]{dps}} + + \item J\"{u}rgen's solution is \textsl{\insExSoln{j-mon}} + +\end{itemize} + +\begin{exercise}\label{ex:one} +Solve this tricky one +\begin{solution} +1) That was a tricky one, can't do it. +\end{solution} +\end{exercise} + +\begin{exercise}\label{ex:two}\begin{cq} +Solve this tricky one.\end{cq} + +\mrkForIns{dps} +\begin{solution} +\ifwithinsoldoc +2) That was a tricky one, can't do it. \else whatever!\fi + +Pass some verbatim content as a test: \verb~$&%$^^%&~. +\end{solution} +\end{exercise} + +\begin{exercise}\label{ex:three} +Solve this tricky one +\begin{solution} +3) That was a tricky one, can't do it. +\end{solution} +\end{exercise} + +\begin{exercise*} +\begin{parts} + \item This is the part (a) question. +\begin{solution} +This is the part (a) solution. +\end{solution} + + \item (J\"{u}rgen's little q) This is the part (b) question. +\mrkForIns{j-mon} +\begin{solution} +This is the part (b) solution. +\end{solution} + + \item This is the part (b) question. +\begin{solution} +This is the part (b) solution. +\end{solution} + +\end{parts} +\end{exercise*} + +\newpage + +\section{Quizzes} + +In this section are two quizzes, generated by the \env{shortquiz} and \env{quiz} environments. + +\begin{itemize} + +\item Alex's solution is \textsl{\insSqSoln{aps}} Check for spurious spaces. + +\item Topi's solution is \textsl{\insQzSoln{topi}} Check for spurious spaces. +\end{itemize} + +\begin{shortquiz} +Solve each +\begin{questions} +\item \begin{answers}*{4} +\Ans0 False &\Ans1 True +\end{answers} +\begin{solution} +The answer is True +\end{solution} + +\mrkForIns{aps} +\item (Alex's question) $\cos(\pi) = \RespBoxMath{-1}*{1}{.0001}{[2,4]}\cgBdry\kern1bp\CorrAnsButton{-1}$ +\begin{solution} +Of course, everyone knows that $\cos(\pi) = -1 $. +\end{solution} +\end{questions} +\end{shortquiz} + +\useBeginQuizButton +\useEndQuizButton + +\begin{quiz*}{mathquiz} Answer each of the following. Passing +is 100\%. + +\begin{questions} + +\mrkForIns{topi} +\item (Topi's question) If $\lim_{x\to a} f(x) = f(a)$, then we say that $f$ is\dots +\begin{answers}*{3} +\Ans0 differentiable &\Ans1 continuous &\Ans0 integrable +\end{answers} + +\begin{solution} +A function $f$ is said to be continuous at $x=a$ if $x\in\mbox{Dom}(f)$, +$\lim_{x\to a} f(x) $ exists and $\lim_{x\to a} f(x) = f(a)$. +\end{solution} + +\item $\cos(\pi) = \RespBoxMath{-1}*{1}{.0001}{[2,4]}\cgBdry\kern1bp\CorrAnsButton{-1}$ +\begin{solution} +Of course, everyone knows that $\cos(\pi) = -1 $. +\end{solution} + +\end{questions} +\end{quiz*}\quad\ScoreField\currQuiz\olBdry\eqButton\currQuiz + +\noindent +Answers: \AnswerField\currQuiz + +\end{document} diff --git a/macros/latex/contrib/mi-solns/examples/mi-solns-eqe.tex b/macros/latex/contrib/mi-solns/examples/mi-solns-eqe.tex new file mode 100644 index 0000000000..a17be61f01 --- /dev/null +++ b/macros/latex/contrib/mi-solns/examples/mi-solns-eqe.tex @@ -0,0 +1,202 @@ +% +% This is a modified version of selectversion_tst.tex, which is distributed with eqexam +% +\documentclass{article} +\usepackage[fleqn]{amsmath} +\usepackage[pointsonleft,nototals,forcolorpaper, +% Select exactly one of the next three options +% nosolutions, +% answerkey, + vspacewithsolns, + obeylocalversions +]{eqexam} + +\usepackage{mi-solns} + +\university +{% + NORTHWEST FLORIDA STATE COLLEGE\\ + Department of Mathematics +} +\email{storyd@nwfsc.edu} + +\examNum{1}\numVersions{5}\forVersion{e} +\subject[CA]{College Algebra} +\longTitleText + {Test~{\nExam} A} + {Test~{\nExam} B} + {Test~{\nExam} C} + {Test~{\nExam} D} + {Test~{\nExam} E} +\endlongTitleText +\shortTitleText + {T\nExam-A} + {T\nExam-B} + {T\nExam-C} + {T\nExam-D} + {T\nExam-E} +\endshortTitleText +\title[\sExam]{\Exam} +\author{Dr.\ D. P. Story} +\date{\thisterm, \the\year} +\duedate{09/30/09} +\keywords{MAC 1105, Exam \nExam, {\thisterm} semester, \theduedate, at NWFSC} + +\newcommand{\cs}[1]{\texttt{\char`\\#1}} +\solAtEndFormatting{\eqequesitemsep{3pt}} +\turnContAnnotOn + +%\copySolnsOff + +\begin{document} + +\maketitle + +\medskip\noindent +This is a modified version of \texttt{selectversion\_tst.tex}, which is +distributed with \textsf{eqexam}, see that file for more details on producing +a document with multiple versions. + +\ifanswerkey When \texttt{answerkey} option is taken, the SOL file is not +written to include the solutions to the problem, as a result, the solutions +not available; however, by saying \cs{SolutionsAtEnd} you can locally turn on +writing the solutions and off writing with \cs{SolutionsAfter}.\fi +\par\medskip\noindent +dps: \textsl{\insExSoln[\ignoreterminex]{dps}}\medskip\par\noindent +kaf: \textsl{\insExSoln[\ignoreterminex]{kaf}} + +\begin{exam}[Part 1]{P1} + +\writeToSolnFile{\par\medskip + This comment is written to the solution file, but it should appear + when a solution is input using \protect\cs{insExSoln}, at least I hope so.\par\medskip} + +\selectVersion{}{3} +\begin{problem}\relax +\verb!\selectVersion{}{3}! \begin{cq}This problem is version \vA{A}\vB{B}\vC{C} of 3.\end{cq} + +\mrkForIns{dps} +\begin{solution} +The first problem, version \vA{A}\vB{B}\vC{C} of 3. +\end{solution} +\end{problem} + +\begin{problem*}[2ea] +Multi-part question. + \begin{parts} +\selectVersion{}{4} + \item \verb!\selectVersion{}{4}! This is problem, version \vA{A}\vB{B}\vC{C}\vD{D} of 4. +\begin{solution} +This is version \vA{A}\vB{B}\vC{C}\vD{D} + +The answer is: +\begin{verA} +This is version A +\end{verA} +\begin{verB} +This is version B +\end{verB} +\begin{verC} +This is version C +\end{verC} +\begin{verD} +This is version D +\end{verD} +\end{solution} + +\selectVersion{}{3} + \item \verb!\selectVersion{}{3}! This is a problem, version \vA{A}\vB{B}\vC{C} of 3. +\begin{verA} +This is A +\end{verA} +\begin{verB} +This is version B +\end{verB} +\begin{verE} +This is version E +\end{verE} + +\mrkForIns{kaf} +\begin{solution} +This is version \vA{A}\vB{B}\vC{C}\vD{D} + +The answer is: +\begin{verA} +This is version A +\end{verA} +\begin{verB} +This is version B +\end{verB} +\begin{verC} +This is version C +\end{verC} +\begin{verD} +This is version D +\end{verD} +\end{solution} + +\pushProblem % this closes the group +\begin{eqComments} +We insert a new page command so we can see the shortened titles on the next page +to verify that the new system of title management is working correctly. +\end{eqComments} +\emitMessageNearBottom*[.75\textheight]{% + \vfill\hfill\textbf{Problem~{\eqeCurrProb} continues on next page}} +\popProblem % this begins a group + +\selectVersion{}{5} + \item \verb!\selectVersion{}{5}! This is a problem, version \vA{A}\vB{B}\vC{C}\vD{D}\vE{E} of 5. +\begin{verB} +This is version B +\end{verB} +\begin{verE} +This is version E +\end{verE} +\begin{solution} +This is version \vA{A}\vB{B}\vC{C}\vD{D}\vE{E} + +The answer is: +\begin{verB} +This is version B +\end{verB} +\begin{verE} +This is version E +\end{verE} +\end{solution} + +\selectVersion{}{4} + \item \verb!\selectVersion{}{4}! This is a problem, version \vA{A}\vB{B}\vC{C}\vD{D} of 4. +\begin{verA} +This is A +\end{verA} +\begin{verB} +This is version B +\end{verB} +\begin{verE} +This is version E +\end{verE} +\begin{solution} +This is version \vA{A}\vB{B}\vC{C}\vD{D}\vE{E}. + +The answer is: +\begin{verA} +This is version A +\end{verA} +\begin{verB} +This is version B +\end{verB} +\begin{verC} +This is version C +\end{verC} +\begin{verD} +This is version D +\end{verD} +\begin{verE} +This is version E +\end{verE} +\end{solution} +\end{parts} +\end{problem*} + +\end{exam} +\end{document} diff --git a/macros/latex/contrib/mi-solns/examples/use-db.tex b/macros/latex/contrib/mi-solns/examples/use-db.tex new file mode 100644 index 0000000000..c743f72138 --- /dev/null +++ b/macros/latex/contrib/mi-solns/examples/use-db.tex @@ -0,0 +1,23 @@ +\documentclass{article} +\usepackage[forcolorpaper]{web} + +\usepackage{exerquiz} + +\usepackage{mi-solns} + +\copySolnsOff + + +\begin{document} + +%\noindent\textbf{Ogden Nash: First Limerick} +%\insExSoln[\declSOLOut{poems.lst}]{First Limerick}\medskip + +\noindent\textbf{Ogden Nash: The Lama} +\insExSoln[\declSOLOut{poems.lst}]{The Lama}\medskip + +\noindent\textbf{Edward R. Sill: Opportunity} +\insExSoln[\declSOLOut{poems.lst}]{Opportunity}\medskip + + +\end{document} |