@citolab/qti-components 6.9.1-1 → 6.9.1-2
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/dist/custom-elements.json +56 -56
- package/dist/index.js +7 -7
- package/dist/qti-components/index.js +59 -59
- package/package.json +1 -1
|
@@ -748,6 +748,62 @@
|
|
|
748
748
|
"declarations": [],
|
|
749
749
|
"exports": []
|
|
750
750
|
},
|
|
751
|
+
{
|
|
752
|
+
"kind": "javascript-module",
|
|
753
|
+
"path": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts",
|
|
754
|
+
"declarations": [
|
|
755
|
+
{
|
|
756
|
+
"kind": "class",
|
|
757
|
+
"description": "Represents a custom element for referencing an assessment stimulus.",
|
|
758
|
+
"name": "QtiAssessmentStimulusRef",
|
|
759
|
+
"members": [],
|
|
760
|
+
"attributes": [
|
|
761
|
+
{
|
|
762
|
+
"name": "identifier",
|
|
763
|
+
"type": {
|
|
764
|
+
"text": "string"
|
|
765
|
+
},
|
|
766
|
+
"default": "''",
|
|
767
|
+
"description": "The identifier of the stimulus.",
|
|
768
|
+
"fieldName": "identifier"
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
"name": "href",
|
|
772
|
+
"type": {
|
|
773
|
+
"text": "string"
|
|
774
|
+
},
|
|
775
|
+
"default": "''",
|
|
776
|
+
"description": "The href of the stimulus.",
|
|
777
|
+
"fieldName": "href"
|
|
778
|
+
}
|
|
779
|
+
],
|
|
780
|
+
"superclass": {
|
|
781
|
+
"name": "LitElement",
|
|
782
|
+
"package": "lit"
|
|
783
|
+
},
|
|
784
|
+
"tagName": "qti-assessment-stimulus-ref",
|
|
785
|
+
"customElement": true
|
|
786
|
+
}
|
|
787
|
+
],
|
|
788
|
+
"exports": [
|
|
789
|
+
{
|
|
790
|
+
"kind": "js",
|
|
791
|
+
"name": "QtiAssessmentStimulusRef",
|
|
792
|
+
"declaration": {
|
|
793
|
+
"name": "QtiAssessmentStimulusRef",
|
|
794
|
+
"module": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts"
|
|
795
|
+
}
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
"kind": "custom-element-definition",
|
|
799
|
+
"name": "qti-assessment-stimulus-ref",
|
|
800
|
+
"declaration": {
|
|
801
|
+
"name": "QtiAssessmentStimulusRef",
|
|
802
|
+
"module": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts"
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
]
|
|
806
|
+
},
|
|
751
807
|
{
|
|
752
808
|
"kind": "javascript-module",
|
|
753
809
|
"path": "src/lib/qti-components/qti-assessment-item/item-print-variables.ts",
|
|
@@ -927,62 +983,6 @@
|
|
|
927
983
|
}
|
|
928
984
|
]
|
|
929
985
|
},
|
|
930
|
-
{
|
|
931
|
-
"kind": "javascript-module",
|
|
932
|
-
"path": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts",
|
|
933
|
-
"declarations": [
|
|
934
|
-
{
|
|
935
|
-
"kind": "class",
|
|
936
|
-
"description": "Represents a custom element for referencing an assessment stimulus.",
|
|
937
|
-
"name": "QtiAssessmentStimulusRef",
|
|
938
|
-
"members": [],
|
|
939
|
-
"attributes": [
|
|
940
|
-
{
|
|
941
|
-
"name": "identifier",
|
|
942
|
-
"type": {
|
|
943
|
-
"text": "string"
|
|
944
|
-
},
|
|
945
|
-
"default": "''",
|
|
946
|
-
"description": "The identifier of the stimulus.",
|
|
947
|
-
"fieldName": "identifier"
|
|
948
|
-
},
|
|
949
|
-
{
|
|
950
|
-
"name": "href",
|
|
951
|
-
"type": {
|
|
952
|
-
"text": "string"
|
|
953
|
-
},
|
|
954
|
-
"default": "''",
|
|
955
|
-
"description": "The href of the stimulus.",
|
|
956
|
-
"fieldName": "href"
|
|
957
|
-
}
|
|
958
|
-
],
|
|
959
|
-
"superclass": {
|
|
960
|
-
"name": "LitElement",
|
|
961
|
-
"package": "lit"
|
|
962
|
-
},
|
|
963
|
-
"tagName": "qti-assessment-stimulus-ref",
|
|
964
|
-
"customElement": true
|
|
965
|
-
}
|
|
966
|
-
],
|
|
967
|
-
"exports": [
|
|
968
|
-
{
|
|
969
|
-
"kind": "js",
|
|
970
|
-
"name": "QtiAssessmentStimulusRef",
|
|
971
|
-
"declaration": {
|
|
972
|
-
"name": "QtiAssessmentStimulusRef",
|
|
973
|
-
"module": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts"
|
|
974
|
-
}
|
|
975
|
-
},
|
|
976
|
-
{
|
|
977
|
-
"kind": "custom-element-definition",
|
|
978
|
-
"name": "qti-assessment-stimulus-ref",
|
|
979
|
-
"declaration": {
|
|
980
|
-
"name": "QtiAssessmentStimulusRef",
|
|
981
|
-
"module": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts"
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
]
|
|
985
|
-
},
|
|
986
986
|
{
|
|
987
987
|
"kind": "javascript-module",
|
|
988
988
|
"path": "src/lib/qti-components/qti-companion-materials-info/qti-companion-materials-info.ts",
|
package/dist/index.js
CHANGED
|
@@ -352,7 +352,7 @@ var Mr=Object.defineProperty,Rs=Object.defineProperties,ks=Object.getOwnProperty
|
|
|
352
352
|
`],st=a([h("qti-hotspot-interaction")],st);var fe=class extends g{constructor(){super(...arguments);this.matchMin=0;this.matchMax=1;this.fixed=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("slot","qti-simple-associable-choice"),this.setAttribute("part","qti-simple-associable-choice")}render(){return d`
|
|
353
353
|
<slot></slot>
|
|
354
354
|
<slot name="qti-simple-associable-choice"></slot>
|
|
355
|
-
`}};a([p({type:Number,attribute:"match-min"})],fe.prototype,"matchMin",2),a([p({type:Number,attribute:"match-max"})],fe.prototype,"matchMax",2),a([p({type:Boolean,attribute:"fixed"})],fe.prototype,"fixed",2),fe=a([h("qti-simple-associable-choice")],fe);var ge=class extends z(g,"qti-simple-match-set:first-of-type qti-simple-associable-choice",!1,"qti-simple-match-set:last-of-type qti-simple-associable-choice"){constructor(){super(...arguments);this.lastCheckedRadio=null;this.response=[];this.responseIdentifier="";this.handleRadioClick=e=>{let r=e.target;this.lastCheckedRadio===r?(r.checked=!1,this.lastCheckedRadio=null,this.handleRadioChange(e)):this.lastCheckedRadio=r};this.handleRadioChange=e=>{let r=e.target,s=r.value;r.checked?(this.response.push(s),this.lastCheckedRadio=r):(this.response=this.response.filter(
|
|
355
|
+
`}};a([p({type:Number,attribute:"match-min"})],fe.prototype,"matchMin",2),a([p({type:Number,attribute:"match-max"})],fe.prototype,"matchMax",2),a([p({type:Boolean,attribute:"fixed"})],fe.prototype,"fixed",2),fe=a([h("qti-simple-associable-choice")],fe);var ge=class extends z(g,"qti-simple-match-set:first-of-type qti-simple-associable-choice",!1,"qti-simple-match-set:last-of-type qti-simple-associable-choice"){constructor(){super(...arguments);this.lastCheckedRadio=null;this.response=[];this.responseIdentifier="";this.handleRadioClick=e=>{let r=e.target;this.lastCheckedRadio===r?(r.checked=!1,this.lastCheckedRadio=null,this.handleRadioChange(e)):this.lastCheckedRadio=r};this.handleRadioChange=e=>{let r=e.target,s=r.value,n=r.name,o=r.type;r.checked?(this.response?this.response.indexOf(s)===-1&&(o==="radio"&&(this.response=this.response.filter(l=>l.indexOf(n)===-1)),this.response.push(s)):this.response=[s],this.lastCheckedRadio=r):(this.response=this.response.filter(l=>l!==s),this.lastCheckedRadio=null),this.requestUpdate(),this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,detail:{responseIdentifier:this.responseIdentifier,response:this.response}}))}}connectedCallback(){super.connectedCallback(),this.rows=Array.from(this.querySelectorAll("qti-simple-match-set:first-of-type qti-simple-associable-choice")),this.cols=Array.from(this.querySelectorAll("qti-simple-match-set:last-of-type qti-simple-associable-choice")),this.response=[]}render(){return this.classList.contains("qti-match-tabular")?d`
|
|
356
356
|
<slot name="prompt"></slot>
|
|
357
357
|
<table>
|
|
358
358
|
<tr>
|
|
@@ -362,16 +362,16 @@ var Mr=Object.defineProperty,Rs=Object.defineProperties,ks=Object.getOwnProperty
|
|
|
362
362
|
|
|
363
363
|
${this.rows.map((e,r)=>d`<tr>
|
|
364
364
|
<td part="c-header">${we(e.innerHTML)}</td>
|
|
365
|
-
${this.cols.map((s,n)=>{let o=e.getAttribute("identifier"),l=s.getAttribute("identifier"),c=`${o} ${l}`,u=this.response.filter(
|
|
365
|
+
${this.cols.map((s,n)=>{let o=e.getAttribute("identifier"),l=s.getAttribute("identifier"),c=`${o} ${l}`,u=this.response.filter(v=>v.split(" ")[0]===o).length||0,m=this.response.includes(c),f=`rb ${m?"rb-checked":""}`,y=e.matchMax===1?!1:u>=e.matchMax&&!m;return d`<td>
|
|
366
366
|
<input
|
|
367
|
-
type=${e.matchMax===1?"radio":"checkbox"}
|
|
367
|
+
type=${e.matchMax===1?"radio":"checkbox"}
|
|
368
368
|
role="id"
|
|
369
|
+
part=${f}
|
|
369
370
|
name=${o}
|
|
370
371
|
value=${c}
|
|
371
|
-
.disabled=${
|
|
372
|
-
|
|
373
|
-
@
|
|
374
|
-
@click=${y=>e.matchMax===1?this.handleRadioClick(y):null}
|
|
372
|
+
.disabled=${y}
|
|
373
|
+
@change=${v=>this.handleRadioChange(v)}
|
|
374
|
+
@click=${v=>e.matchMax===1?this.handleRadioClick(v):null}
|
|
375
375
|
/>
|
|
376
376
|
</td>`})}
|
|
377
377
|
</tr>`)}
|