Forum archive 2000-2006

Animikh Biswas - Randomly generating Multiple Choice everytime

Animikh Biswas - Randomly generating Multiple Choice everytime

by Arnold Pizer -
Number of replies: 0
inactiveTopicRandomly generating Multiple Choice everytime topic started 9/17/2002; 5:35:28 AM
last post 9/18/2002; 3:48:58 AM
userAnimikh Biswas - Randomly generating Multiple Choice everytime  blueArrow
9/17/2002; 5:35:28 AM (reads: 893, responses: 1)
Hi, I would like to set multiple choice questions without any restrictions on the number of attempts. I wanr to set it up so that each time a student clicks on a multiple choice question, she/he gets a different version. In other words, I want the random number to be generated afresh every time a student clicks on a multiple choice problem. Otherwise, if there are say five choices provided, then the student needs to try the problem five times to get it right unless one restricts the number of attempts. Is there any way to achieve this in WebWork?

Thanks in advance for your response.

Animikh Biswas UNC-Charlotte

<| Post or View Comments |>


userArnold K. Pizer - Re: Randomly generating Multiple Choice everytime  blueArrow
9/18/2002; 3:48:58 AM (reads: 1138, responses: 0)
Hi Animikh,

I can not think of a way to do this but maybe I'm missing something. It is very easy to have the student get a different set of questions each time they click submit (i.e. to get "the random number to be generated afresh every time a student clicks"), but this is not what you want (see below). To get a new random number each time just add e.g.

TEXT(&beginproblem);
$PG_random_generator->srand(time);

so that perl's time function seeds the random number generator. However, the grading of the problem doesn't work.

What is going on is the following. WeBWorK produces and displays a problem (with random data fixed by the seed) and that's the end of the process. The student submits an answer which creates a new process which produces a "new" problem, checks that the student's answer is a correct answer to the problem, and then displays the problem. If the new problem has a different seed than the original problem, then the student's answer to the original problem will be checked against the correct answer to the new problem and will almost always be wrong.

In theory one could get the seed from the database, create but not display the problem, check the student's answer, then create and store a new seed and create and display a new problem based on the need seed. But WeBWorK doesn't work that way (it would double the necessary work).

Arnie

<| Post or View Comments |>