使用 probsoln 包创建随机试卷

使用 probsoln 包创建随机试卷

我已经编写了使用 Probson 包生成随机问题的代码。我遇到的唯一问题是,当我运行该程序时,它会一次又一次地显示相同的输出。我想要的是,每当我运行这个程序时,它都应该从文件中选择不同的问题并给我不同的输出。

\documentclass[a4paper]{article}
\usepackage{probsoln}

\loadrandomproblems[easy1]{3}{file1.tex}%
\loadrandomproblems[easy2]{4}{file2.tex}

\begin{document}

\begin{enumerate}

 \foreachproblem[easy1]{\item \thisproblem}
  \foreachproblem[easy2]{\item \thisproblem}
\end{enumerate}
\end{document}

file1.tex 的内容是

\newproblem{dfp:xcube}{
Differentiate $f(x) = x^3$ with respect to $x$ by first principles.}{}

\newproblem{dfp:Ioverxsq}{
Differentiate $\displaystyle f(x) = \frac{1}{x^2}$ with respect to $x$ by first principles.}{}

\newproblem{dfp:sqrtx}{
Differentiate from first principles $f(x) = \surd x$}{}

\newproblem{dfp:cons}{
Differentiate from first principles $f(x) = c$ here $c$ is a constant.}{}

\newproblem{dfp:cosx1}{my next problem}{}

file2.tex 的内容为

\newproblem{Q1}{first question}{}
\newproblem{Q2}{second question}{}
\newproblem{Q3}{third question}{}
\newproblem{Q4}{fourth question}{}
\newproblem{Q5}{five question}{}
\newproblem{Q6}{six question}{}
\newproblem{Q7}{seven question}{}
\newproblem{Q8}{eight question}{}
\newproblem{Q9}{nine question}{}
\newproblem{Q10}{Ten question}{}

相关内容