summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/mi-solns/examples/mi-solns-eq.tex
blob: d6cc6b31ab8b8058065ec4a1f00ffbdaf817623d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
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}