package hr.fer.zemris.ffr.desktop.formCreator.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class PMProject implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	private String courseName;
	private String courseISVU;
	private String academicYear;
	private String semester;
	private String assessmentName;
	private Date date;
	private long studentScheduleVersion;
	private int answersCount;
	private String[] problemLabels;
	private String[] groupLabels;
	private String errorColumn;
	
	private List<PMStudent> students = new ArrayList<PMStudent>();
	private List<PMRoom> rooms = new ArrayList<PMRoom>();
	private Map<PMRoom,List<PMStudent>> studentSchedule = new LinkedHashMap<PMRoom, List<PMStudent>>();

	public String getErrorColumn() {
		if(errorColumn==null) return "";
		return errorColumn;
	}
	
	public void setErrorColumn(String errorColumn) {
		if(errorColumn!=null && errorColumn.trim().isEmpty()) {
			errorColumn = null;
		}
		if(errorColumn==null) {
			this.errorColumn = null;
		} else {
			this.errorColumn = errorColumn.trim();
		}
	}
	
	public String[] getGroupLabels() {
		return groupLabels;
	}
	
	public void setGroupLabels(String[] groupLabels) {
		this.groupLabels = groupLabels;
	}
	
	public String[] getProblemLabels() {
		return problemLabels;
	}
	
	public void setProblemLabels(String[] problemLabels) {
		this.problemLabels = problemLabels;
	}
	
	public int getAnswersCount() {
		return answersCount;
	}
	
	public void setAnswersCount(int answersCount) {
		this.answersCount = answersCount;
	}
	
	public void incrementStudentScheduleVersion() {
		studentScheduleVersion++;
	}
	
	public long getStudentScheduleVersion() {
		return studentScheduleVersion;
	}
	
	public List<PMStudent> getStudents() {
		return students;
	}
	
	public void setStudents(List<PMStudent> students) {
		this.students = students;
	}
	
	public Date getDate() {
		return date;
	}
	
	public void setDate(Date date) {
		this.date = date;
	}
	
	public String getAssessmentName() {
		return assessmentName;
	}
	
	public void setAssessmentName(String assessmentName) {
		this.assessmentName = assessmentName;
	}
	
	public String getCourseName() {
		return courseName;
	}
	
	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}
	
	public List<PMRoom> getRooms() {
		return rooms;
	}
	
	public void setRooms(List<PMRoom> rooms) {
		this.rooms = rooms;
	}
	
	public Map<PMRoom, List<PMStudent>> getStudentSchedule() {
		return studentSchedule;
	}
	
	public void setStudentSchedule(Map<PMRoom, List<PMStudent>> studentSchedule) {
		this.studentSchedule = studentSchedule;
	}
	
	public String getCourseISVU() {
		return courseISVU;
	}
	
	public void setCourseISVU(String courseISVU) {
		this.courseISVU = courseISVU;
	}
	
	public String getAcademicYear() {
		return academicYear;
	}
	
	public void setAcademicYear(String academicYear) {
		this.academicYear = academicYear;
	}
	
	public String getSemester() {
		return semester;
	}
	
	public void setSemester(String semester) {
		this.semester = semester;
	}
	
}
