summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/probsoln/sample2.tex
blob: abc7c0d7bd31707572c28590065d719fac8b7172 (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
\documentclass[a4paper]{article}

\usepackage{probsoln}
%uncomment the following line to display the answers
\showanswers

% The following will generate a different set of
% problems in subsequent years
%\PSNrandseed{\year}

% The following will generate a different set of
% problems on every run (where each run is at
% least a minute apart from the previous one)
\PSNrandseed{\time}

\begin{document}
\title{Sample Problem Sheet}
\author{Nicola Talbot}
\maketitle

\begin{enumerate}

\newcounter{numproblems}
% store a random number from 1 to 3 in the counter numproblems
\random{numproblems}{1}{3}

% selects 1,2 or 3 problems from 1 of the given files:
\doforrandN{1}{\file}{1stprncp,implicit}{\selectrandomly{\file}{\value{numproblems}}}

\item Differentiate the following functions:
\input{args}% load database
\begin{enumerate}
\newcounter{A}
\newcounter{B}
\newcounter{C}
\random{A}{-4}{5}
\random{B}{-3}{3}
\random{C}{-1}{10}
\item \useproblem{diff:quad}{\arabic{A}}{\arabic{B}}{\arabic{C}}

\random{A}{-5}{5}
% make sure its not 0
\whiledo{\value{A}=0}{\random{A}{-5}{5}}
\item \useproblem{diff:sin}{\arabic{A}}
\end{enumerate}
\end{enumerate}
\end{document}