#ifndef PAPERDEF_H
#define PAPERDEF_H

#include <string>
#include <vector>
#include "json/json.h"

#include <QString>

extern int g_ItemOrderIndex;

QString Arab2Sinogram(int num);

enum STRUCT_TYPE
{
    stSingleChoice = 1,  //单选
    stMultiChoice,       //多选
    stJudge,            //判断
    stFillBlank,        //填空
    stQuestionAndAnswer,   //问答
    stSubjectSet,       //套题
};

struct SUBQUESTION_INFO
{
    std::string sId;
    int nOrderIndex;
    int nDetailNumber;
    int nQuestionNumber;
    int nNumber;
    double fScore;
    int nStructType;
    bool bObjective;
    Json::Value jBody;
    std::string sOptionOrders;
    Json::Value jOptions;
    Json::Value jStandarddAnswer;
    QString sAnswer;
    int nAnswerDuration;
    SUBQUESTION_INFO()
    {
        sId = "";
        nOrderIndex = 0;
        nDetailNumber = 0;
        nQuestionNumber = 0;
        nNumber = 0;
        fScore = 0;
        nStructType = 0;
        bObjective = false;
        jBody = Json::Value::null;
        sOptionOrders = "";
        jOptions = Json::Value::null;
        jStandarddAnswer = Json::Value::null;
        sAnswer = "";
        nAnswerDuration = 0;
    }
};

struct QUESTION_INFO
{
    std::string sId;
    int nOrderIndex;
    int nDetailNumber;
    int nNumber;
    double fScore;
    int nStructType;
    bool bObjective;
    Json::Value jBody;
    std::string sOptionOrders;
    Json::Value jOptions;
    Json::Value jStandarddAnswer;
    QString sAnswer;
    int nAnswerDuration;
    std::vector<SUBQUESTION_INFO> vSubQuestions;
    QUESTION_INFO()
    {
        sId = "";        
        nOrderIndex = 0;
        nDetailNumber = 0;
        nNumber = 0;
        fScore = 0;
        nStructType = 0;
        bObjective = false;
        jBody = Json::Value::null;
        sOptionOrders = "";
        jOptions = Json::Value::null;
        jStandarddAnswer = Json::Value::null;
        sAnswer = "";
        nAnswerDuration = 0;
        vSubQuestions.clear();
    }
};

enum QUESTION_SHOW_LEVEL
{
    qslShowQuestion = 2,
    qslShowSubQuestion,
};

struct QUESTION_SHOW_INFO
{
    int nLevel; //2 3
    int nDettailNumber;
    int nStartIndex;
    std::string sDetailName;
    QUESTION_INFO vQi;
    SUBQUESTION_INFO vSQI;
//    boost::variant<QUESTION_INFO, SUBQUESTION_INFO> vItem;
    QUESTION_SHOW_INFO()
    {
        nDettailNumber = 0;
        nLevel = 0;
        sDetailName = "";
    }
};

struct DEATIL_INFO
{
    int nNumber;
    std::string sName;
    double fTotalScore;
    int nQueStionCount;
    std::vector<QUESTION_INFO> vQuestions;
    DEATIL_INFO()
    {
        nNumber = 0;
        sName = "";
        fTotalScore = 0;
        nQueStionCount = 0;
        vQuestions.clear();
    }
};

struct PAPER_INFO
{
    std::string sId;
    std::string sName;
    std::string sCourseCode;
    std::string sCourseName;
    double fTotalScore;
    int nHasVideo;
    int nDetailCount;
    std::vector<DEATIL_INFO> vDetails;
    PAPER_INFO()
    {
        sId = "";
        sName = "";
        sCourseCode = "";
        sCourseName = "";
        fTotalScore = 0;
        nHasVideo = 0;
        nDetailCount = 0;
        vDetails.clear();
    }
};




#endif // PAPERDEF_H
