Debian Codegraph @

texmf-dist/doc/latex/mi-solns/examples/mi-solns-eq.tex

raw
1 \documentclass{article}
2 \usepackage[designiv,forcolorpaper]{web}
3 \usepackage{exerquiz}
4 \usepackage{mi-solns}
5
6 \def\cs#1{\texttt{\char`\\#1}}
7 \let\pkg\textsf
8 \let\env\texttt
9
10 %\copySolnsOff
11 %\readSolnsOff
12
13 \noSolnOpt
14
15 \declCQSolStr{\textit{Solution}}\declCQQuesStr{\textit{Question}}
16
17 \begin{document}
18
19 \section{Introduction}
20
21 \noindent
22 \textbf{The Problem.} For a document that uses \pkg{exerquiz} or \pkg{eqexam}, can a solution
23 that is marked in some way be reproduced in another part of the
24 document?\medskip
25
26 \noindent\textbf{The Solution.} We require copies of \cs{jobname.sol} and
27 \cs{jobname.qsl} be made; these are named \cs{jobname-cpy.sol} and
28 \cs{jobname-cpy.qsl} (default names), and they are created at the end of each
29 compile. This file is closed when you compile again and hence can be input.
30 The switch for the compiler must be \texttt{--shell-escape} for those using
31 MiK\TeX. When a copy of a solution is needed, one of these two files are
32 input with the appropriate redefinitions. The solution has been formalized
33 into a new package \pkg{ci-solns}.
34
35 \section{Exercises}
36
37 Below are two extracted solutions from the exercises in this section.
38 \begin{itemize}
39
40 \item The solution to Exercise~2 is\\[6pt]\textsl{\insExSoln{dps}} True this!
41
42 \item The question of Exercise~2 is enclosed in the \env{cq} environment.
43 The question to the solution is typeset automatically, as above. The solution to
44 Exercise~2 again, this time without the question, we pass the special command
45 \cs{ignoreterminex}: \textsl{\insExSoln[\ignoreterminex]{dps}}
46
47 \item J\"{u}rgen's solution is \textsl{\insExSoln{j-mon}}
48
49 \end{itemize}
50
51 \begin{exercise}\label{ex:one}
52 Solve this tricky one
53 \begin{solution}
54 1) That was a tricky one, can't do it.
55 \end{solution}
56 \end{exercise}
57
58 \begin{exercise}\label{ex:two}\begin{cq}
59 Solve this tricky one.\end{cq}
60
61 \mrkForIns{dps}
62 \begin{solution}
63 \ifwithinsoldoc
64 2) That was a tricky one, can't do it. \else whatever!\fi
65
66 Pass some verbatim content as a test: \verb~$&%$^^%&~.
67 \end{solution}
68 \end{exercise}
69
70 \begin{exercise}\label{ex:three}
71 Solve this tricky one
72 \begin{solution}
73 3) That was a tricky one, can't do it.
74 \end{solution}
75 \end{exercise}
76
77 \begin{exercise*}
78 \begin{parts}
79 \item This is the part (a) question.
80 \begin{solution}
81 This is the part (a) solution.
82 \end{solution}
83
84 \item (J\"{u}rgen's little q) This is the part (b) question.
85 \mrkForIns{j-mon}
86 \begin{solution}
87 This is the part (b) solution.
88 \end{solution}
89
90 \item This is the part (b) question.
91 \begin{solution}
92 This is the part (b) solution.
93 \end{solution}
94
95 \end{parts}
96 \end{exercise*}
97
98 \newpage
99
100 \section{Quizzes}
101
102 In this section are two quizzes, generated by the \env{shortquiz} and \env{quiz} environments.
103
104 \begin{itemize}
105
106 \item Alex's solution is \textsl{\insSqSoln{aps}} Check for spurious spaces.
107
108 \item Topi's solution is \textsl{\insQzSoln{topi}} Check for spurious spaces.
109 \end{itemize}
110
111 \begin{shortquiz}
112 Solve each
113 \begin{questions}
114 \item \begin{answers}*{4}
115 \Ans0 False &\Ans1 True
116 \end{answers}
117 \begin{solution}
118 The answer is True
119 \end{solution}
120
121 \mrkForIns{aps}
122 \item (Alex's question) $\cos(\pi) = \RespBoxMath{-1}*{1}{.0001}{[2,4]}\cgBdry\kern1bp\CorrAnsButton{-1}$
123 \begin{solution}
124 Of course, everyone knows that $\cos(\pi) = -1 $.
125 \end{solution}
126 \end{questions}
127 \end{shortquiz}
128
129 \useBeginQuizButton
130 \useEndQuizButton
131
132 \begin{quiz*}{mathquiz} Answer each of the following. Passing
133 is 100\%.
134
135 \begin{questions}
136
137 \mrkForIns{topi}
138 \item (Topi's question) If $\lim_{x\to a} f(x) = f(a)$, then we say that $f$ is\dots
139 \begin{answers}*{3}
140 \Ans0 differentiable &\Ans1 continuous &\Ans0 integrable
141 \end{answers}
142
143 \begin{solution}
144 A function $f$ is said to be continuous at $x=a$ if $x\in\mbox{Dom}(f)$,
145 $\lim_{x\to a} f(x) $ exists and $\lim_{x\to a} f(x) = f(a)$.
146 \end{solution}
147
148 \item $\cos(\pi) = \RespBoxMath{-1}*{1}{.0001}{[2,4]}\cgBdry\kern1bp\CorrAnsButton{-1}$
149 \begin{solution}
150 Of course, everyone knows that $\cos(\pi) = -1 $.
151 \end{solution}
152
153 \end{questions}
154 \end{quiz*}\quad\ScoreField\currQuiz\olBdry\eqButton\currQuiz
155
156 \noindent
157 Answers: \AnswerField\currQuiz
158
159 \end{document}