]> Git trees. - libqmvoc.git/commitdiff
integrated the leitner system in the quiz
authorMartin Pfeiffer <hubipete@gmx.net>
Tue, 12 Jul 2005 13:28:01 +0000 (13:28 +0000)
committerMartin Pfeiffer <hubipete@gmx.net>
Tue, 12 Jul 2005 13:28:01 +0000 (13:28 +0000)
svn path=/branches/work/kwordquiz/src/keduvocexpression.h; revision=433985

kwordquiz/keduvocexpression.cpp
kwordquiz/keduvocexpression.h
kwordquiz/leitnersystem.cpp
kwordquiz/leitnersystem.h

index df0342a8081c9e9e6d79521ab4f51c01b606d609..daa3e293d5eafbe220a63b49c668c8ad9902c704 100644 (file)
@@ -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;
+}
+
index 9e98c839aa4eddaa692402396ba915aa8651982d..8158ac217ca9868e5d7351879c81f039cfb7afac 100644 (file)
@@ -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<Comparison>  comparisons;
   vector<MultipleChoice> mcs;
 
+  QString           leitnerBox;
   int                lesson;
   bool               inquery;
   bool               active;
index b903b8f498a2321b10dabf931405ac923c8a7fcf..2df19adc29e946cd13090868885080e3b5a63d48 100644 (file)
@@ -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() );
index 50b9f2ddd6050a4675c7f18938960e22e6dfb34b..e53586ed26ee82f1357de3fef02231448f622909 100644 (file)
@@ -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 );