#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);
