parley
practicestatemachine.cpp
Go to the documentation of this file.
30 PracticeStateMachine::PracticeStateMachine(AbstractFrontend* frontend, ParleyDocument* doc, const PracticeOptions& options, TestEntryManager* testEntryManager, QObject* parent)
69 m_mode = new WrittenBackendMode(m_options, m_frontend, this, m_testEntryManager, m_document->document());
74 m_mode = new WrittenBackendMode(m_options, m_frontend, this, m_testEntryManager, m_document->document());
79 m_mode = new ExampleSentenceBackendMode(m_options, m_frontend, this,m_testEntryManager, m_document->document());
83 m_mode = new GenderBackendMode(m_options, m_frontend, this, m_testEntryManager, m_document->document());
87 m_mode = new ConjugationBackendMode(m_options, m_frontend, this, m_testEntryManager, m_document->document());
91 m_mode = new ComparisonBackendMode(m_options, m_frontend, this, m_testEntryManager, m_document->document());
205 grade_t goodGrade = qMax(grade, grade_t(KV_LEV1_GRADE)); // if the word hasn't been practiced yet, use grade 1 as a base
241 kDebug() << "entry finished: " << m_frontend->resultState() << " change grades? " << m_current->changeGrades();
bool changeGrades()
check if the entry was finished and the practice backend may update the grades that will be saved to ...
Definition: testentry.cpp:86
Definition: practiceoptions.h:22
virtual void setResultState(ResultState resultState)=0
The result state indicated whether a word is counted as correct (and grades are raised) and can be ch...
int activeEntryCount()
The number of entries that are still to be practiced.
Definition: testentrymanager.cpp:139
void practiceFinished()
virtual void showQuestion()=0
enter question mode - the user is asked to provide the solution
virtual void setBoxes(grade_t currentBox, grade_t newBoxIfCorrect, grade_t newBoxIfWrong)=0
PracticeStateMachine(AbstractFrontend *frontend, ParleyDocument *doc, const PracticeOptions &options, TestEntryManager *testEntryManager, QObject *parent=0)
Definition: practicestatemachine.cpp:30
static bool flashcardsFrontImage()
Get Show images on the front of the flashcard.
Definition: prefs.h:255
virtual void checkAnswer()=0
Check if the current answer is right.
virtual void setQuestionImage(const KUrl &img)=0
Definition: testentrymanager.h:31
virtual void setLessonName(const QString &lesson)=0
Definition: parleydocument.h:29
TestEntry * getNextEntry()
Get the next entry to show to the user.
Definition: testentrymanager.cpp:188
virtual void setMode(Mode mode)=0
switch between different modes such as written, flash card, etc
void slotPracticeFinished()
Definition: practicestatemachine.cpp:126
virtual void updateGrades()
Change the grades for the current entry.
Definition: abstractbackendmode.cpp:46
void updateStatisticsRightAnswer()
update the internal statistics for this practice with a right result
Definition: testentry.cpp:64
virtual bool setTestEntry(TestEntry *current)
start practicing a new word.
Definition: abstractbackendmode.cpp:27
virtual void setFinishedWordsTotalWords(int finished, int total)=0
The status such as lesson or number of words has changed.
void updateStatisticsWrongAnswer()
update the internal statistics for this practice with a wrong result
Definition: testentry.cpp:91
void practiceFinished()
Definition: testentrymanager.cpp:128
virtual void showSolution()=0
enter show solution mode - the solution is shown
Prefs::EnumPracticeMode::type mode() const
Definition: practiceoptions.cpp:32
virtual void setFeedbackState(ResultState feedbackState)=0
The feedback state tells the user if the currently entered word is correct (independent of whether th...
void removeCurrentEntryFromPractice()
Finish the currently active entry.
Definition: testentrymanager.cpp:98
Definition: abstractfrontend.h:25
virtual grade_t currentGradeForEntry()
The grade of the current entry - this has an default implementation to return the grade for the curre...
Definition: abstractbackendmode.cpp:41
virtual void setSolutionImage(const KUrl &img)=0
void stopPractice()
static bool flashcardsBackImage()
Get Show images on the back of the flashcard.
Definition: prefs.h:274
virtual ResultState resultState()=0
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.