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

parley

  • sources
  • kde-4.12
  • kdeedu
  • parley
  • src
  • practice
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 = 0x1,
27  CapitalizationMistake = 0x2,
28  AccentMistake = 0x4,
29  ArticleWrong = 0x8,
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();
46 
48  void updateStatisticsWrongAnswer();
49 
55  bool changeGrades();
56 
57  int answeredCorrectInSequence();
58  int statisticCount();
59  int statisticGoodCount();
60  int statisticBadCount();
61  bool correctAtFirstAttempt();
62 
66  QString conjugationTense() const;
67  void setConjugationTense(const QString& tense);
68 
72  QList<KEduVocWordFlags> conjugationPronouns() const;
73  void setConjugationPronouns(const QList<KEduVocWordFlags>& flags);
74 
75  void setLastErrors(ErrorTypes errorTypes);
76  ErrorTypes lastErrors();
77 
78  void setLastPercentage(double percent);
79  double lastPercentage();
80 
81  void addUserAnswer(const QString& answer) { if (!answer.isEmpty()) m_userAnswers.append(answer); }
82  QStringList userAnswers() { return m_userAnswers; }
83 
84  static void setGradeFrom(int from);
85  static void setGradeTo(int to);
86  static int gradeFrom();
87  static int gradeTo();
88 
89  KEduVocExpression *entry();
90 
91 private:
93  KEduVocExpression *m_entry;
94 
96  QString m_conjugationTense;
98  QList<KEduVocWordFlags> m_conjugationPronouns;
99 
100  // these are for the CURRENT query only, so we can display statistics.
101  int m_statisticCount;
102  int m_statisticGoodCount;
103  int m_statisticBadCount;
104  int m_answeredCorrectInSequence;
105  bool m_correctAtFirstAttempt;
106  bool m_practiceFinished;
107  bool m_changeGrades;
108 
109  double m_lastPercentage;
110  ErrorTypes m_lastError;
111 
112  QStringList m_userAnswers;
113 
114  static int m_gradeTo;
115  static int m_gradeFrom;
116 };
117 
118 Q_DECLARE_OPERATORS_FOR_FLAGS(TestEntry::ErrorTypes)
119 
120 #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::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
TestEntry::answeredCorrectInSequence
int answeredCorrectInSequence()
Definition: testentry.cpp:44
TestEntry::lastPercentage
double lastPercentage()
Definition: testentry.cpp:129
TestEntry::ArticleWrong
< an accent is missing or wrong (é)
Definition: testentry.h:29
TestEntry::Wrong
< no error, solution was right
Definition: testentry.h:37
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::ErrorType
ErrorType
Definition: testentry.h:25
TestEntry::Synonym
< a false friend
Definition: testentry.h:32
TestEntry::gradeFrom
static int gradeFrom()
Definition: testentry.cpp:99
TestEntry::lastErrors
ErrorTypes lastErrors()
Definition: testentry.cpp:119
TestEntry::setGradeTo
static void setGradeTo(int to)
Definition: testentry.cpp:34
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:139
TestEntry::setConjugationTense
void setConjugationTense(const QString &tense)
Definition: testentry.cpp:144
TestEntry::AccentMistake
< capitalization error (whAt)
Definition: testentry.h:28
TestEntry::gradeTo
static int gradeTo()
Definition: testentry.cpp:104
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:124
TestEntry::UnrelatedWord
< empty answer string
Definition: testentry.h:34
TestEntry::conjugationPronouns
QList< KEduVocWordFlags > conjugationPronouns() const
In conjugation mode, use these pronouns for the entry.
Definition: testentry.cpp:149
TestEntry::userAnswers
QStringList userAnswers()
Definition: testentry.h:82
TestEntry::updateStatisticsRightAnswer
void updateStatisticsRightAnswer()
update the internal statistics for this practice with a right result
Definition: testentry.cpp:64
TestEntry::setLastErrors
void setLastErrors(ErrorTypes errorTypes)
Definition: testentry.cpp:114
TestEntry::updateStatisticsWrongAnswer
void updateStatisticsWrongAnswer()
update the internal statistics for this practice with a wrong result
Definition: testentry.cpp:91
TestEntry::setConjugationPronouns
void setConjugationPronouns(const QList< KEduVocWordFlags > &flags)
Definition: testentry.cpp:154
TestEntry::statisticBadCount
int statisticBadCount()
Definition: testentry.cpp:54
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:81
TestEntry::CapitalizationMistake
< misspelled
Definition: testentry.h:27
TestEntry::correctAtFirstAttempt
bool correctAtFirstAttempt()
Definition: testentry.cpp:109
TestEntry::setGradeFrom
static void setGradeFrom(int from)
Definition: testentry.cpp:39
TestEntry::entry
KEduVocExpression * entry()
Definition: testentry.cpp:134
TestEntry
Definition: testentry.h:22
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

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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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