{"version":3,"sources":["webpack:///./src/views/academics/AssessmentDetail.vue","webpack:///./src/views/academics/AssessmentDetail.vue?ffae","webpack:///./src/views/academics/AssessmentDetail.vue?4190","webpack:///./src/core/helpers/breadcrumb.ts"],"names":["class","style","assessmentId","id","model","assessmentDetail","ref","for","prop","placeholder","selectedSemester","updateSubject","semesters","semester","label","name","code","moment","start_date","format","end_date","value","key","selectedSubject","updateStudents","subjects","subject","subjectId","session","level","program","type_id","types","type","skill_area","skillAreas","skill","title","period","range-separator","start-placeholder","end-placeholder","content","rows","max_point","student_grades","length","grade","student","student_id","first_name","last_name","achieved_point","colspan","backToList","submit","deleteAssessment","components","route","params","formRef","submitButton","user","store","getters","currentUser","getAssessmentTypes","Promise","resolve","reject","ApiService","setHeader","get","then","data","catch","response","Error","errors","getSemesters","sortedData","sort","a","b","Date","parse","error","getClasses","forEach","levels","sessions","push","getAssessment","filter","x","Object","assign","subject_id","assessment_start_date","assessment_end_date","getSkillAreas","split","getSubjectStudents","confirm","delete","fire","text","icon","buttonsStyling","confirmButtonText","customClass","confirmButton","router","user_id","setAttribute","post","finally","removeAttribute","update","go","render","setCurrentPageBreadcrumbs","pageTitle","breadcrumbs","dispatch","SET_BREADCRUMB_ACTION","pageBreadcrumbPath","setCurrentPageTitle"],"mappings":"gJACOA,MAAM,sB,GACJA,MAAM,wB,uBAINA,MAAM,uB,GAOEA,MAAM,gC,SACFA,MAAM,Y,GAIFA,MAAM,mB,SAmBVA,MAAM,Y,GAIFA,MAAM,mB,SAkBVA,MAAM,Y,GAIFA,MAAM,mB,GAMVA,MAAM,Y,GAIFA,MAAM,mB,GAcVA,MAAM,Y,GAIFA,MAAM,mB,GAcVA,MAAM,Y,GAIFA,MAAM,mB,GAWVA,MAAM,Y,GAIFA,MAAM,mB,GAYVA,MAAM,Y,GAIFA,MAAM,mB,GAYVA,MAAM,Y,GAIFA,MAAM,mB,GAWVA,MAAM,Y,GAIFA,MAAM,+B,SAEIA,MAAM,kD,aAUGC,MAAA,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GJ9C,EAAa,KACf0D,EAAA,KAAOO,IAAI,IAoBf,OAjBA,2BAAc,IAAY,qDAClBrD,IACc,IAAjBhE,QACK0F,IAAgBnB,KAAK,IAAU,qDAC3B6B,UACAF,cAIFrB,IAAeN,WAI3B,uBAAU,KACN,eAA0C,GAAhBvE,EAAoB,oBAAqB,oBAAqB,CAAC,YAAa,2BAGnG,CACHqD,SACAK,UACAvD,mBACAH,eACA8B,QACApB,YACAa,WACAf,mBACAa,kBACAN,OAAA,IACAN,gBACAa,iBACAgC,mBACAF,aACAnB,iBC9SZ,EAAOqF,OAASA,EAED,gB,kCCLf,gGAQO,MAAMC,EAA4B,CACvCC,EACAC,KAEA,OAAMC,SAAS,OAAQC,sBAAuB,CAC5CxF,MAAOqF,EACPI,mBAAoBH,KAQXI,EAAuB1F,IAClC,OAAMuF,SAAS,OAAQC,sBAAuB,CAC5CxF,MAAOA","file":"js/chunk-31d8350f.720c8c77.js","sourcesContent":["\r\n\r\n\r\n","\r\nimport { defineComponent, ref, reactive, onBeforeMount, onMounted, watch } from \"vue\";\r\nimport Swal from \"sweetalert2/dist/sweetalert2.min.js\";\r\nimport { useRoute } from 'vue-router'\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport router from \"@/router\";\r\nimport store from \"@/store\";\r\nimport moment from \"moment\";\r\nimport { setCurrentPageBreadcrumbs } from \"@/core/helpers/breadcrumb\";\r\nimport { ElMessageBox } from \"element-plus\";\r\n\r\nexport default defineComponent({\r\n name: \"assessment-detail-modal\",\r\n components: {\r\n },\r\n setup() {\r\n const route = useRoute();\r\n const assessmentId = +route.params.id; \r\n const semesters = ref([] as any);\r\n const subjects = ref([] as any);\r\n const selectedSemester = ref(null as any);\r\n const selectedSubject = ref(null as any);\r\n const formRef = ref(null);\r\n const submitButton = ref(null);\r\n const assessmentDetail = reactive({} as any);\r\n const user = store.getters.currentUser;\r\n const types = ref([]);\r\n const skillAreas = ref([]);\r\n \r\n const getAssessmentTypes = async() =>{\r\n await new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"assessment/types\")\r\n .then(({ data }) => {\r\n types.value = data.data;\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n reject(new Error ('getAssessmentTypes => '+response.data.errors));\r\n });\r\n });\r\n }\r\n\r\n const getSemesters = () : any => {\r\n return new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"class/semesters\")\r\n .then(({ data }) => {\r\n let sortedData = data.data.sort(function(a,b) { \r\n if(a.id == b.id) return 0;\r\n\r\n if (Date.parse(a.start_date!) < Date.parse(b.start_date!))\r\n return 1;\r\n if (Date.parse(a.start_date!) > Date.parse(b.start_date!))\r\n return -1;\r\n return 0;\r\n });\r\n semesters.value = sortedData;\r\n resolve(sortedData);\r\n })\r\n .catch((error) => {\r\n reject(new Error ('getSemesters error => '+error));\r\n });\r\n });\r\n }\r\n\r\n const getClasses = async() => {\r\n subjects.value = [];\r\n await new Promise((resolve, reject) => {\r\n ApiService.setHeader(); \r\n ApiService.get(\"class/\"+selectedSemester.value)\r\n .then(async({ data }) => {\r\n data.data.forEach(program => {\r\n program.levels.forEach(level => {\r\n level.sessions.forEach(session => {\r\n session.subjects.forEach(subject =>{\r\n subjects.value.push({subjectId: subject.id, label: program.code+'/'+level.code+'/'+session.code+'/'+subject.name})\r\n })\r\n })\r\n })\r\n });\r\n\r\n resolve();\r\n })\r\n .catch((error) => {\r\n reject(new Error ('getClasses error => '+error));\r\n });\r\n });\r\n }\r\n\r\n const getAssessment = async () => {\r\n await new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"assessment/\"+assessmentId)\r\n .then(({ data }) => {\r\n if(data.data){\r\n data.data.student_grades = data.data.student_grades.filter(x=>x.student!=null);\r\n Object.assign(assessmentDetail,data.data);\r\n }\r\n\r\n selectedSubject.value = data.data.subject_id;\r\n assessmentDetail.period = [];\r\n assessmentDetail.period[0] = data.data.assessment_start_date;\r\n assessmentDetail.period[1] = data.data.assessment_end_date;\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n reject(new Error ('getAgents error => '+response.data.errors));\r\n });\r\n });\r\n }\r\n\r\n const getSkillAreas = () => {\r\n return new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"class/subject/\"+selectedSubject.value)\r\n .then(({ data }) => {\r\n if(data.data.skill_area){\r\n skillAreas.value = data.data.skill_area.split(';');\r\n }\r\n resolve(data.data);\r\n })\r\n .catch((error) => {\r\n reject(new Error ('getSemesters error => '+error));\r\n });\r\n });\r\n }\r\n\r\n const getSubjectStudents = () : any => {\r\n return new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"class-student/students/\"+selectedSubject.value)\r\n .then(({ data }) => {\r\n if(!assessmentDetail.student_grades){\r\n assessmentDetail.student_grades = []; \r\n } \r\n data.data.filter(x=>x.student != null).forEach(student => {\r\n if(assessmentDetail.student_grades.filter(x=> x.student_id == student.student_id ).length == 0){\r\n assessmentDetail.student_grades.push({student_id: student.student_id, student:student.student, achieved_point:0})\r\n }\r\n });\r\n resolve(data.data);\r\n })\r\n .catch((error) => {\r\n reject(new Error ('getSemesters error => '+error));\r\n });\r\n });\r\n }\r\n\r\n const deleteAssessment = () =>{\r\n ElMessageBox.confirm('Are you sure to delete this class?')\r\n .then(() => {\r\n ApiService.setHeader();\r\n ApiService.delete(\"assessment/\"+assessmentId)\r\n .then(() => {\r\n Swal.fire({\r\n text: \"Assessment is deleted successfully\",\r\n icon: \"success\",\r\n buttonsStyling: false, \r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n })\r\n .then(() => {\r\n router.push({ name: \"assessments\"});\r\n });\r\n })\r\n .catch(({ response }) => {\r\n Swal.fire({\r\n text: \"Failed to delete the assessment. \"+response.data.errors,\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n })\r\n });\r\n });\r\n }\r\n \r\n const submit = () => {\r\n assessmentDetail.user_id=user.id;\r\n assessmentDetail.assessment_start_date=assessmentDetail.period[0];\r\n assessmentDetail.assessment_end_date=assessmentDetail.period[1];\r\n delete assessmentDetail.period;\r\n if(!assessmentDetail.subject_id)\r\n {\r\n assessmentDetail.subject_id = selectedSubject.value; \r\n } \r\n\r\n submitButton.value?.setAttribute(\"data-kt-indicator\", \"on\");\r\n \r\n if(assessmentId === 0){\r\n ApiService.setHeader();\r\n ApiService.post(\"assessment\", assessmentDetail)\r\n .then(() => {\r\n Swal.fire({\r\n text: \"Assessment information has been successfully created!\",\r\n icon: \"success\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn fw-bold btn-light-primary\",\r\n },\r\n }).then(() => {\r\n router.push({ name: \"assessments\"});\r\n });\r\n })\r\n .catch(({ response }) => {\r\n Swal.fire({\r\n text: \"Failed to create the new assessment. \"+response.data.errors,\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n })\r\n })\r\n .finally(() =>{\r\n submitButton.value?.removeAttribute(\"data-kt-indicator\");\r\n });\r\n }\r\n else\r\n {\r\n ApiService.setHeader();\r\n ApiService.update(\"assessment\", assessmentId, assessmentDetail)\r\n .then(() => {\r\n Swal.fire({\r\n text: \"Assessment is updated successfully\",\r\n icon: \"success\",\r\n buttonsStyling: false, \r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n })\r\n .then(() => {\r\n router.push({ name: \"assessments\"});\r\n });\r\n })\r\n .catch(({ response }) => {\r\n Swal.fire({\r\n text: \"Failed to update the assessment\"+response.data.errors,\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n })\r\n })\r\n .finally(() =>{\r\n submitButton.value?.removeAttribute(\"data-kt-indicator\");\r\n });\r\n }\r\n };\r\n\r\n const updateSubject = async() =>{\r\n await getClasses();\r\n }\r\n\r\n const updateStudents = async() =>{\r\n await getSubjectStudents();\r\n await getSkillAreas();\r\n }\r\n\r\n const backToList = () =>{\r\n router.go(-1);\r\n }\r\n\r\n onBeforeMount(async () => {\r\n await getAssessmentTypes();\r\n if(assessmentId !== 0){\r\n await getAssessment().then(async() =>{\r\n await getSubjectStudents();\r\n await getSkillAreas();\r\n });\r\n }\r\n else{\r\n await getSemesters().then();\r\n }\r\n })\r\n\r\n onMounted(() => {\r\n setCurrentPageBreadcrumbs(assessmentId != 0 ? \"Assessment Detail\": \"Create Assessment\", [\"Academics\", \"Assessment & Grading\"]);\r\n });\r\n\r\n return {\r\n submit,\r\n formRef,\r\n assessmentDetail,\r\n assessmentId,\r\n types,\r\n semesters,\r\n subjects,\r\n selectedSemester,\r\n selectedSubject,\r\n moment,\r\n updateSubject,\r\n updateStudents,\r\n deleteAssessment,\r\n backToList,\r\n skillAreas\r\n };\r\n },\r\n});\r\n","import { render } from \"./AssessmentDetail.vue?vue&type=template&id=349f3ddb\"\nimport script from \"./AssessmentDetail.vue?vue&type=script&lang=ts\"\nexport * from \"./AssessmentDetail.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","import store from \"@/store\";\r\nimport { Actions } from \"@/store/enums/StoreEnums\";\r\n\r\n/**\r\n * Sets current page breadcrumbs\r\n * @param {string} pageTitle Current page title\r\n * @param {Array} breadcrumbs Current page breadcrumbs\r\n */\r\nexport const setCurrentPageBreadcrumbs = (\r\n pageTitle: string,\r\n breadcrumbs: Array\r\n): void => {\r\n store.dispatch(Actions.SET_BREADCRUMB_ACTION, {\r\n title: pageTitle,\r\n pageBreadcrumbPath: breadcrumbs,\r\n });\r\n};\r\n\r\n/**\r\n * Sets current page breadcrumbs\r\n * @param {string} title Current page title name\r\n */\r\nexport const setCurrentPageTitle = (title: string): void => {\r\n store.dispatch(Actions.SET_BREADCRUMB_ACTION, {\r\n title: title,\r\n });\r\n};\r\n"],"sourceRoot":""}