diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
commit | d24f813f3f2a05c112e803e4256b53535895fc98 (patch) | |
tree | 601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /src/study/StudyRecord.h |
Diffstat (limited to 'src/study/StudyRecord.h')
-rw-r--r-- | src/study/StudyRecord.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/study/StudyRecord.h b/src/study/StudyRecord.h new file mode 100644 index 0000000..abe7ef9 --- /dev/null +++ b/src/study/StudyRecord.h @@ -0,0 +1,62 @@ +#ifndef STUDYRECORD_H +#define STUDYRECORD_H + +#include <iostream> +#include <QDateTime> + +using std::ostream; + +class ScheduleParams; + +struct StudyRecord +{ +public: + static const int MaxAnswerTime = 180; // sec + enum Level + { + New = 1, + ShortLearning = 2, + LongLearning = 3, + Repeating = 10 + }; + enum Grade + { + Unknown = 1, + Incorrect = 2, + Difficult = 3, + Good = 4, + Easy = 5, + GradesNum = 5 + }; + +public: + StudyRecord(); + StudyRecord(int level, int grade, double easiness, double interval); + + bool timeTriggered() const; + int getSecsToNextRepetition() const; + bool isOneDayOld() const; + bool isLearning() const; + int getScheduledTodayReviews() const; + bool isReviewedToday() const; + bool isActivatedToday() const; + bool operator==( const StudyRecord& aOther ) const; + void setRecallTime(double time); + void setAnswerTime(double time); + +private: + static QDateTime shiftedDate(const QDateTime& aDate); + +public: + QDateTime date; + int level; + double interval; // days + int grade; + double easiness; + double recallTime; // sec + double answerTime; // Full answer time: recall + grading +}; + +ostream& operator<<(ostream& os, const StudyRecord& study); + +#endif |