• 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
multiplechoicebackendmode.h
Go to the documentation of this file.
1 /***************************************************************************
2  Copyright 2009 Frederik Gladhorn <gladhorn@kde.org>
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 MULTIPLECHOICEBACKENDMODE_H
16 #define MULTIPLECHOICEBACKENDMODE_H
17 
18 #include "abstractbackendmode.h"
19 #include "practice/sessionmanagerbase.h"
20 
21 namespace Practice
22 {
23 
24 class MultipleChoiceBackendMode : public AbstractBackendMode
25 {
26  Q_OBJECT
27 
28 public:
29  MultipleChoiceBackendMode(AbstractFrontend *frontend, QObject *parent,
30  Practice::SessionManagerBase* sessionManager);
31 
33  virtual bool setTestEntry(TestEntry* current);
34 
35  virtual void checkAnswer();
36 
37 public Q_SLOTS:
38  virtual void hintAction();
39 
40 protected:
44  virtual void prepareChoices(TestEntry* current);
45 
49  void setQuestion(const QString& question);
50 
54  void setChoices(const QStringList& choices);
55 
59  void setCorrectAnswer(int index);
60 
61  int numberOfChoices();
62 
66  virtual void populateFrontEnd();
67 
68 private:
69  SessionManagerBase* m_sessionManager;
70  KRandomSequence m_randomSequence;
71  QString m_question;
72  int m_numberOfChoices;
73  QStringList m_choices;
74  int m_correctAnswer;
75  QList<int> m_hints;
76 };
77 
78 }
79 
80 #endif
Practice::MultipleChoiceBackendMode::setCorrectAnswer
void setCorrectAnswer(int index)
The correct solution, index of the choices.
Definition: multiplechoicebackendmode.cpp:90
Practice::MultipleChoiceBackendMode::setChoices
void setChoices(const QStringList &choices)
This must include the correct answer.
Definition: multiplechoicebackendmode.cpp:85
Practice::MultipleChoiceBackendMode::populateFrontEnd
virtual void populateFrontEnd()
Configure the multiple choice front end.
Definition: multiplechoicebackendmode.cpp:58
Practice::MultipleChoiceBackendMode::hintAction
virtual void hintAction()
Definition: multiplechoicebackendmode.cpp:108
Practice::MultipleChoiceBackendMode::numberOfChoices
int numberOfChoices()
Definition: multiplechoicebackendmode.cpp:80
Practice::MultipleChoiceBackendMode::MultipleChoiceBackendMode
MultipleChoiceBackendMode(AbstractFrontend *frontend, QObject *parent, Practice::SessionManagerBase *sessionManager)
Definition: multiplechoicebackendmode.cpp:22
QObject
abstractbackendmode.h
Practice::MultipleChoiceBackendMode
Definition: multiplechoicebackendmode.h:24
QString
QList< int >
QStringList
Practice::MultipleChoiceBackendMode::checkAnswer
virtual void checkAnswer()
Check if the current answer is right.
Definition: multiplechoicebackendmode.cpp:96
Practice::AbstractBackendMode
Definition: abstractbackendmode.h:26
Practice::AbstractFrontend
Definition: abstractfrontend.h:26
Practice::MultipleChoiceBackendMode::setTestEntry
virtual bool setTestEntry(TestEntry *current)
Start practicing a new word.
Definition: multiplechoicebackendmode.cpp:31
sessionmanagerbase.h
Practice::SessionManagerBase
Definition: sessionmanagerbase.h:40
QObject::parent
QObject * parent() const
Practice::MultipleChoiceBackendMode::setQuestion
void setQuestion(const QString &question)
Set the question/original language.
Definition: multiplechoicebackendmode.cpp:75
Practice::MultipleChoiceBackendMode::prepareChoices
virtual void prepareChoices(TestEntry *current)
set the list of possible answers.
Definition: multiplechoicebackendmode.cpp:43
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