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

parley

  • sources
  • kde-4.14
  • kdeedu
  • parley
  • src
  • practice
abstractbackendmode.h
Go to the documentation of this file.
1 /***************************************************************************
2  Copyright 2009 Frederik Gladhorn <gladhorn@kde.org>
3  ***************************************************************************/
4 
5 /***************************************************************************
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  ***************************************************************************/
13 
14 #ifndef ABSTRACTBACKENDMODE_H
15 #define ABSTRACTBACKENDMODE_H
16 
17 #include <QVariant>
18 
19 #include "testentry.h"
20 #include "abstractfrontend.h"
21 
22 
23 namespace Practice
24 {
25 
26 class AbstractBackendMode : public QObject
27 {
28  Q_OBJECT
29 
30 public:
31 
32  AbstractBackendMode(AbstractFrontend *frontend, QObject *parent);
33  virtual ~AbstractBackendMode() {}
34 
37  virtual bool setTestEntry(TestEntry* current);
38 
41  void addSynonym(const QString& entry) {
42  if (!entry.isEmpty()) m_synonyms.append(entry);
43  }
44 
53  virtual grade_t currentPreGradeForEntry() const;
69  virtual grade_t currentGradeForEntry() const;
70 
76  virtual void updateGrades();
77 
78 public Q_SLOTS:
80  virtual void hintAction() = 0;
81 
86  virtual void checkAnswer() = 0;
87 
88 Q_SIGNALS:
89  void removeCurrentEntryFromPractice();
90 
92  void nextEntry();
93 
94  void answerRight();
95  void answerWrongRetry();
96  void answerWrongShowSolution();
97  void showSolution();
98 
99 protected:
100  // Support functions for derived classes
101 
118  void updateGrade(KEduVocText &text, bool isCorrectAnswer, bool hasNoPreviousBadAnswers);
119 
120 protected:
121  AbstractFrontend* m_frontend;
122  TestEntry* m_current;
123  QStringList m_synonyms;
124 };
125 
126 }
127 
128 #endif // ABSTRACTBACKENDMODE_H
Practice::AbstractBackendMode::hintAction
virtual void hintAction()=0
the frontend requested a hint
Practice::AbstractBackendMode::addSynonym
void addSynonym(const QString &entry)
add a new synonym to the list of shown/answered synonyms depending on which mode we are in...
Definition: abstractbackendmode.h:41
Practice::AbstractBackendMode::showSolution
void showSolution()
Practice::AbstractBackendMode::answerRight
void answerRight()
Practice::AbstractBackendMode::updateGrade
void updateGrade(KEduVocText &text, bool isCorrectAnswer, bool hasNoPreviousBadAnswers)
Update the grade for the current entry.
Definition: abstractbackendmode.cpp:84
Practice::AbstractBackendMode::checkAnswer
virtual void checkAnswer()=0
Check if the current answer is right.
Practice::AbstractBackendMode::removeCurrentEntryFromPractice
void removeCurrentEntryFromPractice()
testentry.h
Practice::AbstractBackendMode::m_frontend
AbstractFrontend * m_frontend
Definition: abstractbackendmode.h:121
QList::append
void append(const T &value)
Practice::AbstractBackendMode::~AbstractBackendMode
virtual ~AbstractBackendMode()
Definition: abstractbackendmode.h:33
Practice::AbstractBackendMode::m_current
TestEntry * m_current
Definition: abstractbackendmode.h:122
QObject
Practice::AbstractBackendMode::m_synonyms
QStringList m_synonyms
Definition: abstractbackendmode.h:123
QString::isEmpty
bool isEmpty() const
Practice::AbstractBackendMode::updateGrades
virtual void updateGrades()
Change the grades for the current entry.
Definition: abstractbackendmode.cpp:63
QString
QStringList
Practice::AbstractBackendMode::setTestEntry
virtual bool setTestEntry(TestEntry *current)
start practicing a new word.
Definition: abstractbackendmode.cpp:28
Practice::AbstractBackendMode::nextEntry
void nextEntry()
ask for the next word to be practiced
Practice::AbstractBackendMode::answerWrongShowSolution
void answerWrongShowSolution()
abstractfrontend.h
Practice::AbstractBackendMode
Definition: abstractbackendmode.h:26
Practice::AbstractBackendMode::currentGradeForEntry
virtual grade_t currentGradeForEntry() const
The grade of the current entry - this has a default implementation to return the grade for the curren...
Definition: abstractbackendmode.cpp:58
Practice::AbstractFrontend
Definition: abstractfrontend.h:26
Practice::AbstractBackendMode::answerWrongRetry
void answerWrongRetry()
Practice::AbstractBackendMode::AbstractBackendMode
AbstractBackendMode(AbstractFrontend *frontend, QObject *parent)
Definition: abstractbackendmode.cpp:21
QObject::parent
QObject * parent() const
Practice::AbstractBackendMode::currentPreGradeForEntry
virtual grade_t currentPreGradeForEntry() const
The pregrade of the current entry - this has a default implementation to return the pregrade for the ...
Definition: abstractbackendmode.cpp:53
TestEntry
Definition: testentry.h:22
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 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