2 * Copyright (C) 2010 Charles Clement <caratorn _at_ gmail.com>
4 * This file is part of qquiz.
6 * qquiz is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
32 #include <QGridLayout>
34 #define APP_NAME "qquiz"
35 #define APP_VERSION 0.1
36 #define AUTHOR "Charles Clement <caratorn@gmail.com>"
38 #define SUBSET_PATTERN "subset:"
39 #define CHAR_DELIM ';'
40 #define ANSWER_DELIM '|'
42 #define DEFAULT_NR_COL 2
44 #define DEFAULT_WIDTH 800
45 #define DEFAULT_HEIGHT 480
53 question(QString s, QString r);
56 QList<QString> alternate_answers;
68 class quiz : public QObject{
73 void retrieve_quizzes();
74 int read_quiz(const char *filename);
75 void trim_questions();
83 void buzz(const QString& text);
89 vector<question *> questions;
90 vector<quiz_file *> files;
97 unsigned int total_time;
98 unsigned int current_time;
99 unsigned int max_label_length;
100 map < QString, int > index;
107 QScrollArea *scrollArea;