@citolab/qti-components 7.1.4 → 7.1.5
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.
- package/cdn/chunks/chunk-24FGNKCD.js +1007 -0
- package/cdn/chunks/chunk-2GQCYBJ3.js +5 -0
- package/cdn/chunks/chunk-2OZT6A22.js +5 -0
- package/cdn/chunks/chunk-3AJ3S2FB.js +23 -0
- package/cdn/chunks/chunk-3M6EKDMW.js +1 -0
- package/cdn/chunks/chunk-3QCUKN7V.js +1 -0
- package/cdn/chunks/chunk-4LPUHBZG.js +5 -0
- package/cdn/chunks/chunk-5UN2ELTW.js +23 -0
- package/cdn/chunks/chunk-5VTVIA6M.js +23 -0
- package/cdn/chunks/chunk-6JHIITOD.js +1 -0
- package/cdn/chunks/chunk-7UDDUERA.js +1007 -0
- package/cdn/chunks/chunk-7ZNR6KCO.js +5 -0
- package/cdn/chunks/chunk-AAOFOYWA.js +5 -0
- package/cdn/chunks/chunk-AJMJQJUQ.js +5 -0
- package/cdn/chunks/chunk-CY2CQDCJ.js +5 -0
- package/cdn/chunks/chunk-D2GQ4BES.js +1 -0
- package/cdn/chunks/chunk-D6WQKU5P.js +5 -0
- package/cdn/chunks/chunk-DMIFXRAW.js +5 -0
- package/cdn/chunks/chunk-DQ7GTTCX.js +5 -0
- package/cdn/chunks/chunk-DVRZBFAS.js +5 -0
- package/cdn/chunks/chunk-E6M5VAZC.js +1007 -0
- package/cdn/chunks/chunk-EJDPW23L.js +5 -0
- package/cdn/chunks/chunk-FWCOZSKN.js +5 -0
- package/cdn/chunks/chunk-G24US7VC.js +23 -0
- package/cdn/chunks/chunk-HCWGJCF3.js +1007 -0
- package/cdn/chunks/chunk-IUEV6I3Y.js +5 -0
- package/cdn/chunks/chunk-J4CI5WG7.js +23 -0
- package/cdn/chunks/chunk-JEZ3FDS2.js +1007 -0
- package/cdn/chunks/chunk-L7FX2BSJ.js +1007 -0
- package/cdn/chunks/chunk-L7G3YUQJ.js +23 -0
- package/cdn/chunks/chunk-LKOMJADF.js +5 -0
- package/cdn/chunks/chunk-M2YVQSR3.js +5 -0
- package/cdn/chunks/chunk-MADHY2TG.js +5 -0
- package/cdn/chunks/chunk-MCE2HPAI.js +23 -0
- package/cdn/chunks/chunk-MPVVJRN5.js +5 -0
- package/cdn/chunks/chunk-MYK3AVE5.js +5 -0
- package/cdn/chunks/chunk-NQUXPDU3.js +1 -0
- package/cdn/chunks/chunk-O64TZW6N.js +5 -0
- package/cdn/chunks/chunk-OM6BKR6U.js +5 -0
- package/cdn/chunks/chunk-PTEZUFUL.js +5 -0
- package/cdn/chunks/chunk-Q3MPB5OG.js +23 -0
- package/cdn/chunks/chunk-RC3C5C7I.js +5 -0
- package/cdn/chunks/chunk-RDREFUYQ.js +1007 -0
- package/cdn/chunks/chunk-RPBLXGHD.js +5 -0
- package/cdn/chunks/chunk-RWCWDO5R.js +5 -0
- package/cdn/chunks/chunk-SEJ6XHOU.js +1 -0
- package/cdn/chunks/chunk-SHZ5UCLJ.js +5 -0
- package/cdn/chunks/chunk-SRXFURHS.js +5 -0
- package/cdn/chunks/chunk-TJWJV2U3.js +5 -0
- package/cdn/chunks/chunk-URO7DOBX.js +1 -0
- package/cdn/chunks/chunk-UVCZCMPG.js +5 -0
- package/cdn/chunks/chunk-V2HYQXWT.js +1007 -0
- package/cdn/chunks/chunk-V6VPFEQB.js +1 -0
- package/cdn/chunks/chunk-V7S5DVXO.js +5 -0
- package/cdn/chunks/chunk-VAKXKPIY.js +1007 -0
- package/cdn/chunks/chunk-VCATS6AD.js +5 -0
- package/cdn/chunks/chunk-VGBHSWOI.js +5 -0
- package/cdn/chunks/chunk-VTBQWQOW.js +23 -0
- package/cdn/chunks/chunk-W567D2AF.js +1 -0
- package/cdn/chunks/chunk-WQFK6JFL.js +5 -0
- package/cdn/chunks/chunk-WRAB6IVU.js +5 -0
- package/cdn/chunks/chunk-WWNOVLDK.js +23 -0
- package/cdn/chunks/chunk-XJHAZYHN.js +1007 -0
- package/cdn/chunks/chunk-YCTL45GB.js +1 -0
- package/cdn/chunks/chunk-ZRWDLR2Y.js +5 -0
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +1 -1
- package/cdn/qti-components/index.js +1 -1
- package/cdn/qti-item/components/item-container.js +1 -1
- package/cdn/qti-item/core/index.js +1 -1
- package/cdn/qti-loader/index.js +1 -1
- package/cdn/qti-test/components/index.js +1 -1
- package/cdn/qti-test/components/test-container.js +1 -1
- package/cdn/qti-test/core/index.js +1 -1
- package/cdn/qti-transformers/index.js +1 -1
- package/dist/chunks/chunk-2IXFDXDW.js +646 -0
- package/dist/chunks/chunk-2IXFDXDW.js.map +1 -0
- package/dist/chunks/chunk-2RRW2DFF.js +31 -0
- package/dist/chunks/chunk-2RRW2DFF.js.map +1 -0
- package/dist/chunks/chunk-2SENMECZ.js +383 -0
- package/dist/chunks/chunk-2SENMECZ.js.map +1 -0
- package/dist/chunks/chunk-2YIXNTLW.js +31 -0
- package/dist/chunks/chunk-2YIXNTLW.js.map +1 -0
- package/dist/chunks/chunk-323JSMZF.js +6888 -0
- package/dist/chunks/chunk-323JSMZF.js.map +1 -0
- package/dist/chunks/chunk-334SZRIZ.js +627 -0
- package/dist/chunks/chunk-334SZRIZ.js.map +1 -0
- package/dist/chunks/chunk-42QJNL24.js +383 -0
- package/dist/chunks/chunk-42QJNL24.js.map +1 -0
- package/dist/chunks/chunk-4QHU4ILT.js +627 -0
- package/dist/chunks/chunk-4QHU4ILT.js.map +1 -0
- package/dist/chunks/chunk-5LEN6QDS.js +31 -0
- package/dist/chunks/chunk-5LEN6QDS.js.map +1 -0
- package/dist/chunks/chunk-5QMNVSHC.js +94 -0
- package/dist/chunks/chunk-5QMNVSHC.js.map +1 -0
- package/dist/chunks/chunk-5WS6ZWUN.js +374 -0
- package/dist/chunks/chunk-5WS6ZWUN.js.map +1 -0
- package/dist/chunks/chunk-673CG4KG.js +94 -0
- package/dist/chunks/chunk-673CG4KG.js.map +1 -0
- package/dist/chunks/chunk-6VFH66FM.js +94 -0
- package/dist/chunks/chunk-6VFH66FM.js.map +1 -0
- package/dist/chunks/chunk-6YED6PQC.js +6888 -0
- package/dist/chunks/chunk-6YED6PQC.js.map +1 -0
- package/dist/chunks/chunk-75QW5V24.js +6888 -0
- package/dist/chunks/chunk-75QW5V24.js.map +1 -0
- package/dist/chunks/chunk-AVDZJOCT.js +400 -0
- package/dist/chunks/chunk-AVDZJOCT.js.map +1 -0
- package/dist/chunks/chunk-BCMG64M3.js +94 -0
- package/dist/chunks/chunk-BCMG64M3.js.map +1 -0
- package/dist/chunks/chunk-CHFTTHPJ.js +383 -0
- package/dist/chunks/chunk-CHFTTHPJ.js.map +1 -0
- package/dist/chunks/chunk-DT72VPM7.js +32 -0
- package/dist/chunks/chunk-DT72VPM7.js.map +1 -0
- package/dist/chunks/chunk-E2WYWXM3.js +6888 -0
- package/dist/chunks/chunk-E2WYWXM3.js.map +1 -0
- package/dist/chunks/chunk-E4XNZM6H.js +383 -0
- package/dist/chunks/chunk-E4XNZM6H.js.map +1 -0
- package/dist/chunks/chunk-ECTDE6XC.js +646 -0
- package/dist/chunks/chunk-ECTDE6XC.js.map +1 -0
- package/dist/chunks/chunk-EN7ICTLG.js +94 -0
- package/dist/chunks/chunk-EN7ICTLG.js.map +1 -0
- package/dist/chunks/chunk-EV2QQBO6.js +94 -0
- package/dist/chunks/chunk-EV2QQBO6.js.map +1 -0
- package/dist/chunks/chunk-FJI6VGC6.js +94 -0
- package/dist/chunks/chunk-FJI6VGC6.js.map +1 -0
- package/dist/chunks/chunk-FKUTUG6E.js +94 -0
- package/dist/chunks/chunk-FKUTUG6E.js.map +1 -0
- package/dist/chunks/chunk-FOAIUAWY.js +627 -0
- package/dist/chunks/chunk-FOAIUAWY.js.map +1 -0
- package/dist/chunks/chunk-GR52YZQB.js +31 -0
- package/dist/chunks/chunk-GR52YZQB.js.map +1 -0
- package/dist/chunks/chunk-GRT2RDCX.js +6888 -0
- package/dist/chunks/chunk-GRT2RDCX.js.map +1 -0
- package/dist/chunks/chunk-GT4B3SMY.js +94 -0
- package/dist/chunks/chunk-GT4B3SMY.js.map +1 -0
- package/dist/chunks/chunk-I6JSNAIT.js +627 -0
- package/dist/chunks/chunk-I6JSNAIT.js.map +1 -0
- package/dist/chunks/chunk-IKNXVVXK.js +32 -0
- package/dist/chunks/chunk-IKNXVVXK.js.map +1 -0
- package/dist/chunks/chunk-KJ5Y7Q3K.js +94 -0
- package/dist/chunks/chunk-KJ5Y7Q3K.js.map +1 -0
- package/dist/chunks/chunk-KNV7LPEA.js +94 -0
- package/dist/chunks/chunk-KNV7LPEA.js.map +1 -0
- package/dist/chunks/chunk-LCYRSF7H.js +6888 -0
- package/dist/chunks/chunk-LCYRSF7H.js.map +1 -0
- package/dist/chunks/chunk-LLVJY74K.js +373 -0
- package/dist/chunks/chunk-LLVJY74K.js.map +1 -0
- package/dist/chunks/chunk-LOCV27GA.js +31 -0
- package/dist/chunks/chunk-LOCV27GA.js.map +1 -0
- package/dist/chunks/chunk-LVPRIPTY.js +94 -0
- package/dist/chunks/chunk-LVPRIPTY.js.map +1 -0
- package/dist/chunks/chunk-MHPLSF7C.js +645 -0
- package/dist/chunks/chunk-MHPLSF7C.js.map +1 -0
- package/dist/chunks/chunk-MWVK6TYO.js +94 -0
- package/dist/chunks/chunk-MWVK6TYO.js.map +1 -0
- package/dist/chunks/chunk-NC7KY56H.js +627 -0
- package/dist/chunks/chunk-NC7KY56H.js.map +1 -0
- package/dist/chunks/chunk-O55K2M54.js +94 -0
- package/dist/chunks/chunk-O55K2M54.js.map +1 -0
- package/dist/chunks/chunk-PEV4JLKR.js +374 -0
- package/dist/chunks/chunk-PEV4JLKR.js.map +1 -0
- package/dist/chunks/chunk-POTLDXHV.js +627 -0
- package/dist/chunks/chunk-POTLDXHV.js.map +1 -0
- package/dist/chunks/chunk-QA5CX4HN.js +94 -0
- package/dist/chunks/chunk-QA5CX4HN.js.map +1 -0
- package/dist/chunks/chunk-QCZ76WFB.js +6888 -0
- package/dist/chunks/chunk-QCZ76WFB.js.map +1 -0
- package/dist/chunks/chunk-QS6VHKJL.js +94 -0
- package/dist/chunks/chunk-QS6VHKJL.js.map +1 -0
- package/dist/chunks/chunk-RVZE4R2K.js +400 -0
- package/dist/chunks/chunk-RVZE4R2K.js.map +1 -0
- package/dist/chunks/chunk-SGUZHURT.js +94 -0
- package/dist/chunks/chunk-SGUZHURT.js.map +1 -0
- package/dist/chunks/chunk-SJYWAAZE.js +31 -0
- package/dist/chunks/chunk-SJYWAAZE.js.map +1 -0
- package/dist/chunks/chunk-STQBRYLA.js +31 -0
- package/dist/chunks/chunk-STQBRYLA.js.map +1 -0
- package/dist/chunks/chunk-TAO7UEFH.js +400 -0
- package/dist/chunks/chunk-TAO7UEFH.js.map +1 -0
- package/dist/chunks/chunk-TC3OIHDQ.js +6888 -0
- package/dist/chunks/chunk-TC3OIHDQ.js.map +1 -0
- package/dist/chunks/chunk-TOJHUALI.js +646 -0
- package/dist/chunks/chunk-TOJHUALI.js.map +1 -0
- package/dist/chunks/chunk-TPAA44Y7.js +31 -0
- package/dist/chunks/chunk-TPAA44Y7.js.map +1 -0
- package/dist/chunks/chunk-TRYCV7IM.js +31 -0
- package/dist/chunks/chunk-TRYCV7IM.js.map +1 -0
- package/dist/chunks/chunk-TVNMKAMJ.js +645 -0
- package/dist/chunks/chunk-TVNMKAMJ.js.map +1 -0
- package/dist/chunks/chunk-U4RFKBRP.js +94 -0
- package/dist/chunks/chunk-U4RFKBRP.js.map +1 -0
- package/dist/chunks/chunk-UGLQ4IE6.js +94 -0
- package/dist/chunks/chunk-UGLQ4IE6.js.map +1 -0
- package/dist/chunks/chunk-UJFRZXCT.js +647 -0
- package/dist/chunks/chunk-UJFRZXCT.js.map +1 -0
- package/dist/chunks/chunk-UMF3ZNLB.js +627 -0
- package/dist/chunks/chunk-UMF3ZNLB.js.map +1 -0
- package/dist/chunks/chunk-UPOAW5KH.js +6888 -0
- package/dist/chunks/chunk-UPOAW5KH.js.map +1 -0
- package/dist/chunks/chunk-UYO3TSPZ.js +373 -0
- package/dist/chunks/chunk-UYO3TSPZ.js.map +1 -0
- package/dist/chunks/chunk-VDCLAPUT.js +627 -0
- package/dist/chunks/chunk-VDCLAPUT.js.map +1 -0
- package/dist/chunks/chunk-WEBEBLJU.js +94 -0
- package/dist/chunks/chunk-WEBEBLJU.js.map +1 -0
- package/dist/chunks/chunk-WWFGVIQF.js +627 -0
- package/dist/chunks/chunk-WWFGVIQF.js.map +1 -0
- package/dist/chunks/chunk-XBCKVU3I.js +94 -0
- package/dist/chunks/chunk-XBCKVU3I.js.map +1 -0
- package/dist/chunks/chunk-XOKC45VV.js +631 -0
- package/dist/chunks/chunk-XOKC45VV.js.map +1 -0
- package/dist/chunks/chunk-YHEITHMB.js +6888 -0
- package/dist/chunks/chunk-YHEITHMB.js.map +1 -0
- package/dist/chunks/chunk-YSGGRW2E.js +6888 -0
- package/dist/chunks/chunk-YSGGRW2E.js.map +1 -0
- package/dist/chunks/chunk-ZLOEM737.js +94 -0
- package/dist/chunks/chunk-ZLOEM737.js.map +1 -0
- package/dist/index.js +17 -17
- package/dist/qti-components/index.js +2 -2
- package/dist/qti-components-jsx.d.ts +1 -3
- package/dist/qti-item/components/item-container.js +2 -2
- package/dist/qti-item/core/index.js +2 -2
- package/dist/qti-loader/index.js +2 -2
- package/dist/qti-test/components/index.js +6 -6
- package/dist/qti-test/components/test-container.js +2 -2
- package/dist/qti-test/core/index.js +3 -3
- package/dist/qti-transformers/index.d.ts +3 -14
- package/dist/qti-transformers/index.js +1 -1
- package/dist/vscode.html-custom-data.json +1 -2
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as c,b as h}from"./chunk-7RINQSWP.js";import{a as i}from"./chunk-XUJ7TXHW.js";import{c as l}from"./chunk-J4CI5WG7.js";import{a as n,b as p,c as a}from"./chunk-PT6SVREH.js";import{d as s,i as o}from"./chunk-SCPSWPAG.js";import{a as r}from"./chunk-IAP2CEE7.js";var e=class extends o{constructor(){super(...arguments);this.testURL=null;this.testDoc=null;this.testXML=null;this.templateContent=null}async handleTestURLChange(){if(this.testURL)try{let t=await l().load(this.testURL);this.testDoc=t.htmlDoc()}catch(t){console.error("Error loading or parsing XML:",t)}}handleTestXMLChange(){if(this.testXML)try{this.testDoc=l().parse(this.testXML).htmlDoc()}catch(t){console.error("Error parsing XML:",t)}}async connectedCallback(){super.connectedCallback(),this.initializeTemplateContent(),this.applyStyles(),this.testURL&&this.handleTestURLChange(),this.testXML&&this.handleTestXMLChange()}initializeTemplateContent(){let t=this.querySelector("template");this.templateContent=t?t.content:s``}applyStyles(){let t=new CSSStyleSheet;t.replaceSync(h),this.shadowRoot.adoptedStyleSheets=[t]}render(){return s`
|
|
2
|
+
${this.templateContent}
|
|
3
|
+
<slot></slot>
|
|
4
|
+
${c(this.testDoc,s`<span>Loading...</span>`)}
|
|
5
|
+
`}};r([p({type:String,attribute:"test-url"})],e.prototype,"testURL",2),r([a()],e.prototype,"testDoc",2),r([a()],e.prototype,"testXML",2),r([i("testURL",{waitUntilFirstUpdate:!0})],e.prototype,"handleTestURLChange",1),r([i("testXML",{waitUntilFirstUpdate:!0})],e.prototype,"handleTestXMLChange",1),e=r([n("test-container")],e);export{e as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as c,b as h}from"./chunk-7RINQSWP.js";import{a as i}from"./chunk-XUJ7TXHW.js";import{c as l}from"./chunk-L7G3YUQJ.js";import{a as n,b as p,c as a}from"./chunk-PT6SVREH.js";import{d as s,i as o}from"./chunk-SCPSWPAG.js";import{a as r}from"./chunk-IAP2CEE7.js";var e=class extends o{constructor(){super(...arguments);this.testURL=null;this.testDoc=null;this.testXML=null;this.templateContent=null}async handleTestURLChange(){if(this.testURL)try{let t=await l().load(this.testURL);this.testDoc=t.htmlDoc()}catch(t){console.error("Error loading or parsing XML:",t)}}handleTestXMLChange(){if(this.testXML)try{this.testDoc=l().parse(this.testXML).htmlDoc()}catch(t){console.error("Error parsing XML:",t)}}async connectedCallback(){super.connectedCallback(),this.initializeTemplateContent(),this.applyStyles(),this.testURL&&this.handleTestURLChange(),this.testXML&&this.handleTestXMLChange()}initializeTemplateContent(){let t=this.querySelector("template");this.templateContent=t?t.content:s``}applyStyles(){let t=new CSSStyleSheet;t.replaceSync(h),this.shadowRoot.adoptedStyleSheets=[t]}render(){return s`
|
|
2
|
+
${this.templateContent}
|
|
3
|
+
<slot></slot>
|
|
4
|
+
${c(this.testDoc,s`<span>Loading...</span>`)}
|
|
5
|
+
`}};r([p({type:String,attribute:"test-url"})],e.prototype,"testURL",2),r([a()],e.prototype,"testDoc",2),r([a()],e.prototype,"testXML",2),r([i("testURL",{waitUntilFirstUpdate:!0})],e.prototype,"handleTestURLChange",1),r([i("testXML",{waitUntilFirstUpdate:!0})],e.prototype,"handleTestXMLChange",1),e=r([n("test-container")],e);export{e as a};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var N=String.raw,O=N`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
2
|
+
<xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />
|
|
3
|
+
<xsl:template match="@*|node()">
|
|
4
|
+
<xsl:copy>
|
|
5
|
+
<xsl:apply-templates select="@*|node()"/>
|
|
6
|
+
</xsl:copy>
|
|
7
|
+
</xsl:template>
|
|
8
|
+
|
|
9
|
+
<!-- remove existing namespaces -->
|
|
10
|
+
<xsl:template match="*">
|
|
11
|
+
<!-- remove element prefix -->
|
|
12
|
+
<xsl:element name="{local-name()}">
|
|
13
|
+
<!-- process attributes -->
|
|
14
|
+
<xsl:for-each select="@*">
|
|
15
|
+
<!-- remove attribute prefix -->
|
|
16
|
+
<xsl:attribute name="{local-name()}">
|
|
17
|
+
<xsl:value-of select="."/>
|
|
18
|
+
</xsl:attribute>
|
|
19
|
+
</xsl:for-each>
|
|
20
|
+
<xsl:apply-templates/>
|
|
21
|
+
</xsl:element>
|
|
22
|
+
</xsl:template>
|
|
23
|
+
</xsl:stylesheet>`;function w(n,r,t){n.querySelectorAll(r).forEach(e=>{let i=`${r}-${t}`,o=X(e,i);e.replaceWith(o)})}function D(n,r){n.querySelectorAll("*").forEach(t=>{let e=t.classList;e&&e.forEach(i=>{if(i.startsWith(`${r}:`)){let o=i.slice(`${r}:`.length),a=`${t.nodeName}-${o}`,l=X(t,a);t.replaceWith(l)}})})}function X(n,r){let t=document.createElement(r);for(let e of n.attributes)t.setAttribute(e.name,e.value);for(;n.firstChild;)t.appendChild(n.firstChild);return t}function C(n){let r=[];return n.querySelectorAll("qti-assessment-item-ref").forEach(t=>{let e=t.getAttribute("identifier"),i=t.getAttribute("href"),o=t.getAttribute("category");r.push({identifier:e,href:i,category:o})}),r}var L=null;function g(n,r=!1){return r&&L!==null&&L.abort(),new Promise((t,e)=>{let i=new XMLHttpRequest;L=i,i.open("GET",n,!0),i.responseType="document",i.onload=()=>{i.status>=200&&i.status<300?t(i.responseXML):e(i.statusText)},i.onerror=()=>{e(i.statusText)},i.send()})}function d(n){return new DOMParser().parseFromString(n,"text/xml")}function h(n){let r=new XSLTProcessor,t=new DOMParser().parseFromString(O,"text/xml");return r.importStylesheet(t),r.transformToFragment(n,document)}function y(n,r){r.endsWith("/")||(r+="/"),n.querySelectorAll("[src],[href],[primary-path]").forEach(t=>{let e="";t.getAttribute("src")&&(e="src"),t.getAttribute("href")&&(e="href"),t.getAttribute("primary-path")&&(e="primary-path");let i=t.getAttribute(e)?.trim();if(!i.startsWith("data:")&&!i.startsWith("http")){let o=r+encodeURI(i);t.setAttribute(e,o)}})}function E(n){n.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value').forEach(t=>{let e=document.createComment(t.textContent);t.replaceChild(e,t.firstChild)})}function F(n){n.querySelectorAll("qti-stylesheet").forEach(r=>r.remove())}function v(n){switch(n){case"qti-choice-interaction":case"qti-order-interaction":return"qti-simple-choice";case"qti-inline-choice-interaction":return"qti-inline-choice";case"qti-match-interaction":return["qti-simple-match-set:first-of-type qti-simple-associable-choice","qti-simple-match-set:last-of-type > qti-simple-associable-choice"];case"qti-gap-match-interaction":return"qti-gap-text";case"qti-associate-interaction":return"qti-simple-associable-choice";default:}}var $=(n=!1)=>{let r,t={async load(e,i,o=!1){let a=(i||e)?.replace(/[^a-zA-Z0-9]/g,"_");return n&&sessionStorage.getItem(a)?Promise.resolve(t.parse(sessionStorage.getItem(a))):new Promise(l=>{g(e,o).then(c=>(r=c,t.path(e.substring(0,e.lastIndexOf("/"))),n&&sessionStorage.setItem(a,new XMLSerializer().serializeToString(r)),l(t.shuffleInteractions().api)))})},parse(e){return r=d(e),t},path:e=>(y(r,e),t),fn(e){return e(r),t},pciHooks(e){let i=["hook","module"],o=e.substring(0,e.lastIndexOf("/"));for(let a of i)r.querySelectorAll("["+a+"]").forEach(c=>{let u=c.getAttribute(a);!u.startsWith("data:")&&!u.startsWith("http")&&(c.setAttribute("base-url",e),c.setAttribute("module",o+"/"+encodeURI(u+(u.endsWith(".js")?"":".js"))))});return t},shuffleInteractions(e){let i=r.querySelectorAll('[shuffle="true"]'),o=Array.from(i).filter(l=>l.tagName?.toLowerCase().endsWith("-interaction")),a=[];for(let l of o){let c=v(l.tagName.toLowerCase()),u=Array.isArray(c)?c:[c];for(let q of u){let x=Array.from(l.querySelectorAll(q)),b=x.map(s=>s.getAttribute("identifier")||""),A=(a.length+1).toString();if(e){let s=e[A];if(!s.every(p=>b.includes(p))){console.warn(`Predefined order for ${A} contains unknown identifiers.`);continue}let f=s.map(p=>x.find(z=>z.getAttribute("identifier")===p)).filter(Boolean);for(let p of f)p.parentElement.appendChild(p);a.push({interactionId:A,ids:{original:b,shuffled:s}}),l.removeAttribute("shuffle");continue}let S=x.map((s,f)=>({element:s,fixed:s.hasAttribute("fixed")&&s.getAttribute("fixed")==="true",originalOrder:f})).filter(s=>s.fixed),m=x.filter(s=>!s.hasAttribute("fixed")||s.getAttribute("fixed")!=="true");if(m.length<=1)return console.warn("Shuffling is not possible with fewer than 2 non-fixed elements."),{api:t,result:void 0};let P=[...m],T=!1,I=0;for(;!T&&I<20;){I++;for(let s=m.length-1;s>0;s--){let f=Math.floor(Math.random()*(s+1));[m[s],m[f]]=[m[f],m[s]]}T=!m.every((s,f)=>s===P[f])}if(!T)return console.warn("Failed to shuffle the choices after multiple attempts."),null;l.removeAttribute("shuffle");let M=0;for(let s of m)s.parentElement.insertBefore(s,S[M]?.element),M++;for(let s of S)s.element.parentElement.insertBefore(s.element,m[s.originalOrder]);let H=Array.from(l.querySelectorAll(q)).map(s=>s.getAttribute("identifier")||"");a.push({interactionId:A,ids:{original:b,shuffled:H}})}}return{api:t,result:a}},extendElementName:(e,i)=>(w(r,e,i),t),extendElementsWithClass:(e="extend")=>(D(r,e),t),customInteraction(e,i){let o=r.querySelector("qti-custom-interaction"),a=o.querySelector("object");return o.setAttribute("data-base-ref",e),o.setAttribute("data-base-item",e+i),o.setAttribute("data",a.getAttribute("data")),o.setAttribute("width",a.getAttribute("width")),o.setAttribute("height",a.getAttribute("height")),o.removeChild(a),t},convertCDATAtoComment(){return E(r),t},stripStyleSheets(){return F(r),t},html(){return new XMLSerializer().serializeToString(h(r))},xml(){return new XMLSerializer().serializeToString(r)},htmlDoc(){return h(r)},xmlDoc(){return r}};return t};var k=()=>{let n,r={async load(t){return new Promise(e=>{g(t).then(i=>(n=i,e(r)))})},parse(t){n=d(t)},assessmentTest(){let t=n.querySelector('resource[type="imsqti_test_xmlv3p0"]');return{href:t.getAttribute("href"),identifier:t.getAttribute("identifier")}}};return r};var V=()=>{let n,r={async load(t){return new Promise((e,i)=>{g(t).then(o=>(n=o,r.path(t.substring(0,t.lastIndexOf("/"))),e(r)))})},parse(t){return n=d(t),r},path:t=>(y(n,t),r),fn(t){return t(n),r},items(){return C(n)},html(){return new XMLSerializer().serializeToString(h(n))},xml(){return new XMLSerializer().serializeToString(n)},htmlDoc(){return h(n)},xmlDoc(){return n}};return r};export{$ as a,k as b,V as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,b as o,c as r}from"./chunk-3AJ3S2FB.js";var h=async s=>{let t=s.substring(0,s.lastIndexOf("/")),e=await o().load(`${s}`).then(n=>n.assessmentTest()),m=await r().load(`${t}/${e.href}`).then(n=>n.htmlDoc()),f=await r().load(`${t}/${e.href}`).then(n=>n.items()),a=`${t}/${e.href}`,c=`${t}/${e.href.substring(0,e.href.lastIndexOf("/"))}`;return{testHTMLDoc:m,testURI:c,testURL:a,items:f,testIdentifier:e.identifier}},d=async s=>i().load(s).then(t=>t.htmlDoc().firstElementChild);export{h as a,d as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as c,b as h}from"./chunk-7RINQSWP.js";import{a as i}from"./chunk-XUJ7TXHW.js";import{c as l}from"./chunk-5VTVIA6M.js";import{a as n,b as p,c as a}from"./chunk-PT6SVREH.js";import{d as s,i as o}from"./chunk-SCPSWPAG.js";import{a as r}from"./chunk-IAP2CEE7.js";var e=class extends o{constructor(){super(...arguments);this.testURL=null;this.testDoc=null;this.testXML=null;this.templateContent=null}async handleTestURLChange(){if(this.testURL)try{let t=await l().load(this.testURL);this.testDoc=t.htmlDoc()}catch(t){console.error("Error loading or parsing XML:",t)}}handleTestXMLChange(){if(this.testXML)try{this.testDoc=l().parse(this.testXML).htmlDoc()}catch(t){console.error("Error parsing XML:",t)}}async connectedCallback(){super.connectedCallback(),this.initializeTemplateContent(),this.applyStyles(),this.testURL&&this.handleTestURLChange(),this.testXML&&this.handleTestXMLChange()}initializeTemplateContent(){let t=this.querySelector("template");this.templateContent=t?t.content:s``}applyStyles(){let t=new CSSStyleSheet;t.replaceSync(h),this.shadowRoot.adoptedStyleSheets=[t]}render(){return s`
|
|
2
|
+
${this.templateContent}
|
|
3
|
+
<slot></slot>
|
|
4
|
+
${c(this.testDoc,s`<span>Loading...</span>`)}
|
|
5
|
+
`}};r([p({type:String,attribute:"test-url"})],e.prototype,"testURL",2),r([a()],e.prototype,"testDoc",2),r([a()],e.prototype,"testXML",2),r([i("testURL",{waitUntilFirstUpdate:!0})],e.prototype,"handleTestURLChange",1),r([i("testXML",{waitUntilFirstUpdate:!0})],e.prototype,"handleTestXMLChange",1),e=r([n("test-container")],e);export{e as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as p,b as c}from"./chunk-7RINQSWP.js";import{a as l}from"./chunk-XUJ7TXHW.js";import{a as o}from"./chunk-J4CI5WG7.js";import{a as s,b as m,c as a}from"./chunk-PT6SVREH.js";import{d as r,i as n}from"./chunk-SCPSWPAG.js";import{a as i}from"./chunk-IAP2CEE7.js";var e=class extends n{constructor(){super(...arguments);this.itemURL=null;this.itemDoc=null;this.itemXML=null;this.templateContent=null}async handleItemURLChange(){if(this.itemURL)try{let t=await o().load(this.itemURL);this.itemDoc=t.htmlDoc()}catch(t){console.error("Error loading or parsing XML:",t)}}handleItemXMLChange(){if(this.itemXML)try{this.itemDoc=o().parse(this.itemXML).htmlDoc()}catch(t){console.error("Error parsing XML:",t)}}async connectedCallback(){super.connectedCallback(),this.initializeTemplateContent(),this.applyStyles(),this.itemURL&&this.handleItemURLChange(),this.itemXML&&this.handleItemXMLChange()}initializeTemplateContent(){let t=this.querySelector("template");this.templateContent=t?t.content:r``}applyStyles(){let t=new CSSStyleSheet;t.replaceSync(c),this.shadowRoot.adoptedStyleSheets=[t]}render(){return r`
|
|
2
|
+
${this.templateContent}
|
|
3
|
+
<slot></slot>
|
|
4
|
+
${p(this.itemDoc,r`<span>Loading...</span>`)}
|
|
5
|
+
`}};i([m({type:String,attribute:"item-url"})],e.prototype,"itemURL",2),i([a()],e.prototype,"itemDoc",2),i([a()],e.prototype,"itemXML",2),i([l("itemURL",{waitUntilFirstUpdate:!0})],e.prototype,"handleItemURLChange",1),i([l("itemXML",{waitUntilFirstUpdate:!0})],e.prototype,"handleItemXMLChange",1),e=i([s("item-container")],e);export{e as a};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var N=String.raw,O=N`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
2
|
+
<xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />
|
|
3
|
+
<xsl:template match="@*|node()">
|
|
4
|
+
<xsl:copy>
|
|
5
|
+
<xsl:apply-templates select="@*|node()"/>
|
|
6
|
+
</xsl:copy>
|
|
7
|
+
</xsl:template>
|
|
8
|
+
|
|
9
|
+
<!-- remove existing namespaces -->
|
|
10
|
+
<xsl:template match="*">
|
|
11
|
+
<!-- remove element prefix -->
|
|
12
|
+
<xsl:element name="{local-name()}">
|
|
13
|
+
<!-- process attributes -->
|
|
14
|
+
<xsl:for-each select="@*">
|
|
15
|
+
<!-- remove attribute prefix -->
|
|
16
|
+
<xsl:attribute name="{local-name()}">
|
|
17
|
+
<xsl:value-of select="."/>
|
|
18
|
+
</xsl:attribute>
|
|
19
|
+
</xsl:for-each>
|
|
20
|
+
<xsl:apply-templates/>
|
|
21
|
+
</xsl:element>
|
|
22
|
+
</xsl:template>
|
|
23
|
+
</xsl:stylesheet>`;function w(n,r,t){n.querySelectorAll(r).forEach(e=>{let i=`${r}-${t}`,o=X(e,i);e.replaceWith(o)})}function D(n,r){n.querySelectorAll("*").forEach(t=>{let e=t.classList;e&&e.forEach(i=>{if(i.startsWith(`${r}:`)){let o=i.slice(`${r}:`.length),a=`${t.nodeName}-${o}`,l=X(t,a);t.replaceWith(l)}})})}function X(n,r){let t=document.createElement(r);for(let e of n.attributes)t.setAttribute(e.name,e.value);for(;n.firstChild;)t.appendChild(n.firstChild);return t}function C(n){let r=[];return n.querySelectorAll("qti-assessment-item-ref").forEach(t=>{let e=t.getAttribute("identifier"),i=t.getAttribute("href"),o=t.getAttribute("category");r.push({identifier:e,href:i,category:o})}),r}var L=null;function g(n,r=!1){return r&&L!==null&&L.abort(),new Promise((t,e)=>{let i=new XMLHttpRequest;L=i,i.open("GET",n,!0),i.responseType="document",i.onload=()=>{i.status>=200&&i.status<300?t(i.responseXML):e(i.statusText)},i.onerror=()=>{e(i.statusText)},i.send()})}function d(n){return new DOMParser().parseFromString(n,"text/xml")}function h(n){let r=new XSLTProcessor,t=new DOMParser().parseFromString(O,"text/xml");return r.importStylesheet(t),r.transformToFragment(n,document)}function y(n,r){r.endsWith("/")||(r+="/"),n.querySelectorAll("[src],[href],[primary-path]").forEach(t=>{let e="";t.getAttribute("src")&&(e="src"),t.getAttribute("href")&&(e="href"),t.getAttribute("primary-path")&&(e="primary-path");let i=t.getAttribute(e)?.trim();if(!i.startsWith("data:")&&!i.startsWith("http")){let o=r+encodeURI(i);t.setAttribute(e,o)}})}function E(n){n.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value').forEach(t=>{let e=document.createComment(t.textContent);t.replaceChild(e,t.firstChild)})}function F(n){n.querySelectorAll("qti-stylesheet").forEach(r=>r.remove())}function v(n){switch(n){case"qti-choice-interaction":case"qti-order-interaction":return"qti-simple-choice";case"qti-inline-choice-interaction":return"qti-inline-choice";case"qti-match-interaction":return["qti-simple-match-set:first-of-type qti-simple-associable-choice","qti-simple-match-set:last-of-type > qti-simple-associable-choice"];case"qti-gap-match-interaction":return"qti-gap-text";case"qti-associate-interaction":return"qti-simple-associable-choice";default:}}var $=(n=!1)=>{let r,t={async load(e,i,o=!1){let a=(i||e)?.replace(/[^a-zA-Z0-9]/g,"_");return n&&sessionStorage.getItem(a)?Promise.resolve(t.parse(sessionStorage.getItem(a))):new Promise(l=>{g(e,o).then(c=>(r=c,t.path(e.substring(0,e.lastIndexOf("/"))),n&&sessionStorage.setItem(a,new XMLSerializer().serializeToString(r)),l(t)))})},parse(e){return r=d(e),t},path:e=>(y(r,e),t),fn(e){return e(r),t},pciHooks(e){let i=["hook","module"],o=e.substring(0,e.lastIndexOf("/"));for(let a of i)r.querySelectorAll("["+a+"]").forEach(c=>{let u=c.getAttribute(a);!u.startsWith("data:")&&!u.startsWith("http")&&(c.setAttribute("base-url",e),c.setAttribute("module",o+"/"+encodeURI(u+(u.endsWith(".js")?"":".js"))))});return t},shuffleInteractions(e){let i=r.querySelectorAll('[shuffle="true"]'),o=Array.from(i).filter(l=>l.tagName?.toLowerCase().endsWith("-interaction")),a=[];for(let l of o){let c=v(l.tagName.toLowerCase()),u=Array.isArray(c)?c:[c];for(let q of u){let x=Array.from(l.querySelectorAll(q)),b=x.map(s=>s.getAttribute("identifier")||""),A=(a.length+1).toString();if(e){let s=e[A];if(!s.every(p=>b.includes(p))){console.warn(`Predefined order for ${A} contains unknown identifiers.`);continue}let f=s.map(p=>x.find(z=>z.getAttribute("identifier")===p)).filter(Boolean);for(let p of f)p.parentElement.appendChild(p);a.push({interactionId:A,ids:{original:b,shuffled:s}}),l.removeAttribute("shuffle");continue}let S=x.map((s,f)=>({element:s,fixed:s.hasAttribute("fixed")&&s.getAttribute("fixed")==="true",originalOrder:f})).filter(s=>s.fixed),m=x.filter(s=>!s.hasAttribute("fixed")||s.getAttribute("fixed")!=="true");if(m.length<=1)return console.warn("Shuffling is not possible with fewer than 2 non-fixed elements."),{api:t,result:void 0};let P=[...m],T=!1,M=0;for(;!T&&M<20;){M++;for(let s=m.length-1;s>0;s--){let f=Math.floor(Math.random()*(s+1));[m[s],m[f]]=[m[f],m[s]]}T=!m.every((s,f)=>s===P[f])}if(!T)return console.warn("Failed to shuffle the choices after multiple attempts."),null;l.removeAttribute("shuffle");let I=0;for(let s of m)s.parentElement.insertBefore(s,S[I]?.element),I++;for(let s of S)s.element.parentElement.insertBefore(s.element,m[s.originalOrder]);let H=Array.from(l.querySelectorAll(q)).map(s=>s.getAttribute("identifier")||"");a.push({interactionId:A,ids:{original:b,shuffled:H}})}}return{api:t,result:a}},extendElementName:(e,i)=>(w(r,e,i),t),extendElementsWithClass:(e="extend")=>(D(r,e),t),customInteraction(e,i){let o=r.querySelector("qti-custom-interaction"),a=o.querySelector("object");return o.setAttribute("data-base-ref",e),o.setAttribute("data-base-item",e+i),o.setAttribute("data",a.getAttribute("data")),o.setAttribute("width",a.getAttribute("width")),o.setAttribute("height",a.getAttribute("height")),o.removeChild(a),t},convertCDATAtoComment(){return E(r),t},stripStyleSheets(){return F(r),t},html(){return new XMLSerializer().serializeToString(h(r))},xml(){return new XMLSerializer().serializeToString(r)},htmlDoc(){return h(r)},xmlDoc(){return r}};return t};var k=()=>{let n,r={async load(t){return new Promise(e=>{g(t).then(i=>(n=i,e(r)))})},parse(t){n=d(t)},assessmentTest(){let t=n.querySelector('resource[type="imsqti_test_xmlv3p0"]');return{href:t.getAttribute("href"),identifier:t.getAttribute("identifier")}}};return r};var V=()=>{let n,r={async load(t){return new Promise((e,i)=>{g(t).then(o=>(n=o,r.path(t.substring(0,t.lastIndexOf("/"))),e(r)))})},parse(t){return n=d(t),r},path:t=>(y(n,t),r),fn(t){return t(n),r},items(){return C(n)},html(){return new XMLSerializer().serializeToString(h(n))},xml(){return new XMLSerializer().serializeToString(n)},htmlDoc(){return h(n)},xmlDoc(){return n}};return r};export{$ as a,k as b,V as c};
|