package com.ssj.service.kmt.dto;

import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.*;

public class StudentHomeworkDto implements Serializable {
    private static final long serialVersionUID = 1L;

    private String vipId;
    private String name;
    private String grade;
    private int version;
    private int feedbackCount = 0;
    private int homeworkPictureCount;
    private int unSelectedHomeworkPictureCount;
    private String homeworkId;
    private List<HomeworkPictureDto> homeworkPictureList;
    /**
     * 1补拍, 11有改动
     */
    private int type;

    private int semester;


    public StudentHomeworkDto () {
        homeworkPictureList = new ArrayList<HomeworkPictureDto>();
    }

    public String getVipId() {
        return vipId;
    }

    public void setVipId(String vipId) {
        this.vipId = vipId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    public int getFeedbackCount() {
        return feedbackCount;
    }

    public void setFeedbackCount(int feedbackCount) {
        this.feedbackCount = feedbackCount;
    }

    public int getHomeworkPictureCount() {
        return homeworkPictureCount;
    }

    public void setHomeworkPictureCount(int homeworkPictureCount) {
        this.homeworkPictureCount = homeworkPictureCount;
    }

    public List<HomeworkPictureDto> getHomeworkPictureList() {
        return homeworkPictureList;
    }

    public void setHomeworkPictureList(List<HomeworkPictureDto> homeworkPictureList) {
        this.homeworkPictureList = homeworkPictureList;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public void addProblem (HomeworkPictureDto p, Date correctTime) {
        if (p.getIsFeedback() == 1){
            this.feedbackCount++;
        }
        if (p.getIsCheckIn() == 0){
            this.homeworkPictureCount++;
        }
        //已批改完又有未批改作业的， 补拍状态
        if (p.getType() == 5){
            this.type = 1;
        }
        if (p.getType() == 4){
            this.unSelectedHomeworkPictureCount++;
        }
        if (p.getType() == 11){
            this.type = 11;
        }
        homeworkPictureList.add(p);
    }

    public int getSemester() {
        return semester;
    }

    public void setSemester(int semester) {
        this.semester = semester;
    }

    public String getHomeworkId() {
        return homeworkId;
    }

    public void setHomeworkId(String homeworkId) {
        this.homeworkId = homeworkId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getUnSelectedHomeworkPictureCount() {
        return unSelectedHomeworkPictureCount;
    }

    public void setUnSelectedHomeworkPictureCount(int unSelectedHomeworkPictureCount) {
        this.unSelectedHomeworkPictureCount = unSelectedHomeworkPictureCount;
    }

}
