1 /***************************************************************************
2 kverbosuser.h - description
4 begin : Tue Dec 18 2001
5 copyright : (C) 2001 by Arnold Kraschinski
6 email : arnold.k67@gmx.de
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
21 #include "verbspanish.h"
23 // Der maximale Wert für den falsch bzw. richtig Zähler
24 #define MAX_WERT 32767
25 // Die maximale Anzahl von Anfragen, die ein Verb in der Richtig-Liste verbleibt.
26 #define STAY_IN_R_LIST 25
29 #define RICHTIGGEMACHT 1
30 #define FALSCHGEWICHT 2
31 #define DEFAULTUSER "------"
32 #define MAX_RESULTS 10
34 /** Datenstruktur für ein Verb in den Listen
35 * right - gibt an, wie oft das Verb schon richtig eingegeben wurde.
36 * wrong - gibt an, wie oft das Verb schon falsch eingegeben wurde.
37 * counter - ist der Zähler für die aufsummierte Gewichtung der Verben bei Verben in den
38 * ungelernten bzw. falschen Listen. In der Liste der richtig gelernten Verben
39 * ist das ein Zähler, der angibt, wie lange das Verb in der Liste bleiben kann.
40 * used - zeigt an, ob das Verb in der Verbendatei des Hauptprogrammes vorkommt.
41 * status - zeigt an, ob das Verb noch nicht geübt wurde (status = 0), ob es zuletzt falsch
42 * eingegeben wurde (status = -1) oder zuletzt richtig (status = 1)
47 bool operator== (const eintrag
& e
) const;
56 typedef QValueList
<eintrag
> verbenListe
;
58 /** This class holds information about an user of the program. It stores lists of
59 * verbs. One list for the words that are in the opened verb file and aren't traines yet.
60 * Another list for the words that have been correct. This verbs are stored in the
61 * list to present them more rarely to the user. The third list are for verbs entered with
62 * errors. This verbs are presented to the user with a greater probability.
64 *@author Arnold Kraschinski
68 KVerbosUser(spanishVerbList
* pL
, QString n
=DEFAULTUSER
);
70 /** fills the lists with the verbs that are in the verb list of the main program */
71 void fillList(spanishVerbList
* pL
);
72 /** returns the user name */
73 QString
getName() { return name
; };
74 /** marks all verbs in the R(right) and the F(false) list as unused. That means they can't
75 * be a suggestion. This are probably verbs that are stored user data but at the moment
76 * they aren't in the used verb list.
79 /** calculates the Kumulus for the list with the verbs that aren't studied yet and
80 * for the list with the verbs that have been wrong. */
82 /** selects a verb out of the verbs that are in the U and F list. That means a
83 * verb that hasn't been studied yet or one that was wrong. */
84 QString
suggestVerb();
85 /** The solution for the suggested verb was right. Now the verb should be deleted from
86 * the list of unstudied verbs but added to the list with the right verbs.
89 /** The opposite function to the above one. The solution was wrong and the verb has to
90 * be moved to the list with the wrong verbs.
93 /** Saves all the user information to the $KDEHOME/apps/kverbos/data/username.kverbos file */
94 bool saveUser(const int& res
, const int& num
);
95 /** Retrieve the old results and the number of sessions */
96 bool getResults(int& s
, QString d
[], int r
[][2]);
97 /** returns a pointer to the users verb list */
98 verbenListe
* getListe() { return &liste
; };
101 /** name of the user */
103 /** the list of the verbs that the user has workes with */
105 /** this is the latest selected verb of the list */
107 /** die aufaddierte Summe der gewichteten Verben */
109 /** an Iterator for the verb list */
110 verbenListe::Iterator it
;
111 /** the number of training sessions that the user has made */
113 /** The results of the last ten seccions */
114 QString date
[MAX_RESULTS
];
115 int result
[MAX_RESULTS
][2];