From 95080bc66f5d1022cbcfbe7535a87055d02aa568 Mon Sep 17 00:00:00 2001
From: Karl Berry
The probsoln package is designed for teachers or lecturers who want to create problem
-sheets for their students. This package was designed with mathematics problems in
-mind, but can be used for other subjects as well. The idea is to create a file
-containing a large number of problems with their solutions which can be read in
-
-
-
-by LATEX, and then select a number of problems to typeset. This means
-that once the database has been set up, each year you can easily create a new
-problem sheet that is sufficiently different from the previous year, thus preventing
-the temptation of current students seeking out the previous year’s students,
-and checking out their answers. There is also an option that can be passed to
-the package to determine whether or not the solutions should be printed. In
-this way, one file can either produce the student’s version or the teacher’s
+class="ec-lmss-10x-x-109">probsoln package is designed for teachers or lecturers who want to
+create problem sheets for their students. This package was designed with
+mathematics problems in mind, but can be used for other subjects as well. The
+idea is to create a file containing a large number of problems with their
+solutions which can be read in by LATEX, and then select a number of
+problems to typeset. This means that once the database has been set up,
+each year you can easily create a new problem sheet that is sufficiently
+different from the previous year, thus preventing the temptation of current
+students seeking out the previous year’s students, and checking out their
+answers. There is also an option that can be passed to the package
+to determine whether or not the solutions should be printed. In this
+way, one file can either produce the student’s version or the teacher’s
version.
2012-08-23
Contents
-
2 2 Package Options
-
3 3 Verbatim
-
4 4 Showing and Hiding Solutions
-
5 5 General Formatting Commands
-
6 6 Defining a Problem
-
7 7 Using a Problem
-
8 8 Loading Problems From External Files
-
9 Iterating Through Datasets
-
10 Random Number Generator
-
11 Compatibility With Versions Prior to 3.0
-
Index
-
8.1 Randomly Selecting Problems Not Selected in Previous Documents
+
9 Iterating Through Datasets
+
10 Random Number Generator
+
11 Compatibility With Versions Prior to 3.0
+
Index
+
+
+
1 1 Introduction
2 Top
The following options may be passed to this package:
As from version 3.02, problems and solutions may contain verbatim text, but you must
-use the As from version 3.02, problems and solutions may contain verbatim text, but
+you must use the fragile (or fragile=true) option for the associated environments.
- Alternatively, if most of your problems contain verbatim, you can globally set this
-option using:
+class="ec-lmtt-10x-x-109">fragile (or fragile=true) option for the associated
+environments.
+ Alternatively, if most of your problems contain verbatim, you can globally set
+this option using:
-
You can switch off this option using fragile=false.
- The fragile option writes information to a temporary file. This defaults to
+class="ec-lmtt-10x-x-109">fragile=false.
+ The fragile option writes information to a temporary file. This defaults to
\jobname.vrb but the name may be changed. The extension (.vrb) is given
+class="ec-lmtt-10x-x-109">\jobname.vrb but the name may be changed. The extension (.vrb) is given
by:
-
The base name (\jobname) is given by:
-
In addition to the answersanswers and noanswers package options, it is also possible to show or
-suppress the solutions using
-
and
-
respectively.
- The boolean variable showanswers The boolean variable showanswers determines whether the answers should be
displayed. You can use this value with the ifthen package to specify different text
-depending on whether the solutions should be displayed. For example:
+class="ec-lmss-10x-x-109">ifthen package to specify
+different text depending on whether the solutions should be displayed. For
+example:
-
Alternatively you can use \ifshowanswers\ifshowanswers…\else…\fi:
+class="ec-lmtt-10x-x-109">\else…\fi:
-
- For longer passages, you can use the environments
-
and
-
For example:
-
The above will only display the question if showanswers is false and will only display
-the solution if showanswers is true. If you want the question to appear in the answer
-sheet as well as the solution, then don’t put the question in the onlyproblemshowanswers is false and will only
+display the solution if showanswers is true. If you want the question to appear in
+the answer sheet as well as the solution, then don’t put the question in the
+onlyproblem
-environment:
+ id="dx1-5015"> environment:
-
-
- If you use onlysolution within the defproblem If you use onlysolution within the defproblem environment, the problem will be
-tagged as having a solution and will be added to the list used by \foreachsolution.
-The optional argument of onlysolution (and onlyproblem) is inherited from the parent
+ id="dx1-5021">
The commands and environments described in this section are provided to assist
formatting problems and their solutions.
-
By default, this is equivalent to Note that the probsoln package will only define the solution Note that the probsoln package will only define the solution environment if it is not
-already defined.
-
The textenum environment is like the enumeratetextenum environment is like the enumerate environment but is in-line. It uses
-the same counter that the enumerate environment would use at that level so
-the question can be compact but the answer can use enumerate instead. For
+ id="dx1-6012"> environment but is in-line. It
+uses the same counter that the enumerate environment would use at that level
+so the question can be compact but the answer can use enumerate instead. For
+
+
example:
-
In this example, the items in the question are brief, so an enumerateenumerate environment
-would result in a lot of unnecessary white space, but the answers require more space, so
-an enumerate environment is more appropriate. Since the textenum environment uses
-the same counters as the enumerate environment, the question and answer sheets use
-consistent labelling. Note that there are other packages available on CTAN
-that you can use to create in-line lists. Check the TeX Catalogue for further
-details.
- \correctitem
+environment would result in a lot of unnecessary white space, but the answers
+require more space, so an enumerate environment is more appropriate. Since the
+textenum environment uses the same counters as the enumerate environment, the
+question and answer sheets use consistent labelling. Note that there are other
+packages available on CTAN that you can use to create in-line lists. Check the
+TeX Catalogue for further details.
+ \correctitem \incorrectitem \incorrectitem
-
You can use the commands \correctitem and \incorrectitem in place of
+class="ec-lmtt-10x-x-109">\correctitem and \incorrectitem in place of
\item\item. If the solutions are suppressed, these commands behave in the same way
as \item, otherwise they format the item label using one of the commands:
+class="ec-lmtt-10x-x-109">\item, otherwise they format the item label using one of the commands:
\correctitemformat \correctitemformat \incorrectitemformat \incorrectitemformat
-
For example:
-
The default definition of \correctitemformat puts a frame around the label.
+class="ec-lmtt-10x-x-109">\correctitemformat puts a frame around the
+label.
It is possible to construct a problem sheet with solutions using the commands described
-in the previous sections, however it is also possible to define a set of problems for later
-use. In this way you can create an external file containing many problems some or all of
-which can be loaded and used in a document. The probsoln package has a default data
-set labelled “default” in which you can store problems. Alternatively, you can
-create multiple data sets. You can then iterate through each problem in a
-problem set. You can use a previously defined problem more than once, which
-means that by judicious use of onlyproblem It is possible to construct a problem sheet with solutions using the commands
+described in the previous sections, however it is also possible to define a set of
+problems for later use. In this way you can create an external file containing
+many problems some or all of which can be loaded and used in a document. The
+probsoln package has a default data set labelled “default” in which you can
+store problems. Alternatively, you can create multiple data sets. You
+can then iterate through each problem in a problem set. You can use a
+previously defined problem more than once, which means that by judicious
+use of onlyproblem, onlysolutiononlysolution or the showanswers
-boolean variable in conjunction with \showanswersshowanswers boolean variable
+in conjunction with \showanswers and \hideanswers, you can
-print the solutions in a different location to the questions (for example in an
+class="ec-lmtt-10x-x-109">\hideanswers, you can print
+the solutions in a different location to the questions (for example in an
appendix).
-
This defines the problem whose label is given by ⟨label⟩. The label must be unique for a
-given data set and should not contain active characters or a comma. (Active characters
-include the special characters such as $ and &, but some packages may make other
-symbols active, such as the colon (:) character. For example, the ngerman⟨label⟩. The label must be
+unique for a given data set and should not contain active characters or
+a comma. (Active characters include the special characters such as $
+and &, but some packages may make other symbols active, such as the
+colon (:) character. For example, the ngerman and babel
-packages make certain punctuation active. Check the relevant package documentation
-for details.)
-
- If defproblem If defproblem occurs in the document or is included via \input\input or \include, then
-the problem will be added to the default data set. If defproblem occurs in an external
-file that is loaded using one of the commands defined in \include,
+then the problem will be added to the default data set. If defproblem occurs in
+an external file that is loaded using one of the commands defined in §8 Loading Problems
-
-
-
-From External Files then the problem will be added to the specified data
-set.
- The contents of the defproblemLoading
+Problems From External Files then the problem will be added to the specified
+data set.
+ The contents of the defproblem environment should be the text that defines the
-problem. This may include any of the commands defined in environment should be the text that defines
+the problem. This may include any of the commands defined in §4 Showing and Hiding
-Solutions and Showing and
+Hiding Solutions and §5 General Formatting Commands.
- The problem may optionally take ⟨n⟩ arguments (where ⟨n⟩ is from 0 to 9). The
-arguments can be referenced in the definition via #1,…,#9. If ⟨n⟩ is omitted then the
-problem doesn’t take any arguments. The following example defines a problem with one
-argument:
+ The problem may optionally take ⟨n⟩ arguments (where ⟨n⟩ is from 0 to 9).
+The arguments can be referenced in the definition via #1,…,#9. If ⟨n⟩ is omitted
+then the problem doesn’t take any arguments. The following example defines a
+problem with one argument:
-
- The second optional argument ⟨default args⟩ supplies default problem arguments
-that will automatically be used within \thisproblem when used in \foreachproblem
-in conjunction with the package option usedefaultargs The second optional argument ⟨default args⟩ supplies default problem
+arguments that will automatically be used within \thisproblem when used in
+\foreachproblem in conjunction with the package option usedefaultargs. (See §9 Iterating Through
-Datasets.) For example:
+href="#x1-110009">§9
+
-
This is a shortcut command for:
- \begin{defproblem}[⟨n⟩][⟨default args⟩]{⟨label⟩}%
- For example:
+ \begin{defproblem}[⟨n⟩][⟨default args⟩]{⟨label⟩}%
+ For example:
-
is equivalent to
-
(In this example, the argument will need to be a positive number to avoid a double
-minus in the answer. If you want to perform floating point arithmetic on the arguments,
-then try the fp (In this example, the argument will need to be a positive number to avoid a
+double minus in the answer. If you want to perform floating point arithmetic on
+the arguments, then try the fp or pgfmathpgfmath packages.)
- Alternatively, if you want to supply default arguments to use when iterating through
-problems with \foreachproblem Alternatively, if you want to supply default arguments to use when iterating
+through problems with \foreachproblem:
-
-
This is a shortcut for:
- \begin{defproblem}[⟨n⟩][⟨default args⟩]{⟨label⟩}%
-
Once you have defined a problem using defproblemdefproblem or \newproblem\newproblem (see §6 Defining a
-Problem), you can later display the problem using:
-
where ⟨data set⟩ is the name of the data set that contains the problem (the default data
-set is used if omitted), ⟨label⟩ is the label identifying the required problem and ⟨arg1⟩, …,
-⟨argN⟩ are the arguments to pass to the problem, if the problem was defined to have
-arguments (where N is the number of arguments specified when the problem was
-defined).
- For example, in the previous section the problem diffcos was defined to have one
-argument, so it can be used as follows:
+class="lmsy-10x-x-109">⟨data set⟩ is the name of the data set that contains the problem (the
+default data set is used if omitted), ⟨label⟩ is the label identifying the required
+problem and ⟨arg1⟩, …, ⟨argN⟩ are the arguments to pass to the problem, if the
+problem was defined to have arguments (where N is the number of arguments
+specified when the problem was defined).
+ For example, in the previous section the problem diffcos was defined to have
+one argument, so it can be used as follows:
-
This will be equivalent to:
-
You can store all your problem definitions (see §6 Defining a Problem) in an external
-file. These problems can all be appended to the default data set by including the file via
-\input or they can be appended to other data sets using one of the commands
-described below. Once you have loaded all the required problems, you can iterate
-through the data sets using the commands described in §9 Iterating Through Datasets.
-Note that the commands below will create a new data set, if the named data set doesn’t
+href="#x1-70006">Defining a Problem) in an
+external file. These problems can all be appended to the default data set by
+including the file via \input or they can be appended to other data sets
+using one of the commands described below. Once you have loaded all
+the required problems, you can iterate through the data sets using the
+commands described in §9 Iterating Through Datasets. Note that the
+commands below will create a new data set, if the named data set doesn’t
exist.
-
This will load all problems defined in ⟨filename⟩ and append them to the specified
-data set, in the order in which they are defined in the file. If ⟨data set⟩ is
-omitted, the default data set will be used. If ⟨data set⟩ doesn’t exist, it will be
+class="lmsy-10x-x-109">⟨filename⟩ and append them to the
+specified data set, in the order in which they are defined in the file. If ⟨data set⟩
+is omitted, the default data set will be used. If ⟨data set⟩ doesn’t exist, it will be
created.
-
This is like \loadallproblems, but only those problems whose label is listed in the
-comma-separated list ⟨labels⟩ are loaded. For example, if I have some problems defined
-in the file derivatives.tex, then
+class="ec-lmtt-10x-x-109">\loadallproblems, but only those problems whose label is listed in
+the comma-separated list ⟨labels⟩ are loaded. For example, if I have some
+problems defined in the file derivatives.tex, then
-
will only load the problems whose labels are diffsin and diffcos, respectively. All
-the other problems in the file will remain undefined.
-
This is the reverse of \loadselectedproblems. This loads all problems except those
-whose labels are listed in ⟨exception list⟩.
-
This randomly loads ⟨n⟩ problems from ⟨filename⟩ and adds them to the given data
-set. If ⟨data set⟩ is omitted, the default data set is assumed. Note that the
-problems will be added to the data set in a random order, not in the order
-in which they were defined. There must be at least ⟨n⟩ problems defined in
+class="lmsy-10x-x-109">⟨n⟩ problems from ⟨filename⟩ and adds them to the given
+data set. If ⟨data set⟩ is omitted, the default data set is assumed. Note that the
+problems will be added to the data set in a random order, not in the order in
+which they were defined. There must be at least ⟨n⟩ problems defined in
⟨filename⟩.
-
This is similar to \loadrandomproblems except that it won’t load those problems
-whose labels are listed in ⟨exception list⟩.
- Note that the random number generator has been modified in version 3.01 in order
-to fix a bug. If you want to ensure that your random numbers are compatible with
-earlier versions, you can switch to the old generator using
- Note that the random number generator has been modified in version 3.01 in
+order to fix a bug. If you want to ensure that your random numbers are
+compatible with earlier versions, you can switch to the old generator
+using
+
-
+
-
- Once you have defined all your problems for a given data set, you can use an individual
-problem with \useproblem (see §7 Using a Problem) but it is more likely that you will
-want to iterate through all the problems so that you don’t need to remember the labels
-of all the problems you have defined.
+class="ec-lmtt-10x-x-109">\newproblem*. All the commands in this section input the external file within a
+local scope, so command definitions would need to be made global to have any
+effect. In addition, \loadrandomproblems has to load each file twice, which
+means that anything outside a problem definition will be parsed twice.
+
+
+ Suppose you have a large set of questions that you want to randomly select for
+assignments and exams. The chances are, you don’t want to include questions
+that have been previously set for, say, the last three years. That is, you don’t
+want to select questions the students may already have seen. As from version
+3.03, you can now do this.
+ The probsoln package defaults to the UK academic year, which starts in
+September. If this isn’t appropriate, you can change it using:
+
+class="ec-lmtt-10x-x-109">\SetStartMonth{⟨n⟩}
+where ⟨n⟩ is the number of the month. (1 = January, 2 = February,
+etc.)
+ The start year is the calender year in effect when the academic
+year started. For example, if this is the academic year 2011/12, then
+the start year is 2011. This is automatically set to the start of the
+current academic year. It is also updated when \SetStartMonth is
+used.1
+If you want to set it to a specific year, you can use:
+
+For example: \SetStartYear{2008} indicates the academic year 2008/9.
+ There are two files concerned with previously used labels. They are:
+
+ This file keeps track of all the labels used in the current document from
+ the previous LATEX run. Note that if you want to delete this file, first
+ clear it using
+
+
+
+ in place of \ExcludePreviousFile{⟨file⟩}, described below. The
+ argument ⟨file⟩ is the previously used labels file described above.
+ \ClearUsedFile will remove all labels in the current used labels file from
+ the previously used labels file and clear the current used labels file. Once
+ this file is empty, it may then be deleted.
+ Before loading randomly selected problems, first specify the previously used
+labels file with the command:
+
+where ⟨file name⟩ is the name of the previously used file. The optional argument
+⟨number of years⟩ specifies the year cut-off. This defaults to 3, which means that
+only those labels used this year or the previous 2 years will be kept. Any
+problems used before then may be reused.
+ Suppose I’m lecturing a first year undergraduate mathematics course
+(designated, say, mth101). I want to set assignments on each topic and an exam
+at the end of the year (as well as a resit or second sitting paper). I’ve got
+databases with problems for each topic, but the first and second sitting
+exams mustn’t include any of the problems used in the assignments
+or any problems used in assignments or exams for the previous two
+academic years. I’m going to arrange my directory structure as follows:
+
+ Once you have defined all your problems for a given data set, you can use an
+individual problem with \useproblem (see §7 Using a Problem) but it is more
+likely that you will want to iterate through all the problems so that
+you don’t need to remember the labels of all the problems you have
+defined.
+
This does ⟨body⟩ for each problem in the given data set. If ⟨data set⟩ is omitted, the
-default data set is used. Within ⟨body⟩ you can use
-
+class="lmsy-10x-x-109">⟨body⟩ for each problem in the given data set. If ⟨data set⟩ is omitted,
+the default data set is used. Within ⟨body⟩ you can use
+
to use the current problem and
-
+
to access the current label. If the problem requires arguments, and no default
-arguments were supplied in the problem definition or the package option usedefaultargs
-was not used, then you will be prompted for arguments, so if you want to use this
-approach you will need to use LATEX in interactive mode. If you do provide
-arguments, they will be stored in the event that you need to iterate through the data
-set again. The arguments will be included in \thisproblem, so you only need to use
+arguments were supplied in the problem definition or the package option
\thisproblem without having to specify \useproblem.
- For example, to iterate through all problems in the default data set:
+class="ec-lmss-10x-x-109">usedefaultargs was not used, then you will be prompted for arguments, so if you
+
+
+want to use this approach you will need to use LATEX in interactive mode. If
+you do provide arguments, they will be stored in the event that you need to
+iterate through the data set again. The arguments will be included in
+\thisproblem, so you only need to use \thisproblem without having to specify
+\useproblem.
+ For example, to iterate through all problems in the default data set:
-
-
+
+
This is equivalent to \foreachsolution, but only iterates through problems that
-contain the onlysolution environment. Note that you still need to use \showanswers or
-the answers package option for the contents of the onlysolution environment to
-appear.
-
+class="ec-lmtt-10x-x-109">\foreachsolution, but only iterates through problems
+that contain the onlysolution environment. Note that you still need to use
+\showanswers or the answers package option for the contents of the onlysolution
+environment to appear.
+
This does ⟨body⟩ for each of the defined data sets. Within ⟨body⟩, ⟨cmd⟩ will be set to
-the name of the current data set. For example, to display all problems in all data
-sets:
+class="lmsy-10x-x-109">⟨body⟩ for each of the defined data sets. Within ⟨body⟩, ⟨cmd⟩ will be
+set to the name of the current data set. For example, to display all problems in
+all data sets:
-
- Suppose I have two external files called derivatives.tex and probspaces.tex
-which define problems using both onlyproblem and onlysolution for example:
+
+ Suppose I have two external files called derivatives.tex and
+probspaces.tex which define problems using both onlyproblem and onlysolution
+for example:
-
I can write a document that creates two data sets, one for the derivative problems and
-one for the problems about probability spaces. I can then use \hideanswers and iterate
-through the require data set to produce the problems. Later, I can use \showanswers
-and iterate over all problems defined in both data sets to produce the chapter
-containing all the answers. When displaying the questions, I have taken advantage of
-the fact that I can cross-reference items within an enumerate environment,
-and redefined \theenumi to label the questions according to the chapter. The
-cross-reference label is constructed from the problem label and is referenced
-in the answer section to ensure that the answers have the same label as the
+ I can write a document that creates two data sets, one for the derivative
+problems and one for the problems about probability spaces. I can then use
+\hideanswers and iterate through the require data set to produce the
+problems. Later, I can use \showanswers and iterate over all problems defined
+in both data sets to produce the chapter containing all the answers. When
+displaying the questions, I have taken advantage of the fact that I can
+cross-reference items within an enumerate environment, and redefined
+\theenumi to label the questions according to the chapter. The cross-reference
+label is constructed from the problem label and is referenced in the
+answer section to ensure that the answers have the same label as the
questions.
-
-
- This package provides a pseudo-random number generator that is used by
-\loadrandomproblems. As noted earlier the random number generator has been
+
-
-modified in version 3.01 in order to fix a bug. If you want to ensure that your random
-numbers are compatible with earlier versions, you can switch to the old generator
-using
-
-
+
+ This package provides a pseudo-random number generator that is used by
+\loadrandomproblems. As noted earlier the random number generator has been
+modified in version 3.01 in order to fix a bug. If you want to ensure that your
+random numbers are compatible with earlier versions, you can switch to the old
+generator using
+
+
This sets the seed to ⟨n⟩ which must be a non-zero integer. For example, to
+class="lmsy-10x-x-109">⟨n⟩ which must be a non-zero integer. For example, to
generate a different set of random numbers every time you LATEX your
document,1
+href="#fn2x0" id="fn2x0-bk">2
put the following in your preamble:
-
or to generate a different set of random numbers every year you LAT or to generate a different set of random numbers every year you LATEX your
document:
-
-
+
+
This stores the current seed in the count register specified by ⟨register⟩. For
+class="lmsy-10x-x-109">⟨register⟩. For
example:
-
-
+
+
Generates a random integer from 1 to ⟨n⟩ and stores in the count register specified by
-⟨register⟩. For example, the following generates an integer from 1 to 10 and stores it in
-the register \myreg:
+class="lmsy-10x-x-109">⟨n⟩ and stores in the count register
+specified by ⟨register⟩. For example, the following generates an integer from 1 to
+10 and stores it in the register \myreg:
-
-
+
+
Generates a random integer from ⟨min⟩ to ⟨max⟩ and stores in the given counter. For
-example, the following generates a random number between 3 and 8 (inclusive) and
-stores it in the counter myrand.
+class="lmsy-10x-x-109">⟨min⟩ to ⟨max⟩ and stores in the given
+counter. For example, the following generates a random number between 3 and
+8 (inclusive) and stores it in the counter myrand.
-
-
+
+
Randomly selects ⟨n⟩ values from the comma-separated list given by ⟨list⟩ and iterates
-through this subset. On each iteration it sets ⟨cmd⟩ to the current value and does
+class="lmsy-10x-x-109">⟨n⟩ values from the comma-separated list given by
+⟨list⟩ and iterates through this subset. On each iteration it sets ⟨cmd⟩
+to the current value and does ⟨text⟩. For example, the following will
+load a randomly selected problem from two of the listed files (where
⟨text⟩. For example, the following will load a randomly selected problem from two of the
-listed files (where file1.tex, file2.tex and file3.tex are files containing at least
-one problem):
+class="ec-lmtt-10x-x-109">file1.tex, file2.tex and file3.tex are files containing at least one
+problem):
-
-
+
+
Version 3.0 of the probsoln package completely changed the structure of the package,
-but the commands described in this section have been provided to maintain
-compatibility with earlier versions. The only problems that are likely to occur
-are those where commands are contained within groups. This will effect any
-commands that are contained in external files that are outside of the arguments to
-\newproblem and \newproblem*. However, since the external files had to be
-parsed twice in order to load the problems, this shouldn’t be an issue as adding
-anything other than problem definitions in those files would be problematic
-anyway.
- The other likely difference is where the random generator is used in a group. This
-includes commands such as \selectrandomly. For example, if your document
-contained something like:
+ Version 3.0 of the probsoln package completely changed the structure of the
+package, but the commands described in this section have been provided to
+maintain compatibility with earlier versions. The only problems that are likely
+to occur are those where commands are contained within groups. This will effect
+any commands that are contained in external files that are outside of the
+arguments to \newproblem and \newproblem*. However, since the external files
+had to be parsed twice in order to load the problems, this shouldn’t be an issue
+as adding anything other than problem definitions in those files would be
+problematic anyway.
+ The other likely difference is where the random generator is used in a group.
+This includes commands such as \selectrandomly. For example, if your
+document contained something like:
-
Then using versions prior to v3.0 will produce a different set of random numbers since
-the second \selectrandomly is in a different level of grouping. If you want to
-ensure that the document produces exactly the same random set with the
-new version as with the old version, you will need to get and set the random
-number seed. For example, the above would need to be modified so that it
-becomes:
+ Then using versions prior to v3.0 will produce a different set of random
+numbers since the second \selectrandomly is in a different level of grouping. If
+you want to ensure that the document produces exactly the same random set
+with the new version as with the old version, you will need to get and set the
+random number seed. For example, the above would need to be modified so that
+it becomes:
-
-
+
+
This is now equivalent to:
- {\loadrandomproblems[⟨filename⟩]{⟨n⟩}{⟨filename⟩}}%
-
+ {\loadrandomproblems[⟨filename⟩]{⟨n⟩}{⟨filename⟩}}%
+
This is now equivalent to:
- {\loadallproblems[⟨filename⟩]{⟨filename⟩}}%
- Note that in both the above cases, a new data set is created with the same name as
-the file name.
-
-
-
- Note that in both the above cases, a new data set is created with the same
+name as the file name.
+
+
+ B
+class="ec-lmbx-10x-x-109">B
C
+class="ec-lmbx-10x-x-109">C D
+class="ec-lmbx-10x-x-109">D
defproblem (environment) 4, 5, defproblem (environment) 5, 6, 6, 7, 8, 9, 10, 11 E
+class="ec-lmbx-10x-x-109">E
enumerate (environment) 13, 14, 15 F
+class="ec-lmbx-10x-x-109">F
\foreachdataset 45 H
+class="ec-lmbx-10x-x-109">H
\hideanswers \hideanswers 53, 54, 55 I
+class="ec-lmbx-10x-x-109">I
\ifshowanswers 56, 57 L
+class="ec-lmbx-10x-x-109">L
\loadallproblems \loadallproblems 65 N
+class="ec-lmbx-10x-x-109">N
\newproblem \newproblem 71, 72, 73, 74 O
+class="ec-lmbx-10x-x-109">O
onlyproblem (environment) onlyproblem (environment) 79, 80, 81, 82, 83, 84, 85 P
+class="ec-lmbx-10x-x-109">P
package options: R
+class="ec-lmbx-10x-x-109">R
\random 113 S
+class="ec-lmbx-10x-x-109">S
\selectallproblems 114 T
+class="ec-lmbx-10x-x-109">T
textenum (environment) textenum (environment) 129 U
+class="ec-lmbx-10x-x-109">U
\useproblem \useproblem 136, 137, 138 1assuming you leave at least a minute between runs.
+class="ec-lmtt-10x-x-109">\ProbSolnFragileExt
+class="ec-lmtt-10x-x-109">\ProbSolnFragileFile
4 Top
4 Showing and Hiding Solutions
+class="ec-lmtt-10x-x-109">\showanswers
What is the derivative of $f(x) = x^2$?
\end{onlyproblem}%
@@ -492,130 +531,130 @@ For example:
\end{onlysolution}
\begin{onlysolution}%
Solution: $f’(x) = 2x$
\end{onlysolution}
5 Top
5 General Formatting Commands
\par\noindent\textbf{\solutionname}: ⟨text⟩
-
\par\noindent\textbf{\solutionname}: ⟨text⟩
+
+class="ec-lmtt-10x-x-109">\begin{textenum}…\end{textenum}
Differentiate the following:
\begin{textenum}
@@ -640,65 +679,64 @@ example:
\end{onlysolution}
\incorrectitem
+class="ec-lmtt-10x-x-109">\incorrectitem
\incorrectitemformat{⟨label⟩}
+class="ec-lmtt-10x-x-109">\incorrectitemformat{⟨label⟩}
become a probability space?
\begin{enumerate}
@@ -709,146 +747,147 @@ Under which of the following functions
\end{enumerate}
6 Top
6 Defining a Problem
-
\begin{defproblem}[⟨n⟩][⟨default args⟩]{⟨label⟩}[⟨option⟩]
⟨definition⟩
⟨definition⟩
\end{defproblem}
+class="ec-lmtt-10x-x-109">\end{defproblem}
Differentiate $f(x)=\sin(#1x)$.
\begin{onlysolution}%
@@ -859,26 +898,25 @@ argument:
\end{defproblem}
Differentiate $f(x)=\sin(#1x)$.
\begin{onlysolution}%
@@ -889,74 +927,73 @@ Datasets.) For example:
\end{defproblem}
⟨problem⟩%
-
\begin{onlysolution}%
-
\begin{solution}%
-
⟨solution⟩%
-
\end{solution}%
-
\end{onlysolution}%
-
\end{defproblem}
-
⟨problem⟩%
+
\begin{onlysolution}%
+
\begin{solution}%
+
⟨solution⟩%
+
\end{solution}%
+
\end{onlysolution}%
+
\end{defproblem}
+
\(f(x) = \sin(#1x)\)
}%
@@ -966,10 +1003,9 @@ class="ec-lmtt-10">\end{defproblem}
\(f(x) = \cos(#1x)\)
\begin{onlysolution}%
@@ -979,22 +1015,21 @@ class="ec-lmtt-10">\end{defproblem}
\end{onlysolution}%
\end{defproblem}
\(f(x) = \sin(#1x)\)
}%
@@ -1003,135 +1038,134 @@ class="ec-lmtt-10">\foreachproblem}
⟨definition⟩%
-
\end{defproblem}
-
⟨definition⟩%
+
\end{defproblem}
+7 Top
7 Using a Problem
+class="ec-lmtt-10x-x-109">\useproblem[⟨data set⟩]{⟨label⟩}{⟨arg1⟩}…{⟨argN⟩}
+
\begin{onlysolution}%
\begin{solution}%
@@ -1143,367 +1177,575 @@ argument, so it can be used as follows:
8 Top
8 Loading Problems From External Files
+class="ec-lmtt-10x-x-109">\loadallproblems[⟨data set⟩]{⟨filename⟩}
+class="ec-lmri-10x-x-109">list⟩}
-
+9 Iterating Through Datasets
-8.1 Randomly Selecting Problems Not Selected in Previous Documents
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 9 Iterating Through Datasets
+
+
-
+
-
+
\foreachproblem{\item\thisproblem}
\end{enumerate}
-
+
-
+
\foreachdataset{\thisdataset}{%
\foreachproblem[\thisdataset]{\item\thisproblem}}
\end{enumerate}
\begin{onlyproblem}%
$y = \cos(x^2)\sin x$.%
@@ -1513,30 +1755,30 @@ class="ec-lmss-10">onlysolution\end{onlysolution}%
\end{defproblem}
\usepackage{probsoln}
\begin{document}
@@ -1571,241 +1813,234 @@ questions.
\end{itemize}
\end{document}
10 Random Number Generator
-
-
-10 Random Number Generator
+
+
+
-
+
\PSNgetrandseed{\myseed}
-
+
\PSNrandom{\myreg}{10}
-
+
\random{myrand}{3}{8}
-
+
\loadrandomproblems{1}{\thisfile}}
11 Compatibility With Versions Prior to 3.0
-11 Compatibility With Versions Prior to 3.0
+
\selectrandomly{file1}{8}
\item Solve the following:
@@ -1815,18 +2050,17 @@ contained something like:
\selectrandomly{file3}{2}
\end{enumerate}
\selectrandomly{file1}{8}
\item Solve the following:
@@ -1839,424 +2073,451 @@ becomes:
\selectrandomly{file3}{2}
\end{enumerate}
-
+
\foreachproblem[⟨filename⟩]{\PSNitem\thisproblem\endPSNitem}
-
-
\foreachproblem[⟨filename⟩]{\PSNitem\thisproblem\endPSNitem}
+
+
\foreachproblem[⟨filename⟩]{\PSNitem\thisproblem\endPSNitem}
-Index
+ id="x1-1400011">Index
\correctitem \correctitem 2
+class="ec-lmri-10x-x-109">3
\correctitemformat \correctitemformat 3
+class="ec-lmri-10x-x-109">4
+class="ec-lmri-10x-x-109">7, 8, 9, 10, 11, 12
\doforrandN 12
+class="ec-lmtt-10x-x-109">\doforrandN 13
+class="ec-lmtt-10x-x-109">enumerate (environment) 14, 15, 16
environments:
defproblem 16, 17, defproblem 17, 18, 18, 19, 20, 21, 22, 23
+class="ec-lmri-10x-x-109">19, 20, 21, 22, 23, 24
enumerate 24, 25, 26
+class="ec-lmtt-10x-x-109">enumerate 25, 26, 27
onlyproblem onlyproblem 27, 28, 29, 30, 31, 32, 33
+class="ec-lmri-10x-x-109">28, 29, 30, 31, 32, 33, 34
onlysolution onlysolution 34, 35, 36, 37, 38, 39, 40
+class="ec-lmri-10x-x-109">35, 36, 37, 38, 39, 40, 41
solution solution 41, 42, 43
+class="ec-lmri-10x-x-109">42, 43, 44
textenum textenum 44
+class="ec-lmri-10x-x-109">45
+\ExcludePreviousFile 46
+class="ec-lmtt-10x-x-109">\foreachdataset 47
\foreachproblem 46, 47, 48
+class="ec-lmtt-10x-x-109">\foreachproblem 48, 49, 50
\foreachsolution 49, 50
+class="ec-lmtt-10x-x-109">\foreachsolution 51, 52
fp package 51
+class="ec-lmss-10x-x-109">fp package 53
fragile 52
+href="probsoln-manual.html#dx1-4001" >54
+class="ec-lmri-10x-x-109">55, 56, 57
+
+
+class="ec-lmtt-10x-x-109">\ifshowanswers 58, 59
ifthen package 58
+class="ec-lmss-10x-x-109">ifthen package 60
\include 59
+class="ec-lmtt-10x-x-109">\include 61
\incorrectitem \incorrectitem 60
-
-
-
+class="ec-lmri-10x-x-109">62
\incorrectitemformat \incorrectitemformat 61
+class="ec-lmri-10x-x-109">63
\input 62, 63
+class="ec-lmtt-10x-x-109">\input 64, 65
\item 64
+class="ec-lmtt-10x-x-109">\item 66
+class="ec-lmri-10x-x-109">67
\loadexceptproblems \loadexceptproblems 66
+class="ec-lmri-10x-x-109">68
\loadrandomexcept \loadrandomexcept 67
+class="ec-lmri-10x-x-109">69
\loadrandomproblems \loadrandomproblems 68, 69
+class="ec-lmri-10x-x-109">70, 71
\loadselectedproblems \loadselectedproblems 70
+class="ec-lmri-10x-x-109">72
+class="ec-lmri-10x-x-109">73, 74, 75, 76
\newproblem* \newproblem* 75, 76, 77
+class="ec-lmri-10x-x-109">77, 78, 79
ngerman package 78
+class="ec-lmss-10x-x-109">ngerman package 80
+class="ec-lmri-10x-x-109">81, 82, 83, 84, 85, 86, 87
onlysolution (environment) onlysolution (environment) 86, 87, 88, 89, 90, 91, 92
+class="ec-lmri-10x-x-109">88, 89, 90, 91, 92, 93, 94
answers 93, 94, 95
+class="ec-lmss-10x-x-109">answers 95, 96, 97
draft 96
+class="ec-lmss-10x-x-109">draft 98
final 97
+class="ec-lmss-10x-x-109">final 99
noanswers 98, 99
+class="ec-lmss-10x-x-109">noanswers 100, 101
nousedefaultargs 100
+class="ec-lmss-10x-x-109">nousedefaultargs 102
usedefaultargs 101, 102, 103
+class="ec-lmss-10x-x-109">usedefaultargs 103, 104, 105
pgfmath package 104
+class="ec-lmss-10x-x-109">pgfmath package 106
probsoln package 105
+class="ec-lmss-10x-x-109">probsoln package 107, 108, 109
\ProbSolnFragileExt \ProbSolnFragileExt 106
+class="ec-lmri-10x-x-109">110
\ProbSolnFragileFile \ProbSolnFragileFile 107
+class="ec-lmri-10x-x-109">111
+
+
\PSNgetrandseed 108
+class="ec-lmtt-10x-x-109">\PSNgetrandseed 112
\PSNrandom 109
+class="ec-lmtt-10x-x-109">\PSNrandom 113
\PSNrandseed 110
+class="ec-lmtt-10x-x-109">\PSNrandseed 114
\PSNuseoldrandom \PSNuseoldrandom 111, 112
+class="ec-lmri-10x-x-109">115, 116
+class="ec-lmtt-10x-x-109">\random 117
+class="ec-lmtt-10x-x-109">\selectallproblems 118
\selectrandomly 115, 116
+class="ec-lmtt-10x-x-109">\selectrandomly 119, 120
\showanswers \SetStartMonth 121
+\SetStartYear 122
+\SetUsedFileName 123
+\showanswers 117, 118, 119, 120
-
-
-
+class="ec-lmri-10x-x-109">124, 125, 126, 127
showanswers boolean variable 121, 122, 123, 124
+class="ec-lmss-10x-x-109">showanswers boolean variable 128, 129, 130, 131
solution (environment) solution (environment) 125, 126, 127
+class="ec-lmri-10x-x-109">132, 133, 134
\solutionname \solutionname 128
+class="ec-lmri-10x-x-109">135
+class="ec-lmri-10x-x-109">136
\theenumi 130
+class="ec-lmtt-10x-x-109">\theenumi 137
\thisproblem 131, 132, 133, 134
+class="ec-lmtt-10x-x-109">\thisproblem 138, 139, 140, 141
\thisproblemlabel 135
+class="ec-lmtt-10x-x-109">\thisproblemlabel 142
+class="ec-lmri-10x-x-109">143, 144, 145