[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Phptest-users] Random answers solution!

From: Luis Lebron
Subject: RE: [Phptest-users] Random answers solution!
Date: Wed, 19 Feb 2003 10:43:03 -0600

I found a different solution. In qtypes/, in the draw_test_question function I changed the line that read

$rand = mt_rand(1, 4); //right before the switch statement

if(strcasecmp($row->answer,"All of the above")==1)
if(strcasecmp($row->alt_1,"All of the above")==1)
if(strcasecmp($row->alt_2,"All of the above")==1)
if(strcasecmp($row->alt_3,"All of the above")==1)
if(strcasecmp($row->alt_3,"All of the above")!=1 && strcasecmp($row->alt_2,"All of the above")!=1 && strcasecmp($row->alt_1,"All of the above")!=1 && strcasecmp($row->answer,"All of the above")!=1)

                $rand = mt_rand(1, 4);

This will force a switch type if one of the choices is "All of the above" otherwise it will use the normal random function.


-----Original Message-----
From: TW [mailto:address@hidden]
Sent: Tuesday, February 18, 2003 8:23 PM
To: general phptest discussion
Subject: Re: [Phptest-users] Random answers

What I have done is make a new question type. It is a single entry answer
question so basically in the question you ask the user to pick either a, b,
c, and so on and the user enters the correct letter into the answer box. If
you want this you can download it from here:

This file is meant to be used with the file, you may need to
modify the csingleanswer file if you are not using it.



----- Original Message -----
From: "Luis Lebron" <address@hidden>
To: "Phptest-Users (E-mail)" <address@hidden>
Sent: Tuesday, February 18, 2003 12:39 PM
Subject: [Phptest-users] Random answers

> Is there a way to disable the random order of answers. We have a customer
> that likes to use "All of the above" as one of their choices. This does
> work with PHPtest since the answers can be in any order.
> thanks,
> Luis R. Lebron
> Project Manager
> Sigmatech, Inc


> _______________________________________________
> Phptest-users mailing list
> address@hidden

Phptest-users mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]