• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

parley

PracticeDialog Class Reference

#include <practicedialog.h>

Inheritance diagram for PracticeDialog:
Inheritance graph
[legend]

List of all members.

Public Types

enum  WidgetStyle { Default, PositiveResult, NegativeResult, HintStyle }

Public Slots

virtual void showSolution ()=0
void timeoutReached ()

Signals

void currentEntryFinished ()

Public Member Functions

 PracticeDialog (const QString &caption, KEduVocDocument *doc, QWidget *parent)
virtual ~PracticeDialog ()
VocabularyPractice::Result result ()
virtual void setEntry (TestEntry *entry)=0
virtual void setProgressCounter (int current, int total)=0

Protected Slots

void audioPlayFromIdentifier ()
void audioPlayToIdentifier ()
void continueWithNextWord ()
void countAsRight ()
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

Detailed Description

Definition at line 47 of file practicedialog.h.


Member Enumeration Documentation

enum PracticeDialog::WidgetStyle
Enumerator:
Default 

Normal font, normal color (black).

PositiveResult 

Green text, bold.

NegativeResult 

Red text, bold.

HintStyle 

Blue text, bold.

Definition at line 51 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 47 of file practicedialog.cpp.

PracticeDialog::~PracticeDialog (  )  [virtual]

Default dtor.

Definition at line 76 of file practicedialog.cpp.


Member Function Documentation

bool PracticeDialog::answerTainted (  )  [protected]

Returns true if the answer is counted as wrong.

Returns:

Definition at line 268 of file practicedialog.cpp.

void PracticeDialog::audioPlayFile ( const KUrl &  soundFile  )  [protected]

Definition at line 209 of file practicedialog.cpp.

void PracticeDialog::audioPlayFromIdentifier (  )  [protected, slot]

Play the audio file associated with the question.

Definition at line 193 of file practicedialog.cpp.

void PracticeDialog::audioPlayToIdentifier (  )  [protected, slot]

Play the soundfile associated with the solution.

Definition at line 201 of file practicedialog.cpp.

void PracticeDialog::closeEvent ( QCloseEvent *  e  )  [protected, virtual]

Definition at line 82 of file practicedialog.cpp.

void PracticeDialog::continueWithNextWord (  )  [protected, slot]

Move on to the next word.

Definition at line 327 of file practicedialog.cpp.

void PracticeDialog::countAsRight (  )  [protected, slot]

Continue with the next word and count this one as right.

Definition at line 321 of file practicedialog.cpp.

void PracticeDialog::currentEntryFinished (  )  [signal]

Emitted when the user has answered and the solution is displayed.

void PracticeDialog::imageShowFile ( QGraphicsView *  view,
const QString &  url 
) [protected]

Definition at line 224 of file practicedialog.cpp.

void PracticeDialog::imageShowFromEntry ( QGraphicsView *  view  )  [protected]

Definition at line 247 of file practicedialog.cpp.

VocabularyPractice::Result PracticeDialog::result (  ) 

Gives back the result (right/wrong answer) after currentEntryFinished() has been emitted.

Definition at line 160 of file practicedialog.cpp.

void PracticeDialog::resultCorrect (  )  [protected]

Definition at line 177 of file practicedialog.cpp.

void PracticeDialog::resultWrong (  )  [protected]

Definition at line 188 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 263 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 137 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::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 273 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::skipKnown (  )  [protected, slot]

Call this when the user decided to skip this entry as KNOWN.

Definition at line 165 of file practicedialog.cpp.

void PracticeDialog::skipUnknown (  )  [protected, slot]

Call this when the user decided to skip this entry as UNKNOWN.

Definition at line 171 of file practicedialog.cpp.

bool PracticeDialog::smartCompare ( const QString &  ,
const QString &   
) const [protected]

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 110 of file practicedialog.cpp.

void PracticeDialog::startShowSolutionTimer (  )  [protected]

Emits nextEntry() when the timeout for showing the solution is reached.

Definition at line 308 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 130 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.

Definition at line 89 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 341 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 335 of file practicedialog.cpp.


Member Data Documentation

KEduVocDocument* PracticeDialog::m_doc [protected]

Definition at line 172 of file practicedialog.h.

TestEntry* PracticeDialog::m_entry [protected]

Definition at line 173 of file practicedialog.h.

int PracticeDialog::m_testType [protected]

Definition at line 174 of file practicedialog.h.


The documentation for this class was generated from the following files:
  • practicedialog.h
  • practicedialog.cpp

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  •     lib
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal