Buckets:
| import"./DsnmJJEf.js";import{C as Z,D as $,l as ee,F as ae,G as te,H as P,I as re,p as se,J as D,K as Y,o as oe,A as j,L as ne,a as h,b as le,M as ce,s as I,c as g,d as p,N as q,f as ie,O as r,r as b,B as de,P as ve,Q as fe,R as w}from"./BSLaTJ2c.js";import{i as F}from"./BleB-t_z.js";import{aG as _e,aH as ue,aI as B,aJ as me,aK as he}from"./B0fRHuno.js";const G=new Set;function pe(v,c,a,i,n=i){var k=a.getAttribute("type")==="checkbox",s=v;let f=!1;if(c!==null)for(var x of c)s=s[x]??=[];s.push(a),Z(a,"change",()=>{var e=a.__value;k&&(e=N(s,e,a.checked)),n(e)},()=>n(k?[]:null)),$(()=>{var e=i();if(ee&&a.defaultChecked!==a.checked){f=!0;return}k?(e=e||[],a.checked=e.includes(a.__value)):a.checked=ae(a.__value,e)}),te(()=>{var e=s.indexOf(a);e!==-1&&s.splice(e,1)}),G.has(s)||(G.add(s),P(()=>{s.sort((e,d)=>e.compareDocumentPosition(d)===4?-1:1),G.delete(s)})),P(()=>{if(f){var e;if(k)e=N(s,e,a.checked);else{var d=s.find(M=>M.checked);e=d?.__value}n(e)}})}function N(v,c,a){for(var i=new Set,n=0;n<v.length;n+=1)v[n].checked&&i.add(v[n].__value);return a||i.delete(c),Array.from(i)}const H=re({});var be=g('<div><span class="font-bold"> </span> <!></div>'),ge=g('<label class="block"><input autocomplete="off" class="form-input -mt-1.5 mr-2" name="choice" type="checkbox"/> <!></label> <!>',1),ke=g('<span class="text-red-900 dark:text-red-200">Looks like at least one of your answers is wrong, try again!</span>'),xe=g(`<span class="text-red-900 dark:text-red-200">You didn't select all the correct answers, there's more!</span>`),we=g('<span class="text-green-900 dark:text-green-200">You got all the answers!</span>'),ye=g('<div class="font-semibold leading-snug"><!></div>'),Ce=g('<div><form><!> <div class="flex flex-row items-center mt-3"><button class="btn px-4 mr-4" type="submit">Submit</button> <!></div></form></div>');function Me(v,c){se(c,!0);const a=()=>fe(H,"$answers",i),[i,n]=ce(),k=[],s=R();let f=D(!1),x=D(!1),e=D(Y([])),d=D(Y([]));oe(()=>{q(H,{...a(),[s]:{correct:!1}})});function M(){w(f,!1),w(x,!1);for(let t=0;t<c.choices.length;t++){const _=c.choices[t];_.correct&&!r(e).includes(t)?w(x,!0):!_.correct&&r(e).includes(t)&&w(f,!0)}if(w(d,r(e),!0),q(H,{...a(),[s]:{correct:!r(x)&&!r(f)}}),Object.values(a()).every(({correct:t})=>t)){const t=new Event("ChapterComplete");window.dispatchEvent(t)}}function R(l="_"){return`${l}${Math.random().toString(36).substr(2,9)}`}var O=Ce(),Q=p(O),J=p(Q);_e(J,17,()=>c.choices,he,(l,t,_)=>{var A=ge(),y=ie(A),u=p(y);ue(u),u.value=u.__value=_;var o=I(u,2);B(o,()=>r(t).text),b(y);var m=I(y,2);{var U=C=>{var S=be(),E=p(S),W=p(E,!0);b(E);var X=I(E,2);B(X,()=>r(t).explain),b(S),j(()=>{me(S,1,`alert alert-${r(t).correct?"success":"error"} mt-1 mb-2.5 leading-normal`),de(W,r(t).correct?"Correct!":"Incorrect.")}),h(C,S)},V=ve(()=>r(d)&&r(d).includes(_));F(m,C=>{r(V)&&C(U)})}pe(k,[],u,()=>r(e),C=>w(e,C)),h(l,A)});var K=I(J,2),L=p(K),z=I(L,2);{var T=l=>{var t=ye(),_=p(t);{var A=o=>{var m=ke();h(o,m)},y=o=>{var m=xe();h(o,m)},u=o=>{var m=we();h(o,m)};F(_,o=>{r(f)?o(A):r(x)?o(y,1):o(u,-1)})}b(t),h(l,t)};F(z,l=>{r(d).length&&l(T)})}b(K),b(Q),b(O),j(()=>L.disabled=!r(e).length),ne("submit",Q,l=>{l.preventDefault(),M()}),h(v,O),le(),n()}export{Me as Q}; | |
Xet Storage Details
- Size:
- 3.22 kB
- Xet hash:
- 23d2d452b9548f978983b8d148a948a680fb3651ea5b6032bfb6c962fbf3587f
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.