@citolab/qti-components 6.0.28 → 6.0.29

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 (35) hide show
  1. package/dist/{chunk-C4C24R3I.cjs → chunk-M4CYU6DC.cjs} +1 -1
  2. package/dist/{chunk-5U4R2HMK.cjs → chunk-PNQIHQ4E.cjs} +3 -3
  3. package/dist/{chunk-2K77UHFA.js → chunk-QFISTKXH.js} +2 -2
  4. package/dist/{chunk-BVYXUE3V.js → chunk-QROD4MVT.js} +1 -1
  5. package/dist/context/index.cjs +1 -1
  6. package/dist/context/index.d.cts +8 -1
  7. package/dist/context/index.d.ts +8 -1
  8. package/dist/context/index.js +1 -1
  9. package/dist/custom-elements.json +287 -287
  10. package/dist/decorators/index.cjs +1 -1
  11. package/dist/decorators/index.js +1 -1
  12. package/dist/index.cjs +58 -58
  13. package/dist/index.d.cts +0 -1
  14. package/dist/index.d.ts +0 -1
  15. package/dist/index.js +59 -59
  16. package/dist/qti-components/index.cjs +22 -22
  17. package/dist/qti-components/index.d.cts +3 -4
  18. package/dist/qti-components/index.d.ts +3 -4
  19. package/dist/qti-components/index.js +20 -20
  20. package/dist/qti-item/index.cjs +1 -1
  21. package/dist/qti-item/index.d.cts +19 -3
  22. package/dist/qti-item/index.d.ts +19 -3
  23. package/dist/qti-item/index.js +1 -1
  24. package/dist/qti-item-react/index.cjs +1 -1
  25. package/dist/qti-item-react/index.d.cts +2 -2
  26. package/dist/qti-item-react/index.d.ts +2 -2
  27. package/dist/qti-item-react/index.js +1 -1
  28. package/dist/{qti-simple-choice-86f433b6.d.ts → qti-simple-choice-9a8c789b.d.ts} +1 -1
  29. package/dist/qti-transform/index.cjs +1 -1
  30. package/dist/qti-transform/index.js +1 -1
  31. package/package.json +19 -18
  32. package/dist/audience-context-444478f4.d.ts +0 -8
  33. package/dist/qti-item-395a9535.d.ts +0 -19
  34. /package/dist/{chunk-NMCIOGD2.js → chunk-343LZK3D.js} +0 -0
  35. /package/dist/{chunk-HOQW4KDA.cjs → chunk-6G76D2MI.cjs} +0 -0
@@ -1,12 +1,12 @@
1
- import{a as gt,b as h}from"../chunk-BVYXUE3V.js";import{a as bt}from"../chunk-5GG2XAUT.js";import{a as k,b as W,c as s}from"../chunk-NMCIOGD2.js";var vt={};var yt={};var xt={};var Et={};var qt={};var Ct={};var _t={};var kt={};var At={};var Rt={ON_OUTCOME_CHANGED:"qti-outcome-changed",ON_INTERACTION_CHANGED:"on-interaction-changed",ON_REGISTER_VARIABLE:"on-register-variable",ON_REGISTER_FEEDBACK:"on-register-feedback",ON_REGISTER_INTERACTION:"on-register-interaction",ON_REGISTER_CHOICE:"on-register-choice",ON_REGISTER_HOTSPOT:"on-register-hotspot",ON_LOOSE_CHOICE:"on-loose-choice",ON_INTERACTION_RESPONSE:"on-interaction-response",ON_DROPDOWN_SELECTED:"on-dropdown-selected",ON_CHOICE_ELEMENT_SELECTED:"choice-element-selected"};var H=class{constructor(){this.value=null}},N=class{constructor(){this.value=null;this.candidateResponse=null;this.correctResponse=null}};import{customElement as Zt,property as oe}from"lit/decorators.js";import{html as Qt,LitElement as er}from"lit";var A=class extends er{constructor(){super();this.variables=[];this.feedbackElements=[];this.interactionElements=[];this._numAttempts=0;this._handleDisabledChange=(e,t)=>{this.interactionElements.forEach(r=>r.disabled=t)};this._handleReadonlyChange=(e,t)=>this.interactionElements.forEach(r=>r.readonly=t);this.addEventListener("qti-register-variable",this._registerVariable),this.addEventListener("qti-register-feedback",this.registerFeedbackElement),this.addEventListener("qti-register-interaction",this.registerInteractionElement),this.addEventListener("qti-outcome-changed",this.outcomeChanged),this.addEventListener("qti-interaction-response",this.interactionResponse)}render(){return Qt`<slot></slot>`}firstUpdated(e){super.firstUpdated(e),this.dispatchEvent(new CustomEvent("qti-item-connected",{bubbles:!0,composed:!0,detail:this}))}disconnectedCallback(){this.removeEventListener("qti-register-variable",this._registerVariable),this.removeEventListener("qti-register-feedback",this.registerFeedbackElement),this.removeEventListener("qti-register-interaction",this.registerInteractionElement),this.removeEventListener("qti-outcome-changed",this.outcomeChanged),this.removeEventListener("qti-interaction-response",this.interactionResponse)}_registerVariable(e){this.variables.push(e.detail.variable)}showCorrectResponse(){let e=this.variables.filter(t=>"correctResponse"in t&&t.correctResponse);this.responses=e.map(t=>({responseIdentifier:t.identifier,response:t.correctResponse}))}processResponse(){let e=this.querySelector("qti-response-processing");return e?e.process?(e.process(),this._numAttempts++,this.dispatchEvent(new CustomEvent("qti-response-processing")),!0):(console.info("Client side response webcomponents not available"),!1):(console.info("Client side response processing template not available"),!1)}set responses(e){if(e)for(let t of e){let r=this.interactionElements.find(n=>n.getAttribute("response-identifier")===t.responseIdentifier),o=this.getResponse(t.responseIdentifier);o&&(o.value=t.response),r&&(r.response=t.response)}}resetInteractions(){this.interactionElements.forEach(e=>e.reset())}validateResponses(){let e=!0;return this.interactionElements.forEach(t=>{t.validate()||(e=!1)}),e}getVariable(e){switch(e){case"numAttempts":return{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:this._numAttempts.toString()};default:{let t=this.variables.find(r=>r.identifier===e);return t||(console.warn(`Variable with identifier ${e} was not found`),null)}break}}getResponse(e){let t=this.variables.find(o=>o.identifier===e);return t instanceof N?t:null}getOutcome(e){let t=this.variables.find(r=>r.identifier===e);return t instanceof H?t:null}registerFeedbackElement(e){e.stopPropagation(),this.feedbackElements.push(e.detail)}registerInteractionElement(e){e.stopPropagation(),this.interactionElements.push(e.target)}interactionResponse(e){let t=e.detail,r=this.getResponse(t.responseIdentifier);r&&(r.value=t.response),e.stopImmediatePropagation();let o=this.getAttribute("identifier");o||console.warn("qti-assessment-item has no identifier specified"),this.dispatchEvent(new CustomEvent("qti-interaction-changed",{bubbles:!0,composed:!0,detail:{item:o,responseIdentifier:t.responseIdentifier,response:t.response}}))}outcomeChanged(e){this.showFeedback(e)}showFeedback(e){this.feedbackElements.forEach(t=>{t.checkShowFeedback(e.detail.outcomeIdentifier)})}setOutcomeValue(e,t){let r;switch(e){case"completionStatus":r={identifier:"completionStatus",cardinality:"single",baseType:"string",value:t};break;default:{if(r=this.getOutcome(e),!r){console.warn(`Can not set qti-outcome-identifier: ${e}, it is not available`);return}r.cardinality==="single"?r.value=t:r.value.push(t)}break}this.dispatchEvent(new CustomEvent("qti-outcome-changed",{bubbles:!0,composed:!0,detail:{item:this.identifier,outcomeIdentifier:e,value:r.value}}))}};s([oe({type:Boolean})],A.prototype,"disabled",2),s([oe({type:Boolean})],A.prototype,"readonly",2),s([oe({type:String})],A.prototype,"title",2),s([oe({type:String})],A.prototype,"identifier",2),s([h("disabled",{waitUntilFirstUpdate:!0})],A.prototype,"_handleDisabledChange",2),s([h("readonly",{waitUntilFirstUpdate:!0})],A.prototype,"_handleReadonlyChange",2),A=s([Zt("qti-assessment-item")],A);import{LitElement as tr}from"lit";var De=class extends tr{constructor(){super()}connectedCallback(){super.connectedCallback();let e=this.closest("qti-assessment-item"),t=this.getAttribute("href");if(t!==null){let r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.media="screen",r.href=t,e.appendChild(r),this.styleLink=r}if(this.textContent!==null){let r=document.createElement("style");r.media="screen",r.textContent=this.textContent,e.appendChild(r),this.styleLink=r}}disconnectedCallback(){let e=this.closest("qti-assessment-item");if(this.styleLink&&this.styleLink.parentElement===this)try{e.removeChild(this.styleLink)}catch(t){console.log("could not remove stylesheet")}}};customElements.define("qti-stylesheet",De);import{customElement as ir}from"lit/decorators.js";import{html as sr,LitElement as or}from"lit";import{css as rr}from"lit";var Tt=rr`
1
+ import{a as gt,b as h}from"../chunk-QROD4MVT.js";import{a as bt}from"../chunk-5GG2XAUT.js";import{a as k,b as W,c as s}from"../chunk-343LZK3D.js";var vt={};var yt={};var xt={};var Et={};var qt={};var Ct={};var _t={};var kt={};var At={};var Tt={ON_OUTCOME_CHANGED:"qti-outcome-changed",ON_INTERACTION_CHANGED:"on-interaction-changed",ON_REGISTER_VARIABLE:"on-register-variable",ON_REGISTER_FEEDBACK:"on-register-feedback",ON_REGISTER_INTERACTION:"on-register-interaction",ON_REGISTER_CHOICE:"on-register-choice",ON_REGISTER_HOTSPOT:"on-register-hotspot",ON_LOOSE_CHOICE:"on-loose-choice",ON_INTERACTION_RESPONSE:"on-interaction-response",ON_DROPDOWN_SELECTED:"on-dropdown-selected",ON_CHOICE_ELEMENT_SELECTED:"choice-element-selected"};var H=class{constructor(){this.value=null}},N=class{constructor(){this.value=null;this.candidateResponse=null;this.correctResponse=null}};import{customElement as Zt,property as oe}from"lit/decorators.js";import{html as Qt,LitElement as er}from"lit";var A=class extends er{constructor(){super();this.variables=[];this.feedbackElements=[];this.interactionElements=[];this._numAttempts=0;this._handleDisabledChange=(e,t)=>{this.interactionElements.forEach(r=>r.disabled=t)};this._handleReadonlyChange=(e,t)=>this.interactionElements.forEach(r=>r.readonly=t);this.addEventListener("qti-register-variable",this._registerVariable),this.addEventListener("qti-register-feedback",this.registerFeedbackElement),this.addEventListener("qti-register-interaction",this.registerInteractionElement),this.addEventListener("qti-outcome-changed",this.outcomeChanged),this.addEventListener("qti-interaction-response",this.interactionResponse)}render(){return Qt`<slot></slot>`}firstUpdated(e){super.firstUpdated(e),this.dispatchEvent(new CustomEvent("qti-item-connected",{bubbles:!0,composed:!0,detail:this}))}disconnectedCallback(){this.removeEventListener("qti-register-variable",this._registerVariable),this.removeEventListener("qti-register-feedback",this.registerFeedbackElement),this.removeEventListener("qti-register-interaction",this.registerInteractionElement),this.removeEventListener("qti-outcome-changed",this.outcomeChanged),this.removeEventListener("qti-interaction-response",this.interactionResponse)}_registerVariable(e){this.variables.push(e.detail.variable)}showCorrectResponse(){let e=this.variables.filter(t=>"correctResponse"in t&&t.correctResponse);this.responses=e.map(t=>({responseIdentifier:t.identifier,response:t.correctResponse}))}processResponse(){let e=this.querySelector("qti-response-processing");return e?e.process?(e.process(),this._numAttempts++,this.dispatchEvent(new CustomEvent("qti-response-processing")),!0):(console.info("Client side response webcomponents not available"),!1):(console.info("Client side response processing template not available"),!1)}set responses(e){if(e)for(let t of e){let r=this.interactionElements.find(n=>n.getAttribute("response-identifier")===t.responseIdentifier),o=this.getResponse(t.responseIdentifier);o&&(o.value=t.response),r&&(r.response=t.response)}}resetInteractions(){this.interactionElements.forEach(e=>e.reset())}validateResponses(){let e=!0;return this.interactionElements.forEach(t=>{t.validate()||(e=!1)}),e}getVariable(e){switch(e){case"numAttempts":return{identifier:"numAttempts",cardinality:"single",baseType:"integer",value:this._numAttempts.toString()};default:{let t=this.variables.find(r=>r.identifier===e);return t||(console.warn(`Variable with identifier ${e} was not found`),null)}break}}getResponse(e){let t=this.variables.find(o=>o.identifier===e);return t instanceof N?t:null}getOutcome(e){let t=this.variables.find(r=>r.identifier===e);return t instanceof H?t:null}registerFeedbackElement(e){e.stopPropagation(),this.feedbackElements.push(e.detail)}registerInteractionElement(e){e.stopPropagation(),this.interactionElements.push(e.target)}interactionResponse(e){let t=e.detail,r=this.getResponse(t.responseIdentifier);r&&(r.value=t.response),e.stopImmediatePropagation();let o=this.getAttribute("identifier");o||console.warn("qti-assessment-item has no identifier specified"),this.dispatchEvent(new CustomEvent("qti-interaction-changed",{bubbles:!0,composed:!0,detail:{item:o,responseIdentifier:t.responseIdentifier,response:t.response}}))}outcomeChanged(e){this.showFeedback(e)}showFeedback(e){this.feedbackElements.forEach(t=>{t.checkShowFeedback(e.detail.outcomeIdentifier)})}setOutcomeValue(e,t){let r;switch(e){case"completionStatus":r={identifier:"completionStatus",cardinality:"single",baseType:"string",value:t};break;default:{if(r=this.getOutcome(e),!r){console.warn(`Can not set qti-outcome-identifier: ${e}, it is not available`);return}r.cardinality==="single"?r.value=t:r.value.push(t)}break}this.dispatchEvent(new CustomEvent("qti-outcome-changed",{bubbles:!0,composed:!0,detail:{item:this.identifier,outcomeIdentifier:e,value:r.value}}))}};s([oe({type:Boolean})],A.prototype,"disabled",2),s([oe({type:Boolean})],A.prototype,"readonly",2),s([oe({type:String})],A.prototype,"title",2),s([oe({type:String})],A.prototype,"identifier",2),s([h("disabled",{waitUntilFirstUpdate:!0})],A.prototype,"_handleDisabledChange",2),s([h("readonly",{waitUntilFirstUpdate:!0})],A.prototype,"_handleReadonlyChange",2),A=s([Zt("qti-assessment-item")],A);import{LitElement as tr}from"lit";var De=class extends tr{constructor(){super()}connectedCallback(){super.connectedCallback();let e=this.closest("qti-assessment-item"),t=this.getAttribute("href");if(t!==null){let r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.media="screen",r.href=t,e.appendChild(r),this.styleLink=r}if(this.textContent!==null){let r=document.createElement("style");r.media="screen",r.textContent=this.textContent,e.appendChild(r),this.styleLink=r}}disconnectedCallback(){let e=this.closest("qti-assessment-item");if(this.styleLink&&this.styleLink.parentElement===this)try{e.removeChild(this.styleLink)}catch(t){console.log("could not remove stylesheet")}}};customElements.define("qti-stylesheet",De);import{customElement as ir}from"lit/decorators.js";import{html as sr,LitElement as or}from"lit";import{css as rr}from"lit";var wt=rr`
2
2
  :host {
3
3
  display: block;
4
4
  }
