/home/techb158/ileadtechnology.com/SSM/public/js/exam/online-exam
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/exam/online-exam/edit.js (18038B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[198],{QsIv:function(e,t,a){"use strict";a.r(t);var n={components:{onlineExamForm:a("v05G").a},data:function(){return{uuid:this.$route.params.uuid}},mounted:function(){helper.hasPermission("edit-online-exam")||(helper.notAccessibleMsg(),this.$router.push("/dashboard"))}},s=a("KHd+"),i=Object(s.a)(n,(function(){var e=this,t=e.$createElement,a=e._self._c||t;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"},[e._v(e._s(e.trans("exam.edit_online_exam")))])]),e._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"action-buttons pull-right"},[a("button",{staticClass:"btn btn-info btn-sm",on:{click:function(t){return e.$router.push("/online-exam")}}},[a("i",{staticClass:"fas fa-list"}),e._v(" "),a("span",{staticClass:"d-none d-sm-inline"},[e._v(e._s(e.trans("exam.online_exam")))])])])])])]),e._v(" "),a("div",{staticClass:"container-fluid"},[a("div",{staticClass:"card card-form"},[a("div",{staticClass:"card-body p-t-20"},[a("online-exam-form",{attrs:{uuid:e.uuid}})],1)])])])}),[],!1,null,null,null);t.default=i.exports},ddiv:function(e,t,a){"use strict";var n={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 e=this,t=this.$loading.show();axios.get("/api/exam/pre-requisite").then((function(a){e.exam_terms=a.exam_terms,e.id&&e.get(),t.hide()})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},store:function(){var e=this,t=this.$loading.show();this.examForm.post("/api/exam").then((function(a){toastr.success(a.message),e.selected_exam_term=null,e.$emit("completed"),t.hide()})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},get:function(){var e=this,t=this.$loading.show();axios.get("/api/exam/"+this.id).then((function(a){e.examForm.name=a.name,e.examForm.exam_term_id=a.exam_term_id,e.selected_exam_term=a.exam_term_id?{id:a.exam_term_id,name:a.term.name+" ("+a.term.course_group.name+")"}:null,e.examForm.description=a.description,t.hide()})).catch((function(a){t.hide(),helper.showErrorMsg(a),e.$router.push("/exam")}))},update:function(){var e=this,t=this.$loading.show();this.examForm.patch("/api/exam/"+this.id).then((function(a){toastr.success(a.message),t.hide(),e.$router.push("/exam")})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},getConfig:function(e){return helper.getConfig(e)},onExamTermSelect:function(e){this.examForm.exam_term_id=e.id}}},s=a("KHd+"),i=Object(s.a)(n,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("form",{on:{submit:function(t){return t.preventDefault(),e.proceed(t)},keydown:function(t){return e.examForm.errors.clear(t.target.name)}}},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.term"))+" ")]),e._v(" "),a("v-select",{attrs:{label:"name",name:"exam_term_id",id:"exam_term_id",options:e.exam_terms,placeholder:e.trans("exam.select_term")},on:{select:e.onExamTermSelect,close:function(t){return e.examForm.errors.clear("exam_term_id")},remove:function(t){e.examForm.exam_term_id=""}},model:{value:e.selected_exam_term,callback:function(t){e.selected_exam_term=t},expression:"selected_exam_term"}},[e.exam_terms.length?e._e():a("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[e._v("\n "+e._s(e.trans("general.no_option_found"))+"\n ")])]),e._v(" "),a("show-error",{attrs:{"form-name":e.examForm,"prop-name":"exam_term_id"}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.exam_name")))]),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.examForm.name,expression:"examForm.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:e.trans("exam.exam_name")},domProps:{value:e.examForm.name},on:{input:function(t){t.target.composing||e.$set(e.examForm,"name",t.target.value)}}}),e._v(" "),a("show-error",{attrs:{"form-name":e.examForm,"prop-name":"name"}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.exam_description")))]),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.examForm.description,expression:"examForm.description"}],staticClass:"form-control",attrs:{type:"text",name:"description",placeholder:e.trans("exam.exam_description")},domProps:{value:e.examForm.description},on:{input:function(t){t.target.composing||e.$set(e.examForm,"description",t.target.value)}}}),e._v(" "),a("show-error",{attrs:{"form-name":e.examForm,"prop-name":"description"}})],1)])]),e._v(" "),a("div",{staticClass:"card-footer text-right"},[a("router-link",{directives:[{name:"show",rawName:"v-show",value:e.id,expression:"id"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/exam"}},[e._v(e._s(e.trans("general.cancel")))]),e._v(" "),e.id?e._e():a("button",{staticClass:"btn btn-danger waves-effect waves-light ",attrs:{type:"button"},on:{click:function(t){return e.$emit("cancel")}}},[e._v(e._s(e.trans("general.cancel")))]),e._v(" "),a("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[e.id?a("span",[e._v(e._s(e.trans("general.update")))]):a("span",[e._v(e._s(e.trans("general.save")))])])],1)])}),[],!1,null,null,null);t.a=i.exports},v05G:function(e,t,a){"use strict";var n={components:{onlineExamForm:a("ddiv").a},data:function(){return{onlineExamForm:new Form({name:"",batch_id:"",subject_id:"",date:"",start_time:"",end_time:"",exam_type:"mcq",passing_percentage:"",is_negative_mark_applicable:"",negative_mark_percentage_per_question:"",instructions:"",description:""}),start_time:{hour:"",minute:"",meridiem:"am"},end_time:{hour:"",minute:"",meridiem:"am"},exam_types:[],batches:[],selected_batch:null,selected_subject:null,batch_with_subjects:[],subjects:[],showExamModal:!1}},props:["uuid"],mounted:function(){helper.hasPermission("create-online-exam")||helper.hasPermission("edit-online-exam")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),this.getPreRequisite()},methods:{hasPermission:function(e){return helper.hasPermission(e)},getPreRequisite:function(){var e=this,t=this.$loading.show();axios.get("/api/online-exam/pre-requisite").then((function(a){e.batches=a.batches,e.batch_with_subjects=a.batch_with_subjects,e.exam_types=a.exam_types,e.uuid&&e.get(),t.hide()})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},getSubjects:function(){var e=this,t=this.$loading.show(),a=this.batch_with_subjects.find((function(t){return t.id==e.onlineExamForm.batch_id}));void 0!==a?(this.subjects=[],this.selected_subject="",a.subjects.forEach((function(t){e.subjects.push({id:t.id,name:t.name+" ("+t.code+")"})})),t.hide()):t.hide()},proceed:function(){this.uuid?this.update():this.store()},store:function(){var e=this,t=this.$loading.show();this.onlineExamForm.start_time=helper.toTime(this.start_time),this.onlineExamForm.end_time=helper.toTime(this.end_time),this.onlineExamForm.post("/api/online-exam").then((function(a){toastr.success(a.message),e.onlineExamForm.exam_type="mcq",e.selected_batch=null,e.selected_subject=null,e.start_time.hour="",e.start_time.minute="",e.end_time.hour="",e.end_time.minute="",e.$emit("completed"),t.hide()})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},get:function(){var e=this,t=this.$loading.show();axios.get("/api/online-exam/"+this.uuid).then((function(a){t.hide(),e.onlineExamForm.name=a.online_exam.name,e.onlineExamForm.batch_id=a.online_exam.batch_id,e.onlineExamForm.subject_id=a.online_exam.subject_id,e.onlineExamForm.description=a.online_exam.description,e.onlineExamForm.instructions=a.online_exam.instructions,e.onlineExamForm.exam_type=a.online_exam.exam_type,e.onlineExamForm.passing_percentage=a.online_exam.passing_percentage,e.onlineExamForm.is_negative_mark_applicable=a.online_exam.is_negative_mark_applicable?1:0,e.onlineExamForm.negative_mark_percentage_per_question=a.online_exam.is_negative_mark_applicable?a.online_exam.negative_mark_percentage_per_question:0,e.selected_batch=a.selected_batch,e.selected_subject=a.selected_subject,e.onlineExamForm.date=a.online_exam.date,e.start_time=a.start_time,e.end_time=a.end_time})).catch((function(a){t.hide(),helper.showErrorMsg(a),e.$router.push("/online-exam")}))},update:function(){var e=this,t=this.$loading.show();this.onlineExamForm.start_time=helper.toTime(this.start_time),this.onlineExamForm.end_time=helper.toTime(this.end_time),this.onlineExamForm.patch("/api/online-exam/"+this.uuid).then((function(a){toastr.success(a.message),t.hide(),e.$router.push("/online-exam")})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},onBatchSelect:function(e){this.onlineExamForm.batch_id=e.id,this.getSubjects()},onSubjectSelect:function(e){this.onlineExamForm.subject_id=e.id}},watch:{}},s=a("KHd+"),i=Object(s.a)(n,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("form",{on:{submit:function(t){return t.preventDefault(),e.proceed(t)},keydown:function(t){return e.onlineExamForm.errors.clear(t.target.name)}}},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-3"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.online_exam_name")))]),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.onlineExamForm.name,expression:"onlineExamForm.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:e.trans("exam.online_exam_name")},domProps:{value:e.onlineExamForm.name},on:{input:function(t){t.target.composing||e.$set(e.onlineExamForm,"name",t.target.value)}}}),e._v(" "),a("show-error",{attrs:{"form-name":e.onlineExamForm,"prop-name":"name"}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-3"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("academic.batch"))+" ")]),e._v(" "),a("v-select",{attrs:{label:"name","group-values":"batches","group-label":"course_group","group-select":!1,name:"batch_id",id:"batch_id",options:e.batches,placeholder:e.trans("academic.select_batch")},on:{select:e.onBatchSelect,close:function(t){return e.onlineExamForm.errors.clear("batch_id")},remove:function(t){e.onlineExamForm.batch_id=""}},model:{value:e.selected_batch,callback:function(t){e.selected_batch=t},expression:"selected_batch"}},[e.batches.length?e._e():a("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[e._v("\n "+e._s(e.trans("general.no_option_found"))+"\n ")])]),e._v(" "),a("show-error",{attrs:{"form-name":e.onlineExamForm,"prop-name":"batch_id"}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-3"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("academic.subject"))+" ")]),e._v(" "),a("v-select",{attrs:{label:"name",name:"subject_id",id:"subject_id",options:e.subjects,placeholder:e.trans("academic.select_subject")},on:{select:e.onSubjectSelect,close:function(t){return e.onlineExamForm.errors.clear("subject_id")},remove:function(t){e.onlineExamForm.subject_id=""}},model:{value:e.selected_subject,callback:function(t){e.selected_subject=t},expression:"selected_subject"}},[e.subjects.length?e._e():a("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[e._v("\n "+e._s(e.trans("general.no_option_found"))+"\n ")])]),e._v(" "),a("show-error",{attrs:{"form-name":e.onlineExamForm,"prop-name":"subject_id"}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.online_exam_date")))]),e._v(" "),a("datepicker",{attrs:{bootstrapStyling:!0,placeholder:e.trans("exam.online_exam_date")},on:{selected:function(t){return e.onlineExamForm.errors.clear("date")}},model:{value:e.onlineExamForm.date,callback:function(t){e.$set(e.onlineExamForm,"date",t)},expression:"onlineExamForm.date"}}),e._v(" "),a("show-error",{attrs:{"form-name":e.onlineExamForm,"prop-name":"date"}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.online_exam_start_time")))]),e._v(" "),a("timepicker",{attrs:{hour:e.start_time.hour,minute:e.start_time.minute,meridiem:e.start_time.meridiem},on:{"update:hour":function(t){return e.$set(e.start_time,"hour",t)},"update:minute":function(t){return e.$set(e.start_time,"minute",t)},"update:meridiem":function(t){return e.$set(e.start_time,"meridiem",t)}}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.online_exam_end_time")))]),e._v(" "),a("timepicker",{attrs:{hour:e.end_time.hour,minute:e.end_time.minute,meridiem:e.end_time.meridiem},on:{"update:hour":function(t){return e.$set(e.end_time,"hour",t)},"update:minute":function(t){return e.$set(e.end_time,"minute",t)},"update:meridiem":function(t){return e.$set(e.end_time,"meridiem",t)}}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.online_exam_passing_percentage")))]),e._v(" "),a("div",{staticClass:"input-group mb-3"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.onlineExamForm.passing_percentage,expression:"onlineExamForm.passing_percentage"}],staticClass:"form-control",attrs:{type:"text",name:"passing_percentage",placeholder:e.trans("exam.online_exam_passing_percentage")},domProps:{value:e.onlineExamForm.passing_percentage},on:{input:function(t){t.target.composing||e.$set(e.onlineExamForm,"passing_percentage",t.target.value)}}}),e._v(" "),e._m(0)]),e._v(" "),a("show-error",{attrs:{"form-name":e.onlineExamForm,"prop-name":"passing_percentage"}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("div",[e._v(e._s(e.trans("exam.online_exam_is_negative_mark_applicable")))]),e._v(" "),a("switches",{staticClass:"m-t-10",attrs:{theme:"bootstrap",color:"success"},model:{value:e.onlineExamForm.is_negative_mark_applicable,callback:function(t){e.$set(e.onlineExamForm,"is_negative_mark_applicable",t)},expression:"onlineExamForm.is_negative_mark_applicable"}}),e._v(" "),a("show-error",{attrs:{"form-name":e.onlineExamForm,"prop-name":"online_exam_is_negative_mark_applicable"}})],1)]),e._v(" "),e.onlineExamForm.is_negative_mark_applicable?a("div",{staticClass:"col-12 col-sm-4"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.online_exam_negative_mark_percentage_per_question")))]),e._v(" "),a("div",{staticClass:"input-group mb-3"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.onlineExamForm.negative_mark_percentage_per_question,expression:"onlineExamForm.negative_mark_percentage_per_question"}],staticClass:"form-control",attrs:{type:"text",name:"negative_mark_percentage_per_question",placeholder:e.trans("exam.online_exam_negative_mark_percentage_per_question")},domProps:{value:e.onlineExamForm.negative_mark_percentage_per_question},on:{input:function(t){t.target.composing||e.$set(e.onlineExamForm,"negative_mark_percentage_per_question",t.target.value)}}}),e._v(" "),e._m(1)]),e._v(" "),a("show-error",{attrs:{"form-name":e.onlineExamForm,"prop-name":"negative_mark_percentage_per_question"}})],1)]):e._e(),e._v(" "),a("div",{staticClass:"col-12"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.online_exam_instructions")))]),e._v(" "),a("html-editor",{attrs:{name:"instructions",model:e.onlineExamForm.instructions,height:"200",isUpdate:!!e.uuid},on:{"update:model":function(t){return e.$set(e.onlineExamForm,"instructions",t)},clearErrors:function(t){return e.onlineExamForm.errors.clear("instructions")}}}),e._v(" "),a("show-error",{attrs:{"form-name":e.onlineExamForm,"prop-name":"instructions"}})],1)]),e._v(" "),a("div",{staticClass:"col-12"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("exam.online_exam_description")))]),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.onlineExamForm.description,expression:"onlineExamForm.description"}],staticClass:"form-control",attrs:{type:"text",name:"description",placeholder:e.trans("exam.online_exam_description")},domProps:{value:e.onlineExamForm.description},on:{input:function(t){t.target.composing||e.$set(e.onlineExamForm,"description",t.target.value)}}}),e._v(" "),a("show-error",{attrs:{"form-name":e.onlineExamForm,"prop-name":"description"}})],1)])]),e._v(" "),a("div",{staticClass:"card-footer text-right"},[a("router-link",{staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/online-exam"}},[e._v(e._s(e.trans("general.cancel")))]),e._v(" "),a("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[e.uuid?a("span",[e._v(e._s(e.trans("general.update")))]):a("span",[e._v(e._s(e.trans("general.save")))])])],1)])])}),[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"input-group-append"},[t("span",{staticClass:"input-group-text"},[this._v("%")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"input-group-append"},[t("span",{staticClass:"input-group-text"},[this._v("%")])])}],!1,null,null,null);t.a=i.exports}}]);
//# sourceMappingURL=edit.js.map?id=f65a9bba1d96b0ada1ac