WeBWorK Problems

Adding re-randomization

Adding re-randomization

by D. Brian Walton -
Number of replies: 3
There are many problems that I like from the National Problem Library for which I would like to add the option for students to be able to re-randomize once they get it correct the first time. Is there a way to accomplish this without creating a new version of the problem that includes the problemRandomize.pl library?

As a general point, it would often be nice to be able to have problems that have options that could be turned on/off through some sort of problem set config file, or extra options that can be included at the time of invocation. The randomization might be one such option. Other options might include the number of integer roots a polynomial has, or the number of turning points a function should have. In other words, times where everything about the problem is identical except for the initialization of certain parameters at the beginning.

D. Brian Walton
James Madison University
In reply to D. Brian Walton

Re: Adding re-randomization

by Dick Lane -
In addition to loading problemRandomize.pl, it will be necessary to invoke it appropriately.  I have appended my current PGcourse.pl which provides a "Show New Version" button to students only after (correct or assignment-closed) but to instructors (and observers) at any time.  Since pg/macros has a PGcourse.pl which does nothing, it is a benign act for each problem to have its loadMacros command finish by loading PGcourse.pl --- that provides each instructor with the course-by-course option of putting their own PGcourse.pl into templates/macros.

I suspect most problems in the NPL do not load PGcourse.pl.  It might be useful to also have similar functionality available at the level of a problem set (perhaps via a command in a set definition file), or as a course-wide choice (with a new option in course.conf).
In reply to D. Brian Walton

Re: Adding re-randomization

by Dick Lane -

Your second paragraph is intriguing, but I wonder about the complexity of writing problems to take advantage of an external parameter while also keeping the student's task manageable.  Two or three outlines of such a problem, including the manner of presenting answers and solutions to students, could help me understand how this might be an easy extension of what we can do now with a small suite of related problems.


    E.g., suppose I have 3 problems for monotonic cubics: always increasing, always decreasing, and random choice of up/down (with solution adapted to the problem's choice); there would be a similar triple for non-montonic cubics.  (If the student needs to locate both zeros and critical points, then handling a possible multiplicity of zeros complicates matters.)  Would it be satisfactory to treat this collection of 6 (or more) problem templates as a group from which each student would get one randomly chosen item?  An instructor could have a group definition file which cites all items in the group and the instructor has the flexibility of choosing whether to comment-out some items for a particular assignment --- this seems more flexible than having the instructor choice hinge on a single parameter (e.g., cubic, quartic, poly of degree less than n).  On the third hand, allowing an instructor choice between presenting a polynomial in expanded or factored form leads to an additional complication in any scheme.

In reply to Dick Lane

Re: passing parameters [was: Adding re-randomization]

by D. Brian Walton -
On the topic of allowing parameters to be passed into problems...

As an example, I have written an algebra problem to practice synthetic division and factoring of polynomials where I have a parameter that specifies the number of unique roots and another for the maximum multiplicity. I then generate a random polynomial and write it in standard form. Currently, there is a different problem for various settings, but the only thing that is changing is the value assigned to that parameter. I think this is closest to what Dick Lane was suggesting.

As another example, on a multi-part problem, it could be beneficial to allow the instructor to assign the values of the individual parts. At present, this is hard-coded in the problem. So an instructor that wants a different weighting of the parts must create a duplicate of the problem. (Note: This might actually be a separate issue, although currently it might be resolved using parameters.)

As a third example, some word problems often use locations or names that might have significance for a particular school. For the sake of sharing such problems, it could be nice to make the problem customizable by adding an option to choose names that are appropriate. (This makes me think of a problem almost like a MadLib! Please enter a name followed by an adjective. :-)

A fourth example is a class of problems that took me quite a bit of time to develop. This is where I construct a graph of a function with intervals of monotonicity and concavity whose endpoints are always integers, so that I can ask students to identify based on a graph where a function is increasing, decreasing, concave up, or concave down. The code only needs to know the number of turning points, or similar parameter. It just feels wasteful to implement the same problem with multiple files simply to add another turning point, etc.

- Brian

D. Brian Walton
James Madison University