• 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
writtenpracticevalidator.h
Go to the documentation of this file.
1 /***************************************************************************
2  Copyright 2010 Benjamin Schleinzer <ben-kde@schleinzer.eu>
3  Copyright 2007-2010 Frederik Gladhorn <gladhorn@kde.org>
4 ***************************************************************************/
5 
6 /***************************************************************************
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 ***************************************************************************/
14 
15 #ifndef WRITTENPRACTICEVALIDATOR_H
16 #define WRITTENPRACTICEVALIDATOR_H
17 
18 #include <sonnet/speller.h>
19 
20 #include "parleydocument.h"
21 
22 #include "testentry.h"
23 
24 
25 namespace Practice
26 {
27 
28 class WrittenPracticeValidator
29 {
30 
31 public:
32 
33  WrittenPracticeValidator(int translation, KEduVocDocument* doc);
34  ~WrittenPracticeValidator();
35 
36  void setEntry(TestEntry* entry);
37  void validateAnswer(const QString& answer);
38  bool spellcheckerAvailable();
39  QString getCorrectedAnswer();
40 
41 private:
42 
43  void setLanguage(int translation);
44 
46  bool isCorrect(const QString& correct, const QString& answer);
47 
51  bool isSynonymMistake(const QString& answer);
52 
54  bool isCapitalizationMistake(const QString& original, const QString& answer);
55 
58  bool isAccentMistake(const QString& original, const QString& answer);
59 
60  TestEntry* m_entry;
61  KEduVocDocument* m_doc;
62  QString m_correctedAnswer;
63  int m_translation;
64  TestEntry::ErrorTypes m_error;
65 
67  Sonnet::Speller* m_speller;
68  bool m_spellerAvailable;
69 };
70 
71 }
72 
73 #endif // WRITTENPRACTICEVALIDATOR_H
Practice::WrittenPracticeValidator::spellcheckerAvailable
bool spellcheckerAvailable()
Definition: writtenpracticevalidator.cpp:89
Practice::WrittenPracticeValidator::~WrittenPracticeValidator
~WrittenPracticeValidator()
Definition: writtenpracticevalidator.cpp:51
testentry.h
parleydocument.h
QString
Practice::WrittenPracticeValidator::WrittenPracticeValidator
WrittenPracticeValidator(int translation, KEduVocDocument *doc)
Definition: writtenpracticevalidator.cpp:41
Practice::WrittenPracticeValidator
Definition: writtenpracticevalidator.h:28
Practice::WrittenPracticeValidator::validateAnswer
void validateAnswer(const QString &answer)
Definition: writtenpracticevalidator.cpp:94
Practice::WrittenPracticeValidator::getCorrectedAnswer
QString getCorrectedAnswer()
Definition: writtenpracticevalidator.cpp:132
Practice::WrittenPracticeValidator::setEntry
void setEntry(TestEntry *entry)
Definition: writtenpracticevalidator.cpp:56
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