{"version":3,"sources":["webpack:///./src/views/academics/Assessment.vue?6bf0","webpack:///./src/views/academics/modals/EditTypeWeightModal.vue?e660","webpack:///./src/views/academics/Assessment.vue","webpack:///./src/views/academics/modals/EditTypeWeightModal.vue","webpack:///./src/views/academics/modals/EditTypeWeightModal.vue?2b4b","webpack:///./src/views/academics/modals/EditTypeWeightModal.vue?c798","webpack:///./src/views/academics/Assessment.vue?f8a7","webpack:///./src/views/academics/Assessment.vue?b029"],"names":["class","style","align","id","placeholder","selectedSemester","updateClasses","semesters","semester","label","name","code","moment","start_date","format","end_date","value","key","selectedSubject","updateAssessment","subjects","subject","subjectId","data-bs-toggle","data-bs-target","createDefaultAssessments","search","searchValue","to","data","pagedTableDate","openAssessmentDetail","prop","scope","row","type","student_grades","length","map","item","achieved_point","reduce","prev","curr","toFixed","assessments","layout","page-size","pageSize","total","setPage","tabindex","aria-hidden","data-bs-dismiss","getAssessmentTypes","src","model","formdata","ref","assessmentTypes","percentage","saveData","components","Promise","resolve","reject","ApiService","setHeader","get","then","catch","response","Error","errors","x","fire","text","icon","buttonsStyling","confirmButtonText","customClass","confirmButton","post","editCloseButton","document","getElementById","click","console","log","render","__scopeId","EditTypeWeight","route","params","subject_id","user","store","getters","currentUser","subjectsAll","page","pageValue","filter","title","toLowerCase","includes","slice","val","getSemesters","sortedData","sort","a","b","Date","parse","error","getClasses","session","level","program","forEach","push","getAssessments","router","getSkillAreas","assessmentDetails","skillAreas","skill_area","split","skillArea","type_id","user_id","max_point","getSubjects","availableSemester","v","i","indexOf","today","currentSemester"],"mappings":"2IAAA,W,oCCAA,W,2FCCOA,MAAM,2BAA2BC,MAAA,mB,GAC/BA,MAAA,yBAA8BD,MAAM,Y,GAiBpCC,MAAA,yBAA8BD,MAAM,Y,GAiBtCA,MAAM,oBAAoBC,MAAA,2B,GACxBD,MAAM,WAAWE,MAAM,Q,GAcvBF,MAAM,WAAWE,MAAM,S,GAczBF,MAAM,qBAAqBG,GAAG,mB,GAIhBF,MAAA,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Q/G,SAASL,IAAME,EAAiBW,OACjF8F,MAAK,SAASC,EAAEC,GACb,OAAID,EAAEpG,KAAOqG,EAAErG,KACJ,EACPoG,EAAEpG,KAAOqG,EAAErG,MACH,EACL,KAEV6G,QAAQnG,IACPD,EAASJ,MAAMyG,KAAK,CAACnG,UAAWD,EAAQlB,GAAIM,MAAOY,EAAQgG,QAAQC,MAAMC,QAAQ5G,KAAK,IAAIU,EAAQgG,QAAQC,MAAM3G,KAAK,IAAIU,EAAQgG,QAAQ1G,KAAK,IAAIU,EAAQX,SAGpJ,GAAbY,GACDJ,EAAgBF,MAAQI,EAASJ,MAAM,GAAGM,UAC1CqG,EAAA,KAAOF,KAAK,CAAE/G,KAAM,cAAemF,OAAQ,CAAEC,WAAY1E,EAASJ,MAAM,GAAGM,cAG3EJ,EAAgBF,MAAQM,QAGpBoG,IACN1D,QAEDM,MAAO6C,IACJlD,EAAO,IAAIO,MAAO,uBAAuB2C,WA6BzD,OAxBA,2BAAc,KACZP,IAAevC,KAAYxC,GAAS,+CAClC,GAAGA,EAAK,CACN,GAAgB,GAAbP,EAAe,CAChB,IAAIoH,EAAQ,IAAIzB,KACZ0B,EAAkB9G,EAAKyE,OAAO9F,GAAaA,EAASK,YAAc6H,GAASlI,EAASO,UAAY2H,GAEjGC,EAAgBtG,OAAS,EAC1BhC,EAAiBW,MAAQ2H,EAAgB,GAAGxI,GAG5CE,EAAiBW,MAAQa,EAAK,GAAG1B,SAG/BkI,UACA/E,WAKZ,uBAAU,KACR,eAA0B,uBAAwB,CAAC,gBAG9C,CACLJ,UACApB,iBACAkB,WACAtB,SACAmB,cACAjC,OAAA,IACAL,YACAF,mBACAa,kBACAE,WACAD,mBACAb,gBACAyB,uBACAN,+B,UCnQN,EAAOgE,OAASA,EAChB,EAAOC,UAAY,kBAEJ","file":"js/chunk-2e432634.0510884a.js","sourcesContent":["export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Assessment.vue?vue&type=style&index=0&id=345e4198&scoped=true&lang=css\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./EditTypeWeightModal.vue?vue&type=style&index=0&id=6c27d949&lang=scss&scoped=true\"","\r\n\r\n\r\n\r\n\r\n\r\n","\r\n\r\n\r\n\r\n\r\n","\r\nimport { defineComponent, onMounted, ref} from \"vue\";\r\nimport Swal from \"sweetalert2/dist/sweetalert2.min.js\";\r\nimport ApiService from \"@/core/services/ApiService\";\r\n\r\nexport default defineComponent({\r\n name: \"edit-class-modal\",\r\n components: {\r\n },\r\n setup() {\r\n const assessmentTypes = ref([] as any);\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 assessmentTypes.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 saveData = () =>{\r\n if(assessmentTypes.value.map(x=>x.percentage).reduce((prev, curr) => prev + curr, 0) != 100){\r\n Swal.fire({\r\n text: \"Total sum of the percentages should be 100.\",\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 else{\r\n ApiService.setHeader();\r\n ApiService.post(\"assessment/type\", assessmentTypes.value as any)\r\n .then(() => {\r\n Swal.fire({\r\n text: \"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 }).then(() => {\r\n let editCloseButton = document.getElementById('edit_close_button');\r\n editCloseButton?.click();\r\n });\r\n \r\n })\r\n .catch(({ response }) => {\r\n Swal.fire({\r\n text: \"Update failed\",\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 console.log('handleEdit error => '+response.data.errors);\r\n });\r\n }\r\n }\r\n \r\n onMounted (() =>{\r\n getAssessmentTypes();\r\n });\r\n\r\n return {\r\n assessmentTypes,\r\n saveData,\r\n getAssessmentTypes\r\n };\r\n },\r\n});\r\n","import { render } from \"./EditTypeWeightModal.vue?vue&type=template&id=6c27d949&scoped=true\"\nimport script from \"./EditTypeWeightModal.vue?vue&type=script&lang=ts\"\nexport * from \"./EditTypeWeightModal.vue?vue&type=script&lang=ts\"\n\nimport \"./EditTypeWeightModal.vue?vue&type=style&index=0&id=6c27d949&lang=scss&scoped=true\"\nscript.render = render\nscript.__scopeId = \"data-v-6c27d949\"\n\nexport default script","\r\nimport { defineComponent, onMounted, computed, ref, reactive, onBeforeMount, watch } from \"vue\";\r\nimport { setCurrentPageBreadcrumbs } from \"@/core/helpers/breadcrumb\";\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport moment from \"moment\";\r\nimport router from \"@/router\";\r\nimport EditTypeWeight from \"@/views/academics/modals/EditTypeWeightModal.vue\";\r\nimport Swal from \"sweetalert2\";\r\nimport store from \"@/store\";\r\nimport { useRoute } from \"vue-router\";\r\n\r\nexport default defineComponent({\r\n name: \"assessment-list\",\r\n components: {\r\n EditTypeWeight\r\n },\r\n setup() {\r\n const route = useRoute();\r\n const subjectId = +route.params.subject_id; \r\n const assessments : any= reactive([]);\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 pageSize = 10;\r\n const assessmentTypes = ref([] as any);\r\n const user = store.getters.currentUser;\r\n const subjectsAll = ref([] as any);\r\n let page = reactive({pageValue : 1});\r\n\r\n const pagedTableDate = computed(()=>{\r\n if(!assessments.value){\r\n return;\r\n }\r\n\r\n return assessments.value.filter(data => !search \r\n || data.title.toLowerCase().includes(search.searchValue.toLowerCase())\r\n || data.type.name.toLowerCase().includes(search.searchValue.toLowerCase()))\r\n .slice(pageSize * page.pageValue - pageSize, pageSize * page.pageValue);\r\n })\r\n\r\n const search = reactive({searchValue : ''});\r\n\r\n const setPage = (val) => {\r\n page.pageValue = val;\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 subjectsAll.value.filter(subject => subject.session.level.program.semester.id == selectedSemester.value).forEach(subject =>{\r\n subjects.value.push({subjectId: subject.id, label: subject.session.level.program.code+'/'+subject.session.level.code+'/'+subject.session.code+'/'+subject.name})\r\n });\r\n\r\n if(subjects.value.length > 0){\r\n selectedSubject.value = subjects.value[0].subjectId;\r\n }\r\n\r\n getAssessments();\r\n }\r\n\r\n const getAssessments = () : any => {\r\n return new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"assessment/subject/\"+selectedSubject.value)\r\n .then(({ data }) => {\r\n assessments.value = data.data;\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 updateClasses = async() => {\r\n await getClasses();\r\n }\r\n\r\n const updateAssessment = async() => {\r\n router.push({ name: \"assessments\", params: { subject_id: selectedSubject.value } });\r\n getAssessments();\r\n }\r\n\r\n const openAssessmentDetail= (row) =>{\r\n router.push({ name: \"assessment-detail\", params: { id: row.id } });\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 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 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 assessmentTypes.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 createDefaultAssessments = () =>{\r\n getSkillAreas().then((x :any) => {\r\n var assessmentDetails = [] as any;\r\n var skillAreas = x.skill_area.split(';');\r\n skillAreas.forEach((skillArea) => {\r\n assessmentTypes.value.forEach((type) =>{\r\n assessmentDetails.push({\r\n subject_id:selectedSubject.value,\r\n type_id:type.id,\r\n skill_area: skillArea,\r\n title:type.name,\r\n user_id:user.id,\r\n max_point: 10\r\n })\r\n })\r\n })\r\n \r\n ApiService.setHeader();\r\n ApiService.post(\"assessment/bulk\", assessmentDetails)\r\n .then(() => {\r\n Swal.fire({\r\n text: \"Default assessments have 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 getAssessments();\r\n });\r\n })\r\n .catch(({ response }) => {\r\n Swal.fire({\r\n text: \"Failed to create the new assessments for the subject\",\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\r\n const getSubjects = async() => {\r\n subjects.value = [];\r\n await new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"class/subjects/detail\")\r\n .then(async({ data }) => {\r\n subjectsAll.value = data.data;\r\n let availableSemester = data.data.map(subject => subject.session.level.program.semester.id).filter((v, i, a) => a.indexOf(v) === i);\r\n semesters.value = semesters.value.filter(x=> availableSemester.includes(x.id)); \r\n if(subjectId != 0){\r\n selectedSemester.value = data.data.filter(subject => subject.id == subjectId)[0].session.level.program.semester.id;\r\n }\r\n\r\n data.data.filter(subject => subject.session.level.program.semester.id == selectedSemester.value)\r\n .sort(function(a,b) { \r\n if (a.code > b.code)\r\n return 1;\r\n if (a.code < b.code)\r\n return -1;\r\n return 0;\r\n })\r\n .forEach(subject =>{\r\n subjects.value.push({subjectId: subject.id, label: subject.session.level.program.code+'/'+subject.session.level.code+'/'+subject.session.code+'/'+subject.name})\r\n });\r\n\r\n if(subjectId == 0){\r\n selectedSubject.value = subjects.value[0].subjectId;\r\n router.push({ name: \"assessments\", params: { subject_id: subjects.value[0].subjectId } });\r\n }\r\n else{\r\n selectedSubject.value = subjectId; \r\n }\r\n\r\n await getAssessments();\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 onBeforeMount(() =>{\r\n getSemesters().then(async (data) => {\r\n if(data){\r\n if(subjectId == 0){\r\n let today = new Date();\r\n let currentSemester = data.filter(semester => (semester.start_date <= today && semester.end_date >= today));\r\n\r\n if(currentSemester.length > 0){\r\n selectedSemester.value = currentSemester[0].id;\r\n }\r\n else{\r\n selectedSemester.value = data[0].id;\r\n }\r\n }\r\n await getSubjects();\r\n await getAssessmentTypes();\r\n }\r\n }); \r\n })\r\n\r\n onMounted(() => {\r\n setCurrentPageBreadcrumbs(\"Assessment & Grading\", [\"Academics\"]);\r\n });\r\n\r\n return {\r\n setPage,\r\n pagedTableDate,\r\n pageSize,\r\n search,\r\n assessments,\r\n moment,\r\n semesters,\r\n selectedSemester,\r\n selectedSubject,\r\n subjects,\r\n updateAssessment,\r\n updateClasses,\r\n openAssessmentDetail,\r\n createDefaultAssessments\r\n };\r\n },\r\n});\r\n","import { render } from \"./Assessment.vue?vue&type=template&id=345e4198&scoped=true\"\nimport script from \"./Assessment.vue?vue&type=script&lang=ts\"\nexport * from \"./Assessment.vue?vue&type=script&lang=ts\"\n\nimport \"./Assessment.vue?vue&type=style&index=0&id=345e4198&scoped=true&lang=css\"\nscript.render = render\nscript.__scopeId = \"data-v-345e4198\"\n\nexport default script"],"sourceRoot":""}