1

This can be seen as a follow up to this question: Properly defining problems and subproblems using the xsim package

I have not yet accepted this question, as I am still trying to update my tex distribution to the newest version to fully test the answer. However, from the answer I was able to come up with my own solution which lead me to this question

Background

I want to take in previous exam problems in Calculus 1, from different universities, label them, and separate them into exercises and subquestions. The exercises are the main exam problems and looks something like this

enter image description here

The subquestions are a part of exercises that can stand alone. Think, "Problem 1b", where "1b" is not dependent on "1a" or other information (like the introduction text of a problem). Thus, one could mix and match subquestions.

Goal

I want to sample exercises with different themes from these exams

Ideally I want to sample 1-2 problems about integration, derivation, differential equations and complex numbers.

Problem

There are about 4 universities that offer these courses, and usually they hold 2 exams per year with about 4-8 problems per exam. I want to sample problems from the last 5 years. If they on average have 6 problems per exam this gives me roughly 250 exercises to sample from.

In the example below, I have only included 1 exam per university from 1 year giving a meager 24 exercises to sample from.

Sampling only problems labeled integration gives me well over 58 aux-files.

enter image description here

Creating collections for all four makes the problem much much worse.

Compilation times takes about a minute or two for complex and when I include all four it was still not done after 30 minutes.

I shudder when I think how many weeks the compilation will take when sampling from the entire pool of 250 problems.

Questions

  • Is there a better way to sample (pick random question) with different tags? Do I have to create a seperate unique collection for each of them?

  • Why does xsim create som many aux-files? Is there a way to make it calm down?

  • Why does the compilation time take forever is it a way to make it compile in a reasonable time (e.g few minutes) when increasing the number of exercises to about 250?

Code

main.tex

\documentclass{article}
\usepackage{amssymb,mathtools}
\usepackage[ISO]{diffcoeff}
\usepackage{tasks}
\usepackage{xsim}

\providecommand*\e{e}

\DeclareExerciseType{subquestion}{ exercise-env = question , solution-env = answer , exercise-name = Question , solution-name = Answer , exercise-template = item , solution-template = item } \DeclareExerciseTagging{year} % 1992, 2010, etc \DeclareExerciseTagging{topic} \DeclareExerciseTagging{semester} % V (Spring), H (Fall) \DeclareExerciseTagging{exam} % O (ordinary), K (kont / re-sit exam), P (prøveeksamen) \DeclareExerciseTagging{university} % UiO, UiB, UiT, etc \DeclareExerciseProperty{title} \DeclareExerciseTagging{type}

