• 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
  • collection
testentry.h
Go to the documentation of this file.
1 /***************************************************************************
2  Copyright 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
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 
15 #ifndef TESTENTRY_H
16 #define TESTENTRY_H
17 
18 #include <QFlags>
19 
20 #include <keduvocexpression.h>
21 
22 class TestEntry
23 {
24 public:
25  enum ErrorType {
26  SpellingMistake = 0x01,
27  CapitalizationMistake = 0x02,
28  AccentMistake = 0x04,
29  ArticleWrong = 0x08,
30  ArticleMissing = 0x10,
31  FalseFriend = 0x20,
32  Synonym = 0x40,
33  Empty = 0x80,
34  UnrelatedWord = 0x100,
35  Incomplete = 0x200,
36  Correct = 0x400,
37  Wrong = 0x800
38  };
39 
40  Q_DECLARE_FLAGS(ErrorTypes, ErrorType)
41 
42  TestEntry(KEduVocExpression *entry);
43 
45  void updateStatisticsRightAnswer(grade_t currentPreGrade, grade_t currentGrade);
46 
48  void updateStatisticsWrongAnswer(grade_t currentPreGrade, grade_t currentGrade);
49 
55  bool shouldChangeGrades();
56 
57  int answeredCorrectInSequence();
58  int statisticCount();
59  int statisticGoodCount();
60  int statisticBadCount();
61  bool correctAtFirstAttempt();
62  bool isUnseenQuestion() const;
63 
67  QString conjugationTense() const;
68  void setConjugationTense(const QString& tense);
69 
73  QList<KEduVocWordFlags> conjugationPronouns() const;
74  void setConjugationPronouns(const QList<KEduVocWordFlags>& flags);
75 
76  void setLastErrors(ErrorTypes errorTypes);
77  ErrorTypes lastErrors();
78 
79  void setLastPercentage(double percent);
80  double lastPercentage();
81 
82  void addUserAnswer(const QString& answer) {
83  if (!answer.isEmpty()) m_userAnswers.append(answer);
84  }
85  QStringList userAnswers() {
86  return m_userAnswers;
87  }
88 
89  void setLanguageFrom(int from);
90  void setLanguageTo(int to);
91  int languageFrom() const;
92  int languageTo() const;
93 
94  KEduVocExpression *entry() const;
95 
96 private:
98  KEduVocExpression *m_entry;
99 
100  int m_languageFrom; // Index of the language this entry is from
101  int m_languageTo; // Index of the language this entry is from
102 
103  // These are for the current entry only, so that we can display
104  // statistics about it after the training session is finished..
105  int m_statisticCount;
106  int m_statisticGoodCount;
107  int m_statisticBadCount;
108  int m_answeredCorrectInSequence;
109  bool m_correctAtFirstAttempt;
110  bool m_shouldChangeGrades; // Set to true when grades should be changed after the practice
111  bool m_isUnseenQuestion; // Is set to true for questions never seen before.
112 
113  double m_lastPercentage;
114  ErrorTypes m_lastError;
115 
116  QStringList m_userAnswers;
117 
119  QString m_conjugationTense;
121  QList<KEduVocWordFlags> m_conjugationPronouns;
122 };
123 
124 Q_DECLARE_OPERATORS_FOR_FLAGS(TestEntry::ErrorTypes)
125 
126 #endif
TestEntry::ArticleMissing
< solution is correct with the article interchanged
Definition: testentry.h:30
TestEntry::SpellingMistake
Definition: testentry.h:26
TestEntry::statisticCount
int statisticCount()
Definition: testentry.cpp:49
TestEntry::entry
KEduVocExpression * entry() const
Definition: testentry.cpp:149
TestEntry::setLanguageFrom
void setLanguageFrom(int from)
Definition: testentry.cpp:34
TestEntry::answeredCorrectInSequence
int answeredCorrectInSequence()
Definition: testentry.cpp:44
TestEntry::lastPercentage
double lastPercentage()
Definition: testentry.cpp:144
TestEntry::ArticleWrong
< an accent is missing or wrong (é)
Definition: testentry.h:29
TestEntry::Wrong
< no error, solution was right
Definition: testentry.h:37
TestEntry::updateStatisticsRightAnswer
void updateStatisticsRightAnswer(grade_t currentPreGrade, grade_t currentGrade)
update the internal statistics for this practice with a right result
Definition: testentry.cpp:64
TestEntry::FalseFriend
< solution is correct with the article missing
Definition: testentry.h:31
TestEntry::Empty
< a synonym (may be correct)
Definition: testentry.h:33
TestEntry::setLanguageTo
void setLanguageTo(int to)
Definition: testentry.cpp:39
TestEntry::ErrorType
ErrorType
Definition: testentry.h:25
TestEntry::Synonym
< a false friend
Definition: testentry.h:32
TestEntry::lastErrors
ErrorTypes lastErrors()
Definition: testentry.cpp:134
TestEntry::statisticGoodCount
int statisticGoodCount()
Definition: testentry.cpp:59
TestEntry::conjugationTense
QString conjugationTense() const
In conjugation mode, use this tense for the entry.
Definition: testentry.cpp:154
TestEntry::setConjugationTense
void setConjugationTense(const QString &tense)
Definition: testentry.cpp:159
TestEntry::AccentMistake
< capitalization error (whAt)
Definition: testentry.h:28
QList::append
void append(const T &value)
TestEntry::Correct
< the part that was entered is right, but not complete
Definition: testentry.h:36
TestEntry::setLastPercentage
void setLastPercentage(double percent)
Definition: testentry.cpp:139
TestEntry::UnrelatedWord
< empty answer string
Definition: testentry.h:34
TestEntry::updateStatisticsWrongAnswer
void updateStatisticsWrongAnswer(grade_t currentPreGrade, grade_t currentGrade)
update the internal statistics for this practice with a wrong result
Definition: testentry.cpp:96
TestEntry::conjugationPronouns
QList< KEduVocWordFlags > conjugationPronouns() const
In conjugation mode, use these pronouns for the entry.
Definition: testentry.cpp:164
QString
QList
TestEntry::userAnswers
QStringList userAnswers()
Definition: testentry.h:85
QStringList
TestEntry::setLastErrors
void setLastErrors(ErrorTypes errorTypes)
Definition: testentry.cpp:129
TestEntry::setConjugationPronouns
void setConjugationPronouns(const QList< KEduVocWordFlags > &flags)
Definition: testentry.cpp:169
TestEntry::statisticBadCount
int statisticBadCount()
Definition: testentry.cpp:54
TestEntry::languageFrom
int languageFrom() const
Definition: testentry.cpp:109
TestEntry::Incomplete
< a valid word but no connection to the solution
Definition: testentry.h:35
TestEntry::addUserAnswer
void addUserAnswer(const QString &answer)
Definition: testentry.h:82
TestEntry::CapitalizationMistake
< misspelled
Definition: testentry.h:27
TestEntry::correctAtFirstAttempt
bool correctAtFirstAttempt()
Definition: testentry.cpp:124
TestEntry::languageTo
int languageTo() const
Definition: testentry.cpp:114
TestEntry::shouldChangeGrades
bool shouldChangeGrades()
check if the entry was finished and the practice backend may update the grades that will be saved to ...
Definition: testentry.cpp:91
TestEntry::isUnseenQuestion
bool isUnseenQuestion() const
Definition: testentry.cpp:119
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