1 /***************************************************************************
2 taskview.cpp - Header File
4 begin : Tue Feb 08 13:42:00 CET 2002
5 copyright : (C) 2001 - 2004 by Sebastian Stein
6 email : seb.kde@hpfsc.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 ***************************************************************************/
24 #include "exercisebase.h"
25 #include "resultwidget.h"
27 #include "taskwidget.h"
45 /*! Constructs a QWidget, which shows the task to the user.
46 * The class also provides input fields, so that the user can enter the result.
47 * It also controls the interaction, so that the entered result gets checked
48 * and a new task can be generated.
49 * \author Sebastian Stein
51 class TaskView
: public ExerciseBase
57 TaskView(QWidget
* parent
= 0, const char * name
= 0,
58 bool padd_sub
= true, bool pmul_div
= false,
59 unsigned int pnr_ratios
= 2, unsigned int pmax_md
= 10);
64 /** set new task parameters, which will be used for the next task to be
66 void setTaskParameters(bool padd_sub
, bool pmul_div
, unsigned int pnr_ratios
, unsigned int pmax_md
);
68 /** force the creation of a new task */
75 /** class emits this signal, if the task was solved correctly by the user */
76 void signalTaskSolvedCorrect();
78 /** class emits this signal, if the task was solved not correctly by the user
80 void signalTaskSolvedWrong();
85 unsigned int nr_ratios
;
86 unsigned int curr_nr_ratios
;
90 ResultWidget
* m_resultWidget
;
91 QPushButton
* m_checkButton
;
93 TaskWidget
* m_taskWidget
;
94 QLineEdit
* numer_edit
;
98 QGridLayout
* baseGrid
;
100 QVBoxLayout
* realLayout
;
104 ratio entered_result
;
110 void slotCheckButtonClicked();