\DeclareExerciseEnvironmentTemplate{named} {\subsection*{\GetExercisePropertyTF{title}{#1}{??}}} {}

\DeclareExerciseEnvironmentTemplate{item} {\item} {}

\xsimsetup{ exercise/template = named, exercise/begin-hook = \renewcommand\theenumi{\alph{enumi}}, }

\DeclareExerciseCollection{MAT}

\DeclareExerciseCollection{integral} \DeclareExerciseCollection{derivative} \DeclareExerciseCollection{complex} \DeclareExerciseCollection{ODE}

\newcommand*\includeQuestion[1]{% \XSIMexpandcode{\printexercise{subquestion}{\GetExerciseIdForProperty{ID}{#1}}}% }

\newcommand*\includeProblem[1]{% \XSIMexpandcode{\printexercise{exercise}{\GetExerciseIdForProperty{ID}{#1}}}% }

\usepackage{csquotes} \usepackage{multicol}

\begin{document}

% \collectexercises{integral} % \xsimsetup{type=prob, topic=integral} % \input{UiO/MAT1100/MAT1100-2015-2019} % \input{UiB/MAT111/MAT111-2015-2019} % \input{UiT/MAT-1001/MAT-1001-2015-2019} % \input{UiS/MAT100/MAT111-2015-2019} % \collectexercisesstop{integral}

% \collectexercises{derivative} % \xsimsetup{type=prob, topic=derivative} % \input{UiO/MAT1100/MAT1100-2015-2019} % \input{UiB/MAT111/MAT111-2015-2019} % \input{UiT/MAT-1001/MAT-1001-2015-2019} % \input{UiS/MAT100/MAT111-2015-2019} % \collectexercisesstop{derivative}

\collectexercises{complex} \xsimsetup{type=prob} \input{main-problems.tex} % \input{UiO/MAT1100/MAT1100-2015-2019} % \input{UiB/MAT111/MAT111-2015-2019} % \input{UiT/MAT-1001/MAT-1001-2015-2019} % \input{UiS/MAT100/MAT111-2015-2019} \collectexercisesstop{complex}

% \collectexercises{ODE} % \xsimsetup{type=prob, topic=ODE} % \input{UiO/MAT1100/MAT1100-2015-2019} % \input{UiB/MAT111/MAT111-2015-2019} % \input{UiT/MAT-1001/MAT-1001-2015-2019} % \input{UiS/MAT100/MAT111-2015-2019} % \collectexercisesstop{ODE}

% \printcollection{MAT}

\printrandomexercises[collection=complex]{1}

% \printrandomexercises[collection=derivative]{1}

% \printrandomexercises[collection=integral]{1}

% \printrandomexercises[collection=ODE]{1}

\end{document}

main-problems.tex

\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT-1001-2019-H-O-Problem-1-a,
  university = {UiT},
  topic = {complex, root}
  ]
  Det komplekse tallet $z_1 = 1 + i \sqrt{2}$ er en løsning til annengradslikningen

\begin{equation} z^2 - 2z + 3 = 0. \end{equation}

Finn den andre løsningen $z_2$. Regn så ut tallet $z_1^2 + z_2^2$. \end{question}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT-1001-2019-H-O-Problem-1-b, university = {UiT}, topic = {complex, root, figure} ] Finn alle tre tredjegradsrøttene til $8$ på form $\rho e^{i\theta}$ og merk dem av som punktet på en skisse av det komplekse planet. Pass på å merke av enhetene $1$ og $i$ på aksene. \end{question}

\begin{exercise}[ year=2019,semester=H,type={prob},exam=O, topic={complex, root, figure}, ID=MAT-1001-2019-H-O-Problem-1, university = {UiT}, title={Oppgave~1 (H19, UiT)}] \begin{enumerate} \includeQuestion{MAT-1001-2019-H-O-Problem-1-a} \includeQuestion{MAT-1001-2019-H-O-Problem-1-b} \end{enumerate} \end{exercise}

\begin{exercise}[year=2019,semester=H,type={prob}, topic={concavity,monotonicity,limit},exam=O, ID=MAT-1001-2019-H-O-Problem-1, university = {UiT}, title={Oppgave~2 (H19, UiT)}] En kontinuerlig funksjon $f\colon [0, \infty) \to \mathbb{R}$ er gitt ved

\begin{equation} f(x) = x^2 \log x, \qquad \text{når} > 0. \end{equation} \begin{enumerate} \item Avgjør hvor $f$ er voksende/avtagende på $(0, \infty)$. \item Avgjør hvor $f$ er konveks/konkav på $(0, \infty)$. \item Regn ut grensen

\begin{equation*}
    \lim_{x \to 0^+} x^2 \log x
\end{equation*}

og finn funksjonsverdien $f(0)$. Hva er minimumsverdien til $f$?

\end{enumerate} \end{exercise}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT-1001-2019-H-O-Problem-3-a, university = {UiT}, topic = {ODE,2-order,homogeneous} ] For differensiallikningen

\begin{equation} u''(x) - 5 u'(x) + 6 u(x) = 0,\phantom{e^x} \end{equation} \end{question}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT-1001-2019-H-O-Problem-3-b, university = {UiT}, topic = {IVT,ODE,2-order,nonhomogeneous} ] For differensiallikningen \begin{equation} u''(x) - 5 u'(x) + 6 u(x) = 2e^x, \end{equation}

Løs startverdiproblemet $y(0)=y'(0)=0$. \end{question}

\begin{exercise}[ year=2019,semester=H,type={prob},exam=O, topic={IVT,ODE,2-order,nonhomogeneous,homogeneous}, ID=MAT-1001-2019-H-O-Problem-3, university = {UiT}, title={Oppgave~3 (H19, UiT)}] \begin{enumerate} \includeQuestion{MAT-1001-2019-H-O-Problem-3-a} \includeQuestion{MAT-1001-2019-H-O-Problem-3-b} \end{enumerate} \end{exercise}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT-1001-2019-H-O-Problem-4-a, university = {UiT}, topic = {integral, IBP, substitution} ] Regn ut integralene

\begin{equation} \int \frac{e^x + 1}{(e^x + 1)^2} \dl x \quad \text{og} \quad \int_1^e x \log^2(x) \dl x \end{equation} \end{question}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT-1001-2019-H-O-Problem-4-b, university = {UiT}, topic = {integral, FTC, linear-approximation} ] Integralet

\begin{equation} \int_0^{2\pi} \frac{\dl u}{5 + 3 \cos(u)} = \frac{\pi}{2} \end{equation}

er oppgitt. Finn for funksjonen

\begin{equation} F(x) = \int_0^{x} \frac{\dl u}{5 + 3 \cos(u)} \end{equation}

den beste lineære tilnærmingen omrking punktet $x = 2\pi$. Vær nøye med din begrunnelse. \end{question}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT-1001-2019-H-O-Problem-4-c, university = {UiT}, topic = {continuous,differentiable} ] En funksjon $g\colon[0,1] \to [0,1]$ er definert ved $g(1) = 1$, og

\begin{equation} g(x) = \frac{k - 1}{k} \cdot x \quad \text{og} \quad \frac{k - 1}{k} \leq x < \frac{k}{k+1} \quad \text{når} \quad k = 1, 2, 3, \ldots \end{equation}

Er $g$ kontinuerlig? Er $g$ integrerbar? Begrunn dine svar. \end{question}

\begin{exercise}[ year=2019,semester=H,type={prob},exam=O, topic={integral, IBP, substitution,FTC, linear-approximation,continuous,differentiable}, ID=MAT-1001-2019-H-O-Problem-4, university = {UiT}, title={Oppgave~4 (H19, UiT)}] \begin{enumerate} \includeQuestion{MAT-1001-2019-H-O-Problem-4-a} \includeQuestion{MAT-1001-2019-H-O-Problem-4-b} \includeQuestion{MAT-1001-2019-H-O-Problem-4-c} \end{enumerate} \end{exercise}

\begin{question}[ year=2018,semester=V,exam=O,type={subprob}, ID=MAT100-2018-V-O-Problem-1-a, university = {UiS}, topic = {complex} ] Gitt $z = 1 + 2i$ og $w = 3 - i$. Regn ut $z^2$, $|z|$ og $z/w$. \end{question}

\begin{question}[ year=2018,semester=H,exam=O,type={subprob}, ID=MAT100-2018-V-O-Problem-1-b, university = {UiS}, topic = {complex, polar, normalform} ] Skriv $a = 1 \sqrt{-3}i$ og $b=-2i$ på eksponentiell form og finn $a^3 b^4$. Skriv svaret på kartesisk form. \end{question}

\begin{question}[ year=2018,semester=H,exam=O,type={subprob}, ID=MAT100-2018-V-O-Problem-1-c, university = {UiS}, topic = {complex, root} ] For hvilke positive heltall $n$ er $i^n = -1$? \end{question}

\begin{exercise}[ year=2018,semester=H,type={prob},exam=O, topic={complex, root, polar, normalform}, ID=MAT100-2018-V-O-Problem-1, university = {UiS}, title={Oppgave~1 (H18, UiS)}] \begin{enumerate} \includeQuestion{MAT100-2018-V-O-Problem-1-a} \includeQuestion{MAT100-2018-V-O-Problem-1-b} \includeQuestion{MAT100-2018-V-O-Problem-1-c} \end{enumerate} \end{exercise}

\begin{question}[ year=2018,semester=V,exam=O,type={subprob}, ID=MAT100-2018-V-O-Problem-2-a, university = {UiS}, topic = {integral,trigonometric} ] $\displaystyle \int \bigl(2x^{5/3} + \cos x) \dl x$ \end{question}

\begin{question}[ year=2018,semester=H,exam=O,type={subprob}, ID=MAT100-2018-V-O-Problem-2-b, university = {UiS}, topic = {integral,logarithm,IBP} ] $\displaystyle \int x^2 \log x \dl x$ \end{question}

\begin{question}[ year=2018,semester=H,exam=O,type={subprob}, ID=MAT100-2018-V-O-Problem-2-c, university = {UiS}, topic = {integral,substitution} ] $\displaystyle \int \frac{x^2}{\sqrt{2x^3 + 1}} \dl x$ \end{question}

\begin{question}[ year=2018,semester=H,exam=O,type={subprob}, ID=MAT100-2018-V-O-Problem-2-d, university = {UiS}, topic = {integral,PFD} ] $\displaystyle \int \frac{x^2+1}{(x+1)^2(x+2)} \dl x$ \end{question}

\begin{question}[ year=2018,semester=H,exam=O,type={subprob}, ID=MAT100-2018-V-O-Problem-2-e, university = {UiS}, topic = {integral, substitution} ] $\displaystyle \int \frac{\tan^{-1}x}{1+x^2} \dl x$ \end{question}

\begin{exercise}[ year=2018,semester=H,type={prob},exam=O, topic={integral}, ID=MAT100-2018-V-O-Problem-2, university = {UiS}, title={Oppgave~2 (H18, UiS)}] Finn følgende integraler. Utregning må vises! \begin{multicols}{2} \begin{enumerate} \includeQuestion{MAT100-2018-V-O-Problem-2-a} \includeQuestion{MAT100-2018-V-O-Problem-2-b} \includeQuestion{MAT100-2018-V-O-Problem-2-c} \includeQuestion{MAT100-2018-V-O-Problem-2-d} \includeQuestion{MAT100-2018-V-O-Problem-2-e} \item[\vspace{\fill}] \end{enumerate} \end{multicols} \end{exercise}

\begin{question}[ year=2018,semester=H,exam=O,type={subprob}, ID=MAT100-2018-V-O-Problem-3-a, university = {UiS}, topic = {ODE, IVP} ] Løs initialverdiproblemet:

\begin{equation} \begin{cases} 4 y'' + y' + y = 0, \ y(0) = 0, \quad y'(0) = 1. \end{cases} \end{equation} \end{question}

\begin{question}[ year=2018,semester=H,exam=O,type={subprob}, ID=MAT100-2018-V-O-Problem-3-b, university = {UiS}, topic = {ODE, 1-order, separable} ] Løs differensialligningen

\begin{equation} \diff yx = x^2 + y^2 x^2. \end{equation} \end{question}

\begin{exercise}[ year=2018,semester=H,type={prob},exam=O, topic={ODE, IVP, 1-order, separable}, ID=MAT100-2018-V-O-Problem-3, university = {UiS}, title={Oppgave~3 (H18, UiS)}] Finn følgende integraler. Utregning må vises! \begin{enumerate} \includeQuestion{MAT100-2018-V-O-Problem-3-a} \includeQuestion{MAT100-2018-V-O-Problem-3-b} \end{enumerate} \end{exercise}

\begin{exercise}[ year=2018,semester=H,type={prob},exam=O, topic={derivative, max-min, integral, surface-of-revolution}, ID=MAT100-2018-V-O-Problem-5, university = {UiS}, title={Oppgave~5 (H18, UiS)}] Funksjonen $f$ er gitt som

\begin{equation} f(x) = x \sqrt{1 - x^2}, \qquad x \in [-1, 1]. \end{equation} \begin{enumerate} \item Finn alle ekstremalpunktene for $f$. Avgjør om de er logale eller globale maksimum og minimum. \item La $D$ være området avgrenset av grafen til $f$, $x$-aksen, $x=0$, og $x=1$. Finn volumet av omdreiningslegemet som fremkommer ved å dreie $D$ om $y$-aksen. \end{enumerate} \end{exercise}

\begin{exercise}[ year=2018,semester=H,type={prob},exam=O, topic={curve, implicitt-derivative}, ID=MAT100-2018-V-O-Problem-5, university = {UiS}, title={Oppgave~5 (H18, UiS)}] En kurve er definert implisitt ved $x^2 y^3 - x^3 y^2 = 12$ \begin{enumerate} \item Finn $\diff x/y$. \item Finn likningene for tangenten og normalen til kurven gjennom punktet $(-1, 2)$. \end{enumerate} \end{exercise}

\begin{exercise}[ year=2018,semester=H,type={prob},exam=O, topic={IVT, ODE, word-problem}, ID=MAT100-2018-V-O-Problem-6, university = {UiS}, title={Oppgave~6 (H18, UiS)}] Ali Gruffalo har akkuratt brygget seg en kopp kaffe. Kaffen er kjempevarm og holder temperaturen $96^\circ$C. Dette er alt for varmt for å drikkes og Ali venter derfor litt for at kaffen skal kjøle seg ned. Vi antar nedkjølinga følger Newtons kjølelov

\begin{equation} \diff Tt = -k(T - A) \end{equation}

hvor $T$ er temperaturen (i $^\circ$C, $t$ er tiden (i minutter), $A$ er temperaturen til omgivelsene, og $k$ er konstant. Temperaturen i rommet er $21^\circ$C, så vi lar $A = 21$. \begin{enumerate} \item Løs differensiallikningen med initialbetingelsen $T(0) = 96$. \item Etter $5$ minutter måler Ali temperaturen i kaffen til å være $66^\circ$C. Når er temperaturen i kaffen $45^\circ$C? \end{enumerate} \end{exercise}

\begin{exercise}[year=2019,semester=H,type={prob}, topic={partialderivative,derivative},exam=O, ID=MAT1100-2019-H-O-Problem-1, university = {UiO}, title={Oppgave~1 (H19, UiO)}] Finn de partiellderiverte $\diffp{f}{x}$, $\diffp{f}{x}$, $\diffp{f}{x}$ til

\begin{equation} f(x, y, z) = y^2 \tan(x z^3). \end{equation} \end{exercise}

\begin{exercise}[year=2019,semester=H,type={prob}, topic={gradient,derivative,steepest-descent},exam=O, ID=MAT1100-2019-H-O-Problem-2, university = {UiO}, title={Oppgave~2 (H19, UiO)}] Finn stigningstallet til funksjonen $f(x, y) = x^3y + x^2$ i punktet $(1, -1)$ i den retningen der funksjonen vokser raskest. \end{exercise}

\begin{exercise}[year=2019,semester=H,type={prob}, topic={gradient,derivative,steepest-descent},exam=O, ID=MAT1100-2019-H-O-Problem-3, university = {UiO}, title={Oppgave~3 (H19, UiO)}] Finn stigningstallet til funksjonen $f(x, y) = x^3y + x^2$ i punktet $(1, -1)$ i den retningen der funksjonen vokser raskest. \end{exercise}

\begin{exercise}[year=2019,semester=H,type={prob}, topic={matrix,inverse},exam=O, ID=MAT1100-2019-H-O-Problem-4, university = {UiO}, title={Oppgave~4 (H19, UiO)}] \begin{flalign} &\text{La} & \begin{pmatrix} 1 & a \ 0 & 1 \end{pmatrix}, \quad \text{der $a$ er ett reelt tall}.&& \end{flalign} \begin{enumerate} \item Regn ut matriseproduktene $M(2)M(3)$ og $M(1)M(2)$ og matrisepotensen $\bigl(M(a)\Bigr)^3$. \item Regn ut $M(a)M(b)$ og finn den inverse matrisen til $M(a)$. \end{enumerate} \end{exercise}

\begin{exercise}[year=2019,semester=H,type={prob}, topic={integral, convergence},exam=O, ID=MAT1100-2019-H-O-Problem-5, university = {UiO}, title={Oppgave~5 (H19, UiO)}] Avgjør om det uegentlige integralet

\begin{equation} \int_0^1 \frac{\arctan x}{x^2} \dl x \end{equation}

konvergerer eller divergerer. \end{exercise}

\begin{exercise}[year=2019,semester=H,type={prob}, topic={FTC,derivative,second-derivative},exam=O, ID=MAT1100-2019-H-O-Problem-6, university = {UiO}, title={Oppgave~6 (H19, UiO)}] Finn den andrederiverte til funksjonen

\begin{equation} f(x) = \int_1^{2x^2} \e^{3t} \dl t, x \in [1, \infty) \end{equation} \end{exercise}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT1100-2019-H-O-Problem-7-a, university = {UiO}, topic = {complex,root,polar} ] Skriv de komplekse røttene til polynomet

\begin{equation} x^2 + x + 1 \end{equation}

både på $a + ib$ form og på polarform. \end{question}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT1100-2019-H-O-Problem-7-b, university = {UiO}, topic = {complex,root,factorization} ] Faktoriser

\begin{equation} x^4 + x^2 + 1 \end{equation}

i reelle andregradspolynomer. \end{question}

\begin{exercise}[year=2019,semester=H,type={prob}, topic={complex,root,polar,factorization},exam=O, ID=MAT1100-2019-H-O-Problem-7, university = {UiO}, title={Oppgave~7 (H19, UiO)}] \begin{enumerate} \includeQuestion{MAT1100-2019-H-O-Problem-7-a} \includeQuestion{MAT1100-2019-H-O-Problem-7-b} \end{enumerate} \end{exercise}

\begin{exercise}[year=2019,semester=H,type={prob}, topic={continuous,differentiable,integrable},exam=O, ID=MAT1100-2019-H-O-Problem-8, university = {UiO}, title={Oppgave~8 (H19, UiO)}] La $a$, $b$ og $c$ være reelle tall. La

\begin{equation} f(x) = \begin{cases} c & \text{hvis} \ x = 0\ \frac{ax \cos x}{\sin x} + 2 & \text{hvis} 0 < x < \frac{\pi}{2}\ bx + 1 & \text{hvis} \ \frac{\pi}{2} \leq x \leq 2 \end{cases} \end{equation} \begin{enumerate} \item For hvilke reelle tall $a$ og $c$ er $f$ kontinuerlig i $x = 0$. \item Finn $a$, $b$ og $c$ slik at $f$ er kontinuerlig på $[0, 2]$ og deriverbart på $(0, 2)$. \item Forklar hvorfor $f$ er integrerbar på hele intervallet $[0, 2]$ for alle reelle tall $a$, $b$ og $c$. (Du skal ikke finne integralet.) \end{enumerate} \end{exercise}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT111-2019-H-O-Problem-1-a, university = {UiB}, topic = {complex,root,normalform} ] Skriv de komplekse tallene nedenfor på normalform (på formen $a + ib$):

\begin{tasks}(2) \task $\displaystyle \frac{2 + 3i}{1 + 4i}$ \task $\displaystyle \Bigr(\frac{1}{2} - \frac{\sqrt{3}}{2}i\Bigl)^9$ \end{tasks} \end{question}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT111-2019-H-O-Problem-1-b, university = {UiB}, topic = {complex,root,normal} ] Finn alle løsningene til ligningen $z^3 = -1 $ og skriv dem på normalform. \end{question}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT111-2019-H-O-Problem-1-c, university = {UiB}, topic = {complex,root,factorization} ] Faktoriser $z^3 + 1$ i lineære faktorier over $\mathbb{C}$ og i lineære kvadratiske faktorer over $\mathbb{R}$. \end{question}

\begin{exercise}[year=2019,semester=H,type={prob}, topic={complex},exam=O, ID=MAT111-2019-H-O-Problem-1, university = {UiB}, title={Oppgave~1 (H19, UiB)}] \begin{enumerate} \includeQuestion{MAT111-2019-H-O-Problem-1-a} \includeQuestion{MAT111-2019-H-O-Problem-1-b} \includeQuestion{MAT111-2019-H-O-Problem-1-c} \end{enumerate} \end{exercise}

\begin{exercise}[year=2019,semester=H,type={prob}, topic={IVT,ODE,1-order,seperable},exam=O, ID=MAT111-2019-H-O-Problem-2, university = {UiB}, title={Oppgave~2 (H19, UiB)} ] En kiselalge (\textit{Tacphoria arlyc Ketil, 2019}) blomstrer i takt med tilgangen på næring, slik at den totale massen $y(t)$ (i megatonn) kiselalger i Beringhavet ved tid t (i måneder etter nyttår) tilfredsstiller differensialligningen

\begin{equation} y'(t) = k \sin \Bigl( \frac{2\pi t}{12} \Bigr) \cdot y(t), \end{equation}

der $k$ er en konstant. Gitt at $y(0) = 100$ og $y(6) = 400$, finn $y(t)$. \end{exercise}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT111-2019-H-O-Problem-3-a, university = {UiB}, topic = {limit,epsilon-delta} ] Bruk den \emph{formelle definisjonen av grenseverdi} (\enquote{$\varepsilon-\delta$ definisjonen}) til å vise at:

