#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