@citolab/qti-components 7.0.1 → 7.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +8297 -0
  3. package/dist/custom-elements.json +27271 -0
  4. package/dist/{qti-test/index.d.ts → index.d.ts} +170 -4
  5. package/dist/index.js +17164 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/item.css +257 -46
  8. package/dist/{qti-loader → loader}/index.d.ts +1 -1
  9. package/dist/qti-components-jsx.d.ts +33 -61
  10. package/dist/{qti-simple-choice-CynLWb8d.d.cts → qti-simple-choice-UTrFa_RQ.d.ts} +11 -19
  11. package/dist/vscode.html-custom-data.json +15 -11
  12. package/package.json +41 -58
  13. package/readme.md +55 -0
  14. package/README.md +0 -85
  15. package/cdn/index.min.cjs +0 -4489
  16. package/cdn/index.min.js +0 -4489
  17. package/dist/qti-components/index.cjs +0 -6704
  18. package/dist/qti-components/index.cjs.map +0 -1
  19. package/dist/qti-components/index.d.cts +0 -150
  20. package/dist/qti-components/index.d.ts +0 -150
  21. package/dist/qti-components/index.js +0 -6593
  22. package/dist/qti-components/index.js.map +0 -1
  23. package/dist/qti-item/index.cjs +0 -89
  24. package/dist/qti-item/index.cjs.map +0 -1
  25. package/dist/qti-item/index.d.cts +0 -24
  26. package/dist/qti-item/index.d.ts +0 -24
  27. package/dist/qti-item/index.js +0 -65
  28. package/dist/qti-item/index.js.map +0 -1
  29. package/dist/qti-loader/index.cjs +0 -332
  30. package/dist/qti-loader/index.cjs.map +0 -1
  31. package/dist/qti-loader/index.d.cts +0 -20
  32. package/dist/qti-simple-choice-CynLWb8d.d.ts +0 -1185
  33. package/dist/qti-test/index.cjs +0 -4632
  34. package/dist/qti-test/index.cjs.map +0 -1
  35. package/dist/qti-test/index.d.cts +0 -304
  36. package/dist/qti-test/index.js +0 -4599
  37. package/dist/qti-test/index.js.map +0 -1
  38. package/dist/qti-transformers/index.cjs +0 -316
  39. package/dist/qti-transformers/index.cjs.map +0 -1
  40. package/dist/qti-transformers/index.d.cts +0 -75
  41. /package/dist/{qti-loader → loader}/index.js +0 -0
  42. /package/dist/{qti-loader → loader}/index.js.map +0 -0
  43. /package/dist/{qti-transformers → transformers}/index.d.ts +0 -0
  44. /package/dist/{qti-transformers → transformers}/index.js +0 -0
  45. /package/dist/{qti-transformers → transformers}/index.js.map +0 -0
package/cdn/index.min.cjs DELETED
@@ -1,4489 +0,0 @@
1
- var _e=Object.defineProperty;var Ei=Object.getOwnPropertyDescriptor;var js=Object.getOwnPropertyNames;var Ws=Object.prototype.hasOwnProperty;var Xs=(s,e,t)=>e in s?_e(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var Ys=(s,e)=>{for(var t in e)_e(s,t,{get:e[t],enumerable:!0})},Gs=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of js(e))!Ws.call(s,i)&&i!==t&&_e(s,i,{get:()=>e[i],enumerable:!(r=Ei(e,i))||r.enumerable});return s};var Ks=s=>Gs(_e({},"__esModule",{value:!0}),s),l=(s,e,t,r)=>{for(var i=r>1?void 0:r?Ei(e,t):e,o=s.length-1,n;o>=0;o--)(n=s[o])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&_e(e,t,i),i};var z=(s,e,t)=>Xs(s,typeof e!="symbol"?e+"":e,t);var jo={};Ys(jo,{ActiveElementMixin:()=>Y,Interaction:()=>C,QtiAnd:()=>Ke,QtiAssessmentItem:()=>D,QtiAssessmentItemRef:()=>F,QtiAssessmentSection:()=>B,QtiAssessmentStimulusRef:()=>$t,QtiAssessmentTest:()=>ft,QtiAssociableHotspot:()=>qe,QtiAssociateInteraction:()=>Nt,QtiBaseValue:()=>Ze,QtiChoiceInteraction:()=>Dt,QtiCompanionMaterialsInfo:()=>Fe,QtiConditionExpression:()=>H,QtiContains:()=>Dr,QtiContentBody:()=>Be,QtiCorrect:()=>Ir,QtiCustomInteraction:()=>ot,QtiCustomOperator:()=>xe,QtiEndAttemptInteraction:()=>Pt,QtiEqual:()=>Qe,QtiEqualRounded:()=>Je,QtiExpression:()=>_,QtiExtendedTextInteraction:()=>O,QtiFeedbackBlock:()=>ne,QtiFeedbackInline:()=>ae,QtiGap:()=>Ot,QtiGapImg:()=>Ht,QtiGapMatchInteraction:()=>ue,QtiGapText:()=>Vt,QtiGraphicAssociateInteraction:()=>Q,QtiGraphicGapMatchInteraction:()=>ge,QtiGraphicOrderInteraction:()=>fe,QtiGt:()=>Nr,QtiGte:()=>Pr,QtiHotspotChoice:()=>zt,QtiHotspotInteraction:()=>be,QtiHottext:()=>we,QtiHottextInteraction:()=>Xe,QtiInlineChoice:()=>Ee,QtiInlineChoiceInteraction:()=>ct,QtiIsNull:()=>Or,QtiItem:()=>sr,QtiItemBody:()=>oe,QtiItemMixin:()=>wi,QtiLookupOutcomeValue:()=>Ge,QtiLt:()=>Hr,QtiLte:()=>Vr,QtiMapResponse:()=>tr,QtiMapping:()=>It,QtiMatch:()=>zr,QtiMatchInteraction:()=>pt,QtiMediaInteraction:()=>ve,QtiMember:()=>Ur,QtiModalFeedback:()=>le,QtiMultiple:()=>Fr,QtiNot:()=>Br,QtiOr:()=>jr,QtiOrderInteraction:()=>nt,QtiOrdered:()=>Wr,QtiOutcomeDeclaration:()=>G,QtiOutcomeProcessing:()=>ce,QtiOutcomeProcessingProcessor:()=>Sr,QtiPortableCustomInteraction:()=>Ct,QtiPositionObjectInteraction:()=>ir,QtiPositionObjectStage:()=>ye,QtiPrintedVariable:()=>he,QtiProduct:()=>Xr,QtiPrompt:()=>ze,QtiResponseCondition:()=>Rr,QtiResponseDeclaration:()=>it,QtiResponseElse:()=>de,QtiResponseElseIf:()=>$r,QtiResponseIf:()=>pe,QtiResponseProcessing:()=>Et,QtiRubricBlock:()=>K,QtiRule:()=>J,QtiSelectPointInteraction:()=>ht,QtiSetOutcomeValue:()=>Mr,QtiSetOutcomeValueRule:()=>Lr,QtiSimpleAssociableChoice:()=>dt,QtiSimpleChoice:()=>Ut,QtiSliderInteraction:()=>I,QtiStringMatch:()=>rr,QtiStylesheet:()=>Ue,QtiSubtract:()=>er,QtiSum:()=>Yr,QtiSumExpression:()=>Gr,QtiTest:()=>Ie,QtiTestPart:()=>j,QtiTextEntryInteraction:()=>Z,QtiVariable:()=>Kr,TestContainer:()=>Mt,TestItemLink:()=>re,TestNext:()=>te,TestPagingButtonsStamp:()=>Lt,TestPrev:()=>ee,TestView:()=>W,getItemByUri:()=>Bo,getManifestInfo:()=>Fo,itemContext:()=>$,itemContextVariables:()=>vi,qtiAndMixin:()=>Ds,qtiSubtractMixin:()=>Is,qtiTransformItem:()=>Rt,qtiTransformManifest:()=>pi,qtiTransformTest:()=>Jt});module.exports=Ks(jo);var mt=class extends Event{constructor(e,t,r){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.callback=t,this.subscribe=r??!1}};var Ft=class{constructor(e,t,r,i){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(o,n)=>{this.unsubscribe&&(this.unsubscribe!==n&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=o,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(o,n)),this.unsubscribe=n},this.host=e,t.context!==void 0){let o=t;this.context=o.context,this.callback=o.callback,this.subscribe=o.subscribe??!1}else this.context=t,this.callback=r,this.subscribe=i??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new mt(this.context,this.t,this.subscribe))}};var or=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){let r=t||!Object.is(e,this.o);this.o=e,r&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(let[t,{disposer:r}]of this.subscriptions)t(this.o,r)},e!==void 0&&(this.value=e)}addCallback(e,t,r){if(!r)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});let{disposer:i}=this.subscriptions.get(e);e(this.value,i)}clearCallbacks(){this.subscriptions.clear()}};var Qr=class extends Event{constructor(e){super("context-provider",{bubbles:!0,composed:!0}),this.context=e}},Bt=class extends or{constructor(e,t,r){super(t.context!==void 0?t.initialValue:r),this.onContextRequest=i=>{let o=i.composedPath()[0];i.context===this.context&&o!==this.host&&(i.stopPropagation(),this.addCallback(i.callback,o,i.subscribe))},this.onProviderRequest=i=>{let o=i.composedPath()[0];if(i.context!==this.context||o===this.host)return;let n=new Set;for(let[a,{consumerHost:c}]of this.subscriptions)n.has(a)||(n.add(a),c.dispatchEvent(new mt(this.context,a,!0)));i.stopPropagation()},this.host=e,t.context!==void 0?this.context=t.context:this.context=t,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Qr(this.context))}};function jt({context:s}){return(e,t)=>{let r=new WeakMap;if(typeof t=="object")return t.addInitializer(function(){r.set(this,new Bt(this,{context:s}))}),{get(){return e.get.call(this)},set(i){return r.get(this)?.setValue(i),e.set.call(this,i)},init(i){return r.get(this)?.setValue(i),i}};{e.constructor.addInitializer(n=>{r.set(n,new Bt(n,{context:s}))});let i=Object.getOwnPropertyDescriptor(e,t),o;if(i===void 0){let n=new WeakMap;o={get(){return n.get(this)},set(a){r.get(this).setValue(a),n.set(this,a)},configurable:!0,enumerable:!0}}else{let n=i.set;o={...i,set(a){r.get(this).setValue(a),n?.call(this,a)}}}return void Object.defineProperty(e,t,o)}}}function T({context:s,subscribe:e}){return(t,r)=>{typeof r=="object"?r.addInitializer(function(){new Ft(this,{context:s,callback:i=>{t.set.call(this,i)},subscribe:e})}):t.constructor.addInitializer(i=>{new Ft(i,{context:s,callback:o=>{i[r]=o},subscribe:e})})}}var _i=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var ki=new WeakMap,ke=s=>{let e=ki.get(s);return e===void 0&&ki.set(s,e=new Map),e},Zs=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(ke(this)).map(([e,t])=>({name:e,value:t}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,t){ke(this).set(e,String(t))}removeAttribute(e){ke(this).delete(e)}toggleAttribute(e,t){if(this.hasAttribute(e)){if(t===void 0||!t)return this.removeAttribute(e),!1}else return t===void 0||t?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return ke(this).has(e)}attachShadow(e){let t={host:this};return this.__shadowRootMode=e.mode,e&&e.mode==="open"&&(this.__shadowRoot=t),t}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let e=new _i(this);return this.__internals=e,e}getAttribute(e){return ke(this).get(e)??null}};var Js=class extends Zs{},Ti=Js;var Qs=class{constructor(){this.__definitions=new Map}define(e,t){if(this.__definitions.has(e))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
2
- Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:t.observedAttributes??[]})}get(e){return this.__definitions.get(e)?.ctor}},to=Qs;var Ai=new to;var Te=globalThis,nr=Te.ShadowRoot&&(Te.ShadyCSS===void 0||Te.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ti=Symbol(),Si=new WeakMap,Ae=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==ti)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(nr&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=Si.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Si.set(t,e))}return e}toString(){return this.cssText}},Ri=s=>new Ae(typeof s=="string"?s:s+"",void 0,ti),b=(s,...e)=>{let t=s.length===1?s[0]:e.reduce((r,i,o)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+s[o+1],s[0]);return new Ae(t,s,ti)},ei=(s,e)=>{if(nr)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),i=Te.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=t.cssText,s.appendChild(r)}},ar=nr||Te.CSSStyleSheet===void 0?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return Ri(t)})(s):s;var{is:eo,defineProperty:ro,getOwnPropertyDescriptor:io,getOwnPropertyNames:so,getOwnPropertySymbols:oo,getPrototypeOf:no}=Object,U=globalThis;U.customElements??(U.customElements=Ai);var Mi=U.trustedTypes,ao=Mi?Mi.emptyScript:"",lo=U.reactiveElementPolyfillSupport,Se=(s,e)=>s,Re={toAttribute(s,e){switch(e){case Boolean:s=s?ao:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},lr=(s,e)=>!eo(s,e),Li={attribute:!0,type:String,converter:Re,reflect:!1,hasChanged:lr};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),U.litPropertyMetadata??(U.litPropertyMetadata=new WeakMap);var at=class extends(globalThis.HTMLElement??Ti){static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Li){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&ro(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){let{get:i,set:o}=io(this.prototype,e)??{get(){return this[t]},set(n){this[t]=n}};return{get(){return i?.call(this)},set(n){let a=i?.call(this);o.call(this,n),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Li}static _$Ei(){if(this.hasOwnProperty(Se("elementProperties")))return;let e=no(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Se("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Se("properties"))){let t=this.properties,r=[...so(t),...oo(t)];for(let i of r)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let i of r)t.unshift(ar(i))}else e!==void 0&&t.push(ar(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ei(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){let r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(i!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:Re).toAttribute(t,r.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,t){let r=this.constructor,i=r._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let o=r.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:Re;this._$Em=i,this[i]=n.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){if(r??(r=this.constructor.getPropertyOptions(e)),!(r.hasChanged??lr)(this[e],t))return;this.P(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[i,o]of r)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(t)):this._$EU()}catch(r){throw e=!1,this._$EU(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}};at.elementStyles=[],at.shadowRootOptions={mode:"open"},at[Se("elementProperties")]=new Map,at[Se("finalized")]=new Map,lo?.({ReactiveElement:at}),(U.reactiveElementVersions??(U.reactiveElementVersions=[])).push("2.0.4");var Wt=globalThis,cr=Wt.trustedTypes,$i=cr?cr.createPolicy("lit-html",{createHTML:s=>s}):void 0,ii="$lit$",lt=`lit$${Math.random().toFixed(9).slice(2)}$`,si="?"+lt,co=`<${si}>`,Tt=Wt.document===void 0?{createTreeWalker:()=>({})}:document,Le=()=>Tt.createComment(""),$e=s=>s===null||typeof s!="object"&&typeof s!="function",oi=Array.isArray,Hi=s=>oi(s)||typeof s?.[Symbol.iterator]=="function",ri=`[
3
- \f\r]`,Me=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Di=/-->/g,Ii=/>/g,_t=RegExp(`>|${ri}(?:([^\\s"'>=/]+)(${ri}*=${ri}*(?:[^
4
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Ni=/'/g,Pi=/"/g,Vi=/^(?:script|style|textarea|title)$/i,ni=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),h=ni(1),ai=ni(2),$n=ni(3),R=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),Oi=new WeakMap,kt=Tt.createTreeWalker(Tt,129);function zi(s,e){if(!oi(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return $i!==void 0?$i.createHTML(e):e}var Ui=(s,e)=>{let t=s.length-1,r=[],i,o=e===2?"<svg>":e===3?"<math>":"",n=Me;for(let a=0;a<t;a++){let c=s[a],d,u,m=-1,f=0;for(;f<c.length&&(n.lastIndex=f,u=n.exec(c),u!==null);)f=n.lastIndex,n===Me?u[1]==="!--"?n=Di:u[1]!==void 0?n=Ii:u[2]!==void 0?(Vi.test(u[2])&&(i=RegExp("</"+u[2],"g")),n=_t):u[3]!==void 0&&(n=_t):n===_t?u[0]===">"?(n=i??Me,m=-1):u[1]===void 0?m=-2:(m=n.lastIndex-u[2].length,d=u[1],n=u[3]===void 0?_t:u[3]==='"'?Pi:Ni):n===Pi||n===Ni?n=_t:n===Di||n===Ii?n=Me:(n=_t,i=void 0);let y=n===_t&&s[a+1].startsWith("/>")?" ":"";o+=n===Me?c+co:m>=0?(r.push(d),c.slice(0,m)+ii+c.slice(m)+lt+y):c+lt+(m===-2?a:y)}return[zi(s,o+(s[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},De=class s{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let o=0,n=0,a=e.length-1,c=this.parts,[d,u]=Ui(e,t);if(this.el=s.createElement(d,r),kt.currentNode=this.el.content,t===2||t===3){let m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(i=kt.nextNode())!==null&&c.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let m of i.getAttributeNames())if(m.endsWith(ii)){let f=u[n++],y=i.getAttribute(m).split(lt),x=/([.?@])?(.*)/.exec(f);c.push({type:1,index:o,name:x[2],strings:y,ctor:x[1]==="."?pr:x[1]==="?"?hr:x[1]==="@"?ur:St}),i.removeAttribute(m)}else m.startsWith(lt)&&(c.push({type:6,index:o}),i.removeAttribute(m));if(Vi.test(i.tagName)){let m=i.textContent.split(lt),f=m.length-1;if(f>0){i.textContent=cr?cr.emptyScript:"";for(let y=0;y<f;y++)i.append(m[y],Le()),kt.nextNode(),c.push({type:2,index:++o});i.append(m[f],Le())}}}else if(i.nodeType===8)if(i.data===si)c.push({type:2,index:o});else{let m=-1;for(;(m=i.data.indexOf(lt,m+1))!==-1;)c.push({type:7,index:o}),m+=lt.length-1}o++}}static createElement(e,t){let r=Tt.createElement("template");return r.innerHTML=e,r}};function At(s,e,t=s,r){if(e===R)return e;let i=r!==void 0?t._$Co?.[r]:t._$Cl,o=$e(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(s),i._$AT(s,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=i:t._$Cl=i),i!==void 0&&(e=At(s,i._$AS(s,e.values),i,r)),e}var dr=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,i=(e?.creationScope??Tt).importNode(t,!0);kt.currentNode=i;let o=kt.nextNode(),n=0,a=0,c=r[0];for(;c!==void 0;){if(n===c.index){let d;c.type===2?d=new Xt(o,o.nextSibling,this,e):c.type===1?d=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(d=new mr(o,this,e)),this._$AV.push(d),c=r[++a]}n!==c?.index&&(o=kt.nextNode(),n++)}return kt.currentNode=Tt,i}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},Xt=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=At(this,e,t),$e(e)?e===k||e==null||e===""?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==R&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Hi(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==k&&$e(this._$AH)?this._$AA.nextSibling.data=e:this.T(Tt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=De.createElement(zi(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{let o=new dr(i,this),n=o.u(this.options);o.p(t),this.T(n),this._$AH=o}}_$AC(e){let t=Oi.get(e.strings);return t===void 0&&Oi.set(e.strings,t=new De(e)),t}k(e){oi(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let o of e)i===t.length?t.push(r=new s(this.O(Le()),this.O(Le()),this,this.options)):r=t[i],r._$AI(o),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let r=e.nextSibling;e.remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},St=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,o){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=k}_$AI(e,t=this,r,i){let o=this.strings,n=!1;if(o===void 0)e=At(this,e,t,0),n=!$e(e)||e!==this._$AH&&e!==R,n&&(this._$AH=e);else{let a=e,c,d;for(e=o[0],c=0;c<o.length-1;c++)d=At(this,a[r+c],t,c),d===R&&(d=this._$AH[c]),n||(n=!$e(d)||d!==this._$AH[c]),d===k?e=k:e!==k&&(e+=(d??"")+o[c+1]),this._$AH[c]=d}n&&!i&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},pr=class extends St{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},hr=class extends St{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},ur=class extends St{constructor(e,t,r,i,o){super(e,t,r,i,o),this.type=5}_$AI(e,t=this){if((e=At(this,e,t,0)??k)===R)return;let r=this._$AH,i=e===k&&r!==k||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==k&&(r===k||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},mr=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){At(this,e)}},M={M:ii,P:lt,A:si,C:1,L:Ui,R:dr,D:Hi,V:At,I:Xt,H:St,N:hr,U:ur,B:pr,F:mr},po=Wt.litHtmlPolyfillSupport;po?.(De,Xt),(Wt.litHtmlVersions??(Wt.litHtmlVersions=[])).push("3.2.1");var li=(s,e,t)=>{let r=t?.renderBefore??e,i=r._$litPart$;if(i===void 0){let o=t?.renderBefore??null;r._$litPart$=i=new Xt(e.insertBefore(Le(),o),o,void 0,t??{})}return i._$AI(s),i};var v=class extends at{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;let e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=li(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return R}};v._$litElement$=!0,v.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:v});var ho=globalThis.litElementPolyfillSupport;ho?.({LitElement:v});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");var g=s=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(s,e)}):customElements.define(s,e)};var uo={attribute:!0,type:String,converter:Re,reflect:!1,hasChanged:lr},mo=(s=uo,e,t)=>{let{kind:r,metadata:i}=t,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(t.name,s),r==="accessor"){let{name:n}=t;return{set(a){let c=e.get.call(this);e.set.call(this,a),this.requestUpdate(n,c,s)},init(a){return a!==void 0&&this.P(n,void 0,s),a}}}if(r==="setter"){let{name:n}=t;return function(a){let c=this[n];e.call(this,a),this.requestUpdate(n,c,s)}}throw Error("Unsupported decorator location: "+r)};function p(s){return(e,t)=>typeof t=="object"?mo(s,e,t):((r,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...r,wrapped:!0}:r),n?Object.getOwnPropertyDescriptor(i,o):void 0})(s,e,t)}function w(s){return p({...s,state:!0,attribute:!1})}var gt=(s,e,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(s,e,t),t);function Yt(s,e){return(t,r,i)=>{let o=n=>n.renderRoot?.querySelector(s)??null;if(e){let{get:n,set:a}=typeof r=="object"?t:i??(()=>{let c=Symbol();return{get(){return this[c]},set(d){this[c]=d}}})();return gt(t,r,{get(){let c=n.call(this);return c===void 0&&(c=o(this),(c!==null||this.hasUpdated)&&a.call(this,c)),c}})}return gt(t,r,{get(){return o(this)}})}}function Fi(s){return(e,t)=>{let{slot:r,selector:i}=s??{},o="slot"+(r?`[name=${r}]`:":not([name])");return gt(e,t,{get(){let n=this.renderRoot?.querySelector(o),a=n?.assignedElements(s)??[];return i===void 0?a:a.filter(c=>c.matches(i))}})}}var tt=Symbol("test"),gr=Symbol("testElement");var Bi={fromAttribute(s){return s==="true"},toAttribute(s){return s?"true":"false"}},F=class extends v{constructor(){super(...arguments);this.weigths=new Map}createRenderRoot(){return this}get assessmentItem(){return this.renderRoot?.querySelector("qti-assessment-item")}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new CustomEvent("qti-assessment-item-ref-connected",{bubbles:!0,composed:!0,detail:{identifier:this.identifier,href:this.href,category:this.category}}))}render(){return h`${this.xmlDoc}`}};l([p({type:String})],F.prototype,"category",2),l([p({type:String})],F.prototype,"identifier",2),l([p({type:Boolean,converter:Bi})],F.prototype,"required",2),l([p({type:Boolean,converter:Bi})],F.prototype,"fixed",2),l([p({type:String})],F.prototype,"href",2),l([T({context:tt,subscribe:!0})],F.prototype,"_testContext",2),l([p({type:Object,attribute:!1})],F.prototype,"xmlDoc",2);customElements.get("qti-assessment-item-ref")||customElements.define("qti-assessment-item-ref",F);var ci={fromAttribute(s){return s==="true"},toAttribute(s){return s?"true":"false"}},B=class extends v{async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new Event("qti-assessment-section-connected",{bubbles:!0,composed:!0}))}render(){return h`<slot name="qti-rubric-block"></slot><slot></slot>`}};l([p({type:String})],B.prototype,"identifier",2),l([p({type:String})],B.prototype,"required",2),l([p({type:Boolean,converter:ci})],B.prototype,"fixed",2),l([p({type:String})],B.prototype,"title",2),l([p({type:Boolean,converter:ci})],B.prototype,"visible",2),l([p({type:Boolean,converter:ci,attribute:"keep-together"})],B.prototype,"keepTogether",2),l([T({context:tt,subscribe:!0})],B.prototype,"_testContext",2);customElements.get("qti-assessment-section")||customElements.define("qti-assessment-section",B);var ft=class extends v{async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new CustomEvent("qti-assessment-test-connected",{detail:this,bubbles:!0,composed:!0}))}render(){return h` <slot></slot>`}};l([p({type:String})],ft.prototype,"identifier",2),l([p({type:String})],ft.prototype,"title",2),l([T({context:tt,subscribe:!0})],ft.prototype,"_testContext",2),ft=l([g("qti-assessment-test")],ft);var j=class extends v{constructor(){super(...arguments);this.identifier="";this.title="";this.class="";this.NavigationMode="nonlinear";this.submissionMode="individual"}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new Event("qti-test-part-connected",{bubbles:!0,composed:!0}))}render(){return h` <slot></slot>`}};l([p({type:String})],j.prototype,"identifier",2),l([p({type:String})],j.prototype,"title",2),l([p({type:String})],j.prototype,"class",2),l([p({type:String,attribute:"navigation-mode"})],j.prototype,"NavigationMode",2),l([p({type:String,attribute:"submission-mode"})],j.prototype,"submissionMode",2),j=l([g("qti-test-part")],j);customElements.get("qti-test-part")||customElements.define("qti-test-part",j);var go=String.raw,fo=go`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
- <xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />
6
- <xsl:template match="@*|node()">
7
- <xsl:copy>
8
- <xsl:apply-templates select="@*|node()"/>
9
- </xsl:copy>
10
- </xsl:template>
11
-
12
- <!-- remove existing namespaces -->
13
- <xsl:template match="*">
14
- <!-- remove element prefix -->
15
- <xsl:element name="{local-name()}">
16
- <!-- process attributes -->
17
- <xsl:for-each select="@*">
18
- <!-- remove attribute prefix -->
19
- <xsl:attribute name="{local-name()}">
20
- <xsl:value-of select="."/>
21
- </xsl:attribute>
22
- </xsl:for-each>
23
- <xsl:apply-templates/>
24
- </xsl:element>
25
- </xsl:template>
26
- </xsl:stylesheet>`;function ji(s,e,t){s.querySelectorAll(e).forEach(r=>{let i=`${e}-${t}`,o=Xi(r,i);r.replaceWith(o)})}function Wi(s,e){s.querySelectorAll("*").forEach(t=>{let r=t.classList;r&&r.forEach(i=>{if(i.startsWith(`${e}:`)){let o=i.slice(`${e}:`.length),n=`${t.nodeName}-${o}`,a=Xi(t,n);t.replaceWith(a)}})})}function Xi(s,e){let t=document.createElement(e);for(let r of s.attributes)t.setAttribute(r.name,r.value);for(;s.firstChild;)t.appendChild(s.firstChild);return t}function Yi(s){let e=[];return s.querySelectorAll("qti-assessment-item-ref").forEach(t=>{let r=t.getAttribute("identifier"),i=t.getAttribute("href"),o=t.getAttribute("category");e.push({identifier:r,href:i,category:o})}),e}var di=null;function Gt(s,e=!1){return e&&di!==null&&di.abort(),new Promise((t,r)=>{let i=new XMLHttpRequest;di=i,i.open("GET",s,!0),i.responseType="document",i.onload=()=>{i.status>=200&&i.status<300?t(i.responseXML):r(i.statusText)},i.onerror=()=>{r(i.statusText)},i.send()})}function Kt(s){return new DOMParser().parseFromString(s,"text/xml")}function Zt(s){let e=new XSLTProcessor,t=new DOMParser().parseFromString(fo,"text/xml");return e.importStylesheet(t),e.transformToFragment(s,document)}function Gi(s,e){e.endsWith("/")||(e+="/"),s.querySelectorAll("[src],[href],[primary-path]").forEach(t=>{let r="";t.getAttribute("src")&&(r="src"),t.getAttribute("href")&&(r="href"),t.getAttribute("primary-path")&&(r="primary-path");let i=t.getAttribute(r)?.trim();if(!i.startsWith("data:")&&!i.startsWith("http")){let o=e+encodeURI(i);t.setAttribute(r,o)}})}function Ki(s){s.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value').forEach(t=>{let r=document.createComment(t.textContent);t.replaceChild(r,t.firstChild)})}function Zi(s){s.querySelectorAll("qti-stylesheet").forEach(e=>e.remove())}var Rt=()=>{let s,e={async load(t,r=!1){return new Promise(i=>{Gt(t,r).then(o=>(s=o,e.path(t.substring(0,t.lastIndexOf("/"))),i(e)))})},parse(t){return s=Kt(t),e},path:t=>(Gi(s,t),e),fn(t){return t(s),e},pciHooks(t){let r=["hook","module"],i=t.substring(0,t.lastIndexOf("/"));for(let o of r)s.querySelectorAll("["+o+"]").forEach(a=>{let c=a.getAttribute(o);!c.startsWith("data:")&&!c.startsWith("http")&&(a.setAttribute("base-url",t),a.setAttribute("module",i+"/"+encodeURI(c+(c.endsWith(".js")?"":".js"))))});return e},extendElementName:(t,r)=>(ji(s,t,r),e),extendElementsWithClass:(t="extend")=>(Wi(s,t),e),customInteraction(t,r){let i=s.querySelector("qti-custom-interaction"),o=i.querySelector("object");return i.setAttribute("data-base-ref",t),i.setAttribute("data-base-item",t+r),i.setAttribute("data",o.getAttribute("data")),i.setAttribute("width",o.getAttribute("width")),i.setAttribute("height",o.getAttribute("height")),i.removeChild(o),e},convertCDATAtoComment(){return Ki(s),e},stripStyleSheets(){return Zi(s),e},html(){return new XMLSerializer().serializeToString(Zt(s))},xml(){return new XMLSerializer().serializeToString(s)},htmlDoc(){return Zt(s)},xmlDoc(){return s}};return e};var pi=()=>{let s,e={async load(t){return new Promise(r=>{Gt(t).then(i=>(s=i,r(e)))})},parse(t){s=Kt(t)},assessmentTest(){let t=s.querySelector('resource[type="imsqti_test_xmlv3p0"]');return{href:t.getAttribute("href"),identifier:t.getAttribute("identifier")}}};return e};var Jt=()=>{let s,e={async load(t){return new Promise((r,i)=>{Gt(t).then(o=>(s=o,r(e)))})},parse(t){return s=Kt(t),e},fn(t){return t(s),e},items(){return Yi(s)},html(){return new XMLSerializer().serializeToString(Zt(s))},xml(){return new XMLSerializer().serializeToString(s)},htmlDoc(){return Zt(s)},xmlDoc(){return s}};return e};var Ji=s=>{class e extends s{constructor(...i){super(...i);this.testURL="";this.addEventListener("qti-load-test-request",o=>{let{testURL:n}=o.detail;n?this.testURL=n:console.warn("No test found, there should be an aattribute test-url with the path to the test on the test-container"),o.detail.promise=(async()=>(o.preventDefault(),(await Jt().load(`${this.testURL}`)).htmlDoc()))()}),this.addEventListener("qti-assessment-test-connected",()=>{}),this.addEventListener("qti-load-item-request",({detail:o})=>{this.testURL&&(o.promise=(async()=>(await Rt().load(`${this.testURL.slice(0,this.testURL.lastIndexOf("/"))}/${o.href}`,o.cancelPreviousRequest)).htmlDoc())())}),this.addEventListener("qti-interaction-changed",o=>{}),this.addEventListener("qti-outcome-changed",()=>{})}}return e};var Qi=s=>{class e extends s{constructor(...r){super(...r),this.addEventListener("qti-request-test-item",({detail:i})=>{if(!i)return;this._clearLoadedItems();let o=this.testElement.el.querySelector(`qti-assessment-item-ref[identifier="${i}"]`),n=this._loadItemRequest(o.href,!0),a=o.closest("qti-test-part").identifier,c=o.closest("qti-assessment-section").identifier;this._testContext={...this._testContext,navPartId:a,navSectionId:c,navItemId:i,navItemLoading:!0},n?n.then(d=>{o.xmlDoc=d,requestAnimationFrame(()=>this.dispatchEvent(new CustomEvent("qti-item-connected",{bubbles:!0,composed:!0}))),this._testContext={...this._testContext,navItemLoading:!1}}).catch(d=>console.error("Failed to load item:",d)):console.info("Load item request was not handled:",o.href)}),this.addEventListener("qti-assessment-test-connected",()=>{let i=this._testContext.navItemId;i||(i=this.testElement.el.querySelector("qti-assessment-item-ref").identifier),this.dispatchEvent(new CustomEvent("qti-request-test-item",{detail:i,bubbles:!0,composed:!0}))})}_clearLoadedItems(){let r=this.testElement.el.querySelectorAll("qti-assessment-test qti-assessment-item-ref");Array.from(r).forEach(i=>{i.xmlDoc=null})}_loadItemRequest(r,i=!0){let o=new CustomEvent("qti-load-item-request",{bubbles:!0,composed:!0,detail:{href:r,promise:null,cancelPreviousRequest:i}});return this.dispatchEvent(o),o.detail.promise}}return e};var ts=s=>{class e extends s{constructor(...r){super(...r),this._testContext={...this._testContext,view:"candidate"},this.addEventListener("on-test-switch-view",i=>{this._testContext={...this._testContext,view:i.detail},this._updateElementView()}),this.addEventListener("qti-assessment-test-connected",()=>{this._updateElementView()}),this.addEventListener("qti-assessment-item-connected",i=>{this._updateElementView(),this._setCorrectResponseVisibility(i.detail)})}willUpdate(r){super.willUpdate(r),r.has("_testContext")&&this._updateElementView()}_updateElementView(){if(this.testElement&&this.testElement.el){Array.from(this.testElement.el.querySelectorAll("[view]")).forEach(o=>{o.classList.toggle("show",o.getAttribute("view")===this._testContext.view)});let i=this.testElement.el.querySelector(`qti-assessment-item[identifier="${this._testContext.navItemId}"]`);i&&i.showCorrectResponse(this._testContext.view==="scorer")}}_setCorrectResponseVisibility(r){r.showCorrectResponse(this._testContext.view==="scorer")}}return e};var Qt=class extends v{constructor(){super();this._testContext={items:[],testOutcomeVariables:[]};this.testElement={el:null};this._updateItemInTestContext=t=>{let{identifier:r,variables:i}=t,o=this._testContext.items.find(n=>n?.identifier===r);if(!o){console.warn(`Item IDs between assessment.xml and item.xml should match: ${r} is not found!`);return}o.variables?.length===1?this._updateItemVariablesInTestContext(r,i):t.variables=[...o.variables||[]]};this.addEventListener("qti-assessment-test-connected",t=>{let r=t.detail,i=Array.from(r.querySelectorAll("qti-assessment-item-ref")).map(o=>({href:o.href,identifier:o.identifier,category:o.category,variables:[{identifier:"completionStatus",value:"not_attempted",type:"outcome"}]}));this.testElement={el:r},this._testContext={...this._testContext,items:i}}),this.addEventListener("qti-assessment-item-connected",t=>{this._updateItemInTestContext(t.detail)}),this.addEventListener("qti-outcome-changed",t=>{let r=t.composedPath()[0];this._updateItemVariablesInTestContext(r.identifier,r.variables)})}get context(){return this._testContext}set context(t){t!=null&&(this._testContext={...t},t.items?.forEach(r=>{let i=this._testContext.items.find(o=>o.identifier===r.identifier);i?i.variables=r.variables:this._testContext.items.push(r)}))}_updateItemVariablesInTestContext(t,r){this._testContext={...this._testContext,items:this._testContext.items.map(i=>i.identifier!==t?i:{...i,variables:r.map(o=>{let n=i.variables.find(a=>a.identifier===o.identifier);return n?{...n,...o}:o})})}}connectedCallback(){super.connectedCallback(),this.setAttribute("qti-test","")}};l([w(),jt({context:tt})],Qt.prototype,"_testContext",2),l([w(),jt({context:gr})],Qt.prototype,"testElement",2);var Ie=class extends Ji(Qi(ts(Qt))){connectedCallback(){super.connectedCallback();let e=this.querySelector(":scope > template");e&&this.shadowRoot?.appendChild(e.content)}render(){return h`<slot></slot>`}};Ie=l([g("qti-test")],Ie);var es=b`
27
- display: inline-flex;
28
- align-items: center;
29
- cursor: pointer;
30
- padding: 0.5rem 1rem;
31
- border-radius: 0.25rem;
32
- user-select: none;
33
- `,fr=b`
34
- background-color: lightgray;
35
- ${es};
36
- `,br=b`
37
- cursor: not-allowed;
38
- opacity: 0.5;
39
- `,$l=b`
40
- ${es};
41
- border: 1px solid gray;
42
- `;function is(s,e){let t,r={...e};return(i,o)=>{let{connectedCallback:n,disconnectedCallback:a}=i;i.connectedCallback=function(){n.call(this);let c=u=>{let m=Array.from(this.querySelectorAll(s));for(let f of u){let y=Array.from(f.addedNodes).map(q=>q),x=Array.from(f.addedNodes).map(q=>q);f.type==="childList"&&y.find(q=>m.includes(q))&&this[o](y,x)}};t=new MutationObserver(c),t.observe(this,{childList:!0,subtree:!0});let d=this.querySelectorAll(s)??[];this[o](Array.from(d),[])},i.disconnectedCallback=function(){a.call(this),t.disconnect()}}}function S(s,e){let t={waitUntilFirstUpdate:!1,...e};return(r,i)=>{let{update:o}=r,n=Array.isArray(s)?s:[s];r.update=function(a){n.forEach(c=>{let d=c;if(a.has(d)){let u=a.get(d),m=this[d];u!==m&&(!t.waitUntilFirstUpdate||this.hasUpdated)&&this[i](u,m)}}),o.call(this,a)}}}function ss(s){return(e,t)=>{p(s)(e,t);let r=`__${t}`;Object.defineProperty(e,t,{get(){return this[r]},set(i){let o=this[r];if(this[r]=i,o!==i){if(this._internals?.states){let n=t.toLowerCase();i?this._internals.states.add(`--${n}`):this._internals.states.delete(`--${n}`)}if(s.aria&&this._internals){let n=s.aria;i?this._internals[n]="true":this._internals[n]=null}this.requestUpdate(t,o)}},configurable:!0,enumerable:!0})}}var L=class extends v{constructor(){super();this.disabled=!0;this._internals=this.attachInternals()}_handleTestElementChange(t,r){r.el&&(this.disabled=!1)}willUpdate(t){if(t.has("_testContext")){let{items:r=[],navItemId:i}=this._testContext??{};this.itemIndex=r.findIndex(o=>o.identifier===i),this.items=r,this.view=this._testContext?.view}}_switchView(t){this.dispatchEvent(new CustomEvent("on-test-switch-view",{composed:!0,bubbles:!0,detail:t}))}_requestItem(t){this.dispatchEvent(new CustomEvent("qti-request-test-item",{composed:!0,bubbles:!0,detail:t}))}};l([ss({type:Boolean,reflect:!0,aria:"ariaDisabled"})],L.prototype,"disabled",2),l([w(),T({context:tt,subscribe:!0})],L.prototype,"_testContext",2),l([w(),T({context:gr,subscribe:!0})],L.prototype,"_testElement",2),l([S("_testElement")],L.prototype,"_handleTestElementChange",1);var te=class extends L{constructor(){super(),this._internals.role="button",this._internals.ariaLabel="Next item",this.addEventListener("click",e=>{e.preventDefault(),this.disabled||this._requestItem(this.items[this.itemIndex+1].identifier)})}willUpdate(e){super.willUpdate(e),e.has("_testContext")&&(this.disabled=!this._testElement?.el||this.itemIndex<0||this.itemIndex>=this.items.length-1)}render(){return h`<slot></slot>`}};te.styles=b`
43
- :host {
44
- ${fr};
45
- }
46
- :host([disabled]) {
47
- ${br};
48
- }
49
- `,te=l([g("test-next")],te);var ee=class extends L{constructor(){super(),this._internals.role="button",this._internals.ariaLabel="Next item",this.addEventListener("click",e=>{e.preventDefault(),this.disabled||this._requestItem(this.items[this.itemIndex-1].identifier)})}willUpdate(e){super.willUpdate(e),e.has("_testContext")&&(this.disabled=!this._testElement?.el||this.itemIndex===0||this.itemIndex===-1)}render(){return h`<slot></slot>`}};ee.styles=b`
50
- :host {
51
- ${fr};
52
- }
53
- :host([disabled]) {
54
- ${br};
55
- }
56
- `,ee=l([g("test-prev")],ee);var W=class extends L{constructor(){super(...arguments);this.label="view";this.viewOptions="";this._handleViewOptionsChange=(t,r)=>{console.log(r)};this._viewOptions=W.DEFAULT_VIEW_OPTIONS}render(){return h`
57
- <label part="label" for="viewSelect">${this.label}</label>
58
- <select
59
- part="select"
60
- id="viewSelect"
61
- .disabled=${this.disabled}
62
- @change=${t=>{let r=t.target;this._switchView(r.value)}}
63
- >
64
- ${this._viewOptions.map(t=>h`<option value="${t}" ?selected=${t===this.view}>${t}</option>`)}
65
- </select>
66
- `}};W.DEFAULT_VIEW_OPTIONS=["author","candidate","proctor","scorer","testConstructor","tutor"],l([p({type:String})],W.prototype,"label",2),l([p({type:String,attribute:"view-options"})],W.prototype,"viewOptions",2),l([S("viewOptions")],W.prototype,"_handleViewOptionsChange",2),W=l([g("test-view")],W);var re=class extends L{constructor(){super();this.itemId=null;this.addEventListener("click",()=>this._requestItem(this.itemId))}render(){return h` <slot></slot> `}};l([p({type:String,attribute:"item-id"})],re.prototype,"itemId",2),re=l([g("test-item-link")],re);var{I:bo}=M,ns=s=>s===null||typeof s!="object"&&typeof s!="function";var as=s=>s.strings===void 0,os=()=>document.createComment(""),ie=(s,e,t)=>{let r=s._$AA.parentNode,i=e===void 0?s._$AB:e._$AA;if(t===void 0){let o=r.insertBefore(os(),i),n=r.insertBefore(os(),i);t=new bo(o,n,s,s.options)}else{let o=t._$AB.nextSibling,n=t._$AM,a=n!==s;if(a){let c;t._$AQ?.(s),t._$AM=s,t._$AP!==void 0&&(c=s._$AU)!==n._$AU&&t._$AP(c)}if(o!==i||a){let c=t._$AA;for(;c!==o;){let d=c.nextSibling;r.insertBefore(c,i),c=d}}}return t},bt=(s,e,t=s)=>(s._$AI(e,t),s),vo={},ls=(s,e=vo)=>s._$AH=e,cs=s=>s._$AH,vr=s=>{s._$AP?.(!1,!0);let e=s._$AA,t=s._$AB.nextSibling;for(;e!==t;){let r=e.nextSibling;e.remove(),e=r}};var vt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},X=s=>(...e)=>({_$litDirective$:s,values:e}),et=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var Ne=(s,e)=>{let t=s._$AN;if(t===void 0)return!1;for(let r of t)r._$AO?.(e,!1),Ne(r,e);return!0},yr=s=>{let e,t;do{if((e=s._$AM)===void 0)break;t=e._$AN,t.delete(s),s=e}while(t?.size===0)},ds=s=>{for(let e;e=s._$AM;s=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(s))break;t.add(s),qo(e)}};function yo(s){this._$AN!==void 0?(yr(this),this._$AM=s,ds(this)):this._$AM=s}function xo(s,e=!1,t=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(let o=t;o<r.length;o++)Ne(r[o],!1),yr(r[o]);else r!=null&&(Ne(r,!1),yr(r));else Ne(this,s)}var qo=s=>{s.type==vt.CHILD&&(s._$AP??(s._$AP=xo),s._$AQ??(s._$AQ=yo))},se=class extends et{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),ds(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Ne(this,e),yr(this))}setValue(e){if(as(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var xr=class{constructor(e){this.Y=e}disconnect(){this.Y=void 0}reconnect(e){this.Y=e}deref(){return this.Y}},qr=class{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){this.Z??(this.Z=new Promise(e=>this.q=e))}resume(){this.q?.(),this.Z=this.q=void 0}};var ps=s=>!ns(s)&&typeof s.then=="function",hs=1073741823,hi=class extends se{constructor(){super(...arguments),this._$Cwt=hs,this._$Cbt=[],this._$CK=new xr(this),this._$CX=new qr}render(...e){return e.find(t=>!ps(t))??R}update(e,t){let r=this._$Cbt,i=r.length;this._$Cbt=t;let o=this._$CK,n=this._$CX;this.isConnected||this.disconnected();for(let a=0;a<t.length&&!(a>this._$Cwt);a++){let c=t[a];if(!ps(c))return this._$Cwt=a,c;a<i&&c===r[a]||(this._$Cwt=hs,i=0,Promise.resolve(c).then(async d=>{for(;n.get();)await n.get();let u=o.deref();if(u!==void 0){let m=u._$Cbt.indexOf(c);m>-1&&m<u._$Cwt&&(u._$Cwt=m,u.setValue(d))}}))}return R}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},us=X(hi);var ms=`@layer qti-base, qti-components, qti-utilities, qti-variants, qti-extended;
67
-
68
- :root,
69
- :host {
70
- /* Active colors */
71
- --qti-bg-active: #ffecec;
72
- --qti-border-active: #f86d70;
73
-
74
- /* Gap size */
75
- --qti-gap-size: 1rem;
76
-
77
- /* Background colors */
78
- --qti-bg: white;
79
- --qti-hover-bg: #f9fafb;
80
-
81
- /* Light theme colors */
82
- --qti-light-bg-active: #f0f0f0; /* Light gray */
83
- --qti-light-border-active: #d0d0d0; /* Medium gray */
84
-
85
- /* Dark theme colors */
86
- --qti-dark-bg-active: #1f2937; /* Dark gray */
87
- --qti-dark-border-active: #64748b; /* Medium gray */
88
-
89
- /* Disabled colors */
90
- --qti-disabled-bg: #f3f4f6;
91
- --qti-disabled-color: #45484f;
92
-
93
- /* Border properties */
94
- --qti-border-thickness: 2px;
95
- --qti-border-style: solid;
96
- --qti-border-color: #c6cad0;
97
- --qti-border-radius: 0.3rem;
98
- --qti-drop-border-radius: calc(var(--qti-border-radius) + var(--qti-border-thickness));
99
-
100
- /* Focus & active states */
101
- --qti-focus-border-width: 5px;
102
- --qti-focus-color: #bddcff7e;
103
-
104
- /* Class-specific variables */
105
-
106
- /* Form elements */
107
- --qti-form-size: 1rem;
108
-
109
- /* Point elements */
110
- --qti-point-size: 2rem;
111
-
112
- /* Order buttons */
113
- --qti-order-size: 2rem;
114
-
115
- /* Generic padding for all elements */
116
- --qti-padding-vertical: 0.5rem; /* py-2 */
117
- --qti-padding-horizontal: 0.5rem; /* px-2 */
118
- }
119
-
120
- /* SVG masks and backgrounds */
121
-
122
- .chevron {
123
- background: url("data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E")
124
- no-repeat center right 6px;
125
- }
126
-
127
- .handle {
128
- background-image: radial-gradient(
129
- circle at center,
130
- rgb(0 0 0 / 10%) 0,
131
- rgb(0 0 0 / 20%) 2px,
132
- rgb(255 255 255 / 0%) 2px,
133
- rgb(255 255 255 / 0%) 100%
134
- );
135
- background-repeat: repeat-y;
136
- background-position: left center;
137
- background-size: 14px 8px;
138
- }
139
-
140
- .check-mask {
141
- -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
142
- mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
143
- }
144
-
145
- /*
146
- Following are classes that can be applied to elements and element states, so they are not used directly
147
- The @apply directive is used to apply these classes to elements
148
- */
149
-
150
- /* Apply .bordered to an element */
151
-
152
- .bordered {
153
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
154
- outline: none;
155
- }
156
-
157
- /* Apply .form rules for checkbox and radiobutton */
158
-
159
- .form {
160
-
161
- display: grid;
162
- place-content: center;
163
- width: var(--qti-form-size);
164
- height: var(--qti-form-size);
165
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
166
- outline: none;
167
- }
168
-
169
- /* Apply .button rules for button-like elements, such as drags and buttons */
170
-
171
- .button {
172
-
173
- border-radius: var(--qti-border-radius);
174
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
175
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
176
- outline: none;
177
- }
178
-
179
- /* Apply .select for the select dropdown element */
180
-
181
- .select {
182
-
183
- border-radius: var(--qti-border-radius);
184
- position: relative;
185
- -webkit-appearance: none;
186
- -moz-appearance: none;
187
- appearance: none;
188
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
189
- padding-right: calc(var(--qti-padding-horizontal) + 1.5rem); /* 1.5rem for the chevron */ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color); outline: none; background: url("data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E")
190
- no-repeat center right 6px;
191
- }
192
-
193
- /* Apply .text for the input text and textarea */
194
-
195
- .text {
196
-
197
- border-radius: 0;
198
- cursor: text;
199
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
200
- background: unset;
201
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
202
- outline: none;
203
- }
204
-
205
- /* Apply .spot for hotspot shapes */
206
-
207
- .spot {
208
-
209
- width: 100%;
210
- height: 100%;
211
- background-color: transparent;
212
- padding: 0;
213
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
214
- outline: none;
215
- }
216
-
217
- /* Apply .point for circular small hotspots */
218
-
219
- .point {
220
-
221
- border-radius: 100%;
222
- width: var(--qti-point-size);
223
- height: var(--qti-point-size);
224
- background-color: transparent;
225
- padding: 0;
226
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
227
- outline: none;
228
- }
229
-
230
- /* Apply .drag for draggable elements */
231
-
232
- .drag {
233
-
234
- transition:
235
- transform 200ms ease-out,
236
- box-shadow 200ms ease-out,
237
- rotate 200ms ease-out;
238
- cursor: grab;
239
- background-color: var(--qti-bg);
240
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
241
- border-radius: var(--qti-border-radius);
242
- padding-left: calc(var(--qti-padding-horizontal) + 0.5rem) !important; /* 1.5rem for the drag */ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color); outline: none; background-image: radial-gradient(
243
- circle at center,
244
- rgb(0 0 0 / 10%) 0,
245
- rgb(0 0 0 / 20%) 2px,
246
- rgb(255 255 255 / 0%) 2px,
247
- rgb(255 255 255 / 0%) 100%
248
- ); background-repeat: repeat-y; background-position: left center; background-size: 14px 8px;
249
- }
250
-
251
- /* Apply .dragging for the dragging state of a draggable element */
252
-
253
- .dragging {
254
- pointer-events: none;
255
- rotate: -2deg;
256
- box-shadow:
257
- 0 8px 12px rgb(0 0 0 / 20%),
258
- 0 4px 8px rgb(0 0 0 / 10%);
259
- }
260
-
261
- /* Apply .drop for an element where you can drop the draggable */
262
-
263
- .drop {
264
-
265
- background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
266
- center no-repeat;
267
- border-radius: var(--qti-border-radius);
268
- position: relative;
269
- background-color: var(--qti-bg);
270
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
271
- outline: none;
272
- }
273
-
274
- /* Apply .dropping for an indicator where you can drop the draggable */
275
-
276
- .dropping {
277
- background-color: var(--qti-bg-active);
278
- }
279
-
280
- /* Apply .order for a small circular button */
281
-
282
- .order {
283
-
284
- display: grid;
285
- place-content: center;
286
-
287
- /* background-color: var(--qti-bg-active); */
288
- border-radius: 100%;
289
- width: var(--qti-order-size);
290
- height: var(--qti-order-size);
291
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
292
- outline: none;
293
- }
294
-
295
- /* Apply .check-size for radio and checkbox size */
296
-
297
- .check-size {
298
- width: calc(var(--qti-form-size) - 6px);
299
- height: calc(var(--qti-form-size) - 6px);
300
- }
301
-
302
- /* Apply .check for checkbox */
303
-
304
- .check {
305
- gap: 0.5rem;
306
- border-radius: var(--qti-border-radius);
307
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
308
- outline: none;
309
- cursor: pointer;
310
- }
311
-
312
- /* Apply .check-radio for outer circle of the radio buttons */
313
-
314
- .check-radio {
315
-
316
- border-radius: 100%;
317
-
318
- display: grid;
319
-
320
- place-content: center;
321
-
322
- width: var(--qti-form-size);
323
-
324
- height: var(--qti-form-size);
325
-
326
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
327
-
328
- outline: none;
329
- }
330
-
331
- /* Apply .check-radio-checked for the inner checked radio */
332
-
333
- .check-radio-checked {
334
- background-color: var(--qti-border-active);
335
- border-radius: 100%;
336
- }
337
-
338
- /* Apply .check-checkbox for outer square of the checkbox */
339
-
340
- .check-checkbox {
341
-
342
- display: flex;
343
- place-items: center;
344
- border-radius: var(--qti-border-radius);
345
- display: grid;
346
- place-content: center;
347
- width: var(--qti-form-size);
348
- height: var(--qti-form-size);
349
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
350
- outline: none;
351
- }
352
-
353
- /* Apply .check-checkbox-checked for the inner checkmark */
354
-
355
- .check-checkbox-checked {
356
- background-color: var(--qti-border-active);
357
- -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
358
- mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
359
- }
360
-
361
- /* Apply .hov for hover state */
362
-
363
- .hov {
364
- background-color: var(--qti-hover-bg);
365
- }
366
-
367
- /* Apply .foc for focus state */
368
-
369
- .foc {
370
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
371
- }
372
-
373
- /* Apply .act for active state */
374
-
375
- .act {
376
- border-color: var(--qti-border-active);
377
- background-color: var(--qti-bg-active);
378
- }
379
-
380
- .act-bg {
381
- background-color: var(--qti-bg-active);
382
- }
383
-
384
- .act-bor {
385
- border-color: var(--qti-border-active);
386
- }
387
-
388
- /* Apply .rdo for readonly state */
389
-
390
- .rdo {
391
- cursor: pointer;
392
- background-color: var(--qti-bg);
393
- outline: 0;
394
- border: none;
395
- }
396
-
397
- /* Apply .dis for disabled state */
398
-
399
- .dis {
400
- cursor: not-allowed;
401
- background-color: var(--qti-disabled-bg);
402
- color: var(--qti-disabled-color);
403
- border-color: var(--qti-border-color);
404
- outline: 4px solid var(--qti-disabled-bg);
405
- }
406
-
407
- /* base */
408
-
409
- /* ============================
410
- QTI 3 shared css
411
- 1. Display
412
- 2. Special Flex styles
413
- 3. Margin
414
- 4. Padding
415
- 5. Horizontal Alignment styles
416
- 6. Vertical Alignment styles
417
- 7. Height
418
- 8. Width
419
- 9. Text-Indent
420
- 10. List Style
421
- 11. Layout
422
- 12. Other QTI 3 presentation utilities
423
- ============================ */
424
-
425
- /* ==========
426
- Display css
427
- =========== */
428
-
429
- .qti-display-inline {
430
- display: inline;
431
- }
432
-
433
- .qti-display-inline-block {
434
- display: inline-block;
435
- }
436
-
437
- .qti-display-block {
438
- display: block;
439
- }
440
-
441
- .qti-display-flex {
442
- display: flexbox;
443
- display: flex;
444
- }
445
-
446
- .qti-display-inline-flex {
447
- display: inline-flex;
448
- }
449
-
450
- .qti-display-grid {
451
- display: grid;
452
- }
453
-
454
- .qti-display-inline-grid {
455
- display: inline-grid;
456
- }
457
-
458
- .qti-display-table {
459
- display: table;
460
- }
461
-
462
- .qti-display-table-cell {
463
- display: table-cell;
464
- }
465
-
466
- .qti-display-table-row {
467
- display: table-row;
468
- }
469
-
470
- .qti-display-list-item {
471
- display: list-item;
472
- }
473
-
474
- .qti-display-inherit {
475
- display: inherit;
476
- }
477
-
478
- /*
479
- * hidden to screen readers and sighted
480
- */
481
-
482
- .qti-hidden {
483
- display: none;
484
- }
485
-
486
- /*
487
- * visible to screen readers, hidden to sighted
488
- */
489
-
490
- .qti-visually-hidden {
491
- position: fixed !important;
492
- overflow: hidden;
493
- clip: rect(1px 1px 1px 1px);
494
- height: 1px;
495
- width: 1px;
496
- border: 0;
497
- margin: -1px;
498
- }
499
-
500
- /* =============================
501
- Special flex styles
502
- ============================= */
503
-
504
- .qti-flex-direction-column {
505
- flex-direction: column;
506
- }
507
-
508
- .qti-flex-direction-row {
509
- flex-direction: row;
510
- }
511
-
512
- .qti-flex-grow-1 {
513
- flex-grow: 1;
514
- }
515
-
516
- .qti-flex-grow-0 {
517
- flex-grow: 0;
518
- }
519
-
520
- /* =========
521
- Margin css
522
- ========== */
523
-
524
- /**
525
- * For margin Top and Bottom and Left and Right
526
- */
527
-
528
- .qti-margin-0 {
529
- margin: 0 !important;
530
- }
531
-
532
- .qti-margin-1 {
533
- margin: 0.25rem !important;
534
- }
535
-
536
- .qti-margin-2 {
537
- margin: 0.5rem !important;
538
- }
539
-
540
- .qti-margin-3 {
541
- margin: 1rem !important;
542
- }
543
-
544
- .qti-margin-4 {
545
- margin: 1.5rem !important;
546
- }
547
-
548
- .qti-margin-5 {
549
- margin: 3rem !important;
550
- }
551
-
552
- .qti-margin-auto {
553
- margin: auto !important;
554
- }
555
-
556
- /*
557
- For margin Left and Right
558
- */
559
-
560
- .qti-margin-x-0 {
561
- margin-right: 0 !important;
562
- margin-left: 0 !important;
563
- }
564
-
565
- .qti-margin-x-1 {
566
- margin-right: 0.25rem !important;
567
- margin-left: 0.25rem !important;
568
- }
569
-
570
- .qti-margin-x-2 {
571
- margin-right: 0.5rem !important;
572
- margin-left: 0.5rem !important;
573
- }
574
-
575
- .qti-margin-x-3 {
576
- margin-right: 1rem !important;
577
- margin-left: 1rem !important;
578
- }
579
-
580
- .qti-margin-x-4 {
581
- margin-right: 1.5rem !important;
582
- margin-left: 1.5rem !important;
583
- }
584
-
585
- .qti-margin-x-5 {
586
- margin-right: 3rem !important;
587
- margin-left: 3rem !important;
588
- }
589
-
590
- .qti-margin-x-auto {
591
- margin-right: auto !important;
592
- margin-left: auto !important;
593
- }
594
-
595
- /*
596
- For margin Top and Bottom
597
- */
598
-
599
- .qti-margin-y-0 {
600
- margin-top: 0 !important;
601
- margin-bottom: 0 !important;
602
- }
603
-
604
- .qti-margin-y-1 {
605
- margin-top: 0.25rem !important;
606
- margin-bottom: 0.25rem !important;
607
- }
608
-
609
- .qti-margin-y-2 {
610
- margin-top: 0.5rem !important;
611
- margin-bottom: 0.5rem !important;
612
- }
613
-
614
- .qti-margin-y-3 {
615
- margin-top: 1rem !important;
616
- margin-bottom: 1rem !important;
617
- }
618
-
619
- .qti-margin-y-4 {
620
- margin-top: 1.5rem !important;
621
- margin-bottom: 1.5rem !important;
622
- }
623
-
624
- .qti-margin-y-5 {
625
- margin-top: 3rem !important;
626
- margin-bottom: 3rem !important;
627
- }
628
-
629
- .qti-margin-y-auto {
630
- margin-top: auto !important;
631
- margin-bottom: auto !important;
632
- }
633
-
634
- /*
635
- For margin Top
636
- */
637
-
638
- .qti-margin-t-0 {
639
- margin-top: 0 !important;
640
- }
641
-
642
- .qti-margin-t-1 {
643
- margin-top: 0.25rem !important;
644
- }
645
-
646
- .qti-margin-t-2 {
647
- margin-top: 0.5rem !important;
648
- }
649
-
650
- .qti-margin-t-3 {
651
- margin-top: 1rem !important;
652
- }
653
-
654
- .qti-margin-t-4 {
655
- margin-top: 1.5rem !important;
656
- }
657
-
658
- .qti-margin-t-5 {
659
- margin-top: 3rem !important;
660
- }
661
-
662
- .qti-margin-t-auto {
663
- margin-top: auto !important;
664
- }
665
-
666
- /*
667
- For margin Bottom
668
- */
669
-
670
- .qti-margin-b-0 {
671
- margin-bottom: 0 !important;
672
- }
673
-
674
- .qti-margin-b-1 {
675
- margin-bottom: 0.25rem !important;
676
- }
677
-
678
- .qti-margin-b-2 {
679
- margin-bottom: 0.5rem !important;
680
- }
681
-
682
- .qti-margin-b-3 {
683
- margin-bottom: 1rem !important;
684
- }
685
-
686
- .qti-margin-b-4 {
687
- margin-bottom: 1.5rem !important;
688
- }
689
-
690
- .qti-margin-b-5 {
691
- margin-bottom: 3rem !important;
692
- }
693
-
694
- .qti-margin-b-auto {
695
- margin-bottom: auto !important;
696
- }
697
-
698
- /*
699
- For margin Start LTR
700
- */
701
-
702
- .qti-margin-s-0 {
703
- margin-left: 0 !important;
704
- }
705
-
706
- .qti-margin-s-1 {
707
- margin-left: 0.25rem !important;
708
- }
709
-
710
- .qti-margin-s-2 {
711
- margin-left: 0.5rem !important;
712
- }
713
-
714
- .qti-margin-s-3 {
715
- margin-left: 1rem !important;
716
- }
717
-
718
- .qti-margin-s-4 {
719
- margin-left: 1.5rem !important;
720
- }
721
-
722
- .qti-margin-s-5 {
723
- margin-left: 3rem !important;
724
- }
725
-
726
- .qti-margin-s-auto {
727
- margin-left: auto !important;
728
- }
729
-
730
- /*
731
- For margin End LTR
732
- */
733
-
734
- .qti-margin-e-0 {
735
- margin-right: 0 !important;
736
- }
737
-
738
- .qti-margin-e-1 {
739
- margin-right: 0.25rem !important;
740
- }
741
-
742
- .qti-margin-e-2 {
743
- margin-right: 0.5rem !important;
744
- }
745
-
746
- .qti-margin-e-3 {
747
- margin-right: 1rem !important;
748
- }
749
-
750
- .qti-margin-e-4 {
751
- margin-right: 1.5rem !important;
752
- }
753
-
754
- .qti-margin-e-5 {
755
- margin-right: 3rem !important;
756
- }
757
-
758
- .qti-margin-e-auto {
759
- margin-right: auto !important;
760
- }
761
-
762
- /* =========
763
- Padding css
764
- ========== */
765
-
766
- /*
767
- For padding Top and Bottom and Left and Right
768
- */
769
-
770
- .qti-padding-0 {
771
- padding: 0 !important;
772
- }
773
-
774
- .qti-padding-1 {
775
- padding: 0.25rem !important;
776
- }
777
-
778
- .qti-padding-2 {
779
- padding: 0.5rem !important;
780
- }
781
-
782
- .qti-padding-3 {
783
- padding: 1rem !important;
784
- }
785
-
786
- .qti-padding-4 {
787
- padding: 1.5rem !important;
788
- }
789
-
790
- .qti-padding-5 {
791
- padding: 3rem !important;
792
- }
793
-
794
- /*
795
- For padding Left and Right
796
- */
797
-
798
- .qti-padding-x-0 {
799
- padding-right: 0 !important;
800
- padding-left: 0 !important;
801
- }
802
-
803
- .qti-padding-x-1 {
804
- padding-right: 0.25rem !important;
805
- padding-left: 0.25rem !important;
806
- }
807
-
808
- .qti-padding-x-2 {
809
- padding-right: 0.5rem !important;
810
- padding-left: 0.5rem !important;
811
- }
812
-
813
- .qti-padding-x-3 {
814
- padding-right: 1rem !important;
815
- padding-left: 1rem !important;
816
- }
817
-
818
- .qti-padding-x-4 {
819
- padding-right: 1.5rem !important;
820
- padding-left: 1.5rem !important;
821
- }
822
-
823
- .qti-padding-x-5 {
824
- padding-right: 3rem !important;
825
- padding-left: 3rem !important;
826
- }
827
-
828
- /*
829
- For padding Top and Bottom
830
- */
831
-
832
- .qti-padding-y-0 {
833
- padding-top: 0 !important;
834
- padding-bottom: 0 !important;
835
- }
836
-
837
- .qti-padding-y-1 {
838
- padding-top: 0.25rem !important;
839
- padding-bottom: 0.25rem !important;
840
- }
841
-
842
- .qti-padding-y-2 {
843
- padding-top: 0.5rem !important;
844
- padding-bottom: 0.5rem !important;
845
- }
846
-
847
- .qti-padding-y-3 {
848
- padding-top: 1rem !important;
849
- padding-bottom: 1rem !important;
850
- }
851
-
852
- .qti-padding-y-4 {
853
- padding-top: 1.5rem !important;
854
- padding-bottom: 1.5rem !important;
855
- }
856
-
857
- .qti-padding-y-5 {
858
- padding-top: 3rem !important;
859
- padding-bottom: 3rem !important;
860
- }
861
-
862
- /*
863
- For padding Top
864
- */
865
-
866
- .qti-padding-t-0 {
867
- padding-top: 0 !important;
868
- }
869
-
870
- .qti-padding-t-1 {
871
- padding-top: 0.25rem !important;
872
- }
873
-
874
- .qti-padding-t-2 {
875
- padding-top: 0.5rem !important;
876
- }
877
-
878
- .qti-padding-t-3 {
879
- padding-top: 1rem !important;
880
- }
881
-
882
- .qti-padding-t-4 {
883
- padding-top: 1.5rem !important;
884
- }
885
-
886
- .qti-padding-t-5 {
887
- padding-top: 3rem !important;
888
- }
889
-
890
- /*
891
- For padding Bottom
892
- */
893
-
894
- .qti-padding-b-0 {
895
- padding-bottom: 0 !important;
896
- }
897
-
898
- .qti-padding-b-1 {
899
- padding-bottom: 0.25rem !important;
900
- }
901
-
902
- .qti-padding-b-2 {
903
- padding-bottom: 0.5rem !important;
904
- }
905
-
906
- .qti-padding-b-3 {
907
- padding-bottom: 1rem !important;
908
- }
909
-
910
- .qti-padding-b-4 {
911
- padding-bottom: 1.5rem !important;
912
- }
913
-
914
- .qti-padding-b-5 {
915
- padding-bottom: 3rem !important;
916
- }
917
-
918
- /*
919
- For padding Start LTR
920
- */
921
-
922
- .qti-padding-s-0 {
923
- padding-left: 0 !important;
924
- }
925
-
926
- .qti-padding-s-1 {
927
- padding-left: 0.25rem !important;
928
- }
929
-
930
- .qti-padding-s-2 {
931
- padding-left: 0.5rem !important;
932
- }
933
-
934
- .qti-padding-s-3 {
935
- padding-left: 1rem !important;
936
- }
937
-
938
- .qti-padding-s-4 {
939
- padding-left: 1.5rem !important;
940
- }
941
-
942
- .qti-padding-s-5 {
943
- padding-left: 3rem !important;
944
- }
945
-
946
- /*
947
- For padding End LTR
948
- */
949
-
950
- .qti-padding-e-0 {
951
- padding-right: 0 !important;
952
- }
953
-
954
- .qti-padding-e-1 {
955
- padding-right: 0.25rem !important;
956
- }
957
-
958
- .qti-padding-e-2 {
959
- padding-right: 0.5rem !important;
960
- }
961
-
962
- .qti-padding-e-3 {
963
- padding-right: 1rem !important;
964
- }
965
-
966
- .qti-padding-e-4 {
967
- padding-right: 1.5rem !important;
968
- }
969
-
970
- .qti-padding-e-5 {
971
- padding-right: 3rem !important;
972
- }
973
-
974
- /* ====================
975
- Horizontal alignment
976
- ==================== */
977
-
978
- .qti-align-left {
979
- text-align: left;
980
- }
981
-
982
- .qti-align-center {
983
- text-align: center;
984
- }
985
-
986
- .qti-align-right {
987
- text-align: right;
988
- }
989
-
990
- /* ==================
991
- Vertical alignment
992
- ================== */
993
-
994
- .qti-valign-top {
995
- vertical-align: top;
996
- }
997
-
998
- .qti-valign-middle {
999
- vertical-align: middle;
1000
- }
1001
-
1002
- .qti-valign-baseline {
1003
- vertical-align: baseline;
1004
- }
1005
-
1006
- .qti-valign-bottom {
1007
- vertical-align: bottom;
1008
- }
1009
-
1010
- /* =============
1011
- Height styles
1012
- ============= */
1013
-
1014
- .qti-height-0 {
1015
- height: 0;
1016
- }
1017
-
1018
- .qti-height-px {
1019
- height: 1px;
1020
- }
1021
-
1022
- .qti-height-0p5 {
1023
- height: 0.125rem;
1024
- }
1025
-
1026
- .qti-height-1 {
1027
- height: 0.25rem;
1028
- }
1029
-
1030
- .qti-height-1p5 {
1031
- height: 0.375rem;
1032
- }
1033
-
1034
- .qti-height-2 {
1035
- height: 0.5rem;
1036
- }
1037
-
1038
- .qti-height-2p5 {
1039
- height: 0.625rem;
1040
- }
1041
-
1042
- .qti-height-3 {
1043
- height: 0.75rem;
1044
- }
1045
-
1046
- .qti-height-3p5 {
1047
- height: 0.875rem;
1048
- }
1049
-
1050
- .qti-height-4 {
1051
- height: 1rem;
1052
- }
1053
-
1054
- .qti-height-5 {
1055
- height: 1.25rem;
1056
- }
1057
-
1058
- .qti-height-6 {
1059
- height: 1.5rem;
1060
- }
1061
-
1062
- .qti-height-7 {
1063
- height: 1.75rem;
1064
- }
1065
-
1066
- .qti-height-8 {
1067
- height: 2rem;
1068
- }
1069
-
1070
- .qti-height-9 {
1071
- height: 2.25rem;
1072
- }
1073
-
1074
- .qti-height-10 {
1075
- height: 2.5rem;
1076
- }
1077
-
1078
- .qti-height-11 {
1079
- height: 2.75rem;
1080
- }
1081
-
1082
- .qti-height-12 {
1083
- height: 3rem;
1084
- }
1085
-
1086
- .qti-height-14 {
1087
- height: 3.5rem;
1088
- }
1089
-
1090
- .qti-height-16 {
1091
- height: 4rem;
1092
- }
1093
-
1094
- .qti-height-20 {
1095
- height: 5rem;
1096
- }
1097
-
1098
- .qti-height-24 {
1099
- height: 6rem;
1100
- }
1101
-
1102
- .qti-height-28 {
1103
- height: 7rem;
1104
- }
1105
-
1106
- .qti-height-32 {
1107
- height: 8rem;
1108
- }
1109
-
1110
- .qti-height-36 {
1111
- height: 9rem;
1112
- }
1113
-
1114
- .qti-height-40 {
1115
- height: 10rem;
1116
- }
1117
-
1118
- .qti-height-44 {
1119
- height: 11rem;
1120
- }
1121
-
1122
- .qti-height-48 {
1123
- height: 12rem;
1124
- }
1125
-
1126
- .qti-height-52 {
1127
- height: 13rem;
1128
- }
1129
-
1130
- .qti-height-56 {
1131
- height: 14rem;
1132
- }
1133
-
1134
- .qti-height-60 {
1135
- height: 15rem;
1136
- }
1137
-
1138
- .qti-height-64 {
1139
- height: 16rem;
1140
- }
1141
-
1142
- .qti-height-72 {
1143
- height: 18rem;
1144
- }
1145
-
1146
- .qti-height-80 {
1147
- height: 20rem;
1148
- }
1149
-
1150
- .qti-height-96 {
1151
- height: 24rem;
1152
- }
1153
-
1154
- .qti-height-1-2 {
1155
- height: 50%;
1156
- }
1157
-
1158
- .qti-height-1-3 {
1159
- height: 33.3333%;
1160
- }
1161
-
1162
- .qti-height-2-3 {
1163
- height: 66.6667%;
1164
- }
1165
-
1166
- .qti-height-1-4 {
1167
- height: 25%;
1168
- }
1169
-
1170
- .qti-height-2-4 {
1171
- height: 50%;
1172
- }
1173
-
1174
- .qti-height-3-4 {
1175
- height: 75%;
1176
- }
1177
-
1178
- .qti-height-1-5 {
1179
- height: 20%;
1180
- }
1181
-
1182
- .qti-height-2-5 {
1183
- height: 40%;
1184
- }
1185
-
1186
- .qti-height-3-5 {
1187
- height: 60%;
1188
- }
1189
-
1190
- .qti-height-4-5 {
1191
- height: 80%;
1192
- }
1193
-
1194
- .qti-height-1-6 {
1195
- height: 16.6667%;
1196
- }
1197
-
1198
- .qti-height-2-6 {
1199
- height: 33.3333%;
1200
- }
1201
-
1202
- .qti-height-3-6 {
1203
- height: 50%;
1204
- }
1205
-
1206
- .qti-height-4-6 {
1207
- height: 66.6667%;
1208
- }
1209
-
1210
- .qti-height-5-6 {
1211
- height: 83.3333%;
1212
- }
1213
-
1214
- .qti-height-auto {
1215
- height: auto;
1216
- }
1217
-
1218
- .qti-height-full {
1219
- height: 100%;
1220
- }
1221
-
1222
- /* ============
1223
- Width styles
1224
- ============ */
1225
-
1226
- .qti-width-0 {
1227
- width: 0;
1228
- }
1229
-
1230
- .qti-width-px {
1231
- width: 1px;
1232
- }
1233
-
1234
- .qti-width-0p5 {
1235
- width: 0.125rem;
1236
- }
1237
-
1238
- .qti-width-1 {
1239
- width: 0.25rem;
1240
- }
1241
-
1242
- .qti-width-1p5 {
1243
- width: 0.375rem;
1244
- }
1245
-
1246
- .qti-width-2 {
1247
- width: 0.5rem;
1248
- }
1249
-
1250
- .qti-width-2p5 {
1251
- width: 0.625rem;
1252
- }
1253
-
1254
- .qti-width-3 {
1255
- width: 0.75rem;
1256
- }
1257
-
1258
- .qti-width-3p5 {
1259
- width: 0.875rem;
1260
- }
1261
-
1262
- .qti-width-4 {
1263
- width: 1rem;
1264
- }
1265
-
1266
- .qti-width-5 {
1267
- width: 1.25rem;
1268
- }
1269
-
1270
- .qti-width-6 {
1271
- width: 1.5rem;
1272
- }
1273
-
1274
- .qti-width-7 {
1275
- width: 1.75rem;
1276
- }
1277
-
1278
- .qti-width-8 {
1279
- width: 2rem;
1280
- }
1281
-
1282
- .qti-width-9 {
1283
- width: 2.25rem;
1284
- }
1285
-
1286
- .qti-width-10 {
1287
- width: 2.5rem;
1288
- }
1289
-
1290
- .qti-width-11 {
1291
- width: 2.75rem;
1292
- }
1293
-
1294
- .qti-width-12 {
1295
- width: 3rem;
1296
- }
1297
-
1298
- .qti-width-14 {
1299
- width: 3.5rem;
1300
- }
1301
-
1302
- .qti-width-16 {
1303
- width: 4rem;
1304
- }
1305
-
1306
- .qti-width-20 {
1307
- width: 5rem;
1308
- }
1309
-
1310
- .qti-width-24 {
1311
- width: 6rem;
1312
- }
1313
-
1314
- .qti-width-28 {
1315
- width: 7rem;
1316
- }
1317
-
1318
- .qti-width-32 {
1319
- width: 8rem;
1320
- }
1321
-
1322
- .qti-width-36 {
1323
- width: 9rem;
1324
- }
1325
-
1326
- .qti-width-40 {
1327
- width: 10rem;
1328
- }
1329
-
1330
- .qti-width-44 {
1331
- width: 11rem;
1332
- }
1333
-
1334
- .qti-width-48 {
1335
- width: 12rem;
1336
- }
1337
-
1338
- .qti-width-52 {
1339
- width: 13rem;
1340
- }
1341
-
1342
- .qti-width-56 {
1343
- width: 14rem;
1344
- }
1345
-
1346
- .qti-width-60 {
1347
- width: 15rem;
1348
- }
1349
-
1350
- .qti-width-64 {
1351
- width: 16rem;
1352
- }
1353
-
1354
- .qti-width-72 {
1355
- width: 18rem;
1356
- }
1357
-
1358
- .qti-width-80 {
1359
- width: 20rem;
1360
- }
1361
-
1362
- .qti-width-96 {
1363
- width: 24rem;
1364
- }
1365
-
1366
- .qti-width-auto {
1367
- width: auto;
1368
- }
1369
-
1370
- .qti-width-1-2 {
1371
- width: 50%;
1372
- }
1373
-
1374
- .qti-width-1-3 {
1375
- width: 33.3333%;
1376
- }
1377
-
1378
- .qti-width-2-3 {
1379
- width: 66.6667%;
1380
- }
1381
-
1382
- .qti-width-1-4 {
1383
- width: 25%;
1384
- }
1385
-
1386
- .qti-width-2-4 {
1387
- width: 50%;
1388
- }
1389
-
1390
- .qti-width-3-4 {
1391
- width: 75%;
1392
- }
1393
-
1394
- .qti-width-1-5 {
1395
- width: 20%;
1396
- }
1397
-
1398
- .qti-width-2-5 {
1399
- width: 40%;
1400
- }
1401
-
1402
- .qti-width-3-5 {
1403
- width: 60%;
1404
- }
1405
-
1406
- .qti-width-4-5 {
1407
- width: 80%;
1408
- }
1409
-
1410
- .qti-width-1-6 {
1411
- width: 16.6667%;
1412
- }
1413
-
1414
- .qti-width-2-6 {
1415
- width: 33.3333%;
1416
- }
1417
-
1418
- .qti-width-3-6 {
1419
- width: 50%;
1420
- }
1421
-
1422
- .qti-width-4-6 {
1423
- width: 66.6667%;
1424
- }
1425
-
1426
- .qti-width-5-6 {
1427
- width: 83.3333%;
1428
- }
1429
-
1430
- .qti-width-1-12 {
1431
- width: 8.3333%;
1432
- }
1433
-
1434
- .qti-width-2-12 {
1435
- width: 16.6667%;
1436
- }
1437
-
1438
- .qti-width-3-12 {
1439
- width: 25%;
1440
- }
1441
-
1442
- .qti-width-4-12 {
1443
- width: 33.3333%;
1444
- }
1445
-
1446
- .qti-width-5-12 {
1447
- width: 41.6667%;
1448
- }
1449
-
1450
- .qti-width-6-12 {
1451
- width: 50%;
1452
- }
1453
-
1454
- .qti-width-7-12 {
1455
- width: 58.3333%;
1456
- }
1457
-
1458
- .qti-width-8-12 {
1459
- width: 66.6667%;
1460
- }
1461
-
1462
- .qti-width-9-12 {
1463
- width: 75%;
1464
- }
1465
-
1466
- .qti-width-10-12 {
1467
- width: 83.3333%;
1468
- }
1469
-
1470
- .qti-width-11-12 {
1471
- width: 91.6667%;
1472
- }
1473
-
1474
- .qti-width-full,
1475
- .qti-fullwidth {
1476
- width: 100%;
1477
- }
1478
-
1479
- /* ==================
1480
- Text Indent styles
1481
- ================== */
1482
-
1483
- .qti-text-indent-0 {
1484
- text-indent: 0;
1485
- }
1486
-
1487
- .qti-text-indent-px {
1488
- text-indent: 1px;
1489
- }
1490
-
1491
- .qti-text-indent-0p5 {
1492
- text-indent: 0.125rem;
1493
- }
1494
-
1495
- .qti-text-indent-1 {
1496
- text-indent: 0.25rem;
1497
- }
1498
-
1499
- .qti-text-indent-1p5 {
1500
- text-indent: 0.375rem;
1501
- }
1502
-
1503
- .qti-text-indent-2 {
1504
- text-indent: 0.5rem;
1505
- }
1506
-
1507
- .qti-text-indent-2p5 {
1508
- text-indent: 0.625rem;
1509
- }
1510
-
1511
- .qti-text-indent-3 {
1512
- text-indent: 0.75rem;
1513
- }
1514
-
1515
- .qti-text-indent-3p5 {
1516
- text-indent: 0.875rem;
1517
- }
1518
-
1519
- .qti-text-indent-4 {
1520
- text-indent: 1rem;
1521
- }
1522
-
1523
- .qti-text-indent-5 {
1524
- text-indent: 1.25rem;
1525
- }
1526
-
1527
- .qti-text-indent-6 {
1528
- text-indent: 1.5rem;
1529
- }
1530
-
1531
- .qti-text-indent-7 {
1532
- text-indent: 1.75rem;
1533
- }
1534
-
1535
- .qti-text-indent-8 {
1536
- text-indent: 2rem;
1537
- }
1538
-
1539
- .qti-text-indent-12 {
1540
- text-indent: 3rem;
1541
- }
1542
-
1543
- .qti-text-indent-16 {
1544
- text-indent: 4rem;
1545
- }
1546
-
1547
- .qti-text-indent-20 {
1548
- text-indent: 5rem;
1549
- }
1550
-
1551
- .qti-text-indent-24 {
1552
- text-indent: 6rem;
1553
- }
1554
-
1555
- .qti-text-indent-28 {
1556
- text-indent: 7rem;
1557
- }
1558
-
1559
- .qti-text-indent-32 {
1560
- text-indent: 8rem;
1561
- }
1562
-
1563
- /* =================
1564
- List Style styles
1565
- ================= */
1566
-
1567
- .qti-list-style-type-none {
1568
- list-style-type: none;
1569
- }
1570
-
1571
- .qti-list-style-type-disc {
1572
- list-style-type: disc;
1573
- }
1574
-
1575
- .qti-list-style-type-circle {
1576
- list-style-type: circle;
1577
- }
1578
-
1579
- .qti-list-style-type-square {
1580
- list-style-type: square;
1581
- }
1582
-
1583
- .qti-list-style-type-decimal {
1584
- list-style-type: decimal;
1585
- }
1586
-
1587
- .qti-list-style-type-decimal-leading-zero {
1588
- list-style-type: decimal-leading-zero;
1589
- }
1590
-
1591
- .qti-list-style-type-lower-alpha {
1592
- list-style-type: lower-alpha;
1593
- }
1594
-
1595
- .qti-list-style-type-upper-alpha {
1596
- list-style-type: upper-alpha;
1597
- }
1598
-
1599
- .qti-list-style-type-lower-roman {
1600
- list-style-type: lower-roman;
1601
- }
1602
-
1603
- .qti-list-style-type-upper-roman {
1604
- list-style-type: upper-roman;
1605
- }
1606
-
1607
- .qti-list-style-type-lower-latin {
1608
- list-style-type: lower-latin;
1609
- }
1610
-
1611
- .qti-list-style-type-upper-latin {
1612
- list-style-type: upper-latin;
1613
- }
1614
-
1615
- .qti-list-style-type-lower-greek {
1616
- list-style-type: lower-greek;
1617
- }
1618
-
1619
- .qti-list-style-type-arabic-indic {
1620
- list-style-type: arabic-indic;
1621
- }
1622
-
1623
- .qti-list-style-type-armenian {
1624
- list-style-type: armenian;
1625
- }
1626
-
1627
- .qti-list-style-type-lower-armenian {
1628
- list-style-type: lower-armenian;
1629
- }
1630
-
1631
- .qti-list-style-type-upper-armenian {
1632
- list-style-type: upper-armenian;
1633
- }
1634
-
1635
- .qti-list-style-type-bengali {
1636
- list-style-type: bengali;
1637
- }
1638
-
1639
- .qti-list-style-type-cambodian {
1640
- list-style-type: cambodian;
1641
- }
1642
-
1643
- .qti-list-style-type-simp-chinese-formal {
1644
- list-style-type: simp-chinese-formal;
1645
- }
1646
-
1647
- .qti-list-style-type-simp-chinese-informal {
1648
- list-style-type: simp-chinese-informal;
1649
- }
1650
-
1651
- .qti-list-style-type-trad-chinese-formal {
1652
- list-style-type: trad-chinese-formal;
1653
- }
1654
-
1655
- .qti-list-style-type-trad-chinese-informal {
1656
- list-style-type: trad-chinese-informal;
1657
- }
1658
-
1659
- .qti-list-style-type-cjk-ideographic {
1660
- list-style-type: cjk-ideographic;
1661
- }
1662
-
1663
- .qti-list-style-type-cjk-heavenly-stem {
1664
- list-style-type: cjk-heavenly-stem;
1665
- }
1666
-
1667
- .qti-list-style-type-cjk-earthly-branch {
1668
- list-style-type: cjk-earthly-branch;
1669
- }
1670
-
1671
- .qti-list-style-type-devanagari {
1672
- list-style-type: devanagari;
1673
- }
1674
-
1675
- .qti-list-style-type-ethiopic-halehame-ti-er {
1676
- list-style-type: ethiopic-halehame-ti-er;
1677
- }
1678
-
1679
- .qti-list-style-type-ethiopic-halehame-ti-et {
1680
- list-style-type: ethiopic-halehame-ti-et;
1681
- }
1682
-
1683
- .qti-list-style-type-ethiopic-halehame-am {
1684
- list-style-type: ethiopic-halehame-am;
1685
- }
1686
-
1687
- .qti-list-style-type-ethiopic-halehame {
1688
- list-style-type: ethiopic-halehame;
1689
- }
1690
-
1691
- .qti-list-style-type-georgian {
1692
- list-style-type: georgian;
1693
- }
1694
-
1695
- .qti-list-style-type-gujarati {
1696
- list-style-type: gujarati;
1697
- }
1698
-
1699
- .qti-list-style-type-gurmukhi {
1700
- list-style-type: gurmukhi;
1701
- }
1702
-
1703
- .qti-list-style-type-hangul {
1704
- list-style-type: hangul;
1705
- }
1706
-
1707
- .qti-list-style-type-hangul-consonant {
1708
- list-style-type: hangul-consonant;
1709
- }
1710
-
1711
- .qti-list-style-type-hebrew {
1712
- list-style-type: hebrew;
1713
- }
1714
-
1715
- .qti-list-style-type-hiragana {
1716
- list-style-type: hiragana;
1717
- }
1718
-
1719
- .qti-list-style-type-hiragana-iroha {
1720
- list-style-type: hiragana-iroha;
1721
- }
1722
-
1723
- .qti-list-style-type-khmer {
1724
- list-style-type: khmer;
1725
- }
1726
-
1727
- .qti-list-style-type-korean-hangul-formal {
1728
- list-style-type: korean-hangul-formal;
1729
- }
1730
-
1731
- .qti-list-style-type-korean-hanja-formal {
1732
- list-style-type: korean-hanja-formal;
1733
- }
1734
-
1735
- .qti-list-style-type-korean-hanja-informal {
1736
- list-style-type: korean-hanja-informal;
1737
- }
1738
-
1739
- .qti-list-style-type-lao {
1740
- list-style-type: lao;
1741
- }
1742
-
1743
- .qti-list-style-type-malayalam {
1744
- list-style-type: malayalam;
1745
- }
1746
-
1747
- .qti-list-style-type-mongolian {
1748
- list-style-type: mongolian;
1749
- }
1750
-
1751
- .qti-list-style-type-myanmar {
1752
- list-style-type: myanmar;
1753
- }
1754
-
1755
- .qti-list-style-type-oriya {
1756
- list-style-type: oriya;
1757
- }
1758
-
1759
- .qti-list-style-type-persian {
1760
- list-style-type: persian;
1761
- }
1762
-
1763
- .qti-list-style-type-thai {
1764
- list-style-type: thai;
1765
- }
1766
-
1767
- .qti-list-style-type-tibetan {
1768
- list-style-type: tibetan;
1769
- }
1770
-
1771
- .qti-list-style-type-telugu {
1772
- list-style-type: telugu;
1773
- }
1774
-
1775
- .qti-list-style-type-urdu {
1776
- list-style-type: urdu;
1777
- }
1778
-
1779
- /* =========================
1780
- Other QTI 3 Presentation Utilities
1781
- ========================= */
1782
-
1783
- .qti-bordered {
1784
- border: 1px solid var(--table-border-color);
1785
- }
1786
-
1787
- .qti-underline {
1788
- text-decoration: underline;
1789
- text-decoration-color: var(--foreground);
1790
- }
1791
-
1792
- .qti-italic {
1793
- font-style: italic;
1794
- }
1795
-
1796
- .qti-well {
1797
- min-height: 20px;
1798
- padding: 19px;
1799
- margin-bottom: 20px;
1800
- background-color: var(--well-bg);
1801
- border: var(--well-border);
1802
- border-radius: 4px;
1803
- box-shadow: var(--well-box-shadow);
1804
- }
1805
-
1806
- /* Set writing-mode to vertical-rl
1807
- Typical for CJK vertical text */
1808
-
1809
- .qti-writing-mode-vertical-rl {
1810
- writing-mode: vertical-rl;
1811
- }
1812
-
1813
- /* Set writing-mode to vertical-lr
1814
- Typical for Mongolian vertical text */
1815
-
1816
- .qti-writing-mode-vertical-lr {
1817
- writing-mode: vertical-lr;
1818
- }
1819
-
1820
- /* Set writing-mode to horizontal-tb
1821
- Browser default */
1822
-
1823
- .qti-writing-mode-horizontal-tb {
1824
- writing-mode: horizontal-tb;
1825
- }
1826
-
1827
- /* Float an element left */
1828
-
1829
- .qti-float-left {
1830
- float: left;
1831
- }
1832
-
1833
- /* Float an element right */
1834
-
1835
- .qti-float-right {
1836
- float: right;
1837
- }
1838
-
1839
- /* Remove a float */
1840
-
1841
- .qti-float-none {
1842
- float: none;
1843
- }
1844
-
1845
- /* Clearfix Hack to apply to a container of
1846
- floated content that overflows the container. */
1847
-
1848
- .qti-float-clearfix::after {
1849
- content: '';
1850
- clear: both;
1851
- display: table;
1852
- }
1853
-
1854
- .qti-float-clear-left
1855
- .qti-float-clear-right
1856
- .qti-float-clear-both
1857
-
1858
- /* Set text-orientation to upright */
1859
- .qti-text-orientation-upright {
1860
- text-orientation: upright;
1861
- }
1862
-
1863
- /* stylelint-disable number-max-precision */
1864
-
1865
- @layer qti-base {
1866
- .qti-layout-row {
1867
- display: flex;
1868
- flex-wrap: wrap;
1869
- width: 100%;
1870
- gap: 2.1276595745%;
1871
- }
1872
-
1873
- .qti-layout-row [class*='qti-layout-col']:not(:empty) {
1874
- box-sizing: border-box;
1875
- }
1876
-
1877
- .qti-layout-row [class*='qti-layout-col']:empty {
1878
- width: 0;
1879
- overflow: hidden; /* to fully collapse if there\u2019s padding or borders */
1880
- }
1881
-
1882
- .qti-layout-col1 {
1883
- width: 6.3829787234%;
1884
- }
1885
-
1886
- .qti-layout-col2 {
1887
- width: 14.8936170213%;
1888
- }
1889
-
1890
- .qti-layout-col3 {
1891
- width: 23.4042553191%;
1892
- }
1893
-
1894
- .qti-layout-col4 {
1895
- width: 31.914893617%;
1896
- }
1897
-
1898
- .qti-layout-col5 {
1899
- width: 40.4255319149%;
1900
- }
1901
-
1902
- .qti-layout-col6 {
1903
- width: 48.9361702128%;
1904
- }
1905
-
1906
- .qti-layout-col7 {
1907
- width: 57.4468085106%;
1908
- }
1909
-
1910
- .qti-layout-col8 {
1911
- width: 65.9574468085%;
1912
- }
1913
-
1914
- .qti-layout-col9 {
1915
- width: 74.4680851064%;
1916
- }
1917
-
1918
- .qti-layout-col10 {
1919
- width: 82.9787234043%;
1920
- }
1921
-
1922
- .qti-layout-col11 {
1923
- width: 91.4893617021%;
1924
- }
1925
-
1926
- .qti-layout-col12 {
1927
- width: 100%;
1928
- }
1929
-
1930
- .qti-layout-offset1 {
1931
- margin-left: 8.5106382979%;
1932
- }
1933
-
1934
- .qti-layout-offset2 {
1935
- margin-left: 17.0212765957%;
1936
- }
1937
-
1938
- .qti-layout-offset3 {
1939
- margin-left: 25.5319148936%;
1940
- }
1941
-
1942
- .qti-layout-offset4 {
1943
- margin-left: 34.0425531915%;
1944
- }
1945
-
1946
- .qti-layout-offset5 {
1947
- margin-left: 42.5531914894%;
1948
- }
1949
-
1950
- .qti-layout-offset6 {
1951
- margin-left: 51.0638297872%;
1952
- }
1953
-
1954
- .qti-layout-offset7 {
1955
- margin-left: 59.5744680851%;
1956
- }
1957
-
1958
- .qti-layout-offset8 {
1959
- margin-left: 68.085106383%;
1960
- }
1961
-
1962
- .qti-layout-offset9 {
1963
- margin-left: 76.5957446809%;
1964
- }
1965
-
1966
- .qti-layout-offset10 {
1967
- margin-left: 85.1063829787%;
1968
- }
1969
-
1970
- .qti-layout-offset11 {
1971
- margin-left: 93.6170212766%;
1972
- }
1973
-
1974
- .qti-layout-offset12 {
1975
- margin-left: 102.1276595745%;
1976
- }
1977
-
1978
- @media (width <= 767px) {
1979
- [class*='qti-layout-col'] {
1980
- width: 100%;
1981
- }
1982
- }
1983
- }
1984
-
1985
- [view],
1986
- qti-outcome-declaration,
1987
- qti-response-declaration {
1988
- display: none;
1989
- }
1990
-
1991
- [view].show {
1992
- display: block;
1993
- }
1994
-
1995
- :host {
1996
- box-sizing: border-box;
1997
- }
1998
-
1999
- *,
2000
- *::before,
2001
- *::after {
2002
- box-sizing: inherit;
2003
- }
2004
-
2005
- /* components */
2006
-
2007
- @layer qti-components {
2008
- qti-choice-interaction {
2009
- &.qti-input-control-hidden {
2010
- & qti-simple-choice {
2011
-
2012
- &:hover {
2013
- background-color: var(--qti-hover-bg);
2014
- }
2015
-
2016
- &:focus {
2017
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2018
- }
2019
-
2020
- &::part(ch) {
2021
- display: none;
2022
- }
2023
-
2024
- &:state(--checked),
2025
- &[aria-checked='true'] {
2026
- border-color: var(--qti-border-active);
2027
- background-color: var(--qti-bg-active);
2028
- }
2029
-
2030
- &:state(readonly),
2031
- &[aria-readonly='true'] {
2032
- cursor: pointer;
2033
- background-color: var(--qti-bg);
2034
- outline: 0;
2035
- border: none;
2036
- }
2037
-
2038
- &:state(disabled),
2039
- &[aria-disabled='true'] {
2040
- cursor: not-allowed;
2041
- background-color: var(--qti-disabled-bg);
2042
- color: var(--qti-disabled-color);
2043
- border-color: var(--qti-border-color);
2044
- outline: 4px solid var(--qti-disabled-bg);
2045
- }
2046
-
2047
- border-radius: var(--qti-border-radius);
2048
-
2049
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
2050
-
2051
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2052
-
2053
- outline: none
2054
- }
2055
- }
2056
-
2057
- &:not(.qti-input-control-hidden) {
2058
- & qti-simple-choice {
2059
-
2060
- &:not([aria-disabled='true'], [aria-readonly='true'], :state(--checked)):hover {
2061
- background-color: var(--qti-hover-bg);
2062
- }
2063
-
2064
- &:focus {
2065
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2066
- }
2067
-
2068
- &:state(--checked),
2069
- &[aria-checked='true'] {
2070
- border-color: var(--qti-border-active);
2071
- background-color: var(--qti-bg-active);
2072
- }
2073
-
2074
- &:state(readonly),
2075
- &[aria-readonly='true'] {
2076
- cursor: pointer;
2077
- background-color: var(--qti-bg);
2078
- outline: 0;
2079
- border: none;
2080
- }
2081
-
2082
- &:state(disabled),
2083
- &[aria-disabled='true'] {
2084
- cursor: not-allowed;
2085
- background-color: var(--qti-disabled-bg);
2086
- color: var(--qti-disabled-color);
2087
- border-color: var(--qti-border-color);
2088
- outline: 4px solid var(--qti-disabled-bg);
2089
- }
2090
-
2091
- &::part(cha) {
2092
- width: calc(var(--qti-form-size) - 6px);
2093
- height: calc(var(--qti-form-size) - 6px);
2094
- }
2095
-
2096
- &:state(radio)::part(ch) {
2097
- border-radius: 100%;
2098
- display: grid;
2099
- place-content: center;
2100
- width: var(--qti-form-size);
2101
- height: var(--qti-form-size);
2102
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2103
- outline: none;
2104
- }
2105
-
2106
- &:state(radio):state(--checked)::part(cha) {
2107
- background-color: var(--qti-border-active);
2108
- border-radius: 100%;
2109
- }
2110
-
2111
- &:state(checkbox)::part(ch) {
2112
- display: flex;
2113
- place-items: center;
2114
- border-radius: var(--qti-border-radius);
2115
- display: grid;
2116
- place-content: center;
2117
- width: var(--qti-form-size);
2118
- height: var(--qti-form-size);
2119
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2120
- outline: none;
2121
- }
2122
-
2123
- &:state(checkbox):state(--checked)::part(cha) {
2124
- background-color: var(--qti-border-active);
2125
- -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
2126
- mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
2127
- }
2128
-
2129
- gap: 0.5rem;
2130
-
2131
- border-radius: var(--qti-border-radius);
2132
-
2133
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
2134
-
2135
- outline: none;
2136
-
2137
- cursor: pointer
2138
- }
2139
- }
2140
-
2141
- & qti-simple-choice {
2142
- width: -moz-fit-content;
2143
- width: fit-content;
2144
- cursor: pointer;
2145
-
2146
- &:state(correct-response),
2147
- &[data-correct-response='true'] {
2148
- &::after {
2149
- content: '\\02714';
2150
- color: #16a34a; /* text-green-600 */
2151
- }
2152
- }
2153
- }
2154
-
2155
- & qti-simple-choice > p {
2156
- margin: 0 !important;
2157
- padding: 0 !important;
2158
- }
2159
- }
2160
-
2161
- qti-graphic-gap-match-interaction:state(--dragzone-active)::part(drags) {
2162
- border-color: var(--qti-border-active);
2163
- background-color: var(--qti-bg-active);
2164
- }
2165
-
2166
- qti-graphic-gap-match-interaction:state(--dragzone-enabled)::part(drags) {
2167
- background-color: var(--qti-bg-active);
2168
- }
2169
-
2170
- /* Active state */
2171
- qti-graphic-gap-match-interaction.qti-selections-light:state(--dragzone-active)::part(drags) {
2172
- background-color: var(--qti-light-bg-active);
2173
- border-color: var(--qti-light-border-active);
2174
- }
2175
-
2176
- qti-graphic-gap-match-interaction.qti-selections-dark:state(--dragzone-active)::part(drags) {
2177
- background-color: var(--qti-dark-bg-active);
2178
- border-color: var(--qti-dark-border-active);
2179
- }
2180
-
2181
- /* Enabled state */
2182
- qti-graphic-gap-match-interaction.qti-selections-light:state(--dragzone-enabled)::part(drags) {
2183
- background-color: var(--qti-light-bg-active);
2184
- }
2185
-
2186
- qti-graphic-gap-match-interaction.qti-selections-dark:state(--dragzone-enabled)::part(drags) {
2187
- background-color: var(--qti-dark-bg-active);
2188
- }
2189
-
2190
- qti-graphic-gap-match-interaction {
2191
- position: relative;
2192
-
2193
- & qti-gap-img,
2194
- qti-gap-text {
2195
- display: flex;
2196
- justify-content: center;
2197
- align-items: center;
2198
- cursor: grab;
2199
- }
2200
-
2201
- & qti-associable-hotspot {
2202
- display: flex;
2203
- justify-content: center;
2204
- align-items: center;
2205
- border: 2px solid transparent;
2206
-
2207
- &[enabled] {
2208
-
2209
- /* Light theme override */
2210
- .qti-selections-light & {
2211
- background-color: var(--qti-light-bg-active);
2212
- }
2213
-
2214
- /* Dark theme override */
2215
- .qti-selections-dark & {
2216
- background-color: var(--qti-dark-bg-active);
2217
- }
2218
- background-color: var(--qti-bg-active)
2219
- }
2220
-
2221
- &[active] {
2222
-
2223
- /* Light theme override */
2224
- .qti-selections-light & {
2225
- background-color: var(--qti-light-bg-active);
2226
- border-color: var(--qti-light-border-active);
2227
- }
2228
-
2229
- /* Dark theme override */
2230
- .qti-selections-dark & {
2231
- background-color: var(--qti-dark-bg-active);
2232
- border-color: var(--qti-dark-border-active);
2233
- }
2234
- border-color: var(--qti-border-active);
2235
- background-color: var(--qti-bg-active)
2236
- }
2237
-
2238
- &[disabled] {
2239
-
2240
- &:not(:empty) {
2241
- cursor: default !important;
2242
- }
2243
-
2244
- cursor: not-allowed;
2245
-
2246
- background-color: var(--qti-disabled-bg);
2247
-
2248
- color: var(--qti-disabled-color);
2249
-
2250
- border-color: var(--qti-border-color);
2251
-
2252
- outline: 4px solid var(--qti-disabled-bg)
2253
- }
2254
-
2255
- &:empty::after {
2256
- padding: var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */
2257
- content: '\\0000a0'; /* when empty, put a space in it */
2258
- }
2259
-
2260
- &:not(:empty) {
2261
- padding: 0;
2262
- width: auto;
2263
- }
2264
-
2265
- &:not(:empty) > * {
2266
- flex: 1;
2267
- transform: rotate(0); /* rotate-0 */
2268
- box-shadow: 0 0 0 1px #e5e7eb; /* ring-gray-200 */
2269
- }
2270
- }
2271
-
2272
- & img {
2273
- margin: 0;
2274
- padding: 0;
2275
- }
2276
- }
2277
-
2278
- qti-text-entry-interaction {
2279
- &::part(input) {
2280
- border-radius: 0;
2281
- cursor: text;
2282
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
2283
- background: unset;
2284
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2285
- outline: none;
2286
- }
2287
-
2288
- &:hover {
2289
- background-color: var(--qti-hover-bg);
2290
- }
2291
-
2292
- &:focus-within {
2293
- &::part(input) {
2294
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2295
- border-color: var(--qti-border-active);
2296
- }
2297
- }
2298
- }
2299
-
2300
- qti-extended-text-interaction {
2301
- &::part(textarea) {
2302
- border-radius: 0;
2303
- cursor: text;
2304
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
2305
- background: unset;
2306
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2307
- outline: none;
2308
- }
2309
-
2310
- &:hover {
2311
- background-color: var(--qti-hover-bg);
2312
- }
2313
-
2314
- &:focus-within {
2315
- &::part(textarea) {
2316
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2317
- border-color: var(--qti-border-active);
2318
- }
2319
- }
2320
- }
2321
-
2322
- qti-gap-match-interaction:state(--dragzone-active)::part(drags) {
2323
- border-color: var(--qti-border-active);
2324
- background-color: var(--qti-bg-active);
2325
- }
2326
-
2327
- qti-gap-match-interaction:state(--dragzone-enabled)::part(drags) {
2328
- background-color: var(--qti-bg-active);
2329
- }
2330
-
2331
- qti-gap-match-interaction {
2332
- & qti-gap-text {
2333
-
2334
- &[dragging] {
2335
- pointer-events: none;
2336
- rotate: -2deg;
2337
- box-shadow: 0 8px 12px rgb(0 0 0 / 20%),
2338
- 0 4px 8px rgb(0 0 0 / 10%);
2339
- }
2340
-
2341
- &:hover {
2342
- background-color: var(--qti-hover-bg);
2343
- }
2344
-
2345
- &:focus {
2346
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2347
- }
2348
-
2349
- transition: transform 200ms ease-out,
2350
- box-shadow 200ms ease-out,
2351
- rotate 200ms ease-out;
2352
-
2353
- cursor: grab;
2354
-
2355
- background-color: var(--qti-bg);
2356
-
2357
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
2358
-
2359
- border-radius: var(--qti-border-radius);
2360
-
2361
- padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);
2362
-
2363
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2364
-
2365
- outline: none;
2366
-
2367
- background-image: radial-gradient(
2368
- circle at center,
2369
- rgb(0 0 0 / 10%) 0,
2370
- rgb(0 0 0 / 20%) 2px,
2371
- rgb(255 255 255 / 0%) 2px,
2372
- rgb(255 255 255 / 0%) 100%
2373
- );
2374
-
2375
- background-repeat: repeat-y;
2376
-
2377
- background-position: left center;
2378
-
2379
- background-size: 14px 8px
2380
- }
2381
-
2382
- & qti-gap {
2383
-
2384
- &[enabled] {
2385
-
2386
- /* Light theme override */
2387
- .qti-selections-light & {
2388
- border-color: var(--qti-light-border-active);
2389
- }
2390
-
2391
- /* Dark theme override */
2392
- .qti-selections-dark & {
2393
- border-color: var(--qti-dark-border-active);
2394
- }
2395
- background-color: var(--qti-bg-active)
2396
- }
2397
-
2398
- &[disabled] {
2399
-
2400
- &:not(:empty) {
2401
- cursor: default !important;
2402
- }
2403
-
2404
- cursor: not-allowed;
2405
-
2406
- background-color: var(--qti-disabled-bg);
2407
-
2408
- color: var(--qti-disabled-color);
2409
-
2410
- border-color: var(--qti-border-color);
2411
-
2412
- outline: 4px solid var(--qti-disabled-bg)
2413
- }
2414
-
2415
- &[active] {
2416
-
2417
- /* Light theme override */
2418
- .qti-selections-light & {
2419
- background-color: var(--qti-light-bg-active);
2420
- border-color: var(--qti-light-border-active);
2421
- }
2422
-
2423
- /* Dark theme override */
2424
- .qti-selections-dark & {
2425
- background-color: var(--qti-dark-bg-active);
2426
- border-color: var(--qti-dark-border-active);
2427
- }
2428
- border-color: var(--qti-border-active);
2429
- background-color: var(--qti-bg-active)
2430
- }
2431
-
2432
- display: inline-flex;
2433
- align-items: center;
2434
-
2435
- &:empty::after {
2436
- padding: var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */
2437
- content: '\\0000a0'; /* when empty, put a space in it */
2438
- }
2439
-
2440
- &:not(:empty) {
2441
- display: inline-flex;
2442
- padding: 0;
2443
- width: auto;
2444
- }
2445
-
2446
- &:not(:empty) > * {
2447
- flex: 1;
2448
- transform: rotate(0); /* rotate-0 */
2449
- box-shadow: 0 0 0 1px #e5e7eb; /* ring-gray-200 */
2450
- }
2451
-
2452
- background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
2453
- center no-repeat;
2454
-
2455
- border-radius: var(--qti-border-radius);
2456
-
2457
- position: relative;
2458
-
2459
- background-color: var(--qti-bg);
2460
-
2461
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2462
-
2463
- outline: none
2464
- }
2465
- }
2466
-
2467
- qti-hotspot-interaction {
2468
- & qti-hotspot-choice {
2469
- &[shape='circle'] {
2470
-
2471
- &:hover {
2472
- background-color: var(--qti-hover-bg);
2473
- }
2474
-
2475
- &:focus {
2476
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2477
- }
2478
-
2479
- &:state(--checked),
2480
- &[aria-checked='true'] {
2481
- border-color: var(--qti-border-active);
2482
- }
2483
-
2484
- &:state(--readonly),
2485
- &[aria-readonly='true'] {
2486
- cursor: pointer;
2487
- background-color: var(--qti-bg);
2488
- outline: 0;
2489
- border: none;
2490
- }
2491
-
2492
- &:state(--disabled),
2493
- &[aria-disabled='true'] {
2494
- cursor: not-allowed;
2495
- background-color: var(--qti-disabled-bg);
2496
- color: var(--qti-disabled-color);
2497
- border-color: var(--qti-border-color);
2498
- outline: 4px solid var(--qti-disabled-bg);
2499
- }
2500
-
2501
- width: 100%;
2502
-
2503
- height: 100%;
2504
-
2505
- background-color: transparent;
2506
-
2507
- padding: 0;
2508
-
2509
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2510
-
2511
- outline: none
2512
- }
2513
-
2514
- &[shape='rect'] {
2515
-
2516
- /* &:hover {
2517
- @apply hov;
2518
- } */
2519
-
2520
- &:focus {
2521
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2522
- }
2523
-
2524
- &:state(--checked),
2525
- &[aria-checked='true'] {
2526
- border-color: var(--qti-border-active);
2527
- }
2528
-
2529
- &[aria-readonly='true'] {
2530
- cursor: pointer;
2531
- background-color: var(--qti-bg);
2532
- outline: 0;
2533
- border: none;
2534
- }
2535
-
2536
- &[aria-disabled='true'] {
2537
- cursor: not-allowed;
2538
- background-color: var(--qti-disabled-bg);
2539
- color: var(--qti-disabled-color);
2540
- border-color: var(--qti-border-color);
2541
- outline: 4px solid var(--qti-disabled-bg);
2542
- }
2543
-
2544
- width: 100%;
2545
-
2546
- height: 100%;
2547
-
2548
- background-color: transparent;
2549
-
2550
- padding: 0;
2551
-
2552
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2553
-
2554
- outline: none
2555
- }
2556
-
2557
- &[shape='poly'] {
2558
- &:hover::after {
2559
- content: '';
2560
- width: 100%;
2561
- height: 100%;
2562
- background: repeating-linear-gradient(
2563
- 45deg,
2564
- var(--qti-border-active),
2565
- var(--qti-border-active) 5px,
2566
- transparent 5px,
2567
- transparent 10px
2568
- );
2569
- display: block;
2570
- }
2571
-
2572
- &:state(--checked)::after,
2573
- &[aria-checked='true']::after {
2574
- content: '';
2575
- width: 100%;
2576
- height: 100%;
2577
- background: repeating-linear-gradient(
2578
- 45deg,
2579
- transparent,
2580
- transparent 5px,
2581
- var(--qti-border-active) 5px,
2582
- var(--qti-border-active) 10px
2583
- );
2584
- display: block;
2585
- }
2586
-
2587
- &[aria-readonly='true'] {
2588
- cursor: pointer;
2589
- background-color: var(--qti-bg);
2590
- outline: 0;
2591
- border: none;
2592
- }
2593
-
2594
- &[aria-disabled='true'] {
2595
- cursor: not-allowed;
2596
- background-color: var(--qti-disabled-bg);
2597
- color: var(--qti-disabled-color);
2598
- border-color: var(--qti-border-color);
2599
- outline: 4px solid var(--qti-disabled-bg);
2600
- }
2601
- }
2602
- }
2603
- }
2604
-
2605
- qti-hottext-interaction {
2606
- /* &:not(.qti-input-control-hidden),
2607
- &:not(.qti-unselected-hidden) { */
2608
- qti-hottext {
2609
- display: inline-flex;
2610
- align-items: center;
2611
-
2612
- &:hover {
2613
- background-color: var(--qti-hover-bg);
2614
- }
2615
-
2616
- &:focus {
2617
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2618
- }
2619
-
2620
- &::part(cha) {
2621
- width: calc(var(--qti-form-size) - 6px);
2622
- height: calc(var(--qti-form-size) - 6px);
2623
- }
2624
-
2625
- &:state(radio)::part(ch) {
2626
- border-radius: 100%;
2627
- display: grid;
2628
- place-content: center;
2629
- width: var(--qti-form-size);
2630
- height: var(--qti-form-size);
2631
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2632
- outline: none;
2633
- }
2634
-
2635
- &:state(radio):state(--checked)::part(cha) {
2636
- background-color: var(--qti-border-active);
2637
- border-radius: 100%;
2638
- }
2639
-
2640
- &:state(checkbox)::part(ch) {
2641
- display: flex;
2642
- place-items: center;
2643
- border-radius: var(--qti-border-radius);
2644
- display: grid;
2645
- place-content: center;
2646
- width: var(--qti-form-size);
2647
- height: var(--qti-form-size);
2648
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2649
- outline: none;
2650
- }
2651
-
2652
- &:state(checkbox):state(--checked)::part(cha) {
2653
- background-color: var(--qti-border-active);
2654
- -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
2655
- mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
2656
- }
2657
-
2658
- gap: 0.5rem;
2659
-
2660
- border-radius: var(--qti-border-radius);
2661
-
2662
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
2663
-
2664
- outline: none;
2665
-
2666
- cursor: pointer
2667
- }
2668
-
2669
- /* } */
2670
-
2671
- &.qti-input-control-hidden {
2672
- qti-hottext {
2673
- /* --qti-padding-md: 0.1rem;
2674
- --qti-padding-lg: 0.2rem;
2675
- --qti-border-radius-md: 0.3rem;
2676
- --qti-border-thickness: 1px;
2677
- --qti-font-weight-semibold: 400; */
2678
-
2679
- &:hover {
2680
- background-color: var(--qti-hover-bg);
2681
- }
2682
-
2683
- &:focus {
2684
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2685
- }
2686
-
2687
- /* @layer qti-variants { */
2688
- &::part(ch) {
2689
- display: none;
2690
- }
2691
-
2692
- &:state(--checked) {
2693
- border-color: var(--qti-border-active);
2694
- background-color: var(--qti-bg-active);
2695
- }
2696
-
2697
- &[aria-readonly='true'] {
2698
- cursor: pointer;
2699
- background-color: var(--qti-bg);
2700
- outline: 0;
2701
- border: none;
2702
- }
2703
-
2704
- &[aria-disabled='true'] {
2705
- cursor: not-allowed;
2706
- background-color: var(--qti-disabled-bg);
2707
- color: var(--qti-disabled-color);
2708
- border-color: var(--qti-border-color);
2709
- outline: 4px solid var(--qti-disabled-bg);
2710
- }
2711
-
2712
- border-radius: var(--qti-border-radius);
2713
-
2714
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
2715
-
2716
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2717
-
2718
- outline: none
2719
- }
2720
-
2721
- /* } */
2722
- }
2723
-
2724
- &.qti-unselected-hidden {
2725
- qti-hottext {
2726
- &:hover {
2727
- background-color: var(--qti-hover-bg);
2728
- }
2729
-
2730
- &:focus {
2731
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2732
- }
2733
-
2734
- cursor: pointer;
2735
-
2736
- &::part(ch) {
2737
- display: none;
2738
- }
2739
-
2740
- &:state(--checked) {
2741
- background-color: var(--qti-bg-active);
2742
- }
2743
-
2744
- &[aria-readonly='true'] {
2745
- cursor: pointer;
2746
- background-color: var(--qti-bg);
2747
- outline: 0;
2748
- border: none;
2749
- }
2750
-
2751
- &[aria-disabled='true'] {
2752
- cursor: not-allowed;
2753
- background-color: var(--qti-disabled-bg);
2754
- color: var(--qti-disabled-color);
2755
- border-color: var(--qti-border-color);
2756
- outline: 4px solid var(--qti-disabled-bg);
2757
- }
2758
- }
2759
- }
2760
- }
2761
-
2762
- qti-inline-choice-interaction {
2763
- &::part(select) {
2764
-
2765
- &:hover {
2766
- background-color: var(--qti-hover-bg);
2767
- }
2768
-
2769
- &:focus {
2770
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2771
- }
2772
-
2773
- border-radius: var(--qti-border-radius);
2774
-
2775
- position: relative;
2776
-
2777
- -webkit-appearance: none;
2778
-
2779
- -moz-appearance: none;
2780
-
2781
- appearance: none;
2782
-
2783
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
2784
-
2785
- padding-right: calc(var(--qti-padding-horizontal) + 1.5rem);
2786
-
2787
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2788
-
2789
- outline: none;
2790
-
2791
- background: url("data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E")
2792
- no-repeat center right 6px
2793
- }
2794
- }
2795
-
2796
- qti-match-interaction:not(.qti-match-tabular) {
2797
- /* The draggables */
2798
- & qti-simple-match-set:first-of-type {
2799
- display: flex;
2800
- flex-wrap: wrap;
2801
- align-items: flex-start; /* Prevents children from stretching */
2802
- gap: var(--qti-gap-size);
2803
-
2804
- & qti-simple-associable-choice {
2805
-
2806
- &[dragging] {
2807
- pointer-events: none;
2808
- rotate: -2deg;
2809
- box-shadow: 0 8px 12px rgb(0 0 0 / 20%),
2810
- 0 4px 8px rgb(0 0 0 / 10%);
2811
- }
2812
-
2813
- &:hover {
2814
- background-color: var(--qti-hover-bg);
2815
- }
2816
-
2817
- &:focus {
2818
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2819
- }
2820
-
2821
- transition: transform 200ms ease-out,
2822
- box-shadow 200ms ease-out,
2823
- rotate 200ms ease-out;
2824
-
2825
- cursor: grab;
2826
-
2827
- background-color: var(--qti-bg);
2828
-
2829
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
2830
-
2831
- border-radius: var(--qti-border-radius);
2832
-
2833
- padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);
2834
-
2835
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2836
-
2837
- outline: none;
2838
-
2839
- background-image: radial-gradient(
2840
- circle at center,
2841
- rgb(0 0 0 / 10%) 0,
2842
- rgb(0 0 0 / 20%) 2px,
2843
- rgb(255 255 255 / 0%) 2px,
2844
- rgb(255 255 255 / 0%) 100%
2845
- );
2846
-
2847
- background-repeat: repeat-y;
2848
-
2849
- background-position: left center;
2850
-
2851
- background-size: 14px 8px
2852
- }
2853
- }
2854
-
2855
- /* The droppables */
2856
- & qti-simple-match-set:last-of-type {
2857
- display: grid;
2858
- grid-auto-columns: 1fr; /* auto-cols-fr */
2859
- grid-auto-flow: column; /* grid-flow-col */
2860
- gap: var(--qti-gap-size); /* gap-2 */
2861
- width: 100%; /* w-full */
2862
-
2863
- & qti-simple-associable-choice {
2864
- display: flex;
2865
- flex-direction: column;
2866
- }
2867
-
2868
- & > qti-simple-associable-choice {
2869
- /* a droppable qti-simple-associable-choice */
2870
- box-sizing: border-box;
2871
- display: grid;
2872
- grid-row: 2 / 4;
2873
- grid-template-rows: subgrid;
2874
-
2875
- & img {
2876
- max-width: 100%;
2877
- height: auto;
2878
- }
2879
-
2880
- &[enabled] {
2881
- &::part(dropslot) {
2882
- background-color: var(--qti-bg-active);
2883
- }
2884
- }
2885
-
2886
- &[disabled] {
2887
- &::part(dropslot) {
2888
- cursor: not-allowed;
2889
- background-color: var(--qti-disabled-bg);
2890
- color: var(--qti-disabled-color);
2891
- border-color: var(--qti-border-color);
2892
- outline: 4px solid var(--qti-disabled-bg);
2893
- }
2894
- }
2895
-
2896
- &[active] {
2897
- &::part(dropslot) {
2898
- border-color: var(--qti-border-active);
2899
- background-color: var(--qti-bg-active);
2900
- }
2901
- }
2902
-
2903
- &::part(dropslot) {
2904
-
2905
- &[dragging] {
2906
- pointer-events: none;
2907
- rotate: -2deg;
2908
- box-shadow: 0 8px 12px rgb(0 0 0 / 20%),
2909
- 0 4px 8px rgb(0 0 0 / 10%);
2910
- }
2911
-
2912
- &:focus {
2913
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2914
- }
2915
-
2916
- min-height: 6rem;
2917
- gap: var(--qti-gap-size);
2918
- box-sizing: border-box;
2919
- display: flex;
2920
- justify-content: center;
2921
- align-items: center;
2922
- background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
2923
- center no-repeat;
2924
- border-radius: var(--qti-border-radius);
2925
- position: relative;
2926
- background-color: var(--qti-bg);
2927
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2928
- outline: none;
2929
- }
2930
-
2931
- & > *:not(qti-simple-associable-choice) {
2932
- pointer-events: none;
2933
- }
2934
-
2935
- & > qti-simple-associable-choice {
2936
-
2937
- &::part(dropslot) {
2938
- display: none;
2939
- }
2940
-
2941
- &:hover {
2942
- background-color: var(--qti-hover-bg);
2943
- }
2944
-
2945
- &:focus {
2946
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2947
- }
2948
-
2949
- flex-basis: fit-content;
2950
-
2951
- transition: transform 200ms ease-out,
2952
- box-shadow 200ms ease-out,
2953
- rotate 200ms ease-out;
2954
-
2955
- cursor: grab;
2956
-
2957
- background-color: var(--qti-bg);
2958
-
2959
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
2960
-
2961
- border-radius: var(--qti-border-radius);
2962
-
2963
- padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);
2964
-
2965
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
2966
-
2967
- outline: none;
2968
-
2969
- background-image: radial-gradient(
2970
- circle at center,
2971
- rgb(0 0 0 / 10%) 0,
2972
- rgb(0 0 0 / 20%) 2px,
2973
- rgb(255 255 255 / 0%) 2px,
2974
- rgb(255 255 255 / 0%) 100%
2975
- );
2976
-
2977
- background-repeat: repeat-y;
2978
-
2979
- background-position: left center;
2980
-
2981
- background-size: 14px 8px;
2982
- }
2983
- }
2984
- }
2985
- }
2986
-
2987
- qti-order-interaction {
2988
- &::part(qti-simple-choice),
2989
- & qti-simple-choice {
2990
-
2991
- &[dragging] {
2992
- pointer-events: none;
2993
- rotate: -2deg;
2994
- box-shadow: 0 8px 12px rgb(0 0 0 / 20%),
2995
- 0 4px 8px rgb(0 0 0 / 10%);
2996
- }
2997
-
2998
- &:hover {
2999
- background-color: var(--qti-hover-bg);
3000
- }
3001
-
3002
- &:focus {
3003
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3004
- }
3005
-
3006
- transition: transform 200ms ease-out,
3007
- box-shadow 200ms ease-out,
3008
- rotate 200ms ease-out;
3009
-
3010
- cursor: grab;
3011
-
3012
- background-color: var(--qti-bg);
3013
-
3014
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
3015
-
3016
- border-radius: var(--qti-border-radius);
3017
-
3018
- padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);
3019
-
3020
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3021
-
3022
- outline: none;
3023
-
3024
- background-image: radial-gradient(
3025
- circle at center,
3026
- rgb(0 0 0 / 10%) 0,
3027
- rgb(0 0 0 / 20%) 2px,
3028
- rgb(255 255 255 / 0%) 2px,
3029
- rgb(255 255 255 / 0%) 100%
3030
- );
3031
-
3032
- background-repeat: repeat-y;
3033
-
3034
- background-position: left center;
3035
-
3036
- background-size: 14px 8px
3037
- }
3038
-
3039
- &::part(qti-simple-choice) {
3040
- display: flex;
3041
- overflow: hidden;
3042
- align-items: center;
3043
- width: 100%;
3044
- text-overflow: ellipsis;
3045
- }
3046
-
3047
- &::part(drops) {
3048
- gap: 0.5rem; /* gap-2 */
3049
- }
3050
-
3051
- &::part(drags) {
3052
- gap: 0.5rem; /* gap-2 */
3053
- }
3054
-
3055
- &::part(drop-list) {
3056
-
3057
- &[enabled] {
3058
-
3059
- /* Light theme override */
3060
- .qti-selections-light & {
3061
- border-color: var(--qti-light-border-active);
3062
- }
3063
-
3064
- /* Dark theme override */
3065
- .qti-selections-dark & {
3066
- border-color: var(--qti-dark-border-active);
3067
- }
3068
- background-color: var(--qti-bg-active)
3069
- }
3070
-
3071
- &:hover {
3072
- background-color: var(--qti-hover-bg);
3073
- }
3074
-
3075
- &:focus {
3076
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3077
- }
3078
-
3079
- display: flex;
3080
- min-height: 4rem;
3081
- background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
3082
- center no-repeat;
3083
- border-radius: var(--qti-border-radius);
3084
- position: relative;
3085
- background-color: var(--qti-bg);
3086
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3087
- outline: none;
3088
- }
3089
-
3090
- &::part(active) {
3091
- border-color: var(--qti-border-active);
3092
- background-color: var(--qti-bg-active);
3093
- }
3094
- }
3095
-
3096
- qti-associate-interaction {
3097
- & qti-simple-associable-choice, /* drags when in lightdom */
3098
- &::part(qti-simple-associable-choice) /* drags when in shadowdom */ {
3099
-
3100
- &:hover {
3101
- background-color: var(--qti-hover-bg);
3102
- }
3103
-
3104
- &:focus {
3105
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3106
- }
3107
-
3108
- &[dragging] {
3109
- pointer-events: none;
3110
- rotate: -2deg;
3111
- box-shadow: 0 8px 12px rgb(0 0 0 / 20%),
3112
- 0 4px 8px rgb(0 0 0 / 10%);
3113
- }
3114
-
3115
- transition: transform 200ms ease-out,
3116
- box-shadow 200ms ease-out,
3117
- rotate 200ms ease-out;
3118
-
3119
- cursor: grab;
3120
-
3121
- background-color: var(--qti-bg);
3122
-
3123
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
3124
-
3125
- border-radius: var(--qti-border-radius);
3126
-
3127
- padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);
3128
-
3129
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3130
-
3131
- outline: none;
3132
-
3133
- background-image: radial-gradient(
3134
- circle at center,
3135
- rgb(0 0 0 / 10%) 0,
3136
- rgb(0 0 0 / 20%) 2px,
3137
- rgb(255 255 255 / 0%) 2px,
3138
- rgb(255 255 255 / 0%) 100%
3139
- );
3140
-
3141
- background-repeat: repeat-y;
3142
-
3143
- background-position: left center;
3144
-
3145
- background-size: 14px 8px
3146
- }
3147
-
3148
- /* display: flex;
3149
- overflow: hidden;
3150
- align-items: center; */
3151
-
3152
- /* &::part(drop-container) {
3153
- display: flex;
3154
- flex-direction: column;
3155
- gap: var(--qti-gap-size);
3156
- } */
3157
-
3158
- &::part(drop-list) {
3159
-
3160
- display: grid;
3161
- height: 3rem;
3162
- min-width: 10rem;
3163
- background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
3164
- center no-repeat;
3165
- border-radius: var(--qti-border-radius);
3166
- position: relative;
3167
- background-color: var(--qti-bg);
3168
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3169
- outline: none;
3170
- }
3171
-
3172
- &::part(drop-list):focus {
3173
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3174
- }
3175
-
3176
- &::part(drop-list)[dragging] {
3177
- border-color: var(--qti-border-active);
3178
- background-color: var(--qti-bg-active);
3179
- }
3180
-
3181
- /* &::part(drop-list) {
3182
- @apply act;
3183
- } */
3184
- }
3185
-
3186
- qti-graphic-order-interaction {
3187
- & qti-hotspot-choice {
3188
-
3189
- &:hover {
3190
- background-color: var(--qti-hover-bg);
3191
- }
3192
-
3193
- &:focus {
3194
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3195
- }
3196
-
3197
- &:state(--checked),
3198
- &[aria-checked='true'] {
3199
- border-color: var(--qti-border-active);
3200
- background-color: var(--qti-bg-active);
3201
- }
3202
-
3203
- &[aria-readonly='true'] {
3204
- cursor: pointer;
3205
- background-color: var(--qti-bg);
3206
- outline: 0;
3207
- border: none;
3208
- }
3209
-
3210
- &[aria-disabled='true'] {
3211
- cursor: not-allowed;
3212
- background-color: var(--qti-disabled-bg);
3213
- color: var(--qti-disabled-color);
3214
- border-color: var(--qti-border-color);
3215
- outline: 4px solid var(--qti-disabled-bg);
3216
- }
3217
-
3218
- &[aria-ordervalue] {
3219
- display: grid;
3220
- place-content: center;
3221
- }
3222
-
3223
- &[aria-ordervalue]::after {
3224
- content: attr(aria-ordervalue) !important;
3225
- }
3226
-
3227
- width: 100%;
3228
-
3229
- height: 100%;
3230
-
3231
- background-color: transparent;
3232
-
3233
- padding: 0;
3234
-
3235
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3236
-
3237
- outline: none
3238
- }
3239
- }
3240
-
3241
- qti-graphic-associate-interaction {
3242
- position: relative;
3243
- display: block;
3244
-
3245
- & qti-associable-hotspot {
3246
- &[shape='circle'] {
3247
-
3248
- &:hover {
3249
- background-color: var(--qti-hover-bg);
3250
- }
3251
-
3252
- &:focus {
3253
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3254
- }
3255
-
3256
- &[aria-checked='true'] {
3257
- border-color: var(--qti-border-active);
3258
- background-color: var(--qti-bg-active);
3259
- }
3260
-
3261
- &[aria-readonly='true'] {
3262
- cursor: pointer;
3263
- background-color: var(--qti-bg);
3264
- outline: 0;
3265
- border: none;
3266
- }
3267
-
3268
- &[aria-disabled='true'] {
3269
- cursor: not-allowed;
3270
- background-color: var(--qti-disabled-bg);
3271
- color: var(--qti-disabled-color);
3272
- border-color: var(--qti-border-color);
3273
- outline: 4px solid var(--qti-disabled-bg);
3274
- }
3275
-
3276
- width: 100%;
3277
-
3278
- height: 100%;
3279
-
3280
- background-color: transparent;
3281
-
3282
- padding: 0;
3283
-
3284
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3285
-
3286
- outline: none
3287
- }
3288
-
3289
- &[shape='square'] {
3290
-
3291
- &:hover {
3292
- background-color: var(--qti-hover-bg);
3293
- }
3294
-
3295
- &:focus {
3296
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3297
- }
3298
-
3299
- &[aria-checked='true'] {
3300
- border-color: var(--qti-border-active);
3301
- background-color: var(--qti-bg-active);
3302
- }
3303
-
3304
- &[aria-readonly='true'] {
3305
- cursor: pointer;
3306
- background-color: var(--qti-bg);
3307
- outline: 0;
3308
- border: none;
3309
- }
3310
-
3311
- &[aria-disabled='true'] {
3312
- cursor: not-allowed;
3313
- background-color: var(--qti-disabled-bg);
3314
- color: var(--qti-disabled-color);
3315
- border-color: var(--qti-border-color);
3316
- outline: 4px solid var(--qti-disabled-bg);
3317
- }
3318
-
3319
- width: 100%;
3320
-
3321
- height: 100%;
3322
-
3323
- background-color: transparent;
3324
-
3325
- padding: 0;
3326
-
3327
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3328
-
3329
- outline: none
3330
- }
3331
- }
3332
- }
3333
-
3334
- qti-slider-interaction {
3335
- display: block;
3336
-
3337
- --qti-tick-color: rgb(229 231 235 / 100%);
3338
- --qti-tick-width: 1px;
3339
-
3340
- &::part(slider) {
3341
- margin-left: 2rem; /* mx-8 */
3342
- margin-right: 2rem;
3343
- padding-bottom: 1rem; /* pb-4 */
3344
- padding-top: 1.25rem; /* pt-5 */
3345
- }
3346
-
3347
- --show-bounds: true;
3348
-
3349
- &::part(bounds) {
3350
- display: flex;
3351
- width: 100%;
3352
- justify-content: space-between;
3353
- margin-bottom: 0.5rem; /* mb-2 */
3354
- }
3355
-
3356
- --show-ticks: true;
3357
-
3358
- &::part(ticks) {
3359
- margin-left: 0.125rem; /* mx-0.5 */
3360
- margin-right: 0.125rem;
3361
- margin-bottom: 0.25rem; /* mb-1 */
3362
- height: 0.5rem; /* h-2 */
3363
- background: linear-gradient(to right, var(--qti-tick-color) var(--qti-tick-width), transparent 1px) repeat-x 0
3364
- center / calc(calc(100% - var(--qti-tick-width)) / ((var(--max) - var(--min)) / var(--step))) 100%;
3365
- }
3366
-
3367
- &::part(rail) {
3368
- display: flex;
3369
- align-items: center;
3370
- box-sizing: border-box;
3371
- height: 0.375rem; /* h-1.5 */
3372
- width: 100%;
3373
- cursor: pointer;
3374
- border-radius: 9999px; /* rounded-full */
3375
- border: 1px solid #d1d5db; /* border-gray-300 */
3376
- background-color: #e5e7eb; /* bg-gray-200 */
3377
- }
3378
-
3379
- &::part(knob) {
3380
- background-color: var(--qti-primary);
3381
- position: relative;
3382
- height: 1rem; /* h-4 */
3383
- width: 1rem; /* w-4 */
3384
- transform-origin: center;
3385
- transform: translateX(-50%);
3386
- cursor: pointer;
3387
- border-radius: 9999px; /* rounded-full */
3388
- left: var(--value-percentage);
3389
- }
3390
-
3391
- --show-value: true;
3392
-
3393
- &::part(value) {
3394
- position: absolute;
3395
- bottom: 2rem; /* bottom-8 */
3396
- left: 0.5rem; /* left-2 */
3397
- transform: translateX(-50%);
3398
- cursor: pointer;
3399
- border-radius: 0.25rem; /* rounded */
3400
- background-color: #f3f4f6; /* bg-gray-100 */
3401
- padding: 0.25rem 0.5rem; /* px-2 py-1 */
3402
- text-align: center;
3403
- color: #6b7280; /* text-gray-500 */
3404
- }
3405
- }
3406
-
3407
- qti-select-point-interaction {
3408
- &::part(point) {
3409
- &:hover {
3410
- background-color: var(--qti-hover-bg);
3411
- }
3412
-
3413
- &:focus {
3414
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3415
- }
3416
-
3417
- border-radius: 100%;
3418
-
3419
- width: var(--qti-point-size);
3420
-
3421
- height: var(--qti-point-size);
3422
-
3423
- background-color: transparent;
3424
-
3425
- padding: 0;
3426
-
3427
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3428
-
3429
- outline: none;
3430
- }
3431
- }
3432
-
3433
- qti-position-object-stage {
3434
- & qti-position-object-interaction {
3435
- /* no styles necessary, only layout styles, defined in the component */
3436
- }
3437
- }
3438
-
3439
- qti-prompt {
3440
- margin: 0.5rem 0; /* my-2 */
3441
- display: block;
3442
- width: 100%;
3443
- }
3444
- }
3445
- `;var Mt=class extends v{constructor(){super(...arguments);this.testURL=""}async connectedCallback(){super.connectedCallback();let t=this.querySelector("template");if(t)this.preContent=t.content;else{this.preContent=h``;let r=new CSSStyleSheet;r.replaceSync(ms),this.shadowRoot.adoptedStyleSheets=[r],await this.updateComplete;let i=new CustomEvent("qti-load-test-request",{bubbles:!0,composed:!0,detail:{promise:null,testURL:this.testURL}});this.dispatchEvent(i)?this.content=(async()=>await i.detail.promise)():(console.warn("No qti-load-test-request listener found"),this.preContent=h`<span>qti-load-test-request was not catched</span>`)}}render(){return h`
3446
- ${this.preContent}
3447
- <slot></slot>
3448
- ${us(this.content,h`<span>Loading...</span>`)}
3449
- `}};l([w()],Mt.prototype,"content",2),l([p({type:String,attribute:"test-url"})],Mt.prototype,"testURL",2),Mt=l([g("test-container")],Mt);var wr=["this"],gs=["+","-","!"],fs=["=","+","-","*","/","%","^","==","!=",">","<",">=","<=","||","&&","??","&","===","!==","|","|>"],ui={"!":0,":":0,",":0,")":0,"]":0,"}":0,"|>":1,"?":2,"??":3,"||":4,"&&":5,"|":6,"^":7,"&":8,"!=":9,"==":9,"!==":9,"===":9,">=":10,">":10,"<=":10,"<":10,"+":11,"-":11,"%":12,"/":12,"*":12,"(":13,"[":13,".":13,"{":13},Er=13;var Eo=["==","!=","<=",">=","||","&&","??","|>"],Co=["===","!=="],E;(function(s){s[s.STRING=1]="STRING",s[s.IDENTIFIER=2]="IDENTIFIER",s[s.DOT=3]="DOT",s[s.COMMA=4]="COMMA",s[s.COLON=5]="COLON",s[s.INTEGER=6]="INTEGER",s[s.DECIMAL=7]="DECIMAL",s[s.OPERATOR=8]="OPERATOR",s[s.GROUPER=9]="GROUPER",s[s.KEYWORD=10]="KEYWORD",s[s.ARROW=11]="ARROW"})(E||(E={}));var rt=(s,e,t=0)=>({kind:s,value:e,precedence:t}),_o=s=>s===9||s===10||s===13||s===32,bs=s=>s===95||s===36||(s&=-33,65<=s&&s<=90),ko=s=>bs(s)||Pe(s),To=s=>wr.indexOf(s)!==-1,Ao=s=>s===34||s===39,Pe=s=>48<=s&&s<=57,So=s=>s===43||s===45||s===42||s===47||s===33||s===38||s===37||s===60||s===61||s===62||s===63||s===94||s===124,Ro=s=>s===40||s===41||s===91||s===93||s===123||s===125,Mo=s=>s.replace(/\\(.)/g,(e,t)=>{switch(t){case"n":return`
3450
- `;case"r":return"\r";case"t":return" ";case"b":return"\b";case"f":return"\f";default:return t}}),Cr=class{constructor(e){z(this,"_input");z(this,"_index",-1);z(this,"_tokenStart",0);z(this,"_next");this._input=e,this._advance()}nextToken(){for(;_o(this._next);)this._advance(!0);if(Ao(this._next))return this._tokenizeString();if(bs(this._next))return this._tokenizeIdentOrKeyword();if(Pe(this._next))return this._tokenizeNumber();if(this._next===46)return this._tokenizeDot();if(this._next===44)return this._tokenizeComma();if(this._next===58)return this._tokenizeColon();if(So(this._next))return this._tokenizeOperator();if(Ro(this._next))return this._tokenizeGrouper();if(this._advance(),this._next!==void 0)throw new Error(`Expected end of input, got ${this._next}`)}_advance(e){this._index++,this._index<this._input.length?(this._next=this._input.charCodeAt(this._index),e===!0&&(this._tokenStart=this._index)):this._next=void 0}_getValue(e=0){let t=this._input.substring(this._tokenStart,this._index+e);return e===0&&this._clearValue(),t}_clearValue(){this._tokenStart=this._index}_tokenizeString(){let e="unterminated string",t=this._next;for(this._advance(!0);this._next!==t;){if(this._next===void 0)throw new Error(e);if(this._next===92&&(this._advance(),this._next===void 0))throw new Error(e);this._advance()}let r=rt(E.STRING,Mo(this._getValue()));return this._advance(),r}_tokenizeIdentOrKeyword(){do this._advance();while(ko(this._next));let e=this._getValue(),t=To(e)?E.KEYWORD:E.IDENTIFIER;return rt(t,e)}_tokenizeNumber(){do this._advance();while(Pe(this._next));return this._next===46?this._tokenizeDot():rt(E.INTEGER,this._getValue())}_tokenizeDot(){return this._advance(),Pe(this._next)?this._tokenizeFraction():(this._clearValue(),rt(E.DOT,".",Er))}_tokenizeComma(){return this._advance(!0),rt(E.COMMA,",")}_tokenizeColon(){return this._advance(!0),rt(E.COLON,":")}_tokenizeFraction(){do this._advance();while(Pe(this._next));return rt(E.DECIMAL,this._getValue())}_tokenizeOperator(){this._advance();let e=this._getValue(2);if(Co.indexOf(e)!==-1)this._advance(),this._advance();else{if(e=this._getValue(1),e==="=>")return this._advance(),rt(E.ARROW,e);Eo.indexOf(e)!==-1&&this._advance()}return e=this._getValue(),rt(E.OPERATOR,e,ui[e])}_tokenizeGrouper(){let e=String.fromCharCode(this._next),t=rt(E.GROUPER,e,ui[e]);return this._advance(!0),t}};var mi=(s,e)=>new Oe(s,e).parse(),Oe=class{constructor(e,t){z(this,"_kind");z(this,"_tokenizer");z(this,"_ast");z(this,"_token");z(this,"_value");this._tokenizer=new Cr(e),this._ast=t}parse(){return this._advance(),this._parseExpression()}_advance(e,t){if(!this._matches(e,t))throw new Error(`Expected kind ${e} (${t}), was ${this._token?.kind} (${this._token?.value})`);let r=this._tokenizer.nextToken();this._token=r,this._kind=r?.kind,this._value=r?.value}_matches(e,t){return!(e&&this._kind!==e||t&&this._value!==t)}_parseExpression(){if(!this._token)return this._ast.empty();let e=this._parseUnary();return e===void 0?void 0:this._parsePrecedence(e,0)}_parsePrecedence(e,t){if(e===void 0)throw new Error("Expected left to be defined.");for(;this._token;)if(this._matches(E.GROUPER,"(")){let r=this._parseArguments();e=this._ast.invoke(e,void 0,r)}else if(this._matches(E.GROUPER,"[")){let r=this._parseIndex();e=this._ast.index(e,r)}else if(this._matches(E.DOT)){this._advance();let r=this._parseUnary();e=this._makeInvokeOrGetter(e,r)}else{if(this._matches(E.KEYWORD))break;if(this._matches(E.OPERATOR)&&this._token.precedence>=t)e=this._value==="?"?this._parseTernary(e):this._parseBinary(e,this._token);else break}return e}_makeInvokeOrGetter(e,t){if(t===void 0)throw new Error("expected identifier");if(t.type==="ID")return this._ast.getter(e,t.value);if(t.type==="Invoke"&&t.receiver.type==="ID"){let r=t.receiver;return this._ast.invoke(e,r.value,t.arguments)}else throw new Error(`expected identifier: ${t}`)}_parseBinary(e,t){if(fs.indexOf(t.value)===-1)throw new Error(`unknown operator: ${t.value}`);this._advance();let r=this._parseUnary();for(;(this._kind===E.OPERATOR||this._kind===E.DOT||this._kind===E.GROUPER)&&this._token.precedence>t.precedence;)r=this._parsePrecedence(r,this._token.precedence);return this._ast.binary(e,t.value,r)}_parseUnary(){if(this._matches(E.OPERATOR)){let e=this._value;if(this._advance(),e==="+"||e==="-"){if(this._matches(E.INTEGER))return this._parseInteger(e);if(this._matches(E.DECIMAL))return this._parseDecimal(e)}if(gs.indexOf(e)===-1)throw new Error(`unexpected token: ${e}`);let t=this._parsePrecedence(this._parsePrimary(),Er);return this._ast.unary(e,t)}return this._parsePrimary()}_parseTernary(e){this._advance(E.OPERATOR,"?");let t=this._parseExpression();this._advance(E.COLON);let r=this._parseExpression();return this._ast.ternary(e,t,r)}_parsePrimary(){switch(this._kind){case E.KEYWORD:let e=this._value;if(e==="this")return this._advance(),this._ast.id(e);throw wr.indexOf(e)!==-1?new Error(`unexpected keyword: ${e}`):new Error(`unrecognized keyword: ${e}`);case E.IDENTIFIER:return this._parseInvokeOrIdentifier();case E.STRING:return this._parseString();case E.INTEGER:return this._parseInteger();case E.DECIMAL:return this._parseDecimal();case E.GROUPER:return this._value==="("?this._parseParenOrFunction():this._value==="{"?this._parseMap():this._value==="["?this._parseList():void 0;case E.COLON:throw new Error('unexpected token ":"');default:return}}_parseList(){let e=[];do{if(this._advance(),this._matches(E.GROUPER,"]"))break;e.push(this._parseExpression())}while(this._matches(E.COMMA));return this._advance(E.GROUPER,"]"),this._ast.list(e)}_parseMap(){let e={};do{if(this._advance(),this._matches(E.GROUPER,"}"))break;let t=this._value;(this._matches(E.STRING)||this._matches(E.IDENTIFIER))&&this._advance(),this._advance(E.COLON),e[t]=this._parseExpression()}while(this._matches(E.COMMA));return this._advance(E.GROUPER,"}"),this._ast.map(e)}_parseInvokeOrIdentifier(){let e=this._value;if(e==="true")return this._advance(),this._ast.literal(!0);if(e==="false")return this._advance(),this._ast.literal(!1);if(e==="null")return this._advance(),this._ast.literal(null);if(e==="undefined")return this._advance(),this._ast.literal(void 0);let t=this._parseIdentifier(),r=this._parseArguments();return r?this._ast.invoke(t,void 0,r):t}_parseIdentifier(){if(!this._matches(E.IDENTIFIER))throw new Error(`expected identifier: ${this._value}`);let e=this._value;return this._advance(),this._ast.id(e)}_parseArguments(){if(!this._matches(E.GROUPER,"("))return;let e=[];do{if(this._advance(),this._matches(E.GROUPER,")"))break;let t=this._parseExpression();e.push(t)}while(this._matches(E.COMMA));return this._advance(E.GROUPER,")"),e}_parseIndex(){this._advance();let e=this._parseExpression();return this._advance(E.GROUPER,"]"),e}_parseParenOrFunction(){let e=this._parseArguments();if(this._matches(E.ARROW)){this._advance();let t=this._parseExpression(),r=e?.map(i=>i.value)??[];return this._ast.arrowFunction(r,t)}else return this._ast.paren(e[0])}_parseString(){let e=this._ast.literal(this._value);return this._advance(),e}_parseInteger(e=""){let t=this._ast.literal(parseInt(`${e}${this._value}`,10));return this._advance(),t}_parseDecimal(e=""){let t=this._ast.literal(parseFloat(`${e}${this._value}`));return this._advance(),t}};var Lo={"+":(s,e)=>s+e,"-":(s,e)=>s-e,"*":(s,e)=>s*e,"/":(s,e)=>s/e,"%":(s,e)=>s%e,"==":(s,e)=>s==e,"!=":(s,e)=>s!=e,"===":(s,e)=>s===e,"!==":(s,e)=>s!==e,">":(s,e)=>s>e,">=":(s,e)=>s>=e,"<":(s,e)=>s<e,"<=":(s,e)=>s<=e,"||":(s,e)=>s||e,"&&":(s,e)=>s&&e,"??":(s,e)=>s??e,"|":(s,e)=>e(s),"|>":(s,e)=>e(s)},$o={"+":s=>s,"-":s=>-s,"!":s=>!s},_r=class{empty(){return{type:"Empty",evaluate(e){return e},getIds(e){return e}}}literal(e){return{type:"Literal",value:e,evaluate(t){return this.value},getIds(t){return t}}}id(e){return{type:"ID",value:e,evaluate(t){return this.value==="this"?t:t?.[this.value]},getIds(t){return t.push(this.value),t}}}unary(e,t){let r=$o[e];return{type:"Unary",operator:e,child:t,evaluate(i){return r(this.child.evaluate(i))},getIds(i){return this.child.getIds(i)}}}binary(e,t,r){let i=Lo[t];return{type:"Binary",operator:t,left:e,right:r,evaluate(o){if(this.operator==="="){if(this.left.type!=="ID"&&this.left.type!=="Getter"&&this.left.type!=="Index")throw new Error(`Invalid assignment target: ${this.left}`);let n=this.right.evaluate(o),a,c;return this.left.type==="Getter"?(a=this.left.receiver.evaluate(o),c=this.left.name):this.left.type==="Index"?(a=this.left.receiver.evaluate(o),c=this.left.argument.evaluate(o)):this.left.type==="ID"&&(a=o,c=this.left.value),a===void 0?void 0:a[c]=n}return i(this.left.evaluate(o),this.right.evaluate(o))},getIds(o){return this.left.getIds(o),this.right.getIds(o),o}}}getter(e,t){return{type:"Getter",receiver:e,name:t,evaluate(r){return this.receiver.evaluate(r)?.[this.name]},getIds(r){return this.receiver.getIds(r),r}}}invoke(e,t,r){if(t!=null&&typeof t!="string")throw new Error("method not a string");return{type:"Invoke",receiver:e,method:t,arguments:r,evaluate(i){let o=this.receiver.evaluate(i),n=this.method?o:i?.this??i,a=this.method?o?.[t]:o,d=(this.arguments??[]).map(u=>u?.evaluate(i));return a?.apply?.(n,d)},getIds(i){return this.receiver.getIds(i),this.arguments?.forEach(o=>o?.getIds(i)),i}}}paren(e){return e}index(e,t){return{type:"Index",receiver:e,argument:t,evaluate(r){return this.receiver.evaluate(r)?.[this.argument.evaluate(r)]},getIds(r){return this.receiver.getIds(r),r}}}ternary(e,t,r){return{type:"Ternary",condition:e,trueExpr:t,falseExpr:r,evaluate(i){return this.condition.evaluate(i)?this.trueExpr.evaluate(i):this.falseExpr.evaluate(i)},getIds(i){return this.condition.getIds(i),this.trueExpr.getIds(i),this.falseExpr.getIds(i),i}}}map(e){return{type:"Map",entries:e,evaluate(t){let r={};if(e&&this.entries)for(let i in e){let o=this.entries[i];o&&(r[i]=o.evaluate(t))}return r},getIds(t){if(e&&this.entries)for(let r in e){let i=this.entries[r];i&&i.getIds(t)}return t}}}list(e){return{type:"List",items:e,evaluate(t){return this.items?.map(r=>r?.evaluate(t))},getIds(t){return this.items?.forEach(r=>r?.getIds(t)),t}}}arrowFunction(e,t){return{type:"ArrowFunction",params:e,body:t,evaluate(r){let i=this.params,o=this.body;return function(...n){let a=Object.fromEntries(i.map((d,u)=>[d,n[u]])),c=new Proxy(r??{},{set(d,u,m){return a.hasOwnProperty(u)&&(a[u]=m),d[u]=m},get(d,u){return a.hasOwnProperty(u)?a[u]:d[u]}});return o.evaluate(c)}},getIds(r){return this.body.getIds(r).filter(i=>!this.params.includes(i))}}}};var gi=null,vs={boundAttributeSuffix:M.M,marker:M.P,markerMatch:M.A,HTML_RESULT:M.C,getTemplateHtml:M.L,overrideDirectiveResolve:(s,e)=>class extends s{_$AS(t,r){return e(this,r)}},patchDirectiveResolve:(s,e)=>{if(s.prototype._$AS!==e){gi??(gi=s.prototype._$AS.name);for(let t=s.prototype;t!==Object.prototype;t=Object.getPrototypeOf(t))if(t.hasOwnProperty(gi))return void(t[gi]=e);throw Error("Internal error: It is possible that both dev mode and production mode Lit was mixed together during SSR. Please comment on the issue: https://github.com/lit/lit/issues/4527")}},setDirectiveClass(s,e){s._$litDirective$=e},getAttributePartCommittedValue:(s,e,t)=>{let r=R;return s.j=i=>r=i,s._$AI(e,s,t),r},connectedDisconnectable:s=>({...s,_$AU:!0}),resolveDirective:M.V,AttributePart:M.H,PropertyPart:M.B,BooleanAttributePart:M.N,EventPart:M.U,ElementPart:M.F,TemplateInstance:M.R,isIterable:M.D,ChildPart:M.I};var{AttributePart:Do,PropertyPart:Io,BooleanAttributePart:No,EventPart:Po}=vs,bi=new _r,fi=new Map,ys=s=>s.replace(/-(-|\w)/g,(e,t)=>t.toUpperCase()),kr=(s,e)=>{let t=fi.get(s);if(t===void 0){if(fi.has(s))return;if(s=s.trim(),s.startsWith("{{")&&s.endsWith("}}")){let r=s.substring(2,s.length-2).trim();t=new Oe(r,bi).parse(),fi.set(s,t)}}return t?.evaluate(e)},Oo=(s,e,t,r)=>{let i=s.getAttribute("if");if(i!==null&&kr(i,e))return Tr(s,e,t,r)},xs=/(?<!\\){{(.*?)(?:(?<!\\)}})/g,qs=s=>/(?:\\{{)|(?:\\}})/g.test(s),He=s=>s.replaceAll(/\\{{/g,"{{").replace(/\\}}/g,"}}"),Ho=(s,e,t,r)=>{let i=s.getAttribute("repeat");if(i!==null){let o=kr(i,e);if(!o[Symbol.iterator])return k;let n=Ve(s),a=-1,c=[];for(let d of o){a++;let u=Object.create(e);u.item=d,u.index=a,u.this=e.this??e;let m=[];for(let y of n.parts){let x=y.update(u,t,r);y.type===1?m.push(...x):m.push(x)}let f={_$litType$:n,values:m};c.push(f)}return c}},Es={if:Oo,repeat:Ho},Cs=(s,e=Es,t={},r)=>{let o=Ve(s).renderers;if(r){let a=Ve(r).renderers,c=o.super;c!==void 0?t={...o,...t,super:(d,u,m)=>(m={...a,...m,super:(f,y,x)=>Tr(r,f,y,x)},c(d,u,m))}:(t={...a,...o,...t},s=r)}else t={...o,...t};return n=>Tr(s,n,e,t)};var Tr=(s,e,t=Es,r={})=>{let i=Ve(s),o=[];for(let a of i.parts){let c=a.update(e,t,r);a.type===1?o.push(...c):o.push(c)}return{_$litType$:i,values:o}},ws=new Map,Ve=s=>{let e=ws.get(s);return e===void 0&&ws.set(s,e=Vo(s)),e},Vo=s=>{let e={h:void 0,el:s.cloneNode(!0),parts:[],renderers:{}},t=document.createTreeWalker(e.el.content,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),r=t.currentNode,i=-1,o=[];for(;(r=t.nextNode())!==null;)if(r.nodeType===Node.ELEMENT_NODE){i++;let n=r;if(n.tagName==="TEMPLATE"){let c=n.getAttribute("type"),d=n.getAttribute("name"),u=n.getAttribute("call");if(u!==null||c!==null||d!==null){n.parentNode.insertBefore(document.createComment(""),n),o.push(n);let m;if(u!==null){let f=u.trim(),y=f.startsWith("{{")&&f.endsWith("}}");m=(x,q,A)=>{let N=n.getAttribute("data"),Ce=N===null?void 0:kr(N,x);return(y?kr(f,x):A[u])?.(Ce,q,A)}}else c!==null?m=(f,y,x)=>{let q=y[c];return q?.(n,f,y,x)}:(d==="super"?e.renderers.super=(f,y,x)=>{let q=x.super,A=Ve(n);return x={...x,...A.renderers},q(f,y,x)}:e.renderers[d]=(f,y,x)=>Tr(n,f,y,x),m=(f,y,x)=>{let q=x[d];return q?.(f,y,x)});e.parts.push({type:2,index:i,update:m});continue}}let a=n.getAttributeNames();for(let c of a){let d=n.getAttribute(c),u=d.split(xs);if(u.length===1){qs(d)&&n.setAttribute(c,He(d));continue}n.removeAttribute(c);let m=c,f=Do,y=c[0];y==="."?(m=ys(c.substring(1)),f=Io):y==="?"?(m=c.substring(1),f=No):y==="@"&&(m=ys(c.substring(1)),f=Po);let x=[He(u[0])],q=[];for(let A=1;A<u.length;A+=2){let N=u[A];q.push(mi(N,bi)),x.push(He(u[A+1]))}e.parts.push({type:1,index:i,name:m,strings:x,ctor:f,update:(A,N,Ce)=>q.map(ut=>ut.evaluate(A))})}}else if(r.nodeType===Node.TEXT_NODE){let n=r,a=n.textContent,c=a.split(xs);c.length>1?n.textContent=He(c[0]):qs(a)&&(n.textContent=He(a));for(let d=1;d<c.length;d+=2){let u=c[d],m=mi(u,bi);e.parts.push({type:2,index:++i,update:(y,x)=>m.evaluate(y)});let f=new Text(c[d+1].replace("\\{{","{{"));n.parentNode.insertBefore(f,n.nextSibling),n.parentNode.insertBefore(document.createComment(""),n.nextSibling),n=f,t.currentNode=f}}for(let n of o)n.remove();return e};var Lt=class extends L{constructor(){super();this.maxDisplayedItems=2;this.skipOnCategory="dep-informational";this._internals.ariaLabel="pagination"}createRenderRoot(){return this}render(){let t=this._testContext.items.reduce((a,c)=>{let u=c.category?.split(" ").includes(this.skipOnCategory)?"i":a.counter++;return a.result.push({...c,newIndex:u}),a},{counter:0,result:[]}).result,r=t.findIndex(a=>a.identifier===this._testContext.navItemId),i=Math.max(0,r-this.maxDisplayedItems),o=Math.min(t.length,r+this.maxDisplayedItems+1),n=t.slice(i,o);return h`
3451
- ${n.map(a=>{let c=a.variables.find(ut=>ut.identifier=="SCORE"),d=parseInt(c?.value?.toString()),u=a.variables.find(ut=>ut.identifier==="completionStatus")?.value,m=a.category!==this.skipOnCategory?"regular":"info",f=this._testContext.navItemId===a.identifier,y=this._testContext.view==="scorer"&&m=="regular"&&d!==void 0&&!isNaN(d)&&d>0,x=this._testContext.view==="scorer"&&m=="regular"&&d!==void 0&&!isNaN(d)&&d<=0,q=this._testContext.view==="candidate"&&u==="completed"&&a.category!==this.skipOnCategory,A={...a,type:m,active:f,correct:y,incorrect:x,answered:q},N=this.firstElementChild;return Cs(N)({item:A})})}
3452
- `}};l([p({type:Number,attribute:"max-displayed-items"})],Lt.prototype,"maxDisplayedItems",2),l([p({type:String,attribute:"skip-on-category"})],Lt.prototype,"skipOnCategory",2),Lt=l([g("test-paging-buttons-stamp")],Lt);var vi=[{identifier:"completionStatus",cardinality:"single",baseType:"string",value:"unknown",type:"outcome"},{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:"0",type:"response"}],$=Symbol("item");var D=class extends v{constructor(){super();this.identifier="";this.adaptive="false";this.timeDependent=null;this._handleDisabledChange=(t,r)=>{this._interactionElements.forEach(i=>i.disabled=r)};this._handleReadonlyChange=(t,r)=>this._interactionElements.forEach(i=>i.readonly=r);this._context={identifier:this.getAttribute("identifier"),variables:vi};this._initialContext={...this._context,variables:this._context.variables};this._feedbackElements=[];this._interactionElements=[];this.addEventListener("qti-register-variable",t=>{this._context={...this._context,variables:[...this._context.variables,t.detail.variable]},this._initialContext=this._context,t.stopPropagation()}),this.addEventListener("qti-register-feedback",t=>{t.stopPropagation();let r=t.detail;this._feedbackElements.push(r),r.checkShowFeedback(r.outcomeIdentifier)}),this.addEventListener("qti-register-interaction",t=>{t.stopPropagation(),this._interactionElements.push(t.target)}),this.addEventListener("end-attempt",t=>{let{responseIdentifier:r,countAttempt:i}=t.detail;this.validate(),this.updateResponseVariable(r,"true"),this.processResponse(i)}),this.addEventListener("qti-set-outcome-value",t=>{let{outcomeIdentifier:r,value:i}=t.detail;this.updateOutcomeVariable(r,i),t.stopPropagation()}),this.addEventListener("qti-interaction-response",this.handleUpdateResponseVariable)}get variables(){return this._context.variables.map(t=>({identifier:t.identifier,value:t.value,type:t.type,...t.type==="outcome"&&t.identifier==="SCORE"?{externalScored:t.externalScored}:{}}))}set variables(t){if(!Array.isArray(t)||t.some(r=>!("identifier"in r))){console.warn("variables property should be an array of VariableDeclaration");return}this._context={...this._context,variables:this._context.variables.map(r=>{let i=t.find(o=>o.identifier===r.identifier);return i?{...r,...i}:r})},this._context.variables.forEach(r=>{if(r.type==="response"){let i=this._interactionElements.find(o=>o.responseIdentifier===r.identifier);i&&(i.value=r.value)}r.type==="outcome"&&this._feedbackElements.forEach(i=>i.checkShowFeedback(r.identifier))})}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this._emit("qti-assessment-item-connected",this)}set responses(t){if(t)for(let r of t){this.getResponse(r.responseIdentifier)&&this.updateResponseVariable(r.responseIdentifier,r.response);let o=this._interactionElements.find(n=>n.getAttribute("response-identifier")===r.responseIdentifier);o&&(o.value=r.response)}}render(){return h`<slot></slot>`}showCorrectResponse(t){let i=this._context.variables.filter(o=>"correctResponse"in o&&o.correctResponse).map(o=>({responseIdentifier:o.identifier,response:o.correctResponse}));for(let o of i){let n=this._interactionElements.find(a=>a.getAttribute("response-identifier")===o.responseIdentifier);n&&(n.correctResponse=t?o.response:"")}}processResponse(t=!0){this.validate();let r=this.querySelector("qti-response-processing");return!r||!r.process?!1:(r.process(),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus()),t&&this.updateOutcomeVariable("numAttempts",(+this._context.variables.find(i=>i.identifier==="numAttempts")?.value+1).toString()),this._emit("qti-response-processed"),!0)}resetResponses(){this._context=this._initialContext}getResponse(t){return this.getVariable(t)}getOutcome(t){return this.getVariable(t)}getVariable(t){return this._context.variables.find(r=>r.identifier===t)||null}handleUpdateResponseVariable(t){let{responseIdentifier:r,response:i}=t.detail;this.updateResponseVariable(r,i)}updateResponseVariable(t,r){this._context={...this._context,variables:this._context.variables.map(i=>i.identifier!==t?i:{...i,value:r})},this._emit("qti-interaction-changed",{item:this.identifier,responseIdentifier:t,response:Array.isArray(r)?[...r]:r}),this.adaptive==="false"&&this.updateOutcomeVariable("completionStatus",this._getCompletionStatus())}updateOutcomeVariable(t,r){let i=this.getOutcome(t);if(!i){console.warn(`Can not set qti-outcome-identifier: ${t}, it is not available`);return}this._context={...this._context,variables:this._context.variables.map(o=>o.identifier!==t?o:{...o,value:i.cardinality==="single"?r:[...o.value,r]})},this._feedbackElements.forEach(o=>o.checkShowFeedback(t)),this._emit("qti-outcome-changed",{item:this.identifier,outcomeIdentifier:t,value:this._context.variables.find(o=>o.identifier===t)?.value})}validate(){return this._interactionElements.every(t=>t.validate())?!0:this._interactionElements.some(t=>t.validate())?!1:null}_getCompletionStatus(){let t=this.validate();return t===!0?"completed":t===!1?"incomplete":"not_attempted"}_emit(t,r=null){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:r}))}};l([p({type:String})],D.prototype,"title",2),l([p({type:String})],D.prototype,"identifier",2),l([p({type:String})],D.prototype,"adaptive",2),l([p({type:String})],D.prototype,"timeDependent",2),l([p({type:Boolean})],D.prototype,"disabled",2),l([S("disabled",{waitUntilFirstUpdate:!0})],D.prototype,"_handleDisabledChange",2),l([p({type:Boolean})],D.prototype,"readonly",2),l([S("readonly",{waitUntilFirstUpdate:!0})],D.prototype,"_handleReadonlyChange",2),l([jt({context:$})],D.prototype,"_context",2),D=l([g("qti-assessment-item")],D);var $t=class extends v{constructor(){super(...arguments);this.identifier="";this.href=""}async connectedCallback(){super.connectedCallback();let t=new Event("qti-assessment-stimulus-ref-connected",{cancelable:!0,bubbles:!0});if(this.dispatchEvent(t)){let o=this.closest("qti-assessment-item").querySelector(`[data-stimulus-idref=${this.identifier}]`);o?await this.updateStimulusRef(o):console.warn(`Stimulus with data-stimulus-idref ${this.identifier} not found`)}}async updateStimulusRef(t){let r=await Rt().load(this.href).then(i=>i.htmlDoc());if(r){let i=r.querySelectorAll("qti-stimulus-body, qti-stylesheet");t.innerHTML="",t.append(...i)}}};l([p({type:String})],$t.prototype,"identifier",2),l([p({type:String})],$t.prototype,"href",2),$t=l([g("qti-assessment-stimulus-ref")],$t);var _s={toAttribute:s=>s?"true":"false",fromAttribute:s=>s==="true"};function Y(s,e){class t extends s{constructor(...o){super(...o);this.identifier="";this.tabIndex=0;this.disabled=!1;this.readonly=!1;this.internals=this.attachInternals()}handleDisabledChange(o,n){this.tabIndex=n?-1:0,n&&this.blur()}connectedCallback(){super.connectedCallback(),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent(`register-${e}`,{bubbles:!0,composed:!0}))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent(`unregister-${e}`,{bubbles:!0,composed:!0}))}_onKeyUp(o){o.altKey||o.code==="Space"&&(o.preventDefault(),this._activate())}_onClick(){this.disabled||this.readonly||(this.focus(),this._activate())}_activate(){this.disabled||this.readonly||this.dispatchEvent(new CustomEvent(`activate-${e}`,{bubbles:!0,composed:!0,detail:{identifier:this.identifier}}))}render(){return h`<slot></slot>`}}return l([p({type:String})],t.prototype,"identifier",2),l([p({type:Number,reflect:!0,attribute:"tabindex"})],t.prototype,"tabIndex",2),l([p({type:Boolean,reflect:!0,attribute:"aria-disabled",converter:_s})],t.prototype,"disabled",2),l([p({type:Boolean,reflect:!0,attribute:"aria-readonly",converter:_s})],t.prototype,"readonly",2),l([S("disabled",{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),t}var ks=b`
3453
- :host {
3454
- display: block;
3455
- }
3456
- `;var oe=class extends v{render(){return h`<slot name="qti-rubric-block"></slot><slot></slot>`}};oe.styles=ks,oe=l([g("qti-item-body")],oe);var ze=class extends v{render(){return h`<slot></slot>`}connectedCallback(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}};ze=l([g("qti-prompt")],ze);var Ue=class extends v{constructor(){super(...arguments);this.styleElement=null}firstUpdated(t){super.firstUpdated(t);let r=this.getAttribute("href");if(r!==null&&fetch(r).then(i=>i.text()).then(i=>{let o=this.minifyCss(i);this.styleElement=document.createElement("style"),this.styleElement.media="screen",this.styleElement.textContent=`@scope {${o}}`,this.parentElement?this.parentElement.appendChild(this.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}).catch(i=>{console.error("Failed to load stylesheet:",i)}),this.textContent!==null&&this.textContent.trim()!==""){let i=this.minifyCss(this.textContent);this.styleElement=document.createElement("style"),this.styleElement.media="screen",this.styleElement.textContent=`@scope {${i}}`,this.parentElement?this.parentElement.appendChild(this.styleElement):console.warn("No parent element to append the scoped stylesheet to.")}}minifyCss(t){return t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;])\s*/g,"$1").trim()}disconnectedCallback(){if(this.styleElement)try{this.styleElement.remove()}catch(t){console.error("Could not remove stylesheet:",t)}super.disconnectedCallback()}};Ue=l([g("qti-stylesheet")],Ue);var yt=class extends v{render(){return h`<slot></slot>`}defaultValues(e){let t=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(t.length===0)return null;let r=t.map(i=>i.innerHTML.trim());return r.length>1||e.cardinality==="multiple"||e.cardinality==="ordered"?r:r[0]}};yt=l([g("qti-variabledeclaration")],yt);var G=class extends yt{constructor(){super(...arguments);this.externalScored=null}render(){let t=this.itemContext?.variables.find(r=>r.identifier===this.identifier)?.value;return h`${JSON.stringify(t,null,2)}`}get interpolationTable(){let t=this.querySelector("qti-interpolation-table");if(t){let r=new Map;for(let i of t.querySelectorAll("qti-interpolation-table-entry")){!i.getAttribute("source-value")&&i.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");let o=parseInt(i.getAttribute("source-value")),n=parseInt(i.getAttribute("target-value"));(isNaN(o)||isNaN(n))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),r.set(o,n)}return r}return null}connectedCallback(){super.connectedCallback();let t={identifier:this.identifier,cardinality:this.cardinality,baseType:this.baseType,type:"outcome",value:null,interpolationTable:this.interpolationTable,externalScored:this.externalScored};t.value=this.defaultValues(t),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:t}}))}};G.styles=[b`
3457
- :host {
3458
- display: none;
3459
- }
3460
- `],l([p({type:String,attribute:"base-type"})],G.prototype,"baseType",2),l([p({type:String,attribute:"external-scored"})],G.prototype,"externalScored",2),l([p({type:String})],G.prototype,"identifier",2),l([p({type:String})],G.prototype,"cardinality",2),l([T({context:$,subscribe:!0}),w()],G.prototype,"itemContext",2),G=l([g("qti-outcome-declaration")],G);var it=class extends yt{render(){let e=this.itemContext?.variables.find(t=>t.identifier===this.identifier)?.value;return h`${JSON.stringify(e,null,2)}`}connectedCallback(){super.connectedCallback();let e={baseType:this.baseType,identifier:this.identifier,correctResponse:this.correctResponse,cardinality:this.cardinality||"single",mapping:this.mapping,value:null,type:"response",candidateResponse:null};e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}get correctResponse(){let e,t=this.querySelector("qti-correct-response");if(t){let r=t.querySelectorAll("qti-value");if(this.cardinality==="single"&&r.length>0)e=r[0].textContent,r[0].remove();else if(this.cardinality!=="single"){e=[];for(let i=0;i<r.length;i++)e.push(r[i].textContent),r[i].remove()}}return e}get mapping(){return this.querySelector("qti-mapping")}};it.styles=[b`
3461
- :host {
3462
- display: none;
3463
- }
3464
- `],l([p({type:String,attribute:"base-type"})],it.prototype,"baseType",2),l([p({type:String})],it.prototype,"identifier",2),l([p({type:String})],it.prototype,"cardinality",2),l([T({context:$,subscribe:!0}),w()],it.prototype,"itemContext",2),it=l([g("qti-response-declaration")],it);var Fe=class extends v{};Fe=l([g("qti-companion-materials-info")],Fe);var Be=class extends v{render(){return h`<slot></slot>`}};Be=l([g("qti-content-body")],Be);var K=class extends v{handleclassNamesChange(){this.classNames.split(" ").forEach(t=>{switch(t){case"qti-rubric-discretionary-placement":this.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":this.setAttribute("slot","");break;default:break}})}render(){return h`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-rubric-block")}};K.styles=b`
3465
- :host {
3466
- display: block;
3467
- }
3468
- `,l([p({type:String})],K.prototype,"id",2),l([p({type:String})],K.prototype,"use",2),l([p({type:String})],K.prototype,"view",2),l([p({type:String,attribute:"class"})],K.prototype,"classNames",2),l([S("classNames",{waitUntilFirstUpdate:!0})],K.prototype,"handleclassNamesChange",1),K=l([g("qti-rubric-block")],K);var zo=()=>new Intl.NumberFormat().format(.1).replace(/\d/g,""),je=s=>{if(typeof s=="string")return s;let e=zo();return e==="."?s.toLocaleString():s.toString().replace(".","").replace(e,".")};function yi(s){return s==null}function We(s){return s.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}var P=class extends v{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}checkShowFeedback(e){let t=this._context.variables.find(i=>i.identifier===e)||null;if(this.outcomeIdentifier!==e||!t)return;let r=!1;Array.isArray(t.value)?r=t.value.includes(this.identifier):r=!yi(this.identifier)&&!yi(t?.value)&&this.identifier===t.value||!1,this.showFeedback(r)}showFeedback(e){this.showStatus=e&&this.showHide==="show"||!e&&this.showHide==="hide"?"on":"off"}};l([p({type:String,attribute:"show-hide"})],P.prototype,"showHide",2),l([p({type:String,attribute:"outcome-identifier"})],P.prototype,"outcomeIdentifier",2),l([p({type:String})],P.prototype,"identifier",2),l([p({type:String,attribute:!1})],P.prototype,"showStatus",2),l([T({context:$,subscribe:!0}),w()],P.prototype,"_context",2);var ne=class extends P{render(){return h` <slot part="feedback" class="feedback ${this.showStatus}"></slot> `}firstUpdated(e){this.checkShowFeedback(this.outcomeIdentifier)}};ne.styles=b`
3469
- :host {
3470
- display: block;
3471
- }
3472
- .on {
3473
- display: block;
3474
- }
3475
- .off {
3476
- display: none;
3477
- }
3478
- `,ne=l([g("qti-feedback-block")],ne);var ae=class extends P{constructor(){super(...arguments);this.render=()=>h` <slot part="feedback" class="${this.showStatus}"></slot> `}};ae.styles=b`
3479
- .on {
3480
- display: inline-block;
3481
- }
3482
- .off {
3483
- display: none;
3484
- }
3485
- `,ae=l([g("qti-feedback-inline")],ae);var le=class extends P{constructor(){super(...arguments);this.render=()=>h` <slot part="feedback" class="${this.showStatus}"></slot> `}};le.styles=b`
3486
- .on {
3487
- display: inline-block;
3488
- }
3489
- .off {
3490
- display: none;
3491
- }
3492
- `,le=l([g("qti-modal-feedback")],le);var xt=s=>s??k;var C=class extends v{constructor(){super();this.disabled=!1;this.readonly=!1;this._internals=this.attachInternals()}reportValidity(){return this._internals.reportValidity()}reset(){this.value=""}get correctResponse(){return this._correctResponse}set correctResponse(t){this._correctResponse=t}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,cancelable:!1}))}saveResponse(t){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,cancelable:!1,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(t)?[...t]:t}}))}};C.formAssociated=!0,l([p({type:String,attribute:"response-identifier"})],C.prototype,"responseIdentifier",2),l([p({reflect:!0,type:Boolean})],C.prototype,"disabled",2),l([p({reflect:!0,type:Boolean})],C.prototype,"readonly",2),l([w()],C.prototype,"_correctResponse",2);var O=class extends C{constructor(){super(...arguments);this._rows=5;this._value=""}handleclassNamesChange(t,r){let i=r.split(" "),o=!1;if(i.forEach(n=>{if(n.startsWith("qti-height-lines-")){let a=n.replace("qti-height-lines-","");this._rows=parseInt(a),o=!0}}),!o&&this.expectedLength){let n=Math.ceil(this.expectedLength/50);this._rows=n}}get value(){return this._value}set value(t){if(typeof t=="string"){this._value=t;let r=new FormData;r.append(this.responseIdentifier,t),this._internals.setFormValue(r),this.validate()}else throw new Error("Value must be a string")}validate(){let t=this.shadowRoot.querySelector("textarea");if(!t)return!1;if(this.patternMask&&this.dataPatternmaskMessage){this._internals.setValidity({}),t.setCustomValidity("");let r=this.patternMask.startsWith("^")&&this.patternMask.endsWith("$")?this.patternMask:`^${this.patternMask}$`,i=new RegExp(r);t.checkValidity()&&i.test(t.value)||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),t.setCustomValidity(this.dataPatternmaskMessage))}else{let r=t.checkValidity();this._internals.setValidity(r?{}:{customError:!1})}return this._value!==""&&t.checkValidity()}reportValidity(){let t=this.shadowRoot.querySelector("textarea");if(!t)return!1;let r=this.validate();return r||t.reportValidity(),r}static get styles(){return[b`
3493
- /* PK: display host as block, else design will be collapsed */
3494
- :host {
3495
- display: block;
3496
- }
3497
- textarea {
3498
- box-sizing: border-box;
3499
- width: 100%;
3500
- height: 100%;
3501
- border: 0;
3502
- }
3503
- `]}render(){return h`<slot name="prompt"></slot
3504
- ><textarea
3505
- part="textarea"
3506
- name="${this.responseIdentifier}"
3507
- spellcheck="false"
3508
- autocomplete="off"
3509
- maxlength="${5e3}"
3510
- @keydown="${t=>t.stopImmediatePropagation()}"
3511
- @keyup="${this.textChanged}"
3512
- @change="${this.textChanged}"
3513
- @blur="${t=>{this.reportValidity()}}"
3514
- placeholder="${xt(this.placeholderText?this.placeholderText:void 0)}"
3515
- rows="${this._rows}"
3516
- ?disabled="${this.disabled}"
3517
- ?readonly="${this.readonly}"
3518
- .value=${this._value}
3519
- ></textarea>`}textChanged(t){if(this.disabled||this.readonly)return;let r=t.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this.value=r.value,this.saveResponse(r.value))}setEmptyAttribute(t){this.setAttribute("empty",t===""?"true":"false")}};l([w()],O.prototype,"_rows",2),l([p({type:Number,attribute:"expected-length"})],O.prototype,"expectedLength",2),l([p({type:String,attribute:"pattern-mask"})],O.prototype,"patternMask",2),l([p({type:String,attribute:"placeholder-text"})],O.prototype,"placeholderText",2),l([p({type:String,attribute:"data-patternmask-message"})],O.prototype,"dataPatternmaskMessage",2),l([w()],O.prototype,"_value",2),l([p({type:String,attribute:"class"})],O.prototype,"classNames",2),l([S("classNames")],O.prototype,"handleclassNamesChange",1),O=l([g("qti-extended-text-interaction")],O);var Ts=()=>new qi,qi=class{},xi=new WeakMap,Dh=X(class extends se{render(s){return k}update(s,[e]){let t=e!==this.Y;return t&&this.Y!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.Y=e,this.ht=s.options?.host,this.rt(this.ct=s.element)),k}rt(s){if(this.isConnected||(s=void 0),typeof this.Y=="function"){let e=this.ht??globalThis,t=xi.get(e);t===void 0&&(t=new WeakMap,xi.set(e,t)),t.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),t.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){return typeof this.Y=="function"?xi.get(this.ht??globalThis)?.get(this.Y):this.Y?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var As=b`
3520
- :host {
3521
- display: inline-block;
3522
- }
3523
- [part='correct'] {
3524
- position: absolute;
3525
- width: 100%;
3526
- }
3527
- :host(.qti-input-width-1) [part='input'] {
3528
- width: 1.1rem;
3529
- min-width: 1.1rem;
3530
- }
3531
-
3532
- :host(.qti-input-width-2) [part='input'] {
3533
- width: 2.3rem;
3534
- min-width: 2.3rem;
3535
- }
3536
-
3537
- :host(.qti-input-width-3) [part='input'] {
3538
- width: 3.3rem;
3539
- min-width: 3.3rem;
3540
- }
3541
-
3542
- :host(.qti-input-width-4) [part='input'] {
3543
- width: 4.2rem;
3544
- min-width: 4.2rem;
3545
- }
3546
-
3547
- :host(.qti-input-width-6) [part='input'] {
3548
- width: 6.6rem;
3549
- min-width: 6.6rem;
3550
- }
3551
-
3552
- :host(.qti-input-width-10) [part='input'] {
3553
- width: 8rem;
3554
- min-width: 8rem;
3555
- }
3556
-
3557
- :host(.qti-input-width-15) [part='input'] {
3558
- width: 12rem;
3559
- min-width: 12rem;
3560
- }
3561
-
3562
- :host(.qti-input-width-20) [part='input'] {
3563
- width: 17rem;
3564
- min-width: 17rem;
3565
- }
3566
-
3567
- :host(.qti-input-width-25) [part='input'] {
3568
- width: 20rem;
3569
- min-width: 20rem;
3570
- }
3571
-
3572
- :host(.qti-input-width-30) [part='input'] {
3573
- width: 24rem;
3574
- min-width: 24rem;
3575
- }
3576
-
3577
- :host(.qti-input-width-35) [part='input'] {
3578
- width: 28rem;
3579
- min-width: 28rem;
3580
- }
3581
-
3582
- :host(.qti-input-width-40) [part='input'] {
3583
- width: 32rem;
3584
- min-width: 32rem;
3585
- }
3586
-
3587
- :host(.qti-input-width-45) [part='input'] {
3588
- width: 36rem;
3589
- min-width: 36rem;
3590
- }
3591
-
3592
- :host(.qti-input-width-50) [part='input'] {
3593
- width: 40rem;
3594
- min-width: 40rem;
3595
- }
3596
-
3597
- :host(.qti-input-width-72) [part='input'] {
3598
- width: 57rem;
3599
- min-width: 57rem;
3600
- }
3601
- `;var Z=class extends C{constructor(){super(...arguments);this._value="";this.inputRef=Ts()}get value(){return this._value}set value(t){if(typeof t=="string"){this._value=t;let r=new FormData;r.append(this.responseIdentifier,t),this._internals.setFormValue(r),this.validate()}else throw new Error("Value must be a string")}validate(){let t=this.shadowRoot.querySelector("input");if(!t)return!1;if(this.patternMask&&this.dataPatternmaskMessage)this._internals.setValidity({}),t.setCustomValidity(""),t.checkValidity()||(this._internals.setValidity({customError:!0},this.dataPatternmaskMessage),t.setCustomValidity(this.dataPatternmaskMessage));else{let r=t.checkValidity();this._internals.setValidity(r?{}:{customError:!1})}return this._value!==""&&t.checkValidity()}render(){return h`
3602
- <input
3603
- part="input"
3604
- name="${this.responseIdentifier}"
3605
- spellcheck="false"
3606
- autocomplete="off"
3607
- @blur="${t=>{this.reportValidity()}}"
3608
- @keydown="${t=>t.stopImmediatePropagation()}"
3609
- @keyup="${this.textChanged}"
3610
- @change="${this.textChanged}"
3611
- type="${this.patternMask=="[0-9]*"?"number":"text"}"
3612
- placeholder="${xt(this.placeholderText?this.placeholderText:void 0)}"
3613
- .value="${this._value}"
3614
- pattern="${xt(this.patternMask?this.patternMask:void 0)}"
3615
- maxlength=${1e3}
3616
- ?disabled="${this.disabled}"
3617
- ?readonly="${this.readonly}"
3618
- />
3619
- <div part="correct">${this._correctResponse}</div>
3620
- `}textChanged(t){if(this.disabled||this.readonly)return;let r=t.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this.value=r.value,this.saveResponse(r.value))}reportValidity(){let t=this.shadowRoot.querySelector("input");if(!t)return!1;let r=this.validate();return r||t.reportValidity(),r}reset(){this._value=""}setEmptyAttribute(t){this.setAttribute("empty",t===""?"true":"false")}};Z.styles=As,l([p({type:Number,attribute:"expected-length"})],Z.prototype,"expectedLength",2),l([p({type:String,attribute:"pattern-mask"})],Z.prototype,"patternMask",2),l([p({type:String,attribute:"placeholder-text"})],Z.prototype,"placeholderText",2),l([p({type:String,attribute:"data-patternmask-message"})],Z.prototype,"dataPatternmaskMessage",2),l([w()],Z.prototype,"_value",2),Z=l([g("qti-text-entry-interaction")],Z);var qt=(s,e)=>{class t extends s{constructor(){super(...arguments);this._choiceElements=[];this.minChoices=0;this.maxChoices=1;this._handleDisabledChange=(o,n)=>{this._choiceElements.forEach(a=>a.disabled=n)};this._handleReadonlyChange=(o,n)=>{this._choiceElements.forEach(a=>a.readonly=n)};this._value=""}_handleMaxChoicesChange(o,n){this._determineInputType()}get value(){return Array.isArray(this._value)?this._value.join(","):this._value}set value(o){if(this.maxChoices>1&&typeof o=="string"?this._value=o.split(","):this._value=o,Array.isArray(this._value)){let n=new FormData;this._value.forEach(a=>{n.append(this.responseIdentifier,a)}),this._internals.setFormValue(n)}else this._internals.setFormValue(this._value);this._updateChoiceSelection()}get correctResponse(){return this._correctResponse}set correctResponse(o){this._correctResponse=o;let n=Array.isArray(o)?o:[o];this._choiceElements.forEach(a=>{a.internals.states.delete("correct-response"),a.internals.states.delete("incorrect-response"),n.length>0&&(n.includes(a.identifier)?a.internals.states.add("correct-response"):a.internals.states.add("incorrect-response"))})}connectedCallback(){super.connectedCallback(),this.addEventListener(`register-${e}`,this._registerChoiceElement),this.addEventListener(`unregister-${e}`,this._unregisterChoiceElement),this.addEventListener(`activate-${e}`,this._choiceElementSelectedHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`register-${e}`,this._registerChoiceElement),this.removeEventListener(`unregister-${e}`,this._unregisterChoiceElement),this.removeEventListener(`activate-${e}`,this._choiceElementSelectedHandler)}validate(){let o=this._choiceElements.filter(d=>this._getChoiceChecked(d)),n=o.length,a=!0,c="";return this.maxChoices!==0&&n>this.maxChoices?(a=!1,c=this.dataset.maxSelectionsMessage||`You can select at most ${this.maxChoices} choices.`):n<this.minChoices&&(a=!1,c=this.dataset.minSelectionsMessage||`You must select at least ${this.minChoices} choices.`),o.length>0&&this._internals.setValidity(a?{}:{customError:!0},c,o[n-1]||this._choiceElements[0]||this),this.reportValidity(),a}reportValidity(){return this._validationMessageElement&&(this._internals.validity.valid?(this._validationMessageElement.textContent="",this._validationMessageElement.style.display="none"):(this._validationMessageElement.textContent=this._internals.validationMessage,this._validationMessageElement.style.display="block")),this._internals.validity.valid}_registerChoiceElement(o){o.stopPropagation();let n=o.target;n.disabled=this.disabled,this._choiceElements.push(n),this._setInputType(n)}_unregisterChoiceElement(o){o.stopPropagation();let n=o.target;this._choiceElements=this._choiceElements.filter(a=>a!==n)}_determineInputType(){this._choiceElements.forEach(o=>{this._setInputType(o)})}_setInputType(o){this._internals.ariaLabel=this.maxChoices===1?"radio-group":"checkbox-group";let n=this.maxChoices===1?"radio":"checkbox";o.internals.role=n,o.internals.states.delete(n==="radio"?"checkbox":"radio"),o.internals.states.add(n)}_choiceElementSelectedHandler(o){this._toggleChoiceChecked(o.target),this.maxChoices===1&&this._choiceElements.forEach(n=>{n.identifier!==o.detail.identifier&&this._setChoiceChecked(n,!1)}),this._handleChoiceSelection()}_setChoiceChecked(o,n){o.internals?.states&&(n?(o.internals.states.add("--checked"),o.internals.ariaChecked="true"):(o.internals.states.delete("--checked"),o.internals.ariaChecked="false"))}_getChoiceChecked(o){return o.internals.states.has("--checked")}_toggleChoiceChecked(o){let n=this._getChoiceChecked(o);this._setChoiceChecked(o,!n)}_handleChoiceSelection(){let n=this._choiceElements.filter(a=>this._getChoiceChecked(a)).map(a=>a.identifier);this.value=this.maxChoices===1?n[0]||"":n,this.validate(),this.saveResponse(this._value)}_updateChoiceSelection(){let o=Array.isArray(this._value)?this._value:[this._value];this._choiceElements.forEach(n=>{let a=o.includes(n.identifier);this._setChoiceChecked(n,a)})}}return l([Yt("#validationMessage")],t.prototype,"_validationMessageElement",2),l([p({type:Number,attribute:"min-choices"})],t.prototype,"minChoices",2),l([p({type:Number,attribute:"max-choices"})],t.prototype,"maxChoices",2),l([S("maxChoices",{waitUntilFirstUpdate:!0})],t.prototype,"_handleMaxChoicesChange",1),l([S("disabled",{waitUntilFirstUpdate:!0})],t.prototype,"_handleDisabledChange",2),l([S("readonly",{waitUntilFirstUpdate:!0})],t.prototype,"_handleReadonlyChange",2),t};var Xe=class extends qt(C,"qti-hottext"){constructor(){super(...arguments);this.render=()=>h`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("qti-hottext-interaction","")}};Xe=l([g("qti-hottext-interaction")],Xe);var Ye=class extends et{constructor(e){if(super(e),this.it=k,e.type!==vt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===k||e==null)return this._t=void 0,this.it=e;if(e===R)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Ye.directiveName="unsafeHTML",Ye.resultType=1;var wt=X(Ye);var ct=class extends C{constructor(){super(...arguments);this.options=[];this.correctOption="";this.dataPrompt="select"}static get styles(){return[b`
3621
- :host {
3622
- display: inline-block;
3623
- }
3624
- slot {
3625
- display: flex;
3626
- flex-direction: column;
3627
- }
3628
- [role='menu'] {
3629
- position: absolute;
3630
- z-index: 1000;
3631
- }
3632
- .anchor {
3633
- /* anchor-name: --infobox; */
3634
- width: fit-content;
3635
- }
3636
-
3637
- .positionedElement {
3638
- position: absolute;
3639
- /* position-anchor: --infobox; */
3640
- /* top: anchor(bottom); */
3641
- }
3642
- `]}render(){return h`
3643
- <select part="select" @change="${this.choiceSelected}" ?disabled="${this.disabled}" ?readonly="${this.readonly}">
3644
- ${this.options.map(t=>h`
3645
- <option value="${t.value}" ?selected="${t.selected}">${wt(t.textContent)}</option>
3646
- `)}
3647
- </select>
3648
-
3649
- ${wt(this.correctOption)}
3650
- `}connectedCallback(){super.connectedCallback(),this.addEventListener("on-dropdown-selected",this.choiceSelected);let t=Array.from(this.querySelectorAll("qti-inline-choice"));this.options=[{textContent:this.dataPrompt,value:"",selected:!1},...t.map(r=>({textContent:r.innerHTML,value:r.getAttribute("identifier"),selected:!1}))]}disconnectedCallback(){this.removeEventListener("on-dropdown-selected",this.choiceSelected)}validate(){let t=this.options.find(r=>r.selected);return t?t.value!=="":!1}reset(){this.options=this.options.map((t,r)=>({...t,selected:r===0}))}set value(t){this.options=this.options.map(r=>(t===r.value&&(r.selected=!0),r))}get value(){return this.options.find(t=>t.selected).value}set correctResponse(t){if(t===""){this.correctOption="";return}this.correctOption=`<span part="correct-option">${this.options.find(r=>t===r.value).textContent}</span>`}choiceSelected(t){let r=t.target.value;this.options=this.options.map(i=>({...i,selected:i.value===r})),this.saveResponse(r)}};ct.inputWidthClass=["","qti-input-width-2","qti-input-width-1","qti-input-width-3","qti-input-width-4","qti-input-width-6","qti-input-width-10","qti-input-width-15","qti-input-width-20","qti-input-width-72"],l([w()],ct.prototype,"options",2),l([w()],ct.prototype,"correctOption",2),l([p({attribute:"data-prompt",type:String})],ct.prototype,"dataPrompt",2),ct=l([g("qti-inline-choice-interaction")],ct);var Ar=(s,e)=>{class t extends s{constructor(){super(...arguments);this.shuffle="false"}connectedCallback(){super.connectedCallback(),this._applyShuffle()}updated(o){o.has("shuffle")&&this._applyShuffle()}_applyShuffle(){this.shuffle==="true"?this._shuffleChoices():this._resetShuffleChoices()}_shuffleChoices(){let o=Array.from(this.querySelectorAll(e)),n=o.filter(f=>f.hasAttribute("fixed")),a=o.filter(f=>!f.hasAttribute("fixed"));if(a.length<=1){console.warn("Shuffling is not possible with fewer than 2 non-fixed elements.");return}let c=[...a],d=!1,u=0;for(;!d&&u<10;){u++;for(let f=a.length-1;f>0;f--){let y=Math.floor(Math.random()*(f+1));[a[f],a[y]]=[a[y],a[f]]}d=!a.every((f,y)=>f===c[y])}d||console.warn("Failed to shuffle the choices after multiple attempts.");let m=1;[...n,...a].forEach(f=>{f.style.setProperty("order",String(m++))})}_resetShuffleChoices(){this.querySelectorAll(e).forEach(o=>{o.style.setProperty("order","initial")})}}return l([p({type:String,reflect:!0})],t.prototype,"shuffle",2),t};var Ss=(s,e)=>{class t extends s{constructor(){super(...arguments);this._classes=[];this._allLabels=["qti-labels-decimal","qti-labels-lower-alpha","qti-labels-upper-alpha"];this._allLabelSuffixes=["qti-labels-suffix-period","qti-labels-suffix-parenthesis"]}set class(o){o&&(this._classes=o.split(" "),this._addLabels())}get class(){return this._classes?.join(" ")||""}updated(o){super.updated(o),o.has("shuffle")&&this._addLabels()}_addLabels(){let o=this._classes.some(a=>this._allLabels.includes(a)||this._allLabelSuffixes.includes(a)),n=a=>!isNaN(+a);if(o){let c=Array.from(this.querySelectorAll("qti-simple-choice")).map(d=>d).map((d,u)=>({el:d,order:n(d.style.order)?+d.style.order:u+1})).sort((d,u)=>d.order-u.order).map(d=>d.el);for(let d=0;d<c.length;d++)c[d].marker=this._getLabel(d+1)}}_getLabel(o){let n=this._classes.filter(d=>this._allLabels.includes(d)).pop(),a=this._classes.filter(d=>this._allLabelSuffixes.includes(d)).pop();!n&&a&&(n="qti-labels-upper-alpha");let c="";switch(n){case"qti-labels-decimal":c=`${o}`;break;case"qti-labels-lower-alpha":c=`${String.fromCharCode(97+o-1)}`;break;case"qti-labels-upper-alpha":c=`${String.fromCharCode(65+o-1)}`;break}return a==="qti-labels-suffix-period"?c+=".":a==="qti-labels-suffix-parenthesis"&&(c+=")"),c}}return l([p({type:String,reflect:!0})],t.prototype,"class",1),t};var Rs=b`
3651
- [part='slot'] {
3652
- display: flex;
3653
- flex-direction: column;
3654
- gap: var(--qti-gap-size);
3655
- flex-wrap: wrap;
3656
- }
3657
-
3658
- ::slotted(qti-simple-choice) {
3659
- flex: 0 0
3660
- calc((100% - (var(--qti-gap-size) * var(--choice-interactions-stacking))) / var(--choice-interactions-stacking)) !important;
3661
- box-sizing: border-box !important;
3662
- }
3663
-
3664
- :host(.qti-choices-stacking-1) [part='slot'] {
3665
- flex-direction: row;
3666
- --choice-interactions-stacking: 1;
3667
- }
3668
-
3669
- :host(.qti-choices-stacking-2) [part='slot'] {
3670
- flex-direction: row;
3671
- --choice-interactions-stacking: 2;
3672
- }
3673
- :host(.qti-choices-stacking-3) [part='slot'] {
3674
- flex-direction: row;
3675
- --choice-interactions-stacking: 3;
3676
- }
3677
- :host(.qti-choices-stacking-4) [part='slot'] {
3678
- flex-direction: row;
3679
- --choice-interactions-stacking: 4;
3680
- }
3681
- :host(.qti-choices-stacking-5) [part='slot'] {
3682
- flex-direction: row;
3683
- --choice-interactions-stacking: 5;
3684
- }
3685
- :host([orientation='horizontal']) [part='slot'] {
3686
- flex-direction: row;
3687
- }
3688
- `;var Dt=class extends Ss(Ar(qt(C,"qti-simple-choice"),"qti-simple-choice"),"qti-simple-choice"){constructor(){super(),this._internals.role="group"}render(){return h`
3689
- <slot part="prompt" name="prompt"></slot><slot part="slot"></slot>
3690
- <div part="message" role="alert" id="validationMessage"></div>
3691
- `}};Dt.styles=Rs,l([p({type:String})],Dt.prototype,"orientation",2),Dt=l([g("qti-choice-interaction")],Dt);var ce=class extends v{render(){return h`<slot></slot>`}process(){let e=new Sr,t=[...this.children];e.process(t)}};ce.styles=[b`
3692
- :host {
3693
- display: none;
3694
- }
3695
- `],ce=l([g("qti-outcome-processing")],ce);var Sr=class{process(e){for(let t of e)t.process()}};var Ms=`<qti-response-processing>
3696
- <qti-response-condition>
3697
- <qti-response-if>
3698
- <qti-match>
3699
- <qti-variable identifier="RESPONSE"></qti-variable>
3700
- <qti-correct identifier="RESPONSE"></qti-correct>
3701
- </qti-match>
3702
- <qti-set-outcome-value identifier="SCORE">
3703
- <qti-base-value base-type="float">1</qti-base-value>
3704
- </qti-set-outcome-value>
3705
- </qti-response-if>
3706
- <qti-response-else>
3707
- <qti-set-outcome-value identifier="SCORE">
3708
- <qti-base-value base-type="float">0</qti-base-value>
3709
- </qti-set-outcome-value>
3710
- </qti-response-else>
3711
- </qti-response-condition>
3712
- </qti-response-processing>`,Ls=`<qti-response-processing>
3713
- <qti-response-condition>
3714
- <qti-response-if>
3715
- <qti-is-null>
3716
- <qti-variable identifier="RESPONSE"></qti-variable>
3717
- </qti-is-null>
3718
- <qti-set-outcome-value identifier="SCORE">
3719
- <qti-base-value base-type="float">0.0</qti-base-value>
3720
- </qti-set-outcome-value>
3721
- </qti-response-if>
3722
- <qti-response-else>
3723
- <qti-set-outcome-value identifier="SCORE">
3724
- <qti-map-response identifier="RESPONSE"> </qti-map-response>
3725
- </qti-set-outcome-value>
3726
- </qti-response-else>
3727
- </qti-response-condition>
3728
- </qti-response-processing>`,$s=`<qti-response-processing>
3729
- <qti-response-condition>
3730
- <qti-response-if>
3731
- <qti-is-null>
3732
- <qti-variable identifier="RESPONSE"></qti-variable>
3733
- </qti-is-null>
3734
- <qti-set-outcome-value identifier="SCORE">
3735
- <qti-base-value base-type="float">0</qti-base-value>
3736
- </qti-set-outcome-value>
3737
- </qti-response-if>
3738
- <qti-response-else>
3739
- <qti-set-outcome-value identifier="SCORE">
3740
- <qti-map-response-point identifier="RESPONSE"></qti-map-response-point>
3741
- </qti-set-outcome-value>
3742
- </qti-response-else>
3743
- </qti-response-condition>
3744
- </qti-response-processing>`;var Et=class extends v{render(){return h`<slot></slot>`}process(){if(!this.closest("qti-assessment-item"))return;let t=[...this.children];for(let r of t)r.process()}firstUpdated(e){if(this.getAttribute("template")){let t=this.getAttribute("template").split("/"),r=t[t.length-1].replace(".xml","");switch(this.innerHTML="",r){case"map_response":{this.appendChild(this.fragmentFromString(Ls).firstElementChild.firstElementChild);break}case"map_response_point":{this.appendChild(this.fragmentFromString($s).firstElementChild.firstElementChild);break}case"match_correct":this.appendChild(this.fragmentFromString(Ms).firstElementChild.firstElementChild);break}}}fragmentFromString(e){return document.createRange().createContextualFragment(e)}};Et.styles=[b`
3745
- :host {
3746
- display: none;
3747
- }
3748
- `],Et=l([g("qti-response-processing")],Et);var J=class extends v{render(){return h`<slot></slot>`}process(){throw new Error("Not implemented")}};J=l([g("qti-rule")],J);var Ge=class extends J{get childExpression(){return this.firstElementChild}process(){let e=this.getAttribute("identifier"),t=this.closest("qti-assessment-item").getVariable(e),r;return t.interpolationTable&&(r=t.interpolationTable.get(parseInt(this.childExpression.calculate()))),r==null?(console.warn("lookupOutcomeValue: value is null or undefined"),0):(this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:this.identifier,value:je(r)}})),r)}};l([p({type:String})],Ge.prototype,"identifier",2);customElements.define("qti-lookup-outcome-value",Ge);var Rr=class extends J{render(){return h`<slot></slot>`}process(){let e=[...this.children];for(let t=0;t<e.length;t++){let r=e[t];if(r.calculate()){r.process();return}}}};customElements.define("qti-response-condition",Rr);var Mr=class extends J{process(){let e=this.getAttribute("identifier"),t=this.firstElementChild,i=new Lr(t).process();this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:e,value:Array.isArray(i)?i.map(o=>je(o)):je(i)}}))}},Lr=class{constructor(e){this.expression=e}process(){let e=this.expression?this.expression.calculate():null;if(e==null){console.warn("setOutcomeValue: value is null or undefined");return}return e}};customElements.define("qti-set-outcome-value",Mr);var de=class extends v{render(){return h`<slot></slot>`}calculate(){return!0}getSubRules(){return[...this.children]}process(){let e=this.getSubRules();for(let t=0;t<e.length;t++)e[t].process()}};customElements.define("qti-response-else",de);var pe=class extends de{calculate(){return this.firstElementChild.calculate()}getSubRules(){let e=[];for(let t=1;t<this.children.length;t++)e.push(this.children[t]);return e}};customElements.define("qti-response-if",pe);var $r=class extends pe{render(){return h`${super.render()}`}};customElements.define("qti-response-else-if",$r);var _=class extends v{constructor(){super(...arguments);this.getVariables=()=>Array.from(this.children).map(t=>{switch(t.tagName.toLowerCase()){case"qti-base-value":return{baseType:t.getAttribute("base-type"),value:t.textContent.trim(),cardinality:"single"};case"qti-variable":{let r=t.getAttribute("identifier")||"";return this.context.variables.find(o=>o.identifier===r)||null}case"qti-multiple":{let i=t.getResult();return i.length>0?{identifier:"",baseType:i[0].baseType,value:i.map(o=>o.value),cardinality:"multiple",type:"response"}:null}case"qti-correct":{let r=t.getAttribute("identifier")||"",i=this.context.variables.find(o=>o.identifier===r)||null;return{baseType:i.baseType,value:i.correctResponse,cardinality:i.cardinality}}default:{try{return{baseType:"integer",value:t.getResult().toString(),cardinality:"single"}}catch{console.warn("default not sufficient")}return null}}}).filter(t=>t!==null)}render(){return h`<pre>${JSON.stringify(this.result,null,2)}</pre>
3749
- <slot></slot>`}calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}};_.styles=b`
3750
- slot {
3751
- display: none;
3752
- }
3753
- `,l([w()],_.prototype,"result",2),l([T({context:$,subscribe:!0}),w()],_.prototype,"context",2);var H=class extends _{calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}};var Ke=class extends Ds(H){calculate(){return this.calculateChildren(Array.from(this.children))}};function Ds(s){return class extends s{calculateChildren(t){return t.map(i=>{let o=i;if(!o.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let n=o.calculate(),a=!1;if(typeof n=="string")if(n==="true")a=!0;else if(n==="false")a=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof n=="boolean"&&(a=n);return a}).every(i=>typeof i=="boolean"&&i)}}}customElements.define("qti-and",Ke);var Ze=class extends _{constructor(){super(...arguments);this.baseType="string"}getResult(){return this.textContent.trim()}};l([p({type:String,attribute:"base-type"})],Ze.prototype,"baseType",2);customElements.define("qti-base-value",Ze);var Dr=class extends H{getResult(){let e=this.getVariables();if(this.children.length===2){let t=e[0],r=e[1];if(t.baseType==="directedPair"&&r.baseType==="directedPair"&&t.cardinality==="multiple"){let i=t.value,o=r.value;return i.filter(c=>o.includes(c)).length>0}else if(t.baseType==="directedPair"&&r.baseType==="directedPair"&&t.cardinality==="single"){let i=t.value;return r.value.includes(i)}else console.error("unsupported baseType or cardinality in qti contains, only baseType: directedPair and cardinality: multiple is supported")}else console.error("unexpected number of children in qti contains");return!1}};customElements.define("qti-contains",Dr);var Ir=class extends _{get interpretation(){return this.getAttribute("interpretation")||""}getResult(){let e=this.getAttribute("identifier")||"",t=this.context.variables.find(r=>r.identifier===e)||null;return t.cardinality!=="single"?t.correctResponse.length>0?t.correctResponse[0]:"":t.correctResponse}};customElements.define("qti-correct",Ir);var Je=class extends _{constructor(){super(...arguments);this.roundingMode="significantFigures"}get figures(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;let r=parseInt(this.getAttribute("figures")||"0");return isNaN(r)?(console.error("figures attribute is not a number"),null):r<0?(console.error("figures attribute is negative"),null):r<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):r}getResult(){if(this.children.length===2){let t=this.getVariables(),r=t[0],i=t[1];if(this.roundingMode===null)return null;if(r.cardinality!=="single"||i.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(i.value))return console.error("unexpected cardinality in qti equal"),!1;switch(t[0].baseType){case"integer":case"float":{let o=parseFloat(r.value),n=parseFloat(i.value);if(!isNaN(o)&&!isNaN(n))return this.roundingMode==="significantFigures"?o.toPrecision(this.figures)===n.toPrecision(this.figures):Math.round(o*Math.pow(10,this.figures))/Math.pow(10,this.figures)===Math.round(n*Math.pow(10,this.figures))/Math.pow(10,this.figures);console.error(`value cannot be casted to numeric value in equalRounded operator: ${o}, ${n}`);break}default:{console.error("values other than float and int cannot be used in equalRounded operator.");break}}return!1}return console.error("unexpected number of children in qti-equal-rounded"),null}};l([p({type:String})],Je.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",Je);var V=class{static compareSingleValues(e,t,r){switch(r){case"identifier":case"string":return e===t;case"integer":{let i=parseInt(e,10),o=parseInt(t,10);if(!isNaN(i)&&!isNaN(o))return i===o;console.error(`Cannot convert ${e} and/or ${t} to int.`);break}case"float":{let i=parseFloat(e),o=parseFloat(t);if(!isNaN(i)&&!isNaN(o))return i===o;console.error(`couldn't convert ${e} and/or ${t} to float.`);break}case"pair":case"directedPair":{let i=e.split(" ").sort(),o=t.split(" ").sort();if(i.length===2&&o.length===2)return r==="pair"&&(i.sort(),o.sort()),i.join(" ")===o.join(" ");console.error(`compared two pair but one of the values does not have 2 values: 1: ${e} 2: ${t}`);break}}return!1}};var Qe=class extends _{constructor(){super(...arguments);this.toleranceMode="exact"}getResult(){if(this.children.length===2){let t=this.getVariables(),r=t[0],i=t[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):r.cardinality!=="single"||i.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(i.value)?(console.error("unexpected cardinality in qti equal"),!1):V.compareSingleValues(r.value,i.value,r.baseType)}return console.error("unexpected number of children in qti-equal"),null}};l([p({type:String})],Qe.prototype,"toleranceMode",2);customElements.define("qti-equal",Qe);var Nr=class extends _{getResult(){if(this.children.length===2){let e=this.getVariables(),t=e[0],r=e[1];if((t.baseType==="integer"||t.baseType==="float")&&(r.baseType==="integer"||r.baseType==="float"))return+t.value>+r.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}};customElements.define("qti-gt",Nr);var Pr=class extends H{getResult(){if(this.children.length===2){let e=this.getVariables(),t=e[0],r=e[1];return(t.baseType==="integer"||t.baseType==="float")&&(r.baseType==="integer"||r.baseType==="float")?+t.value>=+r.value:(console.error("unexpected baseType or cardinality in qti gte"),null)}return console.log("unexpected number of children in qte"),null}};customElements.define("qti-gte",Pr);var Or=class extends _{getResult(){if(this.children.length===1){let e=this.getVariables();if(!e)return!0;let t=e[0].value;return t==null||t==null||t===""}return console.error("unexpected number of children in qti Null"),null}};customElements.define("qti-is-null",Or);var Hr=class extends _{getResult(){if(this.children.length===2){let e=this.getVariables(),t=e[0],r=e[1];if((t.baseType==="integer"||t.baseType==="float")&&(r.baseType==="integer"||r.baseType==="float"))return+t.value<+r.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}};customElements.define("qti-lt",Hr);var Vr=class extends H{getResult(){if(this.children.length===2){let e=this.getVariables(),t=e[0],r=e[1];return(t.baseType==="integer"||t.baseType==="float")&&(r.baseType==="integer"||r.baseType==="float")?+t.value<=+r.value:(console.error("unexpected baseType or cardinality in qti lte"),null)}return console.log("unexpected number of children in lte"),null}};customElements.define("qti-lte",Vr);var tr=class extends _{getResult(){let e=this.context.variables.find(o=>o.identifier===this.identifier);if(!e)return console.warn(`Response ${this.identifier} can not be found`),null;let t=e.mapping,r=Array.isArray(e.value)?e.value:[e.value],i=0;for(let o of r){let n=t.mapEntries.find(a=>V.compareSingleValues(a.mapKey,o,e.baseType));n==null||n.mappedValue==null?i+=t.defaultValue:i+=n.mappedValue}return t.lowerBound!=null&&(i=Math.max(t.lowerBound,i)),t.upperBound!=null&&(i=Math.min(t.upperBound,i)),i}};l([p({type:String})],tr.prototype,"identifier",2);customElements.define("qti-map-response",tr);var It=class extends v{constructor(){super(...arguments);this.defaultValue=0}get mapEntries(){return Array.from(this.querySelectorAll("qti-map-entry")).map(t=>({mapKey:t.getAttribute("map-key"),mappedValue:+t.getAttribute("mapped-value")}))}};l([p({attribute:"default-value",type:Number})],It.prototype,"defaultValue",2),l([p({attribute:"lower-bound",type:Number})],It.prototype,"lowerBound",2),l([p({attribute:"upper-bound",type:Number})],It.prototype,"upperBound",2);customElements.define("qti-mapping",It);var zr=class s extends _{getResult(){if(this.children.length===2){let e=this.getVariables(),t=e[0],r=e[1];return s.match(t,r)}return console.error("unexpected number of children in match"),null}static match(e,t){switch(t.cardinality){case"single":return e.value===null?!1:Array.isArray(e.value)||Array.isArray(t.value)?(console.error("unexpected cardinality in qti match"),!1):V.compareSingleValues(e.value?.toString(),t.value.toString(),t.baseType);case"ordered":{if(!Array.isArray(e.value)||!Array.isArray(t.value))return console.error("unexpected cardinality in qti match"),!1;if(e.value.length!==t.value.length)return!1;for(let r=0;r<e.value.length;r++)if(!V.compareSingleValues(t.value[r],e.value[r],t.baseType))return!1;return!0}case"multiple":{if(!Array.isArray(e.value)||!Array.isArray(t.value))return console.error("unexpected cardinality in qti match"),!1;if(e.value.length!==t.value.length)return!1;let r=0;for(let i of t.value){let o=null,n=[...e.value];for(let a of n)if(V.compareSingleValues(i,a,t.baseType)){o=a;break}if(o!==null)n.splice(n.indexOf(o),1);else return!1;r++}return!0}default:return console.error("unexpected cardinality in qti match"),!1}}};customElements.define("qti-match",zr);var Ur=class extends _{getResult(){let e=this.getVariables();this.children.length!==2&&console.warn("The member operator takes two sub-expressions");let[t,r]=e;if(t.baseType===r.baseType||t.baseType==="integer"&&r.baseType==="float"||t.baseType==="float"&&r.baseType==="integer"||console.warn("Which must both have the same base-type"),r.cardinality==="multiple"||r.cardinality==="ordered"||console.warn("and the second must be a multiple or ordered container"),(t.baseType==="float"||r.baseType==="float")&&console.warn("The member operator should not be used on sub-expressions with a base-type of float"),(t.baseType==="duration"||r.baseType==="duration")&&console.warn("It must not be used on sub-expressions with a base-type of duration"),t.value===null||r.value===null)return null;let i=t.value;return r.value.includes(i)}};customElements.define("qti-member",Ur);var Fr=class extends _{getResult(){let e=this.getVariables();if(e.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let t of e)if(t.cardinality!=="multiple"&&t.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[];return e}};customElements.define("qti-multiple",Fr);var Br=class extends _{render(){return h`${super.render()}`}getResult(){return!this.firstElementChild.calculate()}};customElements.define("qti-not",Br);var jr=class extends H{getResult(){return Array.from(this.children).map(t=>{let r=t;if(!r.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let i=r.calculate(),o=!1;if(typeof i=="string")if(i==="true")o=!0;else if(i==="false")o=!1;else return console.error("unexpected val in qti-or, expected boolean"),null;else typeof i=="boolean"&&(o=i);return o}).some(t=>typeof t=="boolean"&&t)}};customElements.define("qti-or",jr);var Wr=class extends _{getResult(){let e=this.getVariables();if(e.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let t of e)if(t.cardinality!=="ordered"&&t.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[];return e}};customElements.define("qti-ordered",Wr);var he=class extends v{render(){let e=this.context?.variables.find(t=>t.identifier===this.identifier)?.value;return h`${JSON.stringify(e,null,2)}`}calculate(){return this.context.variables.find(t=>t.identifier===this.identifier)||null}};l([p({type:String})],he.prototype,"identifier",2),l([T({context:$,subscribe:!0}),w()],he.prototype,"context",2);customElements.define("qti-printed-variable",he);var Xr=class extends _{getResult(){return this.getVariables().reduce((r,i)=>{if(i.baseType=="float"||i.baseType=="integer")try{return r*parseInt(i.value.toString())}catch{console.warn("can not convert to number")}else console.warn(`has another baseType ${i.baseType}`);return r},1)}};customElements.define("qti-product",Xr);var er=class extends Is(_){getResult(){return this.calculateChildren(Array.from(this.children))}};function Is(s){return class extends s{calculateChildren(t){let r=t.map(i=>{if(!i.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let o=i.calculate();return Number.isNaN(o)?(console.error("Unexpected value in qti-subtract, expected number"),null):Number(o)});return r.some(i=>i===null)?(console.error("One or more child expressions returned invalid values"),0):r[0]-r[1]}}}customElements.define("qti-subtract",er);var rr=class extends _{constructor(){super(...arguments);this.caseSensitive="true"}getResult(){if(this.children.length===2){let t=this.getVariables(),r=t[0],i=t[1];if(r.cardinality!=="single"||i.cardinality!=="single"||Array.isArray(r.value)||Array.isArray(i.value))return console.error("unexpected cardinality in qti string-match"),!1;let o=this.caseSensitive==="true"?r.value:r.value.toLowerCase(),n=this.caseSensitive==="true"?i.value:i.value.toLowerCase();return V.compareSingleValues(o,n,r.baseType)}return console.error("unexpected number of children in qti-string-match"),null}};l([p({type:String,attribute:"case-sensitive"})],rr.prototype,"caseSensitive",2);customElements.define("qti-string-match",rr);var Yr=class extends _{constructor(){super(),this._expression=new Gr(Array.from(this.children))}getResult(){return this._expression.calculate()}},Gr=class{constructor(e){this.expressions=e}calculate(){return this.expressions.map(t=>{if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let r=t.calculate();return Number.isNaN(r)?(console.error("unexpected value in qti-sum, expected number"),null):Number(r)}).reduce((t,r)=>t+r,0)}};customElements.define("qti-sum",Yr);var Kr=class extends _{getResult(){let e=this.getAttribute("identifier");return this.context.variables.find(r=>r.identifier===e).value}};customElements.define("qti-variable",Kr);var Ct=class extends C{constructor(){super(...arguments);this._errorMessage=null;this.loadConfig=async(t,r)=>{t=this.removeDoubleSlashes(t);try{let i=await fetch(t);if(i.ok){let n=await i.json();for(let a in n.paths)r&&(n.paths[a]=this.getResolvablePath(n.paths[a],r));return n}}catch{}return null};this.getResolvablePathString=(t,r)=>(t=t.replace(/\.js$/,""),t?.toLocaleLowerCase().startsWith("http")||!r?t:this.removeDoubleSlashes(`${r}/${t}`));this.getResolvablePath=(t,r)=>Array.isArray(t)?t.map(i=>this.getResolvablePathString(i,r)):this.getResolvablePathString(t,r)}convertQtiVariableJSON(t){for(let r in t)if(t.hasOwnProperty(r)){let i=t[r];if(i){for(let o in i)if(i.hasOwnProperty(o)){let n=i[o];if(Array.isArray(n))return n.map(String);if(n!=null)return String(n)}}}return null}startChecking(){this.intervalId=setInterval(()=>{let t=this.pci.getResponse(),r=this.pci.getResponse(),i=JSON.stringify(t);if(i!==this.rawResponse){this.rawResponse=i;let o=this.convertQtiVariableJSON(r);this.value=o,this.saveResponse(o)}},200)}stopChecking(){this.intervalId!==void 0&&clearInterval(this.intervalId)}validate(){return!0}set value(t){}get value(){return this.rawResponse}getTAOConfig(t){let r=t.querySelectorAll("properties"),i={},o=a=>{let c={},d=a.getAttribute("key");if(d){let u=Array.from(a.children),m=u.map(y=>y.getAttribute("key"));m.length>0&&!m.find(y=>!Number.isInteger(+y))?c[d]=u.map(y=>n(y)):c[d]=a.textContent}return c},n=a=>{if(a){let c={};for(let d of a.children)c={...c,...o(d)};return c}};for(let a of r)return a.getAttribute("key")||(i={...i,...n(a)}),i;return console.log("Can not find qti-custom-interaction config"),null}register(t){this.pci=t;let r=this.parentElement.tagName==="QTI-CUSTOM-INTERACTION"?"TAO":"IMS",i=r=="IMS"?this.querySelector("qti-interaction-markup"):this.querySelector("markup");i.classList.add("qti-customInteraction"),r=="TAO"&&this.querySelector("properties")&&(this.querySelector("properties").style.display="none");let o=r=="IMS"?{properties:this.dataset,onready:()=>{console.log("onready")}}:this.getTAOConfig(this);r=="IMS"?t.getInstance(i,o,void 0):t.initialize(this.customInteractionTypeIdentifier,i.firstElementChild,o),r=="TAO"&&Array.from(this.querySelectorAll("link")).map(a=>a.getAttribute("href")).forEach(a=>{let c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.media="screen",c.href=a,i.appendChild(c)}),this.startChecking()}connectedCallback(){super.connectedCallback(),define("qtiCustomInteractionContext",()=>({register:i=>{this.register(i)},notifyReady:()=>{}}));let t=this.buildRequireConfig();requirejs.config(t)(["require"],i=>{i([this.module])})}disconnectedCallback(){super.disconnectedCallback(),requirejs.undef(this.customInteractionTypeIdentifier);let t=requirejs.s.contexts;delete t[this.customInteractionTypeIdentifier],this.stopChecking()}buildRequireConfig(){let t={context:this.customInteractionTypeIdentifier,catchError:!0,paths:window.requirePaths||{},shim:window.requireShim||{}};if(!globalThis.require)return this._errorMessage="RequireJS not found. Please load it via CDN: https://cdnjs.com/libraries/require.js",null;let r=this.getAttribute("data-base-url"),i=this.querySelector("qti-interaction-modules");if(i){let o=i.querySelectorAll("qti-interaction-module");for(let n of o){let a=n.getAttribute("id"),c=n.getAttribute("primary-path"),d=n.getAttribute("fallback-path");if(a&&c){let u=d?this.combineRequireResolvePaths(this.getResolvablePath(c,r),this.getResolvablePath(d,r)):this.getResolvablePath(c,r),m=t.paths[a]||[];t.paths[a]=this.combineRequireResolvePaths(m,u)}}}return t}combineRequireResolvePaths(t,r){let i=Array.isArray(t)?t:[t],o=Array.isArray(r)?r:[r];return i.concat(o)}removeDoubleSlashes(t){return t.replace(/([^:]\/)\/+/g,"$1").replace(/\/\//g,"/").replace("http:/","http://").replace("https:/","https://")}render(){return h`<slot></slot>${this._errorMessage&&h`<div style="color:red">
3754
- <h1>Error</h1>
3755
- ${this._errorMessage}
3756
- </div>`}`}};l([p({type:String,attribute:"module"})],Ct.prototype,"module",2),l([p({type:String,attribute:"custom-interaction-type-identifier"})],Ct.prototype,"customInteractionTypeIdentifier",2),l([w()],Ct.prototype,"_errorMessage",2),Ct=l([g("qti-portable-custom-interaction")],Ct);var Zr=class s{constructor(){this.touchStartTime=0;this.touchStartPoint=null;this.lastClickTime=0;this.isDraggable=!1;this.dragSource=null;this.dragClone=null;this.touchEndTriggered=!1;this.isDragging=!1;this.initialTransform="";this.hasDispatchedDragStart=!1;this.rootNode=null;this.allDropzones=[];this.dataTransfer={data:{},setData(e,t){this.data[e]=t},getData(e){return this.data[e]},effectAllowed:"move"};this.cloneOffset={x:0,y:0};this.lastTarget=null;this.currentDropTarget=null;this.allowClick=!0;this.copyStylesForDragClone=!0;this.dragOnClickEnabled=!1;this.useDragClone=!1;this.MIN_DRAG_DISTANCE=5;this.DRAG_CLONE_OPACITY=1;if(s.instance)return s.instance;s.instance=this,document.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("mousemove",this.handleTouchMove.bind(this),{passive:!1}),document.addEventListener("touchend",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("mouseup",this.handleTouchEnd.bind(this),{passive:!1}),document.addEventListener("touchcancel",this.handleTouchCancel.bind(this),{passive:!1})}addDraggableElements(e){e.forEach(t=>{t.setAttribute("tabindex","0"),t.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!1}),t.addEventListener("mousedown",this.handleTouchStart.bind(this),{passive:!1})})}getInteraction(e){let t=e;for(;t&&!t.tagName.toLocaleLowerCase().endsWith("-interaction");)t=t.parentElement;return t}handleTouchStart(e){this.touchStartTime=Date.now();let{x:t,y:r}=this.getEventCoordinates(e);if(this.touchStartPoint={x:t,y:r},this.dragSource=e.currentTarget,this.isDraggable=!0,this.rootNode=this.dragSource.getRootNode(),this.dragOnClickEnabled&&(this.isDragging=!0,this.createDragClone(e,{clientX:t,clientY:r})),!this.useDragClone){let i=window.getComputedStyle(this.dragSource);this.initialTransform=i.transform==="none"?"":i.transform,this.initialTransition=i.transition||"",this.dragSource.style.transition="none";let o=this.dragSource.getBoundingClientRect();this.cloneOffset.x=t-o.left,this.cloneOffset.y=r-o.top,this.dragSource.style.zIndex="9999",this.dragSource.focus()}e.preventDefault()}handleTouchMove(e){if(this.isDraggable&&this.dragSource){let t=this.getInteraction(this.dragSource);this.allDropzones=[...Array.from(t.querySelectorAll("[dropzone]")),...Array.from(t.shadowRoot?.querySelectorAll("[dropzone]"))];let{x:r,y:i}=this.getEventCoordinates(e),o={clientX:r,clientY:i};this.calculateDragDistance(o)>=this.MIN_DRAG_DISTANCE&&(this.dragSource.style.pointerEvents="none",this.isDragging=!0),this.createDragClone(e,o),e.preventDefault();let n=this.findClosestDropzone();this.currentDropTarget=n,n!==this.lastTarget&&(this.lastTarget&&this.dispatchCustomEvent(this.lastTarget,"dragleave"),n&&this.dispatchCustomEvent(n,"dragenter"),this.lastTarget=n),this.lastTarget&&this.dispatchCustomEvent(this.lastTarget,"dragover")}}createDragClone(e,t){if(!this.isDragging)return;if(this.useDragClone){if(!this.dragClone){if(this.dragSource.style.opacity=this.DRAG_CLONE_OPACITY.toString(),this.dragClone=this.dragSource.cloneNode(!0),this.copyStylesForDragClone){let i=window.getComputedStyle(this.dragSource);for(let o of i)this.dragClone.style[o]=i.getPropertyValue(o)}this.rootNode instanceof ShadowRoot?this.rootNode.host.appendChild(this.dragClone):this.rootNode instanceof Document&&document.body.appendChild(this.dragClone),this.calculateClonePosition(t),this.setDragCloneStyles(t),this.dispatchCustomEvent(this.dragSource,"dragstart")}this.updateDragClonePosition(t)}else if(this.touchStartPoint){let i=t.clientX-this.touchStartPoint.x,o=t.clientY-this.touchStartPoint.y;this.dragSource.style.transform=`${this.initialTransform} translate(${i}px, ${o}px)`,this.hasDispatchedDragStart||(this.dispatchCustomEvent(this.dragSource,"dragstart"),this.hasDispatchedDragStart=!0)}let r=this.currentDropTarget;r!==this.lastTarget&&(this.dispatchCustomEvent(r,"dragenter"),this.dispatchCustomEvent(this.lastTarget,"dragleave"),this.lastTarget=r),this.currentDropTarget=r,this.currentDropTarget&&this.dispatchCustomEvent(r,"dragover")}handleTouchEnd(e){this.allDropzones=[],this.touchEndTriggered=!0,this.isDraggable=!1;let t=!1;if(this.currentDropTarget)this.dispatchCustomEvent(this.currentDropTarget,"drop"),this.dispatchCustomEvent(this.dragSource,"dragend"),t=!0;else if(this.isDragging){let r=new CustomEvent("dragend",{bubbles:!0,cancelable:!0});r.dataTransfer={dropEffect:"none"},this.dragSource?.dispatchEvent(r)}this.resetDragState(t)}handleTouchCancel(e){this.resetDragState()}findClosestDropzone(){if(!this.dragSource||this.allDropzones.length===0)return null;let e=this.dragSource.getBoundingClientRect(),t=this.getCorners(e),r=this.getCenter(e),i=null,o=1/0;for(let n of this.allDropzones){let a=n.getBoundingClientRect(),c=this.getCorners(a),d=this.getCenter(a),u=this.calculateTotalCornerDistance(t,c)/this.getRectDiagonal(a),m=this.calculateDistance(r,d),f=u*.5+m*.5;f<o&&(o=f,i=n)}return i}getCenter(e){return{x:e.left+e.width/2,y:e.top+e.height/2}}getRectDiagonal(e){return Math.sqrt(e.width**2+e.height**2)}getCorners(e){return{topLeft:{x:e.left,y:e.top},topRight:{x:e.right,y:e.top},bottomLeft:{x:e.left,y:e.bottom},bottomRight:{x:e.right,y:e.bottom}}}calculateTotalCornerDistance(e,t){return this.calculateDistance(e.topLeft,t.topLeft)+this.calculateDistance(e.topRight,t.topRight)+this.calculateDistance(e.bottomLeft,t.bottomLeft)+this.calculateDistance(e.bottomRight,t.bottomRight)}calculateDistance(e,t){let r=e.x-t.x,i=e.y-t.y;return Math.sqrt(r*r+i*i)}findDropTarget(e){let{x:t,y:r}=this.getEventCoordinates(e);return this.getDropTargetAtPoint(document,t,r)}getDropTargetAtPoint(e,t,r,i=0){if(i>2)return null;let n=e.elementFromPoint(t,r);if(!n)return null;if(n.hasAttribute("dropzone"))return n;let a=n.parentElement;for(;a;){if(a.hasAttribute("dropzone"))return a;a=a.parentElement}if(n.shadowRoot&&i<2){let c=this.getDropTargetAtPoint(n.shadowRoot,t,r,i+1);if(c)return c}return null}getEventCoordinates(e,t=!1){let r=e.touches?e.touches[0]:e;return{x:t?r.pageX:r.clientX,y:t?r.pageY:r.clientY}}calculateClonePosition(e){let t=this.dragSource.getBoundingClientRect();this.cloneOffset.x=e.clientX-t.left,this.cloneOffset.y=e.clientY-t.top}setDragCloneStyles(e){this.dragClone.style.position="fixed",this.dragClone.style.top=`${e.clientY-this.cloneOffset.y}px`,this.dragClone.style.left=`${e.clientX-this.cloneOffset.x}px`,this.dragClone.style.pointerEvents="none",this.dragClone.style.zIndex="999999"}updateDragClonePosition(e){requestAnimationFrame(()=>{if(this.touchEndTriggered||!this.dragClone)return;let t=e.clientX-this.cloneOffset.x,r=e.clientY-this.cloneOffset.y,{newLeft:i,newTop:o}=this.applyBoundaries(t,r,this.dragClone);this.dragClone.style.left=`${i}px`,this.dragClone.style.top=`${o}px`})}applyBoundaries(e,t,r){let i;this.rootNode instanceof ShadowRoot?i=this.rootNode.host.getBoundingClientRect():this.rootNode instanceof Document?i=document.documentElement.getBoundingClientRect():i=new DOMRect(0,0,window.innerWidth,window.innerHeight);let o=r.getBoundingClientRect(),n=o.width,a=o.height,c=Math.max(i.left,Math.min(e,i.right-n)),d=Math.max(i.top,Math.min(t,i.bottom-a));return{newLeft:c,newTop:d}}calculateDragDistance(e){let t=Math.abs(e.clientX-this.touchStartPoint.x),r=Math.abs(e.clientY-this.touchStartPoint.y);return t+r}dispatchCustomEvent(e,t,r=!0){if(!e)return;let i=new CustomEvent(t,{bubbles:r,cancelable:!0});i.dataTransfer=this.dataTransfer,e.dispatchEvent(i)}resetDragState(e=!1){this.isDragging&&(this.useDragClone?(this.dragSource.style.opacity="1.0",this.dragClone?.parentElement.removeChild(this.dragClone)):(e||(this.dragSource.style.transform="translate(0, 0)"),this.dragSource.style.zIndex="",this.dragSource.style.pointerEvents="",this.dragSource.style.transition=this.initialTransition,this.initialTransition="")),this.isDragging=!1,this.dragSource=null,this.dragClone=null,this.isDraggable=!1,this.touchStartTime=0,this.touchStartPoint=null,this.touchEndTriggered=!1,this.allDropzones=[],this.dataTransfer={data:{},setData(t,r){this.data[t]=r},getData(t){return this.data[t]},effectAllowed:"move"},this.cloneOffset={x:0,y:0},this.lastTarget=null,this.currentDropTarget=null,this.allowClick=!0,this.initialTransform="",this.hasDispatchedDragStart=!1,this.rootNode=null}};var Ns=(s,e,t)=>{class r extends s{constructor(){super(...arguments);this.disabled=!1}firstUpdated(n){if(this.isMatchTabular())return;super.firstUpdated(n);let a=this.getDroppableElements();this.initializeEventHandlers(),a.forEach(c=>{this.prepareDroppable(c),this.observeDroppableAttributes(c)})}isMatchTabular(){return this.classList.contains("qti-match-tabular")}getDroppableElements(){return Array.from(e?this.shadowRoot.querySelectorAll(t):this.querySelectorAll(t))}initializeEventHandlers(){this.dragoverHandler=this.dragoverHandler.bind(this),this.dragleaveHandler=this.dragleaveHandler.bind(this),this.dragenterHandler=this.dragenterHandler.bind(this),this.dropHandler=this.dropHandler.bind(this)}prepareDroppable(n){n.setAttribute("dropzone","move"),n.addEventListener("dragleave",this.dragleaveHandler),this.attachEventListeners(n)}observeDroppableAttributes(n){this.observer=new MutationObserver(a=>{a.forEach(({attributeName:c})=>{c==="disabled"&&this.toggleDroppableHandlers(n)})}),this.observer.observe(n,{attributes:!0})}toggleDroppableHandlers(n){n.hasAttribute("disabled")?this.removeEventListeners(n):this.attachEventListeners(n)}attachEventListeners(n){n.addEventListener("dragover",this.dragoverHandler),n.addEventListener("dragenter",this.dragenterHandler),n.addEventListener("drop",this.dropHandler)}removeEventListeners(n){n.removeEventListener("dragover",this.dragoverHandler),n.removeEventListener("dragenter",this.dragenterHandler),n.removeEventListener("drop",this.dropHandler)}disconnectedCallback(){this.isMatchTabular()||(super.disconnectedCallback(),this.observer?.disconnect())}dragenterHandler(n){n.preventDefault()}dragoverHandler(n){let a=n.dataTransfer.getData("responseIdentifier");return n.preventDefault(),a===this.responseIdentifier&&(this.activateDroppable(n.currentTarget),n.dataTransfer.dropEffect="move"),!1}activateDroppable(n){this._internals.states.delete("--dragzone-active"),n.setAttribute("active","")}async dropHandler(n){n.preventDefault();let a=n.currentTarget,c=n.dataTransfer.getData("text"),d=n.dataTransfer.getData("responseIdentifier"),u=this.findDraggable(d,c);return u?u&&!this.isValidDrop(a,u,d)?(u.style.transform="translate(0, 0)",!1):(await this.moveDraggableToDroppable(u,a),this.deactivateDroppable(a,!1),!1):!1}findDraggable(n,a){return a?n===this.responseIdentifier?this.querySelector(`[identifier=${a}]`)||this.shadowRoot.querySelector(`[identifier=${a}]`):this.closest("qti-assessment-item").querySelector(`[response-identifier=${n}]`).querySelector(`[identifier=${a}]`):null}isValidDrop(n,a,c){return this.responseIdentifier===c}async moveDraggableToDroppable(n,a){let c=()=>{n.style.transform="translate(0, 0)",a.appendChild(n),this.checkMaxAssociations(),this.saveResponse(null)};if(!document.startViewTransition){c();return}await document.startViewTransition(c).finished}deactivateDroppable(n,a=!0){a&&this._internals.states.add("--dragzone-active"),n.removeAttribute("active")}dragleaveHandler(n){return n.preventDefault(),this.deactivateDroppable(n.currentTarget),n.dataTransfer.dropEffect="none",!1}}return l([p({type:Boolean,reflect:!0})],r.prototype,"disabled",2),r};var Ps=(s,e,t)=>{class r extends s{}return r};var st=(s,e,t,r)=>{class i extends Ps(Ns(s,t,r),r,e){constructor(){super(...arguments);this.draggables=new Map;this.droppables=[];this.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};this.minAssociations=1;this.maxAssociations=1;this.handleDragStart=a=>{let c=a.currentTarget;a.dataTransfer.setData("text",c.getAttribute("identifier")),this.responseIdentifier&&a.dataTransfer.setData("responseIdentifier",this.responseIdentifier),this._internals.states.add("--dragzone-enabled"),c.setAttribute("dragging",""),this.activateDragLocation(),this.activateDroppables(c)};this.handleDragEnd=async a=>{a.preventDefault(),this._internals.states.delete("--dragzone-enabled"),this._internals.states.delete("--dragzone-active"),this.deactivateDragLocation(),this.deactivateDroppables();let c=a.currentTarget;c.removeAttribute("dragging"),await this.wasDropped(a)||this.configuration.dragCanBePlacedBack&&this.restoreInitialDraggablePosition(c)}}handleDraggablesChange(a,c){if(this.isMatchTabular())return;let d=this.filterExistingDraggables(a);d.length>0&&this.addNewDraggables(d)}firstUpdated(a){super.firstUpdated(a),this.initializeDroppables()}connectedCallback(){super.connectedCallback(),this.initializeDragDropApi()}initializeDragDropApi(){this.dragDropApi=new Zr,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}isMatchTabular(){return this.classList.contains("qti-match-tabular")}filterExistingDraggables(a){return a.filter(c=>!this.draggables.has(c))}addNewDraggables(a){this.dragDropApi.addDraggableElements(a),a.forEach(c=>this.storeDraggable(c))}storeDraggable(a){let c=Array.from(a.parentNode.children).indexOf(a);this.draggables.set(a,{parent:a.parentElement,index:c}),a.style.viewTransitionName=`drag-${c}-${this.getAttribute("identifier")||crypto.randomUUID()}`,a.setAttribute("qti-draggable","true"),a.addEventListener("dragstart",this.handleDragStart),a.addEventListener("dragend",this.handleDragEnd)}initializeDroppables(){this.droppables=Array.from(t?this.shadowRoot.querySelectorAll(r):this.querySelectorAll(r));let a=this.dataset.choicesContainerWidth;a&&this.droppables.forEach(c=>{c.style.width=`${a}px`,c.style.boxSizing="border-box"})}getDragContainers(){let a=Array.from(this.querySelectorAll("[part='drags']")||[]),c=this.shadowRoot?Array.from(this.shadowRoot.querySelectorAll("[part='drags']")||[]):[];return a.concat(c)}activateDroppables(a){this.getDragContainers().forEach(d=>{d.setAttribute("enabled",""),d.setAttribute("dropzone","move"),d.hasAttribute("disabled")&&(d.contains(a)||d.shadowRoot&&d.shadowRoot.contains(a))&&(d.removeAttribute("disabled"),d.setAttribute("dropzone","move"))}),this.droppables.forEach(d=>{d.setAttribute("enabled",""),d.hasAttribute("disabled")&&(d.contains(a)||d.shadowRoot&&d.shadowRoot.contains(a))&&(d.removeAttribute("disabled"),d.setAttribute("dropzone","move"))})}activateDragLocation(){this._internals.states.add("--dragzone-enabled")}deactivateDragLocation(){this._internals.states.delete("--dragzone-enabled")}deactivateDroppables(){this.getDragContainers().forEach(c=>{c.removeAttribute("enabled")}),this.droppables.forEach(c=>c.removeAttribute("enabled"))}async wasDropped(a){return a.dataTransfer.dropEffect!=="none"}wasMoved(a){return a.dataTransfer.dropEffect==="move"}async restoreInitialDraggablePosition(a){let{parent:c,index:d}=this.draggables.get(a),u=Math.min(d,c.children.length),m=(y,x,q)=>{let A=Math.min(q,x.children.length);x.insertBefore(y,x.children[A]),y.style.transform="translate(0, 0)",this.checkMaxAssociations()};if(!document.startViewTransition){m(a,c,d);return}let f=document.startViewTransition(()=>{a.style.transform="",m(a,c,d)})}validate(){let a=this.getValidAssociations(),c=!0,d="";this.maxAssociations>0&&a>this.maxAssociations?(c=!1,d=this.dataset.maxSelectionsMessage||`You've selected too many associations. Maximum allowed is ${this.maxAssociations}.`):this.minAssociations>0&&a<this.minAssociations&&(c=!1,d=this.dataset.minSelectionsMessage||`You haven't selected enough associations. Minimum required is ${this.minAssociations}.`);let u=this.lastElementChild;return this._internals.setValidity(c?{}:{customError:!0},d,u),this.reportValidity(),c}reportValidity(){let a=this.shadowRoot.querySelector("#validationMessage");return a&&(this._internals.validity.valid?(a.textContent="",a.style.display="none"):(a.textContent=this._internals.validationMessage,a.style.display="block")),this._internals.validity.valid}checkMaxAssociations(){this.droppables.forEach((a,c)=>{let d=+(a.getAttribute("match-max")||1);a.querySelectorAll('[qti-draggable="true"]').length>=d?this.disableDroppable(a):this.enableDroppable(a)})}disableDroppable(a){a.setAttribute("disabled",""),a.removeAttribute("dropzone")}enableDroppable(a){a.removeAttribute("disabled"),a.setAttribute("dropzone","move")}get value(){return this.collectResponseData()}set value(a){if(!this.isMatchTabular())if(this.resetDroppables(),a?.forEach(c=>this.placeResponse(c)),Array.isArray(a)){let c=new FormData;a.forEach(d=>{c.append(this.responseIdentifier,d)}),this._internals.setFormValue(c)}else this._internals.setFormValue(a)}placeResponse(a){let[c,...d]=a.split(" ").reverse(),u=this.findDroppableById(c);d.forEach(m=>this.placeDraggableInDroppable(m,u))}findDroppableById(a){return this.droppables.find(c=>c.getAttribute("identifier")===a)}async placeDraggableInDroppable(a,c){let d=this.querySelector(`[identifier=${a}]`);if(!c||!d){console.error(`Cannot find draggable or droppable with the given identifier: ${a}`);return}let u=()=>{d.style.transform="translate(0, 0)",c.appendChild(d),this.checkMaxAssociations()};document.startViewTransition?await document.startViewTransition(u).finished:u()}getValidAssociations(){return this.droppables.filter(a=>a.childElementCount>0).length}saveResponse(){this.validate();let a=this.collectResponseData();this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:a}}))}collectResponseData(){return this.droppables.map(c=>{let d=c.querySelectorAll('[qti-draggable="true"]'),u=Array.from(d).map(f=>f.getAttribute("identifier")),m=c.getAttribute("identifier");return u.map(f=>`${f} ${m}`)}).flat()}reset(a=!0){this.resetDroppables(),a&&this.saveResponse()}async resetDroppables(){let a=(d,u,m)=>{d.style.transform="translate(0, 0)";let f=Math.min(m,u.children.length);u.insertBefore(d,u.children[f])};if(!document.startViewTransition){this.draggables.forEach(({parent:d,index:u},m)=>{a(m,d,u)});return}await document.startViewTransition(()=>{this.draggables.forEach(({parent:d,index:u},m)=>{a(m,d,u)})}).finished}}return l([p({attribute:!1,type:Object})],i.prototype,"configuration",2),l([p({type:Number,reflect:!0,attribute:"min-associations"})],i.prototype,"minAssociations",2),l([p({type:Number,reflect:!0,attribute:"max-associations"})],i.prototype,"maxAssociations",2),l([is(e)],i.prototype,"handleDraggablesChange",1),i};var Os=b`
3757
- :host {
3758
- display: block; /* necessary to calculate scaling position */
3759
- }
3760
- slot[name='qti-simple-associable-choice'] {
3761
- display: flex;
3762
- flex-wrap: wrap;
3763
- gap: 0.5rem;
3764
- }
3765
-
3766
- :host::part(associables-container) {
3767
- display: flex;
3768
- justify-content: space-between;
3769
- background: linear-gradient(
3770
- 180deg,
3771
- rgb(0 0 0 / 0%) calc(50% - 1px),
3772
- var(--qti-border-color-gray) calc(50%),
3773
- rgb(0 0 0 / 0%) calc(50% + 1px)
3774
- );
3775
- }
3776
- `;var Nt=class extends st(C,"qti-simple-associable-choice",!0,".dl"){constructor(){super();this._childrenMap=[];this._registerChoiceHandler=this._registerChoice.bind(this),this.addEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}_registerChoice(t){let r=t.target;this._childrenMap.push(r)}render(){return h` <slot name="prompt"></slot>
3777
- <slot name="qti-simple-associable-choice"></slot>
3778
- <div part="drop-container">
3779
- ${this._childrenMap.length>0&&Array.from(Array(Math.ceil(this._childrenMap.length/2)).keys()).map((t,r)=>h`<div part="associables-container">
3780
- <div name="left${r}" part="drop-list" class="dl" identifier="droplist${r}_left"></div>
3781
- <div name="right${r}" part="drop-list" class="dl" identifier="droplist${r}_right"></div>
3782
- </div>
3783
- <div role="alert" id="validationMessage"></div>`)}
3784
- </div>`}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("register-qti-simple-associable-choice",this._registerChoiceHandler)}};Nt.styles=Os,l([w()],Nt.prototype,"_childrenMap",2),Nt=l([g("qti-associate-interaction")],Nt);var ot=class extends C{constructor(){super();this._errorMessage=null;this.handlePostMessage=this.handlePostMessage.bind(this)}connectedCallback(){super.connectedCallback();let t=this.data.startsWith("http")?this.data:We(this.baseItemUrl+"/"+this.data);fetch(t).then(r=>r.json()).then(r=>{this.manifest=r,this.setupCES()}).catch(r=>{this._errorMessage=r})}setupCES(){let t=this.shadowRoot.querySelector("#pciContainer"),r=t.contentDocument;window.addEventListener("message",this.handlePostMessage),r.open(),r.write(`
3785
- <html>
3786
- <head>
3787
- <link href='${We(`${this.baseRefUrl}/${this.manifest.style[0]}`)}' rel="stylesheet" />
3788
- <script src='${We(`${this.baseRefUrl}/${this.manifest.script[0]}`)}'></script>
3789
- </head>
3790
- <body></body>
3791
- </html>
3792
- `),r.close()}getIFrames(){let t=this.shadowRoot.querySelectorAll("iframe"),r=this.querySelectorAll("iframe"),i=[...t,...r];for(let o of i){let n=o.src;if(new URL(n,window.location.href).origin===window.location.origin)try{let c=o.contentDocument||o.contentWindow.document;c&&this.getInnerIFrames(c,i)}catch(c){console.error("Error accessing nested iframe:",c)}}return i.forEach((o,n)=>{i.indexOf(o)!==n&&i.splice(n,1)}),i}getInnerIFrames(t,r=[]){return t.querySelectorAll("iframe").forEach(o=>{r.push(o);let n=o.src;if(new URL(n,window.location.href).origin===window.location.origin)try{let c=o.contentDocument||o.contentWindow.document;this.getInnerIFrames(c,r)}catch(c){console.error("Error accessing nested iframe:",c)}else console.warn("Skipped cross-origin iframe:",n)}),r}postToWindowAndIframes(t,r){window.postMessage({type:t,data:r},"*");let i=this.getIFrames();for(let o of i)o.contentWindow&&o.contentWindow.postMessage({type:t,data:r},"*")}handlePostMessage(t){let{type:r,data:i}=t.data;switch(r){case"setResponse":this.rawResponse=i,this.saveResponse(i);break;case"getResponse":{this.postToWindowAndIframes("responseData",this.rawResponse);break}case"getMedia":{let o=this.manifest.media.map(n=>n.startsWith("http")?n:We(this.baseRefUrl+"/"+n));this.postToWindowAndIframes("mediaData",o);break}case"setStageHeight":console.log("setStageHeight not implemented");break}}validate(){return this.rawResponse!==""}get value(){return this.rawResponse}set value(t){if(typeof t=="string")this.rawResponse=t,this.saveResponse(t);else throw new Error("Value must be a string")}disconnectedCallback(){window.removeEventListener("message",this.handlePostMessage),super.disconnectedCallback()}render(){return h`<iframe
3793
- width=${this.getAttribute("width")}
3794
- height=${this.getAttribute("height")}
3795
- frameborder="0"
3796
- title="pciContainer"
3797
- id="pciContainer"
3798
- >
3799
- </iframe>
3800
- ${this._errorMessage&&h`<div style="color:red">
3801
- <h1>Error</h1>
3802
- ${this._errorMessage}
3803
- </div>`}`}};l([p({type:String,attribute:"data"})],ot.prototype,"data",2),l([p({type:String,attribute:"data-base-item"})],ot.prototype,"baseItemUrl",2),l([p({type:String,attribute:"data-base-ref"})],ot.prototype,"baseRefUrl",2),l([p({type:String,attribute:"id"})],ot.prototype,"id",2),l([w()],ot.prototype,"_errorMessage",2),ot=l([g("qti-custom-interaction")],ot);var Pt=class extends C{constructor(){super(...arguments);this.countAttempt="true"}validate(){return!0}get value(){return""}set value(t){}render(){return h`<button ?disabled=${this.disabled} part="button" @click=${this.endAttempt}>${this.title}</button>`}endAttempt(t){this.dispatchEvent(new CustomEvent("end-attempt",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,countAttempt:this.countAttempt==="true"}}))}};l([p({type:String,attribute:"count-attempt"})],Pt.prototype,"countAttempt",2),l([p({type:String})],Pt.prototype,"title",2),Pt=l([g("qti-end-attempt-interaction")],Pt);var Hs=b`
3804
- :host {
3805
- display: flex;
3806
- align-items: flex-start;
3807
- flex-direction: column;
3808
- flex-wrap: wrap;
3809
- gap: 0.5rem;
3810
- }
3811
-
3812
- :host(.qti-choices-top) {
3813
- flex-direction: column;
3814
- }
3815
- :host(.qti-choices-bottom) {
3816
- flex-direction: column-reverse;
3817
- }
3818
- :host(.qti-choices-left) {
3819
- flex-direction: row;
3820
- }
3821
- :host(.qti-choices-right) {
3822
- flex-direction: row-reverse;
3823
- }
3824
- /* [part='drops'] , */
3825
- [name='prompt'] {
3826
- width: 100%;
3827
- }
3828
- [name='drags'] {
3829
- display: flex;
3830
- align-items: flex-start;
3831
- flex: 1;
3832
- border: 2px solid transparent;
3833
- padding: 0.3rem;
3834
- border-radius: 0.3rem;
3835
- gap: 0.5rem;
3836
- }
3837
- `;var ue=class extends st(C,"qti-gap-text",!1,"qti-gap"){constructor(){super(...arguments);this.observer=null;this.resizeObserver=null}render(){return h`<slot name="prompt"> </slot>
3838
- <slot part="drags" name="drags"></slot>
3839
- <slot part="drops"></slot>
3840
- <div role="alert" id="validationMessage"></div>`}firstUpdated(t){super.firstUpdated(t),this.updateMinDimensionsForDrowZones(),this.observer=new MutationObserver(()=>this.updateMinDimensionsForDrowZones()),this.observer.observe(this,{childList:!0,subtree:!0}),this.resizeObserver=new ResizeObserver(()=>this.updateMinDimensionsForDrowZones()),this.querySelectorAll("qti-gap-text").forEach(i=>this.resizeObserver?.observe(i))}disconnectedCallback(){super.disconnectedCallback(),this.observer&&(this.observer.disconnect(),this.observer=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}updateMinDimensionsForDrowZones(){let t=this.querySelectorAll("qti-gap-text"),r=this.querySelectorAll("qti-gap"),i=0,o=0;t.forEach(a=>{let c=a.getBoundingClientRect();i=Math.max(i,c.height),o=Math.max(o,c.width)});let n=this.shadowRoot?.querySelector('[part="drags"]');n&&(n.style.minHeight=`${i}px`,n.style.minWidth=`${o}px`);for(let a of r)a.style.minHeight=`${i}px`,a.style.minWidth=`${o}px`}set correctResponse(t){let r=[],i=Array.isArray(t)?t:[t];i&&(r=i.map(n=>{let a=n.split(" ");return{text:a[0],gap:a[1]}})),this.querySelectorAll("qti-gap").forEach(n=>{let a=n.getAttribute("identifier"),c=r.find(u=>u.gap===a)?.text,d=this.querySelector(`qti-gap-text[identifier="${c}"]`)?.textContent.trim();if(c&&d){if(!n.nextElementSibling?.classList.contains("correct-option")){let u=document.createElement("span");u.classList.add("correct-option"),u.textContent=d,n.insertAdjacentElement("afterend",u)}}else n.nextElementSibling?.classList.contains("correct-option")&&n.nextElementSibling.remove()})}};ue.styles=Hs,ue=l([g("qti-gap-match-interaction")],ue);var Vs=(s,e,t)=>{let r=new Map;for(let i=e;i<=t;i++)r.set(s[i],i);return r},Jr=X(class extends et{constructor(s){if(super(s),s.type!==vt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);let i=[],o=[],n=0;for(let a of s)i[n]=r?r(a,n):n,o[n]=t(a,n),n++;return{values:o,keys:i}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,r]){let i=cs(s),{values:o,keys:n}=this.dt(e,t,r);if(!Array.isArray(i))return this.ut=n,o;let a=this.ut??(this.ut=[]),c=[],d,u,m=0,f=i.length-1,y=0,x=o.length-1;for(;m<=f&&y<=x;)if(i[m]===null)m++;else if(i[f]===null)f--;else if(a[m]===n[y])c[y]=bt(i[m],o[y]),m++,y++;else if(a[f]===n[x])c[x]=bt(i[f],o[x]),f--,x--;else if(a[m]===n[x])c[x]=bt(i[m],o[x]),ie(s,c[x+1],i[m]),m++,x--;else if(a[f]===n[y])c[y]=bt(i[f],o[y]),ie(s,i[m],i[f]),f--,y++;else if(d===void 0&&(d=Vs(n,y,x),u=Vs(a,m,f)),d.has(a[m]))if(d.has(a[f])){let q=u.get(n[y]),A=q!==void 0?i[q]:null;if(A===null){let N=ie(s,i[m]);bt(N,o[y]),c[y]=N}else c[y]=bt(A,o[y]),ie(s,i[m],A),i[q]=null;y++}else vr(i[f]),f--;else vr(i[m]),m++;for(;y<=x;){let q=ie(s,c[x+1]);bt(q,o[y]),c[y++]=q}for(;m<=f;){let q=i[m++];q!==null&&vr(q)}return this.ut=n,ls(s,c),R}});function me(s,e,t,r){switch(s){case"circle":{let[i,o,n]=e,a=i/t.width*100,c=o/t.height*100,d=n/t.width*100;r.style.left=a-d+"%",r.style.top=c-d+"%",r.style.width=r.style.height=4*d+"px",r.style.borderRadius="9999px"}break;case"rect":{let[i,o,n,a]=e,c=i/t.width*100,d=o/t.height*100,u=n/t.width*100,m=a/t.height*100;r.style.left=c+"%",r.style.top=d+"%",r.style.width=u-c+"%",r.style.height=m-d+"%"}break;case"poly":{let i=e.reduce((q,A,N,Ce)=>{if(N%2===1){let ut=q.pop();q[q.length]={x:ut,y:Ce[N]}}else q.push(A);return q},[]),o=Math.min(...i.map(q=>q.x)),n=Math.max(...i.map(q=>q.x)),a=Math.min(...i.map(q=>q.y)),c=Math.max(...i.map(q=>q.y)),d=o/t.width*100,u=a/t.height*100,m=n/t.width*100,f=c/t.height*100;r.style.left=o/t.width*100+"%",r.style.top=a/t.height*100+"%",r.style.width=m-d+"%",r.style.height=f-u+"%";let x=i.map(q=>({x:(q.x-o)/(n-o)*100,y:(q.y-a)/(c-a)*100})).map(q=>Math.round(q.x)+"% "+Math.round(q.y)+"%").join(",");r.style.clipPath=`polygon(${x})`}break;default:break}}var Q=class extends C{constructor(){super();this.startPoint=null;this.endPoint=null;this._lines=[];this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}reset(){this._lines=[]}validate(){return this._lines.length>0}set value(t){Array.isArray(t)&&(this._lines=t)}get value(){return this._lines}render(){return h`<slot name="prompt"></slot>
3841
- <line-container>
3842
- <svg
3843
- width=${xt(this.grImage[0]?.width)}
3844
- height=${xt(this.grImage[0]?.height)}
3845
- viewbox="0 0 ${this.grImage[0]?.width} ${this.grImage[0]?.height}"
3846
- >
3847
- ${Jr(this._lines,t=>t,(t,r)=>ai`
3848
- <line
3849
- part="line"
3850
- x1=${parseInt(this.querySelector("[identifier="+t.split(" ")[0]+"]").style.left)}
3851
- y1=${parseInt(this.querySelector("[identifier="+t.split(" ")[0]+"]").style.top)}
3852
- x2=${parseInt(this.querySelector("[identifier="+t.split(" ")[1]+"]").style.left)}
3853
- y2=${parseInt(this.querySelector("[identifier="+t.split(" ")[1]+"]").style.top)}
3854
- stroke="red"
3855
- stroke-width="3"
3856
- @click=${i=>{i.stopPropagation(),this._lines=this._lines.filter((o,n)=>n!==r),this.saveResponse(this._lines)}}
3857
- />
3858
- `)}
3859
- ${this.startPoint&&ai`<line
3860
- part="point"
3861
- x1=${this.startCoord.x}
3862
- y1=${this.startCoord.y}
3863
- x2=${this.mouseCoord.x}
3864
- y2=${this.mouseCoord.y}
3865
- stroke="red"
3866
- stroke-width="3"
3867
- />`}
3868
- </svg>
3869
- <slot></slot>
3870
- </line-container>
3871
- <div role="alert" id="validationMessage"></div>`}positionHotspotOnRegister(t){let r=this.querySelector("img"),i=t.target,o=i.getAttribute("coords"),n=i.getAttribute("shape"),a=o.split(",").map(c=>parseInt(c));me(n,a,r,i)}firstUpdated(t){super.firstUpdated(t),this.hotspots=this.querySelectorAll("qti-associable-hotspot"),document.addEventListener("mousemove",r=>{this.mouseCoord={x:r.clientX-this.grImage[0].getBoundingClientRect().left,y:r.clientY-this.grImage[0].getBoundingClientRect().top}}),this.hotspots.forEach(r=>{r.style.left=r.getAttribute("coords").split(",")[0]+"px",r.style.top=r.getAttribute("coords").split(",")[1]+"px",r.addEventListener("click",i=>{this.startPoint?this.endPoint||(this.endPoint=i.target,this._lines=[...this._lines,this.startPoint.getAttribute("identifier")+" "+this.endPoint.getAttribute("identifier")],this.saveResponse(this._lines),this.startPoint=null,this.endPoint=null):(this.startPoint=i.target,this.startCoord={x:this.startPoint.getAttribute("coords").split(",")[0],y:this.startPoint.getAttribute("coords").split(",")[1]})})})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};Q.styles=[b`
3872
- slot:not([name='prompt']) {
3873
- // position: relative; /* qti-hotspot-choice relative to the slot */
3874
- display: block;
3875
- width: fit-content; /* hotspots not stretching further if image is at max size */
3876
- }
3877
- ::slotted(img) {
3878
- /* image not selectable anymore */
3879
- pointer-events: none;
3880
- user-select: none;
3881
- }
3882
- ::slotted(qti-associable-hotspot) {
3883
- transform: translate(-50%, -50%);
3884
- }
3885
- line-container {
3886
- display: block;
3887
- position: relative;
3888
- }
3889
- svg {
3890
- position: absolute;
3891
- top: 0px;
3892
- left: 0px;
3893
- }
3894
- `],l([w()],Q.prototype,"_lines",2),l([w()],Q.prototype,"startCoord",2),l([w()],Q.prototype,"mouseCoord",2),l([Yt("svg")],Q.prototype,"svgContainer",2),l([Fi({selector:"img"})],Q.prototype,"grImage",2),Q=l([g("qti-graphic-associate-interaction")],Q);var zs=b`
3895
- :host {
3896
- display: flex;
3897
- align-items: flex-start;
3898
- flex-direction: column;
3899
- flex-wrap: wrap;
3900
- gap: 0.5rem;
3901
- }
3902
-
3903
- :host(.qti-choices-top) {
3904
- flex-direction: column-reverse;
3905
- }
3906
- :host(.qti-choices-bottom) {
3907
- flex-direction: column;
3908
- }
3909
- :host(.qti-choices-left) {
3910
- flex-direction: row-reverse;
3911
- & [name='drags'] {
3912
- width: 25%;
3913
- }
3914
- & [part='image'] {
3915
- width: 75%;
3916
- }
3917
- }
3918
- :host(.qti-choices-right) {
3919
- flex-direction: row;
3920
- & [name='drags'] {
3921
- width: 25%;
3922
- }
3923
- & [part='image'] {
3924
- width: 75%;
3925
- }
3926
- }
3927
- [part='image'] {
3928
- display: block;
3929
- position: relative;
3930
- }
3931
- /* [part='drops'] , */
3932
-
3933
- [name='drags'] {
3934
- display: flex;
3935
- align-items: flex-start;
3936
- flex-wrap: wrap;
3937
- flex: 1;
3938
- border: 2px solid transparent;
3939
- padding: 0.3rem;
3940
- border-radius: 0.3rem;
3941
- gap: 0.5rem;
3942
- }
3943
- ::slotted(img) {
3944
- display: inline-block;
3945
- user-select: none;
3946
- pointer-events: none;
3947
- }
3948
- `;var ge=class extends st(C,"qti-gap-img, qti-gap-text",!1,"qti-associable-hotspot"){constructor(){super(...arguments);this.observer=null;this.resizeObserver=null}render(){return h` <slot name="prompt"></slot>
3949
- <slot part="image"></slot>
3950
- <slot part="drags" name="drags"></slot>
3951
- <div role="alert" id="validationMessage"></div>`}firstUpdated(t){super.firstUpdated(t),this.updateMinDimensionsForDrowZones(),this.observer=new MutationObserver(()=>this.updateMinDimensionsForDrowZones()),this.observer.observe(this,{childList:!0,subtree:!0}),this.resizeObserver=new ResizeObserver(()=>this.updateMinDimensionsForDrowZones()),this.querySelectorAll("qti-gap-img, qti-gap-text").forEach(i=>this.resizeObserver?.observe(i))}updateMinDimensionsForDrowZones(){let t=this.querySelectorAll("qti-gap-img, qti-gap-text"),r=this.querySelectorAll("qti-associable-hotspot"),i=0,o=0;t.forEach(c=>{let d=c.getBoundingClientRect();i=Math.max(i,d.height),o=Math.max(o,d.width)});let n=this.shadowRoot.querySelectorAll("slot"),a=Array.from(n).find(c=>c.name==="drags");a&&(a.style.minHeight=`${i}px`,a.style.minWidth=`${o}px`);for(let c of r)c.style.minHeight=`${i}px`,c.style.minWidth=`${o}px`}positionHotspotOnRegister(t){let r=t.target,i=r.getAttribute("coords"),o=r.getAttribute("shape"),n=i.split(",").map(a=>parseInt(a));switch(o){case"circle":{let[a,c,d]=n;r.style.left=a-d+"px",r.style.top=c-d+"px",r.style.width=r.style.height=2*d+"px"}break;case"rect":{let[a,c,d,u]=n;r.style.left=a+"px",r.style.top=c+"px",r.style.width=d-a+"px",r.style.height=u-c+"px"}break;default:break}}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-register-hotspot",this.positionHotspotOnRegister)}};ge.styles=zs,ge=l([g("qti-graphic-gap-match-interaction")],ge);var fe=class extends qt(C,"qti-hotspot-choice"){constructor(){super(...arguments);this._choiceElements=[]}render(){return h`
3952
- <slot name="prompt"></slot>
3953
- <!-- slot for the prompt -->
3954
- <slot></slot>
3955
- <!-- slot for the image and hotspots -->
3956
- <div role="alert" id="validationMessage"></div>
3957
- `}setHotspotOrder(t){let{identifier:r}=t.detail,i=this._choiceElements.find(n=>n.getAttribute("identifier")===r),o=this._choiceElements.length;if(!this.choiceOrdering){if(this.choiceOrdering=!0,i.order==null){if(this._choiceElements.filter(n=>n.order>0).length>=o){this.choiceOrdering=!1;return}i.order=this._choiceElements.filter(n=>!!n.order).length+1,this.choiceOrdering=!1;return}else this._choiceElements.forEach(n=>(n.order>n.order&&n.order--,n)),i.order=null;this.choiceOrdering=!1}}positionHotspotOnRegister(t){let r=this.querySelector("img"),i=t.target,o=i.getAttribute("coords"),n=i.getAttribute("shape"),a=o.split(",").map(c=>parseInt(c));me(n,a,r,i)}connectedCallback(){super.connectedCallback(),this.addEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("activate-qti-hotspot-choice",this.setHotspotOrder),this.removeEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}};fe.styles=[b`
3958
- slot:not([name='prompt']) {
3959
- position: relative; /* qti-hotspot-choice relative to the slot */
3960
- display: block;
3961
- width: fit-content; /* hotspots not stretching further if image is at max size */
3962
- }
3963
- ::slotted(img) {
3964
- /* image not selectable anymore */
3965
- pointer-events: none;
3966
- user-select: none;
3967
- }
3968
- `],fe=l([g("qti-graphic-order-interaction")],fe);var be=class extends qt(C,"qti-hotspot-choice"){render(){return h`
3969
- <slot name="prompt"></slot>
3970
- <!-- slot for the prompt -->
3971
- <slot></slot>
3972
- <!-- slot for the image and hotspots -->
3973
- `}positionHotspotOnRegister(e){let t=this.querySelector("img"),r=e.target,i=r.getAttribute("coords"),o=r.getAttribute("shape"),n=i.split(",").map(a=>parseInt(a));me(o,n,t,r)}connectedCallback(){super.connectedCallback(),this.addEventListener("register-qti-hotspot-choice",this.positionHotspotOnRegister)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("unregister-qti-hotspot-choice",this.positionHotspotOnRegister)}};be.styles=[b`
3974
- slot:not([name='prompt']) {
3975
- position: relative; /* qti-hotspot-choice relative to the slot */
3976
- display: block;
3977
- width: fit-content; /* hotspots not stretching further if image is at max size */
3978
- }
3979
- ::slotted(img) {
3980
- /* image not selectable anymore */
3981
- pointer-events: none;
3982
- user-select: none;
3983
- /* width:100%; */
3984
- }
3985
- `],be=l([g("qti-hotspot-interaction")],be);var dt=class extends Y(v,"qti-simple-associable-choice"){constructor(){super(...arguments);this.matchMin=0;this.matchMax=1;this.fixed=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}render(){return h`
3986
- <slot part="slot"></slot>
3987
- <slot part="dropslot" name="qti-simple-associable-choice"></slot>
3988
- `}};dt.styles=b`
3989
- :host {
3990
- display: flex;
3991
- user-select: none;
3992
- }
3993
- slot {
3994
- width: 100%;
3995
- display: block;
3996
- }
3997
- slot[name='qti-simple-associable-choice'] {
3998
- width: 100%;
3999
- }
4000
- `,l([p({type:Number,attribute:"match-min"})],dt.prototype,"matchMin",2),l([p({type:Number,attribute:"match-max"})],dt.prototype,"matchMax",2),l([p({type:Boolean,attribute:"fixed"})],dt.prototype,"fixed",2),dt=l([g("qti-simple-associable-choice")],dt);var Us=b`
4001
- slot {
4002
- /* slot where the */
4003
- display: flex;
4004
- flex-direction: column;
4005
- gap: 0.5rem;
4006
- align-items: flex-start; /* prevents the drag and drop container slots having the same height */
4007
- }
4008
- :host(.qti-choices-top) slot {
4009
- flex-direction: column;
4010
- }
4011
- :host(.qti-choices-bottom) slot {
4012
- flex-direction: column-reverse;
4013
- }
4014
- :host(.qti-choices-left) slot {
4015
- flex-direction: row;
4016
- }
4017
- :host(.qti-choices-right) slot {
4018
- flex-direction: row-reverse;
4019
- }
4020
- slot[name='prompt'] {
4021
- display: block;
4022
- }
4023
- ::slotted(qti-simple-match-set) {
4024
- /* Make sure the drag and drop container slots have the same width */
4025
- flex: 1;
4026
- }
4027
- `;var pt=class extends st(C,"qti-simple-match-set:first-of-type qti-simple-associable-choice",!1,"qti-simple-match-set:last-of-type qti-simple-associable-choice"){constructor(){super(...arguments);this.lastCheckedRadio=null;this._response=[];this.correctOptions=[];this.responseIdentifier="";this.handleRadioClick=t=>{let r=t.target;this.lastCheckedRadio===r?(r.checked=!1,this.lastCheckedRadio=null,this.handleRadioChange(t)):this.lastCheckedRadio=r};this.handleRadioChange=t=>{let r=t.target,i=r.value,o=r.name,n=r.type;r.checked?(this.value?this.value.indexOf(i)===-1&&(n==="radio"&&(this.value=this.value.filter(a=>a.indexOf(o)===-1)),this.value=[...this.value,i]):this.value=[i],this.lastCheckedRadio=r):(this.value=this.value.filter(a=>a!==i),this.lastCheckedRadio=null),this.requestUpdate(),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(this.value)?[...this.value]:this.value}}))}}get value(){return this.classList.contains("qti-match-tabular")?this._response:super.value}set value(t){this.classList.contains("qti-match-tabular")?this._response=t:super.value=t}async connectedCallback(){super.connectedCallback(),this.rows=Array.from(this.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),this.cols=Array.from(this.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),this.value=[]}set correctResponse(t){if(t===""){this.correctOptions=[];return}else Array.isArray(t)&&(this.correctOptions=t)}render(){return this.classList.contains("qti-match-tabular")?h`
4028
- <slot name="prompt"></slot>
4029
- <table>
4030
- <tr>
4031
- <td></td>
4032
- ${this.cols.map(t=>h`<th part="r-header">${wt(t.innerHTML)}</th>`)}
4033
- </tr>
4034
-
4035
- ${this.rows.map(t=>h`<tr>
4036
- <td part="c-header">${wt(t.innerHTML)}</td>
4037
- ${this.cols.map(r=>{let i=t.getAttribute("identifier"),o=r.getAttribute("identifier"),n=`${i} ${o}`,a=this.value.filter(m=>m.split(" ")[0]===i).length||0,c=this.value.includes(n),d=`rb ${c?"rb-checked":""} ${this.correctOptions.includes(n)?"rb-correct":""}`,u=this.correctOptions.length>0?!0:t.matchMax===1?!1:a>=t.matchMax&&!c;return h`<td>
4038
- <input
4039
- type=${t.matchMax===1?"radio":"checkbox"}
4040
- part=${d}
4041
- name=${i}
4042
- value=${n}
4043
- .disabled=${u}
4044
- @change=${m=>this.handleRadioChange(m)}
4045
- @click=${m=>t.matchMax===1?this.handleRadioClick(m):null}
4046
- />
4047
- </td>`})}
4048
- </tr>`)}
4049
- </table>
4050
- `:h`<slot name="prompt"></slot> <slot></slot>
4051
- <div role="alert" id="validationMessage"></div>`}};pt.styles=Us,l([w()],pt.prototype,"_response",2),l([w()],pt.prototype,"correctOptions",2),l([p({type:String,attribute:"response-identifier"})],pt.prototype,"responseIdentifier",2),pt=l([g("qti-match-interaction")],pt);var ve=class extends C{constructor(){super();this._value=0}reset(){}validate(){return!0}get value(){return this._value.toString()}set value(t){if(!isNaN(parseInt(t.toString())))this._value=parseInt(t.toString());else throw new Error("Value must be a number")}static get properties(){return{...C.properties,step:{type:Number,attribute:"step",default:10}}}render(){return h` <slot name="prompt"></slot>
4052
- <slot></slot>`}connectedCallback(){super.connectedCallback();let t=this.querySelector("audio")||this.querySelector("video")||this.querySelector("object");t&&t.addEventListener("ended",()=>{this._value++,this.saveResponse(this.value)})}};ve.styles=[b``],ve=l([g("qti-media-interaction")],ve);var nt=class extends Ar(st(C,"qti-simple-choice",!0,"drop-list"),"qti-simple-choice"){constructor(){super(...arguments);this.nrChoices=0;this.correctResponses=[];this.showCorrectResponses=!1}render(){let t=Array.from(this.querySelectorAll("qti-simple-choice"));return this.nrChoices<t.length&&(this.nrChoices=t.length),h` <slot name="prompt"> </slot>
4053
- <div part="container">
4054
- <slot part="drags"> </slot>
4055
- <div part="drops">
4056
- ${Array.from(Array(this.nrChoices)).map((r,i)=>h`<drop-list part="drop-list" identifier="droplist${i}"></drop-list>${this.showCorrectResponses&&this.correctResponses.length>i?wt(`<span part='correct-response'>${this.correctResponses[i]}</span>`):""}`)}
4057
- </div>
4058
- </div>`}set correctResponse(t){if(t===""){this.showCorrectResponses=!1;return}this.correctResponses.length===0&&(Array.isArray(t)?t:[t]).forEach(i=>{let o=this.querySelector(`qti-simple-choice[identifier="${i}"]`);o||(o=this.shadowRoot.querySelector(`qti-simple-choice[identifier="${i}"]`));let n=o?.textContent.trim();this.correctResponses=[...this.correctResponses,n]}),this.showCorrectResponses=!0}getResponse(){return Array.from(this.shadowRoot.querySelectorAll("drop-list")).map(i=>{let o=i.querySelectorAll('[qti-draggable="true"]');return[...Array.from(o).map(a=>a.getAttribute("identifier"))].join(" ")})}async firstUpdated(t){super.firstUpdated(t),this.childrenMap=Array.from(this.querySelectorAll("qti-simple-choice")),this.childrenMap.forEach(r=>r.setAttribute("part","qti-simple-choice"))}};nt.styles=[b`
4059
- [part='drags'] {
4060
- display: flex;
4061
- align-items: flex-start;
4062
- flex: 1;
4063
- }
4064
-
4065
- [part='drops'] {
4066
- flex: 1;
4067
- display: grid;
4068
- grid-auto-flow: column;
4069
- grid-auto-columns: 1fr;
4070
- }
4071
-
4072
- :host([orientation='horizontal']) [part='drags'] {
4073
- flex-direction: row;
4074
- }
4075
- :host([orientation='horizontal']) [part='drops'] {
4076
- grid-auto-flow: column;
4077
- }
4078
- :host([orientation='vertical']) [part='drags'] {
4079
- flex-direction: column;
4080
- }
4081
- :host([orientation='vertical']) [part='drops'] {
4082
- grid-auto-flow: row;
4083
- }
4084
-
4085
- [part='drop-list'] {
4086
- display: block;
4087
- flex: 1;
4088
- }
4089
-
4090
- [part='container'] {
4091
- display: flex;
4092
- gap: 0.5rem;
4093
- }
4094
- :host(.qti-choices-top) [part='container'] {
4095
- flex-direction: column;
4096
- }
4097
- :host(.qti-choices-bottom) [part='container'] {
4098
- flex-direction: column-reverse;
4099
- }
4100
- :host(.qti-choices-left) [part='container'] {
4101
- flex-direction: row;
4102
- }
4103
- :host(.qti-choices-right) [part='container'] {
4104
- flex-direction: row-reverse;
4105
- }
4106
- `],l([w()],nt.prototype,"nrChoices",2),l([w()],nt.prototype,"correctResponses",2),l([w()],nt.prototype,"showCorrectResponses",2),l([p({type:String})],nt.prototype,"orientation",2),nt=l([g("qti-order-interaction")],nt);var ir=class extends v{render(){return h`<slot></slot>`}};ir.styles=[b`
4107
- :host {
4108
- display: block;
4109
- }
4110
- ::slotted(img) {
4111
- position: absolute;
4112
- cursor: move;
4113
- user-select: none;
4114
- left: 50%;
4115
- transform: translateX(-50%);
4116
- }
4117
- `];customElements.define("qti-position-object-interaction",ir);var ye=class extends v{render(){return h`<slot></slot>`}constructor(){super(),this.removeMoveListener=this.removeMoveListener.bind(this),this.dragElementHandler=this.dragElementHandler.bind(this)}dragElementHandler(e){e.preventDefault();let t=e.clientX-this.startX,r=e.clientY-this.startY;this.dragElement.style.left=this.dragElement.offsetLeft+t+"px",this.dragElement.style.top=this.dragElement.offsetTop+r+"px",this.startX=e.clientX,this.startY=e.clientY}firstUpdated(e){super.firstUpdated(e),this.dragElement=this.querySelector("qti-position-object-interaction>img"),this.startX=0,this.startY=0,this.dragElement.addEventListener("mousedown",t=>{this.startX=t.clientX,this.startY=t.clientY,document.addEventListener("mousemove",this.dragElementHandler,!0)}),document.addEventListener("mouseup",this.removeMoveListener)}removeMoveListener(){document.removeEventListener("mousemove",this.dragElementHandler,!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousemove",this.dragElementHandler),document.removeEventListener("mouseup",this.removeMoveListener)}};ye.styles=[b`
4118
- :host {
4119
- display: inline-block;
4120
- position: relative;
4121
- }
4122
- `],ye=l([g("qti-position-object-stage")],ye);var Fs="important",Uo=" !"+Fs,Bs=X(class extends et{constructor(s){if(super(s),s.type!==vt.ATTRIBUTE||s.name!=="style"||s.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((e,t)=>{let r=s[t];return r==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(s,[e]){let{style:t}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(let r of this.ft)e[r]==null&&(this.ft.delete(r),r.includes("-")?t.removeProperty(r):t[r]=null);for(let r in e){let i=e[r];if(i!=null){this.ft.add(r);let o=typeof i=="string"&&i.endsWith(Uo);r.includes("-")||o?t.setProperty(r,o?i.slice(0,-11):i,o?Fs:""):t[r]=i}}return R}});var ht=class extends C{constructor(){super(...arguments);this.maxChoices=1/0;this.minChoices=0;this._points=[];this._imgElement=null;this._onImageClick=t=>{if(this._points.length<this.maxChoices){let r=t.offsetX,i=t.offsetY;this._points=[...this._points,`${r} ${i}`],this.saveResponse(this._points)}}}render(){return h` <slot name="prompt"></slot>
4123
- <point-container>
4124
- ${Jr(this._points,t=>t,(t,r)=>h`
4125
- <button
4126
- part="point"
4127
- style=${Bs({position:"absolute",transform:"translate(-50%, -50%)",left:`${t.split(" ")[0]}px`,top:`${t.split(" ")[1]}px`})}
4128
- aria-label="Remove point at ${t}"
4129
- @click=${i=>{i.stopPropagation(),this._points=this._points.filter((o,n)=>n!==r),this.saveResponse(this._points)}}
4130
- ></button>
4131
- `)}
4132
- <slot></slot>
4133
- </point-container>`}reset(){this._points=[]}validate(){return this._points.length>=this.minChoices&&this._points.length<=this.maxChoices}set value(t){this._points=Array.isArray(t)?t:[t]}get value(){return this._points}firstUpdated(){this._imgElement=this.querySelector("img"),this._imgElement?this._imgElement.addEventListener("click",this._onImageClick):console.warn("No <img> element found in <qti-select-point-interaction>")}disconnectedCallback(){super.disconnectedCallback(),this._imgElement&&this._imgElement.removeEventListener("click",this._onImageClick)}};ht.styles=[b`
4134
- :host {
4135
- display: block;
4136
- }
4137
- point-container {
4138
- display: block;
4139
- position: relative;
4140
- }
4141
- `],l([p({type:Number,attribute:"max-choices"})],ht.prototype,"maxChoices",2),l([p({type:Number,attribute:"min-choices"})],ht.prototype,"minChoices",2),l([w()],ht.prototype,"_points",2),ht=l([g("qti-select-point-interaction")],ht);var I=class extends C{constructor(){super();this._value=0;this.stepLabel=!1;this.reverse=!1;this._handleDisabledChange=()=>{};this._handleReadonlyChange=()=>{};this.csLive=getComputedStyle(this)}set min(t){this._min=t,this._value=t,this.style.setProperty("--min",`${this._min}`)}get min(){return this._min}set max(t){this._max=t,this.style.setProperty("--max",`${this._max}`)}get max(){return this._max}set step(t){this._step=t,this.style.setProperty("--step",`${this._step}`)}get step(){return this._step}reset(){}validate(){return!0}get value(){return this._value.toString()}set value(t){if(!isNaN(parseInt(t.toString())))this._value=parseInt(t.toString());else throw new Error("Value must be a number")}set response(t){if(Array.isArray(t)){console.error("QtiSliderInteraction: response is an array, but should be a single value");return}let r=parseInt(t);if(Number.isNaN(r)){console.error("QtiSliderInteraction: response is not a number");return}this._value=r}render(){this._value<this.min&&(this._value=this.min),this._value>this.max&&(this._value=this.max);let t=(this._value-this.min)/(this.max-this.min)*100;return this.style.setProperty("--value-percentage",`${t}%`),this.setAttribute("aria-valuenow",this.value.toString()),h`<slot name="prompt"></slot>
4142
- <div id="slider" part="slider">
4143
- ${this.csLive.getPropertyValue("--show-bounds")=="true"?h`<div id="bounds" part="bounds">
4144
- <div>${this._min}</div>
4145
- <div>${this._max}</div>
4146
- </div>`:k}
4147
- ${this.csLive.getPropertyValue("--show-ticks")=="true"?h`<div id="ticks" part="ticks"></div>`:k}
4148
- <div id="rail" part="rail" @mousedown=${this._onMouseDown} @touchstart=${this._onTouchMove}>
4149
- <div id="knob" part="knob">
4150
- ${this.csLive.getPropertyValue("--show-value")=="true"?h`<div id="value" part="value">${this.value}</div>`:k}
4151
- </div>
4152
- </div>
4153
- </div>`}connectedCallback(){super.connectedCallback(),this.step=1,this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}_onTouchMove(t){let r=a=>{let{x:c}=this.getPositionFromEvent(a),d=c-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(d),a.stopPropagation()},i=()=>{document.removeEventListener("touchmove",r),document.removeEventListener("touchend",i),this.saveResponse(this.value.toString())};document.addEventListener("touchmove",r),document.addEventListener("touchend",i);let{x:o}=this.getPositionFromEvent(t),n=o-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(n),t.stopPropagation()}_onMouseDown(t){let r=n=>{let a=n.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(a),n.preventDefault(),n.stopPropagation()},i=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i),this.saveResponse(this.value.toString())};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i);let o=t.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(o),t.preventDefault(),t.stopPropagation()}calculateValue(t){let r=this.min+(this.max-this.min)*t/this._rail.getBoundingClientRect().width,i=this.min+Math.round((r-this.min)/this._step)*this._step;this._value=i}getPositionFromEvent(t){let r;if(t.type=="touchstart"||t.type=="touchmove"||t.type=="touchend"||t.type=="touchcancel"){let i=typeof t.originalEvent>"u"?t:t.originalEvent,o=i.touches[0]||i.changedTouches[0];r={x:o.pageX,y:o.pageY}}else(t.type=="mousedown"||t.type=="mouseup"||t.type=="mousemove"||t.type=="mouseover"||t.type=="mouseout"||t.type=="mouseenter"||t.type=="mouseleave")&&(r={x:t.clientX,y:t.clientY});return r}};I.styles=[b``],l([Yt("#rail")],I.prototype,"_rail",2),l([p({type:Boolean,attribute:"step-label"})],I.prototype,"stepLabel",2),l([p({type:Boolean})],I.prototype,"reverse",2),l([p({type:Number,attribute:"lower-bound"})],I.prototype,"min",1),l([p({type:Number,attribute:"upper-bound"})],I.prototype,"max",1),l([p({type:Number,attribute:"step"})],I.prototype,"step",1),l([S("disabled",{waitUntilFirstUpdate:!0})],I.prototype,"_handleDisabledChange",2),l([S("readonly",{waitUntilFirstUpdate:!0})],I.prototype,"_handleReadonlyChange",2),I=l([g("qti-slider-interaction")],I);var xe=class extends v{render(){return h`<slot @slotchange=${this.handleSlotChange}></slot>`}handleSlotChange(){let e=Array.from(this.firstElementChild?.childNodes??[]).find(t=>t.nodeType===Node.COMMENT_NODE);try{this.operatorFunction=new Function("context","fn","item",e.textContent??"")}catch(t){console.error("custom-operator contains invalid javascript code",t)}}calculate(){let e={variable:r=>this._context?.variables.find(i=>i.identifier===r)?.value??"",correct:r=>this._context?.variables.find(i=>i.identifier===r)?.correctResponse??""},t={getVariable:r=>this._context?.variables.find(i=>i.identifier===r),updateOutcomeVariable:(r,i)=>{this.dispatchEvent(new CustomEvent("qti-set-outcome-value",{bubbles:!0,composed:!0,detail:{outcomeIdentifier:r,value:i}}))},updateResponseVariable:(r,i)=>{this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:r,response:i}}))}};return this.operatorFunction(this._context,e,t)}};l([T({context:$,subscribe:!0}),w()],xe.prototype,"_context",2),xe=l([g("qti-custom-operator")],xe);var qe=class extends v{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,composed:!0,cancelable:!1}))}render(){return h` <slot name="drags"></slot> `}};qe.styles=b`
4154
- :host {
4155
- display: flex;
4156
- user-select: none;
4157
- position: absolute;
4158
- }
4159
- `,qe=l([g("qti-associable-hotspot")],qe);var Ot=class extends v{constructor(){super(...arguments);this.tabindex=0}render(){return h` <slot name="drags"></slot>`}};Ot.styles=b`
4160
- :host {
4161
- display: flex;
4162
- user-select: none;
4163
- }
4164
- `,l([p({type:Number,reflect:!0})],Ot.prototype,"tabindex",2),Ot=l([g("qti-gap")],Ot);var Ht=class extends v{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){this.setAttribute("slot","drags")}};Ht.styles=b`
4165
- :host {
4166
- display: flex;
4167
- user-select: none;
4168
- }
4169
- `,l([p({type:Number,reflect:!0})],Ht.prototype,"tabindex",2),Ht=l([g("qti-gap-img")],Ht);var Vt=class extends Y(v,"qti-gap-text"){constructor(){super(...arguments);this.tabindex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","drags")}render(){return h`<slot></slot>`}};Vt.styles=b`
4170
- :host {
4171
- display: inline-flex;
4172
- user-select: none;
4173
- }
4174
- `,l([p({type:Number,reflect:!0})],Vt.prototype,"tabindex",2),Vt=l([g("qti-gap-text")],Vt);var zt=class extends Y(v,"qti-hotspot-choice"){};zt.styles=b`
4175
- :host {
4176
- display: flex;
4177
- user-select: none;
4178
- position: absolute;
4179
- }
4180
- `,l([p({attribute:"aria-ordervalue",type:Number,reflect:!0})],zt.prototype,"order",2),zt=l([g("qti-hotspot-choice")],zt);var we=class extends Y(v,"qti-hottext"){render(){return h`<div part="ch"><div part="cha"></div></div>
4181
- <slot></slot> `}};we.styles=b`
4182
- :host {
4183
- display: flex;
4184
- user-select: none;
4185
- }
4186
- `,we=l([g("qti-hottext")],we);var Ee=class extends v{static get styles(){return[b`
4187
- :host {
4188
- display: block;
4189
- cursor: pointer;
4190
- }
4191
- `]}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onSelectInlineChoice),this.dispatchEvent(new CustomEvent("qti-inline-choice-register",{bubbles:!0,composed:!0,cancelable:!1}))}disconnectedCallback(){this.removeEventListener("click",this._onSelectInlineChoice)}render(){return h` <slot></slot> `}_onSelectInlineChoice(){this.dispatchEvent(new CustomEvent("qti-inline-choice-select",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier}}))}};l([p({type:String})],Ee.prototype,"identifier",2),Ee=l([g("qti-inline-choice")],Ee);var Ut=class extends Y(v,"qti-simple-choice"){get checked(){return this.internals.states.has("--checked")}render(){return h`<div part="ch">
4192
- <div part="cha"></div>
4193
- </div>
4194
- ${this.marker?h`<div id="label">${this.marker}</div>`:k}
4195
- <slot part="slot"></slot> `}};Ut.styles=b`
4196
- :host {
4197
- display: flex;
4198
- align-items: center;
4199
- user-select: none;
4200
- }
4201
- slot {
4202
- width: 100%;
4203
- display: flex;
4204
- align-items: center;
4205
- }
4206
- [part='ch'] {
4207
- display: flex;
4208
- flex-shrink: 0;
4209
- align-items: center;
4210
- justify-content: center;
4211
- }
4212
- `,l([p({type:String,attribute:!1})],Ut.prototype,"marker",2),Ut=l([g("qti-simple-choice")],Ut);console.log("%cC\xBFTO%cLab%c: qti-components loaded","font-weight:bold; color:green",'font-family: "PT Sans", font-weight:bold; color:green; font-size: smaller;vertical-align: sub',"font-weight:unset");function wi(s){class e extends s{createRenderRoot(){return this}get assessmentItem(){return this.renderRoot?.querySelector("qti-assessment-item")}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new CustomEvent("qti-item-connected",{bubbles:!0,composed:!0,detail:{identifier:this.identifier,href:this.href}}))}render(){return h`${this.xmlDoc}`}}return l([p({type:String,reflect:!0})],e.prototype,"identifier",2),l([p({type:String})],e.prototype,"href",2),l([p({type:Object,attribute:!1})],e.prototype,"xmlDoc",2),e}var sr=class extends wi(v){};sr=l([g("qti-item")],sr);var Fo=async s=>{let e=s.substring(0,s.lastIndexOf("/")),t=await pi().load(`${s}`).then(a=>a.assessmentTest()),r=await Jt().load(`${e}/${t.href}`).then(a=>a.htmlDoc()),i=await Jt().load(`${e}/${t.href}`).then(a=>a.items()),o=`${e}/${t.href}`,n=`${e}/${t.href.substring(0,t.href.lastIndexOf("/"))}`;return{testHTMLDoc:r,testURI:n,testURL:o,items:i,testIdentifier:t.identifier}},Bo=async s=>Rt().load(s).then(e=>e.htmlDoc().firstElementChild);0&&(module.exports={ActiveElementMixin,Interaction,QtiAnd,QtiAssessmentItem,QtiAssessmentItemRef,QtiAssessmentSection,QtiAssessmentStimulusRef,QtiAssessmentTest,QtiAssociableHotspot,QtiAssociateInteraction,QtiBaseValue,QtiChoiceInteraction,QtiCompanionMaterialsInfo,QtiConditionExpression,QtiContains,QtiContentBody,QtiCorrect,QtiCustomInteraction,QtiCustomOperator,QtiEndAttemptInteraction,QtiEqual,QtiEqualRounded,QtiExpression,QtiExtendedTextInteraction,QtiFeedbackBlock,QtiFeedbackInline,QtiGap,QtiGapImg,QtiGapMatchInteraction,QtiGapText,QtiGraphicAssociateInteraction,QtiGraphicGapMatchInteraction,QtiGraphicOrderInteraction,QtiGt,QtiGte,QtiHotspotChoice,QtiHotspotInteraction,QtiHottext,QtiHottextInteraction,QtiInlineChoice,QtiInlineChoiceInteraction,QtiIsNull,QtiItem,QtiItemBody,QtiItemMixin,QtiLookupOutcomeValue,QtiLt,QtiLte,QtiMapResponse,QtiMapping,QtiMatch,QtiMatchInteraction,QtiMediaInteraction,QtiMember,QtiModalFeedback,QtiMultiple,QtiNot,QtiOr,QtiOrderInteraction,QtiOrdered,QtiOutcomeDeclaration,QtiOutcomeProcessing,QtiOutcomeProcessingProcessor,QtiPortableCustomInteraction,QtiPositionObjectInteraction,QtiPositionObjectStage,QtiPrintedVariable,QtiProduct,QtiPrompt,QtiResponseCondition,QtiResponseDeclaration,QtiResponseElse,QtiResponseElseIf,QtiResponseIf,QtiResponseProcessing,QtiRubricBlock,QtiRule,QtiSelectPointInteraction,QtiSetOutcomeValue,QtiSetOutcomeValueRule,QtiSimpleAssociableChoice,QtiSimpleChoice,QtiSliderInteraction,QtiStringMatch,QtiStylesheet,QtiSubtract,QtiSum,QtiSumExpression,QtiTest,QtiTestPart,QtiTextEntryInteraction,QtiVariable,TestContainer,TestItemLink,TestNext,TestPagingButtonsStamp,TestPrev,TestView,getItemByUri,getManifestInfo,itemContext,itemContextVariables,qtiAndMixin,qtiSubtractMixin,qtiTransformItem,qtiTransformManifest,qtiTransformTest});
4213
- /*! Bundled license information:
4214
-
4215
- @lit/context/lib/context-request-event.js:
4216
- (**
4217
- * @license
4218
- * Copyright 2021 Google LLC
4219
- * SPDX-License-Identifier: BSD-3-Clause
4220
- *)
4221
-
4222
- @lit/context/lib/create-context.js:
4223
- (**
4224
- * @license
4225
- * Copyright 2021 Google LLC
4226
- * SPDX-License-Identifier: BSD-3-Clause
4227
- *)
4228
-
4229
- @lit/context/lib/controllers/context-consumer.js:
4230
- (**
4231
- * @license
4232
- * Copyright 2021 Google LLC
4233
- * SPDX-License-Identifier: BSD-3-Clause
4234
- *)
4235
-
4236
- @lit/context/lib/value-notifier.js:
4237
- (**
4238
- * @license
4239
- * Copyright 2021 Google LLC
4240
- * SPDX-License-Identifier: BSD-3-Clause
4241
- *)
4242
-
4243
- @lit/context/lib/controllers/context-provider.js:
4244
- (**
4245
- * @license
4246
- * Copyright 2021 Google LLC
4247
- * SPDX-License-Identifier: BSD-3-Clause
4248
- *)
4249
-
4250
- @lit/context/lib/context-root.js:
4251
- (**
4252
- * @license
4253
- * Copyright 2021 Google LLC
4254
- * SPDX-License-Identifier: BSD-3-Clause
4255
- *)
4256
-
4257
- @lit/context/lib/decorators/provide.js:
4258
- (**
4259
- * @license
4260
- * Copyright 2017 Google LLC
4261
- * SPDX-License-Identifier: BSD-3-Clause
4262
- *)
4263
-
4264
- @lit/context/lib/decorators/consume.js:
4265
- (**
4266
- * @license
4267
- * Copyright 2022 Google LLC
4268
- * SPDX-License-Identifier: BSD-3-Clause
4269
- *)
4270
-
4271
- @lit-labs/ssr-dom-shim/lib/element-internals.js:
4272
- (**
4273
- * @license
4274
- * Copyright 2023 Google LLC
4275
- * SPDX-License-Identifier: BSD-3-Clause
4276
- *)
4277
-
4278
- @lit-labs/ssr-dom-shim/index.js:
4279
- (**
4280
- * @license
4281
- * Copyright 2019 Google LLC
4282
- * SPDX-License-Identifier: BSD-3-Clause
4283
- *)
4284
-
4285
- @lit/reactive-element/node/css-tag.js:
4286
- (**
4287
- * @license
4288
- * Copyright 2019 Google LLC
4289
- * SPDX-License-Identifier: BSD-3-Clause
4290
- *)
4291
-
4292
- lit-html/node/lit-html.js:
4293
- (**
4294
- * @license
4295
- * Copyright 2017 Google LLC
4296
- * SPDX-License-Identifier: BSD-3-Clause
4297
- *)
4298
-
4299
- lit-element/lit-element.js:
4300
- (**
4301
- * @license
4302
- * Copyright 2017 Google LLC
4303
- * SPDX-License-Identifier: BSD-3-Clause
4304
- *)
4305
-
4306
- lit-html/node/is-server.js:
4307
- (**
4308
- * @license
4309
- * Copyright 2022 Google LLC
4310
- * SPDX-License-Identifier: BSD-3-Clause
4311
- *)
4312
-
4313
- @lit/reactive-element/node/decorators/custom-element.js:
4314
- (**
4315
- * @license
4316
- * Copyright 2017 Google LLC
4317
- * SPDX-License-Identifier: BSD-3-Clause
4318
- *)
4319
-
4320
- @lit/reactive-element/node/decorators/property.js:
4321
- (**
4322
- * @license
4323
- * Copyright 2017 Google LLC
4324
- * SPDX-License-Identifier: BSD-3-Clause
4325
- *)
4326
-
4327
- @lit/reactive-element/node/decorators/state.js:
4328
- (**
4329
- * @license
4330
- * Copyright 2017 Google LLC
4331
- * SPDX-License-Identifier: BSD-3-Clause
4332
- *)
4333
-
4334
- @lit/reactive-element/node/decorators/event-options.js:
4335
- (**
4336
- * @license
4337
- * Copyright 2017 Google LLC
4338
- * SPDX-License-Identifier: BSD-3-Clause
4339
- *)
4340
-
4341
- @lit/reactive-element/node/decorators/base.js:
4342
- (**
4343
- * @license
4344
- * Copyright 2017 Google LLC
4345
- * SPDX-License-Identifier: BSD-3-Clause
4346
- *)
4347
-
4348
- @lit/reactive-element/node/decorators/query.js:
4349
- (**
4350
- * @license
4351
- * Copyright 2017 Google LLC
4352
- * SPDX-License-Identifier: BSD-3-Clause
4353
- *)
4354
-
4355
- @lit/reactive-element/node/decorators/query-all.js:
4356
- (**
4357
- * @license
4358
- * Copyright 2017 Google LLC
4359
- * SPDX-License-Identifier: BSD-3-Clause
4360
- *)
4361
-
4362
- @lit/reactive-element/node/decorators/query-async.js:
4363
- (**
4364
- * @license
4365
- * Copyright 2017 Google LLC
4366
- * SPDX-License-Identifier: BSD-3-Clause
4367
- *)
4368
-
4369
- @lit/reactive-element/node/decorators/query-assigned-elements.js:
4370
- (**
4371
- * @license
4372
- * Copyright 2021 Google LLC
4373
- * SPDX-License-Identifier: BSD-3-Clause
4374
- *)
4375
-
4376
- @lit/reactive-element/node/decorators/query-assigned-nodes.js:
4377
- (**
4378
- * @license
4379
- * Copyright 2017 Google LLC
4380
- * SPDX-License-Identifier: BSD-3-Clause
4381
- *)
4382
-
4383
- lit-html/node/directive-helpers.js:
4384
- (**
4385
- * @license
4386
- * Copyright 2020 Google LLC
4387
- * SPDX-License-Identifier: BSD-3-Clause
4388
- *)
4389
-
4390
- lit-html/node/directive.js:
4391
- (**
4392
- * @license
4393
- * Copyright 2017 Google LLC
4394
- * SPDX-License-Identifier: BSD-3-Clause
4395
- *)
4396
-
4397
- lit-html/node/async-directive.js:
4398
- (**
4399
- * @license
4400
- * Copyright 2017 Google LLC
4401
- * SPDX-License-Identifier: BSD-3-Clause
4402
- *)
4403
-
4404
- lit-html/node/directives/private-async-helpers.js:
4405
- (**
4406
- * @license
4407
- * Copyright 2021 Google LLC
4408
- * SPDX-License-Identifier: BSD-3-Clause
4409
- *)
4410
-
4411
- lit-html/node/directives/until.js:
4412
- (**
4413
- * @license
4414
- * Copyright 2017 Google LLC
4415
- * SPDX-License-Identifier: BSD-3-Clause
4416
- *)
4417
-
4418
- jexpr/lib/constants.js:
4419
- (*
4420
- * @license
4421
- * Portions Copyright (c) 2013, the Dart project authors.
4422
- *)
4423
-
4424
- jexpr/lib/tokenizer.js:
4425
- (*
4426
- * @license
4427
- * Portions Copyright (c) 2013, the Dart project authors.
4428
- *)
4429
-
4430
- jexpr/lib/parser.js:
4431
- (*
4432
- * @license
4433
- * Portions Copyright (c) 2013, the Dart project authors.
4434
- *)
4435
-
4436
- jexpr/lib/ast_factory.js:
4437
- (*
4438
- * @license
4439
- * Portions Copyright (c) 2013, the Dart project authors.
4440
- *)
4441
-
4442
- jexpr/lib/eval.js:
4443
- (*
4444
- * @license
4445
- * Portions Copyright (c) 2013, the Dart project authors.
4446
- *)
4447
-
4448
- lit-html/node/private-ssr-support.js:
4449
- (**
4450
- * @license
4451
- * Copyright 2019 Google LLC
4452
- * SPDX-License-Identifier: BSD-3-Clause
4453
- *)
4454
-
4455
- lit-html/node/directives/if-defined.js:
4456
- (**
4457
- * @license
4458
- * Copyright 2018 Google LLC
4459
- * SPDX-License-Identifier: BSD-3-Clause
4460
- *)
4461
-
4462
- lit-html/node/directives/ref.js:
4463
- (**
4464
- * @license
4465
- * Copyright 2020 Google LLC
4466
- * SPDX-License-Identifier: BSD-3-Clause
4467
- *)
4468
-
4469
- lit-html/node/directives/unsafe-html.js:
4470
- (**
4471
- * @license
4472
- * Copyright 2017 Google LLC
4473
- * SPDX-License-Identifier: BSD-3-Clause
4474
- *)
4475
-
4476
- lit-html/node/directives/repeat.js:
4477
- (**
4478
- * @license
4479
- * Copyright 2017 Google LLC
4480
- * SPDX-License-Identifier: BSD-3-Clause
4481
- *)
4482
-
4483
- lit-html/node/directives/style-map.js:
4484
- (**
4485
- * @license
4486
- * Copyright 2018 Google LLC
4487
- * SPDX-License-Identifier: BSD-3-Clause
4488
- *)
4489
- */