package com.dlc.exam.ui.learn;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * info
 *
 * @author ReiChin_
 */
public class LearnChapterBean implements Parcelable {

    public String chapterId; // 章节id
    public String courseId; // 课程id

    public String type; // 0 为目录 其他类型同课件类型 文件类型 1 文档，2 视频，3 图片，4 音频，5 富文本
    public String chapterData; // 资源地址或上传的地址
    public long duration; // 课件时长
    public String title; // 标题
    public boolean assessStatus; // 是否需要课后考核

    public LearnChapterBean() {
    }

    protected LearnChapterBean(Parcel in) {
        chapterId = in.readString();
        courseId = in.readString();
        type = in.readString();
        chapterData = in.readString();
        duration = in.readLong();
        title = in.readString();
        assessStatus = in.readByte() != 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(chapterId);
        dest.writeString(courseId);
        dest.writeString(type);
        dest.writeString(chapterData);
        dest.writeLong(duration);
        dest.writeString(title);
        dest.writeByte((byte) (assessStatus ? 1 : 0));
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<LearnChapterBean> CREATOR = new Creator<LearnChapterBean>() {
        @Override
        public LearnChapterBean createFromParcel(Parcel in) {
            return new LearnChapterBean(in);
        }

        @Override
        public LearnChapterBean[] newArray(int size) {
            return new LearnChapterBean[size];
        }
    };
}
