const state = {
  baseinfo: {},
  overview: {},
  scoreRange: [],
  college: [],
  classData: [],
  teacher: [],
  teacherClass: [],
  objective: [],
  subjective: [],
  mainQuestionAnalysis: [],
};

const mutations = {
  setData(state, data) {
    Object.keys(state).forEach((k) => {
      state[k] = data[k] || state[k];
    });
  },
  resetData(state) {
    state.baseinfo = {};
    state.overview = {};
    state.scoreRange = [];
    state.college = [];
    state.classData = [];
    state.teacher = [];
    state.teacherClass = [];
    state.objective = [];
    state.subjective = [];
    state.mainQuestionAnalysis = [];
  },
};

export default {
  namespaced: true,
  state,
  mutations,
};
