• 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
sessionmanagerbase.h
Go to the documentation of this file.
1 /***************************************************************************
2  copyright : (C) 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de>
3  (C) 2005-2007 Peter Hedlund <peter.hedlund@kdemail.net>
4  (C) 2007-2010 Frederik Gladhorn <gladhorn@kde.org>
5  (C) 2014 Inge Wallin <inge@lysator.liu.se>
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef PRACTICESESSIONMANAGERBASE_H
18 #define PRACTICESESSIONMANAGERBASE_H
19 
20 // Qt
21 #include <QVector>
22 
23 // kdelibs
24 #include <KRandomSequence>
25 
26 // kdeedulibs
27 #include <keduvocexpression.h>
28 
29 // Parley
30 #include "testentry.h"
31 #include "prefs.h"
32 
33 
34 class KEduVocDocument;
35 class PracticeDialog;
36 
37 namespace Practice
38 {
39 
40 class SessionManagerBase
41 {
42 public:
47  explicit SessionManagerBase(QWidget *parent);
48 
52  virtual ~SessionManagerBase();
53 
61  virtual void setDocument(KEduVocDocument *doc);
62 
68  virtual void initializeTraining() = 0;
69 
73  QString title() const;
74 
75 
76  // Should be called when starting and ending the practice session respectively.
77  // The default implementations only start and stop the practice timer.
78  virtual void practiceStarted();
79  virtual void practiceFinished();
80 
82  int totalTime();
83 
84 
92  virtual TestEntry* nextTrainingEntry();
93 
95  virtual void removeCurrentEntryFromPractice();
96 
97 
101  QList<TestEntry*> allTestEntries() const;
102 
108  int allEntryCount() const;
109 
114  int activeEntryCount();
115 
119  QList<TestEntry*> allUnansweredTestEntries();
120 
121  // ----------------------------------------------------------------
122  // Statistics
123  int statisticTotalCorrectFirstAttempt();
124  int statisticTotalWrong();
125  int statisticTotalUnanswered();
126 
130  void printStatistics();
131 
132 
133  QStringList multipleChoiceAnswers(int numberChoices);
134 
135  //QString currentConjugationTense();
136 
137  protected: // methods
138 
143  bool isValidMultipleChoiceAnswer(KEduVocExpression *e);
144 
145 protected: // data
146 
147  KEduVocDocument *m_doc;
148  QWidget *m_parent;
149  int m_learningLanguageIndex;
150  int m_knownLanguageIndex;
151  int m_testType;
152 
153  // ----------------------------------------------------------------
154  // The following entries define the training
155 
159  QList<TestEntry*> m_allTestEntries;
160 
162  QList<TestEntry*> m_notAskedTestEntries;
163 
167  QList<TestEntry*> m_currentEntries;
168 
169  // The index of the current entry in m_currentEntries.
170  int m_currentEntry;
171 
172  QTime m_time;
173  int m_totalTime;
174 
175  KRandomSequence m_randomSequence;
176 
177  friend class EntryFilter;
178 };
179 
180 }
181 
182 #endif // kvtquery_included
QWidget
Practice::SessionManagerBase::nextTrainingEntry
virtual TestEntry * nextTrainingEntry()
Get the next entry to show to the user.
Definition: sessionmanagerbase.cpp:124
Practice::SessionManagerBase::statisticTotalUnanswered
int statisticTotalUnanswered()
Definition: sessionmanagerbase.cpp:218
EntryFilter
Definition: entryfilter.h:31
Practice::SessionManagerBase::m_testType
int m_testType
Definition: sessionmanagerbase.h:151
Practice::SessionManagerBase::title
QString title() const
Retun the title of the document.
Definition: sessionmanagerbase.cpp:101
Practice::SessionManagerBase::allUnansweredTestEntries
QList< TestEntry * > allUnansweredTestEntries()
Get a list of all unanswered entries in the test.
Definition: sessionmanagerbase.cpp:182
Practice::SessionManagerBase::printStatistics
void printStatistics()
Puts some grades on the shell.
Definition: sessionmanagerbase.cpp:229
prefs.h
Practice::SessionManagerBase::SessionManagerBase
SessionManagerBase(QWidget *parent)
Create a collection of entries to be practiced.
Definition: sessionmanagerbase.cpp:40
Practice::SessionManagerBase::~SessionManagerBase
virtual ~SessionManagerBase()
destructor
Definition: sessionmanagerbase.cpp:50
QTime
Practice::SessionManagerBase::removeCurrentEntryFromPractice
virtual void removeCurrentEntryFromPractice()
Finish the currently active entry.
Definition: sessionmanagerbase.cpp:160
Practice::SessionManagerBase::allTestEntries
QList< TestEntry * > allTestEntries() const
Get a list of all entries in the test - used by the summary dialog.
Definition: sessionmanagerbase.cpp:167
Practice::SessionManagerBase::m_time
QTime m_time
Definition: sessionmanagerbase.h:172
testentry.h
Practice::SessionManagerBase::m_currentEntries
QList< TestEntry * > m_currentEntries
The list of entries that are being asked.
Definition: sessionmanagerbase.h:167
Practice::SessionManagerBase::allEntryCount
int allEntryCount() const
The number of entries available for the practice session.
Definition: sessionmanagerbase.cpp:172
Practice::SessionManagerBase::m_notAskedTestEntries
QList< TestEntry * > m_notAskedTestEntries
All entries that have not been entered into the active set.
Definition: sessionmanagerbase.h:162
Practice::SessionManagerBase::m_parent
QWidget * m_parent
Definition: sessionmanagerbase.h:148
Practice::SessionManagerBase::m_allTestEntries
QList< TestEntry * > m_allTestEntries
All entries available in the document that fulfill the requirements set in the configuration and the ...
Definition: sessionmanagerbase.h:159
Practice::SessionManagerBase::activeEntryCount
int activeEntryCount()
The number of entries that are still to be practiced.
Definition: sessionmanagerbase.cpp:177
Practice::SessionManagerBase::initializeTraining
virtual void initializeTraining()=0
Initialize the lists of entries that will be used in the training from the full set of available entr...
Practice::SessionManagerBase::m_knownLanguageIndex
int m_knownLanguageIndex
Definition: sessionmanagerbase.h:150
QString
QList< TestEntry * >
Practice::SessionManagerBase::practiceFinished
virtual void practiceFinished()
Definition: sessionmanagerbase.cpp:112
Practice::SessionManagerBase::isValidMultipleChoiceAnswer
bool isValidMultipleChoiceAnswer(KEduVocExpression *e)
Find out if the given expression can be used as a multiple choice answer for the current entry (i...
Definition: sessionmanagerbase.cpp:314
QStringList
Practice::SessionManagerBase::setDocument
virtual void setDocument(KEduVocDocument *doc)
Prepare for practice using the entries in this document.
Definition: sessionmanagerbase.cpp:55
Practice::SessionManagerBase::m_randomSequence
KRandomSequence m_randomSequence
Definition: sessionmanagerbase.h:175
Practice::SessionManagerBase::m_currentEntry
int m_currentEntry
Definition: sessionmanagerbase.h:170
Practice::SessionManagerBase::totalTime
int totalTime()
the time in seconds
Definition: sessionmanagerbase.cpp:118
Practice::SessionManagerBase::m_doc
KEduVocDocument * m_doc
Definition: sessionmanagerbase.h:147
Practice::SessionManagerBase::m_learningLanguageIndex
int m_learningLanguageIndex
Definition: sessionmanagerbase.h:149
Practice::SessionManagerBase::practiceStarted
virtual void practiceStarted()
Definition: sessionmanagerbase.cpp:106
Practice::SessionManagerBase::statisticTotalCorrectFirstAttempt
int statisticTotalCorrectFirstAttempt()
Definition: sessionmanagerbase.cpp:196
Practice::SessionManagerBase::multipleChoiceAnswers
QStringList multipleChoiceAnswers(int numberChoices)
Definition: sessionmanagerbase.cpp:245
Practice::SessionManagerBase
Definition: sessionmanagerbase.h:40
Practice::SessionManagerBase::m_totalTime
int m_totalTime
Definition: sessionmanagerbase.h:173
Practice::SessionManagerBase::statisticTotalWrong
int statisticTotalWrong()
Definition: sessionmanagerbase.cpp:207
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