keduca
keducaview.h
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 #ifndef KEDUCAVIEW_H
00019 #define KEDUCAVIEW_H
00020 
00021 #include <kurl.h>
00022 
00023 #include <qlayout.h>
00024 #include <qsplitter.h>
00025 #include <qwidgetstack.h>
00026 
00027 class QTimer;
00028 class QTextEdit;
00029 class QLabel;
00030 
00031 class KPushButton;
00032 
00033 class FileRead;
00034 class KQuestion;
00035 class KGroupEduca;
00036 
00043 class KEducaView : public QWidgetStack
00044 {
00045     Q_OBJECT
00046 
00047 public:
00048     KEducaView(QWidget *parent=0, const char *name=0);
00049     ~KEducaView();
00051     bool openURL( const KURL &url);
00052     FileRead const *getKeducaFile() const {return _keducaFile; }
00053 
00054 private:
00055 
00056     
00057 
00059     void init();
00061     void showRecord();
00063     void showResults( const QString &text );
00065     void setResults();
00067     QString setFinalResult();
00069     void configWrite();
00071     QString currentStatusPoints();
00073     QString getTableQuestion( bool isCorrect, const QString &correct, const QString &incorrect);
00075     bool questionNext();
00076 
00077     QString getInformation();
00079     QString insertTable( const QString &title = "", unsigned int col=0);
00081     QString insertRow( const QString &text, bool title, unsigned int colSpan=0 );
00082     QString insertRow( const QString &label, const QString &field, bool formBased );
00083     QString insertRow( const QString &label1, const QString &field1, const QString &label2, const QString &field2, bool formBased );
00085     QString insertTableClose();
00086             
00087     
00088 
00090     QLabel *_introWidget;
00091     QWidget *_infoWidget, *_questionWidget, *_resultsWidget;
00093     KPushButton *_buttonNext;
00094     KPushButton *_buttonSave;
00095     KPushButton *_buttonResultsNext; 
00096     KPushButton *_buttonStartTest;
00098     KGroupEduca *_buttonGroup;
00100     FileRead *_keducaFile;
00102     KQuestion *_questionText;
00104     QTextEdit *_viewResults;
00105     QTextEdit *_viewInfo;
00107     int _keducaFileIndex;
00109     QString _results;
00111     QVBoxLayout *_vbox2;
00113     QSplitter *_split;
00115     QString _currentResults;
00117     bool _isInitStatus;
00118     QTimer *_timeoutTimer;
00120     int _correctAnswer;
00122     int _incorrectAnswer;
00124     int _correctPoints;
00126     int _incorrectPoints;
00128     int _currentTime;
00130     bool _showResultFinish;
00132     bool _showRandomQuestions;
00134     bool _showRandomAnswers;
00136     QValueList<uint> _randomQuestions;
00138     QValueList<uint> _randomAnswers;
00139 private slots:
00141     void slotButtonNext();
00142     void slotButtonSave();
00143     void slotButtonStartTest();
00144     void questionTimedOut();
00145 };
00146 
00147 #endif