parley
PracticeDialog Class Reference
#include <practicedialog.h>

Detailed Description
Definition at line 46 of file practicedialog.h.
Public Types | |
| enum | WidgetStyle { Default, PositiveResult, NegativeResult, HintStyle } |
Public Slots | |
| virtual void | showSolution ()=0 |
| void | timeoutReached () |
Signals | |
| void | showSolutionFinished () |
| void | signalResult (TestEntryManager::Result) |
Public Member Functions | |
| PracticeDialog (const QString &caption, KEduVocDocument *doc, QWidget *parent) | |
| virtual void | setEntry (TestEntry *entry)=0 |
| virtual void | setProgressCounter (int current, int total)=0 |
| void | setTestEntryManager (TestEntryManager *testEntryManager) |
| virtual | ~PracticeDialog () |
Protected Slots | |
| void | audioPlayFromIdentifier () |
| void | audioPlayToIdentifier () |
| void | continueButtonClicked () |
| void | skipKnown () |
| void | skipUnknown () |
Protected Member Functions | |
| bool | answerTainted () |
| void | audioPlayFile (const KUrl &soundFile) |
| virtual void | closeEvent (QCloseEvent *e) |
| void | imageShowFile (QGraphicsView *view, const QString &url) |
| void | imageShowFromEntry (QGraphicsView *view) |
| void | resultCorrect () |
| void | resultWrong () |
| void | setAnswerTainted (bool tainted=true) |
| virtual void | setStatusText (const QString &status)=0 |
| void | setWidgetStyle (QWidget *widget, WidgetStyle style=Default) |
| bool | smartCompare (const QString &, const QString &) const |
| void | startAnswerTimer () |
| void | startShowSolutionTimer () |
| void | stopAnswerTimer () |
| virtual QProgressBar * | timebar ()=0 |
| double | verifyAnswer (const QString &solution, const QString &userAnswer) |
| double | verifyAnswer (const QString &userAnswer) |
Protected Attributes | |
| KEduVocDocument * | m_doc |
| TestEntry * | m_entry |
| int | m_testType |
Member Enumeration Documentation
- Enumerator:
-
Default Normal font, normal color (black). PositiveResult Green text, bold. NegativeResult Red text, bold. HintStyle Blue text, bold.
Definition at line 50 of file practicedialog.h.
Constructor & Destructor Documentation
| PracticeDialog::PracticeDialog | ( | const QString & | caption, | |
| KEduVocDocument * | doc, | |||
| QWidget * | parent | |||
| ) |
Default constructor for a test dialog.
- Parameters:
-
caption the dialog title doc the document to be used parent parent widget
Definition at line 46 of file practicedialog.cpp.
| PracticeDialog::~PracticeDialog | ( | ) | [virtual] |
Member Function Documentation
| bool PracticeDialog::answerTainted | ( | ) | [protected] |
Returns true if the answer is counted as wrong.
- Returns:
Definition at line 265 of file practicedialog.cpp.
| void PracticeDialog::audioPlayFile | ( | const KUrl & | soundFile | ) | [protected] |
Definition at line 205 of file practicedialog.cpp.
| void PracticeDialog::audioPlayFromIdentifier | ( | ) | [protected, slot] |
Play the audio file associated with the question.
Definition at line 189 of file practicedialog.cpp.
| void PracticeDialog::audioPlayToIdentifier | ( | ) | [protected, slot] |
| void PracticeDialog::closeEvent | ( | QCloseEvent * | e | ) | [protected, virtual] |
Definition at line 83 of file practicedialog.cpp.
| void PracticeDialog::continueButtonClicked | ( | ) | [protected, slot] |
The continue button has been clicked - stop m_showSolutionTimer.
Definition at line 318 of file practicedialog.cpp.
| void PracticeDialog::imageShowFile | ( | QGraphicsView * | view, | |
| const QString & | url | |||
| ) | [protected] |
Definition at line 221 of file practicedialog.cpp.
| void PracticeDialog::imageShowFromEntry | ( | QGraphicsView * | view | ) | [protected] |
Definition at line 244 of file practicedialog.cpp.
| void PracticeDialog::resultCorrect | ( | ) | [protected] |
Definition at line 173 of file practicedialog.cpp.
| void PracticeDialog::resultWrong | ( | ) | [protected] |
Definition at line 184 of file practicedialog.cpp.
| void PracticeDialog::setAnswerTainted | ( | bool | tainted = true |
) | [protected] |
When tainted is set true, a correct answer will be counted as wrong (for example show more button).
- Parameters:
-
tainted
Definition at line 260 of file practicedialog.cpp.
| void PracticeDialog::setEntry | ( | TestEntry * | entry | ) | [pure virtual] |
Set an entry to be tested.
Each dialog should reimplement this. You must call this to get the timer started!
- Parameters:
-
entry
Implemented in AdjQueryDlg, ArtQueryDlg, MCQueryDlg, MixedLetterPracticeDialog, SimpleQueryDlg, VerbQueryDlg, and WrittenPracticeDialog.
Definition at line 138 of file practicedialog.cpp.
| virtual void PracticeDialog::setProgressCounter | ( | int | current, | |
| int | total | |||
| ) | [pure virtual] |
Informs the dialog of the number of entries to be tested.
- Parameters:
-
current number of answered entries total number of entries in the test
Implemented in AdjQueryDlg, ArtQueryDlg, MCQueryDlg, MixedLetterPracticeDialog, SimpleQueryDlg, VerbQueryDlg, and WrittenPracticeDialog.
| virtual void PracticeDialog::setStatusText | ( | const QString & | status | ) | [protected, pure virtual] |
Implemented in SimpleQueryDlg.
| void PracticeDialog::setTestEntryManager | ( | TestEntryManager * | testEntryManager | ) |
| void PracticeDialog::setWidgetStyle | ( | QWidget * | widget, | |
| WidgetStyle | style = Default | |||
| ) | [protected] |
Set the color scheme of a widget to WidgetStyle.
- Parameters:
-
widget the widget to be modified style WidgetStyle
Definition at line 270 of file practicedialog.cpp.
| virtual void PracticeDialog::showSolution | ( | ) | [pure virtual, slot] |
Let the dialog show the solution.
Implemented in MCQueryDlg, MixedLetterPracticeDialog, SimpleQueryDlg, and WrittenPracticeDialog.
| void PracticeDialog::showSolutionFinished | ( | ) | [signal] |
| void PracticeDialog::signalResult | ( | TestEntryManager::Result | ) | [signal] |
| void PracticeDialog::skipKnown | ( | ) | [protected, slot] |
Call this when the user decided to skip this entry as KNOWN.
Definition at line 161 of file practicedialog.cpp.
| void PracticeDialog::skipUnknown | ( | ) | [protected, slot] |
Call this when the user decided to skip this entry as UNKNOWN.
Definition at line 167 of file practicedialog.cpp.
compare two strings with simplified applied first (pretty smart huh?)
| void PracticeDialog::startAnswerTimer | ( | ) | [protected] |
When a timeout per question is set in the prefs, this starts the timer.
Called by setQuery, so don't wory about it. Cann be called to restart the timer.
Definition at line 111 of file practicedialog.cpp.
| void PracticeDialog::startShowSolutionTimer | ( | ) | [protected] |
Emits nextEntry() when the timeout for showing the solution is reached.
Definition at line 305 of file practicedialog.cpp.
| void PracticeDialog::stopAnswerTimer | ( | ) | [protected] |
When the solution is shown etc there's no point in counting any more.
..
Definition at line 131 of file practicedialog.cpp.
| virtual QProgressBar* PracticeDialog::timebar | ( | ) | [protected, pure virtual] |
Implemented in SimpleQueryDlg.
| void PracticeDialog::timeoutReached | ( | ) | [slot] |
Informs the dialog that the time is up.
- Todo:
- check if this works - esp with 3x timeout
Definition at line 90 of file practicedialog.cpp.
| double PracticeDialog::verifyAnswer | ( | const QString & | solution, | |
| const QString & | userAnswer | |||
| ) | [protected] |
Like verifyAnswer but for two strings, so the entry is not taken into consideration.
- Parameters:
-
solution userAnswer
- Returns:
Definition at line 334 of file practicedialog.cpp.
| double PracticeDialog::verifyAnswer | ( | const QString & | userAnswer | ) | [protected] |
Use this to check if the answer is correct.
Use only to check the word itself, does not work on other properties like comparison forms etc.
- Parameters:
-
userAnswer
- Returns:
- a fuzzy answer where 1.0 is the correct solution and 0.0 completely wrong
Definition at line 327 of file practicedialog.cpp.
Member Data Documentation
KEduVocDocument* PracticeDialog::m_doc [protected] |
Definition at line 167 of file practicedialog.h.
TestEntry* PracticeDialog::m_entry [protected] |
Definition at line 168 of file practicedialog.h.
int PracticeDialog::m_testType [protected] |
Definition at line 169 of file practicedialog.h.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference