From d24f813f3f2a05c112e803e4256b53535895fc98 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 14 Jul 2021 11:49:10 +1200 Subject: Initial mirror commit --- src/study/StudyRecord.h | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/study/StudyRecord.h (limited to 'src/study/StudyRecord.h') 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 +#include + +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 -- cgit