\begin{equation} \lim_{x \to 1} \Bigl( x^2 + x + 1 \Bigr) = 3, \end{equation} \end{question}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT111-2019-H-O-Problem-3-b, university = {UiB}, topic = {lhopital,limit,derivative} ] La $f$ og $g$ være deriverbare funksjoner og $a$ et reelt tall slik at

\begin{equation} f(a) = g(a) = 0, \quad g'(a) = 0 \end{equation}

Begrunn at

\begin{equation} \frac{f'(a)}{g'(a)} = \lim_{x \to a} \frac{f(x)}{g(x)}. \end{equation}

Du får \emph{bare} bruke definisjonen av den deriverte og grensesetningene, ikke f.eks. l'Hôpital's regel. \end{question}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT111-2019-H-O-Problem-3-c, university = {UiB}, topic = {lhopital,limit,derivative} ] Bruk l'Hôpitals regel til å regne ut

\begin{equation} \lim_{x \to 0} \frac{x}{\e^x - 1} \end{equation}. \end{question}

\begin{exercise}[year=2019,semester=H,type={prob}, topic={limit,epsilon-delta,derivative,lhopital},exam=O, ID=MAT111-2019-H-O-Problem-3, university = {UiB}, title={Oppgave~3 (H19, UiB)}] \begin{enumerate} \includeQuestion{MAT111-2019-H-O-Problem-3-a} \includeQuestion{MAT111-2019-H-O-Problem-3-b} \includeQuestion{MAT111-2019-H-O-Problem-3-c} \end{enumerate} \end{exercise}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT111-2019-H-O-Problem-4-a, university = {UiB}, topic = {integral,partial-fractions} ] \begin{equation} \int \frac{\dl x}{x^2 + 2x - 15} \end{equation} \end{question}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT111-2019-H-O-Problem-4-b, university = {UiB}, topic = {integral,IBP} ] \begin{equation} \int_0^1 \tan^{-1}x \dl x \end{equation} \end{question}

