#pragma once

#include <string>
#include <vector>

#include "lexer.h"
#include "result.h"


struct Question {
    double      Cooldown;
    std::string QuestionText;
    std::string Section;

    virtual std::string ToString() const = 0;
    virtual ~Question()                  = default;
};

struct Choice {
    std::string Answer;
    bool        IsCorrect;
};

enum MultiElementType {
	Regular     = 0,
	MultiChoice,
	Order
};

struct MultiElementQuestion : public Question {
    std::vector<Choice>  Choices;
	MultiElementType     type;

    std::string          ToString() const override;
};

struct Group {
    std::string              name;
	std::vector<std::string> elements;
};

struct GroupQuestion : public Question {
	std::vector<Group> Groups;
	
    std::string        ToString() const override;
};

struct ParseInfo {
	std::vector<Question*> questions;
	time_t                 lastTrainedAt;
};

Result<ParseInfo> parseQuestions(const std::vector<Token>& tokens);
