PageSourceSearch

https://app.coursly.ai/_next/static/chunks/pages/projects/[id]/exam-f42d638d0e51cd09.js

js coursly.ai collected 2026-10-05 09:35:51 UTC 4,255 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7308],{61248:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/projects/[id]/exam",function(){return i(39935)}])},94203:function(e,t,i){"use strict";i.d(t,{s:function(){return v}});var n=i(85893),r=i(28627),o=i(30202),s=i(39332),d=i(11163),a=i(67294),u=i(12446),c=i(54606),l=i(34083),m=i(44673),p=i(71890),f=i(38665),x=i(58558),g=i(87594),w=i(65436);let v=()=>{let e=(0,d.useRouter)(),t="string"==typeof e.query.id?e.query.id:"",i=(0,s.useSearchParams)(),{data:v}=f.Mw.useGetContent(t,e.isReady&&!!t),j=(0,o.NL)(),h=f.Mw.useReorderExamQuestions(),{handleDragStart:y,handleDragUpdate:E,placeholderRender:T}=(0,w.Z)(),b=(0,a.useMemo)(()=>{var e;return[...null!==(e=null==v?void 0:v.sections)&&void 0!==e?e:[]].sort((e,t)=>e.position-t.position).flatMap(e=>[...e.lectures].sort((e,t)=>e.position-t.position))},[v]),[I,S]=(0,a.useState)({}),N=(0,a.useRef)(null);(0,a.useEffect)(()=>{S(Object.fromEntries(b.map(e=>[e.id,[...e.examQuestions].sort((e,t)=>e.position-t.position)])))},[b]);let _=i.get("questionId"),q=(0,a.useMemo)(()=>{let e=new Map,t=1;return b.forEach(i=>{var n;(null!==(n=I[i.id])&&void 0!==n?n:[]).forEach(i=>{e.set(i.id,t),t+=1})}),e},[b,I]);return(0,a.useEffect)(()=>{let e,t;if(!_||!Object.values(I).some(e=>e.some(e=>e.id===_)))return;let i=()=>{void 0!==e&&window.cancelAnimationFrame(e),e=window.requestAnimationFrame(()=>{(0,m.RQ)(_)})},n=new ResizeObserver(()=>{window.clearTimeout(t),t=window.setTimeout(i,50)});N.current&&n.observe(N.current);let r=window.setTimeout(()=>{n.disconnect()},2e3);return i(),()=>{n.disconnect(),window.clearTimeout(r),window.clearTimeout(t),void 0!==e&&window.cancelAnimationFrame(e)}},[I,_]),(0,a.useEffect)(()=>{localStorage.getItem((0,x.Y1)(t))&&localStorage.removeItem((0,x.Y1)(t)),g.V.modifyTrackedStep("curriculumDirty",t,!1),g.V.modifyTrackedStep("examConfigDirty",t,!1)},[t]),(0,n.jsxs)("section",{className:"space-y-5",children:[(0,n.jsx)(l.T,{title:"Exam"}),(0,n.jsx)("div",{className:"relative",ref:N,children:(0,n.jsx)(r.Z5,{onDragEnd:e=>{var i;if(!e.destination||e.destination.droppableId!==e.source.droppableId||e.destination.index===e.source.index)return;let n=e.source.droppableId,r=[...null!==(i=I[n])&&void 0!==i?i:[]],[o]=r.splice(e.source.index,1);r.splice(e.destination.index,0,o),S(e=>({...e,[n]:r.map((e,t)=>({...e,position:t+1}))})),h.mutate({projectId:t,data:{examQuestionId:e.draggableId,position:e.destination.index+1}},{onSuccess:()=>{j.invalidateQueries({queryKey:f.Mw.keys.content(t)})},onError:()=>{S(e=>{var t;return{...e,[n]:[...null!==(t=I[n])&&void 0!==t?t:[]]}})}})},onDragStart:y,onDragUpdate:E,children:b.map(e=>(0,n.jsx)(r.bK,{droppableId:e.id,type:"exam-question-".concat(e.id),children:(i,o)=>{var s;let d=null!==(s=I[e.id])&&void 0!==s?s:[];return(0,n.jsxs)("div",{...i.droppableProps,ref:i.innerRef,className:"relative",children:[0===d.length&&(0,n.jsx)(u.H,{forExam:!0,segment:void 0,id:t,lectureContent:e,lectureId:e.id}),d.map((i,o)=>(0,n.jsxs)(a.Fragment,{children:[(0,n.jsx)(r._l,{draggableId:i.id,index:o,children:e=>(0,n.jsx)("div",{id:(0,m.g4)(i.id),"data-exam-question-id":i.id,className:"my-5 scroll-mt-24",ref:e.innerRef,...e.draggableProps,children:(0,n.jsx)("div",{className:"space-y-5",children:(0,n.jsx)(c.X,{type:p.w.SegmentType.enum.QUESTION,questionNumber:q.get(i.id),segment:{id:i.id,position:i.position,segmentType:p.w.SegmentType.enum.QUESTION,questionSegment:i},dragHandleProps:e.dragHandleProps})})})}),(0,n.jsx)(u.H,{forExam:!0,segment:{id:i.id,position:i.position,segmentType:p.w.SegmentType.enum.QUESTION,questionSegment:i},id:t,lectureContent:e,lectureId:e.id})]},i.id)),T(i,o)]})}},e.id))})})]})}},39935:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return u}});var n=i(85893),r=i(67421),o=i(94203),s=i(95841),d=i(9177),a=i(76298);function u(){let{t:e}=(0,r.$G)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.Y,{title:e("projects.head.title"),description:e("projects.head.description")}),(0,n.jsx)(d._,{children:(0,n.jsx)(a.e,{children:(0,n.jsx)(o.s,{})})})]})}}},function(e){e.O(0,[5062,6911,1509,3127,5033,1477,1471,101,318,8074,2266,6058,202,5586,1883,2651,8635,7454,1590,779,2888,9774,179],function(){return e(e.s=61248)}),_N_E=e.O()}]);

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.