From: Martin Pfeiffer Date: Tue, 12 Jul 2005 13:28:01 +0000 (+0000) Subject: integrated the leitner system in the quiz X-Git-Tag: v3.80.2~237^2~28 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=69912265fd95a6b236cadc020fc3f537695f3a43;p=libqmvoc.git integrated the leitner system in the quiz svn path=/branches/work/kwordquiz/src/keduvocexpression.h; revision=433985 --- diff --git a/kwordquiz/keduvocexpression.cpp b/kwordquiz/keduvocexpression.cpp index df0342a..daa3e29 100644 --- a/kwordquiz/keduvocexpression.cpp +++ b/kwordquiz/keduvocexpression.cpp @@ -790,3 +790,13 @@ void KEduVocExpression::setType (int idx, const QString &type) exprtypes[idx] = type.stripWhiteSpace(); } +void KEduVocExpression::setLeitnerBox( const QString& box ) +{ + leitnerBox = box; +} + +QString& KEduVocExpression::getLeitnerBox() +{ + return leitnerBox; +} + diff --git a/kwordquiz/keduvocexpression.h b/kwordquiz/keduvocexpression.h index 9e98c83..8158ac2 100644 --- a/kwordquiz/keduvocexpression.h +++ b/kwordquiz/keduvocexpression.h @@ -416,6 +416,18 @@ class KEduVocExpression */ void incQueryCount (int index, bool rev_count = false); + /** sets the box of the Leitner system which actually contains the expression + * + * @param box the box's name + */ + void setLeitnerBox(const QString& box); + + /** returns the name of the Leitner system's box actually containing the expression + * + * @result the box's name + */ + QString& getLeitnerBox(); + protected: void Init(); @@ -447,6 +459,7 @@ class KEduVocExpression vector comparisons; vector mcs; + QString leitnerBox; int lesson; bool inquery; bool active; diff --git a/kwordquiz/leitnersystem.cpp b/kwordquiz/leitnersystem.cpp index b903b8f..2df19ad 100644 --- a/kwordquiz/leitnersystem.cpp +++ b/kwordquiz/leitnersystem.cpp @@ -92,6 +92,16 @@ const QString& LeitnerSystem::getWrongBox( int box ) return m_boxes[ box ].getWrongWordBox()->getBoxName(); } +const QString& LeitnerSystem::getCorrectBox( QString& box ) +{ + return getBoxWithName( box )->getCorrectWordBox()->getBoxName(); +} + +const QString& LeitnerSystem::getWrongBox( QString& box ) +{ + return getBoxWithName( box )->getWrongWordBox()->getBoxName(); +} + int LeitnerSystem::getWrongBoxNumber( int box ) { return getNumber( m_boxes[ box ].getWrongWordBox() ); diff --git a/kwordquiz/leitnersystem.h b/kwordquiz/leitnersystem.h index 50b9f2d..e53586e 100644 --- a/kwordquiz/leitnersystem.h +++ b/kwordquiz/leitnersystem.h @@ -45,6 +45,8 @@ public: const QString& getCorrectBox( int box ); //returns the correct word box of "int box" const QString& getWrongBox( int box ); //returns the wrong word box of "int box" + const QString& getCorrectBox( QString& box ); + const QString& getWrongBox( QString& box ); int getWrongBoxNumber( int box ); int getCorrectBoxNumber( int box );