\begin{question}[ year=2019,semester=H,exam=O,type={subprob}, ID=MAT111-2019-H-O-Problem-4-c, university = {UiB}, topic = {integral,substitution} ] (Hint: bruk delvis integrasjon) \begin{equation} \int_0^1 \frac{x^2}{\sqrt{1 - x^2}}\dl x \end{equation} \end{question}

\begin{exercise}[ year=2019,semester=H,type={prob},exam=O, topic={limit,epsilon-delta,derivative,lhopital}, ID=MAT111-2019-H-O-Problem-4, university = {UiB}, title={Oppgave~4 (H19, UiB)} ] Regn ut integralene ved grunnleggende integrasjonsteknikker (ikke ved å slå opp i permen i læreboken) \begin{enumerate} \includeQuestion{MAT111-2019-H-O-Problem-4-a} \includeQuestion{MAT111-2019-H-O-Problem-4-b} \includeQuestion{MAT111-2019-H-O-Problem-4-c} \end{enumerate} \end{exercise}

Marijn
  • 37,699
N3buchadnezzar
  • 11,348
  • 7
  • 55
  • 114

2 Answers2

2

The reasoning behind the auxililary files is explained in section 5 How the Exercise Environments Work of the manual: because this is the easiest way to allow verbatim material inside of the exercises and solutions.

