probsoln package FAQ
Unlike the datatool package, the probsoln package doesn’t have a concept of columns or fields so it’s not possible to assign associated data to a particular problem.
If you want to switch to datatool, try reading Using the datatool Package for Exams or Assignment Sheets.
If you want to stick with the probsoln package, then there are several approaches. The examples below use a very simplistic definition of a custom command called \points
. You will need to modify it to fit in with your document.
- Split your problems into separate files according to the number of points they should have. For example,
\documentclass{article} \usepackage{probsoln} \newcommand*{\points}[1]{\marginpar{(#1 points)}} \loadrandomproblems[easy]{1}{easy-problems} \loadrandomproblems[medium]{1}{medium-problems} \loadrandomproblems[hard]{1}{hard-problems} \begin{document} \begin{enumerate} \foreachproblem[easy]{\item\thisproblem\points{5}} \foreachproblem[medium]{\item\thisproblem\points{10}} \foreachproblem[hard]{\item\thisproblem\points{20}} \end{enumerate} \end{document}
- Add a points command to your questions. For example, the file test-problems.tex could have questions defined like this:
\newproblem{prob1}{Sample question\points{5}}{Answer to sample question} \newproblem{prob2}{Another sample question\points{10}}{Answer to another sample question}
The custom
\points
command needs to be defined in the document:
\documentclass{article} \usepackage{probsoln} \newcommand*{\points}[1]{\marginpar{(#1 points)}} \loadrandomproblems{1}{test-problems} \begin{document} \begin{enumerate} \foreachproblem{\item\thisproblem} \end{enumerate} \end{document}
2020-07-03 11:55:20
Permalink: https://www.dickimaw-books.com/faq.php?id=249
Alternative link: https://www.dickimaw-books.com/faq.php?itemlabel=probsolnpoints
Category: probsoln package
Topic:
General Queries