lewismcgeary / VocabBuilder

Vocabulary building Android app for children
9 stars 3 forks source link

Too many repeated words #122

Open derwinmcgeary opened 8 years ago

derwinmcgeary commented 8 years ago

We can kill them all by selecting Nquestions=7 answers upfront like so:

SELECT IMGFILE, NAME, AUDIO, Category FROM 'Vocabulary' WHERE LANG='EN' ORDER BY Random() LIMIT 7;

Then looping through our array of words and doing (for Answer="dog")

SELECT IMGFILE, NAME, AUDIO, Category FROM 'Vocabulary' WHERE LANG='EN' AND Category="Animals" AND NAME <> "Dog" ORDER BY Random() LIMIT 2;

These will have to be slightly assembled in place, total of 8 DB reads but the result will look better to adult observers.