PageSourceSearch

https://www.newyork-caregivers.com/build/assets/ListQuestions-CbgocRn-.js

js newyork-caregivers.com collected 2026-09-29 14:46:37 UTC 6,880 bytes, 2 lines download raw bytes

1import{a1 as h}from"./eventRegistrationStore-BKMDP8zw.js";import{_ as M}from"./lodash-BDM9Oydj.js";import{d as q}from"./JoinVideoConference-B9qMm05l.js";import{a as w}from"./advancedFormat-DJJpiMjt.js";import{a as x}from"./SelectOrganization-erOTAgfa.js";import{a6 as y,Z as o,j as n,g as s,F as a,a4 as p,ad as u,i as d,aP as z,aN as f,aG as g,aC as C,p as _}from"./vendor-core-CnGKUgNT.js";import{g as Q}from"./trualta-global-data-types-CT_5hg_q.js";import"./ForumGuidelinesContent-u0IpKM3r.js";import"./LocalEventConfirmationLink-D72Zqb-T.js";import"./HeaderItem-Bh2UgW68.js";import"./EventWaitlist-DNtR5ZIV.js";import"./vendor-icons-DDA5alrB.js";import"./vendor-sentry-4qddCGQY.js";import"./app-routes-CoXjSNtd.js";import"./LanguageSelectList-DekiRKiq.js";import"./ProfileSectionCard-BW3jF75q.js";import"./app-config-DTIlHeu1.js";import"./sweetalert2.esm.all-BiAqYaRy.js";try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="c1cbe474-b76a-453c-969d-91c49b86bce7",t._sentryDebugIdIdentifier="sentry-dbid-c1cbe474-b76a-453c-969d-91c49b86bce7")}catch{}q.extend(w);const D={props:["quizid"],components:{VSweetAlert:x},data(){return{quiz:"",errors:!1,errorMsg:"",success:!1,successMsg:[],quizBackup:""}},created(){this.$http.get(h+"/questions/"+this.quizid).then(t=>{this.quiz=t.data.data[0],this.quizBackup=JSON.parse(JSON.stringify(this.quiz))},t=>{console.error("error",t)}),window.eventBus.$on("question-added",t=>{this.quiz.questions.push(t),this.success=!0,this.successMsg=["New Question added successfully."]}),window.eventBus.$on("question-updated",()=>{this.success=!0,this.successMsg=["Question updated successfully."]}),this.hideSessionMsg()},methods:{formatDateTime(t){return q(t).format("MMMM Do YYYY")},getCorrectAns(t){let e="";return M.forEach(t,(m,b)=>{m.is_correct==1&&(e+=b+1+",")}),e.substring(0,e.length-1)},updateQuiz(){this.resetMessageObj();const t=this.sanitizeQuiz(this.quiz);this.$http.put(h+"/"+this.quizid,t).then(e=>{this.success=!0,this.successMsg.push(e.data.message)},e=>{this.errors=!0,this.errorMsg=e.response.data.data})},deleteQuestion(t){this.resetMessageObj(),this.$http.delete(`${h}/questions/${t.question.id}`).then(e=>{e.status==200&&(this.quiz.questions.splice(t.key,1),this.success=!0,this.successMsg.push(e.data.message))})},resetMessageObj(){this.errors=!1,this.errorMsg="",this.success=!1,this.successMsg=[]},cancelClicked(){this.quiz.title=this.quizBackup.title,this.quiz.description=this.quizBackup.description,this.quiz.max_score=this.quizBackup.max_score,window.location.href="/admin/quiz"},hideSessionMsg(){let t=document.getElementById("flash_notification");t&&setTimeout(()=>{t.remove()},1e4)}
1,sanitizeQuiz(t){const e={};for(let m in t)e[m]=this.sanitizeInput(t[m]);return e},sanitizeInput(t){return typeof t=="string"?t.replace(/'/g,"\\'").replace(/"/g,'\\"'):t}}},B={class:"control"},N={class:"form-style"},S={key:0},I={class:"notification is-success"},A={key:1},T={class:"field"},V={key:0},j={key:0,class:"help is-danger"},O={class:"field"},U={key:0},Y={key:0,class:"help is-danger"},E={class:"field"},J={key:0},F={key:0,class:"help is-danger"},G={class:"field"},L={key:0},P={key:0,class:"help is-danger"},R={class:"field"},Z={class:"table is-striped"};function H(t,e,m,b,r,c){const k=y("edit-question"),v=y("v-sweet-alert");return o(),n("div",B,[s("div",N,[r.success?(o(),n("div",S,[(o(!0),n(a,null,p(r.successMsg,(i,l)=>(o(),n("div",{key:l},[s("div",I,u(i),1)]))),128))])):d("",!0),r.errors?(o(),n("div",A,[...e[7]||(e[7]=[s("span",{class:"help is-danger"},"Update failed",-1)])])):d("",!0),s("form",{onSubmit:e[6]||(e[6]=z((...i)=>c.updateQuiz&&c.updateQuiz(...i),["prevent"]))},[s("div",T,[e[8]||(e[8]=s("label",{class:"label"},"Quiz Title:",-1)),f(s("input",{class:"input",type:"text",id:"title","onUpdate:modelValue":e[0]||(e[0]=i=>r.quiz.title=i),required:""},null,512),[[g,r.quiz.title]]),r.errors?(o(),n("div",V,[r.errorMsg.title?(o(),n("span",j,[(o(!0),n(a,null,p(r.errorMsg.title,(i,l)=>(o(),n("span",{key:l},u(i),1))),128))])):d("",!0)])):d("",!0)]),s("div",O,[e[9]||(e[9]=s("label",{class:"label"},"Quiz Description:",-1)),f(s("textarea",{class:"textarea",name:"desc",id:"",cols:"30",rows:"10","onUpdate:modelValue":e[1]||(e[1]=i=>r.quiz.description=i)},null,512),[[g,r.quiz.description]]),r.errors?(o(),n("div",U,[r.errorMsg.description?(o(),n("span",Y,[(o(!0),n(a,null,p(r.errorMsg.description,(i,l)=>(o(),n("span",{key:l},u(i),1))),128))])):d("",!0)])):d("",!0)]),s("div",E,[e[10]||(e[10]=s("label",{class:"label"},"Quiz Care Rewards:",-1)),f(s("input",{class:"input",type:"number",id:"credits","onUpdate:modelValue":e[2]||(e[2]=i=>r.quiz.max_score=i),required:"",min:"1"},null,512),[[g,r.quiz.max_score]]),r.errors?(o(),n("div",J,[r.errorMsg.max_score?(o(),n("span",F,[(o(!0),n(a,null,p(r.errorMsg.max_score,(i,l)=>(o(),n("span",{key:l},u(i),1))),128))])):d("",!0)])):d("",!0)]),s("div",G,[e[11]||(e[11]=s("label",{class:"label"},"Click here to add this Quiz for certification",-1)),f(s("input",{class:"checkbox",type:"checkbox",id:"is_certification","onUpdate:modelValue":e[3]||(e[3]=i=>r.quiz.is_certification=i),onClick:e[4]||(e[4]=i=>r.quiz.is_certification=!r.quiz.is_certification)},null,512),[[C,r.quiz.is_certification]]),r.errors?(o(),n("div",L,[r.errorMsg.is_certification?(o(),n("span",P,[(o(!0),n(a,null,p(r.errorMsg.is_certification,(i,l)=>(o(),n("span",{key:l},u(i),1))),128))])):d("",!0)])):d("",!0)]),s("div",R,[e[12]||(e[12]=s("button",{type:"submit",class:"ds-button"},"Save Changes",-1)),s("button",{class:"ds-button ds-button--outlined",onClick:e[5]||(e[5]=z((...i)=>c.cancelClicked&&c.cancelClicked(...i),["stop","prevent"]))}," Cancel ")]),e[13]||(e[13]=s("div",{class:"field"},null,-1)),e[14]||(e[14]=s("br",null,null,-1))],32)]),s("table",Z,[e[15]||(e[15]=s("thead",null,[s("tr",null,[s("th",null,"Global Id"),s("th",null,"Question"),s("th",null,"Type"),s("th",null,"Correct Answer"),s("th",null,"Updated on"),s("th",null,"Actions")])],-1)),s("tbody",null,[(o(!0),n(a,null,p(r.quiz.questions,(i,l)=>(o(),n("tr",{key:l},[s("td",null,u(i.global_id),1),s("td",null,u(i.stem),1),s("td",null,u(i.question_type),1),s("td",null,u(c.getCorrectAns(i.options)),1),s("td",null,u(c.formatDateTime(i.updated_at)),1),s("td",null,[_(k,{"clone-question":JSON.parse(JSON.stringify(i)),"question-obj":i},null,8,["clone-question","question-obj"]),_(v,{title:"Delete",text:"Are you sure you want to delete Question?","button-text":"Delete","show-cancel-button":"","show-confirm-button":"","confirm-button-text":"Yes","cancel-button-text":"No",onConfirm:c.deleteQuestion,payload:{question:i,key:l}},null,8,["onConfirm","payload"])])]))),128))])])])}const fe=Q(D,[["render",H]]);export{fe as default};
2//# sourceMappingURL=ListQuestions-CbgocRn-.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.