summaryrefslogtreecommitdiffstats
path: root/klatin/klatin/klatingrammar.h
blob: 5c00d6b78d193ccaf8b19ed3704e81e673d20d9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/***************************************************************************
    begin                : Thu Jul 17 2003
    copyright            : (C) 2001-2004 by George Wright
    email                : gwright@kde.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 KLATINGRAMMAR_H
#define KLATINGRAMMAR_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "keduvocdata.h"
#include "klatingrammarwidget.h"

/** @short Main class for testing grammar*/
class KLatinGrammar : public KLatinGrammarWidget
{
	Q_OBJECT
public:
	KLatinGrammar(QWidget* parent=0, const char *name=0);
	~KLatinGrammar();

	/// Load next question
	void nextQuestion();
	/// Update score of test so far
	void updateScores();
public slots:
	/// Load grammar definitions database
	void loadDatabase();
	/// Destroys the widget
	void goBack();
	/// Check whether the answer is correct
	void checkAnswer();
signals:
	/// Signal that is emitted when the widget is closed
	void exited();
	void statusMsg(const QString&);
private:
	/// Array that holds the 12 cases of a noun
	QString m_noun[12];
	/// The case of the noun being tested
	int m_grammarNumber;
	/// Total number of questions attempted that are wrong
	int m_numWrong;

	/// Total number of questions attempted that are correct
	int m_totalCorrect;
	/// Total number of questions attempted
	int m_total;
};

#endif // KLATINGRAMMAR_H