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

parley

  • Practice
  • AbstractBackendMode
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Practice::AbstractBackendMode Class Referenceabstract

#include <abstractbackendmode.h>

Inheritance diagram for Practice::AbstractBackendMode:
Inheritance graph
[legend]

Public Slots

virtual void checkAnswer ()=0
 
virtual void hintAction ()=0
 

Signals

void answerRight ()
 
void answerWrongRetry ()
 
void answerWrongShowSolution ()
 
void nextEntry ()
 
void removeCurrentEntryFromPractice ()
 
void showSolution ()
 

Public Member Functions

 AbstractBackendMode (AbstractFrontend *frontend, QObject *parent)
 
virtual ~AbstractBackendMode ()
 
void addSynonym (const QString &entry)
 
virtual grade_t currentGradeForEntry () const
 
virtual grade_t currentPreGradeForEntry () const
 
virtual bool setTestEntry (TestEntry *current)
 
virtual void updateGrades ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Protected Member Functions

void updateGrade (KEduVocText &text, bool isCorrectAnswer, bool hasNoPreviousBadAnswers)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Protected Attributes

TestEntry * m_current
 
AbstractFrontend * m_frontend
 
QStringList m_synonyms
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Definition at line 26 of file abstractbackendmode.h.

Constructor & Destructor Documentation

AbstractBackendMode::AbstractBackendMode ( Practice::AbstractFrontend *  frontend,
QObject *  parent 
)

Definition at line 21 of file abstractbackendmode.cpp.

virtual Practice::AbstractBackendMode::~AbstractBackendMode ( )
inlinevirtual

Definition at line 33 of file abstractbackendmode.h.

Member Function Documentation

void Practice::AbstractBackendMode::addSynonym ( const QString &  entry)
inline

add a new synonym to the list of shown/answered synonyms depending on which mode we are in.

Definition at line 41 of file abstractbackendmode.h.

void Practice::AbstractBackendMode::answerRight ( )
signal
void Practice::AbstractBackendMode::answerWrongRetry ( )
signal
void Practice::AbstractBackendMode::answerWrongShowSolution ( )
signal
virtual void Practice::AbstractBackendMode::checkAnswer ( )
pure virtualslot

Check if the current answer is right.

This function should emit one of these signals: answerRight, answerWrongRetry, answerWrongShowSolution or showSolution

Implemented in Practice::MultipleChoiceBackendMode, Practice::WrittenBackendMode, and Practice::ComparisonBackendMode.

grade_t Practice::AbstractBackendMode::currentGradeForEntry ( ) const
virtual

The grade of the current entry - this has a default implementation to return the grade for the current translation.

This is used in the frontend to visualize the confidence level. If the practice is not on the translation itself but for example conjugations, the mode needs to re-implement this function in order to change the grade of the correct parts of the translation.

For modes that work on several words, this should return the worst grade of them.

Returns
the grade

Reimplemented in Practice::ConjugationBackendMode.

Definition at line 58 of file abstractbackendmode.cpp.

grade_t Practice::AbstractBackendMode::currentPreGradeForEntry ( ) const
virtual

The pregrade of the current entry - this has a default implementation to return the pregrade for the current translation.

See also
currentGradeForEntry() for a comment about reimplementation.
Returns
the pregrade

Reimplemented in Practice::ConjugationBackendMode.

Definition at line 53 of file abstractbackendmode.cpp.

virtual void Practice::AbstractBackendMode::hintAction ( )
pure virtualslot

the frontend requested a hint

void Practice::AbstractBackendMode::nextEntry ( )
signal

ask for the next word to be practiced

void Practice::AbstractBackendMode::removeCurrentEntryFromPractice ( )
signal
bool AbstractBackendMode::setTestEntry ( TestEntry *  current)
virtual

start practicing a new word.

sets some default that can be overwritten by the modes. m_frontend->showQuestion() should be called after the initialization.

Reimplemented in Practice::GenderBackendMode, Practice::MultipleChoiceBackendMode, Practice::WrittenBackendMode, Practice::ComparisonBackendMode, Practice::ConjugationBackendMode, Practice::ExampleSentenceBackendMode, and Practice::FlashCardBackendMode.

Definition at line 28 of file abstractbackendmode.cpp.

void Practice::AbstractBackendMode::showSolution ( )
signal
void Practice::AbstractBackendMode::updateGrade ( KEduVocText &  text,
bool  isCorrectAnswer,
bool  hasNoPreviousBadAnswers 
)
protected

Update the grade for the current entry.

If the answer from the user was correct, using isCorrectAnswer as the indicator, then the grade of the current entry is increased one step if there was no previous wrong answer; otherwise it's set to pregrade 1, grade 0. The exception is if the word is new (pregrade 0, grade 0). In that case if it's correct it's presumed that the user knows the word reasonably well and the grade is set to a higher level. The exact value of this level is arbitrarily chosen now and may become configurable in the future.

Parameters
textthe translation or similar in the kedudocument that should be changed
isCorrectAnswertrue if the current answer is correct
hasNoPreviousBadAnswerstrue if there never was any wrong answer for this word in the current session

Definition at line 84 of file abstractbackendmode.cpp.

void Practice::AbstractBackendMode::updateGrades ( )
virtual

Change the grades for the current entry.

The default implementation changes the grade of the current translation. Modes working on other parts of the translations need to re-implement this.

Reimplemented in Practice::ComparisonBackendMode, Practice::ConjugationBackendMode, and Practice::GenderBackendMode.

Definition at line 63 of file abstractbackendmode.cpp.

Member Data Documentation

TestEntry* Practice::AbstractBackendMode::m_current
protected

Definition at line 122 of file abstractbackendmode.h.

AbstractFrontend* Practice::AbstractBackendMode::m_frontend
protected

Definition at line 121 of file abstractbackendmode.h.

QStringList Practice::AbstractBackendMode::m_synonyms
protected

Definition at line 123 of file abstractbackendmode.h.


The documentation for this class was generated from the following files:
  • abstractbackendmode.h
  • abstractbackendmode.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

parley

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal