package com.yidianling.im.session.extension;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yidianling.im.session.viewholder.bean.QuestionItemBean;

import java.util.ArrayList;

public class CustomAttachLingxiAnswerQuestion extends CustomAttachment{
    private final String ANSWERS = "answers";//试卷id


    public ArrayList<QuestionItemBean> answers;

    public CustomAttachLingxiAnswerQuestion() {
        super(CustomAttachmentType.TYPE_LINGXI_ANSWER_QUESTION);
    }
    @Override
    protected void parseData(JSONObject data) {
        this.answers=(ArrayList<QuestionItemBean>) JSON.parseArray(data.getString(ANSWERS), QuestionItemBean.class);
    }

    @Override
    protected JSONObject packData() {
        JSONObject data = new JSONObject();
        data.put(ANSWERS, answers);
        return data;
    }
}
