/*************************************************************************** manage queries ----------------------------------------------------------------------- begin : Sat Jul 11 20:50:53 MET 1999 copyright : (C) 1999-2001 Ewald Arnold (C) 2005-2007 Peter Hedlund (C) 2007-2009 Frederik Gladhorn ----------------------------------------------------------------------- ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef TESTENTRYMANAGER_H #define TESTENTRYMANAGER_H #include "testentry.h" #include "prefs.h" #include #include #include class KEduVocDocument; class PracticeDialog; class TestEntryManager { public: /** * Create a collection of entries to be practiced. * @param doc */ explicit TestEntryManager(KEduVocDocument *doc, QWidget *parent); /** * Default ctor */ ~TestEntryManager(); /** * Get the next entry to show to the user. * @return TestEntry* the entry */ TestEntry* getNextEntry(); /** * The number of entries in the practice * @return */ int totalEntryCount(); /** * The number of entries that are still to be practiced * @return */ int activeEntryCount(); /** * Puts some grades on the shell */ void printStatistics(); void currentEntryFinished(); int statisticTotalCorrectFirstAttempt(); int statisticTotalWrong(); int statisticTotalUnanswered(); int statisticTotalSkipKnown(); int statisticTotalSkipUnknown(); private: /** * Select appropriate entries for the practice (respect blocking settings etc) * m_allTestEntries will be filled by this. */ void filterTestEntries(); KEduVocDocument *m_doc; QWidget *m_parent; int m_fromTranslation; int m_toTranslation; int m_testType; /// All entries in the test. QList m_allTestEntries; /// All entries that have not been asked. QList m_notAskedTestEntries; /// The list of entries that are being asked. If one of these is done, it can be deleted and an new one from m_notAskedTestEntries taken. QList m_currentEntries; int m_currentEntry; KRandomSequence m_randomSequence; friend class EntryFilter; }; #endif // kvtquery_included