And because it was obvious from the very beginning that those possibly many, many files cluttering the project folder may very well be at least distracting and maybe annoying xsim always had an option called path:

path = {<path>} With this option a subfolder or path within the main project folder can be given. Exercises will be written to and included from this path. The path must exist on your system before you can use it!

In v0.13 (2019/10/06) the option `no-files' was introduced.

no-files This option prevents xsim from writing the exercises and solutions to external files. This will keep your working folder “clean” but will also prevent using verbatim material in exercises and solutions and will possibly slow processing further down.


The development of xsim is work in progress. Your not so minimal example takes on my machine about 30s for the first compilation and 80s to 85s on subsequent compilations. With my draft for the next version the same file takes about 2s for the first compilation and 7s to 8s on subsequent compilations: only about a tenth of the time. Other tests with other examples show about the same factor of performance enhancement. So stay tuned :)

cgnieder
  • 66,645
0

dbshow provides a way to do such things. The example below shows how to filter questions with different conditionals (or the combination). Four groups of questions are filtered and displayed.

  • hard questions
  • hard questions that have been answered incorrectly for more than one time
  • questions that plan to be reviewed on 2022-01-07
  • questions that is record after 2022-01-02
\documentclass{article}
\usepackage{amsmath, physics}
\usepackage{geometry}
\usepackage{dbshow}
\usepackage{tikz}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\usetikzlibrary{shadings}
\usepackage[hidelinks]{hyperref}

\geometry{ margin=2cm }

% #1 link node #2 target node #3 text to show \NewDocumentCommand \linktarget { m m m } {% \hyperlink{#1}{#3}% \raisebox{1em}{\hypertarget{#2}{}}% }

% question box \tcbset{ base/.style={ empty, frame engine=path, colframe=yellow!10, coltitle=red!70, fonttitle=\bfseries\sffamily, sharp corners, left=4pt, right=4pt, drop fuzzy shadow, drop fuzzy shadow, borderline west={3pt}{-3pt}{red!80}, } }

\newtcolorbox{mybox}[1]{% base, title = {#1} }

\dbNewReviewPoints{review}{1, 3, 7, 15, 30, 60}

\dbNewDatabase{ques-book}{ ques = tl, answer = tl, count = int|1, labels = clist, date = date, }

\begin{dbFilters}{ques-book} \dbNewConditional{hard}{labels}{hard} \dbNewConditional{bad}{count}{\dbval > 1} \dbNewConditional{review}{date}{review|2022-01-07} \dbNewConditional*{after}{date}{\dbval > 2022-01-02} \end{dbFilters}

% show all questions with hyperlink to answers \dbNewStyle{ques}{ques-book}{ before-code = {\section{Questions}}, item-code = { \begin{mybox}{% \linktarget{answer_\dbIndex}{ques_\dbIndex}{% Question \dbarabic% \hspace{2em}\dbuse{date}% \hspace{2em}\dbuse{labels}% \hfill\dbuse{count}% }% } \dbuse{ques}% \end{mybox} }, labels/sep = /, }

% show all questions and answers with hyperlink to questions \dbNewStyle{answer}{ques-book}{ before-code = {\section{Questions and Answers}}, item-code = { \begin{mybox}{% \linktarget{ques_\dbIndex}{answer_\dbIndex}{% Question \dbarabic% \hspace{2em}\dbuse{date}% \hspace{2em}\dbuse{labels}% \hfill\dbuse{count}% }% } \dbuse{ques}\tcbsubtitle{Answer}\dbuse{answer}% \end{mybox} }, labels/sep = /, }

% show all hard questions with hyperlink to answers \dbNewStyle{hard}{ques-book}{ before-code = {\section{Hard Questions}}, item-code = { \begin{mybox}{% \hyperlink{answer_\dbIndex}{% Question \dbarabic% \hspace{2em}\dbuse{date}% \hspace{2em}\dbuse{labels}% \hfill\dbuse{count}% }% } \dbuse{ques}% \end{mybox} }, raw-filter = hard, labels/sep = /, }

% show all hard questions that have answered incorrectly for more than one % time with hyperlink to answers \dbNewStyle[hard]{bad}{ques-book}{ before-code = {\section{Bad Questions}}, raw-filter = {bad && hard}, } % show all questions that plan to be reviewed on 2022-01-07 with hyperlink to % answers \dbNewStyle[hard]{review}{ques-book}{ before-code = {\section{Questions to be Reviewed}}, raw-filter = {review}, } % show all questions that is record after 2022-01-02 with hyperlink to answers \dbNewStyle[hard]{after}{ques-book}{ before-code = {\section{Questions after 2022-01-02}}, raw-filter = {after}, }

\AtEndDocument{ \dbshow{review}{ques-book} \dbshow{hard}{ques-book} \dbshow{bad}{ques-book} \dbshow{after}{ques-book} \dbshow{ques}{ques-book} \dbshow{answer}{ques-book} }

\begin{document}

\begin{dbitem}{ques-book}[ date=2022-01-01, labels={math, equation, easy}, count=2 ] \dbsave{ques}{% Solve the linear equation: $x + 16 = 31$. } \dbsave{answer}{% $x = 31 - 16 = 15$ } \end{dbitem}

\begin{dbitem}{ques-book}[ date=2022-01-01, labels={math, equation, hard}, count=3 ] \dbsave{ques}{% Solve the linear equation: $2y = 16$. } \dbsave{answer}{% $y = 16 / 2 = 8$ } \end{dbitem}

\begin{dbitem}{ques-book}[ date=2022-01-04, labels={math, integral, hard}, count=1 ] \dbsave{ques}{% Find the indefinite integral: $\int 2x \dd x$. } \dbsave{answer}{% $\int 2x \dd x = x^2$ } \end{dbitem}

\end{document}

ZhiyuanLck
  • 4,516