@citolab/qti-components 7.1.6 → 7.2.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-2GVQHMFN.js +5 -0
- package/cdn/chunks/chunk-34TLO462.js +1 -0
- package/cdn/chunks/chunk-3AUZHOWF.js +5 -0
- package/cdn/chunks/chunk-3BTFQ7WO.js +5 -0
- package/cdn/chunks/chunk-3G52PPHF.js +1 -0
- package/cdn/chunks/chunk-3T7FMZJJ.js +5 -0
- package/cdn/chunks/chunk-3WMAQ764.js +23 -0
- package/cdn/chunks/chunk-3XYZ63C3.js +1 -0
- package/cdn/chunks/chunk-43VY76CQ.js +5 -0
- package/cdn/chunks/chunk-4VDQDT6F.js +1 -0
- package/cdn/chunks/chunk-4XDZ5XHU.js +1007 -0
- package/cdn/chunks/chunk-52V4Q43H.js +5 -0
- package/cdn/chunks/chunk-5DVS53XB.js +1007 -0
- package/cdn/chunks/chunk-6BZPFYLZ.js +1 -0
- package/cdn/chunks/chunk-7B6HAKFL.js +1 -0
- package/cdn/chunks/chunk-7BENQ76L.js +1 -0
- package/cdn/chunks/chunk-A6PJTNI7.js +23 -0
- package/cdn/chunks/chunk-AFBSMLI4.js +5 -0
- package/cdn/chunks/chunk-AU2GM346.js +23 -0
- package/cdn/chunks/chunk-B345O2HX.js +1 -0
- package/cdn/chunks/chunk-B3RMHCUZ.js +1 -0
- package/cdn/chunks/chunk-BFPXRWNH.js +5 -0
- package/cdn/chunks/chunk-BGBABJCL.js +5 -0
- package/cdn/chunks/chunk-BKSBIZJA.js +5 -0
- package/cdn/chunks/chunk-BWG4B5VP.js +0 -0
- package/cdn/chunks/chunk-C25LH4KA.js +1 -0
- package/cdn/chunks/chunk-CDCBI3YD.js +1 -0
- package/cdn/chunks/chunk-CQPD5NPM.js +1 -0
- package/cdn/chunks/chunk-CS6UCV2Q.js +5 -0
- package/cdn/chunks/chunk-D74A6CWS.js +8 -0
- package/cdn/chunks/chunk-DFZQWABG.js +5 -0
- package/cdn/chunks/chunk-DHZMASGY.js +5 -0
- package/cdn/chunks/chunk-EZ7OIK2M.js +1007 -0
- package/cdn/chunks/chunk-F2WLIUYH.js +5 -0
- package/cdn/chunks/chunk-F3ZZJBV2.js +5 -0
- package/cdn/chunks/chunk-FCH2GIHD.js +1 -0
- package/cdn/chunks/chunk-FKUEIENC.js +5 -0
- package/cdn/chunks/chunk-FMCWO2FJ.js +17 -0
- package/cdn/chunks/chunk-FQW2YR3J.js +1 -0
- package/cdn/chunks/chunk-FVEUVB2H.js +23 -0
- package/cdn/chunks/chunk-GMF365YO.js +16 -0
- package/cdn/chunks/chunk-GWRXCQHZ.js +23 -0
- package/cdn/chunks/chunk-HAXNBTTE.js +1 -0
- package/cdn/chunks/chunk-HEAJ2NEA.js +1007 -0
- package/cdn/chunks/chunk-HKBOCCDM.js +5 -0
- package/cdn/chunks/chunk-HRLTVAPZ.js +5 -0
- package/cdn/chunks/chunk-HZ5STZXK.js +5 -0
- package/cdn/chunks/chunk-I5HGXKPD.js +1007 -0
- package/cdn/chunks/chunk-IELXBBZK.js +5 -0
- package/cdn/chunks/chunk-IHL5T5GX.js +5 -0
- package/cdn/chunks/chunk-J2M4UG43.js +1 -0
- package/cdn/chunks/chunk-JAMSX45C.js +1 -0
- package/cdn/chunks/chunk-JEPI46VU.js +5 -0
- package/cdn/chunks/chunk-JSQUXTN4.js +1033 -0
- package/cdn/chunks/chunk-JXDOR5ZC.js +1 -0
- package/cdn/chunks/chunk-JZCJOPJ4.js +1007 -0
- package/cdn/chunks/chunk-KKEW6E2D.js +5 -0
- package/cdn/chunks/chunk-L4UTGAI5.js +5 -0
- package/cdn/chunks/chunk-LMLG3NBM.js +5 -0
- package/cdn/chunks/chunk-MM2ZXHVH.js +5 -0
- package/cdn/chunks/chunk-NQQE76LE.js +1 -0
- package/cdn/chunks/chunk-O6CWZJXT.js +28 -0
- package/cdn/chunks/chunk-OSEDGNNB.js +1007 -0
- package/cdn/chunks/chunk-PJFHT7NY.js +5 -0
- package/cdn/chunks/chunk-PKWOG7OF.js +5 -0
- package/cdn/chunks/chunk-PTG4PTFS.js +5 -0
- package/cdn/chunks/chunk-QIRSCGXH.js +1007 -0
- package/cdn/chunks/chunk-RIPDQPTC.js +5 -0
- package/cdn/chunks/chunk-RO5THFZ6.js +5 -0
- package/cdn/chunks/chunk-SQ3RENJ6.js +5 -0
- package/cdn/chunks/chunk-SUOAWPV7.js +23 -0
- package/cdn/chunks/chunk-T43NJLH5.js +5 -0
- package/cdn/chunks/chunk-TIH5N4LQ.js +1007 -0
- package/cdn/chunks/chunk-TOUJRNTD.js +1007 -0
- package/cdn/chunks/chunk-TSMKXWWV.js +5 -0
- package/cdn/chunks/chunk-TU4L55WU.js +5 -0
- package/cdn/chunks/chunk-UDPQY4OA.js +1007 -0
- package/cdn/chunks/chunk-ULI6NOVG.js +23 -0
- package/cdn/chunks/chunk-UTEMKKYS.js +1 -0
- package/cdn/chunks/chunk-UV3CSMRU.js +5 -0
- package/cdn/chunks/chunk-V2RDHKE2.js +5 -0
- package/cdn/chunks/chunk-VQLIWL6K.js +5 -0
- package/cdn/chunks/chunk-VZEUFE5C.js +3455 -0
- package/cdn/chunks/chunk-W5B2MLGL.js +1 -0
- package/cdn/chunks/chunk-WJGOCWFB.js +1 -0
- package/cdn/chunks/chunk-WLQN7SVZ.js +1033 -0
- package/cdn/chunks/chunk-WUX2JPB5.js +17 -0
- package/cdn/chunks/chunk-X7FRU3B6.js +5 -0
- package/cdn/chunks/chunk-XS46RWY6.js +5 -0
- package/cdn/chunks/chunk-XTNESJMB.js +5 -0
- package/cdn/chunks/chunk-Y2EDF22E.js +16 -0
- package/cdn/chunks/chunk-YE4ZNHXG.js +23 -0
- package/cdn/chunks/chunk-YMFPA4QO.js +5 -0
- package/cdn/chunks/chunk-YRK3ZLQP.js +1033 -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/components/test-navigation.js +1 -1
- package/cdn/qti-test/components/test-next.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-stamp.js +1 -0
- package/cdn/qti-test/components/test-view-toggle.js +1 -1
- package/cdn/qti-test/core/index.js +1 -1
- package/cdn/qti-transformers/index.js +1 -1
- package/dist/chunks/chunk-2GPGOKL6.js +94 -0
- package/dist/chunks/chunk-2GPGOKL6.js.map +1 -0
- package/dist/chunks/chunk-2J22QBLB.js +94 -0
- package/dist/chunks/chunk-2J22QBLB.js.map +1 -0
- package/dist/chunks/chunk-34F2DVNP.js +85 -0
- package/dist/chunks/chunk-34F2DVNP.js.map +1 -0
- package/dist/chunks/chunk-3TM6VQEG.js +375 -0
- package/dist/chunks/chunk-3TM6VQEG.js.map +1 -0
- package/dist/chunks/chunk-3YVVZ2MO.js +374 -0
- package/dist/chunks/chunk-3YVVZ2MO.js.map +1 -0
- package/dist/chunks/chunk-46RFKXS6.js +94 -0
- package/dist/chunks/chunk-46RFKXS6.js.map +1 -0
- package/dist/chunks/chunk-47BWT37I.js +94 -0
- package/dist/chunks/chunk-47BWT37I.js.map +1 -0
- package/dist/chunks/chunk-4EXSIVXY.js +68 -0
- package/dist/chunks/chunk-4EXSIVXY.js.map +1 -0
- package/dist/chunks/chunk-4JL6LXWC.js +94 -0
- package/dist/chunks/chunk-4JL6LXWC.js.map +1 -0
- package/dist/chunks/chunk-4TQ3YR2O.js +31 -0
- package/dist/chunks/chunk-4TQ3YR2O.js.map +1 -0
- package/dist/chunks/chunk-4VEH63K4.js +854 -0
- package/dist/chunks/chunk-4VEH63K4.js.map +1 -0
- package/dist/chunks/chunk-5FKTC6XV.js +99 -0
- package/dist/chunks/chunk-5FKTC6XV.js.map +1 -0
- package/dist/chunks/chunk-5SZAGP4N.js +863 -0
- package/dist/chunks/chunk-5SZAGP4N.js.map +1 -0
- package/dist/chunks/chunk-64EQ3AQ4.js +240 -0
- package/dist/chunks/chunk-64EQ3AQ4.js.map +1 -0
- package/dist/chunks/chunk-6MECYIS2.js +94 -0
- package/dist/chunks/chunk-6MECYIS2.js.map +1 -0
- package/dist/chunks/chunk-6T5ICOX2.js +94 -0
- package/dist/chunks/chunk-6T5ICOX2.js.map +1 -0
- package/dist/chunks/chunk-6ZK4ZDQA.js +94 -0
- package/dist/chunks/chunk-6ZK4ZDQA.js.map +1 -0
- package/dist/chunks/chunk-7KTTLJUH.js +45 -0
- package/dist/chunks/chunk-7KTTLJUH.js.map +1 -0
- package/dist/chunks/chunk-7LFQ6D75.js +95 -0
- package/dist/chunks/chunk-7LFQ6D75.js.map +1 -0
- package/dist/chunks/chunk-7T5WVG7T.js +853 -0
- package/dist/chunks/chunk-7T5WVG7T.js.map +1 -0
- package/dist/chunks/chunk-A5IAS5VV.js +54 -0
- package/dist/chunks/chunk-A5IAS5VV.js.map +1 -0
- package/dist/chunks/chunk-ABDJRZ2V.js +78 -0
- package/dist/chunks/chunk-ABDJRZ2V.js.map +1 -0
- package/dist/chunks/chunk-AN33KA5S.js +94 -0
- package/dist/chunks/chunk-AN33KA5S.js.map +1 -0
- package/dist/chunks/chunk-B2SP77UV.js +818 -0
- package/dist/chunks/chunk-B2SP77UV.js.map +1 -0
- package/dist/chunks/chunk-BB7V3D2X.js +250 -0
- package/dist/chunks/chunk-BB7V3D2X.js.map +1 -0
- package/dist/chunks/chunk-BJAP2552.js +6893 -0
- package/dist/chunks/chunk-BJAP2552.js.map +1 -0
- package/dist/chunks/chunk-BSPLGP2R.js +627 -0
- package/dist/chunks/chunk-BSPLGP2R.js.map +1 -0
- package/dist/chunks/chunk-BWUEY6V5.js +818 -0
- package/dist/chunks/chunk-BWUEY6V5.js.map +1 -0
- package/dist/chunks/chunk-C7YUIKFQ.js +249 -0
- package/dist/chunks/chunk-C7YUIKFQ.js.map +1 -0
- package/dist/chunks/chunk-CIZ7HKZC.js +42 -0
- package/dist/chunks/chunk-CIZ7HKZC.js.map +1 -0
- package/dist/chunks/chunk-CJSBOJOH.js +6888 -0
- package/dist/chunks/chunk-CJSBOJOH.js.map +1 -0
- package/dist/chunks/chunk-CYB63HHS.js +31 -0
- package/dist/chunks/chunk-CYB63HHS.js.map +1 -0
- package/dist/chunks/chunk-DFSZKFKS.js +43 -0
- package/dist/chunks/chunk-DFSZKFKS.js.map +1 -0
- package/dist/chunks/chunk-DNRSH4DB.js +854 -0
- package/dist/chunks/chunk-DNRSH4DB.js.map +1 -0
- package/dist/chunks/chunk-DPDCXMHW.js +81 -0
- package/dist/chunks/chunk-DPDCXMHW.js.map +1 -0
- package/dist/chunks/chunk-DQ62VQEH.js +627 -0
- package/dist/chunks/chunk-DQ62VQEH.js.map +1 -0
- package/dist/chunks/chunk-E4G74EVO.js +99 -0
- package/dist/chunks/chunk-E4G74EVO.js.map +1 -0
- package/dist/chunks/chunk-EA7DHOYO.js +6903 -0
- package/dist/chunks/chunk-EA7DHOYO.js.map +1 -0
- package/dist/chunks/chunk-EAFJQRTV.js +56 -0
- package/dist/chunks/chunk-EAFJQRTV.js.map +1 -0
- package/dist/chunks/chunk-EL4TPH56.js +94 -0
- package/dist/chunks/chunk-EL4TPH56.js.map +1 -0
- package/dist/chunks/chunk-FI6LX4IS.js +853 -0
- package/dist/chunks/chunk-FI6LX4IS.js.map +1 -0
- package/dist/chunks/chunk-FORIPEB2.js +241 -0
- package/dist/chunks/chunk-FORIPEB2.js.map +1 -0
- package/dist/chunks/chunk-G3TG4ADZ.js +8 -0
- package/dist/chunks/chunk-G3TG4ADZ.js.map +1 -0
- package/dist/chunks/chunk-H4XZSMVR.js +375 -0
- package/dist/chunks/chunk-H4XZSMVR.js.map +1 -0
- package/dist/chunks/chunk-H6O2X4MD.js +42 -0
- package/dist/chunks/chunk-H6O2X4MD.js.map +1 -0
- package/dist/chunks/chunk-H7W3RQS4.js +627 -0
- package/dist/chunks/chunk-H7W3RQS4.js.map +1 -0
- package/dist/chunks/chunk-HMHM2W7Z.js +241 -0
- package/dist/chunks/chunk-HMHM2W7Z.js.map +1 -0
- package/dist/chunks/chunk-I3RHYDUK.js +6917 -0
- package/dist/chunks/chunk-I3RHYDUK.js.map +1 -0
- package/dist/chunks/chunk-IHNLBY62.js +42 -0
- package/dist/chunks/chunk-IHNLBY62.js.map +1 -0
- package/dist/chunks/chunk-ILA6BNIO.js +31 -0
- package/dist/chunks/chunk-ILA6BNIO.js.map +1 -0
- package/dist/chunks/chunk-JFZF77EN.js +31 -0
- package/dist/chunks/chunk-JFZF77EN.js.map +1 -0
- package/dist/chunks/chunk-JOQ2E6SE.js +92 -0
- package/dist/chunks/chunk-JOQ2E6SE.js.map +1 -0
- package/dist/chunks/chunk-JQBEZ43O.js +240 -0
- package/dist/chunks/chunk-JQBEZ43O.js.map +1 -0
- package/dist/chunks/chunk-JQQ755AG.js +854 -0
- package/dist/chunks/chunk-JQQ755AG.js.map +1 -0
- package/dist/chunks/chunk-JRDTY7YA.js +627 -0
- package/dist/chunks/chunk-JRDTY7YA.js.map +1 -0
- package/dist/chunks/chunk-JU7QJQ6F.js +853 -0
- package/dist/chunks/chunk-JU7QJQ6F.js.map +1 -0
- package/dist/chunks/chunk-K6LM7XK5.js +94 -0
- package/dist/chunks/chunk-K6LM7XK5.js.map +1 -0
- package/dist/chunks/chunk-K6PU3ZO4.js +853 -0
- package/dist/chunks/chunk-K6PU3ZO4.js.map +1 -0
- package/dist/chunks/chunk-KD26ZB2H.js +3445 -0
- package/dist/chunks/chunk-KD26ZB2H.js.map +1 -0
- package/dist/chunks/chunk-KGL6SIOD.js +6893 -0
- package/dist/chunks/chunk-KGL6SIOD.js.map +1 -0
- package/dist/chunks/chunk-KIRLKN6I.js +68 -0
- package/dist/chunks/chunk-KIRLKN6I.js.map +1 -0
- package/dist/chunks/chunk-L74KEUIS.js +94 -0
- package/dist/chunks/chunk-L74KEUIS.js.map +1 -0
- package/dist/chunks/chunk-LEXNKJYF.js +6888 -0
- package/dist/chunks/chunk-LEXNKJYF.js.map +1 -0
- package/dist/chunks/chunk-LVE5GKDT.js +94 -0
- package/dist/chunks/chunk-LVE5GKDT.js.map +1 -0
- package/dist/chunks/chunk-LVZHVB7F.js +31 -0
- package/dist/chunks/chunk-LVZHVB7F.js.map +1 -0
- package/dist/chunks/chunk-MGLNBEW4.js +33 -0
- package/dist/chunks/chunk-MGLNBEW4.js.map +1 -0
- package/dist/chunks/chunk-MS7YRGNG.js +56 -0
- package/dist/chunks/chunk-MS7YRGNG.js.map +1 -0
- package/dist/chunks/chunk-N25ZKAHQ.js +50 -0
- package/dist/chunks/chunk-N25ZKAHQ.js.map +1 -0
- package/dist/chunks/chunk-N46CJQRI.js +94 -0
- package/dist/chunks/chunk-N46CJQRI.js.map +1 -0
- package/dist/chunks/chunk-N4QWREF4.js +375 -0
- package/dist/chunks/chunk-N4QWREF4.js.map +1 -0
- package/dist/chunks/chunk-NM3JA4DH.js +6893 -0
- package/dist/chunks/chunk-NM3JA4DH.js.map +1 -0
- package/dist/chunks/chunk-NOHVLBCB.js +371 -0
- package/dist/chunks/chunk-NOHVLBCB.js.map +1 -0
- package/dist/chunks/chunk-NQSOVEFB.js +31 -0
- package/dist/chunks/chunk-NQSOVEFB.js.map +1 -0
- package/dist/chunks/chunk-OA7AFFCB.js +866 -0
- package/dist/chunks/chunk-OA7AFFCB.js.map +1 -0
- package/dist/chunks/chunk-OLNSD7FR.js +31 -0
- package/dist/chunks/chunk-OLNSD7FR.js.map +1 -0
- package/dist/chunks/chunk-OREE4FRY.js +42 -0
- package/dist/chunks/chunk-OREE4FRY.js.map +1 -0
- package/dist/chunks/chunk-P66WO2Q5.js +870 -0
- package/dist/chunks/chunk-P66WO2Q5.js.map +1 -0
- package/dist/chunks/chunk-PKOIFI5C.js +853 -0
- package/dist/chunks/chunk-PKOIFI5C.js.map +1 -0
- package/dist/chunks/chunk-QFV3VHZ4.js +43 -0
- package/dist/chunks/chunk-QFV3VHZ4.js.map +1 -0
- package/dist/chunks/chunk-QTKNSVUO.js +854 -0
- package/dist/chunks/chunk-QTKNSVUO.js.map +1 -0
- package/dist/chunks/chunk-RSGEN2FF.js +6917 -0
- package/dist/chunks/chunk-RSGEN2FF.js.map +1 -0
- package/dist/chunks/chunk-S6XGFD5B.js +6893 -0
- package/dist/chunks/chunk-S6XGFD5B.js.map +1 -0
- package/dist/chunks/chunk-SOT463MH.js +68 -0
- package/dist/chunks/chunk-SOT463MH.js.map +1 -0
- package/dist/chunks/chunk-SZMR2BFI.js +94 -0
- package/dist/chunks/chunk-SZMR2BFI.js.map +1 -0
- package/dist/chunks/chunk-TDKYWAGB.js +50 -0
- package/dist/chunks/chunk-TDKYWAGB.js.map +1 -0
- package/dist/chunks/chunk-TDNCAAAT.js +627 -0
- package/dist/chunks/chunk-TDNCAAAT.js.map +1 -0
- package/dist/chunks/chunk-TVOHUHS4.js +94 -0
- package/dist/chunks/chunk-TVOHUHS4.js.map +1 -0
- package/dist/chunks/chunk-UE3R54FP.js +853 -0
- package/dist/chunks/chunk-UE3R54FP.js.map +1 -0
- package/dist/chunks/chunk-UUEOV5NM.js +1 -0
- package/dist/chunks/chunk-UUEOV5NM.js.map +1 -0
- package/dist/chunks/chunk-UZRIKXLU.js +94 -0
- package/dist/chunks/chunk-UZRIKXLU.js.map +1 -0
- package/dist/chunks/chunk-VAYGVW5R.js +6903 -0
- package/dist/chunks/chunk-VAYGVW5R.js.map +1 -0
- package/dist/chunks/chunk-VEWD22O5.js +383 -0
- package/dist/chunks/chunk-VEWD22O5.js.map +1 -0
- package/dist/chunks/chunk-VF32HLF4.js +81 -0
- package/dist/chunks/chunk-VF32HLF4.js.map +1 -0
- package/dist/chunks/chunk-VY7QNZVM.js +6893 -0
- package/dist/chunks/chunk-VY7QNZVM.js.map +1 -0
- package/dist/chunks/chunk-W4FWEMCO.js +871 -0
- package/dist/chunks/chunk-W4FWEMCO.js.map +1 -0
- package/dist/chunks/chunk-W5VRVGBL.js +81 -0
- package/dist/chunks/chunk-W5VRVGBL.js.map +1 -0
- package/dist/chunks/chunk-WDGXLQLI.js +94 -0
- package/dist/chunks/chunk-WDGXLQLI.js.map +1 -0
- package/dist/chunks/chunk-WTTOJHIM.js +371 -0
- package/dist/chunks/chunk-WTTOJHIM.js.map +1 -0
- package/dist/chunks/chunk-WZZOX7S2.js +853 -0
- package/dist/chunks/chunk-WZZOX7S2.js.map +1 -0
- package/dist/chunks/chunk-X2G652U7.js +6903 -0
- package/dist/chunks/chunk-X2G652U7.js.map +1 -0
- package/dist/chunks/chunk-XKQP4R6O.js +380 -0
- package/dist/chunks/chunk-XKQP4R6O.js.map +1 -0
- package/dist/chunks/chunk-Z3SN77PI.js +31 -0
- package/dist/chunks/chunk-Z3SN77PI.js.map +1 -0
- package/dist/chunks/chunk-ZECYUSVI.js +43 -0
- package/dist/chunks/chunk-ZECYUSVI.js.map +1 -0
- package/dist/chunks/chunk-ZSPVMGE5.js +94 -0
- package/dist/chunks/chunk-ZSPVMGE5.js.map +1 -0
- package/dist/chunks/chunk-ZTXBJYUG.js +94 -0
- package/dist/chunks/chunk-ZTXBJYUG.js.map +1 -0
- package/dist/exports/computed-item.context.d.ts +1 -1
- package/dist/exports/computed.context.d.ts +1 -1
- package/dist/exports/interaction.d.ts +1 -1
- package/dist/exports/item.context.d.ts +1 -1
- package/dist/exports/qti-assessment-item.context.d.ts +1 -1
- package/dist/exports/qti-condition-expression.d.ts +1 -1
- package/dist/exports/qti-expression.d.ts +1 -1
- package/dist/exports/session.context.d.ts +2 -2
- package/dist/exports/test.context.d.ts +1 -1
- package/dist/exports/variables.d.ts +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.js +28 -12
- package/dist/item.css +26 -130
- package/dist/qti-components/index.d.ts +2 -2
- package/dist/qti-components/index.js +2 -2
- package/dist/qti-components-jsx.d.ts +91 -9
- package/dist/qti-item/components/item-container.js +3 -3
- package/dist/qti-item/components/item-show-correct-response.d.ts +1 -1
- package/dist/qti-item/components/print-item-variables.d.ts +1 -1
- package/dist/qti-item/core/index.d.ts +1 -1
- package/dist/qti-item/core/index.js +3 -3
- package/dist/qti-loader/index.d.ts +1 -1
- package/dist/qti-loader/index.js +2 -2
- package/dist/qti-response-declaration-C3kpm650.d.ts +1171 -0
- package/dist/qti-test/components/index.d.ts +7 -2
- package/dist/qti-test/components/index.js +25 -9
- package/dist/qti-test/components/test-container.js +3 -3
- package/dist/qti-test/components/test-navigation.d.ts +3 -2
- package/dist/qti-test/components/test-navigation.js +1 -1
- package/dist/qti-test/components/test-next.d.ts +1 -1
- package/dist/qti-test/components/test-next.js +1 -1
- package/dist/qti-test/components/test-prev.d.ts +1 -1
- package/dist/qti-test/components/test-print-context.d.ts +1 -1
- package/dist/qti-test/components/test-print-item-variables.d.ts +1 -1
- package/dist/qti-test/components/test-scoring-buttons.d.ts +2 -1
- package/dist/qti-test/components/test-scoring-buttons.js +1 -1
- package/dist/qti-test/components/test-scoring-feedback.d.ts +9 -1273
- package/dist/qti-test/components/test-scoring-feedback.js +4 -60
- package/dist/qti-test/components/test-scoring-feedback.js.map +1 -1
- package/dist/qti-test/components/test-show-correct-response.d.ts +1 -1
- package/dist/qti-test/components/test-stamp.d.ts +18 -0
- package/dist/qti-test/components/test-stamp.js +9 -0
- package/dist/qti-test/components/test-stamp.js.map +1 -0
- package/dist/qti-test/components/test-view-toggle.d.ts +2 -2
- package/dist/qti-test/components/test-view-toggle.js +1 -1
- package/dist/qti-test/core/index.d.ts +4 -4
- package/dist/qti-test/core/index.js +3 -3
- package/dist/qti-test-feedback-CG8nrjhS.d.ts +98 -0
- package/dist/qti-test-feedback-R38tNXBH.d.ts +98 -0
- package/dist/qti-transformers/index.d.ts +4 -1
- package/dist/qti-transformers/index.js +1 -1
- package/dist/vscode.html-custom-data.json +38 -13
- package/package.json +4 -4
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computedContext
|
|
3
|
+
} from "./chunk-6Z5YR5U2.js";
|
|
4
|
+
import {
|
|
5
|
+
__decorateClass
|
|
6
|
+
} from "./chunk-H2JE6IVU.js";
|
|
7
|
+
|
|
8
|
+
// src/lib/qti-test/components/test-stamp.ts
|
|
9
|
+
import { html, LitElement } from "lit";
|
|
10
|
+
import { customElement } from "lit/decorators.js";
|
|
11
|
+
import { prepareTemplate } from "stampino";
|
|
12
|
+
import { consume } from "@lit/context";
|
|
13
|
+
var TestStamp = class extends LitElement {
|
|
14
|
+
createRenderRoot() {
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
connectedCallback() {
|
|
18
|
+
super.connectedCallback();
|
|
19
|
+
const templateElement = this.querySelector("template");
|
|
20
|
+
this.myTemplate = prepareTemplate(templateElement);
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
if (!this.computedContext) return html``;
|
|
24
|
+
const activeItems = this.computedContext?.testParts.flatMap(
|
|
25
|
+
(testPart) => testPart.sections.flatMap((section) => section.items).find((item) => item.active)
|
|
26
|
+
);
|
|
27
|
+
const activeItem = activeItems && activeItems.length > 0 ? activeItems[0] : null;
|
|
28
|
+
if (!activeItem) return html``;
|
|
29
|
+
return html`${this.myTemplate({ item: activeItem })}`;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
__decorateClass([
|
|
33
|
+
consume({ context: computedContext, subscribe: true })
|
|
34
|
+
], TestStamp.prototype, "computedContext", 2);
|
|
35
|
+
TestStamp = __decorateClass([
|
|
36
|
+
customElement("test-stamp")
|
|
37
|
+
], TestStamp);
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
TestStamp
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=chunk-IHNLBY62.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-stamp.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { prepareTemplate } from 'stampino';\nimport { consume } from '@lit/context';\n\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { ComputedContext } from '../../exports/computed.context';\nimport type { TemplateFunction } from 'stampino';\n\n@customElement('test-stamp')\nexport class TestStamp extends LitElement {\n @consume({ context: computedContext, subscribe: true })\n private computedContext: ComputedContext;\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 this.myTemplate = prepareTemplate(templateElement);\n }\n\n render() {\n if (!this.computedContext) return html``;\n const activeItems = this.computedContext?.testParts.flatMap(testPart =>\n testPart.sections.flatMap(section => section.items).find(item => item.active)\n );\n const activeItem = activeItems && activeItems.length > 0 ? activeItems[0] : null;\n if (!activeItem) return html``;\n return html`${this.myTemplate({ item: activeItem })}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-stamp': TestStamp;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,MAAM,kBAAkB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAQjB,IAAM,YAAN,cAAwB,WAAW;AAAA,EAM9B,mBAAmD;AAC3D,WAAO;AAAA,EACT;AAAA,EAEA,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,UAAM,kBAAkB,KAAK,cAAmC,UAAU;AAC1E,SAAK,aAAa,gBAAgB,eAAe;AAAA,EACnD;AAAA,EAEA,SAAS;AACP,QAAI,CAAC,KAAK,gBAAiB,QAAO;AAClC,UAAM,cAAc,KAAK,iBAAiB,UAAU;AAAA,MAAQ,cAC1D,SAAS,SAAS,QAAQ,aAAW,QAAQ,KAAK,EAAE,KAAK,UAAQ,KAAK,MAAM;AAAA,IAC9E;AACA,UAAM,aAAa,eAAe,YAAY,SAAS,IAAI,YAAY,CAAC,IAAI;AAC5E,QAAI,CAAC,WAAY,QAAO;AACxB,WAAO,OAAO,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC,CAAC;AAAA,EACrD;AACF;AAvBU;AAAA,EADP,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAD3C,UAEH;AAFG,YAAN;AAAA,EADN,cAAc,YAAY;AAAA,GACd;","names":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
qtiTransformItem,
|
|
3
|
+
qtiTransformManifest,
|
|
4
|
+
qtiTransformTest
|
|
5
|
+
} from "./chunk-N4QWREF4.js";
|
|
6
|
+
|
|
7
|
+
// src/lib/qti-loader/qti-loader.ts
|
|
8
|
+
var getManifestInfo = async (manifestURL) => {
|
|
9
|
+
const baseURI = manifestURL.substring(0, manifestURL.lastIndexOf("/"));
|
|
10
|
+
const test = await qtiTransformManifest().load(`${manifestURL}`).then((api) => api.assessmentTest());
|
|
11
|
+
const testHTMLDoc = await qtiTransformTest().load(`${baseURI}/${test.href}`).then((api) => api.htmlDoc());
|
|
12
|
+
const items = await qtiTransformTest().load(`${baseURI}/${test.href}`).then((api) => api.items());
|
|
13
|
+
const testURL = `${baseURI}/${test.href}`;
|
|
14
|
+
const testURI = `${baseURI}/${test.href.substring(0, test.href.lastIndexOf("/"))}`;
|
|
15
|
+
return {
|
|
16
|
+
testHTMLDoc,
|
|
17
|
+
testURI,
|
|
18
|
+
testURL,
|
|
19
|
+
items,
|
|
20
|
+
testIdentifier: test.identifier
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
var getItemByUri = async (itemUri) => {
|
|
24
|
+
return qtiTransformItem().load(itemUri).promise.then((api) => api.htmlDoc().firstElementChild);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
getManifestInfo,
|
|
29
|
+
getItemByUri
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=chunk-ILA6BNIO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-loader/qti-loader.ts"],"sourcesContent":["import { qtiTransformItem, qtiTransformTest } from '../qti-transformers';\nimport { qtiTransformManifest } from '../qti-transformers/qti-transform-manifest';\n\nimport type { QtiAssessmentItem } from '../qti-components';\n\nexport type ManifestInfo = {\n testIdentifier: string;\n testHTMLDoc: DocumentFragment;\n testURI: string;\n testURL: string;\n items: {\n identifier: string;\n href: string;\n category: string;\n }[];\n};\n\n// Utility function to ensure package URIs end with a '/'\n// const normalizeUri = (uri: string) => (uri.endsWith('/') ? uri : `${uri}/`);\n\n// Fetches assessment data from the manifest\nexport const getManifestInfo = async (manifestURL: string): Promise<ManifestInfo> => {\n const baseURI = manifestURL.substring(0, manifestURL.lastIndexOf('/'));\n\n const test = await qtiTransformManifest()\n .load(`${manifestURL}`)\n .then(api => api.assessmentTest());\n\n const testHTMLDoc = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.htmlDoc());\n\n const items = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.items());\n\n const testURL = `${baseURI}/${test.href}`;\n const testURI = `${baseURI}/${test.href.substring(0, test.href.lastIndexOf('/'))}`;\n\n return {\n testHTMLDoc,\n testURI,\n testURL,\n items,\n testIdentifier: test.identifier\n };\n};\n\n// Fetches a single item by URI\nexport const getItemByUri = async (itemUri: string): Promise<QtiAssessmentItem> => {\n return qtiTransformItem()\n .load(itemUri)\n .promise.then(api => api.htmlDoc().firstElementChild as QtiAssessmentItem);\n};\n"],"mappings":";;;;;;;AAqBO,IAAM,kBAAkB,OAAO,gBAA+C;AACnF,QAAM,UAAU,YAAY,UAAU,GAAG,YAAY,YAAY,GAAG,CAAC;AAErE,QAAM,OAAO,MAAM,qBAAqB,EACrC,KAAK,GAAG,WAAW,EAAE,EACrB,KAAK,SAAO,IAAI,eAAe,CAAC;AAEnC,QAAM,cAAc,MAAM,iBAAiB,EACxC,KAAK,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,EAC9B,KAAK,SAAO,IAAI,QAAQ,CAAC;AAE5B,QAAM,QAAQ,MAAM,iBAAiB,EAClC,KAAK,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,EAC9B,KAAK,SAAO,IAAI,MAAM,CAAC;AAE1B,QAAM,UAAU,GAAG,OAAO,IAAI,KAAK,IAAI;AACvC,QAAM,UAAU,GAAG,OAAO,IAAI,KAAK,KAAK,UAAU,GAAG,KAAK,KAAK,YAAY,GAAG,CAAC,CAAC;AAEhF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB,KAAK;AAAA,EACvB;AACF;AAGO,IAAM,eAAe,OAAO,YAAgD;AACjF,SAAO,iBAAiB,EACrB,KAAK,OAAO,EACZ,QAAQ,KAAK,SAAO,IAAI,QAAQ,EAAE,iBAAsC;AAC7E;","names":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
qtiTransformItem,
|
|
3
|
+
qtiTransformManifest,
|
|
4
|
+
qtiTransformTest
|
|
5
|
+
} from "./chunk-NOHVLBCB.js";
|
|
6
|
+
|
|
7
|
+
// src/lib/qti-loader/qti-loader.ts
|
|
8
|
+
var getManifestInfo = async (manifestURL) => {
|
|
9
|
+
const baseURI = manifestURL.substring(0, manifestURL.lastIndexOf("/"));
|
|
10
|
+
const test = await qtiTransformManifest().load(`${manifestURL}`).then((api) => api.assessmentTest());
|
|
11
|
+
const testHTMLDoc = await qtiTransformTest().load(`${baseURI}/${test.href}`).then((api) => api.htmlDoc());
|
|
12
|
+
const items = await qtiTransformTest().load(`${baseURI}/${test.href}`).then((api) => api.items());
|
|
13
|
+
const testURL = `${baseURI}/${test.href}`;
|
|
14
|
+
const testURI = `${baseURI}/${test.href.substring(0, test.href.lastIndexOf("/"))}`;
|
|
15
|
+
return {
|
|
16
|
+
testHTMLDoc,
|
|
17
|
+
testURI,
|
|
18
|
+
testURL,
|
|
19
|
+
items,
|
|
20
|
+
testIdentifier: test.identifier
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
var getItemByUri = async (itemUri) => {
|
|
24
|
+
return qtiTransformItem().load(itemUri).then((api) => api.htmlDoc().firstElementChild);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
getManifestInfo,
|
|
29
|
+
getItemByUri
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=chunk-JFZF77EN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-loader/qti-loader.ts"],"sourcesContent":["import { qtiTransformItem, qtiTransformTest } from '../qti-transformers';\nimport { qtiTransformManifest } from '../qti-transformers/qti-transform-manifest';\n\nimport type { QtiAssessmentItem } from '../qti-components';\n\nexport type ManifestInfo = {\n testIdentifier: string;\n testHTMLDoc: DocumentFragment;\n testURI: string;\n testURL: string;\n items: {\n identifier: string;\n href: string;\n category: string;\n }[];\n};\n\n// Utility function to ensure package URIs end with a '/'\n// const normalizeUri = (uri: string) => (uri.endsWith('/') ? uri : `${uri}/`);\n\n// Fetches assessment data from the manifest\nexport const getManifestInfo = async (manifestURL: string): Promise<ManifestInfo> => {\n const baseURI = manifestURL.substring(0, manifestURL.lastIndexOf('/'));\n\n const test = await qtiTransformManifest()\n .load(`${manifestURL}`)\n .then(api => api.assessmentTest());\n\n const testHTMLDoc = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.htmlDoc());\n\n const items = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.items());\n\n const testURL = `${baseURI}/${test.href}`;\n const testURI = `${baseURI}/${test.href.substring(0, test.href.lastIndexOf('/'))}`;\n\n return {\n testHTMLDoc,\n testURI,\n testURL,\n items,\n testIdentifier: test.identifier\n };\n};\n\n// Fetches a single item by URI\nexport const getItemByUri = async (itemUri: string): Promise<QtiAssessmentItem> => {\n return qtiTransformItem()\n .load(itemUri)\n .then(api => api.htmlDoc().firstElementChild as QtiAssessmentItem);\n};\n"],"mappings":";;;;;;;AAqBO,IAAM,kBAAkB,OAAO,gBAA+C;AACnF,QAAM,UAAU,YAAY,UAAU,GAAG,YAAY,YAAY,GAAG,CAAC;AAErE,QAAM,OAAO,MAAM,qBAAqB,EACrC,KAAK,GAAG,WAAW,EAAE,EACrB,KAAK,SAAO,IAAI,eAAe,CAAC;AAEnC,QAAM,cAAc,MAAM,iBAAiB,EACxC,KAAK,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,EAC9B,KAAK,SAAO,IAAI,QAAQ,CAAC;AAE5B,QAAM,QAAQ,MAAM,iBAAiB,EAClC,KAAK,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,EAC9B,KAAK,SAAO,IAAI,MAAM,CAAC;AAE1B,QAAM,UAAU,GAAG,OAAO,IAAI,KAAK,IAAI;AACvC,QAAM,UAAU,GAAG,OAAO,IAAI,KAAK,KAAK,UAAU,GAAG,KAAK,KAAK,YAAY,GAAG,CAAC,CAAC;AAEhF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB,KAAK;AAAA,EACvB;AACF;AAGO,IAAM,eAAe,OAAO,YAAgD;AACjF,SAAO,iBAAiB,EACrB,KAAK,OAAO,EACZ,KAAK,SAAO,IAAI,QAAQ,EAAE,iBAAsC;AACrE;","names":[]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {
|
|
2
|
+
btn,
|
|
3
|
+
dis
|
|
4
|
+
} from "./chunk-5ZHHNEDA.js";
|
|
5
|
+
import {
|
|
6
|
+
computedContext
|
|
7
|
+
} from "./chunk-G3TG4ADZ.js";
|
|
8
|
+
import {
|
|
9
|
+
__decorateClass
|
|
10
|
+
} from "./chunk-H2JE6IVU.js";
|
|
11
|
+
|
|
12
|
+
// src/lib/qti-test/components/test-show-correct-response.ts
|
|
13
|
+
import { css, html, LitElement } from "lit";
|
|
14
|
+
import { customElement, property } from "lit/decorators.js";
|
|
15
|
+
import { consume } from "@lit/context";
|
|
16
|
+
var TestShowCorrectResponse = class extends LitElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.shown = false;
|
|
20
|
+
this.disabled = false;
|
|
21
|
+
this.showCorrectText = "Show correct response";
|
|
22
|
+
this.hideCorrectText = "Hide correct response";
|
|
23
|
+
this.noCorrectResponseText = "No correct response specified";
|
|
24
|
+
}
|
|
25
|
+
// Store previous active item reference
|
|
26
|
+
willUpdate(_changedProperties) {
|
|
27
|
+
const activeItem = this.computedContext?.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items)).find((item) => item.active);
|
|
28
|
+
if (this._previousActiveItem !== activeItem) {
|
|
29
|
+
this.shown = false;
|
|
30
|
+
this._previousActiveItem = activeItem;
|
|
31
|
+
}
|
|
32
|
+
if (activeItem) {
|
|
33
|
+
const containsCorrectResponse = !!activeItem?.variables?.some((v) => v["correctResponse"]);
|
|
34
|
+
const containsMapping = !!activeItem?.variables?.some((v) => {
|
|
35
|
+
return v["mapping"]?.mapEntries?.length > 0 || v["areaMapping"]?.areaMapEntries?.length > 0;
|
|
36
|
+
});
|
|
37
|
+
this.disabled = !containsCorrectResponse && !containsMapping;
|
|
38
|
+
} else {
|
|
39
|
+
this.disabled = true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
_toggleState() {
|
|
43
|
+
if (this.disabled) return;
|
|
44
|
+
this.shown = !this.shown;
|
|
45
|
+
this.dispatchEvent(
|
|
46
|
+
new CustomEvent("test-show-correct-response", {
|
|
47
|
+
detail: this.shown,
|
|
48
|
+
bubbles: true
|
|
49
|
+
})
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
_getDisplayedText() {
|
|
53
|
+
return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
return html` <div @click="${this._toggleState}">${this._getDisplayedText()}</div> `;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
TestShowCorrectResponse.styles = css`
|
|
60
|
+
:host {
|
|
61
|
+
${btn};
|
|
62
|
+
}
|
|
63
|
+
:host([disabled]) {
|
|
64
|
+
${dis};
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
__decorateClass([
|
|
68
|
+
consume({ context: computedContext, subscribe: true })
|
|
69
|
+
], TestShowCorrectResponse.prototype, "computedContext", 2);
|
|
70
|
+
__decorateClass([
|
|
71
|
+
property({ type: Boolean, reflect: true })
|
|
72
|
+
], TestShowCorrectResponse.prototype, "shown", 2);
|
|
73
|
+
__decorateClass([
|
|
74
|
+
property({ type: Boolean, reflect: true })
|
|
75
|
+
], TestShowCorrectResponse.prototype, "disabled", 2);
|
|
76
|
+
__decorateClass([
|
|
77
|
+
property({ type: String })
|
|
78
|
+
], TestShowCorrectResponse.prototype, "showCorrectText", 2);
|
|
79
|
+
__decorateClass([
|
|
80
|
+
property({ type: String })
|
|
81
|
+
], TestShowCorrectResponse.prototype, "hideCorrectText", 2);
|
|
82
|
+
__decorateClass([
|
|
83
|
+
property({ type: String })
|
|
84
|
+
], TestShowCorrectResponse.prototype, "noCorrectResponseText", 2);
|
|
85
|
+
TestShowCorrectResponse = __decorateClass([
|
|
86
|
+
customElement("test-show-correct-response")
|
|
87
|
+
], TestShowCorrectResponse);
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
TestShowCorrectResponse
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=chunk-JOQ2E6SE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-show-correct-response.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport * as styles from './styles';\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { ComputedContext } from '../../exports/computed.context';\n\n@customElement('test-show-correct-response')\nexport class TestShowCorrectResponse extends LitElement {\n @consume({ context: computedContext, subscribe: true })\n public computedContext?: ComputedContext;\n\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: Boolean, reflect: true }) shown = false;\n @property({ type: Boolean, reflect: true }) disabled = false;\n @property({ type: String }) showCorrectText = 'Show correct response';\n @property({ type: String }) hideCorrectText = 'Hide correct response';\n @property({ type: String }) noCorrectResponseText = 'No correct response specified';\n\n private _previousActiveItem?: unknown; // Store previous active item reference\n\n willUpdate(_changedProperties: Map<string | number | symbol, unknown>) {\n const activeItem = this.computedContext?.testParts\n .flatMap(testPart => testPart.sections.flatMap(section => section.items))\n .find(item => item.active);\n\n // If active item changed, reset shown before the update\n if (this._previousActiveItem !== activeItem) {\n this.shown = false;\n this._previousActiveItem = activeItem; // Update previous active item\n }\n\n if (activeItem) {\n const containsCorrectResponse = !!activeItem?.variables?.some(v => v['correctResponse']);\n const containsMapping = !!activeItem?.variables?.some(v => {\n return v['mapping']?.mapEntries?.length > 0 || v['areaMapping']?.areaMapEntries?.length > 0;\n });\n this.disabled = !containsCorrectResponse && !containsMapping;\n } else {\n this.disabled = true;\n }\n }\n private _toggleState() {\n if (this.disabled) return;\n this.shown = !this.shown;\n\n this.dispatchEvent(\n new CustomEvent('test-show-correct-response', {\n detail: this.shown,\n bubbles: true\n })\n );\n }\n\n private _getDisplayedText(): string {\n return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;\n }\n\n render() {\n return html` <div @click=\"${this._toggleState}\">${this._getDisplayedText()}</div> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-show-correct-response': TestShowCorrectResponse;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,kBAAkB;AACtC,SAAS,eAAe,gBAAgB;AACxC,SAAS,eAAe;AAQjB,IAAM,0BAAN,cAAsC,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AW,KAAK,CAAC;AAAA,GAD3C,wBAEJ;AAWqC;AAAA,EAA3C,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAb/B,wBAaiC;AACA;AAAA,EAA3C,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAd/B,wBAciC;AAChB;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAff,wBAeiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAhBf,wBAgBiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAjBf,wBAiBiB;AAjBjB,0BAAN;AAAA,EADN,cAAc,4BAA4B;AAAA,GAC9B;","names":[]}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sessionContext
|
|
3
|
+
} from "./chunk-UZ4QB5IO.js";
|
|
4
|
+
import {
|
|
5
|
+
testContext
|
|
6
|
+
} from "./chunk-CJADUWEC.js";
|
|
7
|
+
import {
|
|
8
|
+
computedContext
|
|
9
|
+
} from "./chunk-6Z5YR5U2.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.navItemId}"]`
|
|
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.navItemId}"]`
|
|
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
|
+
testParts: testPartElements.map((testPart) => {
|
|
84
|
+
const sectionElements = [...testPart.querySelectorAll(`qti-assessment-section`)];
|
|
85
|
+
return {
|
|
86
|
+
active: false,
|
|
87
|
+
identifier: testPart.identifier,
|
|
88
|
+
sections: sectionElements.map((section) => {
|
|
89
|
+
const itemElements = [...section.querySelectorAll(`qti-assessment-item-ref`)];
|
|
90
|
+
return {
|
|
91
|
+
active: false,
|
|
92
|
+
identifier: section.identifier,
|
|
93
|
+
title: section.title,
|
|
94
|
+
items: itemElements.map((item) => {
|
|
95
|
+
return {
|
|
96
|
+
active: false,
|
|
97
|
+
identifier: item.identifier,
|
|
98
|
+
href: item.href,
|
|
99
|
+
variables: []
|
|
100
|
+
};
|
|
101
|
+
})
|
|
102
|
+
};
|
|
103
|
+
})
|
|
104
|
+
};
|
|
105
|
+
})
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/* PK: on item connected we can add item only properties in the xml */
|
|
109
|
+
_handleItemConnected(event) {
|
|
110
|
+
const itemElement = event.detail;
|
|
111
|
+
this.computedContext = {
|
|
112
|
+
...this.computedContext,
|
|
113
|
+
testParts: this.computedContext.testParts.map((testPart) => {
|
|
114
|
+
return {
|
|
115
|
+
...testPart,
|
|
116
|
+
sections: testPart.sections.map((section) => {
|
|
117
|
+
return {
|
|
118
|
+
...section,
|
|
119
|
+
items: section.items.map((item) => {
|
|
120
|
+
if (item.identifier !== itemElement.parentElement.getAttribute("identifier")) {
|
|
121
|
+
return item;
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
...item,
|
|
125
|
+
assessmentItemIdentifier: itemElement.getAttribute("identifier"),
|
|
126
|
+
label: itemElement.getAttribute("label"),
|
|
127
|
+
title: itemElement.title,
|
|
128
|
+
adaptive: itemElement.adaptive == "true" || false,
|
|
129
|
+
timeDependent: itemElement.timeDependent == "true" || false,
|
|
130
|
+
variables: itemElement._context.variables
|
|
131
|
+
};
|
|
132
|
+
})
|
|
133
|
+
};
|
|
134
|
+
})
|
|
135
|
+
};
|
|
136
|
+
})
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/* PK: on every change of the candidate we will recomputed the computedContext */
|
|
140
|
+
willUpdate(_changedProperties) {
|
|
141
|
+
if (!this.computedContext) return;
|
|
142
|
+
let itemIndex = 1;
|
|
143
|
+
this.computedContext = {
|
|
144
|
+
...this.computedContext,
|
|
145
|
+
testParts: this.computedContext.testParts.map((testPart) => {
|
|
146
|
+
return {
|
|
147
|
+
...testPart,
|
|
148
|
+
active: this._sessionContext?.navPartId === testPart.identifier || false,
|
|
149
|
+
sections: testPart.sections.map((section) => {
|
|
150
|
+
return {
|
|
151
|
+
...section,
|
|
152
|
+
active: this._sessionContext?.navSectionId === section.identifier || false,
|
|
153
|
+
completed: section.items.every(
|
|
154
|
+
(item) => this._testContext.items.find((i) => i.identifier === item.identifier)?.variables.find((v) => v.identifier === "completionStatus").value === "completed"
|
|
155
|
+
),
|
|
156
|
+
items: section.items.map((item) => {
|
|
157
|
+
const itemContext = this._testContext?.items.find((i) => i.identifier === item.identifier);
|
|
158
|
+
let computedItem;
|
|
159
|
+
if (this.initContext) {
|
|
160
|
+
const initContext = this.initContext.find((i) => i.identifier === item.identifier);
|
|
161
|
+
computedItem = { ...item, ...itemContext, ...initContext };
|
|
162
|
+
} else {
|
|
163
|
+
computedItem = { ...item, ...itemContext };
|
|
164
|
+
}
|
|
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?.navItemId === computedItem.identifier || false;
|
|
171
|
+
const correct = (
|
|
172
|
+
// this._testContext.view === 'scorer' &&
|
|
173
|
+
type == "regular" && score !== void 0 && !isNaN(score) && score > 0 || false
|
|
174
|
+
);
|
|
175
|
+
const incorrect = (
|
|
176
|
+
// this._testContext.view === 'scorer' &&
|
|
177
|
+
type == "regular" && score !== void 0 && !isNaN(score) && score <= 0 || false
|
|
178
|
+
);
|
|
179
|
+
const completed = (
|
|
180
|
+
// this._testContext.view === 'candidate' &&
|
|
181
|
+
completionStatus === "completed"
|
|
182
|
+
);
|
|
183
|
+
const response = computedItem.variables?.find((v) => v.identifier === "RESPONSE")?.value || "";
|
|
184
|
+
const index = categories.includes(this.configContext?.infoItemCategory) ? null : itemIndex++;
|
|
185
|
+
const view = this._sessionContext.view;
|
|
186
|
+
return {
|
|
187
|
+
...computedItem,
|
|
188
|
+
// rawscore, // not necessary for outside world
|
|
189
|
+
// score, // not necessary for outside world
|
|
190
|
+
// completionStatus, // not necessary for outside world
|
|
191
|
+
// categories, // not necessary for outside world
|
|
192
|
+
type,
|
|
193
|
+
active,
|
|
194
|
+
correct,
|
|
195
|
+
incorrect,
|
|
196
|
+
completed,
|
|
197
|
+
index,
|
|
198
|
+
response,
|
|
199
|
+
view
|
|
200
|
+
};
|
|
201
|
+
})
|
|
202
|
+
};
|
|
203
|
+
})
|
|
204
|
+
};
|
|
205
|
+
})
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
__decorateClass([
|
|
210
|
+
property({ type: String })
|
|
211
|
+
], TestNavigation.prototype, "identifier", 2);
|
|
212
|
+
__decorateClass([
|
|
213
|
+
state()
|
|
214
|
+
], TestNavigation.prototype, "initContext", 2);
|
|
215
|
+
__decorateClass([
|
|
216
|
+
state(),
|
|
217
|
+
consume({ context: testContext, subscribe: true })
|
|
218
|
+
], TestNavigation.prototype, "_testContext", 2);
|
|
219
|
+
__decorateClass([
|
|
220
|
+
state(),
|
|
221
|
+
consume({ context: sessionContext, subscribe: true })
|
|
222
|
+
], TestNavigation.prototype, "_sessionContext", 2);
|
|
223
|
+
__decorateClass([
|
|
224
|
+
state()
|
|
225
|
+
], TestNavigation.prototype, "configContext", 2);
|
|
226
|
+
__decorateClass([
|
|
227
|
+
state(),
|
|
228
|
+
provide({ context: computedContext })
|
|
229
|
+
], TestNavigation.prototype, "computedContext", 2);
|
|
230
|
+
__decorateClass([
|
|
231
|
+
property({ type: Boolean, attribute: "auto-score-items" })
|
|
232
|
+
], TestNavigation.prototype, "autoScoreItems", 2);
|
|
233
|
+
TestNavigation = __decorateClass([
|
|
234
|
+
customElement("test-navigation")
|
|
235
|
+
], TestNavigation);
|
|
236
|
+
|
|
237
|
+
export {
|
|
238
|
+
TestNavigation
|
|
239
|
+
};
|
|
240
|
+
//# sourceMappingURL=chunk-JQBEZ43O.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 @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 protected configContext: ConfigContext = {};\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.navItemId}\"]`\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.navItemId}\"]`\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 testParts: testPartElements.map(testPart => {\n const sectionElements = [...testPart.querySelectorAll<QtiAssessmentSection>(`qti-assessment-section`)];\n return {\n active: false,\n identifier: testPart.identifier,\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(item => {\n return {\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 let computedItem;\n\n if (this.initContext) {\n const initContext = this.initContext.find(i => i.identifier === item.identifier);\n computedItem = { ...item, ...itemContext, ...initContext };\n } else {\n computedItem = { ...item, ...itemContext };\n }\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'; // rounded-full\n const active = this._sessionContext?.navItemId === computedItem.identifier || false; // !border-sky-600\n\n const correct =\n // this._testContext.view === 'scorer' &&\n (type == 'regular' && score !== undefined && !isNaN(score) && score > 0) || false; // bg-green-100 border-green-400\n const incorrect =\n // this._testContext.view === 'scorer' &&\n (type == 'regular' && score !== undefined && !isNaN(score) && score <= 0) || false; // bg-red-100 border-red-400\n const completed =\n // this._testContext.view === 'candidate' &&\n completionStatus === 'completed';\n // || item.category === this.host._configContext?.infoItemCategory || false\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 view = this._sessionContext.view;\n\n return {\n ...computedItem,\n // rawscore, // not necessary for outside world\n // score, // not necessary for outside world\n // completionStatus, // not necessary for outside world\n // categories, // not necessary for outside world\n type,\n active,\n correct,\n incorrect,\n completed,\n index,\n response,\n view\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;AAWpE,SAAU,gBAA+B,CAAC;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