Open derwinmcgeary opened 8 years ago
We can kill them all by selecting Nquestions=7 answers upfront like so:
Nquestions=7
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.
We can kill them all by selecting
Nquestions=7
answers upfront like so:Then looping through our array of words and doing (for Answer="dog")
These will have to be slightly assembled in place, total of 8 DB reads but the result will look better to adult observers.