Logo Search packages:      
Sourcecode: parley version File versions  Download package

Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

AnswerValidatorOld Class Reference

#include <answervalidatorold.h>

Collaboration diagram for AnswerValidatorOld:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AnswerValidatorOld (KEduVocDocument *doc)
void checkUserAnswer (const QString &solution, const QString &userAnswer, const QString &language=QString())
void checkUserAnswer (const QString &userAnswer)
void setLanguage (int translation)
void setTestEntry (TestEntry *entry)
bool spellcheckerAvailable ()

Private Member Functions

QList< QPair< QString, QString > > bestPairs (const QStringList &solutionWords, const QStringList &userAnswerWords)
void defaultCorrector ()
int levenshteinDistance (const QString &s, const QString &t)
void sentenceAnalysis ()
void simpleCorrector ()
bool spellcheckerInSuggestionList (const QString &solution, const QString &userAnswer)
bool spellcheckerMisspelled (const QString &s)
void wordCompare (const QString &solution, const QString &userWord, double &grade, TestEntry::ErrorTypes &errorTypes)

Private Attributes

QByteArray m_d
 field used by the LevenshteinDistance to store temp data
KEduVocDocument * m_doc
 document for language and articles
TestEntrym_entry
 the entry to be checked, this provides meta info like word type etc
QString m_solution
 the solution - usually text of the translation
Sonnet::Speller * m_speller
 spellchecker
bool m_spellerAvailable
int m_translation
QString m_userAnswer
 the answer provided by the user

Static Private Attributes

static const double ACCENT_MISTAKE_PUNISHMENT = 0.1
static const double CAPITALIZATION_MISTAKE_PUNISHMENT = 0.1
static const double FALSE_FRIEND_GRADE = 0.0
static const double LEVENSHTEIN_THRESHOLD = 0.2
static const double SPELLING_MISTAKE_PER_LETTER_PUNISHMENT = 0.2
static const double UNRELATED_WORD_GRADE = 0.0
static const double WRONG_ARTICLE_PUNISHMENT = 0.1

Detailed Description

Provides different comparison methods to determine the quality of the answer.

Author:
Frederik Gladhorn <frederik.gladhorn@kdemail.net>

Definition at line 31 of file answervalidatorold.h.


The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index