parley
multiplechoicebackendmode.cpp
Go to the documentation of this file.
22 MultipleChoiceBackendMode::MultipleChoiceBackendMode(AbstractFrontend* frontend, QObject* parent,
54 m_choices.insert(correctAnswer, m_current->entry()->translation(m_current->languageTo())->text());
66 m_frontend->setQuestionSound(m_current->entry()->translation(m_current->languageFrom())->soundUrl());
67 m_frontend->setSolutionSound(m_current->entry()->translation(m_current->languageTo())->soundUrl());
68 m_frontend->setQuestionPronunciation(m_current->entry()->translation(m_current->languageFrom())->pronunciation());
69 m_frontend->setSolutionPronunciation(m_current->entry()->translation(m_current->languageTo())->pronunciation());
void setCorrectAnswer(int index)
The correct solution, index of the choices.
Definition: multiplechoicebackendmode.cpp:90
void clear()
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...
virtual void setQuestion(const QVariant &question)=0
virtual void setHint(const QVariant &hint)=0
virtual void showQuestion()=0
enter question mode - the user is asked to provide the solution
void answerRight()
void setChoices(const QStringList &choices)
This must include the correct answer.
Definition: multiplechoicebackendmode.cpp:85
virtual void populateFrontEnd()
Configure the multiple choice front end.
Definition: multiplechoicebackendmode.cpp:58
const T & at(int i) const
virtual void hintAction()
Definition: multiplechoicebackendmode.cpp:108
static int numberMultipleChoiceAnswers()
Get How many answers are provided for a multiple choice question, including the correct answer...
Definition: prefs.h:811
virtual void setSolution(const QVariant &solution)=0
int numberOfChoices()
Definition: multiplechoicebackendmode.cpp:80
void clear()
MultipleChoiceBackendMode(AbstractFrontend *frontend, QObject *parent, Practice::SessionManagerBase *sessionManager)
Definition: multiplechoicebackendmode.cpp:22
AbstractFrontend * m_frontend
Definition: abstractbackendmode.h:121
int count(const T &value) const
void append(const T &value)
int toInt(bool *ok) const
bool isNull() const
virtual QVariant userInput()=0
Enables access to the input of the user.
virtual void setQuestionPronunciation(const QString &pronunciationText)=0
virtual void setFeedback(const QVariant &feedback)=0
bool contains(const T &value) const
virtual void checkAnswer()
Check if the current answer is right.
Definition: multiplechoicebackendmode.cpp:96
void answerWrongShowSolution()
virtual void setSolutionSound(const KUrl &soundUrl)=0
void insert(int i, const T &value)
Definition: abstractfrontend.h:26
virtual bool setTestEntry(TestEntry *current)
Start practicing a new word.
Definition: multiplechoicebackendmode.cpp:31
QStringList multipleChoiceAnswers(int numberChoices)
Definition: sessionmanagerbase.cpp:245
virtual void setQuestionSound(const KUrl &soundUrl)=0
void setQuestion(const QString &question)
Set the question/original language.
Definition: multiplechoicebackendmode.cpp:75
virtual void setSolutionPronunciation(const QString &pronunciationText)=0
virtual void prepareChoices(TestEntry *current)
set the list of possible answers.
Definition: multiplechoicebackendmode.cpp:43
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
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.