#ifndef SESSION_H
#define SESSION_H

#include <QString>
#include <QObject>
#include <QList>
#include <QDateTime>
#include <QColor>

#include "student.h"

class LogEntry
{
public:
    LogEntry();
    LogEntry(int, int, int, int, int, int, QString);
    QColor entryBackgroundColour(); QColor entryForegroundColour();
    QString entryText(); QString entryData();
    int bgRed(); int bgGreen(); int bgBlue();
    int fgRed(); int fgGreen(); int fgBlue();

private:
    int le_bgr; int le_bgg; int le_bgb;
    int le_fgr; int le_fgg; int le_fgb;
    QString le_text;
};

class Session : public QObject
{
    Q_OBJECT

public:
    Session();
    virtual ~Session();

public slots:
    void setName(QString); QString name();
    void setDateTimeFromString(QString); void setDateTime(QDateTime);
    QString dateTimeToString(); QDateTime dateTime();
    void addLogEntry(int, int, int, int, int, int, QString);
    int numLogEntries(); LogEntry logEntry(int); void deleteLog();
    void addStudent(Student *); int numStudents(); Student * student(int);
    uint numQuestions(); uint numCorrect();
    void setPassMark(int); int passMark();
    QString sessionData();

private:
    QString s_name;
    QDateTime s_datetime;
    uint s_qnum;
    uint s_cqnum;
    QList<LogEntry> s_log;
    QList<Student *> s_students;
    int s_passmark;
};

#endif // SESSION_H