0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.21.12.41


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/PrepareQuestionPaper-ChAqcXTn.js

import{v as L,E as _,x as w,V as B,r as a,t as e,D,B as d,L as E,F as p}from"./index-CYIKbhnb.js";import{S}from"./index-D47VtnHA.js";import{R as M}from"./ArrowLeftOutlined-jYyloEFF.js";import{R as N}from"./HomeOutlined-CvmI8okJ.js";import{R as q,C as l}from"./row-Dqg1Zeqa.js";import"./responsiveObserver-DfClcaWx.js";const O=t=>async(i,r)=>{try{const n=r(),x=localStorage.getItem("dbname"),c=await L.get("app.php?a=getTemplateDetails&db="+x+"&teachcode="+n.loginfo.userData.fregno+"&data="+JSON.stringify(t)+"&usertype="+n.loginfo.userData.fusertype);i({type:"UNSET_LOADER"}),c.data.error_code===0?i({type:"GET_TEMPLATE_DETAILS",payload:c.data.data}):i({type:"GET_TEMPLATE_DETAILS",payload:[]})}catch(n){_("error",n.message)}},z=t=>{var f,j,h;const i=B(),[r,n]=a.useState([]),[x,c]=a.useState([]),[T,b]=a.useState(""),[P,Q]=a.useState(""),[k,A]=a.useState(""),[I,u]=a.useState(1);a.useEffect(()=>{t.getTemplateDetails(i)},[]),a.useEffect(()=>{n(t.templateDetails)},[t.templateDetails]),a.useEffect(()=>{n(r)},[r]);const R=async(s,o,m)=>{b(s.fqncode),Q(o),A(m)},v=()=>{const s={};s.fqncode=T+I,s.fquestionno="",s.fquestion="",s.fkeyAns="",s.fmaxmarks="",s.fco="",s.fpo="",s.fblooms="",s.ftype="Description",c([...x,s]),u(o=>o+1)},C=()=>{const s=[...r];s[P].fdata[k].fqnarr=x,n(s),c([]),u(1)};return console.log(r,"SDsjdksd"),e.jsxs("div",{children:[e.jsx(D,{style:{margin:"6rem 10px 10px"},title:e.jsx("h6",{children:"Prepare Question Paper"}),extra:e.jsxs(S,{children:[e.jsx(d,{onClick:()=>v(),children:"Add"}),e.jsx(E,{to:t.user.fusertype==="M"?"/qpsettings/mod-qp-det-online":"/qpsettings/prepare-qp",children:e.jsxs(d,{style:{background:"green",color:"white"},children:[e.jsx(M,{}),"Back"]})}),e.jsx(E,{to:"/",children:e.jsxs(d,{type:"primary",danger:!0,children:[e.jsx(N,{})," Exit"]})})]}),children:e.jsx("div",{style:{height:"160px",overflowY:"auto"},children:r.map((s,o)=>{var m;return e.jsxs("div",{children:[e.jsx("span",{children:e.jsxs("b",{children:[s.fpartcode+" - "+s.fpartdesc,":"]})}),(m=s.fdata)==null?void 0:m.map((g,y)=>e.jsx(d,{size:"small",style:{margin:"4px",marginBottom:"3px"},onClick:()=>{R(g,o,y)},children:g.fqnno},y))]},o)})})}),e.jsx("div",{children:(h=(j=(f=r[0])==null?void 0:f.fdata[0])==null?void 0:j.fqnarr)==null?void 0:h.map((s,o)=>e.jsxs(D,{style:{margin:"10px"},extra:e.jsx(S,{}),children:[e.jsxs(q,{gutter:16,children:[e.jsxs(l,{span:4,children:[e.jsx("label",{children:"Qn. No."}),e.jsx(p,{})]}),e.jsxs(l,{span:4,children:[e.jsx("label",{children:"Max. Marks"}),e.jsx(p,{})]}),e.jsxs(l,{span:4,children:[e.jsx("label",{children:"CO"}),e.jsx(p,{})]}),e.jsxs(l,{span:4,children:[e.jsx("label",{children:"PO"}),e.jsx(p,{})]}),e.jsxs(l,{span:4,children:[e.jsx("label",{children:"Blooms"}),e.jsx(p,{})]})]}),e.jsx(q,{children:e.jsx(l,{style:{marginTop:"10px"},span:24,children:e.jsx(d,{type:"primary",size:"medium",style:{float:"right"},onClick:()=>C(),children:"Next"})})})]}))})]})},G=t=>(console.log(t.getTemplateDetails),{templateDetails:t.getTemplateDetails,user:t.loginfo.userData}),$=w(G,{getTemplateDetails:O})(z);export{$ as default};