5
- `;var $=class extends or{render(){return sr`<slot></slot>`}};$.styles=Tt,$=s([ir("qti-item-body")],$);import{html as nr,LitElement as ar}from"lit";var He=class extends ar{render(){return nr`<slot></slot>`}connectedCallback(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}};customElements.define("qti-prompt",He);import{html as lr}from"lit/static-html.js";import{property as G}from"lit/decorators.js";import{LitElement as cr}from"lit";var pr={SPACE:32},y=class extends cr{constructor(){super(...arguments);this.tabindex=0;this.disabled=!1;this.readonly=!1;this.checked=!1}handleDisabledChange(e,t){t?(this.tabindex=void 0,this.blur()):this.tabIndex=0}connectedCallback(){super.connectedCallback(),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("qti-register-choice",{bubbles:!0,cancelable:!1,composed:!0}))}disconnectedCallback(){this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("qti-loose-choice",{bubbles:!0,cancelable:!1,composed:!0}))}reset(){this.checked=!1,this.disabled=!1}_onKeyUp(e){if(!e.altKey)switch(e.keyCode){case pr.SPACE:e.preventDefault(),this._toggleChecked();break;default:}}_onClick(){this._toggleChecked()}_toggleChecked(){this.disabled||this.readonly||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("qti-choice-element-selected",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier,checked:this.checked}})))}validateAllProps(){return!!this.getAttribute("identifier")}render(){return this.validateAllProps()||console.warn(`Invalid props for ${this.outerHTML}`,"missing identifier"),lr` <slot></slot> `}};s([G({type:String})],y.prototype,"identifier",2),s([G({type:Number,reflect:!0})],y.prototype,"tabindex",2),s([G({reflect:!0,type:Boolean,attribute:"aria-disabled",converter:{toAttribute:a=>a}})],y.prototype,"disabled",2),s([G({reflect:!0,type:Boolean,attribute:"aria-readonly",converter:{toAttribute:a=>a}})],y.prototype,"readonly",2),s([G({reflect:!0,type:Boolean,attribute:"aria-checked",converter:{toAttribute:a=>a}})],y.prototype,"checked",2),s([h("disabled",{waitUntilFirstUpdate:!0})],y.prototype,"handleDisabledChange",1);import{html as dr,LitElement as ur}from"lit";var V=class extends ur{render(){return dr``}defaultValues(i){let e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;let t=e.map(r=>r.innerHTML);return t.length>1||i.cardinality==="multiple"||i.cardinality==="ordered"?t:t[0]}};customElements.define("qti-variabledeclaration",V);import{property as Ne}from"lit/decorators.js";var O=class extends V{connectedCallback(){super.connectedCallback();let e=new N;e.baseType=this.baseType,e.identifier=this.identifier,e.correctResponse=this.correctResponse,e.cardinality=this.cardinality||"single",e.mapping=this.mapping,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 o=0;o<r.length;o++)e.push(r[o].textContent),r[o].remove()}}return e}get mapping(){return this.querySelector("qti-mapping")}};s([Ne({type:String,attribute:"base-type"})],O.prototype,"baseType",2),s([Ne({type:String})],O.prototype,"identifier",2),s([Ne({type:String})],O.prototype,"cardinality",2);customElements.define("qti-response-declaration",O);import{property as $e}from"lit/decorators.js";var P=class extends V{get interpolationTable(){let e=this.querySelector("qti-interpolation-table");if(e){let t=new Map;for(let r of e.querySelectorAll("qti-interpolation-table-entry")){!r.getAttribute("source-value")&&r.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");let o=parseInt(r.getAttribute("source-value")),n=parseInt(r.getAttribute("target-value"));(isNaN(o)||isNaN(n))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),t.set(o,n)}}return null}connectedCallback(){super.connectedCallback();let e=new H;e.identifier=this.identifier,e.cardinality=this.cardinality,e.baseType=this.baseType,e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}};s([$e({type:String,attribute:"base-type"})],P.prototype,"baseType",2),s([$e({type:String})],P.prototype,"identifier",2),s([$e({type:String})],P.prototype,"cardinality",2);customElements.define("qti-outcome-declaration",P);import{LitElement as mr}from"lit";import{customElement as hr}from"lit/decorators.js";var ne=class extends mr{};ne=s([hr("qti-companion-materials-info")],ne);import{LitElement as fr,css as br,html as gr}from"lit";import{customElement as vr,property as ae}from"lit/decorators.js";import{ContextConsumer as yr}from"@lit-labs/context";var R=class extends fr{constructor(){super(...arguments);this.logger=new yr(this,bt,e=>this.style.display=this.view===e.view?"block":"none",!0)}handleclassNamesChange(e,t){this.classNames.split(" ").forEach(o=>{switch(o){case"qti-rubric-discretionary-placement":this.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":this.setAttribute("slot","");break;default:break}})}render(){return gr`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-rubric-block")}};R.styles=br`
5
+ `;var $=class extends or{render(){return sr`<slot name="qti-rubric-block"></slot><slot></slot>`}};$.styles=wt,$=s([ir("qti-item-body")],$);import{html as nr,LitElement as ar}from"lit";var He=class extends ar{render(){return nr`<slot></slot>`}connectedCallback(){this.parentElement.tagName.endsWith("INTERACTION")&&this.setAttribute("slot","prompt")}};customElements.define("qti-prompt",He);import{html as lr}from"lit/static-html.js";import{property as G}from"lit/decorators.js";import{LitElement as cr}from"lit";var pr={SPACE:32},y=class extends cr{constructor(){super(...arguments);this.tabindex=0;this.disabled=!1;this.readonly=!1;this.checked=!1}handleDisabledChange(e,t){t?(this.tabindex=void 0,this.blur()):this.tabIndex=0}connectedCallback(){super.connectedCallback(),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("qti-register-choice",{bubbles:!0,cancelable:!1,composed:!0}))}disconnectedCallback(){this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("click",this._onClick),this.dispatchEvent(new CustomEvent("qti-loose-choice",{bubbles:!0,cancelable:!1,composed:!0}))}reset(){this.checked=!1,this.disabled=!1}_onKeyUp(e){if(!e.altKey)switch(e.keyCode){case pr.SPACE:e.preventDefault(),this._toggleChecked();break;default:}}_onClick(){this._toggleChecked()}_toggleChecked(){this.disabled||this.readonly||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("qti-choice-element-selected",{bubbles:!0,cancelable:!1,composed:!0,detail:{identifier:this.identifier,checked:this.checked}})))}validateAllProps(){return!!this.getAttribute("identifier")}render(){return this.validateAllProps()||console.warn(`Invalid props for ${this.outerHTML}`,"missing identifier"),lr` <slot></slot> `}};s([G({type:String})],y.prototype,"identifier",2),s([G({type:Number,reflect:!0})],y.prototype,"tabindex",2),s([G({reflect:!0,type:Boolean,attribute:"aria-disabled",converter:{toAttribute:a=>a}})],y.prototype,"disabled",2),s([G({reflect:!0,type:Boolean,attribute:"aria-readonly",converter:{toAttribute:a=>a}})],y.prototype,"readonly",2),s([G({reflect:!0,type:Boolean,attribute:"aria-checked",converter:{toAttribute:a=>a}})],y.prototype,"checked",2),s([h("disabled",{waitUntilFirstUpdate:!0})],y.prototype,"handleDisabledChange",1);import{html as dr,LitElement as ur}from"lit";var V=class extends ur{render(){return dr``}defaultValues(i){let e=Array.from(this.querySelectorAll("qti-default-value > qti-value"));if(e.length===0)return null;let t=e.map(r=>r.innerHTML);return t.length>1||i.cardinality==="multiple"||i.cardinality==="ordered"?t:t[0]}};customElements.define("qti-variabledeclaration",V);import{property as Ne}from"lit/decorators.js";var O=class extends V{connectedCallback(){super.connectedCallback();let e=new N;e.baseType=this.baseType,e.identifier=this.identifier,e.correctResponse=this.correctResponse,e.cardinality=this.cardinality||"single",e.mapping=this.mapping,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 o=0;o<r.length;o++)e.push(r[o].textContent),r[o].remove()}}return e}get mapping(){return this.querySelector("qti-mapping")}};s([Ne({type:String,attribute:"base-type"})],O.prototype,"baseType",2),s([Ne({type:String})],O.prototype,"identifier",2),s([Ne({type:String})],O.prototype,"cardinality",2);customElements.define("qti-response-declaration",O);import{property as $e}from"lit/decorators.js";var P=class extends V{get interpolationTable(){let e=this.querySelector("qti-interpolation-table");if(e){let t=new Map;for(let r of e.querySelectorAll("qti-interpolation-table-entry")){!r.getAttribute("source-value")&&r.getAttribute("target-value")&&console.error("source-value or target-value is missing in qti-interpolation-table-entry");let o=parseInt(r.getAttribute("source-value")),n=parseInt(r.getAttribute("target-value"));(isNaN(o)||isNaN(n))&&console.error("source-value or target-value is not a number in qti-interpolation-table-entry"),t.set(o,n)}}return null}connectedCallback(){super.connectedCallback();let e=new H;e.identifier=this.identifier,e.cardinality=this.cardinality,e.baseType=this.baseType,e.value=this.defaultValues(e),this.dispatchEvent(new CustomEvent("qti-register-variable",{bubbles:!0,composed:!0,detail:{variable:e}}))}};s([$e({type:String,attribute:"base-type"})],P.prototype,"baseType",2),s([$e({type:String})],P.prototype,"identifier",2),s([$e({type:String})],P.prototype,"cardinality",2);customElements.define("qti-outcome-declaration",P);import{LitElement as mr}from"lit";import{customElement as hr}from"lit/decorators.js";var ne=class extends mr{};ne=s([hr("qti-companion-materials-info")],ne);import{LitElement as fr,css as br,html as gr}from"lit";import{customElement as vr,property as ae}from"lit/decorators.js";import{ContextConsumer as yr}from"@lit-labs/context";var T=class extends fr{constructor(){super(...arguments);this.logger=new yr(this,bt,e=>this.style.display=this.view===e.view?"block":"none",!0)}handleclassNamesChange(e,t){this.classNames.split(" ").forEach(o=>{switch(o){case"qti-rubric-discretionary-placement":this.setAttribute("slot","qti-rubric-block");break;case"qti-rubric-inline":this.setAttribute("slot","");break;default:break}})}render(){return gr`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-rubric-block")}};T.styles=br`
6
6
  :host {
7
7
  display: block;
8
8
  }
9
- `,s([ae({type:String})],R.prototype,"id",2),s([ae({type:String})],R.prototype,"use",2),s([ae({type:String})],R.prototype,"view",2),s([ae({type:String,attribute:"class"})],R.prototype,"classNames",2),s([h("classNames",{waitUntilFirstUpdate:!0})],R.prototype,"handleclassNamesChange",1),R=s([vr("qti-rubric-block")],R);import{LitElement as xr,html as Er}from"lit";import{customElement as qr}from"lit/decorators.js";var le=class extends xr{render(){return Er`<slot></slot>`}};le=s([qr("qti-content-body")],le);import{css as _r,html as kr}from"lit";import{LitElement as Cr}from"lit";import{property as ce}from"lit/decorators.js";var E=class extends Cr{constructor(){super();this.showHide="show",this.showFeedback(this.showHide==="hide")}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}checkShowFeedback(e){let t=this.closest("qti-assessment-item").getOutcome(e);if(this.outcomeIdentifier!==e||!t)return;let r=!1;Array.isArray(t.value)?r=t.baseType=="float"||t.baseType=="integer"?t.value.includes(this.identifier):t.value.includes(this.identifier):r=t.baseType=="float"||t.baseType=="integer"?this.identifier===t.value:this.identifier===t.value,this.showFeedback(r)}showFeedback(e){this.showStatus=e?"on":"off"}};s([ce({type:String,attribute:"show-hide"})],E.prototype,"showHide",2),s([ce({type:String,attribute:"outcome-identifier"})],E.prototype,"outcomeIdentifier",2),s([ce({type:String})],E.prototype,"identifier",2),s([ce({type:String,attribute:!1})],E.prototype,"showStatus",2);var pe=class extends E{constructor(){super(...arguments);this.render=()=>kr` <slot class="${this.showStatus}"></slot> `}};pe.styles=_r`
9
+ `,s([ae({type:String})],T.prototype,"id",2),s([ae({type:String})],T.prototype,"use",2),s([ae({type:String})],T.prototype,"view",2),s([ae({type:String,attribute:"class"})],T.prototype,"classNames",2),s([h("classNames",{waitUntilFirstUpdate:!0})],T.prototype,"handleclassNamesChange",1),T=s([vr("qti-rubric-block")],T);import{LitElement as xr,html as Er}from"lit";import{customElement as qr}from"lit/decorators.js";var le=class extends xr{render(){return Er`<slot></slot>`}};le=s([qr("qti-content-body")],le);import{css as _r,html as kr}from"lit";import{LitElement as Cr}from"lit";import{property as ce}from"lit/decorators.js";var E=class extends Cr{constructor(){super();this.showHide="show",this.showFeedback(this.showHide==="hide")}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-feedback",{bubbles:!0,composed:!0,detail:this}))}checkShowFeedback(e){let t=this.closest("qti-assessment-item").getOutcome(e);if(this.outcomeIdentifier!==e||!t)return;let r=!1;Array.isArray(t.value)?r=t.baseType=="float"||t.baseType=="integer"?t.value.includes(this.identifier):t.value.includes(this.identifier):r=t.baseType=="float"||t.baseType=="integer"?this.identifier===t.value:this.identifier===t.value,this.showFeedback(r)}showFeedback(e){this.showStatus=e?"on":"off"}};s([ce({type:String,attribute:"show-hide"})],E.prototype,"showHide",2),s([ce({type:String,attribute:"outcome-identifier"})],E.prototype,"outcomeIdentifier",2),s([ce({type:String})],E.prototype,"identifier",2),s([ce({type:String,attribute:!1})],E.prototype,"showStatus",2);var pe=class extends E{constructor(){super(...arguments);this.render=()=>kr` <slot class="${this.showStatus}"></slot> `}};pe.styles=_r`
10
10
  .on {
11
11
  display: inline-block;
12
12
  }
@@ -25,7 +25,7 @@ import{a as gt,b as h}from"../chunk-BVYXUE3V.js";import{a as bt}from"../chunk-5G
25
25
  <div class="feedback ${this.showStatus}">
26
26
  <slot></slot>
27
27
  </div>
28
- `}};customElements.define("qti-modal-feedback",Oe);import{html as Rr}from"lit";var Pe=class extends E{render(){return Rr`
28
+ `}};customElements.define("qti-modal-feedback",Oe);import{html as Tr}from"lit";var Pe=class extends E{render(){return Tr`
29
29
  <style>
30
30
  :host {
31
31
  display: block;
@@ -40,7 +40,7 @@ import{a as gt,b as h}from"../chunk-BVYXUE3V.js";import{a as bt}from"../chunk-5G
40
40
  <div class="feedback ${this.showStatus}">
41
41
  <slot></slot>
42
42
  </div>
43
- `}firstUpdated(i){this.checkShowFeedback(this.outcomeIdentifier)}};customElements.define("qti-feedback-block",Pe);import{css as wr,html as Lr}from"lit";import{ifDefined as wt}from"lit/directives/if-defined.js";import{property as Ie}from"lit/decorators.js";import{LitElement as Tr}from"lit";var f=class extends Tr{constructor(){super(...arguments);this.responseIdentifier="";this.disabled=!1;this.readonly=!1}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,cancelable:!1,composed:!0}))}saveResponse(e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,cancelable:!1,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:e}}))}};s([Ie({attribute:"response-identifier"})],f.prototype,"responseIdentifier",2),s([Ie({reflect:!0,type:Boolean})],f.prototype,"disabled",2),s([Ie({reflect:!0,type:Boolean})],f.prototype,"readonly",2);import{customElement as Sr,property as de,state as Lt}from"lit/decorators.js";import{createRef as Mr}from"lit/directives/ref.js";var _=class extends f{constructor(){super(...arguments);this._value="";this._size=5;this.inputRef=Mr()}handleclassNamesChange(e,t){t.split(" ").forEach(o=>{if(o.startsWith("qti-input-width")){let n=o.replace("qti-input-width-","");this._size=parseInt(n)}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[wr`
43
+ `}firstUpdated(i){this.checkShowFeedback(this.outcomeIdentifier)}};customElements.define("qti-feedback-block",Pe);import{css as Rr,html as Lr}from"lit";import{ifDefined as Rt}from"lit/directives/if-defined.js";import{property as Ie}from"lit/decorators.js";import{LitElement as wr}from"lit";var f=class extends wr{constructor(){super(...arguments);this.responseIdentifier="";this.disabled=!1;this.readonly=!1}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,cancelable:!1,composed:!0}))}saveResponse(e){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,cancelable:!1,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:e}}))}};s([Ie({attribute:"response-identifier"})],f.prototype,"responseIdentifier",2),s([Ie({reflect:!0,type:Boolean})],f.prototype,"disabled",2),s([Ie({reflect:!0,type:Boolean})],f.prototype,"readonly",2);import{customElement as Sr,property as de,state as Lt}from"lit/decorators.js";import{createRef as Mr}from"lit/directives/ref.js";var _=class extends f{constructor(){super(...arguments);this._value="";this._size=5;this.inputRef=Mr()}handleclassNamesChange(e,t){t.split(" ").forEach(o=>{if(o.startsWith("qti-input-width")){let n=o.replace("qti-input-width-","");this._size=parseInt(n)}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[Rr`
44
44
  :host {
45
45
  display: inline-flex;
46
46
  }
@@ -52,13 +52,13 @@ import{a as gt,b as h}from"../chunk-BVYXUE3V.js";import{a as bt}from"../chunk-5G
52
52
  @keyup="${this.textChanged}"
53
53
  @change="${this.textChanged}"
54
54
  type="text"
55
- placeholder="${wt(this.placeholderText?this.placeholderText:void 0)}"
55
+ placeholder="${Rt(this.placeholderText?this.placeholderText:void 0)}"
56
56
  .value="${this._value}"
57
57
  size="${this._size}"
58
- pattern="${wt(this.patternMask?this.patternMask:void 0)}"
58
+ pattern="${Rt(this.patternMask?this.patternMask:void 0)}"
59
59
  ?disabled="${this.disabled}"
60
60
  ?readonly="${this.readonly}"
61
- />`}textChanged(e){if(this.disabled||this.readonly)return;let t=e.target;this.setEmptyAttribute(t.value),this._value!==t.value&&(this._value=t.value,this.saveResponse(t.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};s([de({type:Number,attribute:"expected-length"})],_.prototype,"expectedLength",2),s([de({type:String,attribute:"pattern-mask"})],_.prototype,"patternMask",2),s([de({type:String,attribute:"placeholder-text"})],_.prototype,"placeholderText",2),s([Lt()],_.prototype,"_value",2),s([Lt()],_.prototype,"_size",2),s([de({type:String,attribute:"class"})],_.prototype,"classNames",2),s([h("classNames")],_.prototype,"handleclassNamesChange",1),_=s([Sr("qti-text-entry-interaction")],_);import{css as Vr,html as Dr}from"lit";import{ifDefined as Fe}from"lit/directives/if-defined.js";import{ref as Hr,createRef as Nr}from"lit/directives/ref.js";import{customElement as $r,property as ue,state as Or}from"lit/decorators.js";var T=class extends f{constructor(){super(...arguments);this.textareaRef=Nr();this._value=""}handleclassNamesChange(e,t){this.classNames.split(" ").forEach(o=>{if(o.startsWith("qti-height-lines")){let n=o.replace("qti-height-lines-","");this.textareaRef&&(this.textareaRef.value.rows=parseInt(n))}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[Vr`
61
+ />`}textChanged(e){if(this.disabled||this.readonly)return;let t=e.target;this.setEmptyAttribute(t.value),this._value!==t.value&&(this._value=t.value,this.saveResponse(t.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};s([de({type:Number,attribute:"expected-length"})],_.prototype,"expectedLength",2),s([de({type:String,attribute:"pattern-mask"})],_.prototype,"patternMask",2),s([de({type:String,attribute:"placeholder-text"})],_.prototype,"placeholderText",2),s([Lt()],_.prototype,"_value",2),s([Lt()],_.prototype,"_size",2),s([de({type:String,attribute:"class"})],_.prototype,"classNames",2),s([h("classNames")],_.prototype,"handleclassNamesChange",1),_=s([Sr("qti-text-entry-interaction")],_);import{css as Vr,html as Dr}from"lit";import{ifDefined as Fe}from"lit/directives/if-defined.js";import{ref as Hr,createRef as Nr}from"lit/directives/ref.js";import{customElement as $r,property as ue,state as Or}from"lit/decorators.js";var w=class extends f{constructor(){super(...arguments);this.textareaRef=Nr();this._value=""}handleclassNamesChange(e,t){this.classNames.split(" ").forEach(o=>{if(o.startsWith("qti-height-lines")){let n=o.replace("qti-height-lines-","");this.textareaRef&&(this.textareaRef.value.rows=parseInt(n))}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[Vr`
62
62
  /* PK: display host as block, else design will be collapsed */
63
63
  :host {
64
64
  display: block;
@@ -83,7 +83,7 @@ import{a as gt,b as h}from"../chunk-BVYXUE3V.js";import{a as bt}from"../chunk-5G
83
83
  ?disabled="${this.disabled}"
84
84
  ?readonly="${this.readonly}"
85
85
  .value=${this._value}
86
- ></textarea>`}textChanged(e){if(this.disabled||this.readonly)return;let t=e.target;this.setEmptyAttribute(t.value),this._value!==t.value&&(this._value=t.value,this.saveResponse(t.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};s([ue({type:Number,attribute:"expected-length"})],T.prototype,"expectedLength",2),s([ue({type:String,attribute:"pattern-mask"})],T.prototype,"patternMask",2),s([ue({type:String,attribute:"placeholder-text"})],T.prototype,"placeholderText",2),s([Or()],T.prototype,"_value",2),s([ue({type:String,attribute:"class"})],T.prototype,"classNames",2),s([h("classNames",{waitUntilFirstUpdate:!0})],T.prototype,"handleclassNamesChange",1),T=s([$r("qti-extended-text-interaction")],T);import{html as Pr}from"lit";import{property as St}from"lit/decorators.js";var v=class extends f{constructor(){super();this._choiceElements=[];this.minChoices=0;this.maxChoices=1;this._handleDisabledChange=(e,t)=>this._choiceElements.forEach(r=>r.disabled=t);this._handleReadonlyChange=(e,t)=>this._choiceElements.forEach(r=>r.readonly=t);this._handleMaxChoicesChange=()=>this._determineInputType();this.addEventListener("qti-register-choice",this._registerChoiceElement),this.addEventListener("qti-loose-choice",this._looseChoiceElement)}reset(){this._choiceElements.forEach(e=>{e.reset()})}validate(){return this._choiceElements.reduce((t,r)=>t+(r.checked?1:0),0)>=this.minChoices}set response(e){this._choiceElements.forEach(r=>{r.checked=!1}),(Array.isArray(e)?e:[e]).forEach(r=>{let o=this.querySelector(`[identifier='${r}']`);o&&(o.checked=!0)})}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler),this.removeEventListener("qti-register-choice",this._registerChoiceElement)}_registerChoiceElement(e){e.stopPropagation();let t=e.target;this._choiceElements.push(t),this._setInputType(t)}_looseChoiceElement(e){e.stopPropagation();let t=e.target;this._choiceElements.push(t),this._choiceElements=this._choiceElements.filter(r=>r!==t)}_determineInputType(){this._choiceElements.forEach(e=>{this._setInputType(e)})}_setInputType(e){this.maxChoices===1?e.setAttribute("role","radio"):e.setAttribute("role","checkbox")}_choiceElementSelectedHandler(e){this.maxChoices===1&&this._choiceElements.filter(t=>t.identifier!==e.detail.identifier).forEach(t=>{t.checked=!1}),this._choiceElementSelected()}_choiceElementSelected(){let e=this._choiceElements.filter(r=>r.checked).map(r=>r.identifier);this.maxChoices>1&&(this.maxChoices===e.length?this._choiceElements.forEach(r=>r.disabled=!r.checked):this._choiceElements.forEach(r=>r.disabled=!1));let t;this.maxChoices===1?t=e.length>0?e[0]:void 0:t=e,this.saveResponse(t)}};s([St({type:Number,attribute:"min-choices"})],v.prototype,"minChoices",2),s([St({type:Number,attribute:"max-choices"})],v.prototype,"maxChoices",2),s([h("disabled",{waitUntilFirstUpdate:!0})],v.prototype,"_handleDisabledChange",2),s([h("readonly",{waitUntilFirstUpdate:!0})],v.prototype,"_handleReadonlyChange",2),s([h("maxChoices",{waitUntilFirstUpdate:!0})],v.prototype,"_handleMaxChoicesChange",2);var Ue=class extends v{constructor(){super(...arguments);this.render=()=>Pr`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("qti-hottext-interaction","")}};customElements.define("qti-hottext-interaction",Ue);import{css as Ir,html as Mt}from"lit";import{property as Fr,state as Ur}from"lit/decorators.js";var I=class extends f{constructor(){super(...arguments);this.options=[];this.dataPrompt="select"}static get styles(){return[Ir`
86
+ ></textarea>`}textChanged(e){if(this.disabled||this.readonly)return;let t=e.target;this.setEmptyAttribute(t.value),this._value!==t.value&&(this._value=t.value,this.saveResponse(t.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};s([ue({type:Number,attribute:"expected-length"})],w.prototype,"expectedLength",2),s([ue({type:String,attribute:"pattern-mask"})],w.prototype,"patternMask",2),s([ue({type:String,attribute:"placeholder-text"})],w.prototype,"placeholderText",2),s([Or()],w.prototype,"_value",2),s([ue({type:String,attribute:"class"})],w.prototype,"classNames",2),s([h("classNames",{waitUntilFirstUpdate:!0})],w.prototype,"handleclassNamesChange",1),w=s([$r("qti-extended-text-interaction")],w);import{html as Pr}from"lit";import{property as St}from"lit/decorators.js";var v=class extends f{constructor(){super();this._choiceElements=[];this.minChoices=0;this.maxChoices=1;this._handleDisabledChange=(e,t)=>this._choiceElements.forEach(r=>r.disabled=t);this._handleReadonlyChange=(e,t)=>this._choiceElements.forEach(r=>r.readonly=t);this._handleMaxChoicesChange=()=>this._determineInputType();this.addEventListener("qti-register-choice",this._registerChoiceElement),this.addEventListener("qti-loose-choice",this._looseChoiceElement)}reset(){this._choiceElements.forEach(e=>{e.reset()})}validate(){return this._choiceElements.reduce((t,r)=>t+(r.checked?1:0),0)>=this.minChoices}set response(e){this._choiceElements.forEach(r=>{r.checked=!1}),(Array.isArray(e)?e:[e]).forEach(r=>{let o=this.querySelector(`[identifier='${r}']`);o&&(o.checked=!0)})}connectedCallback(){super.connectedCallback(),this.addEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-choice-element-selected",this._choiceElementSelectedHandler),this.removeEventListener("qti-register-choice",this._registerChoiceElement)}_registerChoiceElement(e){e.stopPropagation();let t=e.target;this._choiceElements.push(t),this._setInputType(t)}_looseChoiceElement(e){e.stopPropagation();let t=e.target;this._choiceElements.push(t),this._choiceElements=this._choiceElements.filter(r=>r!==t)}_determineInputType(){this._choiceElements.forEach(e=>{this._setInputType(e)})}_setInputType(e){this.maxChoices===1?e.setAttribute("role","radio"):e.setAttribute("role","checkbox")}_choiceElementSelectedHandler(e){this.maxChoices===1&&this._choiceElements.filter(t=>t.identifier!==e.detail.identifier).forEach(t=>{t.checked=!1}),this._choiceElementSelected()}_choiceElementSelected(){let e=this._choiceElements.filter(r=>r.checked).map(r=>r.identifier);this.maxChoices>1&&(this.maxChoices===e.length?this._choiceElements.forEach(r=>r.disabled=!r.checked):this._choiceElements.forEach(r=>r.disabled=!1));let t;this.maxChoices===1?t=e.length>0?e[0]:void 0:t=e,this.saveResponse(t)}};s([St({type:Number,attribute:"min-choices"})],v.prototype,"minChoices",2),s([St({type:Number,attribute:"max-choices"})],v.prototype,"maxChoices",2),s([h("disabled",{waitUntilFirstUpdate:!0})],v.prototype,"_handleDisabledChange",2),s([h("readonly",{waitUntilFirstUpdate:!0})],v.prototype,"_handleReadonlyChange",2),s([h("maxChoices",{waitUntilFirstUpdate:!0})],v.prototype,"_handleMaxChoicesChange",2);var Ue=class extends v{constructor(){super(...arguments);this.render=()=>Pr`<slot></slot>`}connectedCallback(){super.connectedCallback(),this.setAttribute("qti-hottext-interaction","")}};customElements.define("qti-hottext-interaction",Ue);import{css as Ir,html as Mt}from"lit";import{property as Fr,state as Ur}from"lit/decorators.js";var I=class extends f{constructor(){super(...arguments);this.options=[];this.dataPrompt="select"}static get styles(){return[Ir`
87
87
  :host {
88
88
  display: inline-block;
89
89
  }
@@ -94,7 +94,7 @@ import{a as gt,b as h}from"../chunk-BVYXUE3V.js";import{a as bt}from"../chunk-5G
94
94
  ?readonly="${this.readonly}"
95
95
  >
96
96
  ${this.options.map(e=>Mt` <option value="${e.value}" ?selected="${e.selected}">${e.textContent}</option> `)}
97
- </select>`}firstUpdated(e){super.firstUpdated(e),this.addEventListener(Rt.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}))]}validate(){let e=this.options.find(t=>t.selected);return e?e.value!=="":!1}reset(){this.options=this.options.map((e,t)=>W(k({},e),{selected:t===0}))}set response(e){this.options=this.options.map(t=>(e===t.value&&(t.selected=!0),t))}choiceSelected(e){let t=e.target.value;this.options=this.options.map(r=>W(k({},r),{selected:r.value===t})),this.saveResponse(t)}};I.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"],s([Ur()],I.prototype,"options",2),s([Fr({attribute:"data-prompt",type:String})],I.prototype,"dataPrompt",2);customElements.define("qti-inline-choice-interaction",I);import{customElement as Yr,property as Br}from"lit/decorators.js";import{html as zr}from"lit";import{css as Xr}from"lit";var Vt=Xr`
97
+ </select>`}firstUpdated(e){super.firstUpdated(e),this.addEventListener(Tt.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}))]}validate(){let e=this.options.find(t=>t.selected);return e?e.value!=="":!1}reset(){this.options=this.options.map((e,t)=>W(k({},e),{selected:t===0}))}set response(e){this.options=this.options.map(t=>(e===t.value&&(t.selected=!0),t))}choiceSelected(e){let t=e.target.value;this.options=this.options.map(r=>W(k({},r),{selected:r.value===t})),this.saveResponse(t)}};I.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"],s([Ur()],I.prototype,"options",2),s([Fr({attribute:"data-prompt",type:String})],I.prototype,"dataPrompt",2);customElements.define("qti-inline-choice-interaction",I);import{customElement as Yr,property as Br}from"lit/decorators.js";import{html as zr}from"lit";import{css as Xr}from"lit";var Vt=Xr`
98
98
  :host {
99
99
  display: flex;
100
100
  flex-direction: column;
@@ -163,7 +163,7 @@ import{a as gt,b as h}from"../chunk-BVYXUE3V.js";import{a as bt}from"../chunk-5G
163
163
  border-radius: 5px;
164
164
  margin-bottom: 3px;
165
165
  }
166
- `,s([$t()],u.prototype,"_result",2),s([$t()],u.prototype,"error",1);var q=class extends u{calculate(){throw new Error("Not implemented")}};var je=class extends q{calculate(){return Array.from(this.children).map(e=>{let t=e;if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let r=t.calculate();if(typeof r=="string")if(r==="true")r=!0;else if(r==="false")r=!1;else return console.error("unexpected value in qti-and, expected boolean"),null;return r}).every(e=>typeof e=="boolean"&&e)}};customElements.define("qti-and",je);import{property as ni}from"lit/decorators.js";var me=class extends u{constructor(){super(...arguments);this.baseType="string"}calculate(){return this.textContent}};s([ni({type:String,attribute:"base-type"})],me.prototype,"baseType",2);customElements.define("qti-base-value",me);var Ke=class extends q{calculate(){let i=this.getVariables();if(this.children.length===2){let e=i[0],t=i[1];if(e.baseType==="directedPair"&&t.baseType==="directedPair"&&e.cardinality==="multiple"){let r=e.value,o=t.value;return r.filter(c=>o.includes(c)).length>0}else if(e.baseType==="directedPair"&&t.baseType==="directedPair"&&e.cardinality==="single"){let r=e.value;return t.value.includes(r)}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",Ke);var We=class extends u{get interpretation(){return this.getAttribute("interpretation")||""}calculate(){let i=this.getAttribute("identifier")||"",e=this.closest("qti-assessment-item").getResponse(i);return e.correctResponse,e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}};customElements.define("qti-correct",We);import{property as ai}from"lit/decorators.js";var w=class{static compareSingleValues(i,e,t){switch(t){case"identifier":case"string":return i===e;case"integer":{let r=parseInt(i,10),o=parseInt(e,10);if(!isNaN(r)&&!isNaN(o))return r===o;console.error(`Cannot convert ${i} and/or ${e} to int.`);break}case"float":{let r=parseFloat(i),o=parseFloat(e);if(!isNaN(r)&&!isNaN(o))return r===o;console.error(`couldn't convert ${i} and/or ${e} to float.`);break}case"pair":case"directedPair":{let r=i.split(" ").sort(),o=e.split(" ").sort();if(r.length===2&&o.length===2)return t==="pair"&&(r.sort(),o.sort()),r.join(" ")===o.join(" ");console.error(`compared two pair but one of the values does not have 2 values: 1: ${i} 2: ${e}`);break}}return!1}};var he=class extends u{constructor(){super(...arguments);this.toleranceMode="exact"}calculate(){if(this.children.length===2){let e=this.getVariables(),t=e[0],r=e[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):t.cardinality!=="single"||r.cardinality!=="single"||Array.isArray(t.value)||Array.isArray(r.value)?(console.error("unexpected cardinality in qti equal"),!1):w.compareSingleValues(t.value,r.value,t.baseType)}return console.error("unexpected number of children in qti-equal"),null}};s([ai({type:String})],he.prototype,"toleranceMode",2);customElements.define("qti-equal",he);import{property as li}from"lit/decorators.js";var fe=class extends u{constructor(){super(...arguments);this.roundingMode="significantFigures"}get figures(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;let t=parseInt(this.getAttribute("figures")||"0");return isNaN(t)?(console.error("figures attribute is not a number"),null):t<0?(console.error("figures attribute is negative"),null):t<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):t}calculate(){if(this.children.length===2){let e=this.getVariables(),t=e[0],r=e[1];if(this.roundingMode===null)return null;if(t.cardinality!=="single"||r.cardinality!=="single"||Array.isArray(t.value)||Array.isArray(r.value))return console.error("unexpected cardinality in qti equal"),!1;switch(e[0].baseType){case"integer":case"float":{let o=parseFloat(t.value),n=parseFloat(r.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}};s([li({type:String})],fe.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",fe);var Ge=class extends u{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];if(e.baseType===t.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value>+t.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}};customElements.define("qti-gt",Ge);var Je=class extends q{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];return e.baseType===t.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value>=+t.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",Je);var Ze=class extends u{calculate(){if(this.children.length===1){let i=this.getVariables();if(!i)return!0;let e=i[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}};customElements.define("qti-is-null",Ze);var Qe=class extends u{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];if(e.baseType===t.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value<+t.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}};customElements.define("qti-lt",Qe);var et=class extends q{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];return e.baseType===t.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value<=+t.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",et);import{property as tt}from"lit/decorators.js";import{LitElement as ci}from"lit";var X=class extends ci{constructor(){super(...arguments);this.defaultValue=0}get mapEntries(){return Array.from(this.querySelectorAll("qti-map-entry")).map(e=>({mapKey:e.getAttribute("map-key"),mappedValue:+e.getAttribute("mapped-value")}))}};s([tt({attribute:"default-value",type:Number})],X.prototype,"defaultValue",2),s([tt({attribute:"lower-bound",type:Number})],X.prototype,"lowerBound",2),s([tt({attribute:"upper-bound",type:Number})],X.prototype,"upperBound",2);customElements.define("qti-mapping",X);import{property as pi}from"lit/decorators.js";var be=class extends u{calculate(){let e=this.assessmentItem.getResponse(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],o=0;for(let n of r){let l=t.mapEntries.find(c=>w.compareSingleValues(c.mapKey,n,e.baseType));l==null||l.mappedValue==null?o+=t.defaultValue:o+=l.mappedValue}return t.lowerBound!=null&&(o=Math.max(t.lowerBound,o)),t.upperBound!=null&&(o=Math.min(t.upperBound,o)),o}};s([pi({type:String})],be.prototype,"identifier",2);customElements.define("qti-map-response",be);var rt=class a extends u{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];return this._result=a.match(e,t),this._result}return console.error("unexpected number of children in match"),null}static match(i,e){if(e.cardinality==="single")return Array.isArray(i.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):w.compareSingleValues(i.value.toString(),e.value.toString(),e.baseType);{if(!Array.isArray(i.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(i.value.length!==e.value.length)return!1;let t=0;for(let r of e.value){if(e.cardinality==="ordered"){let o=i[t];if(!w.compareSingleValues(r,o,e.baseType))return!1}else{let o=null;for(let n of i.value)if(w.compareSingleValues(r,n,e.baseType)){o=n;break}if(o!==null)i.value.splice(i.value.indexOf(o),1);else return!1}t++}return!0}}};customElements.define("qti-match",rt);var it=class extends u{calculate(){let i=this.getVariables();this.children.length!==2&&(this.error="The member operator takes two sub-expressions");let[e,t]=i;if(e.baseType!==t.baseType&&(this.error="Which must both have the same base-type"),t.cardinality==="multiple"||t.cardinality==="ordered"||(this.error="and the second must be a multiple or ordered container"),(e.baseType==="float"||t.baseType==="float")&&(this.error="The member operator should not be used on sub-expressions with a base-type of float"),(e.baseType==="duration"||t.baseType==="duration")&&(this.error="It must not be used on sub-expressions with a base-type of duration"),e.value===null||t.value===null)return null;let r=e.value;return t.value.includes(r)}};customElements.define("qti-member",it);var st=class extends u{calculate(){let i=this.getVariables();if(i.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of i)if(e.cardinality!=="multiple"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[];return i}};customElements.define("qti-multiple",st);import{html as di}from"lit";var ot=class extends u{render(){return di`${super.render()}`}calculate(){return!this.firstElementChild.calculate()}};customElements.define("qti-not",ot);import{html as ui}from"lit";var nt=class extends q{render(){return ui``}calculate(){return Array.from(this.children).map(e=>{let t=e;if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let r=t.calculate();if(typeof r=="string")if(r==="true")r=!0;else if(r==="false")r=!1;else return console.error("unexpected value in qti-and, expected boolean"),null;return r}).some(e=>typeof e=="boolean"&&e)}};customElements.define("qti-or",nt);var at=class extends u{calculate(){let i=this.getVariables();if(i.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of i)if(e.cardinality!=="ordered"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[];return i}};customElements.define("qti-ordered",at);import{LitElement as mi,html as Ot}from"lit";import{property as hi,state as fi}from"lit/decorators.js";var ee=class extends mi{constructor(){super();this.value="";this.closest("qti-assessment-item").addEventListener("qti-response-processing",()=>{this.value=this.calculate()})}render(){return Ot`${Array.isArray(this.value)?this.value.map(e=>Ot`${e}`):this.value}`}calculate(){let e=this.closest("qti-assessment-item"),t=this.identifier;return e.getVariable(t).value}};s([hi({type:String})],ee.prototype,"identifier",2),s([fi()],ee.prototype,"value",2);customElements.define("qti-printed-variable",ee);var lt=class extends u{calculate(){return this.getVariables().reduce((t,r)=>{if(r.baseType=="float"||r.baseType=="integer")try{return t*parseInt(r.value.toString())}catch(o){console.warn("can not convert to number")}else console.warn(`has another baseType ${r.baseType}`);return t},1)}};customElements.define("qti-product",lt);var ct=class extends u{calculate(){let i=this.getAttribute("identifier");return this.closest("qti-assessment-item").getVariable(i).value}};customElements.define("qti-variable",ct);import{LitElement as bi,html as Pt}from"lit";var pt=class extends bi{constructor(){super(...arguments);this._errorMessage=null}static get properties(){return{responseIdentifier:{type:String,attribute:"response-identifier"},module:{type:String,attribute:"module"},customInteractionTypeIdentifier:{type:String,attribute:"custom-interaction-type-identifier"},baseUrl:{type:String,attribute:"base-url"},_errorMessage:{type:String,state:!0}}}getTAOConfig(e){let t=e.querySelectorAll("properties"),r={},o=l=>{let c={},p=l.getAttribute("key");if(p){let d=Array.from(l.children),m=d.map(g=>g.getAttribute("key"));m.length>0&&!m.find(g=>!Number.isInteger(+g))?c[p]=d.map(g=>n(g)):c[p]=l.textContent}return c},n=l=>{if(l){let c={};for(let p of l.children)c=k(k({},c),o(p));return c}};for(let l of t)return l.getAttribute("key")||(r=k(k({},r),n(l))),r;console.log("Can not find qti-custom-interaction config")}register(e){let t=this.parentElement.tagName==="QTI-CUSTOM-INTERACTION"?"TAO":"IMS",r=t=="IMS"?this.querySelector("qti-interaction-markup"):this.querySelector("markup");r.classList.add("qti-customInteraction"),t=="TAO"&&this.querySelector("properties")&&(this.querySelector("properties").style.display="none");let o=t=="IMS"?{properties:this.dataset}:this.getTAOConfig(this);t=="IMS"?e.getInstance(r,o,void 0):e.initialize(this.customInteractionTypeIdentifier,r.firstElementChild,o),t=="TAO"&&Array.from(this.querySelectorAll("link")).map(l=>l.getAttribute("href")).forEach(l=>{let c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.media="screen",c.href=l,r.appendChild(c)})}connectedCallback(){super.connectedCallback();let e={context:this.customInteractionTypeIdentifier,baseUrl:this.baseUrl,catchError:!0};if(window.requirePaths&&window.requireShim&&(e.paths=window.requirePaths,e.shim=window.requireShim),!globalThis.require){this._errorMessage="requirejs not found, load with cdn: https://cdnjs.com/libraries/require.js";return}requirejs.config(e)(["require"],r=>{define("qtiCustomInteractionContext",()=>({register:o=>{this.register(o)},notifyReady:()=>{}})),r([this.module],()=>{},o=>{this._errorMessage=o})},r=>{this._errorMessage=r})}render(){return Pt`<slot></slot>${this._errorMessage&&Pt`<div style="color:red">
166
+ `,s([$t()],u.prototype,"_result",2),s([$t()],u.prototype,"error",1);var q=class extends u{calculate(){throw new Error("Not implemented")}};var je=class extends q{calculate(){return Array.from(this.children).map(e=>{let t=e;if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let r=t.calculate();if(typeof r=="string")if(r==="true")r=!0;else if(r==="false")r=!1;else return console.error("unexpected value in qti-and, expected boolean"),null;return r}).every(e=>typeof e=="boolean"&&e)}};customElements.define("qti-and",je);import{property as ni}from"lit/decorators.js";var me=class extends u{constructor(){super(...arguments);this.baseType="string"}calculate(){return this.textContent}};s([ni({type:String,attribute:"base-type"})],me.prototype,"baseType",2);customElements.define("qti-base-value",me);var Ke=class extends q{calculate(){let i=this.getVariables();if(this.children.length===2){let e=i[0],t=i[1];if(e.baseType==="directedPair"&&t.baseType==="directedPair"&&e.cardinality==="multiple"){let r=e.value,o=t.value;return r.filter(c=>o.includes(c)).length>0}else if(e.baseType==="directedPair"&&t.baseType==="directedPair"&&e.cardinality==="single"){let r=e.value;return t.value.includes(r)}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",Ke);var We=class extends u{get interpretation(){return this.getAttribute("interpretation")||""}calculate(){let i=this.getAttribute("identifier")||"",e=this.closest("qti-assessment-item").getResponse(i);return e.correctResponse,e.cardinality!=="single"?e.correctResponse.length>0?e.correctResponse[0]:"":e.correctResponse}};customElements.define("qti-correct",We);import{property as ai}from"lit/decorators.js";var R=class{static compareSingleValues(i,e,t){switch(t){case"identifier":case"string":return i===e;case"integer":{let r=parseInt(i,10),o=parseInt(e,10);if(!isNaN(r)&&!isNaN(o))return r===o;console.error(`Cannot convert ${i} and/or ${e} to int.`);break}case"float":{let r=parseFloat(i),o=parseFloat(e);if(!isNaN(r)&&!isNaN(o))return r===o;console.error(`couldn't convert ${i} and/or ${e} to float.`);break}case"pair":case"directedPair":{let r=i.split(" ").sort(),o=e.split(" ").sort();if(r.length===2&&o.length===2)return t==="pair"&&(r.sort(),o.sort()),r.join(" ")===o.join(" ");console.error(`compared two pair but one of the values does not have 2 values: 1: ${i} 2: ${e}`);break}}return!1}};var he=class extends u{constructor(){super(...arguments);this.toleranceMode="exact"}calculate(){if(this.children.length===2){let e=this.getVariables(),t=e[0],r=e[1];return this.toleranceMode!=="exact"?(console.error("toleranceMode is not supported yet"),!1):t.cardinality!=="single"||r.cardinality!=="single"||Array.isArray(t.value)||Array.isArray(r.value)?(console.error("unexpected cardinality in qti equal"),!1):R.compareSingleValues(t.value,r.value,t.baseType)}return console.error("unexpected number of children in qti-equal"),null}};s([ai({type:String})],he.prototype,"toleranceMode",2);customElements.define("qti-equal",he);import{property as li}from"lit/decorators.js";var fe=class extends u{constructor(){super(...arguments);this.roundingMode="significantFigures"}get figures(){if(!this.getAttribute("figures"))return console.error("figures attribute is missing"),null;let t=parseInt(this.getAttribute("figures")||"0");return isNaN(t)?(console.error("figures attribute is not a number"),null):t<0?(console.error("figures attribute is negative"),null):t<1&&this.roundingMode==="significantFigures"?(console.error("figures cannot be smaller than 1 for RoundingMode significantFigures"),null):t}calculate(){if(this.children.length===2){let e=this.getVariables(),t=e[0],r=e[1];if(this.roundingMode===null)return null;if(t.cardinality!=="single"||r.cardinality!=="single"||Array.isArray(t.value)||Array.isArray(r.value))return console.error("unexpected cardinality in qti equal"),!1;switch(e[0].baseType){case"integer":case"float":{let o=parseFloat(t.value),n=parseFloat(r.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}};s([li({type:String})],fe.prototype,"roundingMode",2);customElements.define("qti-equal-rounded",fe);var Ge=class extends u{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];if(e.baseType===t.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value>+t.value;console.error("unexpected baseType or cardinality in qti gt")}return console.error("unexpected number of children in qt"),null}};customElements.define("qti-gt",Ge);var Je=class extends q{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];return e.baseType===t.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value>=+t.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",Je);var Ze=class extends u{calculate(){if(this.children.length===1){let i=this.getVariables();if(!i)return!0;let e=i[0].value;return e==null||e==null||e===""}return console.error("unexpected number of children in qti Null"),null}};customElements.define("qti-is-null",Ze);var Qe=class extends u{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];if(e.baseType===t.baseType&&(e.baseType==="integer"||e.baseType==="float"))return+e.value<+t.value;console.error("unexpected baseType or cardinality in qti lt")}return console.error("unexpected number of children in lt"),null}};customElements.define("qti-lt",Qe);var et=class extends q{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];return e.baseType===t.baseType&&(e.baseType==="integer"||e.baseType==="float")?+e.value<=+t.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",et);import{property as tt}from"lit/decorators.js";import{LitElement as ci}from"lit";var X=class extends ci{constructor(){super(...arguments);this.defaultValue=0}get mapEntries(){return Array.from(this.querySelectorAll("qti-map-entry")).map(e=>({mapKey:e.getAttribute("map-key"),mappedValue:+e.getAttribute("mapped-value")}))}};s([tt({attribute:"default-value",type:Number})],X.prototype,"defaultValue",2),s([tt({attribute:"lower-bound",type:Number})],X.prototype,"lowerBound",2),s([tt({attribute:"upper-bound",type:Number})],X.prototype,"upperBound",2);customElements.define("qti-mapping",X);import{property as pi}from"lit/decorators.js";var be=class extends u{calculate(){let e=this.assessmentItem.getResponse(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],o=0;for(let n of r){let l=t.mapEntries.find(c=>R.compareSingleValues(c.mapKey,n,e.baseType));l==null||l.mappedValue==null?o+=t.defaultValue:o+=l.mappedValue}return t.lowerBound!=null&&(o=Math.max(t.lowerBound,o)),t.upperBound!=null&&(o=Math.min(t.upperBound,o)),o}};s([pi({type:String})],be.prototype,"identifier",2);customElements.define("qti-map-response",be);var rt=class a extends u{calculate(){if(this.children.length===2){let i=this.getVariables(),e=i[0],t=i[1];return this._result=a.match(e,t),this._result}return console.error("unexpected number of children in match"),null}static match(i,e){if(e.cardinality==="single")return Array.isArray(i.value)||Array.isArray(e.value)?(console.error("unexpected cardinality in qti match"),!1):R.compareSingleValues(i.value.toString(),e.value.toString(),e.baseType);{if(!Array.isArray(i.value)||!Array.isArray(e.value))return console.error("unexpected cardinality in qti match"),!1;if(i.value.length!==e.value.length)return!1;let t=0;for(let r of e.value){if(e.cardinality==="ordered"){let o=i[t];if(!R.compareSingleValues(r,o,e.baseType))return!1}else{let o=null;for(let n of i.value)if(R.compareSingleValues(r,n,e.baseType)){o=n;break}if(o!==null)i.value.splice(i.value.indexOf(o),1);else return!1}t++}return!0}}};customElements.define("qti-match",rt);var it=class extends u{calculate(){let i=this.getVariables();this.children.length!==2&&(this.error="The member operator takes two sub-expressions");let[e,t]=i;if(e.baseType!==t.baseType&&(this.error="Which must both have the same base-type"),t.cardinality==="multiple"||t.cardinality==="ordered"||(this.error="and the second must be a multiple or ordered container"),(e.baseType==="float"||t.baseType==="float")&&(this.error="The member operator should not be used on sub-expressions with a base-type of float"),(e.baseType==="duration"||t.baseType==="duration")&&(this.error="It must not be used on sub-expressions with a base-type of duration"),e.value===null||t.value===null)return null;let r=e.value;return t.value.includes(r)}};customElements.define("qti-member",it);var st=class extends u{calculate(){let i=this.getVariables();if(i.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of i)if(e.cardinality!=="multiple"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti multiple"),[];return i}};customElements.define("qti-multiple",st);import{html as di}from"lit";var ot=class extends u{render(){return di`${super.render()}`}calculate(){return!this.firstElementChild.calculate()}};customElements.define("qti-not",ot);import{html as ui}from"lit";var nt=class extends q{render(){return ui``}calculate(){return Array.from(this.children).map(e=>{let t=e;if(!t.calculate)return console.error("Element doesn't implement QtiConditionExpression"),null;let r=t.calculate();if(typeof r=="string")if(r==="true")r=!0;else if(r==="false")r=!1;else return console.error("unexpected value in qti-and, expected boolean"),null;return r}).some(e=>typeof e=="boolean"&&e)}};customElements.define("qti-or",nt);var at=class extends u{calculate(){let i=this.getVariables();if(i.length===0)return console.error("unexpected number of children in qti multiple"),null;for(let e of i)if(e.cardinality!=="ordered"&&e.cardinality!=="single")return console.error("unexpected cardinality in qti ordered"),[];return i}};customElements.define("qti-ordered",at);import{LitElement as mi,html as Ot}from"lit";import{property as hi,state as fi}from"lit/decorators.js";var ee=class extends mi{constructor(){super();this.value="";this.closest("qti-assessment-item").addEventListener("qti-response-processing",()=>{this.value=this.calculate()})}render(){return Ot`${Array.isArray(this.value)?this.value.map(e=>Ot`${e}`):this.value}`}calculate(){let e=this.closest("qti-assessment-item"),t=this.identifier;return e.getVariable(t).value}};s([hi({type:String})],ee.prototype,"identifier",2),s([fi()],ee.prototype,"value",2);customElements.define("qti-printed-variable",ee);var lt=class extends u{calculate(){return this.getVariables().reduce((t,r)=>{if(r.baseType=="float"||r.baseType=="integer")try{return t*parseInt(r.value.toString())}catch(o){console.warn("can not convert to number")}else console.warn(`has another baseType ${r.baseType}`);return t},1)}};customElements.define("qti-product",lt);var ct=class extends u{calculate(){let i=this.getAttribute("identifier");return this.closest("qti-assessment-item").getVariable(i).value}};customElements.define("qti-variable",ct);import{LitElement as bi,html as Pt}from"lit";var pt=class extends bi{constructor(){super(...arguments);this._errorMessage=null}static get properties(){return{responseIdentifier:{type:String,attribute:"response-identifier"},module:{type:String,attribute:"module"},customInteractionTypeIdentifier:{type:String,attribute:"custom-interaction-type-identifier"},baseUrl:{type:String,attribute:"base-url"},_errorMessage:{type:String,state:!0}}}getTAOConfig(e){let t=e.querySelectorAll("properties"),r={},o=l=>{let c={},p=l.getAttribute("key");if(p){let d=Array.from(l.children),m=d.map(g=>g.getAttribute("key"));m.length>0&&!m.find(g=>!Number.isInteger(+g))?c[p]=d.map(g=>n(g)):c[p]=l.textContent}return c},n=l=>{if(l){let c={};for(let p of l.children)c=k(k({},c),o(p));return c}};for(let l of t)return l.getAttribute("key")||(r=k(k({},r),n(l))),r;console.log("Can not find qti-custom-interaction config")}register(e){let t=this.parentElement.tagName==="QTI-CUSTOM-INTERACTION"?"TAO":"IMS",r=t=="IMS"?this.querySelector("qti-interaction-markup"):this.querySelector("markup");r.classList.add("qti-customInteraction"),t=="TAO"&&this.querySelector("properties")&&(this.querySelector("properties").style.display="none");let o=t=="IMS"?{properties:this.dataset}:this.getTAOConfig(this);t=="IMS"?e.getInstance(r,o,void 0):e.initialize(this.customInteractionTypeIdentifier,r.firstElementChild,o),t=="TAO"&&Array.from(this.querySelectorAll("link")).map(l=>l.getAttribute("href")).forEach(l=>{let c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.media="screen",c.href=l,r.appendChild(c)})}connectedCallback(){super.connectedCallback();let e={context:this.customInteractionTypeIdentifier,baseUrl:this.baseUrl,catchError:!0};if(window.requirePaths&&window.requireShim&&(e.paths=window.requirePaths,e.shim=window.requireShim),!globalThis.require){this._errorMessage="requirejs not found, load with cdn: https://cdnjs.com/libraries/require.js";return}requirejs.config(e)(["require"],r=>{define("qtiCustomInteractionContext",()=>({register:o=>{this.register(o)},notifyReady:()=>{}})),r([this.module],()=>{},o=>{this._errorMessage=o})},r=>{this._errorMessage=r})}render(){return Pt`<slot></slot>${this._errorMessage&&Pt`<div style="color:red">
167
167
  <h1>Error</h1>
168
168
  ${this._errorMessage}
169
169
  </div>`}`}};customElements.define("qti-portable-custom-interaction",pt);import{LitElement as vi,css as yi,html as Ut}from"lit";var ge=class a{constructor(){this._touchBegin=0;this._touchDown=null;this._lastClick=0;this._canDrag=!1;this._dragSrc=null;this._dragCopy=null;this._touchEndCalled=!1;this._dragRunning=!1;this._dataTransfer={data:{},setData:function(i,e){this.data[i]=e},getData:function(i){return this.data[i]},effectAllowed:"move"};this._copyOffset={x:0,y:0};this._lastTarget=null;this._currentDropContainer=null;this._handleClick=!0;this._DBLCLICKDELAY=500;this._CONTEXTMENUDELAY=1e3;this._DRAGDELTA=5;this._COPYOPACITY=.7;this.copyStylesDragClone=!0;this.dragOnClick=!1;this._createDragCopy=(i,e)=>{if(this._dragCopy===null&&this._dragRunning){this._dragSrc.style.opacity=this._COPYOPACITY,this._dragCopy=this._dragSrc.cloneNode(!0);let t=window.getComputedStyle(this._dragSrc);if(this._dragCopy.style="",this._dragCopy.setAttribute("dragclone",""),this.copyStylesDragClone)for(let r of t)this._dragCopy.style[r]=t.getPropertyValue(r);this._calculateDragCopyPosition(e),this._dragCopy.style.top=e.clientY-this._copyOffset.y+"px",this._dragCopy.style.left=e.clientX-this._copyOffset.x+"px",this._dragCopy.style.position="fixed",this._dragCopy.style.pointerEvents="none",this._dragCopy.style.zIndex="999999",this._dragCopy=document.body.appendChild(this._dragCopy),this._dispatchEvent(this._dragSrc,"dragstart")}if(this._dragRunning){let t=this;requestAnimationFrame(function(){t._touchEndCalled||t._dragCopy===null||(t._dragCopy.style.top=e.clientY-t._copyOffset.y+"px",t._dragCopy.style.left=e.clientX-t._copyOffset.x+"px")});let r=this._findDroppable(i);r!=this._lastTarget&&(this._dispatchEvent(r,"dragenter"),this._dispatchEvent(this._lastTarget,"dragleave"),this._lastTarget=r),this._currentDropContainer=r,this._currentDropContainer&&this._dispatchEvent(r,"dragover")}};return a._instance?a._instance:(a._instance=this,document.addEventListener("touchmove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("mousemove",this._touchMove.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchend",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("mouseup",this._touchEnd.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchcancel",this._touchCancel.bind(this),{passive:!1,capture:!1}),this)}addDraggables(i){i.forEach(e=>{e.addEventListener("touchstart",this._touchStart.bind(this),{passive:!1,capture:!1}),e.addEventListener("mousedown",this._touchStart.bind(this),{passive:!1,capture:!1})})}_touchStart(i){this._touchBegin=Date.now();let{x:e,y:t}=this._getPoint(i);if(this._touchDown={x:e,y:t},this._dragSrc=i.currentTarget,this._canDrag=!0,this.dragOnClick){let r={clientX:e,clientY:t};this._dragRunning=!0,this._createDragCopy(i,r)}i.preventDefault()}_touchMove(i){if(this._canDrag&&this._dragSrc){let{x:e,y:t}=this._getPoint(i),r={clientX:e,clientY:t};this._getDelta(r)>=this._DRAGDELTA&&(this._dragRunning=!0),this._createDragCopy(i,r),i.preventDefault()}}_touchEnd(i){var e;if(this._touchEndCalled=!0,this._canDrag=!1,this._currentDropContainer)this._dispatchEvent(this._currentDropContainer,"drop"),this._dispatchEvent(this._dragSrc,"dragend");else if(this._dragRunning){let t=new CustomEvent("dragend",{bubbles:!0,cancelable:!0});t.dataTransfer={dropEffect:"none"},(e=this._dragSrc)==null||e.dispatchEvent(t)}this._reset()}_touchCancel(i){this._reset()}_findDroppable(i){let e=this._getPoint(i);return this.elementFromPoint(e.x,e.y)}elementFromPoint(i,e){let t=document.elementFromPoint(i,e);if(t){for(;t.shadowRoot;){let r=t.shadowRoot.elementFromPoint(i,e);if(r===null||r===t)break;t=r}return t}return null}_getPoint(i,e){return i&&i.touches&&(i=i.touches[0]),{x:e?i.pageX:i.clientX,y:e?i.pageY:i.clientY}}_calculateDragCopyPosition(i){let e=this._dragSrc.getBoundingClientRect();this._copyOffset.x=i.clientX-e.left,this._copyOffset.y=i.clientY-e.top}_getDelta(i){let e=Math.abs(i.clientX-this._touchDown.x),t=Math.abs(i.clientY-this._touchDown.y);return e+t}_dispatchEvent(i,e,t=!0){if(!i)return!1;let r=new CustomEvent(e,{bubbles:t,cancelable:!0});return r.dataTransfer=this._dataTransfer,i.dispatchEvent(r),r.defaultPrevented}_reset(){this._dragRunning&&(this._dragSrc.style.opacity="1.0",this._dragCopy.parentElement.removeChild(this._dragCopy)),this._dragRunning=!1,this._dragSrc=null,this._dragCopy=null,this._canDrag=!1,this._touchBegin=0,this._touchDown=null,this._lastClick=0,this._touchEndCalled=!1,this._dataTransfer={data:{},setData:function(i,e){this.data[i]=e},getData:function(i){return this.data[i]},effectAllowed:"move"},this._copyOffset={x:0,y:0},this._lastTarget=null,this._currentDropContainer=null,this._handleClick=!0}};import{property as gi}from"lit/decorators.js";var It=(a,i,e)=>{class t extends a{constructor(){super(...arguments);this.disabled=!1}firstUpdated(n){if(this.classList.contains("qti-match-tabular"))return;super.firstUpdated(n);let l=Array.from(i?this.shadowRoot.querySelectorAll(e):this.querySelectorAll(e));this.dragoverHandler=this.dragoverHandler.bind(this),this.dragleaveHandler=this.dragleaveHandler.bind(this),this.dragenterHandler=this.dragenterHandler.bind(this),this.dropHandler=this.dropHandler.bind(this),l.forEach(c=>{c.setAttribute("dropzone","move"),c.addEventListener("dragleave",this.dragleaveHandler),this.attachHandler(c)});for(let c of l)this.observer=new MutationObserver(p=>{p.forEach(d=>{if(d.type==="attributes")switch(d.attributeName){case"disabled":{c.hasAttribute("disabled")?this.removeHandler(c):this.attachHandler(c);break}}})}),this.observer.observe(c,{attributes:!0})}attachHandler(n){n.addEventListener("dragover",this.dragoverHandler),n.addEventListener("dragenter",this.dragenterHandler),n.addEventListener("drop",this.dropHandler)}removeHandler(n){n.removeEventListener("dragover",this.dragoverHandler),n.removeEventListener("dragenter",this.dragenterHandler),n.removeEventListener("drop",this.dropHandler)}disconnectedCallback(){var n;this.classList.contains("qti-match-tabular")||(super.disconnectedCallback(),(n=this.observer)==null||n.disconnect())}dragenterHandler(n){n.preventDefault()}dragoverHandler(n){return n.preventDefault(),n.currentTarget.setAttribute("active",""),n.dataTransfer.dropEffect="move",!1}dropHandler(n){n.preventDefault();let l=n.currentTarget,c=this.querySelector(`[identifier=${n.dataTransfer.getData("text")}`),p=c||this.shadowRoot.querySelector(`[identifier=${n.dataTransfer.getData("text")}`);return l?p.parentElement.getAttribute("identifier")!==l.getAttribute("identifier")&&l.appendChild(p):console.error(`cannot find droppable, target: ${n.target?JSON.stringify(n.target):"null"}`),l.removeAttribute("active"),!1}dragleaveHandler(n){return n.preventDefault(),n.currentTarget.removeAttribute("active"),n.dataTransfer.dropEffect="none",!1}}return s([gi({type:Boolean,reflect:!0})],t.prototype,"disabled",2),t};var Ft=(a,i,e)=>{class t extends a{}return t};import{property as Y}from"lit/decorators.js";var L=(a,i,e,t)=>{class r extends Ft(It(a,e,t),t,i){constructor(){super(...arguments);this.draggables=new Map;this.responseIdentifier="";this.configuration={copyStylesDragClone:!0,dragCanBePlacedBack:!0,dragOnClick:!1};this.disabled=!1;this.readonly=!1;this.minAssociations=1;this.maxAssociations=1}reInitDragAndDrop(l,c){if(this.classList.contains("qti-match-tabular"))return;l.filter(d=>!this.draggables||!this.draggables.get(d)).length>0&&(this.dragDropApi.addDraggables(l),l.forEach(d=>{this.draggables.set(d,{parent:d.parentElement,index:Array.from(d.parentNode.children).indexOf(d)}),d.setAttribute("qti-draggable","true"),d.addEventListener("dragstart",m=>{m.dataTransfer.setData("text",m.currentTarget.getAttribute("identifier")),d.setAttribute("dragging","")}),d.addEventListener("dragend",m=>{if(m.preventDefault(),d.removeAttribute("over"),d.removeAttribute("dragging"),(m.dataTransfer.dropEffect==="none"||m.dataTransfer.dropEffect===void 0)&&this.configuration.dragCanBePlacedBack){let C=m.currentTarget,g=this.draggables.get(C),Me=g.index<g.parent.children.length?g.index:g.parent.children.length-1,b=g.parent,Ve=g.parent.children[Me];b.insertBefore(C,Ve),this.saveResponse(),this.checkMaxMatchAssociations()}m.dataTransfer.dropEffect==="move"&&(this.saveResponse(),this.checkMaxMatchAssociations())})}))}handleDragOptionsChanged(l,c){this.dragDropApi.copyStylesDragClone=c.copyStylesDragClone,this.dragDropApi.dragOnClick=c.dragOnClick}handleDisabledChange(l,c){this.draggables.forEach((p,d)=>{c?d.setAttribute("disabled",""):d.removeAttribute("disabled"),c?d.removeAttribute("qti-draggable"):d.setAttribute("qti-draggable","true")})}handleReadonlyChange(l,c){this.draggables.forEach((p,d)=>{c?d.setAttribute("readonly",""):d.removeAttribute("readonly"),c?d.removeAttribute("qti-draggable"):d.setAttribute("qti-draggable","true")})}firstUpdated(l){super.firstUpdated(l),this.droppables=Array.from(e?this.shadowRoot.querySelectorAll(t):this.querySelectorAll(t))}connectedCallback(){super.connectedCallback(),this.dragDropApi=new ge,this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,detail:this}))}reset(l=!0){this.draggables.forEach((c,p)=>{let d=c.parent.children,m=c.index<d.length?c.index:d.length;c.parent.insertBefore(p,d[m])}),l&&this.saveResponse()}checkMaxMatchAssociations(){this.droppables.forEach(l=>{let p=+(l.getAttribute("match-max")||1)<=(l.children.length||0);p?l.setAttribute("disabled",""):l.removeAttribute("disabled"),p?l.removeAttribute("dropzone"):l.setAttribute("dropzone","move")})}set response(l){this.classList.contains("qti-match-tabular")||(this.reset(!1),l!==null&&Array.isArray(l)&&l.forEach(c=>{let[p,...d]=c.split(" ").reverse();if(p){let m=this.droppables.find(C=>C.getAttribute("identifier")===p);d.forEach(C=>{let g=this.querySelector(`[identifier=${C}]`);m?g?(m.appendChild(g),this.checkMaxMatchAssociations()):console.error(`cannot find draggable with identifier: ${C}`):console.error(`cannot find droppable with identifier: ${p}`)})}}))}validate(){let c=(e?Array.from(this.shadowRoot.querySelectorAll(t)):Array.from(this.querySelectorAll(t))).filter(p=>p.childElementCount>0).length;return this.minAssociations<=0||this.minAssociations<=c}saveResponse(){let l=this.droppables.map(c=>{var d;let p="";return((d=c.children)==null?void 0:d.length)>0&&(p+=Array.from(c.children).map(m=>m.getAttribute("identifier")).join(" ")+" "),p+=c.getAttribute("identifier"),p});this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:l}}))}}return s([gt(i)],r.prototype,"reInitDragAndDrop",1),s([Y({type:String,attribute:"response-identifier"})],r.prototype,"responseIdentifier",2),s([Y({attribute:!1,type:Object})],r.prototype,"configuration",2),s([h("configuration")],r.prototype,"handleDragOptionsChanged",1),s([Y({type:Boolean,reflect:!0})],r.prototype,"disabled",2),s([h("disabled",{waitUntilFirstUpdate:!0})],r.prototype,"handleDisabledChange",1),s([Y({type:Boolean,reflect:!0})],r.prototype,"readonly",2),s([h("readonly",{waitUntilFirstUpdate:!0})],r.prototype,"handleReadonlyChange",1),s([Y({type:Number,reflect:!0,attribute:"min-associations"})],r.prototype,"minAssociations",2),s([Y({type:Number,reflect:!0,attribute:"max-associations"})],r.prototype,"maxAssociations",2),r};import{state as xi}from"lit/decorators.js";var te=class extends L(vi,"qti-simple-associable-choice",!0,".dl"){render(){return Ut` <slot name="prompt"></slot>
@@ -204,14 +204,14 @@ import{a as gt,b as h}from"../chunk-BVYXUE3V.js";import{a as bt}from"../chunk-5G
204
204
  align-items: flex-start;
205
205
  flex: 1;
206
206
  }
207
- `];customElements.define("qti-gap-match-interaction",ve);import{css as _i,svg as Xt,html as ki}from"lit";function B(a,i,e,t){switch(a){case"circle":{let[r,o,n]=i,l=r/e.width*100,c=o/e.height*100,p=n/e.width*100;t.style.left=l-p+"%",t.style.top=c-p+"%",t.style.width=t.style.height=4*p+"px",t.style.borderRadius="9999px"}break;case"rect":{let[r,o,n,l]=i,c=r/e.width*100,p=o/e.height*100,d=n/e.width*100,m=l/e.height*100;t.style.left=c+"%",t.style.top=p+"%",t.style.width=d-c+"%",t.style.height=m-p+"%"}break;case"poly":{let r=i.reduce((b,Ve,ft,Gt)=>{if(ft%2===1){let Jt=b.pop();b[b.length]={x:Jt,y:Gt[ft]}}else b.push(Ve);return b},[]),o=Math.min(...r.map(b=>b.x)),n=Math.max(...r.map(b=>b.x)),l=Math.min(...r.map(b=>b.y)),c=Math.max(...r.map(b=>b.y)),p=o/e.width*100,d=l/e.height*100,m=n/e.width*100,C=c/e.height*100;t.style.left=o/e.width*100+"%",t.style.top=l/e.height*100+"%",t.style.width=m-p+"%",t.style.height=C-d+"%";let Me=r.map(b=>({x:(b.x-o)/(n-o)*100,y:(b.y-l)/(c-l)*100})).map(b=>Math.round(b.x)+"% "+Math.round(b.y)+"%").join(",");t.style.clipPath=`polygon(${Me})`}break;default:break}}import{query as Ai,queryAssignedElements as Ri,state as dt}from"lit/decorators.js";import{repeat as Ti}from"lit/directives/repeat.js";import{ifDefined as Yt}from"lit/directives/if-defined.js";var M=class extends f{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 response(e){Array.isArray(e)&&(this._lines=e)}render(){var e,t,r,o;return ki`<slot name="prompt"></slot>
207
+ `];customElements.define("qti-gap-match-interaction",ve);import{css as _i,svg as Xt,html as ki}from"lit";function B(a,i,e,t){switch(a){case"circle":{let[r,o,n]=i,l=r/e.width*100,c=o/e.height*100,p=n/e.width*100;t.style.left=l-p+"%",t.style.top=c-p+"%",t.style.width=t.style.height=4*p+"px",t.style.borderRadius="9999px"}break;case"rect":{let[r,o,n,l]=i,c=r/e.width*100,p=o/e.height*100,d=n/e.width*100,m=l/e.height*100;t.style.left=c+"%",t.style.top=p+"%",t.style.width=d-c+"%",t.style.height=m-p+"%"}break;case"poly":{let r=i.reduce((b,Ve,ft,Gt)=>{if(ft%2===1){let Jt=b.pop();b[b.length]={x:Jt,y:Gt[ft]}}else b.push(Ve);return b},[]),o=Math.min(...r.map(b=>b.x)),n=Math.max(...r.map(b=>b.x)),l=Math.min(...r.map(b=>b.y)),c=Math.max(...r.map(b=>b.y)),p=o/e.width*100,d=l/e.height*100,m=n/e.width*100,C=c/e.height*100;t.style.left=o/e.width*100+"%",t.style.top=l/e.height*100+"%",t.style.width=m-p+"%",t.style.height=C-d+"%";let Me=r.map(b=>({x:(b.x-o)/(n-o)*100,y:(b.y-l)/(c-l)*100})).map(b=>Math.round(b.x)+"% "+Math.round(b.y)+"%").join(",");t.style.clipPath=`polygon(${Me})`}break;default:break}}import{query as Ai,queryAssignedElements as Ti,state as dt}from"lit/decorators.js";import{repeat as wi}from"lit/directives/repeat.js";import{ifDefined as Yt}from"lit/directives/if-defined.js";var M=class extends f{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 response(e){Array.isArray(e)&&(this._lines=e)}render(){var e,t,r,o;return ki`<slot name="prompt"></slot>
208
208
  <line-container>
209
209
  <svg
210
210
  width=${Yt((e=this.grImage[0])==null?void 0:e.width)}
211
211
  height=${Yt((t=this.grImage[0])==null?void 0:t.height)}
212
212
  viewbox="0 0 ${(r=this.grImage[0])==null?void 0:r.width} ${(o=this.grImage[0])==null?void 0:o.height}"
213
213
  >
214
- ${Ti(this._lines,n=>n,(n,l)=>Xt`
214
+ ${wi(this._lines,n=>n,(n,l)=>Xt`
215
215
  <line
216
216
  part="line"
217
217
  x1=${parseInt(this.querySelector("[identifier="+n.split(" ")[0]+"]").style.left)}
@@ -257,8 +257,8 @@ import{a as gt,b as h}from"../chunk-BVYXUE3V.js";import{a as bt}from"../chunk-5G
257
257
  top: 0px;
258
258
  left: 0px;
259
259
  }
260
- `],s([dt()],M.prototype,"_lines",2),s([dt()],M.prototype,"startCoord",2),s([dt()],M.prototype,"mouseCoord",2),s([Ai("svg")],M.prototype,"svgContainer",2),s([Ri({selector:"img"})],M.prototype,"grImage",2);customElements.define("qti-graphic-associate-interaction",M);import{css as wi,html as Li,LitElement as Si}from"lit";var ye=class extends L(Si,"qti-gap-img",!1,"qti-associable-hotspot"){render(){return Li` <slot></slot>
261
- <slot name="qti-gap-img"></slot>`}positionHotspotOnRegister(i){let e=this.querySelector("img"),t=i.target,r=t.getAttribute("coords"),o=t.getAttribute("shape"),n=r.split(",").map(l=>parseInt(l));switch(o){case"circle":{let[l,c,p]=n;t.style.left=l-p+"px",t.style.top=c-p+"px",t.style.width=t.style.height=2*p+"px"}break;case"rect":{let[l,c,p,d]=n;t.style.left=l+"px",t.style.top=c+"px",t.style.width=p-l+"px",t.style.height=d-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)}};ye.styles=wi`
260
+ `],s([dt()],M.prototype,"_lines",2),s([dt()],M.prototype,"startCoord",2),s([dt()],M.prototype,"mouseCoord",2),s([Ai("svg")],M.prototype,"svgContainer",2),s([Ti({selector:"img"})],M.prototype,"grImage",2);customElements.define("qti-graphic-associate-interaction",M);import{css as Ri,html as Li,LitElement as Si}from"lit";var ye=class extends L(Si,"qti-gap-img",!1,"qti-associable-hotspot"){render(){return Li` <slot></slot>
261
+ <slot name="qti-gap-img"></slot>`}positionHotspotOnRegister(i){let e=this.querySelector("img"),t=i.target,r=t.getAttribute("coords"),o=t.getAttribute("shape"),n=r.split(",").map(l=>parseInt(l));switch(o){case"circle":{let[l,c,p]=n;t.style.left=l-p+"px",t.style.top=c-p+"px",t.style.width=t.style.height=2*p+"px"}break;case"rect":{let[l,c,p,d]=n;t.style.left=l+"px",t.style.top=c+"px",t.style.width=p-l+"px",t.style.height=d-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)}};ye.styles=Ri`
262
262
  :host {
263
263
  display: inline-block;
264
264
  position: relative;
@@ -317,12 +317,12 @@ import{a as gt,b as h}from"../chunk-BVYXUE3V.js";import{a as bt}from"../chunk-5G
317
317
  type="checkbox"
318
318
  value=${r.getAttribute("identifier")}
319
319
  .checked=${this.response.includes(n)}
320
- @change=${l=>{l.target.checked?this.response.push(n):this.response=this.response.filter(p=>p!==n),this.requestUpdate(),this.saveResponse()}}
320
+ @change=${l=>{l.target.checked?this.response.push(n):this.response=this.response.filter(p=>p!==n),this.requestUpdate(),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:this.response}}))}}
321
321
  />
322
322
  </td>`})}
323
323
  </tr>`)}
324
324
  </table>
325
- `:re`<slot name="prompt"></slot> <slot></slot>`}saveResponse(){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:this.response}}))}};z.styles=[],s([Ii()],z.prototype,"response",2),s([Pi({type:String,attribute:"response-identifier"})],z.prototype,"responseIdentifier",2);customElements.define("qti-match-interaction",z);import{css as Fi,html as Ui}from"lit";var qe=class extends f{constructor(){super()}reset(){}validate(){return!0}set response(e){}static get properties(){return W(k({},f.properties),{step:{type:Number,attribute:"step",default:10}})}render(){return Ui` <slot name="prompt"></slot>
325
+ `:re`<slot name="prompt"></slot> <slot></slot>`}};z.styles=[],s([Ii()],z.prototype,"response",2),s([Pi({type:String,attribute:"response-identifier"})],z.prototype,"responseIdentifier",2);customElements.define("qti-match-interaction",z);import{css as Fi,html as Ui}from"lit";var qe=class extends f{constructor(){super()}reset(){}validate(){return!0}set response(e){}static get properties(){return W(k({},f.properties),{step:{type:Number,attribute:"step",default:10}})}render(){return Ui` <slot name="prompt"></slot>
326
326
  <slot></slot>`}connectedCallback(){super.connectedCallback()}};qe.styles=[Fi``];customElements.define("qti-media-interaction",qe);import{css as Xi,html as zt,LitElement as Yi}from"lit";import{property as Bi}from"lit/decorators.js";var j=class extends L(Yi,"qti-simple-choice",!0,"drop-list"){render(){return zt` <slot name="prompt"> </slot>
327
327
  <div part="container">
328
328
  <slot part="drags"> </slot>
@@ -423,11 +423,11 @@ import{a as gt,b as h}from"../chunk-BVYXUE3V.js";import{a as bt}from"../chunk-5G
423
423
  ${this.csLive.getPropertyValue("--show-value")=="true"?ke`<div id="value" part="value">${this.value}</div>`:mt}
424
424
  </div>
425
425
  </div>
426
- </div>`}connectedCallback(){super.connectedCallback(),this.step=1,this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}_onTouchMove(e){let t=l=>{let{x:c}=this.getPositionFromEvent(l),p=c-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(p),l.stopPropagation()},r=()=>{document.removeEventListener("touchmove",t),document.removeEventListener("touchend",r),this.saveResponse(this.value.toString())};document.addEventListener("touchmove",t),document.addEventListener("touchend",r);let{x:o}=this.getPositionFromEvent(e),n=o-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(n),e.stopPropagation()}_onMouseDown(e){let t=n=>{let l=n.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(l),n.preventDefault(),n.stopPropagation()},r=()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",r),this.saveResponse(this.value.toString())};document.addEventListener("mousemove",t),document.addEventListener("mouseup",r);let o=e.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(o),e.preventDefault(),e.stopPropagation()}calculateValue(e){let t=this.min+(this.max-this.min)*e/this._rail.getBoundingClientRect().width,r=this.min+Math.round((t-this.min)/this._step)*this._step;this.value=r}getPositionFromEvent(e){let t;if(e.type=="touchstart"||e.type=="touchmove"||e.type=="touchend"||e.type=="touchcancel"){let r=typeof e.originalEvent=="undefined"?e:e.originalEvent,o=r.touches[0]||r.changedTouches[0];t={x:o.pageX,y:o.pageY}}else(e.type=="mousedown"||e.type=="mouseup"||e.type=="mousemove"||e.type=="mouseover"||e.type=="mouseout"||e.type=="mouseenter"||e.type=="mouseleave")&&(t={x:e.clientX,y:e.clientY});return t}};x.styles=[rs``],s([Wt("#knob")],x.prototype,"_knob",2),s([Wt("#rail")],x.prototype,"_rail",2),s([K({type:Number})],x.prototype,"value",2),s([K({type:Boolean,attribute:"step-label"})],x.prototype,"stepLabel",2),s([K({type:Boolean})],x.prototype,"reverse",2),s([K({type:Number,attribute:"lower-bound"})],x.prototype,"min",1),s([K({type:Number,attribute:"upper-bound"})],x.prototype,"max",1),s([K({type:Number,attribute:"step"})],x.prototype,"step",1),s([h("disabled",{waitUntilFirstUpdate:!0})],x.prototype,"_handleDisabledChange",2),s([h("readonly",{waitUntilFirstUpdate:!0})],x.prototype,"_handleReadonlyChange",2);customElements.define("qti-slider-interaction",x);import{LitElement as is,html as ss}from"lit";import{property as os}from"lit/decorators.js";var Ae=class extends is{render(){return ss`<button @click=${this.endAttempt}>${this.title}</button>`}endAttempt(e){this.closest("qti-assessment-item").processResponse()}};s([os({type:String})],Ae.prototype,"title",2);customElements.define("qti-end-attempt-interaction",Ae);import{LitElement as ns,css as as,html as ls}from"lit";var Re=class extends ns{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,cancelable:!1,composed:!0}))}render(){return ls` <slot name="qti-gap-img"></slot> `}};Re.styles=as`
426
+ </div>`}connectedCallback(){super.connectedCallback(),this.step=1,this.setAttribute("tabindex","0"),this.setAttribute("role","slider")}_onTouchMove(e){let t=l=>{let{x:c}=this.getPositionFromEvent(l),p=c-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(p),l.stopPropagation()},r=()=>{document.removeEventListener("touchmove",t),document.removeEventListener("touchend",r),this.saveResponse(this.value.toString())};document.addEventListener("touchmove",t),document.addEventListener("touchend",r);let{x:o}=this.getPositionFromEvent(e),n=o-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(n),e.stopPropagation()}_onMouseDown(e){let t=n=>{let l=n.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(l),n.preventDefault(),n.stopPropagation()},r=()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",r),this.saveResponse(this.value.toString())};document.addEventListener("mousemove",t),document.addEventListener("mouseup",r);let o=e.pageX-this._rail.getBoundingClientRect().left-document.documentElement.scrollLeft;this.calculateValue(o),e.preventDefault(),e.stopPropagation()}calculateValue(e){let t=this.min+(this.max-this.min)*e/this._rail.getBoundingClientRect().width,r=this.min+Math.round((t-this.min)/this._step)*this._step;this.value=r}getPositionFromEvent(e){let t;if(e.type=="touchstart"||e.type=="touchmove"||e.type=="touchend"||e.type=="touchcancel"){let r=typeof e.originalEvent=="undefined"?e:e.originalEvent,o=r.touches[0]||r.changedTouches[0];t={x:o.pageX,y:o.pageY}}else(e.type=="mousedown"||e.type=="mouseup"||e.type=="mousemove"||e.type=="mouseover"||e.type=="mouseout"||e.type=="mouseenter"||e.type=="mouseleave")&&(t={x:e.clientX,y:e.clientY});return t}};x.styles=[rs``],s([Wt("#knob")],x.prototype,"_knob",2),s([Wt("#rail")],x.prototype,"_rail",2),s([K({type:Number})],x.prototype,"value",2),s([K({type:Boolean,attribute:"step-label"})],x.prototype,"stepLabel",2),s([K({type:Boolean})],x.prototype,"reverse",2),s([K({type:Number,attribute:"lower-bound"})],x.prototype,"min",1),s([K({type:Number,attribute:"upper-bound"})],x.prototype,"max",1),s([K({type:Number,attribute:"step"})],x.prototype,"step",1),s([h("disabled",{waitUntilFirstUpdate:!0})],x.prototype,"_handleDisabledChange",2),s([h("readonly",{waitUntilFirstUpdate:!0})],x.prototype,"_handleReadonlyChange",2);customElements.define("qti-slider-interaction",x);import{LitElement as is,html as ss}from"lit";import{property as os}from"lit/decorators.js";var Ae=class extends is{render(){return ss`<button @click=${this.endAttempt}>${this.title}</button>`}endAttempt(e){this.closest("qti-assessment-item").processResponse()}};s([os({type:String})],Ae.prototype,"title",2);customElements.define("qti-end-attempt-interaction",Ae);import{LitElement as ns,css as as,html as ls}from"lit";var Te=class extends ns{connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-hotspot",{bubbles:!0,cancelable:!1,composed:!0}))}render(){return ls` <slot name="qti-gap-img"></slot> `}};Te.styles=as`
427
427
  :host {
428
428
  position: absolute;
429
429
  }
430
- `;customElements.define("qti-associable-hotspot",Re);import{LitElement as cs}from"lit";import{property as ps}from"lit/decorators.js";var Te=class extends cs{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){this.setAttribute("slot","qti-gap-img")}};s([ps({type:Number,reflect:!0})],Te.prototype,"tabindex",2);customElements.define("qti-gap-img",Te);import{html as ds,LitElement as us}from"lit";import{property as ms}from"lit/decorators.js";var we=class extends us{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-gap-text")}render(){return ds`<slot></slot>`}};s([ms({type:Number,reflect:!0})],we.prototype,"tabindex",2);customElements.define("qti-gap-text",we);import{html as hs,LitElement as fs}from"lit";import{property as bs}from"lit/decorators.js";var Le=class extends fs{constructor(){super(...arguments);this.tabindex=0}render(){return hs` <slot name="qti-gap-text"></slot>`}};s([bs({type:Number,reflect:!0})],Le.prototype,"tabindex",2);customElements.define("qti-gap",Le);import{css as gs}from"lit";import{property as vs}from"lit/decorators.js";var ie=class extends y{};ie.styles=gs`
430
+ `;customElements.define("qti-associable-hotspot",Te);import{LitElement as cs}from"lit";import{property as ps}from"lit/decorators.js";var we=class extends cs{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){this.setAttribute("slot","qti-gap-img")}};s([ps({type:Number,reflect:!0})],we.prototype,"tabindex",2);customElements.define("qti-gap-img",we);import{html as ds,LitElement as us}from"lit";import{property as ms}from"lit/decorators.js";var Re=class extends us{constructor(){super(...arguments);this.tabindex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-gap-text")}render(){return ds`<slot></slot>`}};s([ms({type:Number,reflect:!0})],Re.prototype,"tabindex",2);customElements.define("qti-gap-text",Re);import{html as hs,LitElement as fs}from"lit";import{property as bs}from"lit/decorators.js";var Le=class extends fs{constructor(){super(...arguments);this.tabindex=0}render(){return hs` <slot name="qti-gap-text"></slot>`}};s([bs({type:Number,reflect:!0})],Le.prototype,"tabindex",2);customElements.define("qti-gap",Le);import{css as gs}from"lit";import{property as vs}from"lit/decorators.js";var ie=class extends y{};ie.styles=gs`
431
431
  :host {
432
432
  position: absolute;
433
433
  }
@@ -441,4 +441,4 @@ import{a as gt,b as h}from"../chunk-BVYXUE3V.js";import{a as bt}from"../chunk-5G
441
441
  width: 100%;
442
442
  display: block;
443
443
  }
444
- `,se=s([qs("qti-simple-choice")],se);export{Rt as Events,H as OutcomeVariable,ee as QtPrintedVariable,je as QtiAnd,A as QtiAssessmentItem,Re as QtiAssociableHotspot,te as QtiAssociateInteraction,me as QtiBaseValue,y as QtiChoice,At as QtiChoiceElementSelected,F as QtiChoiceInteraction,ne as QtiCompanionMaterialsInfo,q as QtiConditionExpression,Ke as QtiContains,We as QtiCorrect,Ae as QtiEndAttemptInteraction,he as QtiEqual,fe as QtiEqualRounded,u as QtiExpression,T as QtiExtendedTextInteraction,Pe as QtiFeedbackBlock,pe as QtiFeedbackInline,Le as QtiGap,Te as QtiGapImg,ve as QtiGapMatchInteraction,we as QtiGapText,M as QtiGraphicAssociateInteraction,ye as QtiGraphicGapMatchInteraction,xe as QtiGraphicOrderInteraction,Ge as QtiGt,Je as QtiGte,ie as QtiHotspotChoice,Ee as QtiHotspotInteraction,Se as QtiHottext,Ue as QtiHottextInteraction,ht as QtiInlineChoice,I as QtiInlineChoiceInteraction,yt as QtiInteractionChanged,kt as QtiInteractionResponse,Ze as QtiIsNull,_t as QtiLooseChoice,Qe as QtiLt,et as QtiLte,be as QtiMapResponse,X as QtiMapping,rt as QtiMatch,z as QtiMatchInteraction,qe as QtiMediaInteraction,it as QtiMember,Oe as QtiModalFeedback,st as QtiMultiple,ot as QtiNot,nt as QtiOr,j as QtiOrderInteraction,at as QtiOrdered,vt as QtiOutcomeChanged,P as QtiOutcomeDeclaration,pt as QtiPortableCustomInteraction,_e as QtiPositionObjectStage,lt as QtiProduct,He as QtiPrompt,qt as QtiRegisterChoice,Ct as QtiRegisterHotspot,Et as QtiRegisterInteraction,xt as QtiRegisterVariable,Xe as QtiResponseCondition,O as QtiResponseDeclaration,J as QtiResponseElse,Be as QtiResponseElseIf,Z as QtiResponseIf,U as QtiResponseProcessing,S as QtiRule,Ce as QtiSPositionObjectInteraction,D as QtiSelectPointInteraction,Ye as QtiSetOutcomeValue,ut as QtiSimpleAssociableChoice,se as QtiSimpleChoice,x as QtiSliderInteraction,De as QtiStylesheet,_ as QtiTextEntryInteraction,ct as QtiVariable,N as ResponseVariable,le as qtiContentBody,R as qtiRubricBlock};
444
+ `,se=s([qs("qti-simple-choice")],se);export{Tt as Events,H as OutcomeVariable,ee as QtPrintedVariable,je as QtiAnd,A as QtiAssessmentItem,Te as QtiAssociableHotspot,te as QtiAssociateInteraction,me as QtiBaseValue,y as QtiChoice,At as QtiChoiceElementSelected,F as QtiChoiceInteraction,ne as QtiCompanionMaterialsInfo,q as QtiConditionExpression,Ke as QtiContains,We as QtiCorrect,Ae as QtiEndAttemptInteraction,he as QtiEqual,fe as QtiEqualRounded,u as QtiExpression,w as QtiExtendedTextInteraction,Pe as QtiFeedbackBlock,pe as QtiFeedbackInline,Le as QtiGap,we as QtiGapImg,ve as QtiGapMatchInteraction,Re as QtiGapText,M as QtiGraphicAssociateInteraction,ye as QtiGraphicGapMatchInteraction,xe as QtiGraphicOrderInteraction,Ge as QtiGt,Je as QtiGte,ie as QtiHotspotChoice,Ee as QtiHotspotInteraction,Se as QtiHottext,Ue as QtiHottextInteraction,ht as QtiInlineChoice,I as QtiInlineChoiceInteraction,yt as QtiInteractionChanged,kt as QtiInteractionResponse,Ze as QtiIsNull,_t as QtiLooseChoice,Qe as QtiLt,et as QtiLte,be as QtiMapResponse,X as QtiMapping,rt as QtiMatch,z as QtiMatchInteraction,qe as QtiMediaInteraction,it as QtiMember,Oe as QtiModalFeedback,st as QtiMultiple,ot as QtiNot,nt as QtiOr,j as QtiOrderInteraction,at as QtiOrdered,vt as QtiOutcomeChanged,P as QtiOutcomeDeclaration,pt as QtiPortableCustomInteraction,_e as QtiPositionObjectStage,lt as QtiProduct,He as QtiPrompt,qt as QtiRegisterChoice,Ct as QtiRegisterHotspot,Et as QtiRegisterInteraction,xt as QtiRegisterVariable,Xe as QtiResponseCondition,O as QtiResponseDeclaration,J as QtiResponseElse,Be as QtiResponseElseIf,Z as QtiResponseIf,U as QtiResponseProcessing,S as QtiRule,Ce as QtiSPositionObjectInteraction,D as QtiSelectPointInteraction,Ye as QtiSetOutcomeValue,ut as QtiSimpleAssociableChoice,se as QtiSimpleChoice,x as QtiSliderInteraction,De as QtiStylesheet,_ as QtiTextEntryInteraction,ct as QtiVariable,N as ResponseVariable,le as qtiContentBody,T as qtiRubricBlock};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5U4R2HMKcjs = require('../chunk-5U4R2HMK.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-Z2P5ZMVD.cjs');require('../chunk-HOQW4KDA.cjs');exports.QtiItem = _chunk5U4R2HMKcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPNQIHQ4Ecjs = require('../chunk-PNQIHQ4E.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-Z2P5ZMVD.cjs');require('../chunk-6G76D2MI.cjs');exports.QtiItem = _chunkPNQIHQ4Ecjs.a;
@@ -1,3 +1,19 @@
1
- export { Q as QtiItem } from '../qti-item-395a9535.js';
2
- import 'lit-html';
3
- import 'lit';
1
+ import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
+ import { LitElement } from 'lit';
4
+
5
+ declare class QtiItem extends LitElement {
6
+ itemLocation: string;
7
+ set audienceContext(context: {
8
+ view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
9
+ });
10
+ private provider;
11
+ private _xml;
12
+ set xml(val: string);
13
+ get xml(): string;
14
+ static styles: lit.CSSResult;
15
+ connectedCallback(): void;
16
+ render: () => lit_html.TemplateResult<1>;
17
+ }
18
+
19
+ export { QtiItem };
@@ -1,3 +1,19 @@
1
- export { Q as QtiItem } from '../qti-item-395a9535.js';
2
- import 'lit-html';
3
- import 'lit';
1
+ import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
+ import { LitElement } from 'lit';
4
+
5
+ declare class QtiItem extends LitElement {
6
+ itemLocation: string;
7
+ set audienceContext(context: {
8
+ view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
9
+ });
10
+ private provider;
11
+ private _xml;
12
+ set xml(val: string);
13
+ get xml(): string;
14
+ static styles: lit.CSSResult;
15
+ connectedCallback(): void;
16
+ render: () => lit_html.TemplateResult<1>;
17
+ }
18
+
19
+ export { QtiItem };
@@ -1 +1 @@
1
- import{a as o}from"../chunk-2K77UHFA.js";import"../chunk-5GG2XAUT.js";import"../chunk-OO5TITDR.js";import"../chunk-NMCIOGD2.js";export{o as QtiItem};
1
+ import{a as o}from"../chunk-QFISTKXH.js";import"../chunk-5GG2XAUT.js";import"../chunk-OO5TITDR.js";import"../chunk-343LZK3D.js";export{o as QtiItem};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk5U4R2HMKcjs = require('../chunk-5U4R2HMK.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-Z2P5ZMVD.cjs');require('../chunk-HOQW4KDA.cjs');var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _react3 = require('@lit-labs/react');var c=_react3.createComponent.call(void 0, {tagName:"qti-item",react:_react2.default,elementClass:_chunk5U4R2HMKcjs.a,events:{"qti-outcome-changed":"qti-outcome-changed","qti-interaction-changed":"qti-interaction-changed","qti-item-connected":"qti-item-connected"}});exports.QtiItem = c;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkPNQIHQ4Ecjs = require('../chunk-PNQIHQ4E.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-Z2P5ZMVD.cjs');require('../chunk-6G76D2MI.cjs');var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _react3 = require('@lit-labs/react');var c=_react3.createComponent.call(void 0, {tagName:"qti-item",react:_react2.default,elementClass:_chunkPNQIHQ4Ecjs.a,events:{"qti-outcome-changed":"qti-outcome-changed","qti-interaction-changed":"qti-interaction-changed","qti-item-connected":"qti-item-connected"}});exports.QtiItem = c;
@@ -1,6 +1,6 @@
1
1
  import React, { Ref } from 'react';
2
- import { Q as QtiItem$1 } from '../qti-item-395a9535.js';
3
- import { h as OutcomeChangedDetails, j as InteractionChangedDetails, b as QtiAssessmentItem } from '../qti-simple-choice-86f433b6.js';
2
+ import { QtiItem as QtiItem$1 } from '../qti-item/index.cjs';
3
+ import { O as OutcomeChangedDetails, I as InteractionChangedDetails, Q as QtiAssessmentItem } from '../qti-simple-choice-9a8c789b.js';
4
4
  import 'lit-html';
5
5
  import 'lit';
6
6
  import 'lit-html/directives/ref';
@@ -1,6 +1,6 @@
1
1
  import React, { Ref } from 'react';
2
- import { Q as QtiItem$1 } from '../qti-item-395a9535.js';
3
- import { h as OutcomeChangedDetails, j as InteractionChangedDetails, b as QtiAssessmentItem } from '../qti-simple-choice-86f433b6.js';
2
+ import { QtiItem as QtiItem$1 } from '../qti-item/index.js';
3
+ import { O as OutcomeChangedDetails, I as InteractionChangedDetails, Q as QtiAssessmentItem } from '../qti-simple-choice-9a8c789b.js';
4
4
  import 'lit-html';
5
5
  import 'lit';
6
6
  import 'lit-html/directives/ref';
@@ -1 +1 @@
1
- import{a as t}from"../chunk-2K77UHFA.js";import"../chunk-5GG2XAUT.js";import"../chunk-OO5TITDR.js";import"../chunk-NMCIOGD2.js";import e from"react";import{createComponent as o}from"@lit-labs/react";var c=o({tagName:"qti-item",react:e,elementClass:t,events:{"qti-outcome-changed":"qti-outcome-changed","qti-interaction-changed":"qti-interaction-changed","qti-item-connected":"qti-item-connected"}});export{c as QtiItem};
1
+ import{a as t}from"../chunk-QFISTKXH.js";import"../chunk-5GG2XAUT.js";import"../chunk-OO5TITDR.js";import"../chunk-343LZK3D.js";import e from"react";import{createComponent as o}from"@lit-labs/react";var c=o({tagName:"qti-item",react:e,elementClass:t,events:{"qti-outcome-changed":"qti-outcome-changed","qti-interaction-changed":"qti-interaction-changed","qti-item-connected":"qti-item-connected"}});export{c as QtiItem};
@@ -460,4 +460,4 @@ declare global {
460
460
  }
461
461
  }
462
462
 
463
- export { QtiHottext as A, BaseType as B, Cardinality as C, QtiSimpleChoice as D, Interaction as I, Multiple as M, Ordered as O, QtiRule as Q, ResponseVariable as R, VariableDeclaration as V, Choices as a, QtiAssessmentItem as b, QtiChoice as c, directedPair as d, ResponseInteraction as e, Calculate as f, float as g, OutcomeChangedDetails as h, integer as i, InteractionChangedDetails as j, qtiInteractionChanged as k, qtiRegisterVariable as l, qtiRegisterInteraction as m, qtiRegisterChoice as n, qtiRegisterHotspot as o, qtiLooseChoice as p, qtiOutcomeChanged as q, qtiInteractionResponse as r, qtiChoiceElementSelected as s, ResultVariable as t, OutcomeVariable as u, QtiTextEntryInteraction as v, QtiExtendedTextInteraction as w, QtiChoiceInteraction as x, QtiResponseProcessing as y, QtiMapping as z };
463
+ export { QtiHottext as A, BaseType as B, Cardinality as C, QtiSimpleChoice as D, InteractionChangedDetails as I, Multiple as M, OutcomeChangedDetails as O, QtiAssessmentItem as Q, ResponseVariable as R, VariableDeclaration as V, Choices as a, Interaction as b, QtiRule as c, QtiChoice as d, directedPair as e, ResponseInteraction as f, Calculate as g, float as h, integer as i, Ordered as j, qtiInteractionChanged as k, qtiRegisterVariable as l, qtiRegisterInteraction as m, qtiRegisterChoice as n, qtiRegisterHotspot as o, qtiLooseChoice as p, qtiOutcomeChanged as q, qtiInteractionResponse as r, qtiChoiceElementSelected as s, ResultVariable as t, OutcomeVariable as u, QtiTextEntryInteraction as v, QtiExtendedTextInteraction as w, QtiChoiceInteraction as x, QtiResponseProcessing as y, QtiMapping as z };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZ2P5ZMVDcjs = require('../chunk-Z2P5ZMVD.cjs');require('../chunk-HOQW4KDA.cjs');exports.qtiTransform = _chunkZ2P5ZMVDcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZ2P5ZMVDcjs = require('../chunk-Z2P5ZMVD.cjs');require('../chunk-6G76D2MI.cjs');exports.qtiTransform = _chunkZ2P5ZMVDcjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-OO5TITDR.js";import"../chunk-NMCIOGD2.js";export{a as qtiTransform};
1
+ import{a}from"../chunk-OO5TITDR.js";import"../chunk-343LZK3D.js";export{a as qtiTransform};
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "engines": {
13
13
  "node": ">=16.0.0"
14
14
  },
15
- "version": "6.0.28",
15
+ "version": "6.0.29",
16
16
  "type": "module",
17
17
  "main": "dist/index.js",
18
18
  "exports": {
@@ -108,7 +108,8 @@
108
108
  "cheerio": "^1.0.0-rc.12",
109
109
  "haunted": "^5.0.0",
110
110
  "lit": "^2.7.5",
111
- "lit-xml": "^0.5.0"
111
+ "lit-xml": "^0.5.0",
112
+ "remark-gfm": "^3.0.1"
112
113
  },
113
114
  "peerdependencies": {
114
115
  "@lit-labs/context": "> 0.3",
@@ -117,20 +118,21 @@
117
118
  "react": "> 18"
118
119
  },
119
120
  "devDependencies": {
121
+ "@arethetypeswrong/cli": "^0.4.2",
120
122
  "@custom-elements-manifest/analyzer": "^0.8.3",
121
123
  "@jest/globals": "^29.5.0",
122
- "@storybook/addon-a11y": "^7.0.21",
123
- "@storybook/addon-essentials": "^7.0.21",
124
- "@storybook/addon-interactions": "^7.0.21",
125
- "@storybook/addon-jest": "^7.0.21",
126
- "@storybook/addon-links": "^7.0.21",
127
- "@storybook/addon-styling": "1.3.0",
128
- "@storybook/blocks": "^7.0.21",
129
- "@storybook/jest": "^0.1.0",
130
- "@storybook/test-runner": "^0.11.0",
124
+ "@storybook/addon-a11y": "^7.4.0",
125
+ "@storybook/addon-essentials": "^7.4.0",
126
+ "@storybook/addon-interactions": "^7.4.0",
127
+ "@storybook/addon-jest": "^7.4.0",
128
+ "@storybook/addon-links": "^7.4.0",
129
+ "@storybook/addon-mdx-gfm": "^7.4.0",
130
+ "@storybook/blocks": "^7.4.0",
131
+ "@storybook/jest": "^0.2.2",
132
+ "@storybook/test-runner": "^0.13.0",
131
133
  "@storybook/testing-library": "^0.2.0",
132
- "@storybook/web-components": "^7.0.21",
133
- "@storybook/web-components-vite": "^7.0.21",
134
+ "@storybook/web-components": "^7.4.0",
135
+ "@storybook/web-components-vite": "^7.4.0",
134
136
  "@tailwindcss/typography": "^0.5.9",
135
137
  "@types/node": "^20.3.1",
136
138
  "@typescript-eslint/eslint-plugin": "^5.60.0",
@@ -143,7 +145,7 @@
143
145
  "eslint-plugin-lit": "^1.8.3",
144
146
  "eslint-plugin-lit-a11y": "^3.0.0",
145
147
  "eslint-plugin-sort-imports-es6-autofix": "^0.6.0",
146
- "eslint-plugin-storybook": "^0.6.12",
148
+ "eslint-plugin-storybook": "^0.6.13",
147
149
  "eslint-plugin-wc": "^1.5.0",
148
150
  "jest-environment-jsdom": "^29.5.0",
149
151
  "nodemon": "^2.0.22",
@@ -156,15 +158,14 @@
156
158
  "react": "^18.2.0",
157
159
  "react-dom": "^18.2.0",
158
160
  "sass": "^1.63.6",
159
- "storybook": "^7.0.21",
160
- "storybook-addon-pseudo-states": "^2.1.0",
161
+ "storybook": "^7.4.0",
162
+ "storybook-addon-pseudo-states": "^2.1.1",
161
163
  "tailwindcss": "^3.3.2",
162
164
  "ts-jest": "^29.1.0",
163
165
  "ts-node": "^10.9.1",
164
166
  "tsup": "^7.1.0",
165
167
  "typescript": "^5.1.3",
166
- "vite": "^4.3.9",
167
- "@arethetypeswrong/cli": "^0.4.2"
168
+ "vite": "^4.3.9"
168
169
  },
169
170
  "customElements": "custom-elements.json"
170
171
  }
@@ -1,8 +0,0 @@
1
- interface Audience {
2
- view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
3
- }
4
- declare const audienceContext: {
5
- __context__: Audience;
6
- };
7
-
8
- export { Audience as A, audienceContext as a };