moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kwordquiz / src / wqquiz.h
blob555c1fe63a7d902a67582bb173f67cf06d67b039
1 /* This file is part of KWordQuiz
2 Copyright (C) 2003 Peter Hedlund <peter@peterandlinda.com>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA.
19 #ifndef WQQUIZ_H
20 #define WQQUIZ_H
22 #include <qtable.h>
24 #include "wqlistitem.h"
25 #include "kwordquizview.h"
27 /**
28 @author Peter Hedlund
31 class WQQuiz : public QObject
33 Q_OBJECT
34 public:
35 enum QuizType {qtEditor, qtFlash, qtMultiple, qtQA};
36 enum QuizIcon {qiLeftCol, qiRightCol, qiQuestion, qiCorrect, qiError};
38 WQQuiz(KWordQuizView * parent, const char * name=0);
39 ~WQQuiz();
40 void activateErrorList();
41 void activateBaseList();
43 bool init();
44 void finish();
45 bool checkAnswer(int i, const QString & );
46 QStringList multiOptions(int i);
47 QString quizIcon(int i, QuizIcon ico);
48 QString yourAnswer(int i, const QString & s);
49 QString hint(int i);
51 QuizType quizType() const {return m_quizType;}
52 void setQuizType(QuizType qt);
54 int quizMode() const {return m_quizMode;}
55 void setQuizMode(int qm);
57 int questionCount();
58 QString question(int i);
59 QString blankAnswer(int i);
60 QString answer(int i);
61 QString langQuestion(int i);
62 QString langAnswer(int i);
64 int kbAnswer(int i);
66 signals:
67 void checkingAnswer(int );
69 private:
70 KWordQuizView *m_table;
71 int m_quizMode;
72 int m_questionCount;
73 static QPtrList<WQListItem> *m_list;
74 static QPtrList<WQListItem> *m_errorList;
75 static QPtrList<WQListItem> *m_quizList;
77 QuizType m_quizType;
78 QString m_correctBlank;
79 QString m_answerBlank;
81 void addToList(int aCol, int bCol);
82 void listRandom();
85 #endif