File indexing completed on 2024-04-14 03:49:09

0001 /*
0002     SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@kde.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef GENDERBACKENDMODE_H
0007 #define GENDERBACKENDMODE_H
0008 
0009 #include "multiplechoicebackendmode.h"
0010 #include "practice/sessionmanagerbase.h"
0011 
0012 namespace Practice
0013 {
0014 class GenderBackendMode : public MultipleChoiceBackendMode
0015 {
0016     Q_OBJECT
0017 
0018 public:
0019     GenderBackendMode(AbstractFrontend *frontend, QObject *parent, Practice::SessionManagerBase *sessionManager, KEduVocDocument *doc);
0020 
0021     /** Start practicing a new word */
0022     bool setTestEntry(TestEntry *current) override;
0023 
0024     grade_t currentPreGradeForEntry() const override;
0025     grade_t currentGradeForEntry() const override;
0026 
0027 protected:
0028     void prepareChoices(TestEntry *current) override;
0029     void updateGrades() override;
0030 
0031 private:
0032     /** Reference to the kvocdoc */
0033     const KEduVocDocument &m_doc;
0034     KEduVocArticle m_articles;
0035     QString m_masculine;
0036     QString m_feminine;
0037     QString m_neuter;
0038     bool m_neuterExists;
0039 };
0040 
0041 }
0042 
0043 #endif