parley
PracticeDialog Class Reference
#include <practicedialog.h>

Detailed Description
Definition at line 52 of file practicedialog.h.
Public Types | |
| enum | WidgetStyle { Default, PositiveResult, NegativeResult, HintStyle } |
Public Slots | |
| virtual void | showSolution ()=0 |
| void | timeoutReached () |
| void | editEntry () |
Signals | |
| void | signalResult (TestEntryManager::Result) |
| void | showSolutionFinished () |
Public Member Functions | |
| PracticeDialog (const QString &caption, KEduVocDocument *doc, QWidget *parent) | |
| void | setTestEntryManager (TestEntryManager *testEntryManager) |
| virtual | ~PracticeDialog () |
| virtual void | setEntry (TestEntry *entry)=0 |
| virtual void | setProgressCounter (int current, int total)=0 |
Protected Slots | |
| void | skipKnown () |
| void | skipUnknown () |
| void | audioPlayFromIdentifier () |
| void | audioPlayToIdentifier () |
| void | continueButtonClicked () |
Protected Member Functions | |
| void | resultCorrect () |
| void | resultWrong () |
| virtual void | setStatusText (const QString &status)=0 |
| virtual QProgressBar * | timebar ()=0 |
| void | audioPlayFile (const KUrl &soundFile) |
| void | imageShowFile (QGraphicsView *view, const QString &url) |
| void | imageShowFromEntry (QGraphicsView *view, const TestEntry *entry) |
| bool | smartCompare (const QString &, const QString &) const |
| double | verifyAnswer (const QString &userAnswer) |
| double | verifyAnswer (const QString &solution, const QString &userAnswer) |
| void | setWidgetStyle (QWidget *widget, WidgetStyle style=Default) |
| virtual void | closeEvent (QCloseEvent *e) |
| void | startAnswerTimer () |
| void | stopAnswerTimer () |
| void | startShowSolutionTimer () |
| void | setAnswerTainted (bool tainted=true) |
| bool | answerTainted () |
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 56 of file practicedialog.h.
Constructor & Destructor Documentation
Default constructor for a test dialog.
- Parameters:
-
caption the dialog title doc the document to be used parent parent widget
- Todo:
- : uncomment as soon as new strings may be added
Definition at line 45 of file practicedialog.cpp.
| PracticeDialog::~PracticeDialog | ( | ) | [virtual] |
Member Function Documentation
| void PracticeDialog::setTestEntryManager | ( | TestEntryManager * | testEntryManager | ) |
| 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 140 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.
| void PracticeDialog::signalResult | ( | TestEntryManager::Result | ) | [signal] |
| void PracticeDialog::showSolutionFinished | ( | ) | [signal] |
| virtual void PracticeDialog::showSolution | ( | ) | [pure virtual, slot] |
Let the dialog show the solution.
Implemented in MCQueryDlg, MixedLetterPracticeDialog, SimpleQueryDlg, and WrittenPracticeDialog.
| void PracticeDialog::timeoutReached | ( | ) | [slot] |
Informs the dialog that the time is up.
- Todo:
- check if this works - esp with 3x timeout
Definition at line 92 of file practicedialog.cpp.
| void PracticeDialog::editEntry | ( | ) | [slot] |
Slot that starts the edit entry dialog.
A practice dialog can call this to allow editing an entry.
Definition at line 163 of file practicedialog.cpp.
| void PracticeDialog::skipKnown | ( | ) | [protected, slot] |
Call this when the user decided to skip this entry as KNOWN.
Definition at line 182 of file practicedialog.cpp.
| void PracticeDialog::skipUnknown | ( | ) | [protected, slot] |
Call this when the user decided to skip this entry as UNKNOWN.
Definition at line 188 of file practicedialog.cpp.
| void PracticeDialog::audioPlayFromIdentifier | ( | ) | [protected, slot] |
Play the audio file associated with the question.
Definition at line 210 of file practicedialog.cpp.
| void PracticeDialog::audioPlayToIdentifier | ( | ) | [protected, slot] |
| void PracticeDialog::continueButtonClicked | ( | ) | [protected, slot] |
The continue button has been clicked - stop m_showSolutionTimer.
Definition at line 339 of file practicedialog.cpp.
| void PracticeDialog::resultCorrect | ( | ) | [protected] |
Definition at line 194 of file practicedialog.cpp.
| void PracticeDialog::resultWrong | ( | ) | [protected] |
Definition at line 205 of file practicedialog.cpp.
| virtual void PracticeDialog::setStatusText | ( | const QString & | status | ) | [protected, pure virtual] |
Implemented in SimpleQueryDlg.
| virtual QProgressBar* PracticeDialog::timebar | ( | ) | [protected, pure virtual] |
Implemented in SimpleQueryDlg.
| void PracticeDialog::audioPlayFile | ( | const KUrl & | soundFile | ) | [protected] |
Definition at line 226 of file practicedialog.cpp.
| void PracticeDialog::imageShowFile | ( | QGraphicsView * | view, | |
| const QString & | url | |||
| ) | [protected] |
Definition at line 242 of file practicedialog.cpp.
| void PracticeDialog::imageShowFromEntry | ( | QGraphicsView * | view, | |
| const TestEntry * | entry | |||
| ) | [protected] |
Definition at line 265 of file practicedialog.cpp.
compare two strings with simplified applied first (pretty smart huh?)
| 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 348 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 355 of file practicedialog.cpp.
| 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 291 of file practicedialog.cpp.
| void PracticeDialog::closeEvent | ( | QCloseEvent * | e | ) | [protected, virtual] |
Definition at line 85 of file practicedialog.cpp.
| 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 113 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 133 of file practicedialog.cpp.
| void PracticeDialog::startShowSolutionTimer | ( | ) | [protected] |
Emits nextEntry() when the timeout for showing the solution is reached.
Definition at line 326 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 281 of file practicedialog.cpp.
| bool PracticeDialog::answerTainted | ( | ) | [protected] |
Returns true if the answer is counted as wrong.
- Returns:
Definition at line 286 of file practicedialog.cpp.
Member Data Documentation
KEduVocDocument* PracticeDialog::m_doc [protected] |
Definition at line 179 of file practicedialog.h.
TestEntry* PracticeDialog::m_entry [protected] |
Definition at line 180 of file practicedialog.h.
int PracticeDialog::m_testType [protected] |
Definition at line 181 of file practicedialog.h.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference