WeBWorK Problems

Turning off problemRandomize for a single problem

Turning off problemRandomize for a single problem

by Paul Seeburger -
Number of replies: 4
I have placed the problemRandomize.pl in my PGcourse.pl so all of my problems will allow the student to obtain a new version.

However, sometimes there are problems that I wish to not include problemRandomization in.

Is there a way to not include it other than to not load PGcourse.pl?

Currently I do not have anything else in PGcourse.pl, but I can see that I may include more there in the future.
In reply to Paul Seeburger

Re: Turning off problemRandomize for a single problem

by Davide Cervone -
You can load problemRandomize.pl conditionally dependent on the homework set number and question number. Something like
loadMacros("problemRandomize.pl") unless
    ($setNumber eq "MySet1" && $questionNumber == 2) ||
    ($setNumber eq "MySet2" && $questionNumber == 5);
should do it. This example uses randomization except for problem 2 on set MySet1 and problem 5 on set MySet2. Modify to suit your needs.
In reply to Davide Cervone

Re: Turning off problemRandomize for a single problem

by Danny Glin -
Alternatively you should be able to use a variable in the problem to disable the randomization.

In your pg file, add
$noRandomization = 1;
and then in pgCourse.pl:
loadMacros("problemRandomize.pl") unless $noRandomization;
In reply to Danny Glin

Re: Turning off problemRandomize for a single problem

by Paul Seeburger -
That sounds like a nice option!  I'll give it a try.

Thanks, Danny!
In reply to Paul Seeburger

Re: Turning off problemRandomize for a single problem

by Alex Jordan -
Speaking to people from the future:

WeBWorK 2.10 should come with the ShowMeAnother feature (blogged about here: http://cmhugheswebwork.blogspot.com/2014/05/show-me-another-feature-for-webwork.html).

It can (alomst) be used to achieve the functionality that one gets with problemRandomization.pl. The problem-by-problem settings are stored in the database (and in .def files) just as one sets an attempt limit and a weight for each problem. The elements that are missing are control of when the button is available to students in relation to whether they have already gotten credit, and whether or not the due date has passed. But if it is of interest, we could add those.

For anyone adventurous enough to work on the develop branch, you could try using SMA earlier than 2.10.