/home/techb158/ileadtechnology.com/SSM/public/js/exam
NameSizeModeActions
edit~js/-0755rm
online-exam/-0755rm
record/-0755rm
report/-0755rm
schedule/-0755rm
edit.js58980644editdlrm
edit.js.map1370644editdlrm
index.js152330644editdlrm
index.js.map1300644editdlrm
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/exam/index.js (15233B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[196],{"8T2P":function(t,e,a){"use strict";a.r(e);var s={components:{examForm:a("ddiv").a},data:function(){return{exams:{total:0,data:[]},filter:{sort_by:"position",order:"asc",name:"",page_length:helper.getConfig("page_length")},orderByOptions:[{value:"position",translation:i18n.general.position},{value:"name",translation:i18n.exam.exam_name}],showCreatePanel:!1,showFilterPanel:!1,showReorderModal:!1,list:[],help_topic:""}},mounted:function(){helper.hasPermission("list-exam")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),this.getExams()},methods:{hasPermission:function(t){return helper.hasPermission(t)},getExams:function(t){var e=this,a=this.$loading.show();"number"!=typeof t&&(t=1);var s=helper.getFilterURL(this.filter);axios.get("/api/exam?page="+t+s).then((function(t){e.list=[],e.exams=t,e.exams.data.forEach((function(t){e.list.push(t.name)})),a.hide()})).catch((function(t){a.hide(),helper.showErrorMsg(t)}))},editExam:function(t){this.$router.push("/exam/"+t.id+"/edit")},confirmDelete:function(t){var e=this;return function(a){return e.deleteExam(t)}},deleteExam:function(t){var e=this,a=this.$loading.show();axios.delete("/api/exam/"+t.id).then((function(t){toastr.success(t.message),e.getExams(),a.hide()})).catch((function(t){a.hide(),helper.showErrorMsg(t)}))},getConfig:function(t){return helper.getConfig(t)},print:function(){var t=this.$loading.show();axios.post("/api/exam/print",{filter:this.filter}).then((function(e){var a=window.open("/print");t.hide(),a.document.write(e)})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},pdf:function(){var t=this,e=this.$loading.show();axios.post("/api/exam/pdf",{filter:this.filter}).then((function(a){e.hide(),window.open("/download/report/"+a+"?token="+t.authToken)})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},reorderExam:function(){var t=this;axios.post("/api/exam/reorder",{list:this.list}).then((function(e){toastr.success(e.message),t.showReorderModal=!1,t.getExams()})).catch((function(t){helper.showErrorMsg(t)}))}},filters:{moment:function(t){return helper.formatDate(t)},momentDateTime:function(t){return helper.formatDateTime(t)}},watch:{"filter.sort_by":function(t){this.getExams()},"filter.order":function(t){this.getExams()},"filter.page_length":function(t){this.getExams()}},computed:{authToken:function(){return helper.getAuthToken()}}},n=a("KHd+"),r=Object(n.a)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"page-titles"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-6"},[a("h3",{staticClass:"text-themecolor"},[t._v(t._s(t.trans("exam.exam"))+" \n "),t.exams.total?a("span",{staticClass:"card-subtitle d-none d-sm-inline"},[t._v(t._s(t.trans("general.total_result_found",{count:t.exams.total,from:t.exams.from,to:t.exams.to})))]):a("span",{staticClass:"card-subtitle d-none d-sm-inline"},[t._v(t._s(t.trans("general.no_result_found")))])])]),t._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"action-buttons pull-right"},[t.exams.total&&!t.showCreatePanel&&t.hasPermission("create-exam")?a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("general.add_new"),expression:"trans('general.add_new')"}],staticClass:"btn btn-info btn-sm",on:{click:function(e){t.showCreatePanel=!t.showCreatePanel}}},[a("i",{staticClass:"fas fa-plus"}),t._v(" "),a("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("exam.add_new_exam")))])]):t._e(),t._v(" "),t.hasPermission("edit-exam")&&t.exams.total?a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("exam.reorder_exam"),expression:"trans('exam.reorder_exam')"}],staticClass:"btn btn-info btn-sm",on:{click:function(e){t.showReorderModal=!0}}},[a("i",{staticClass:"fas fa-arrows-alt"}),t._v(" "),a("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("exam.reorder_exam")))])]):t._e(),t._v(" "),t.showFilterPanel?t._e():a("button",{staticClass:"btn btn-info btn-sm",on:{click:function(e){t.showFilterPanel=!t.showFilterPanel}}},[a("i",{staticClass:"fas fa-filter"}),t._v(" "),a("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("general.filter")))])]),t._v(" "),a("sort-by",{attrs:{"order-by-options":t.orderByOptions,"sort-by":t.filter.sort_by,order:t.filter.order},on:{updateSortBy:function(e){t.filter.sort_by=e},updateOrder:function(e){t.filter.order=e}}}),t._v(" "),a("div",{staticClass:"btn-group"},[a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("general.more_option"),expression:"trans('general.more_option')"}],staticClass:"btn btn-info btn-sm dropdown-toggle no-caret ",attrs:{type:"button",role:"menu",id:"moreOption","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[a("i",{staticClass:"fas fa-ellipsis-h"}),t._v(" "),a("span",{staticClass:"d-none d-sm-inline"})]),t._v(" "),a("div",{class:["dropdown-menu","ltr"==t.getConfig("direction")?"dropdown-menu-right":""],attrs:{"aria-labelledby":"moreOption"}},[a("button",{staticClass:"dropdown-item custom-dropdown",on:{click:t.print}},[a("i",{staticClass:"fas fa-print"}),t._v(" "+t._s(t.trans("general.print")))]),t._v(" "),a("button",{staticClass:"dropdown-item custom-dropdown",on:{click:t.pdf}},[a("i",{staticClass:"fas fa-file-pdf"}),t._v(" "+t._s(t.trans("general.generate_pdf")))])])]),t._v(" "),a("help-button",{on:{clicked:function(e){t.help_topic="exam.exam"}}})],1)])])]),t._v(" "),a("div",{staticClass:"container-fluid"},[a("transition",{attrs:{name:"fade"}},[t.showFilterPanel?a("div",{staticClass:"card card-form"},[a("div",{staticClass:"card-body"},[a("h4",{staticClass:"card-title"},[t._v(t._s(t.trans("general.filter")))]),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("exam.exam_name")))]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.filter.name,expression:"filter.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:t.trans("exam.exam_name")},domProps:{value:t.filter.name},on:{input:function(e){e.target.composing||t.$set(t.filter,"name",e.target.value)}}})])])]),t._v(" "),a("div",{staticClass:"card-footer text-right"},[a("button",{staticClass:"btn btn-danger",attrs:{type:"button"},on:{click:function(e){t.showFilterPanel=!1}}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),a("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"button"},on:{click:t.getExams}},[t._v(t._s(t.trans("general.filter")))])])])]):t._e()]),t._v(" "),t.hasPermission("create-exam")?a("transition",{attrs:{name:"fade"}},[t.showCreatePanel?a("div",{staticClass:"card card-form"},[a("div",{staticClass:"card-body"},[a("h4",{staticClass:"card-title"},[t._v(t._s(t.trans("exam.add_new_exam")))]),t._v(" "),a("exam-form",{on:{completed:t.getExams,cancel:function(e){t.showCreatePanel=!t.showCreatePanel}}})],1)]):t._e()]):t._e(),t._v(" "),a("div",{staticClass:"card"},[a("div",{staticClass:"card-body"},[t.exams.total?a("div",{staticClass:"table-responsive"},[a("table",{staticClass:"table table-sm"},[a("thead",[a("tr",[a("th",[t._v(t._s(t.trans("exam.exam_name")))]),t._v(" "),a("th",[t._v(t._s(t.trans("exam.term")))]),t._v(" "),a("th",[t._v(t._s(t.trans("exam.exam_description")))]),t._v(" "),a("th",{staticClass:"table-option"},[t._v(t._s(t.trans("general.action")))])])]),t._v(" "),a("tbody",t._l(t.exams.data,(function(e){return a("tr",[a("td",{domProps:{textContent:t._s(e.name)}}),t._v(" "),a("td",[t._v("\n "+t._s(e.exam_term_id?e.term.name+" ("+e.term.course_group.name+")":"")+"\n ")]),t._v(" "),a("td",{domProps:{textContent:t._s(e.description)}}),t._v(" "),a("td",{staticClass:"table-option"},[a("div",{staticClass:"btn-group"},[t.hasPermission("edit-exam")?a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("exam.edit_exam"),expression:"trans('exam.edit_exam')"}],staticClass:"btn btn-info btn-sm",on:{click:function(a){return a.preventDefault(),t.editExam(e)}}},[a("i",{staticClass:"fas fa-edit"})]):t._e(),t._v(" "),t.hasPermission("delete-exam")?a("button",{directives:[{name:"confirm",rawName:"v-confirm",value:{ok:t.confirmDelete(e)},expression:"{ok: confirmDelete(exam)}"},{name:"tooltip",rawName:"v-tooltip",value:t.trans("exam.delete_exam"),expression:"trans('exam.delete_exam')"}],key:e.id,staticClass:"btn btn-danger btn-sm"},[a("i",{staticClass:"fas fa-trash"})]):t._e()])])])})),0)])]):t._e(),t._v(" "),t.exams.total?t._e():a("module-info",{attrs:{module:"exam",title:"exam_module_title",description:"exam_module_description",icon:"check-circle"}},[a("div",{attrs:{slot:"btn"},slot:"btn"},[!t.showCreatePanel&&t.hasPermission("create-exam")?a("button",{staticClass:"btn btn-info btn-md",on:{click:function(e){t.showCreatePanel=!t.showCreatePanel}}},[a("i",{staticClass:"fas fa-plus"}),t._v(" "+t._s(t.trans("general.add_new")))]):t._e()])]),t._v(" "),a("pagination-record",{attrs:{"page-length":t.filter.page_length,records:t.exams},on:{"update:pageLength":function(e){return t.$set(t.filter,"page_length",e)},"update:page-length":function(e){return t.$set(t.filter,"page_length",e)},updateRecords:t.getExams}})],1)])],1),t._v(" "),t.hasPermission("edit-exam")&&t.showReorderModal?a("transition",{attrs:{name:"modal"}},[a("div",{staticClass:"modal-mask"},[a("div",{staticClass:"modal-wrapper"},[a("div",{staticClass:"modal-container modal-lg"},[a("div",{staticClass:"modal-header"},[t._t("header",[t._v("\n "+t._s(t.trans("exam.reorder_exam"))+"\n "),a("span",{staticClass:"float-right pointer",on:{click:function(e){t.showReorderModal=!1}}},[t._v("x")])])],2),t._v(" "),a("div",{staticClass:"modal-body"},[t._t("body",[a("draggable",{staticClass:"list-group",on:{start:function(e){t.drag=!0},end:function(e){t.drag=!1}},model:{value:t.list,callback:function(e){t.list=e},expression:"list"}},t._l(t.list,(function(e){return a("div",{key:e.id,staticClass:"list-group-item pointer"},[a("i",{staticClass:"fas fa-arrows-alt"}),t._v(" "+t._s(e))])})),0),t._v(" "),a("button",{staticClass:"btn btn-info pull-right m-t-10",attrs:{type:"button"},on:{click:t.reorderExam}},[t._v(t._s(t.trans("general.save")))])])],2)])])])]):t._e(),t._v(" "),a("right-panel",{attrs:{topic:t.help_topic}})],1)}),[],!1,null,null,null);e.default=r.exports},ddiv:function(t,e,a){"use strict";var s={components:{},data:function(){return{examForm:new Form({name:"",exam_term_id:"",description:""}),exam_terms:[],selected_exam_term:null}},props:["id"],mounted:function(){helper.hasPermission("create-exam")||helper.hasPermission("edit-exam")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),this.getPreRequisite()},methods:{proceed:function(){this.id?this.update():this.store()},getPreRequisite:function(){var t=this,e=this.$loading.show();axios.get("/api/exam/pre-requisite").then((function(a){t.exam_terms=a.exam_terms,t.id&&t.get(),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},store:function(){var t=this,e=this.$loading.show();this.examForm.post("/api/exam").then((function(a){toastr.success(a.message),t.selected_exam_term=null,t.$emit("completed"),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},get:function(){var t=this,e=this.$loading.show();axios.get("/api/exam/"+this.id).then((function(a){t.examForm.name=a.name,t.examForm.exam_term_id=a.exam_term_id,t.selected_exam_term=a.exam_term_id?{id:a.exam_term_id,name:a.term.name+" ("+a.term.course_group.name+")"}:null,t.examForm.description=a.description,e.hide()})).catch((function(a){e.hide(),helper.showErrorMsg(a),t.$router.push("/exam")}))},update:function(){var t=this,e=this.$loading.show();this.examForm.patch("/api/exam/"+this.id).then((function(a){toastr.success(a.message),e.hide(),t.$router.push("/exam")})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},getConfig:function(t){return helper.getConfig(t)},onExamTermSelect:function(t){this.examForm.exam_term_id=t.id}}},n=a("KHd+"),r=Object(n.a)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("form",{on:{submit:function(e){return e.preventDefault(),t.proceed(e)},keydown:function(e){return t.examForm.errors.clear(e.target.name)}}},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("exam.term"))+" ")]),t._v(" "),a("v-select",{attrs:{label:"name",name:"exam_term_id",id:"exam_term_id",options:t.exam_terms,placeholder:t.trans("exam.select_term")},on:{select:t.onExamTermSelect,close:function(e){return t.examForm.errors.clear("exam_term_id")},remove:function(e){t.examForm.exam_term_id=""}},model:{value:t.selected_exam_term,callback:function(e){t.selected_exam_term=e},expression:"selected_exam_term"}},[t.exam_terms.length?t._e():a("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[t._v("\n "+t._s(t.trans("general.no_option_found"))+"\n ")])]),t._v(" "),a("show-error",{attrs:{"form-name":t.examForm,"prop-name":"exam_term_id"}})],1)]),t._v(" "),a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("exam.exam_name")))]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.examForm.name,expression:"examForm.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:t.trans("exam.exam_name")},domProps:{value:t.examForm.name},on:{input:function(e){e.target.composing||t.$set(t.examForm,"name",e.target.value)}}}),t._v(" "),a("show-error",{attrs:{"form-name":t.examForm,"prop-name":"name"}})],1)]),t._v(" "),a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("exam.exam_description")))]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.examForm.description,expression:"examForm.description"}],staticClass:"form-control",attrs:{type:"text",name:"description",placeholder:t.trans("exam.exam_description")},domProps:{value:t.examForm.description},on:{input:function(e){e.target.composing||t.$set(t.examForm,"description",e.target.value)}}}),t._v(" "),a("show-error",{attrs:{"form-name":t.examForm,"prop-name":"description"}})],1)])]),t._v(" "),a("div",{staticClass:"card-footer text-right"},[a("router-link",{directives:[{name:"show",rawName:"v-show",value:t.id,expression:"id"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/exam"}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),t.id?t._e():a("button",{staticClass:"btn btn-danger waves-effect waves-light ",attrs:{type:"button"},on:{click:function(e){return t.$emit("cancel")}}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),a("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[t.id?a("span",[t._v(t._s(t.trans("general.update")))]):a("span",[t._v(t._s(t.trans("general.save")))])])],1)])}),[],!1,null,null,null);e.a=r.exports}}]); //# sourceMappingURL=index.js.map?id=942567dccaf4a3947e4d