Closed Bug 489916 Opened 16 years ago Closed 16 years ago

Quiz Module repeats Questions over and over again

Categories

(Webtools Graveyard :: Mozbot, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: god, Assigned: mozilla.bugs)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.9.0.9) Gecko/2009040821 Firefox/3.0.9 (.NET CLR 3.5.30729) Build Identifier: Mozbot 2.6 http://ftp.mozilla.org/pub/mozilla.org/webtools/mozbot-LATEST.tar.gz When using the Quiz module, it occured to me, that the bot would repeat the same questions all the time, while there were many unused in the database. Reproducible: Always Steps to Reproduce: 1. Start a quiz 2. play some time 3. you will see, that you will get the same questions over and over Actual Results: Selected the same questions all the time and a new one just once in a while Expected Results: Select different questions most of the time
in BotModules/Quiz.bm replace lines 494 and 495 $self->{'questionIndex'} += 1 + $event->{'time'} % $self->{'skipMargin'}; $self->{'questionIndex'} %= @{$self->{'questions'}}; with my $questionCount = scalar @{$self->{'questions'}}; $self->{'questionIndex'} = int(rand(($questionCount-1))); to let the bot select the questions randomly
Status: UNCONFIRMED → NEW
Ever confirmed: true
I have made a patch using the lines of code provided in Comment #2.
Attachment #380654 - Flags: review?(bugtrap)
OS: Linux → All
Hardware: x86_64 → All
Comment on attachment 380654 [details] [diff] [review] Patch for random selection of questions by Quiz.bm Code-wise, looks good. (Note: untested)
Attachment #380654 - Flags: review?(bugtrap) → review+
Keywords: checkin-needed
Assignee: nobody → mozilla.bugs
Wolf: I will set up a question set and test the module.
Status: NEW → ASSIGNED
Checking in BotModules/Quiz.bm; /cvsroot/mozilla/webtools/mozbot/BotModules/Quiz.bm,v <-- Quiz.bm new revision: 2.7; previous revision: 2.6 done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Keywords: checkin-needed
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: