Closed
Bug 489916
Opened 16 years ago
Closed 16 years ago
Quiz Module repeats Questions over and over again
Categories
(Webtools Graveyard :: Mozbot, defect)
Webtools Graveyard
Mozbot
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: god, Assigned: mozilla.bugs)
Details
Attachments
(1 file)
|
1.05 KB,
patch
|
wolf
:
review+
|
Details | Diff | Splinter Review |
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
| Assignee | ||
Updated•16 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Assignee | ||
Comment 2•16 years ago
|
||
I have made a patch using the lines of code provided in Comment #2.
Attachment #380654 -
Flags: review?(bugtrap)
| Assignee | ||
Updated•16 years ago
|
OS: Linux → All
Hardware: x86_64 → All
Comment 3•16 years ago
|
||
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+
Updated•16 years ago
|
Keywords: checkin-needed
Updated•16 years ago
|
Assignee: nobody → mozilla.bugs
| Assignee | ||
Comment 4•16 years ago
|
||
Wolf: I will set up a question set and test the module.
Status: NEW → ASSIGNED
Comment 5•16 years ago
|
||
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
| Assignee | ||
Updated•16 years ago
|
Keywords: checkin-needed
Updated•6 years ago
|
Product: Webtools → Webtools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•