MichaelSp / Langunator

Language and Vocabulary trainer
0 stars 1 forks source link

Too many vocabularys are asked #18

Closed Petebox closed 11 years ago

Petebox commented 11 years ago

The criteria of which vocabulary to ask does not work. Example: A word with (RightInRow = 6) which was last asked on 1th July was asked today. (today = 15th August). But for RightInRow = 6 at least 64 days need to have passed.

The condition for a word to be asked must be:

day(now) - day(last Asked) >= 2 ^ (RightInRow)

MichaelSp commented 11 years ago

can you try to replace line 117 in Backend.cpp with this:

    trainingSet = qry.filter( DQWhere("(date('now','start of day') - date(lastAsked,'start of day'))") >= DQWhere("rightInRow*rightInRow") ).all();
Petebox commented 11 years ago

You have typed "rightInRow * rightInRow" which is (rightInRow ^ 2) NOT (2 ^ rightInRow)

MichaelSp commented 11 years ago

Oh right. That was a test in an early stage. Unfortunately there is no power function in sqlite: http://lists.osgeo.org/pipermail/grass-user/2010-March/055088.html Available aggregate functions: http://www.sqlite.org/lang_aggfunc.html

Any suggestions how to work around this limitation?