@citolab/qti-components 7.2.2 → 7.3.0
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-2PEB7XOI.js +1 -0
- package/cdn/chunks/chunk-2YSPUZLT.js +2 -0
- package/cdn/chunks/chunk-3HVTDMTS.js +1 -0
- package/cdn/chunks/chunk-3YJ5LGHO.js +1 -0
- package/cdn/chunks/chunk-4HD4LAOA.js +2 -0
- package/cdn/chunks/chunk-4PXGOA73.js +1 -0
- package/cdn/chunks/chunk-4U6VOTDY.js +2 -0
- package/cdn/chunks/chunk-5B5ZBB3H.js +2 -0
- package/cdn/chunks/chunk-6KJL4I6M.js +1 -0
- package/cdn/chunks/chunk-7ASLC5ZB.js +1 -0
- package/cdn/chunks/chunk-7OAHC7YP.js +1 -0
- package/cdn/chunks/chunk-7P7BX6D6.js +1 -0
- package/cdn/chunks/chunk-AH2FX4HG.js +1 -0
- package/cdn/chunks/chunk-ALDED3YL.js +1 -0
- package/cdn/chunks/chunk-AOQNGPU3.js +1 -0
- package/cdn/chunks/chunk-ARYTJGGM.js +8 -0
- package/cdn/chunks/chunk-BS7S3RPY.js +1 -0
- package/cdn/chunks/chunk-BSL7QSJS.js +1 -0
- package/cdn/chunks/chunk-C2RWTG52.js +1 -0
- package/cdn/chunks/chunk-DKMPPZUE.js +2 -0
- package/cdn/chunks/chunk-DNPPZXZF.js +1 -0
- package/cdn/chunks/chunk-EJQGI6MR.js +1 -0
- package/cdn/chunks/chunk-EKAFL2KP.js +1 -0
- package/cdn/chunks/chunk-F63HVNEI.js +1 -0
- package/cdn/chunks/chunk-FKNSURIA.js +2 -0
- package/cdn/chunks/chunk-FNCQNHCU.js +1 -0
- package/cdn/chunks/chunk-GTDTMMHF.js +2 -0
- package/cdn/chunks/chunk-GYF5ZDB3.js +1 -0
- package/cdn/chunks/chunk-H6ZOKOLE.js +1 -0
- package/cdn/chunks/chunk-HCAWI7AZ.js +1 -0
- package/cdn/chunks/chunk-I25TBSYM.js +8 -0
- package/cdn/chunks/chunk-IAXDPXPS.js +2 -0
- package/cdn/chunks/chunk-JATFFFTP.js +1 -0
- package/cdn/chunks/chunk-JFCDOKX7.js +2 -0
- package/cdn/chunks/chunk-JSCH2J4L.js +2 -0
- package/cdn/chunks/chunk-LZMZV6TD.js +2 -0
- package/cdn/chunks/chunk-MR6ZHDES.js +1 -0
- package/cdn/chunks/chunk-N6A5NZLH.js +1 -0
- package/cdn/chunks/chunk-NNGQPZRR.js +2 -0
- package/cdn/chunks/chunk-NTHP3CIK.js +1 -0
- package/cdn/chunks/chunk-NUS4RU5N.js +1 -0
- package/cdn/chunks/chunk-OJTWWSZH.js +1 -0
- package/cdn/chunks/chunk-P6SSTAJ2.js +1 -0
- package/cdn/chunks/chunk-PACSO5NR.js +1 -0
- package/cdn/chunks/chunk-Q4UYMUWQ.js +1 -0
- package/cdn/chunks/chunk-QNNLXEUP.js +1 -0
- package/cdn/chunks/chunk-R345NUSS.js +2 -0
- package/cdn/chunks/chunk-RATUNBN5.js +1 -0
- package/cdn/chunks/chunk-RAXTSUAP.js +1 -0
- package/cdn/chunks/chunk-SGUBIUUK.js +1 -0
- package/cdn/chunks/chunk-SKCRMPN3.js +8 -0
- package/cdn/chunks/chunk-SXYEFBGL.js +2 -0
- package/cdn/chunks/chunk-TDDS7QJB.js +48 -0
- package/cdn/chunks/chunk-TDKNW4KB.js +1 -0
- package/cdn/chunks/chunk-TTH5243V.js +1 -0
- package/cdn/chunks/chunk-U4D7JJMM.js +1 -0
- package/cdn/chunks/chunk-UGQPBOTB.js +17 -0
- package/cdn/chunks/chunk-UO3YPQWX.js +1 -0
- package/cdn/chunks/chunk-UOYDBSKF.js +1 -0
- package/cdn/chunks/chunk-W3L3NJQM.js +1 -0
- package/cdn/chunks/chunk-XDXLBDGD.js +2 -0
- package/cdn/chunks/chunk-XLVU3CES.js +1 -0
- package/cdn/chunks/chunk-YL5IGHSU.js +1 -0
- package/cdn/chunks/chunk-ZNLWZYAX.js +5 -0
- package/cdn/chunks/chunk-ZWUH2GAI.js +1 -0
- package/cdn/exports/computed.context.js +1 -1
- package/cdn/index.js +1 -1
- package/cdn/qti-test/components/index.js +1 -1
- package/cdn/qti-test/components/test-navigation.js +1 -1
- package/cdn/qti-test/components/test-next.js +1 -1
- package/cdn/qti-test/components/test-paging-buttons-stamp.js +1 -1
- package/cdn/qti-test/components/test-prev.js +1 -1
- package/cdn/qti-test/components/test-print-context.js +1 -1
- package/cdn/qti-test/components/test-print-item-variables.js +1 -1
- package/cdn/qti-test/components/test-scoring-buttons.js +1 -1
- package/cdn/qti-test/components/test-scoring-feedback.js +1 -1
- package/cdn/qti-test/components/test-scoring-toggle.js +1 -0
- package/cdn/qti-test/components/test-section-buttons-stamp.js +1 -1
- package/cdn/qti-test/components/test-show-correct-response.js +1 -1
- package/cdn/qti-test/components/test-stamp.js +1 -1
- package/cdn/qti-test/components/test-view-toggle copy.js +1 -0
- package/cdn/qti-test/components/test-view-toggle.js +1 -1
- package/cdn/qti-test/core/index.js +1 -1
- package/dist/chunks/chunk-22IRJWWY.js +10 -0
- package/dist/chunks/chunk-22IRJWWY.js.map +1 -0
- package/dist/chunks/chunk-254VCWDJ.js +249 -0
- package/dist/chunks/chunk-254VCWDJ.js.map +1 -0
- package/dist/chunks/chunk-2SJOPI6B.js +45 -0
- package/dist/chunks/chunk-2SJOPI6B.js.map +1 -0
- package/dist/chunks/chunk-2WZXGGU3.js +85 -0
- package/dist/chunks/chunk-2WZXGGU3.js.map +1 -0
- package/dist/chunks/chunk-36G5MQKR.js +85 -0
- package/dist/chunks/chunk-36G5MQKR.js.map +1 -0
- package/dist/chunks/chunk-3L7UTYZ5.js +92 -0
- package/dist/chunks/chunk-3L7UTYZ5.js.map +1 -0
- package/dist/chunks/chunk-3N546FXF.js +81 -0
- package/dist/chunks/chunk-3N546FXF.js.map +1 -0
- package/dist/chunks/chunk-3QOIGEC7.js +92 -0
- package/dist/chunks/chunk-3QOIGEC7.js.map +1 -0
- package/dist/chunks/chunk-3UAT3IXP.js +85 -0
- package/dist/chunks/chunk-3UAT3IXP.js.map +1 -0
- package/dist/chunks/chunk-4KYSAVEL.js +85 -0
- package/dist/chunks/chunk-4KYSAVEL.js.map +1 -0
- package/dist/chunks/chunk-4OGJBG35.js +8 -0
- package/dist/chunks/chunk-4OGJBG35.js.map +1 -0
- package/dist/chunks/chunk-4UEAQMY4.js +28 -0
- package/dist/chunks/chunk-4UEAQMY4.js.map +1 -0
- package/dist/chunks/chunk-5F52D6LQ.js +64 -0
- package/dist/chunks/chunk-5F52D6LQ.js.map +1 -0
- package/dist/chunks/chunk-5FEXUWZH.js +28 -0
- package/dist/chunks/chunk-5FEXUWZH.js.map +1 -0
- package/dist/chunks/chunk-6ELX5242.js +234 -0
- package/dist/chunks/chunk-6ELX5242.js.map +1 -0
- package/dist/chunks/chunk-6FJB3RNO.js +65 -0
- package/dist/chunks/chunk-6FJB3RNO.js.map +1 -0
- package/dist/chunks/chunk-6HSX33RT.js +239 -0
- package/dist/chunks/chunk-6HSX33RT.js.map +1 -0
- package/dist/chunks/chunk-6KHKAHVS.js +235 -0
- package/dist/chunks/chunk-6KHKAHVS.js.map +1 -0
- package/dist/chunks/chunk-6YAR3VHX.js +56 -0
- package/dist/chunks/chunk-6YAR3VHX.js.map +1 -0
- package/dist/chunks/chunk-7SGVY6AL.js +85 -0
- package/dist/chunks/chunk-7SGVY6AL.js.map +1 -0
- package/dist/chunks/chunk-7ZME7TLK.js +81 -0
- package/dist/chunks/chunk-7ZME7TLK.js.map +1 -0
- package/dist/chunks/chunk-AZIKAG7K.js +8 -0
- package/dist/chunks/chunk-AZIKAG7K.js.map +1 -0
- package/dist/chunks/chunk-B2J3M334.js +92 -0
- package/dist/chunks/chunk-B2J3M334.js.map +1 -0
- package/dist/chunks/chunk-BEFR3ACM.js +241 -0
- package/dist/chunks/chunk-BEFR3ACM.js.map +1 -0
- package/dist/chunks/chunk-BSDFAZ5E.js +43 -0
- package/dist/chunks/chunk-BSDFAZ5E.js.map +1 -0
- package/dist/chunks/chunk-BTNZ5BZC.js +99 -0
- package/dist/chunks/chunk-BTNZ5BZC.js.map +1 -0
- package/dist/chunks/chunk-CL26AHAV.js +65 -0
- package/dist/chunks/chunk-CL26AHAV.js.map +1 -0
- package/dist/chunks/chunk-CLLDFOBO.js +64 -0
- package/dist/chunks/chunk-CLLDFOBO.js.map +1 -0
- package/dist/chunks/chunk-CO4K3UIU.js +81 -0
- package/dist/chunks/chunk-CO4K3UIU.js.map +1 -0
- package/dist/chunks/chunk-CRFBT36M.js +85 -0
- package/dist/chunks/chunk-CRFBT36M.js.map +1 -0
- package/dist/chunks/chunk-CRI6TK2F.js +81 -0
- package/dist/chunks/chunk-CRI6TK2F.js.map +1 -0
- package/dist/chunks/chunk-CS3XEHIS.js +64 -0
- package/dist/chunks/chunk-CS3XEHIS.js.map +1 -0
- package/dist/chunks/chunk-D47JA24G.js +85 -0
- package/dist/chunks/chunk-D47JA24G.js.map +1 -0
- package/dist/chunks/chunk-DIEBUNEE.js +83 -0
- package/dist/chunks/chunk-DIEBUNEE.js.map +1 -0
- package/dist/chunks/chunk-DLBPLBZU.js +85 -0
- package/dist/chunks/chunk-DLBPLBZU.js.map +1 -0
- package/dist/chunks/chunk-DNBDU6ZU.js +45 -0
- package/dist/chunks/chunk-DNBDU6ZU.js.map +1 -0
- package/dist/chunks/chunk-DNLC7HVK.js +870 -0
- package/dist/chunks/chunk-DNLC7HVK.js.map +1 -0
- package/dist/chunks/chunk-DSAPUEWR.js +81 -0
- package/dist/chunks/chunk-DSAPUEWR.js.map +1 -0
- package/dist/chunks/chunk-DZAOLWAS.js +238 -0
- package/dist/chunks/chunk-DZAOLWAS.js.map +1 -0
- package/dist/chunks/chunk-E572KIOQ.js +83 -0
- package/dist/chunks/chunk-E572KIOQ.js.map +1 -0
- package/dist/chunks/chunk-EIIKSMCN.js +96 -0
- package/dist/chunks/chunk-EIIKSMCN.js.map +1 -0
- package/dist/chunks/chunk-EJZQSOHU.js +85 -0
- package/dist/chunks/chunk-EJZQSOHU.js.map +1 -0
- package/dist/chunks/chunk-EP4SJRC6.js +99 -0
- package/dist/chunks/chunk-EP4SJRC6.js.map +1 -0
- package/dist/chunks/chunk-EXNO2VEU.js +85 -0
- package/dist/chunks/chunk-EXNO2VEU.js.map +1 -0
- package/dist/chunks/chunk-FAMJLVHG.js +92 -0
- package/dist/chunks/chunk-FAMJLVHG.js.map +1 -0
- package/dist/chunks/chunk-FBE6FA2H.js +45 -0
- package/dist/chunks/chunk-FBE6FA2H.js.map +1 -0
- package/dist/chunks/chunk-FEIMJLFV.js +85 -0
- package/dist/chunks/chunk-FEIMJLFV.js.map +1 -0
- package/dist/chunks/chunk-FIN4YG3K.js +233 -0
- package/dist/chunks/chunk-FIN4YG3K.js.map +1 -0
- package/dist/chunks/chunk-FQMHR6ZF.js +92 -0
- package/dist/chunks/chunk-FQMHR6ZF.js.map +1 -0
- package/dist/chunks/chunk-FS7SRRSA.js +96 -0
- package/dist/chunks/chunk-FS7SRRSA.js.map +1 -0
- package/dist/chunks/chunk-G5R527RC.js +90 -0
- package/dist/chunks/chunk-G5R527RC.js.map +1 -0
- package/dist/chunks/chunk-GBGZRLXO.js +45 -0
- package/dist/chunks/chunk-GBGZRLXO.js.map +1 -0
- package/dist/chunks/chunk-GBU4IXYM.js +95 -0
- package/dist/chunks/chunk-GBU4IXYM.js.map +1 -0
- package/dist/chunks/chunk-GDZ632HR.js +244 -0
- package/dist/chunks/chunk-GDZ632HR.js.map +1 -0
- package/dist/chunks/chunk-GE7AVAEW.js +99 -0
- package/dist/chunks/chunk-GE7AVAEW.js.map +1 -0
- package/dist/chunks/chunk-GXXWWT6Y.js +96 -0
- package/dist/chunks/chunk-GXXWWT6Y.js.map +1 -0
- package/dist/chunks/chunk-H7YSTWT5.js +45 -0
- package/dist/chunks/chunk-H7YSTWT5.js.map +1 -0
- package/dist/chunks/chunk-HAP4ICAJ.js +8 -0
- package/dist/chunks/chunk-HAP4ICAJ.js.map +1 -0
- package/dist/chunks/chunk-HARRGXYA.js +243 -0
- package/dist/chunks/chunk-HARRGXYA.js.map +1 -0
- package/dist/chunks/chunk-HNCSSLU6.js +95 -0
- package/dist/chunks/chunk-HNCSSLU6.js.map +1 -0
- package/dist/chunks/chunk-IDZOOEB2.js +85 -0
- package/dist/chunks/chunk-IDZOOEB2.js.map +1 -0
- package/dist/chunks/chunk-IGSFWBNK.js +235 -0
- package/dist/chunks/chunk-IGSFWBNK.js.map +1 -0
- package/dist/chunks/chunk-IPRRYKZD.js +95 -0
- package/dist/chunks/chunk-IPRRYKZD.js.map +1 -0
- package/dist/chunks/chunk-J3I5LKXH.js +60 -0
- package/dist/chunks/chunk-J3I5LKXH.js.map +1 -0
- package/dist/chunks/chunk-JDSSQE7I.js +56 -0
- package/dist/chunks/chunk-JDSSQE7I.js.map +1 -0
- package/dist/chunks/chunk-JKX62AOP.js +8 -0
- package/dist/chunks/chunk-JKX62AOP.js.map +1 -0
- package/dist/chunks/chunk-JMYRH33D.js +84 -0
- package/dist/chunks/chunk-JMYRH33D.js.map +1 -0
- package/dist/chunks/chunk-JX3F6YCC.js +43 -0
- package/dist/chunks/chunk-JX3F6YCC.js.map +1 -0
- package/dist/chunks/chunk-JXMZQ3DF.js +249 -0
- package/dist/chunks/chunk-JXMZQ3DF.js.map +1 -0
- package/dist/chunks/chunk-K7JGTBMV.js +248 -0
- package/dist/chunks/chunk-K7JGTBMV.js.map +1 -0
- package/dist/chunks/chunk-KBQUCIRG.js +233 -0
- package/dist/chunks/chunk-KBQUCIRG.js.map +1 -0
- package/dist/chunks/chunk-KGVAUC45.js +242 -0
- package/dist/chunks/chunk-KGVAUC45.js.map +1 -0
- package/dist/chunks/chunk-KH3ZEJAY.js +95 -0
- package/dist/chunks/chunk-KH3ZEJAY.js.map +1 -0
- package/dist/chunks/chunk-KIK3YNR7.js +95 -0
- package/dist/chunks/chunk-KIK3YNR7.js.map +1 -0
- package/dist/chunks/chunk-KKV6WBJ2.js +234 -0
- package/dist/chunks/chunk-KKV6WBJ2.js.map +1 -0
- package/dist/chunks/chunk-KWCQRFC3.js +56 -0
- package/dist/chunks/chunk-KWCQRFC3.js.map +1 -0
- package/dist/chunks/chunk-KWUJVUKA.js +99 -0
- package/dist/chunks/chunk-KWUJVUKA.js.map +1 -0
- package/dist/chunks/chunk-LMWMNMIU.js +99 -0
- package/dist/chunks/chunk-LMWMNMIU.js.map +1 -0
- package/dist/chunks/chunk-LSTECKJV.js +56 -0
- package/dist/chunks/chunk-LSTECKJV.js.map +1 -0
- package/dist/chunks/chunk-LWBXN5C4.js +66 -0
- package/dist/chunks/chunk-LWBXN5C4.js.map +1 -0
- package/dist/chunks/chunk-LXQKATBH.js +91 -0
- package/dist/chunks/chunk-LXQKATBH.js.map +1 -0
- package/dist/chunks/chunk-M2PGI5QL.js +92 -0
- package/dist/chunks/chunk-M2PGI5QL.js.map +1 -0
- package/dist/chunks/chunk-M3D3T5OO.js +45 -0
- package/dist/chunks/chunk-M3D3T5OO.js.map +1 -0
- package/dist/chunks/chunk-M43YVT6M.js +8 -0
- package/dist/chunks/chunk-M43YVT6M.js.map +1 -0
- package/dist/chunks/chunk-MJMLVDAV.js +82 -0
- package/dist/chunks/chunk-MJMLVDAV.js.map +1 -0
- package/dist/chunks/chunk-MNYMPXJZ.js +95 -0
- package/dist/chunks/chunk-MNYMPXJZ.js.map +1 -0
- package/dist/chunks/chunk-MT3XAJZC.js +61 -0
- package/dist/chunks/chunk-MT3XAJZC.js.map +1 -0
- package/dist/chunks/chunk-MYRQCWA6.js +81 -0
- package/dist/chunks/chunk-MYRQCWA6.js.map +1 -0
- package/dist/chunks/chunk-NY5T6G3K.js +8 -0
- package/dist/chunks/chunk-NY5T6G3K.js.map +1 -0
- package/dist/chunks/chunk-NYR2RLEI.js +65 -0
- package/dist/chunks/chunk-NYR2RLEI.js.map +1 -0
- package/dist/chunks/chunk-O3WD4F3W.js +92 -0
- package/dist/chunks/chunk-O3WD4F3W.js.map +1 -0
- package/dist/chunks/chunk-OALKFNG4.js +99 -0
- package/dist/chunks/chunk-OALKFNG4.js.map +1 -0
- package/dist/chunks/chunk-OB2TPXBB.js +85 -0
- package/dist/chunks/chunk-OB2TPXBB.js.map +1 -0
- package/dist/chunks/chunk-OH5UJYOH.js +83 -0
- package/dist/chunks/chunk-OH5UJYOH.js.map +1 -0
- package/dist/chunks/chunk-OLDZGCD4.js +45 -0
- package/dist/chunks/chunk-OLDZGCD4.js.map +1 -0
- package/dist/chunks/chunk-ONVGVU57.js +243 -0
- package/dist/chunks/chunk-ONVGVU57.js.map +1 -0
- package/dist/chunks/chunk-OWELU5YR.js +43 -0
- package/dist/chunks/chunk-OWELU5YR.js.map +1 -0
- package/dist/chunks/chunk-P4CAO52E.js +43 -0
- package/dist/chunks/chunk-P4CAO52E.js.map +1 -0
- package/dist/chunks/chunk-P6SNSCN4.js +235 -0
- package/dist/chunks/chunk-P6SNSCN4.js.map +1 -0
- package/dist/chunks/chunk-PJIOSYIC.js +241 -0
- package/dist/chunks/chunk-PJIOSYIC.js.map +1 -0
- package/dist/chunks/chunk-PRYR7UB6.js +95 -0
- package/dist/chunks/chunk-PRYR7UB6.js.map +1 -0
- package/dist/chunks/chunk-PSGZN2AP.js +8 -0
- package/dist/chunks/chunk-PSGZN2AP.js.map +1 -0
- package/dist/chunks/chunk-PWNPDEWD.js +43 -0
- package/dist/chunks/chunk-PWNPDEWD.js.map +1 -0
- package/dist/chunks/chunk-QHGH7FF6.js +28 -0
- package/dist/chunks/chunk-QHGH7FF6.js.map +1 -0
- package/dist/chunks/chunk-QKAKO3CZ.js +233 -0
- package/dist/chunks/chunk-QKAKO3CZ.js.map +1 -0
- package/dist/chunks/chunk-QSFYRRIN.js +85 -0
- package/dist/chunks/chunk-QSFYRRIN.js.map +1 -0
- package/dist/chunks/chunk-QVPOOZ5O.js +64 -0
- package/dist/chunks/chunk-QVPOOZ5O.js.map +1 -0
- package/dist/chunks/chunk-QXKGZ752.js +43 -0
- package/dist/chunks/chunk-QXKGZ752.js.map +1 -0
- package/dist/chunks/chunk-QZ4TYR6G.js +43 -0
- package/dist/chunks/chunk-QZ4TYR6G.js.map +1 -0
- package/dist/chunks/chunk-R5HX7O5I.js +81 -0
- package/dist/chunks/chunk-R5HX7O5I.js.map +1 -0
- package/dist/chunks/chunk-RF2VC7DN.js +239 -0
- package/dist/chunks/chunk-RF2VC7DN.js.map +1 -0
- package/dist/chunks/chunk-RIPZMRDA.js +238 -0
- package/dist/chunks/chunk-RIPZMRDA.js.map +1 -0
- package/dist/chunks/chunk-RKBUP3WS.js +28 -0
- package/dist/chunks/chunk-RKBUP3WS.js.map +1 -0
- package/dist/chunks/chunk-RTPJGNMA.js +230 -0
- package/dist/chunks/chunk-RTPJGNMA.js.map +1 -0
- package/dist/chunks/chunk-S6F2NHT6.js +85 -0
- package/dist/chunks/chunk-S6F2NHT6.js.map +1 -0
- package/dist/chunks/chunk-SI7DUJBA.js +28 -0
- package/dist/chunks/chunk-SI7DUJBA.js.map +1 -0
- package/dist/chunks/chunk-SRCICFU7.js +28 -0
- package/dist/chunks/chunk-SRCICFU7.js.map +1 -0
- package/dist/chunks/chunk-SXRET5LH.js +235 -0
- package/dist/chunks/chunk-SXRET5LH.js.map +1 -0
- package/dist/chunks/chunk-THUTSBBP.js +56 -0
- package/dist/chunks/chunk-THUTSBBP.js.map +1 -0
- package/dist/chunks/chunk-TPZRDVLI.js +85 -0
- package/dist/chunks/chunk-TPZRDVLI.js.map +1 -0
- package/dist/chunks/chunk-TYH4XFYQ.js +84 -0
- package/dist/chunks/chunk-TYH4XFYQ.js.map +1 -0
- package/dist/chunks/chunk-TZGAS66M.js +56 -0
- package/dist/chunks/chunk-TZGAS66M.js.map +1 -0
- package/dist/chunks/chunk-U54LOZ6V.js +235 -0
- package/dist/chunks/chunk-U54LOZ6V.js.map +1 -0
- package/dist/chunks/chunk-U7WNOBID.js +235 -0
- package/dist/chunks/chunk-U7WNOBID.js.map +1 -0
- package/dist/chunks/chunk-UDZ6DBC4.js +65 -0
- package/dist/chunks/chunk-UDZ6DBC4.js.map +1 -0
- package/dist/chunks/chunk-UF7XJJHR.js +56 -0
- package/dist/chunks/chunk-UF7XJJHR.js.map +1 -0
- package/dist/chunks/chunk-UFJLGWZN.js +95 -0
- package/dist/chunks/chunk-UFJLGWZN.js.map +1 -0
- package/dist/chunks/chunk-UNB4FVMX.js +248 -0
- package/dist/chunks/chunk-UNB4FVMX.js.map +1 -0
- package/dist/chunks/chunk-US5NIIW7.js +244 -0
- package/dist/chunks/chunk-US5NIIW7.js.map +1 -0
- package/dist/chunks/chunk-VMAASK34.js +234 -0
- package/dist/chunks/chunk-VMAASK34.js.map +1 -0
- package/dist/chunks/chunk-VN2QDEVU.js +250 -0
- package/dist/chunks/chunk-VN2QDEVU.js.map +1 -0
- package/dist/chunks/chunk-W5FVZTR6.js +56 -0
- package/dist/chunks/chunk-W5FVZTR6.js.map +1 -0
- package/dist/chunks/chunk-WFFIUFJJ.js +28 -0
- package/dist/chunks/chunk-WFFIUFJJ.js.map +1 -0
- package/dist/chunks/chunk-WFSIKRZ3.js +95 -0
- package/dist/chunks/chunk-WFSIKRZ3.js.map +1 -0
- package/dist/chunks/chunk-WHTJNLWJ.js +235 -0
- package/dist/chunks/chunk-WHTJNLWJ.js.map +1 -0
- package/dist/chunks/chunk-X7TJEF7P.js +78 -0
- package/dist/chunks/chunk-X7TJEF7P.js.map +1 -0
- package/dist/chunks/chunk-XCECF27R.js +45 -0
- package/dist/chunks/chunk-XCECF27R.js.map +1 -0
- package/dist/chunks/chunk-XCJMG5II.js +229 -0
- package/dist/chunks/chunk-XCJMG5II.js.map +1 -0
- package/dist/chunks/chunk-XNNXOUDF.js +245 -0
- package/dist/chunks/chunk-XNNXOUDF.js.map +1 -0
- package/dist/chunks/chunk-YBFPPPMD.js +233 -0
- package/dist/chunks/chunk-YBFPPPMD.js.map +1 -0
- package/dist/chunks/chunk-YQXKY6CK.js +99 -0
- package/dist/chunks/chunk-YQXKY6CK.js.map +1 -0
- package/dist/chunks/chunk-YS4T2ORC.js +86 -0
- package/dist/chunks/chunk-YS4T2ORC.js.map +1 -0
- package/dist/chunks/chunk-YSK5NQO6.js +235 -0
- package/dist/chunks/chunk-YSK5NQO6.js.map +1 -0
- package/dist/chunks/chunk-YZSGZTWA.js +8 -0
- package/dist/chunks/chunk-YZSGZTWA.js.map +1 -0
- package/dist/chunks/chunk-Z6FBIC76.js +83 -0
- package/dist/chunks/chunk-Z6FBIC76.js.map +1 -0
- package/dist/chunks/chunk-ZNU2BCTJ.js +95 -0
- package/dist/chunks/chunk-ZNU2BCTJ.js.map +1 -0
- package/dist/chunks/chunk-ZTFOPRHT.js +242 -0
- package/dist/chunks/chunk-ZTFOPRHT.js.map +1 -0
- package/dist/chunks/chunk-ZZFSVIVR.js +85 -0
- package/dist/chunks/chunk-ZZFSVIVR.js.map +1 -0
- package/dist/exports/computed-item.context.d.ts +3 -0
- package/dist/exports/computed-item.context.js +1 -1
- package/dist/exports/computed.context.d.ts +5 -0
- package/dist/exports/computed.context.js +1 -1
- package/dist/exports/session.context.d.ts +16 -1
- package/dist/exports/session.context.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +20 -20
- package/dist/qti-components-jsx.d.ts +5 -4
- package/dist/qti-item/components/item-show-correct-response.js +2 -2
- package/dist/qti-item/components/print-item-variables.js +2 -2
- package/dist/qti-item/core/index.js +4 -4
- package/dist/qti-test/components/index.d.ts +4 -3
- package/dist/qti-test/components/index.js +15 -15
- package/dist/qti-test/components/test-navigation.d.ts +4 -3
- package/dist/qti-test/components/test-navigation.js +3 -3
- package/dist/qti-test/components/test-next.d.ts +4 -1
- package/dist/qti-test/components/test-next.js +2 -2
- package/dist/qti-test/components/test-paging-buttons-stamp.js +2 -2
- package/dist/qti-test/components/test-prev.d.ts +4 -1
- package/dist/qti-test/components/test-prev.js +2 -2
- package/dist/qti-test/components/test-print-context.d.ts +4 -1
- package/dist/qti-test/components/test-print-context.js +2 -2
- package/dist/qti-test/components/test-print-item-variables.d.ts +4 -1
- package/dist/qti-test/components/test-print-item-variables.js +2 -2
- package/dist/qti-test/components/test-scoring-buttons.d.ts +7 -1
- package/dist/qti-test/components/test-scoring-buttons.js +2 -2
- package/dist/qti-test/components/test-scoring-feedback.d.ts +4 -1
- package/dist/qti-test/components/test-scoring-feedback.js +2 -2
- package/dist/qti-test/components/test-scoring-toggle.d.ts +20 -0
- package/dist/qti-test/components/test-scoring-toggle.js +9 -0
- package/dist/qti-test/components/test-scoring-toggle.js.map +1 -0
- package/dist/qti-test/components/test-section-buttons-stamp.js +2 -2
- package/dist/qti-test/components/test-show-correct-response.d.ts +4 -1
- package/dist/qti-test/components/test-show-correct-response.js +2 -2
- package/dist/qti-test/components/test-stamp.d.ts +2 -2
- package/dist/qti-test/components/test-stamp.js +2 -2
- package/dist/qti-test/components/test-view-toggle copy.js +63 -0
- package/dist/qti-test/components/test-view-toggle copy.js.map +1 -0
- package/dist/qti-test/components/test-view-toggle.d.ts +4 -3
- package/dist/qti-test/components/test-view-toggle.js +2 -2
- package/dist/qti-test/components/test-view.js +2 -2
- package/dist/qti-test/core/index.d.ts +3 -2
- package/dist/qti-test/core/index.js +2 -2
- package/dist/qti-test-feedback-BGPOO6Zu.d.ts +98 -0
- package/dist/qti-test-feedback-C2mE_Xcg.d.ts +85 -0
- package/dist/vscode.html-custom-data.json +1 -1
- package/package.json +17 -17
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computedContext
|
|
3
|
+
} from "./chunk-YZSGZTWA.js";
|
|
4
|
+
import {
|
|
5
|
+
__decorateClass
|
|
6
|
+
} from "./chunk-H2JE6IVU.js";
|
|
7
|
+
|
|
8
|
+
// src/lib/qti-test/components/test-stamp.ts
|
|
9
|
+
import { html, LitElement, nothing } from "lit";
|
|
10
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
11
|
+
import { prepareTemplate } from "stampino";
|
|
12
|
+
import { consume } from "@lit/context";
|
|
13
|
+
|
|
14
|
+
// dist/chunks/chunk-22IRJWWY.js
|
|
15
|
+
import { createContext } from "@lit/context";
|
|
16
|
+
var sessionContext = createContext(Symbol("testContext"));
|
|
17
|
+
|
|
18
|
+
// src/lib/qti-test/components/test-stamp.ts
|
|
19
|
+
var TestStamp = class extends LitElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.debug = false;
|
|
23
|
+
this.stampContext = null;
|
|
24
|
+
}
|
|
25
|
+
createRenderRoot() {
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
super.connectedCallback();
|
|
30
|
+
const templateElement = this.querySelector("template");
|
|
31
|
+
if (!templateElement) {
|
|
32
|
+
this.myTemplate = null;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this.myTemplate = prepareTemplate(templateElement);
|
|
36
|
+
}
|
|
37
|
+
willUpdate(_changedProperties) {
|
|
38
|
+
if (!this.computedContext) {
|
|
39
|
+
this.stampContext = null;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const activeTestPart = this.computedContext.testParts.find((testPart) => testPart.active);
|
|
43
|
+
const activeSection = activeTestPart?.sections.find((section) => section.active);
|
|
44
|
+
const activeItem = activeSection?.items.find((item) => item.active);
|
|
45
|
+
const { variables, ...augmentedItem } = activeItem || {};
|
|
46
|
+
if (!activeTestPart || !activeSection || !activeItem) {
|
|
47
|
+
this.stampContext = null;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const augmentedTestPart = {
|
|
51
|
+
...activeTestPart,
|
|
52
|
+
items: activeTestPart.sections.flatMap((section) => section.items.map(({ variables: variables2, ...rest }) => rest)),
|
|
53
|
+
sections: activeTestPart.sections.map((section) => ({
|
|
54
|
+
...section,
|
|
55
|
+
items: section.items.map(({ variables: variables2, ...rest }) => rest)
|
|
56
|
+
}))
|
|
57
|
+
};
|
|
58
|
+
const augmentedSection = { ...activeSection, items: activeSection.items.map(({ variables: variables2, ...rest }) => rest) };
|
|
59
|
+
const { testParts, ...activeTest } = this.computedContext;
|
|
60
|
+
this.stampContext = {
|
|
61
|
+
view: this.sessionContext.view,
|
|
62
|
+
item: augmentedItem,
|
|
63
|
+
section: augmentedSection,
|
|
64
|
+
testpart: augmentedTestPart,
|
|
65
|
+
test: activeTest
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
if (!this.stampContext) return nothing;
|
|
70
|
+
return html` ${this.debug ? html`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : nothing}
|
|
71
|
+
${this.myTemplate ? this.myTemplate(this.stampContext) : nothing}`;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
__decorateClass([
|
|
75
|
+
property({ type: Boolean, reflect: true })
|
|
76
|
+
], TestStamp.prototype, "debug", 2);
|
|
77
|
+
__decorateClass([
|
|
78
|
+
state(),
|
|
79
|
+
consume({ context: computedContext, subscribe: true })
|
|
80
|
+
], TestStamp.prototype, "computedContext", 2);
|
|
81
|
+
__decorateClass([
|
|
82
|
+
state(),
|
|
83
|
+
consume({ context: sessionContext, subscribe: true })
|
|
84
|
+
], TestStamp.prototype, "sessionContext", 2);
|
|
85
|
+
__decorateClass([
|
|
86
|
+
state()
|
|
87
|
+
], TestStamp.prototype, "stampContext", 2);
|
|
88
|
+
TestStamp = __decorateClass([
|
|
89
|
+
customElement("test-stamp")
|
|
90
|
+
], TestStamp);
|
|
91
|
+
|
|
92
|
+
export {
|
|
93
|
+
TestStamp
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=chunk-KIK3YNR7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-stamp.ts","../../src/lib/exports/session.context.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { prepareTemplate } from 'stampino';\nimport { consume } from '@lit/context';\n\nimport { computedContext } from '../../exports/computed.context';\nimport { sessionContext } from '../../../../dist/exports/session.context';\n\nimport type { SessionContext } from '../../../../dist/exports/session.context';\nimport type { View } from '../core/mixins/test-view.mixin';\nimport type { PropertyValues } from 'lit';\nimport type { ComputedContext } from '../../exports/computed.context';\nimport type { TemplateFunction } from 'stampino';\n\n@customElement('test-stamp')\nexport class TestStamp extends LitElement {\n /**\n * Indicates whether the component is in debug mode.\n * When set to `true`, the available objects and properties (i.e.: stampContext) is displayed.\n */\n @property({ type: Boolean, reflect: true })\n public debug = false;\n\n @state()\n @consume({ context: computedContext, subscribe: true })\n private computedContext: ComputedContext;\n\n @state()\n @consume({ context: sessionContext, subscribe: true })\n private sessionContext: SessionContext;\n\n @state()\n private stampContext: {\n view?: View;\n test?: unknown;\n testpart?: unknown;\n section?: unknown;\n item?: unknown;\n } | null = null;\n\n myTemplate: TemplateFunction;\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n const templateElement = this.querySelector<HTMLTemplateElement>('template');\n if (!templateElement) {\n this.myTemplate = null;\n return;\n }\n this.myTemplate = prepareTemplate(templateElement);\n }\n\n protected willUpdate(_changedProperties: PropertyValues): void {\n if (!this.computedContext) {\n this.stampContext = null;\n return;\n }\n\n const activeTestPart = this.computedContext.testParts.find(testPart => testPart.active);\n const activeSection = activeTestPart?.sections.find(section => section.active);\n const activeItem = activeSection?.items.find(item => item.active);\n const { variables, ...augmentedItem } = activeItem || {};\n\n if (!activeTestPart || !activeSection || !activeItem) {\n this.stampContext = null;\n return;\n }\n\n const augmentedTestPart = {\n ...activeTestPart,\n items: activeTestPart.sections.flatMap(section => section.items.map(({ variables, ...rest }) => rest)),\n sections: activeTestPart.sections.map(section => ({\n ...section,\n items: section.items.map(({ variables, ...rest }) => rest)\n }))\n };\n\n const augmentedSection = { ...activeSection, items: activeSection.items.map(({ variables, ...rest }) => rest) };\n const { testParts, ...activeTest } = this.computedContext;\n\n this.stampContext = {\n view: this.sessionContext.view,\n item: augmentedItem,\n section: augmentedSection,\n testpart: augmentedTestPart,\n test: activeTest\n };\n }\n\n render() {\n if (!this.stampContext) return nothing;\n return html` ${this.debug ? html`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : nothing}\n ${this.myTemplate ? this.myTemplate(this.stampContext) : nothing}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-stamp': TestStamp;\n }\n}\n","import { createContext } from '@lit/context';\n\nimport type { View } from '../qti-test/core/mixins/test-view.mixin';\n\nexport interface SessionContext {\n navPartId?: string | null;\n navSectionId?: string | null;\n navItemRefId?: string | null;\n navItemLoading?: boolean;\n navTestLoading?: boolean;\n view?: View;\n}\n\nexport const INITIAL_SESSION_CONTEXT: Readonly<SessionContext> = { view: 'candidate' };\n\nexport const sessionContext = createContext<Readonly<SessionContext>>(Symbol('testContext'));\n"],"mappings":";;;;;;;;AAAA,SAAS,MAAM,YAAY,eAAe;AAC1C,SAAS,eAAe,UAAU,aAAa;AAC/C,SAAS,uBAAuB;AAChC,SAAS,eAAe;;;ACHxB,SAAS,qBAAqB;AAevB,IAAM,iBAAiB,cAAwC,OAAO,aAAa,CAAC;;;ADApF,IAAM,YAAN,cAAwB,WAAW;AAAA,EAAnC;AAAA;AAML,SAAO,QAAQ;AAWf,SAAQ,eAMG;AAAA;AAAA,EAID,mBAAmD;AAC3D,WAAO;AAAA,EACT;AAAA,EAEA,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,UAAM,kBAAkB,KAAK,cAAmC,UAAU;AAC1E,QAAI,CAAC,iBAAiB;AACpB,WAAK,aAAa;AAClB;AAAA,IACF;AACA,SAAK,aAAa,gBAAgB,eAAe;AAAA,EACnD;AAAA,EAEU,WAAW,oBAA0C;AAC7D,QAAI,CAAC,KAAK,iBAAiB;AACzB,WAAK,eAAe;AACpB;AAAA,IACF;AAEA,UAAM,iBAAiB,KAAK,gBAAgB,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UAMJ;AAIC;AAAA,EAFP,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAT3C,UAUH;AAIA;AAAA,EAFP,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,gBAAgB,WAAW,KAAK,CAAC;AAAA,GAb1C,UAcH;AAGA;AAAA,EADP,MAAM;AAAA,GAhBI,UAiBH;AAjBG,YAAN;AAAA,EADN,cAAc,YAAY;AAAA,GACd;","names":["variables"]}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sessionContext
|
|
3
|
+
} from "./chunk-22IRJWWY.js";
|
|
4
|
+
import {
|
|
5
|
+
testContext
|
|
6
|
+
} from "./chunk-CJADUWEC.js";
|
|
7
|
+
import {
|
|
8
|
+
computedContext
|
|
9
|
+
} from "./chunk-AZIKAG7K.js";
|
|
10
|
+
import {
|
|
11
|
+
__decorateClass
|
|
12
|
+
} from "./chunk-H2JE6IVU.js";
|
|
13
|
+
|
|
14
|
+
// src/lib/qti-test/components/test-navigation.ts
|
|
15
|
+
import { consume, provide } from "@lit/context";
|
|
16
|
+
import { html, LitElement } from "lit";
|
|
17
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
18
|
+
var TestNavigation = class extends LitElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
this.identifier = void 0;
|
|
22
|
+
this.initContext = [];
|
|
23
|
+
this.configContext = {};
|
|
24
|
+
this.autoScoreItems = false;
|
|
25
|
+
this.addEventListener("qti-assessment-test-connected", this._handleTestConnected.bind(this));
|
|
26
|
+
this.addEventListener("qti-assessment-item-connected", this._handleItemConnected.bind(this));
|
|
27
|
+
this.addEventListener("qti-interaction-changed", this._handleInteractionChanged.bind(this));
|
|
28
|
+
this.addEventListener("test-end-attempt", this._handleTestEndAttempt.bind(this));
|
|
29
|
+
this.addEventListener("test-show-correct-response", this._handleTestShowCorrectResponse.bind(this));
|
|
30
|
+
this.addEventListener("test-update-outcome-variable", this._handleTestUpdateOutcomeVariable.bind(this));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Handles the 'test-end-attempt' event.
|
|
34
|
+
* @private
|
|
35
|
+
* @listens TestNavigation#test-end-attempt
|
|
36
|
+
* @param {CustomEvent} event - The custom event object.
|
|
37
|
+
*/
|
|
38
|
+
_handleTestEndAttempt(_event) {
|
|
39
|
+
const qtiItemEl = this._testElement.querySelector(
|
|
40
|
+
`qti-assessment-item-ref[identifier="${this._sessionContext.navItemRefId}"]`
|
|
41
|
+
);
|
|
42
|
+
const qtiAssessmentItemEl = qtiItemEl.assessmentItem;
|
|
43
|
+
const reportValidityAfterScoring = this.configContext?.reportValidityAfterScoring === true ? true : false;
|
|
44
|
+
qtiAssessmentItemEl.processResponse(true, reportValidityAfterScoring);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Handles the 'test-end-attempt' event.
|
|
48
|
+
* @private
|
|
49
|
+
* @listens TestNavigation#test-show-correct-response
|
|
50
|
+
* @param {CustomEvent} event - The custom event object.
|
|
51
|
+
*/
|
|
52
|
+
_handleTestShowCorrectResponse(event) {
|
|
53
|
+
const qtiItemEl = this._testElement.querySelector(
|
|
54
|
+
`qti-assessment-item-ref[identifier="${this._sessionContext.navItemRefId}"]`
|
|
55
|
+
);
|
|
56
|
+
const qtiAssessmentItemEl = qtiItemEl.assessmentItem;
|
|
57
|
+
qtiAssessmentItemEl.showCorrectResponse(event.detail);
|
|
58
|
+
}
|
|
59
|
+
_handleTestUpdateOutcomeVariable(event) {
|
|
60
|
+
const qtiItemEl = this._testElement.querySelector(
|
|
61
|
+
`qti-assessment-item-ref[identifier="${event.detail.assessmentItemRefId}"]`
|
|
62
|
+
);
|
|
63
|
+
const qtiAssessmentItemEl = qtiItemEl.assessmentItem;
|
|
64
|
+
qtiAssessmentItemEl.setOutcomeVariable(event.detail.outcomeVariableId, event.detail.value);
|
|
65
|
+
}
|
|
66
|
+
_handleInteractionChanged(_event) {
|
|
67
|
+
if (this.autoScoreItems) {
|
|
68
|
+
const assessmentItem = _event.composedPath()[0].closest("qti-assessment-item");
|
|
69
|
+
const scoreOutcomeIdentifier = assessmentItem.variables.find((v) => v.identifier === "SCORE");
|
|
70
|
+
if (scoreOutcomeIdentifier && scoreOutcomeIdentifier.externalScored === null && assessmentItem.adaptive === "false") {
|
|
71
|
+
assessmentItem.processResponse();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
render() {
|
|
76
|
+
return html`<slot></slot>`;
|
|
77
|
+
}
|
|
78
|
+
/* PK: on test connected we can build the computed context */
|
|
79
|
+
_handleTestConnected(event) {
|
|
80
|
+
this._testElement = event.detail;
|
|
81
|
+
const testPartElements = Array.from(this._testElement?.querySelectorAll(`qti-test-part`) || []);
|
|
82
|
+
this.computedContext = {
|
|
83
|
+
identifier: this._testElement.identifier,
|
|
84
|
+
title: this._testElement.title,
|
|
85
|
+
view: this._sessionContext?.view,
|
|
86
|
+
testParts: testPartElements.map((testPart) => {
|
|
87
|
+
const sectionElements = [...testPart.querySelectorAll(`qti-assessment-section`)];
|
|
88
|
+
return {
|
|
89
|
+
active: false,
|
|
90
|
+
identifier: testPart.identifier,
|
|
91
|
+
navigationMode: testPart.navigationMode,
|
|
92
|
+
submissionMode: testPart.submissionMode,
|
|
93
|
+
sections: sectionElements.map((section) => {
|
|
94
|
+
const itemElements = [...section.querySelectorAll(`qti-assessment-item-ref`)];
|
|
95
|
+
return {
|
|
96
|
+
active: false,
|
|
97
|
+
identifier: section.identifier,
|
|
98
|
+
title: section.title,
|
|
99
|
+
items: itemElements.map(
|
|
100
|
+
(item) => ({
|
|
101
|
+
...this.initContext?.find((i) => i.identifier === item.identifier),
|
|
102
|
+
active: false,
|
|
103
|
+
identifier: item.identifier,
|
|
104
|
+
href: item.href,
|
|
105
|
+
variables: []
|
|
106
|
+
})
|
|
107
|
+
)
|
|
108
|
+
};
|
|
109
|
+
})
|
|
110
|
+
};
|
|
111
|
+
})
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/* PK: on item connected we can add item only properties in the xml */
|
|
115
|
+
_handleItemConnected(event) {
|
|
116
|
+
const itemElement = event.detail;
|
|
117
|
+
this.computedContext = {
|
|
118
|
+
...this.computedContext,
|
|
119
|
+
testParts: this.computedContext.testParts.map((testPart) => {
|
|
120
|
+
return {
|
|
121
|
+
...testPart,
|
|
122
|
+
sections: testPart.sections.map((section) => {
|
|
123
|
+
return {
|
|
124
|
+
...section,
|
|
125
|
+
items: section.items.map((item) => {
|
|
126
|
+
if (item.identifier !== itemElement.parentElement.getAttribute("identifier")) {
|
|
127
|
+
return item;
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
...item,
|
|
131
|
+
assessmentItemIdentifier: itemElement.getAttribute("identifier"),
|
|
132
|
+
label: itemElement.getAttribute("label"),
|
|
133
|
+
title: itemElement.title,
|
|
134
|
+
adaptive: itemElement.adaptive == "true" || false,
|
|
135
|
+
timeDependent: itemElement.timeDependent == "true" || false,
|
|
136
|
+
variables: itemElement._context.variables
|
|
137
|
+
};
|
|
138
|
+
})
|
|
139
|
+
};
|
|
140
|
+
})
|
|
141
|
+
};
|
|
142
|
+
})
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/* PK: on every change of the candidate we will recomputed the computedContext */
|
|
146
|
+
willUpdate(_changedProperties) {
|
|
147
|
+
if (!this.computedContext) return;
|
|
148
|
+
let itemIndex = 1;
|
|
149
|
+
this.computedContext = {
|
|
150
|
+
...this.computedContext,
|
|
151
|
+
testParts: this.computedContext.testParts.map((testPart) => {
|
|
152
|
+
return {
|
|
153
|
+
...testPart,
|
|
154
|
+
active: this._sessionContext?.navPartId === testPart.identifier || false,
|
|
155
|
+
sections: testPart.sections.map((section) => {
|
|
156
|
+
return {
|
|
157
|
+
...section,
|
|
158
|
+
active: this._sessionContext?.navSectionId === section.identifier || false,
|
|
159
|
+
completed: section.items.every(
|
|
160
|
+
(item) => this._testContext.items.find((i) => i.identifier === item.identifier)?.variables.find((v) => v.identifier === "completionStatus").value === "completed"
|
|
161
|
+
),
|
|
162
|
+
items: section.items.map((item) => {
|
|
163
|
+
const itemContext = this._testContext?.items.find((i) => i.identifier === item.identifier);
|
|
164
|
+
const computedItem = { ...item, ...itemContext };
|
|
165
|
+
const rawscore = computedItem.variables?.find((vr) => vr.identifier == "SCORE")?.value;
|
|
166
|
+
const score = parseInt(rawscore?.toString());
|
|
167
|
+
const completionStatus = computedItem.variables?.find((v) => v.identifier === "completionStatus")?.value;
|
|
168
|
+
const categories = computedItem.category ? computedItem.category?.split(" ") : [];
|
|
169
|
+
const type = categories.includes(this.configContext?.infoItemCategory) ? "info" : "regular";
|
|
170
|
+
const active = this._sessionContext?.navItemRefId === computedItem.identifier || false;
|
|
171
|
+
const correct = type == "regular" && score !== void 0 && !isNaN(score) && score > 0 || false;
|
|
172
|
+
const incorrect = type == "regular" && score !== void 0 && !isNaN(score) && score <= 0 || false;
|
|
173
|
+
const completed = completionStatus === "completed";
|
|
174
|
+
const response = computedItem.variables?.find((v) => v.identifier === "RESPONSE")?.value || "";
|
|
175
|
+
const index = categories.includes(this.configContext?.infoItemCategory) ? null : itemIndex++;
|
|
176
|
+
const containsCorrectResponse = !!item?.variables?.some((v) => v["correctResponse"]);
|
|
177
|
+
const containsMapping = !!item?.variables?.some((v) => {
|
|
178
|
+
return v["mapping"]?.mapEntries?.length > 0 || v["areaMapping"]?.areaMapEntries?.length > 0;
|
|
179
|
+
});
|
|
180
|
+
const hasCorrectResponse = !containsCorrectResponse && !containsMapping;
|
|
181
|
+
return {
|
|
182
|
+
...computedItem,
|
|
183
|
+
// score => correct / incorrect
|
|
184
|
+
// completionStatus, => completed
|
|
185
|
+
hasCorrectResponse,
|
|
186
|
+
categories,
|
|
187
|
+
type,
|
|
188
|
+
active,
|
|
189
|
+
correct,
|
|
190
|
+
incorrect,
|
|
191
|
+
completed,
|
|
192
|
+
index,
|
|
193
|
+
response
|
|
194
|
+
};
|
|
195
|
+
})
|
|
196
|
+
};
|
|
197
|
+
})
|
|
198
|
+
};
|
|
199
|
+
})
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
__decorateClass([
|
|
204
|
+
property({ type: String })
|
|
205
|
+
], TestNavigation.prototype, "identifier", 2);
|
|
206
|
+
__decorateClass([
|
|
207
|
+
state()
|
|
208
|
+
], TestNavigation.prototype, "initContext", 2);
|
|
209
|
+
__decorateClass([
|
|
210
|
+
state()
|
|
211
|
+
], TestNavigation.prototype, "configContext", 2);
|
|
212
|
+
__decorateClass([
|
|
213
|
+
state(),
|
|
214
|
+
consume({ context: testContext, subscribe: true })
|
|
215
|
+
], TestNavigation.prototype, "_testContext", 2);
|
|
216
|
+
__decorateClass([
|
|
217
|
+
state(),
|
|
218
|
+
consume({ context: sessionContext, subscribe: true })
|
|
219
|
+
], TestNavigation.prototype, "_sessionContext", 2);
|
|
220
|
+
__decorateClass([
|
|
221
|
+
state(),
|
|
222
|
+
provide({ context: computedContext })
|
|
223
|
+
], TestNavigation.prototype, "computedContext", 2);
|
|
224
|
+
__decorateClass([
|
|
225
|
+
property({ type: Boolean, attribute: "auto-score-items" })
|
|
226
|
+
], TestNavigation.prototype, "autoScoreItems", 2);
|
|
227
|
+
TestNavigation = __decorateClass([
|
|
228
|
+
customElement("test-navigation")
|
|
229
|
+
], TestNavigation);
|
|
230
|
+
|
|
231
|
+
export {
|
|
232
|
+
TestNavigation
|
|
233
|
+
};
|
|
234
|
+
//# sourceMappingURL=chunk-KKV6WBJ2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-navigation.ts"],"sourcesContent":["import { consume, provide } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\n\nimport { testContext } from '../../exports/test.context';\nimport { sessionContext } from '../../exports/session.context';\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { ComputedItemContext } from '../../exports/computed-item.context';\nimport type { QtiAssessmentItem } from '../../qti-components';\nimport type { OutcomeVariable } from '../../exports/variables';\nimport type { ComputedContext } from '../../exports/computed.context';\nimport type { PropertyValues } from 'lit';\nimport type { QtiAssessmentItemRef, QtiAssessmentSection, QtiAssessmentTest, QtiTestPart } from '../core';\nimport type { ConfigContext } from '../../exports/config.context';\nimport type { SessionContext } from '../../exports/session.context';\nimport type { TestContext } from '../../exports/test.context';\n\ntype CustomEventMap = {\n 'test-end-attempt': CustomEvent;\n 'test-show-correct-response': CustomEvent<{ value: boolean }>;\n};\n\ndeclare global {\n interface GlobalEventHandlersEventMap extends CustomEventMap {}\n}\n\n@customElement('test-navigation')\nexport class TestNavigation extends LitElement {\n @property({ type: String }) identifier = undefined;\n\n @state()\n public initContext: { identifier: string; [key: string]: any }[] = [];\n\n @state()\n public configContext: ConfigContext = {};\n\n @state()\n @consume({ context: testContext, subscribe: true })\n protected _testContext?: TestContext;\n\n @state()\n @consume({ context: sessionContext, subscribe: true })\n protected _sessionContext?: SessionContext;\n\n @state()\n @provide({ context: computedContext })\n protected computedContext: ComputedContext;\n\n @property({ type: Boolean, attribute: 'auto-score-items' }) autoScoreItems = false;\n\n private _testElement: QtiAssessmentTest;\n\n constructor() {\n super();\n this.addEventListener('qti-assessment-test-connected', this._handleTestConnected.bind(this));\n this.addEventListener('qti-assessment-item-connected', this._handleItemConnected.bind(this));\n\n this.addEventListener('qti-interaction-changed', this._handleInteractionChanged.bind(this));\n\n this.addEventListener('test-end-attempt', this._handleTestEndAttempt.bind(this));\n this.addEventListener('test-show-correct-response', this._handleTestShowCorrectResponse.bind(this));\n this.addEventListener('test-update-outcome-variable', this._handleTestUpdateOutcomeVariable.bind(this));\n }\n\n /**\n * Handles the 'test-end-attempt' event.\n * @private\n * @listens TestNavigation#test-end-attempt\n * @param {CustomEvent} event - The custom event object.\n */\n private _handleTestEndAttempt(_event: CustomEvent) {\n const qtiItemEl = this._testElement.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${this._sessionContext.navItemRefId}\"]`\n );\n const qtiAssessmentItemEl = qtiItemEl.assessmentItem;\n const reportValidityAfterScoring = this.configContext?.reportValidityAfterScoring === true ? true : false;\n qtiAssessmentItemEl.processResponse(true, reportValidityAfterScoring);\n }\n\n /**\n * Handles the 'test-end-attempt' event.\n * @private\n * @listens TestNavigation#test-show-correct-response\n * @param {CustomEvent} event - The custom event object.\n */\n private _handleTestShowCorrectResponse(event: CustomEvent) {\n const qtiItemEl = this._testElement.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${this._sessionContext.navItemRefId}\"]`\n );\n const qtiAssessmentItemEl = qtiItemEl.assessmentItem;\n qtiAssessmentItemEl.showCorrectResponse(event.detail);\n }\n\n private _handleTestUpdateOutcomeVariable(event: CustomEvent) {\n const qtiItemEl = this._testElement.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${event.detail.assessmentItemRefId}\"]`\n );\n const qtiAssessmentItemEl = qtiItemEl.assessmentItem;\n qtiAssessmentItemEl.setOutcomeVariable(event.detail.outcomeVariableId, event.detail.value);\n }\n\n private _handleInteractionChanged(_event: CustomEvent) {\n if (this.autoScoreItems) {\n const assessmentItem = (_event.composedPath()[0] as HTMLElement).closest('qti-assessment-item');\n const scoreOutcomeIdentifier = assessmentItem.variables.find(v => v.identifier === 'SCORE') as OutcomeVariable;\n if (\n scoreOutcomeIdentifier &&\n scoreOutcomeIdentifier.externalScored === null &&\n assessmentItem.adaptive === 'false'\n ) {\n assessmentItem.processResponse();\n }\n }\n }\n\n render() {\n return html`<slot></slot>`;\n }\n\n /* PK: on test connected we can build the computed context */\n private _handleTestConnected(event: CustomEvent) {\n this._testElement = event.detail as QtiAssessmentTest;\n const testPartElements = Array.from(this._testElement?.querySelectorAll<QtiTestPart>(`qti-test-part`) || []);\n this.computedContext = {\n identifier: this._testElement.identifier,\n title: this._testElement.title,\n view: this._sessionContext?.view,\n testParts: testPartElements.map(testPart => {\n const sectionElements = [...testPart.querySelectorAll<QtiAssessmentSection>(`qti-assessment-section`)];\n return {\n active: false,\n identifier: testPart.identifier,\n navigationMode: testPart.navigationMode,\n submissionMode: testPart.submissionMode,\n sections: sectionElements.map(section => {\n const itemElements = [...section.querySelectorAll<QtiAssessmentItemRef>(`qti-assessment-item-ref`)];\n return {\n active: false,\n identifier: section.identifier,\n title: section.title,\n items: itemElements.map(\n item =>\n ({\n ...this.initContext?.find(i => i.identifier === item.identifier),\n active: false,\n identifier: item.identifier,\n href: item.href,\n variables: []\n }) as ComputedItemContext\n )\n };\n })\n };\n })\n };\n }\n\n /* PK: on item connected we can add item only properties in the xml */\n private _handleItemConnected(event: CustomEvent) {\n const itemElement = event.detail as QtiAssessmentItem;\n this.computedContext = {\n ...this.computedContext,\n testParts: this.computedContext.testParts.map(testPart => {\n return {\n ...testPart,\n sections: testPart.sections.map(section => {\n return {\n ...section,\n items: section.items.map(item => {\n if (item.identifier !== itemElement.parentElement.getAttribute('identifier')) {\n return item;\n }\n return {\n ...item,\n assessmentItemIdentifier: itemElement.getAttribute('identifier'),\n label: itemElement.getAttribute('label'),\n title: itemElement.title,\n adaptive: itemElement.adaptive == 'true' || false,\n timeDependent: itemElement.timeDependent == 'true' || false,\n variables: (itemElement as any)._context.variables\n };\n })\n };\n })\n };\n })\n };\n }\n\n /* PK: on every change of the candidate we will recomputed the computedContext */\n protected willUpdate(_changedProperties: PropertyValues): void {\n if (!this.computedContext) return;\n\n let itemIndex = 1;\n this.computedContext = {\n ...this.computedContext,\n testParts: this.computedContext.testParts.map(testPart => {\n return {\n ...testPart,\n active: this._sessionContext?.navPartId === testPart.identifier || false,\n sections: testPart.sections.map(section => {\n return {\n ...section,\n active: this._sessionContext?.navSectionId === section.identifier || false,\n completed: section.items.every(\n item =>\n this._testContext.items\n .find(i => i.identifier === item.identifier)\n ?.variables.find(v => v.identifier === 'completionStatus').value === 'completed'\n ),\n\n items: section.items.map(item => {\n const itemContext = this._testContext?.items.find(i => i.identifier === item.identifier);\n const computedItem = { ...item, ...itemContext };\n\n const rawscore = computedItem.variables?.find(vr => vr.identifier == 'SCORE')?.value;\n const score = parseInt(rawscore?.toString());\n const completionStatus = computedItem.variables?.find(v => v.identifier === 'completionStatus')?.value;\n const categories = computedItem.category ? computedItem.category?.split(' ') : [];\n\n const type = categories.includes(this.configContext?.infoItemCategory) ? 'info' : 'regular';\n const active = this._sessionContext?.navItemRefId === computedItem.identifier || false;\n\n const correct = (type == 'regular' && score !== undefined && !isNaN(score) && score > 0) || false;\n const incorrect = (type == 'regular' && score !== undefined && !isNaN(score) && score <= 0) || false;\n const completed = completionStatus === 'completed';\n\n const response = computedItem.variables?.find(v => v.identifier === 'RESPONSE')?.value || '';\n\n const index = categories.includes(this.configContext?.infoItemCategory) ? null : itemIndex++;\n\n const containsCorrectResponse = !!item?.variables?.some(v => v['correctResponse']);\n const containsMapping = !!item?.variables?.some(v => {\n return v['mapping']?.mapEntries?.length > 0 || v['areaMapping']?.areaMapEntries?.length > 0;\n });\n const hasCorrectResponse = !containsCorrectResponse && !containsMapping;\n\n return {\n ...computedItem,\n // score => correct / incorrect\n // completionStatus, => completed\n hasCorrectResponse,\n categories,\n type,\n active,\n correct,\n incorrect,\n completed,\n index,\n response\n };\n })\n };\n })\n };\n })\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,SAAS,eAAe;AACjC,SAAS,MAAM,kBAAkB;AACjC,SAAS,eAAe,UAAU,aAAa;AA0BxC,IAAM,iBAAN,cAA6B,WAAW;AAAA,EAyB7C,cAAc;AACZ,UAAM;AAzBoB,sBAAa;AAGzC,SAAO,cAA4D,CAAC;AAGpE,SAAO,gBAA+B,CAAC;AAcqB,0BAAiB;AAM3E,SAAK,iBAAiB,iCAAiC,KAAK,qBAAqB,KAAK,IAAI,CAAC;AAC3F,SAAK,iBAAiB,iCAAiC,KAAK,qBAAqB,KAAK,IAAI,CAAC;AAE3F,SAAK,iBAA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AA,IACH;AAAA,EACF;AACF;AAtO8B;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GADf,eACiB;AAGrB;AAAA,EADN,MAAM;AAAA,GAHI,eAIJ;AAGA;AAAA,EADN,MAAM;AAAA,GANI,eAOJ;AAIG;AAAA,EAFT,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,aAAa,WAAW,KAAK,CAAC;AAAA,GAVvC,eAWD;AAIA;AAAA,EAFT,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,gBAAgB,WAAW,KAAK,CAAC;AAAA,GAd1C,eAeD;AAIA;AAAA,EAFT,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,gBAAgB,CAAC;AAAA,GAlB1B,eAmBD;AAEkD;AAAA,EAA3D,SAAS,EAAE,MAAM,SAAS,WAAW,mBAAmB,CAAC;AAAA,GArB/C,eAqBiD;AArBjD,iBAAN;AAAA,EADN,cAAc,iBAAiB;AAAA,GACnB;","names":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computedContext
|
|
3
|
+
} from "./chunk-M43YVT6M.js";
|
|
4
|
+
import {
|
|
5
|
+
__decorateClass
|
|
6
|
+
} from "./chunk-H2JE6IVU.js";
|
|
7
|
+
|
|
8
|
+
// src/lib/qti-test/components/test-scoring-feedback.ts
|
|
9
|
+
import { consume } from "@lit/context";
|
|
10
|
+
import { html, LitElement } from "lit";
|
|
11
|
+
import { customElement, property } from "lit/decorators.js";
|
|
12
|
+
var TestScoringFeedback = class extends LitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.view = null;
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
const activeItem = this.computedContext?.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items)).find((item) => item.active);
|
|
19
|
+
if (!activeItem || !activeItem.variables) return html``;
|
|
20
|
+
if (activeItem["category"] === "dep-informational") return html`<div>${this.dataset.informational}</div>`;
|
|
21
|
+
const completionStatus = activeItem?.variables.find((v) => v.identifier === "completionStatus")?.value;
|
|
22
|
+
const scoreOutcome = activeItem?.variables.find((vr) => vr.identifier == "SCORE");
|
|
23
|
+
const score = parseInt(scoreOutcome?.value);
|
|
24
|
+
const externalScored = activeItem["externalScored"];
|
|
25
|
+
const feedbackText = () => {
|
|
26
|
+
if (completionStatus !== "completed") {
|
|
27
|
+
return this.dataset.textNoResponse;
|
|
28
|
+
}
|
|
29
|
+
if (!externalScored && score !== void 0 && !Number.isNaN(score)) {
|
|
30
|
+
return score > 0 ? this.dataset.textCorrect : this.dataset.textIncorrect;
|
|
31
|
+
}
|
|
32
|
+
if (externalScored === "externalMachine") {
|
|
33
|
+
return Number.isNaN(score) || score === void 0 ? "We konden je antwoord geen score geven, omdat we te weinig antwoorden konden vinden die op jouw antwoord leken. Kijk je antwoord zelf na." : `We hebben je antwoord ${score === 0 ? "geen punten" : score == 1 ? "\xE9\xE9n punt" : `${score} punten`} gegeven. Je kunt je score zelf aanpassen als je denkt dat dat niet klopt.`;
|
|
34
|
+
}
|
|
35
|
+
if (externalScored === "human") {
|
|
36
|
+
return Number.isNaN(score) ? "" : "Deze score heb je zelf toegekend.";
|
|
37
|
+
}
|
|
38
|
+
return this.dataset.scoreUnknown;
|
|
39
|
+
};
|
|
40
|
+
return html`<div>${feedbackText()}</div>`;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
__decorateClass([
|
|
44
|
+
consume({ context: computedContext, subscribe: true })
|
|
45
|
+
], TestScoringFeedback.prototype, "computedContext", 2);
|
|
46
|
+
__decorateClass([
|
|
47
|
+
property({ type: String, attribute: "view" })
|
|
48
|
+
], TestScoringFeedback.prototype, "view", 2);
|
|
49
|
+
TestScoringFeedback = __decorateClass([
|
|
50
|
+
customElement("test-scoring-feedback")
|
|
51
|
+
], TestScoringFeedback);
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
TestScoringFeedback
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=chunk-KWCQRFC3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-scoring-feedback.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { OutcomeVariable } from '../../exports/variables';\nimport type { ComputedContext } from '../../exports/computed.context';\nimport type { ViewMode } from 'storybook/internal/types';\n\n@customElement('test-scoring-feedback')\nexport class TestScoringFeedback extends LitElement {\n @consume({ context: computedContext, subscribe: true })\n protected computedContext?: ComputedContext;\n\n @property({ type: String, attribute: 'view' })\n public view: ViewMode = null;\n\n render() {\n const activeItem = this.computedContext?.testParts\n .flatMap(testPart => testPart.sections.flatMap(section => section.items))\n .find(item => item.active);\n\n if (!activeItem || !activeItem.variables) return html``;\n\n if (activeItem['category'] === 'dep-informational') return html`<div>${this.dataset.informational}</div>`;\n\n const completionStatus = activeItem?.variables.find(v => v.identifier === 'completionStatus')?.value;\n const scoreOutcome = activeItem?.variables.find(vr => vr.identifier == 'SCORE') as OutcomeVariable;\n\n const score = parseInt(scoreOutcome?.value as string);\n const externalScored = activeItem['externalScored'];\n\n const feedbackText = () => {\n if (completionStatus !== 'completed') {\n return this.dataset.textNoResponse;\n }\n\n if (!externalScored && score !== undefined && !Number.isNaN(score)) {\n return score > 0 ? this.dataset.textCorrect : this.dataset.textIncorrect;\n }\n\n if (externalScored === 'externalMachine') {\n return Number.isNaN(score) || score === undefined\n ? 'We konden je antwoord geen score geven, omdat we te weinig antwoorden konden vinden die op jouw antwoord leken. Kijk je antwoord zelf na.'\n : `We hebben je antwoord ${score === 0 ? 'geen punten' : score == 1 ? 'één punt' : `${score} punten`} gegeven. Je kunt je score zelf aanpassen als je denkt dat dat niet klopt.`;\n }\n\n if (externalScored === 'human') {\n return Number.isNaN(score) ? '' : 'Deze score heb je zelf toegekend.';\n }\n\n return this.dataset.scoreUnknown;\n };\n\n return html`<div>${feedbackText()}</div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-scoring-feedback': TestScoringFeedback;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,MAAM,kBAAkB;AACjC,SAAS,eAAe,gBAAgB;AASjC,IAAM,sBAAN,cAAkC,WAAW;AAAA,EAA7C;AAAA;AAKL,SAAO,OAAiB;AAAA;AAAA,EAExB,SAAS;AACP,UAAM,aAAa,KAAK,iBAAiB,UACtC,QAAQ,cAAY,SAAS,SAAS,QAAQ,aAAW,QAAQ,KAAK,CAAC,EACvE,KAAK,UAAQ,KAAK,MAAM;AAE3B,QAAI,CAAC,cAAc,CAAC,WAAW,UAAW,QAAO;AAEjD,QAAI,WAAW,UAAU,MAAM,oBAAqB,QAAO,YAAY,KAAK,QAAQ,aAAa;AAEjG,UAAM,mBAAmB,YAAY,UAAU,KAAK,OAAK,EAAE,eAAe,kBAAkB,GAAG;AAC/F,UAAM,eAAe,YAAY,UAAU,KAAK,QAAM,GAAG,cAAc,OAAO;AAE9E,UAAM,QAAQ,SAAS,cAAc,KAAe;AACpD,UAAM,iBAAiB,WAAW,gBAAgB;AAElD,UAAM,eAAe,MAAM;AACzB,UAAI,qBAAqB,aAAa;AACpC,eAAO,KAAK,QAAQ;AAAA,MACtB;AAEA,UAAI,CAAC,kBAAkB,UAAU,UAAa,CAAC,OAAO,MAAM,KAAK,GAAG;AAClE,eAAO,QAAQ,IAAI,KAAK,QAAQ,cAAc,KAAK,QAAQ;AAAA,MAC7D;AAEA,UAAI,mBAAmB,mBAAmB;AACxC,eAAO,OAAO,MAAM,KAAK,KAAK,UAAU,SACpC,8IACA,yBAAyB,UAAU,IAAI,gBAAgB,SAAS,IAAI,mBAAa,GAAG,KAAK,SAAS;AAAA,MACxG;AAEA,UAAI,mBAAmB,SAAS;AAC9B,eAAO,OAAO,MAAM,KAAK,IAAI,KAAK;AAAA,MACpC;AAEA,aAAO,KAAK,QAAQ;AAAA,IACtB;AAEA,WAAO,YAAY,aAAa,CAAC;AAAA,EACnC;AACF;AA5CY;AAAA,EADT,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAD3C,oBAED;AAGH;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,WAAW,OAAO,CAAC;AAAA,GAJlC,oBAKJ;AALI,sBAAN;AAAA,EADN,cAAc,uBAAuB;AAAA,GACzB;","names":[]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
propInternalState
|
|
3
|
+
} from "./chunk-K6EUKFNW.js";
|
|
4
|
+
import {
|
|
5
|
+
btn,
|
|
6
|
+
dis
|
|
7
|
+
} from "./chunk-5ZHHNEDA.js";
|
|
8
|
+
import {
|
|
9
|
+
watch
|
|
10
|
+
} from "./chunk-ELDMXTUQ.js";
|
|
11
|
+
import {
|
|
12
|
+
computedContext
|
|
13
|
+
} from "./chunk-YZSGZTWA.js";
|
|
14
|
+
import {
|
|
15
|
+
__decorateClass
|
|
16
|
+
} from "./chunk-H2JE6IVU.js";
|
|
17
|
+
|
|
18
|
+
// src/lib/qti-test/components/test-next.ts
|
|
19
|
+
import { css, html, LitElement } from "lit";
|
|
20
|
+
import { customElement } from "lit/decorators.js";
|
|
21
|
+
import { consume } from "@lit/context";
|
|
22
|
+
var TestNext = class extends LitElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.disabled = true;
|
|
26
|
+
this._internals = this.attachInternals();
|
|
27
|
+
this._internals.role = "button";
|
|
28
|
+
this._internals.ariaLabel = "Next item";
|
|
29
|
+
this.addEventListener("click", (e) => {
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
if (!this.disabled) this._requestItem(this.sectionItems[this.itemIndex + 1].identifier);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
_handleTestElementChange(_oldValue, newValue) {
|
|
35
|
+
if (newValue) {
|
|
36
|
+
this.disabled = false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
connectedCallback() {
|
|
40
|
+
super.connectedCallback();
|
|
41
|
+
this.checkDisabled();
|
|
42
|
+
}
|
|
43
|
+
willUpdate(_changedProperties) {
|
|
44
|
+
if (!this.computedContext) return;
|
|
45
|
+
const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
|
|
46
|
+
if (!testPart) return;
|
|
47
|
+
this.sectionItems = testPart.sections.flatMap((section) => section.items);
|
|
48
|
+
this.itemIndex = this.sectionItems.findIndex((item) => item.active);
|
|
49
|
+
this.checkDisabled();
|
|
50
|
+
}
|
|
51
|
+
checkDisabled() {
|
|
52
|
+
this.disabled = !this.computedContext || this.itemIndex < 0 || this.itemIndex >= this.sectionItems?.length - 1;
|
|
53
|
+
}
|
|
54
|
+
_requestItem(identifier) {
|
|
55
|
+
this.dispatchEvent(
|
|
56
|
+
new CustomEvent("qti-request-navigation", {
|
|
57
|
+
composed: true,
|
|
58
|
+
bubbles: true,
|
|
59
|
+
detail: {
|
|
60
|
+
type: "item",
|
|
61
|
+
id: identifier
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
return html`<slot></slot>`;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
TestNext.styles = css`
|
|
71
|
+
:host {
|
|
72
|
+
${btn};
|
|
73
|
+
}
|
|
74
|
+
:host([disabled]) {
|
|
75
|
+
${dis};
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
__decorateClass([
|
|
79
|
+
propInternalState({
|
|
80
|
+
type: Boolean,
|
|
81
|
+
reflect: true,
|
|
82
|
+
aria: "ariaDisabled"
|
|
83
|
+
// Maps to `aria-disabled` attribute
|
|
84
|
+
})
|
|
85
|
+
], TestNext.prototype, "disabled", 2);
|
|
86
|
+
__decorateClass([
|
|
87
|
+
consume({ context: computedContext, subscribe: true })
|
|
88
|
+
], TestNext.prototype, "computedContext", 2);
|
|
89
|
+
__decorateClass([
|
|
90
|
+
watch("computedContext")
|
|
91
|
+
], TestNext.prototype, "_handleTestElementChange", 1);
|
|
92
|
+
TestNext = __decorateClass([
|
|
93
|
+
customElement("test-next")
|
|
94
|
+
], TestNext);
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
TestNext
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=chunk-KWUJVUKA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-next.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport * as styles from './styles';\nimport { propInternalState, watch } from '../../decorators';\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { ComputedContext, ComputedItem } from '../../exports/computed.context';\n\n/**\n * Represents a custom element for navigating to the next test item.\n *\n * @remarks\n * This element provides functionality for navigating to the next test item.\n *\n * @example\n * ```html\n * <test-next></test-next>\n * ```\n */\n@customElement('test-next')\nexport class TestNext extends LitElement {\n @propInternalState({\n type: Boolean,\n reflect: true,\n aria: 'ariaDisabled' // Maps to `aria-disabled` attribute\n })\n public disabled = true;\n\n @consume({ context: computedContext, subscribe: true })\n protected computedContext: ComputedContext;\n\n sectionItems: ComputedItem[];\n itemIndex: number;\n\n @watch('computedContext')\n _handleTestElementChange(_oldValue: ComputedContext, newValue: ComputedContext) {\n if (newValue) {\n this.disabled = false;\n }\n }\n\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n private _internals: ElementInternals;\n\n constructor() {\n super();\n\n this._internals = this.attachInternals();\n this._internals.role = 'button';\n this._internals.ariaLabel = 'Next item';\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this.disabled) this._requestItem(this.sectionItems[this.itemIndex + 1].identifier);\n });\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.checkDisabled();\n }\n\n willUpdate(_changedProperties: Map<string | number | symbol, unknown>) {\n if (!this.computedContext) return;\n const testPart = this.computedContext?.testParts.find(testPart => testPart.active);\n if (!testPart) return;\n this.sectionItems = testPart.sections.flatMap(section => section.items);\n this.itemIndex = this.sectionItems.findIndex(item => item.active);\n this.checkDisabled();\n }\n\n checkDisabled() {\n this.disabled = !this.computedContext || this.itemIndex < 0 || this.itemIndex >= this.sectionItems?.length - 1;\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-navigation', {\n composed: true,\n bubbles: true,\n detail: {\n type: 'item',\n id: identifier\n }\n })\n );\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-next': TestNext;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,kBAAkB;AACtC,SAAS,qBAAqB;AAC9B,SAAS,eAAe;AAoBjB,IAAM,WAAN,cAAuB,WAAW;AAAA,EA+BvC,cAAc;AACZ,UAAM;AA1BR,SAAO,WAAW;AA4BhB,SAAK,aAAa,KAAK,gBAAgB;AACvC,SAAK,WAAW,OAAO;AACvB,SAAK,WAAW,YAAY;AAE5B,SAAK,iBAAiB,SAAS,OAAK;AAClC,QAAE,eAAe;AACjB,UAAI,CAAC,KAAK,SAAU,MAAK,aAAa,KAAK,aAAa,KAAK,YAAY,CAAC,EAAE,UAAU;AAAA,IACxF,CAAC;AAAA,EACH;AAAA,EA3BA,yBAAyB,WAA4B,UAA2B;AAC9E,QAAI,UAAU;AACZ,WAAK,WAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAyBA,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,SAAK,cAAc;AAAA,EACrB;AAAA,EAEA,WAAW,oBAA4D;AACrE,QAAI,CAAC,KAAK,gBAAiB;AAC3B,UAAM,WAAW,KAAK,iBAAiB,UAAU,KAAK,CAAAA,cAAYA,UAAS,MAAM;AACjF,QAAI,CAAC,SAAU;AACf,SAAK,eAAe,SAAS,SAAS,QAAQ,aAAW,QAAQ,KAAK;AACtE,SAAK,YAAY,KAAK,aAAa,UAAU,UAAQ,KAAK,MAAM;AAChE,SAAK,cAAc;AAAA,EACrB;AAAA,EAEA,gBAAgB;AACd,SAAK,WAAW,CAAC,KAAK,mBAAmB,KAAK,YAAY,KAAK,KAAK,aAAa,KAAK,cAAc,SAAS;AAAA,EAC/G;AAAA,EAEU,aAAa,YAA0B;AAC/C,SAAK;AAAA,MACH,IAAI,YAAY,0BAA0B;AAAA,QACxC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,UACN,MAAM;AAAA,UACN,IAAI;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AA9Ea,SAqBJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AApBT;AAAA,EALN,kBAAkB;AAAA,IACjB,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA;AAAA,EACR,CAAC;AAAA,GALU,SAMJ;AAGG;AAAA,EADT,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAR3C,SASD;AAMV;AAAA,EADC,MAAM,iBAAiB;AAAA,GAdb,SAeX;AAfW,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":["testPart"]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
propInternalState
|
|
3
|
+
} from "./chunk-K6EUKFNW.js";
|
|
4
|
+
import {
|
|
5
|
+
btn,
|
|
6
|
+
dis
|
|
7
|
+
} from "./chunk-5ZHHNEDA.js";
|
|
8
|
+
import {
|
|
9
|
+
watch
|
|
10
|
+
} from "./chunk-ELDMXTUQ.js";
|
|
11
|
+
import {
|
|
12
|
+
computedContext
|
|
13
|
+
} from "./chunk-NY5T6G3K.js";
|
|
14
|
+
import {
|
|
15
|
+
__decorateClass
|
|
16
|
+
} from "./chunk-H2JE6IVU.js";
|
|
17
|
+
|
|
18
|
+
// src/lib/qti-test/components/test-next.ts
|
|
19
|
+
import { css, html, LitElement } from "lit";
|
|
20
|
+
import { customElement } from "lit/decorators.js";
|
|
21
|
+
import { consume } from "@lit/context";
|
|
22
|
+
var TestNext = class extends LitElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.disabled = true;
|
|
26
|
+
this._internals = this.attachInternals();
|
|
27
|
+
this._internals.role = "button";
|
|
28
|
+
this._internals.ariaLabel = "Next item";
|
|
29
|
+
this.addEventListener("click", (e) => {
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
if (!this.disabled) this._requestItem(this.sectionItems[this.itemIndex + 1].identifier);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
_handleTestElementChange(_oldValue, newValue) {
|
|
35
|
+
if (newValue) {
|
|
36
|
+
this.disabled = false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
connectedCallback() {
|
|
40
|
+
super.connectedCallback();
|
|
41
|
+
this.checkDisabled();
|
|
42
|
+
}
|
|
43
|
+
willUpdate(_changedProperties) {
|
|
44
|
+
if (!this.computedContext) return;
|
|
45
|
+
const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
|
|
46
|
+
if (!testPart) return;
|
|
47
|
+
this.sectionItems = testPart.sections.flatMap((section) => section.items);
|
|
48
|
+
this.itemIndex = this.sectionItems.findIndex((item) => item.active);
|
|
49
|
+
this.checkDisabled();
|
|
50
|
+
}
|
|
51
|
+
checkDisabled() {
|
|
52
|
+
this.disabled = !this.computedContext || this.itemIndex < 0 || this.itemIndex >= this.sectionItems?.length - 1;
|
|
53
|
+
}
|
|
54
|
+
_requestItem(identifier) {
|
|
55
|
+
this.dispatchEvent(
|
|
56
|
+
new CustomEvent("qti-request-navigation", {
|
|
57
|
+
composed: true,
|
|
58
|
+
bubbles: true,
|
|
59
|
+
detail: {
|
|
60
|
+
type: "item",
|
|
61
|
+
id: identifier
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
return html`<slot></slot>`;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
TestNext.styles = css`
|
|
71
|
+
:host {
|
|
72
|
+
${btn};
|
|
73
|
+
}
|
|
74
|
+
:host([disabled]) {
|
|
75
|
+
${dis};
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
__decorateClass([
|
|
79
|
+
propInternalState({
|
|
80
|
+
type: Boolean,
|
|
81
|
+
reflect: true,
|
|
82
|
+
aria: "ariaDisabled"
|
|
83
|
+
// Maps to `aria-disabled` attribute
|
|
84
|
+
})
|
|
85
|
+
], TestNext.prototype, "disabled", 2);
|
|
86
|
+
__decorateClass([
|
|
87
|
+
consume({ context: computedContext, subscribe: true })
|
|
88
|
+
], TestNext.prototype, "computedContext", 2);
|
|
89
|
+
__decorateClass([
|
|
90
|
+
watch("computedContext")
|
|
91
|
+
], TestNext.prototype, "_handleTestElementChange", 1);
|
|
92
|
+
TestNext = __decorateClass([
|
|
93
|
+
customElement("test-next")
|
|
94
|
+
], TestNext);
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
TestNext
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=chunk-LMWMNMIU.js.map
|