@pie-element/multiple-choice 13.2.1 → 13.2.2-next.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.
Files changed (266) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/defaults.d.ts +205 -0
  4. package/dist/author/defaults.js +151 -0
  5. package/dist/author/index.d.ts +26 -0
  6. package/dist/author/index.js +119 -0
  7. package/dist/author/main.d.ts +34 -0
  8. package/dist/author/main.js +287 -0
  9. package/dist/author/utils.d.ts +9 -0
  10. package/dist/author/utils.js +7 -0
  11. package/dist/browser/_Uint8Array-CUOjhemR.js +396 -0
  12. package/dist/browser/_Uint8Array-CUOjhemR.js.map +1 -0
  13. package/dist/browser/_baseClone-fFvdZAu5.js +245 -0
  14. package/dist/browser/_baseClone-fFvdZAu5.js.map +1 -0
  15. package/dist/browser/author/index.js +40187 -0
  16. package/dist/browser/author/index.js.map +1 -0
  17. package/dist/browser/controller/index.js +199 -0
  18. package/dist/browser/controller/index.js.map +1 -0
  19. package/dist/browser/debounce-PkR6OuzU.js +9669 -0
  20. package/dist/browser/debounce-PkR6OuzU.js.map +1 -0
  21. package/dist/browser/delivery/index.js +250 -0
  22. package/dist/browser/delivery/index.js.map +1 -0
  23. package/dist/browser/isEqual-CnAlrBXo.js +182 -0
  24. package/dist/browser/isEqual-CnAlrBXo.js.map +1 -0
  25. package/dist/browser/isObject-B-uKF3Sg.js +38 -0
  26. package/dist/browser/isObject-B-uKF3Sg.js.map +1 -0
  27. package/dist/browser/main-CmP4Uwst.js +2440 -0
  28. package/dist/browser/main-CmP4Uwst.js.map +1 -0
  29. package/dist/browser/multiple-choice.css +2 -0
  30. package/dist/browser/print/index.js +48 -0
  31. package/dist/browser/print/index.js.map +1 -0
  32. package/dist/controller/defaults.d.ts +35 -0
  33. package/dist/controller/defaults.js +29 -0
  34. package/dist/controller/index.d.ts +65 -0
  35. package/dist/controller/index.js +124 -0
  36. package/dist/controller/utils.d.ts +10 -0
  37. package/dist/controller/utils.js +8 -0
  38. package/dist/delivery/choice-input.d.ts +44 -0
  39. package/dist/delivery/choice-input.js +272 -0
  40. package/dist/delivery/choice.d.ts +20 -0
  41. package/dist/delivery/choice.js +105 -0
  42. package/dist/delivery/feedback-tick.d.ts +20 -0
  43. package/dist/delivery/feedback-tick.js +104 -0
  44. package/dist/delivery/index.d.ts +37 -0
  45. package/dist/delivery/index.js +214 -0
  46. package/dist/delivery/main.d.ts +31 -0
  47. package/dist/delivery/main.js +51 -0
  48. package/dist/delivery/multiple-choice.d.ts +61 -0
  49. package/dist/delivery/multiple-choice.js +244 -0
  50. package/dist/delivery/session-updater.d.ts +10 -0
  51. package/dist/delivery/session-updater.js +9 -0
  52. package/dist/index.d.ts +1 -0
  53. package/dist/index.iife.d.ts +8 -0
  54. package/dist/index.iife.js +148 -0
  55. package/dist/index.js +2 -0
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +6 -0
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +16 -0
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +16 -0
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +6 -0
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +16 -0
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +6 -0
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +6 -0
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +11 -0
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +14 -0
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +5 -0
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +6 -0
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +12 -0
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +7 -0
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +10 -0
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +7 -0
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +7 -0
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignMergeValue.js +8 -0
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +10 -0
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +8 -0
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +8 -0
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +8 -0
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +12 -0
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +57 -0
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +14 -0
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +5 -0
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +9 -0
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +8 -0
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +9 -0
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +11 -0
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +9 -0
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +12 -0
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +13 -0
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMerge.js +19 -0
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMergeDeep.js +31 -0
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +9 -0
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +14 -0
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +7 -0
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js +8 -0
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +8 -0
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +6 -0
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +10 -0
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +8 -0
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +8 -0
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +8 -0
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +8 -0
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +14 -0
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +8 -0
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +5 -0
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createAssigner.js +15 -0
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +12 -0
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +10 -0
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +35 -0
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +35 -0
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +32 -0
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +9 -0
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +8 -0
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +9 -0
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +5 -0
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +10 -0
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +23 -0
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +6 -0
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +7 -0
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +7 -0
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +13 -0
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +9 -0
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +9 -0
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +8 -0
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +33 -0
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +9 -0
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +8 -0
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +12 -0
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +7 -0
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +11 -0
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +8 -0
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +6 -0
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +9 -0
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +8 -0
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +7 -0
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +8 -0
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +13 -0
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +7 -0
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +7 -0
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +8 -0
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +9 -0
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +5 -0
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +5 -0
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +9 -0
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +8 -0
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +13 -0
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_safeGet.js +6 -0
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +7 -0
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +6 -0
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +9 -0
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +6 -0
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +14 -0
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +7 -0
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +7 -0
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +6 -0
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +6 -0
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +16 -0
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +15 -0
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js +8 -0
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +8 -0
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +8 -0
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/debounce.js +50 -0
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +16 -0
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +6 -0
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +6 -0
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +10 -0
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +4 -0
  183. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +8 -0
  184. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js +8 -0
  185. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +6 -0
  186. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +21 -0
  187. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +7 -0
  188. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +11 -0
  189. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +7 -0
  190. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +7 -0
  191. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
  192. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
  193. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isPlainObject.js +14 -0
  194. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +7 -0
  195. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +9 -0
  196. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +7 -0
  197. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +9 -0
  198. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +9 -0
  199. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/merge.js +8 -0
  200. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/now.js +7 -0
  201. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +6 -0
  202. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +6 -0
  203. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js +19 -0
  204. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toPlainObject.js +8 -0
  205. package/dist/print/index.d.ts +15 -0
  206. package/dist/print/index.js +44 -0
  207. package/package.json +82 -25
  208. package/CHANGELOG.json +0 -1972
  209. package/CHANGELOG.md +0 -2720
  210. package/LICENSE.md +0 -5
  211. package/PRINT.md +0 -35
  212. package/README.md +0 -56
  213. package/choice.png +0 -0
  214. package/configure/CHANGELOG.json +0 -1387
  215. package/configure/CHANGELOG.md +0 -2068
  216. package/configure/lib/defaults.js +0 -203
  217. package/configure/lib/defaults.js.map +0 -1
  218. package/configure/lib/index.js +0 -202
  219. package/configure/lib/index.js.map +0 -1
  220. package/configure/lib/main.js +0 -484
  221. package/configure/lib/main.js.map +0 -1
  222. package/configure/lib/utils.js +0 -18
  223. package/configure/lib/utils.js.map +0 -1
  224. package/configure/package.json +0 -22
  225. package/controller/CHANGELOG.json +0 -527
  226. package/controller/CHANGELOG.md +0 -1405
  227. package/controller/lib/defaults.js +0 -33
  228. package/controller/lib/defaults.js.map +0 -1
  229. package/controller/lib/index.js +0 -288
  230. package/controller/lib/index.js.map +0 -1
  231. package/controller/lib/utils.js +0 -15
  232. package/controller/lib/utils.js.map +0 -1
  233. package/controller/package.json +0 -15
  234. package/docs/config-schema.json +0 -2993
  235. package/docs/config-schema.json.md +0 -2217
  236. package/docs/demo/config.js +0 -8
  237. package/docs/demo/generate.js +0 -61
  238. package/docs/demo/index.html +0 -1
  239. package/docs/demo/session.js +0 -7
  240. package/docs/pie-schema.json +0 -1332
  241. package/docs/pie-schema.json.md +0 -1015
  242. package/lib/choice-input.js +0 -374
  243. package/lib/choice-input.js.map +0 -1
  244. package/lib/choice.js +0 -192
  245. package/lib/choice.js.map +0 -1
  246. package/lib/feedback-tick.js +0 -134
  247. package/lib/feedback-tick.js.map +0 -1
  248. package/lib/index.js +0 -402
  249. package/lib/index.js.map +0 -1
  250. package/lib/main.js +0 -63
  251. package/lib/main.js.map +0 -1
  252. package/lib/multiple-choice.js +0 -397
  253. package/lib/multiple-choice.js.map +0 -1
  254. package/lib/print.js +0 -94
  255. package/lib/print.js.map +0 -1
  256. package/lib/session-updater.js +0 -37
  257. package/lib/session-updater.js.map +0 -1
  258. package/module/configure.js +0 -1
  259. package/module/controller.js +0 -3045
  260. package/module/demo.js +0 -86
  261. package/module/element.js +0 -1
  262. package/module/index.html +0 -21
  263. package/module/manifest.json +0 -14
  264. package/module/print-demo.js +0 -124
  265. package/module/print.html +0 -18
  266. package/module/print.js +0 -1
@@ -0,0 +1,48 @@
1
+ import { Gt as e, I as t, t as n, z as r } from "../debounce-PkR6OuzU.js";
2
+ import { t as i } from "../main-CmP4Uwst.js";
3
+ import { t as a } from "../_baseClone-fFvdZAu5.js";
4
+ import o from "react";
5
+ import { createRoot as s } from "react-dom/client";
6
+ //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js
7
+ var c = 1, l = 4;
8
+ function u(e) {
9
+ return a(e, c | l);
10
+ }
11
+ var d = (0, (/* @__PURE__ */ e(r(), 1)).default)("pie-element:multiple-choice:print"), f = (e, t) => {
12
+ let n = t.role === "instructor";
13
+ return e.prompt = e.promptEnabled === !1 ? void 0 : e.prompt, e.teacherInstructions = n && e.teacherInstructionsEnabled !== !1 ? e.teacherInstructions : void 0, e.showTeacherInstructions = n, e.alwaysShowCorrect = n, e.mode = n ? "evaluate" : e.mode, e.disabled = !0, e.animationsDisabled = !0, e.lockChoiceOrder = !0, e.choicesLayout = e.choicesLayout || "vertical", e.choices = u(e.choices).map((t) => (t.rationale = n && e.rationaleEnabled !== !1 ? t.rationale : void 0, t.hideTick = n, t.feedback = void 0, t)), e.keyMode = e.choicePrefix || "letters", e;
14
+ }, p = class extends HTMLElement {
15
+ constructor() {
16
+ super(), this._options = null, this._model = null, this._session = [], this._root = null, this._rerender = n(() => {
17
+ if (this._model && this._session) {
18
+ let e = f(this._model, this._options), n = this._options && o.createElement(i, {
19
+ model: e,
20
+ session: {},
21
+ options: this._options
22
+ });
23
+ this._root ||= s(this), this._root.render(n), requestAnimationFrame(() => {
24
+ requestAnimationFrame(() => {
25
+ d("render complete - render math"), t(this);
26
+ });
27
+ });
28
+ } else d("skip");
29
+ }, 50, {
30
+ leading: !1,
31
+ trailing: !0
32
+ });
33
+ }
34
+ set options(e) {
35
+ this._options = e;
36
+ }
37
+ set model(e) {
38
+ this._model = e, this._rerender();
39
+ }
40
+ connectedCallback() {}
41
+ disconnectedCallback() {
42
+ this._root && this._root.unmount();
43
+ }
44
+ };
45
+ //#endregion
46
+ export { p as default };
47
+
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js","../../../src/print/index.tsx"],"sourcesContent":["import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multiple-choice/src/print.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { cloneDeep, debounce } from 'lodash-es';\nimport Main from '../delivery/main.js';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\nimport debug from 'debug';\n\nconst log = debug('pie-element:multiple-choice:print');\n\n/**\n * Live in same package as main element - so we can access some of the shared comps!\n *\n * - update pslb to build print if src/print.js is there\n * - update demo el\n * - get configure/controller building\n */\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n\n model.prompt = model.promptEnabled !== false ? model.prompt : undefined;\n model.teacherInstructions =\n instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;\n model.showTeacherInstructions = instr;\n model.alwaysShowCorrect = instr;\n model.mode = instr ? 'evaluate' : model.mode;\n\n model.disabled = true;\n model.animationsDisabled = true;\n model.lockChoiceOrder = true;\n model.choicesLayout = model.choicesLayout || 'vertical';\n\n const choices = cloneDeep(model.choices);\n\n model.choices = choices.map((c) => {\n c.rationale = instr && model.rationaleEnabled !== false ? c.rationale : undefined;\n c.hideTick = instr;\n c.feedback = undefined;\n return c;\n });\n\n model.keyMode = model.choicePrefix || 'letters';\n\n return model;\n};\n\nexport default class MultipleChoicePrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._root = null;\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element =\n this._options &&\n React.createElement(Main, {\n model: printModel,\n session: {},\n options: this._options,\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n // Use double requestAnimationFrame so React has committed to the DOM before we render math\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n log('render complete - render math');\n renderMath(this);\n });\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n set options(o) {\n this._options = o;\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n }\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;AAGA,IAAI,IAAkB,GAClB,IAAqB;AAoBzB,SAAS,EAAU,GAAO;CACxB,OAAO,EAAU,GAAO,IAAkB,CAAkB;AAC9D;ACTA,IAAM,KAAA,IAAA,wBAAA,GAAA,SAAY,mCAAmC,GAU/C,KAAqB,GAAO,MAAS;CACzC,IAAM,IAAQ,EAAK,SAAS;CAyB5B,OAvBA,EAAM,SAAS,EAAM,kBAAkB,KAAuB,KAAA,IAAf,EAAM,QACrD,EAAM,sBACJ,KAAS,EAAM,+BAA+B,KAAQ,EAAM,sBAAsB,KAAA,GACpF,EAAM,0BAA0B,GAChC,EAAM,oBAAoB,GAC1B,EAAM,OAAO,IAAQ,aAAa,EAAM,MAExC,EAAM,WAAW,IACjB,EAAM,qBAAqB,IAC3B,EAAM,kBAAkB,IACxB,EAAM,gBAAgB,EAAM,iBAAiB,YAI7C,EAAM,UAFU,EAAU,EAAM,OAEhB,EAAQ,KAAK,OAC3B,EAAE,YAAY,KAAS,EAAM,qBAAqB,KAAQ,EAAE,YAAY,KAAA,GACxE,EAAE,WAAW,GACb,EAAE,WAAW,KAAA,GACN,EACR,GAED,EAAM,UAAU,EAAM,gBAAgB,WAE/B;AACT,GAEqB,IAArB,cAAiD,YAAY;CAC3D,cAAc;EAMZ,AALA,MAAM,GACN,KAAK,WAAW,MAChB,KAAK,SAAS,MACd,KAAK,WAAW,CAAC,GACjB,KAAK,QAAQ,MACb,KAAK,YAAY,QACT;GACJ,IAAI,KAAK,UAAU,KAAK,UAAU;IAChC,IAAM,IAAa,EAAkB,KAAK,QAAQ,KAAK,QAAQ,GAEzD,IACJ,KAAK,YACL,EAAM,cAAc,GAAM;KACxB,OAAO;KACP,SAAS,CAAC;KACV,SAAS,KAAK;IAChB,CAAC;IAOH,AALA,AACE,KAAK,UAAQ,EAAW,IAAI,GAE9B,KAAK,MAAM,OAAO,CAAO,GAEzB,4BAA4B;KAC1B,4BAA4B;MAE1B,AADA,EAAI,+BAA+B,GACnC,EAAW,IAAI;KACjB,CAAC;IACH,CAAC;GACH,OACE,EAAI,MAAM;EAEd,GACA,IACA;GAAE,SAAS;GAAO,UAAU;EAAK,CACnC;CACF;CACA,IAAI,QAAQ,GAAG;EACb,KAAK,WAAW;CAClB;CAEA,IAAI,MAAM,GAAG;EAEX,AADA,KAAK,SAAS,GACd,KAAK,UAAU;CACjB;CAEA,oBAAoB,CAAC;CAErB,uBAAuB;EACrB,AAAI,KAAK,SACP,KAAK,MAAM,QAAQ;CAEvB;AACF"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/multiple-choice/controller/src/defaults.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ declare const _default: {
10
+ choiceMode: string;
11
+ choicePrefix: string;
12
+ choices: never[];
13
+ choicesLayout: string;
14
+ feedbackEnabled: boolean;
15
+ gridColumns: number;
16
+ lockChoiceOrder: boolean;
17
+ partialScoring: boolean;
18
+ prompt: string;
19
+ promptEnabled: boolean;
20
+ rationale: string;
21
+ rationaleEnabled: boolean;
22
+ scoringType: string;
23
+ studentInstructionsEnabled: boolean;
24
+ teacherInstructions: string;
25
+ teacherInstructionsEnabled: boolean;
26
+ toolbarEditorPosition: string;
27
+ selectedAnswerBackgroundColor: string;
28
+ selectedAnswerStrokeColor: string;
29
+ selectedAnswerStrokeWidth: string;
30
+ hoverAnswerBackgroundColor: string;
31
+ hoverAnswerStrokeColor: string;
32
+ hoverAnswerStrokeWidth: string;
33
+ keyboardEventsEnabled: boolean;
34
+ };
35
+ export default _default;
@@ -0,0 +1,29 @@
1
+ //#region src/controller/defaults.ts
2
+ var e = {
3
+ choiceMode: "checkbox",
4
+ choicePrefix: "letters",
5
+ choices: [],
6
+ choicesLayout: "vertical",
7
+ feedbackEnabled: !1,
8
+ gridColumns: 2,
9
+ lockChoiceOrder: !0,
10
+ partialScoring: !0,
11
+ prompt: "",
12
+ promptEnabled: !0,
13
+ rationale: "",
14
+ rationaleEnabled: !0,
15
+ scoringType: "auto",
16
+ studentInstructionsEnabled: !0,
17
+ teacherInstructions: "",
18
+ teacherInstructionsEnabled: !0,
19
+ toolbarEditorPosition: "bottom",
20
+ selectedAnswerBackgroundColor: "initial",
21
+ selectedAnswerStrokeColor: "initial",
22
+ selectedAnswerStrokeWidth: "initial",
23
+ hoverAnswerBackgroundColor: "initial",
24
+ hoverAnswerStrokeColor: "initial",
25
+ hoverAnswerStrokeWidth: "initial",
26
+ keyboardEventsEnabled: !1
27
+ };
28
+ //#endregion
29
+ export { e as default };
@@ -0,0 +1,65 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/multiple-choice/controller/src/index.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ export declare function createDefaultModel(model?: {}): Promise<unknown>;
10
+ export declare const normalize: (question: any) => any;
11
+ /**
12
+ *
13
+ * @param {*} question
14
+ * @param {*} session
15
+ * @param {*} env
16
+ * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.
17
+ */
18
+ export declare function model(question: any, session: any, env: any, updateSession: any): Promise<{
19
+ disabled: boolean;
20
+ mode: any;
21
+ prompt: any;
22
+ choicesLayout: any;
23
+ gridColumns: any;
24
+ choiceMode: any;
25
+ keyMode: any;
26
+ choices: any;
27
+ responseCorrect: any;
28
+ language: any;
29
+ extraCSSRules: any;
30
+ fontSizeFactor: any;
31
+ isSelectionButtonBelow: any;
32
+ selectedAnswerBackgroundColor: any;
33
+ selectedAnswerStrokeColor: any;
34
+ selectedAnswerStrokeWidth: any;
35
+ hoverAnswerBackgroundColor: any;
36
+ hoverAnswerStrokeColor: any;
37
+ hoverAnswerStrokeWidth: any;
38
+ minSelections: any;
39
+ maxSelections: any;
40
+ keyboardEventsEnabled: any;
41
+ autoplayAudioEnabled: any;
42
+ completeAudioEnabled: any;
43
+ customAudioButton: any;
44
+ }>;
45
+ export declare const getScore: (config: any, session: any) => number;
46
+ /**
47
+ * Generates detailed trace log for scoring evaluation
48
+ * @param {Object} model - the question model
49
+ * @param {Object} session - the student session
50
+ * @param {Object} env - the environment
51
+ * @returns {Array} traceLog - array of trace messages
52
+ */
53
+ export declare const getLogTrace: (model: any, session: any, env: any) => string[];
54
+ /**
55
+ *
56
+ * The score is partial by default for checkbox mode, allOrNothing for radio mode.
57
+ * To disable partial scoring for checkbox mode you either set model.partialScoring = false or env.partialScoring = false. the value in `env` will
58
+ * override the value in `model`.
59
+ * @param {Object} model - the main model
60
+ * @param {*} session
61
+ * @param {Object} env
62
+ */
63
+ export declare function outcome(model: any, session: any, env: any): Promise<unknown>;
64
+ export declare const createCorrectResponseSession: (question: any, env: any) => Promise<unknown>;
65
+ export declare const validate: (model?: {}, config?: {}) => {};
@@ -0,0 +1,124 @@
1
+ import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js";
2
+ import { isResponseCorrect as t } from "./utils.js";
3
+ import n from "./defaults.js";
4
+ import { getShuffledChoices as r, lockChoices as i, partialScoring as a } from "@pie-element/shared-controller-utils";
5
+ //#region src/controller/index.ts
6
+ var o = (e, t, n) => (r) => {
7
+ let { role: i, mode: a } = t || {}, o = {
8
+ label: r.label,
9
+ value: r.value
10
+ };
11
+ if (i === "instructor" && (a === "view" || a === "evaluate") ? o.rationale = e.rationaleEnabled ? r.rationale : null : o.rationale = null, a === "evaluate" && (o.correct = !!r.correct, e.feedbackEnabled)) {
12
+ let e = r.feedback && r.feedback.type || "none";
13
+ e === "default" ? o.feedback = n[r.correct ? "correct" : "incorrect"] : e === "custom" && (o.feedback = r.feedback.value);
14
+ }
15
+ return o;
16
+ };
17
+ function s(e = {}) {
18
+ return new Promise((t) => t({
19
+ ...n,
20
+ ...e
21
+ }));
22
+ }
23
+ var c = (e) => {
24
+ let { verticalMode: t, choicesLayout: r, ...i } = e || {};
25
+ return {
26
+ ...n,
27
+ ...i,
28
+ choicesLayout: r || t === !1 && "horizontal" || n.choicesLayout
29
+ };
30
+ };
31
+ async function l(e, n, a, s) {
32
+ let l = c(e), u = Object.assign({
33
+ correct: "Correct",
34
+ incorrect: "Incorrect"
35
+ }, l.defaultFeedback), d = (l.choices || []).map(o(l, a, u));
36
+ i(l, n, a) || (d = await r(d, n, s, "value"));
37
+ let f = {
38
+ disabled: a.mode !== "gather",
39
+ mode: a.mode,
40
+ prompt: l.promptEnabled ? l.prompt : null,
41
+ choicesLayout: l.choicesLayout,
42
+ gridColumns: l.gridColumns,
43
+ choiceMode: l.choiceMode,
44
+ keyMode: l.choicePrefix,
45
+ choices: d,
46
+ responseCorrect: a.mode === "evaluate" ? t(l, n) : void 0,
47
+ language: l.language,
48
+ extraCSSRules: l.extraCSSRules,
49
+ fontSizeFactor: l.fontSizeFactor,
50
+ isSelectionButtonBelow: l.isSelectionButtonBelow,
51
+ selectedAnswerBackgroundColor: l.selectedAnswerBackgroundColor || "initial",
52
+ selectedAnswerStrokeColor: l.selectedAnswerStrokeColor || "initial",
53
+ selectedAnswerStrokeWidth: l.selectedAnswerStrokeWidth || "initial",
54
+ hoverAnswerBackgroundColor: l.hoverAnswerBackgroundColor || "initial",
55
+ hoverAnswerStrokeColor: l.hoverAnswerStrokeColor || "initial",
56
+ hoverAnswerStrokeWidth: l.hoverAnswerStrokeWidth || "initial",
57
+ minSelections: l.minSelections,
58
+ maxSelections: l.maxSelections,
59
+ keyboardEventsEnabled: l.keyboardEventsEnabled,
60
+ autoplayAudioEnabled: l.autoplayAudioEnabled,
61
+ completeAudioEnabled: l.completeAudioEnabled,
62
+ customAudioButton: l.customAudioButton
63
+ }, { role: p, mode: m } = a || {};
64
+ return p === "instructor" && (m === "view" || m === "evaluate") ? f.teacherInstructions = l.teacherInstructionsEnabled ? l.teacherInstructions : null : f.teacherInstructions = null, f;
65
+ }
66
+ var u = (t, n) => {
67
+ if (!n || e(n)) return 0;
68
+ let r = n.value || [], i = (t.choices || []).filter((e) => e.correct), a = r.reduce((e, t) => e + +!!i.find((e) => e.value === t), 0);
69
+ i.length < r.length && (a -= r.length - i.length, a < 0 && (a = 0));
70
+ let o = i.length ? a / i.length : 0;
71
+ return parseFloat(o.toFixed(2));
72
+ }, d = (e, t, n) => {
73
+ let r = [], i = t?.value || [], o = e.choiceMode === "radio" ? "multiple-choice (radio)" : "multiple-select (checkbox)";
74
+ r.push(`Question type: ${o}.`), i.length ? r.push(`Student selected ${i.length} answer(s): ${i.join(", ")}.`) : r.push("Student did not select any answers.");
75
+ let s = (e.choices || []).filter((e) => e.correct), c = s.map((e) => e.value);
76
+ if (r.push(`${s.length} correct answer(s) are defined for this question.`), i.length) {
77
+ let e = i.filter((e) => c.includes(e)), t = i.filter((e) => !c.includes(e));
78
+ r.push(`Student selected ${e.length} correct and ${t.length} incorrect answer(s).`);
79
+ }
80
+ let l = a.enabled(e, n) && e.choiceMode !== "radio" ? "partial scoring" : "all-or-nothing scoring";
81
+ r.push(`Score calculated using ${l}.`);
82
+ let d = u(e, t);
83
+ return r.push(`Final score: ${d}.`), r;
84
+ };
85
+ function f(t, n, r) {
86
+ return new Promise((i) => {
87
+ if (!n || e(n)) i({
88
+ score: 0,
89
+ empty: !0,
90
+ traceLog: ["Student did not select any answers. Score is 0."]
91
+ });
92
+ else {
93
+ let e = d(t, n, r), o = u(t, n);
94
+ i({
95
+ score: a.enabled(t, r) && t.choiceMode !== "radio" ? o : +(o === 1),
96
+ empty: !1,
97
+ traceLog: e
98
+ });
99
+ }
100
+ });
101
+ }
102
+ var p = (e, t) => new Promise((n) => {
103
+ if (t.mode !== "evaluate" && t.role === "instructor") {
104
+ let { choices: t } = e || { choices: [] };
105
+ n({
106
+ id: "1",
107
+ value: t.filter((e) => e.correct).map((e) => e.value)
108
+ });
109
+ } else n(null);
110
+ }), m = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), h = (t = {}, n = {}) => {
111
+ let { choices: r } = t, { minAnswerChoices: i = 2, maxAnswerChoices: a } = n, o = [...r || []].reverse(), s = {}, c = {}, l = {};
112
+ ["teacherInstructions", "prompt"].forEach((e) => {
113
+ n[e]?.required && !m(t[e]) && (l[e] = "This field is required.");
114
+ });
115
+ let u = !1;
116
+ o.forEach((e, t) => {
117
+ let { correct: r, value: i, label: a, rationale: l } = e;
118
+ r && (u = !0), m(a) ? o.slice(t + 1).some((e) => e.label === a) && (s[i] = "Content should be unique.") : s[i] = "Content should not be empty.", n.rationale?.required && !m(l) && (c[i] = "This field is required.");
119
+ });
120
+ let d = (r || []).length;
121
+ return d < i ? l.answerChoices = `There should be at least ${i} choices defined.` : d > a && (l.answerChoices = `No more than ${a} choices should be defined.`), u || (l.correctResponse = "No correct response defined."), e(s) || (l.choices = s), e(c) || (l.rationale = c), l;
122
+ };
123
+ //#endregion
124
+ export { p as createCorrectResponseSession, s as createDefaultModel, d as getLogTrace, u as getScore, l as model, c as normalize, f as outcome, h as validate };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/multiple-choice/controller/src/utils.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ export declare const getCorrectResponse: (choices: any) => any;
10
+ export declare const isResponseCorrect: (question: any, session: any) => any;
@@ -0,0 +1,8 @@
1
+ import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js";
2
+ //#region src/controller/utils.ts
3
+ var t = (e) => e.filter((e) => e.correct).map((e) => e.value).sort(), n = (n, r) => {
4
+ let i = t(n.choices);
5
+ return r && e((r.value || []).sort(), i);
6
+ };
7
+ //#endregion
8
+ export { n as isResponseCorrect };
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/multiple-choice/src/choice-input.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare const StyledFormControlLabel: any;
12
+ export declare const StyledCheckbox: (props: any) => React.JSX.Element;
13
+ export declare const StyledRadio: (props: any) => React.JSX.Element;
14
+ export declare class ChoiceInput extends React.Component {
15
+ static propTypes: {
16
+ choiceMode: PropTypes.Requireable<string>;
17
+ displayKey: PropTypes.Requireable<string>;
18
+ checked: PropTypes.Validator<boolean>;
19
+ correctness: PropTypes.Requireable<string>;
20
+ disabled: PropTypes.Validator<boolean>;
21
+ feedback: PropTypes.Requireable<string>;
22
+ label: PropTypes.Validator<string>;
23
+ rationale: PropTypes.Requireable<string>;
24
+ onChange: PropTypes.Validator<(...args: any[]) => any>;
25
+ value: PropTypes.Validator<string>;
26
+ className: PropTypes.Requireable<string>;
27
+ tagName: PropTypes.Requireable<string>;
28
+ hideTick: PropTypes.Requireable<boolean>;
29
+ isEvaluateMode: PropTypes.Requireable<boolean>;
30
+ choicesLayout: PropTypes.Requireable<string>;
31
+ isSelectionButtonBelow: PropTypes.Requireable<boolean>;
32
+ };
33
+ static defaultProps: {
34
+ rationale: null;
35
+ checked: boolean;
36
+ isEvaluateMode: boolean;
37
+ };
38
+ constructor(props: any);
39
+ onToggleChoice(event: any): void;
40
+ generateChoiceId(): string;
41
+ handleKeyDown: any;
42
+ render(): React.JSX.Element;
43
+ }
44
+ export default ChoiceInput;
@@ -0,0 +1,272 @@
1
+ import e from "./feedback-tick.js";
2
+ import t from "react";
3
+ import n from "prop-types";
4
+ import * as r from "@pie-lib/render-ui";
5
+ import { Feedback as i, PreviewPrompt as a, color as o } from "@pie-lib/render-ui";
6
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
7
+ import u from "classnames";
8
+ import { styled as d } from "@mui/material/styles";
9
+ import f from "@mui/material/Box";
10
+ import p from "@mui/material/FormControlLabel";
11
+ import m from "@mui/material/Checkbox";
12
+ import h from "@mui/material/Radio";
13
+ //#region src/delivery/choice-input.tsx
14
+ function g(e) {
15
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
16
+ }
17
+ function _(e, t) {
18
+ return !e || g(e) ? e : g(e.default) ? e.default : t && g(e[t]) ? e[t] : t && g(e[t]?.default) ? e[t].default : e;
19
+ }
20
+ var v = _(a, "PreviewPrompt") || _(S.PreviewPrompt, "PreviewPrompt"), y = _(i, "Feedback") || _(S.Feedback, "Feedback"), b = r, x = b.default, S = x && typeof x == "object" ? x : b, C = "multiple-choice-component", w = d(f)({
21
+ display: "flex",
22
+ alignItems: "center",
23
+ backgroundColor: o.background()
24
+ }), T = d(f)({
25
+ display: "flex",
26
+ alignItems: "center",
27
+ backgroundColor: o.background(),
28
+ flex: 1,
29
+ "& .MuiFormControlLabel-root": { marginLeft: "-14px" },
30
+ "& label": {
31
+ color: o.text(),
32
+ "& > span": { fontSize: "inherit" },
33
+ "& > .MuiButtonBase-root": { padding: "12px" }
34
+ }
35
+ }), E = d("span")(({ theme: e }) => ({
36
+ display: "flex",
37
+ alignItems: "center",
38
+ "& > span": { marginLeft: `-${e.spacing(1)}` }
39
+ })), D = d("span")({
40
+ position: "absolute",
41
+ left: "-10000px",
42
+ top: "auto",
43
+ width: "1px",
44
+ height: "1px",
45
+ overflow: "hidden"
46
+ }), O = d(p)({
47
+ "& .MuiFormControlLabel-label": {
48
+ color: `${o.text()} !important`,
49
+ backgroundColor: o.background(),
50
+ letterSpacing: "normal"
51
+ },
52
+ "&.Mui-disabled *": { cursor: "not-allowed !important" }
53
+ }), k = (e, t) => ({ [`&.${C}`]: { color: `var(--choice-input-${e}, ${t}) !important` } }), A = (e) => {
54
+ let t = (t) => e ? `${e}-${t}` : t;
55
+ return {
56
+ [t("root")]: {
57
+ ...k("color", o.text()),
58
+ ...e ? {} : { "&:hover": { color: `${o.primaryLight()} !important` } },
59
+ ...e === "correct" ? k("correct-color", o.text()) : {},
60
+ ...e === "incorrect" ? k("incorrect-color", o.incorrect()) : {}
61
+ },
62
+ [t("checked")]: {
63
+ ...e === "correct" ? k("correct-selected-color", o.correct()) : {},
64
+ ...e === "incorrect" ? k("incorrect-checked", o.incorrect()) : {},
65
+ ...e ? {} : k("selected-color", o.primary())
66
+ },
67
+ [t("disabled")]: {
68
+ ...k("disabled-color", o.text()),
69
+ ...e === "correct" ? k("correct-disabled-color", o.disabled()) : {},
70
+ ...e === "incorrect" ? k("incorrect-disabled-color", o.disabled()) : {},
71
+ opacity: .6,
72
+ cursor: "not-allowed !important",
73
+ pointerEvents: "initial !important"
74
+ },
75
+ focusVisibleUnchecked: {
76
+ outline: `2px solid ${o.keyBoardFocusIndicator()}`,
77
+ backgroundColor: "transparent"
78
+ },
79
+ focusVisibleChecked: {
80
+ outline: `2px solid ${o.keyBoardFocusIndicator()}`,
81
+ backgroundColor: "transparent"
82
+ }
83
+ };
84
+ }, j = d(m, { shouldForwardProp: (e) => e !== "correctness" })(({ correctness: e }) => {
85
+ let t = A(e), n = (t) => e ? `${e}-${t}` : t;
86
+ return {
87
+ [`&.${C}`]: {
88
+ ...t[n("root")],
89
+ "&.Mui-checked": t[n("checked")],
90
+ "&.Mui-disabled": e ? {} : t[n("disabled")]
91
+ },
92
+ "&.Mui-focusVisible": {
93
+ "&:not(.Mui-checked)": t.focusVisibleUnchecked,
94
+ "&.Mui-checked": t.focusVisibleChecked
95
+ }
96
+ };
97
+ }), M = (e) => {
98
+ let { correctness: t, checked: n, onChange: r, disabled: i, value: a, id: o, onKeyDown: s, inputRef: l } = e;
99
+ return /* @__PURE__ */ c(j, {
100
+ id: o,
101
+ slotProps: { input: { ref: l } },
102
+ onKeyDown: s,
103
+ disableRipple: !0,
104
+ checked: n,
105
+ onChange: r,
106
+ disabled: i,
107
+ value: a,
108
+ correctness: t,
109
+ className: C
110
+ });
111
+ }, N = d(h, { shouldForwardProp: (e) => e !== "correctness" })(({ correctness: e }) => {
112
+ let t = A(e), n = (t) => e ? `${e}-${t}` : t;
113
+ return {
114
+ [`&.${C}`]: {
115
+ ...t[n("root")],
116
+ "&.Mui-checked": t[n("checked")],
117
+ "&.Mui-disabled": e ? {} : t[n("disabled")]
118
+ },
119
+ "&.Mui-focusVisible": {
120
+ "& input": { outline: 0 },
121
+ "&:not(.Mui-checked)": t.focusVisibleUnchecked,
122
+ "&.Mui-checked": t.focusVisibleChecked
123
+ }
124
+ };
125
+ }), P = (e) => {
126
+ let { correctness: t, checked: n, onChange: r, disabled: i, value: a, id: o, tagName: s, inputRef: l } = e;
127
+ return /* @__PURE__ */ c(N, {
128
+ id: o,
129
+ slotProps: { input: { ref: l } },
130
+ disableRipple: !0,
131
+ checked: n,
132
+ onChange: r,
133
+ disabled: i,
134
+ value: a,
135
+ correctness: t,
136
+ className: C,
137
+ name: s
138
+ });
139
+ }, F = class extends t.Component {
140
+ static propTypes = {
141
+ choiceMode: n.oneOf(["radio", "checkbox"]),
142
+ displayKey: n.string,
143
+ checked: n.bool.isRequired,
144
+ correctness: n.string,
145
+ disabled: n.bool.isRequired,
146
+ feedback: n.string,
147
+ label: n.string.isRequired,
148
+ rationale: n.string,
149
+ onChange: n.func.isRequired,
150
+ value: n.string.isRequired,
151
+ className: n.string,
152
+ tagName: n.string,
153
+ hideTick: n.bool,
154
+ isEvaluateMode: n.bool,
155
+ choicesLayout: n.oneOf([
156
+ "vertical",
157
+ "grid",
158
+ "horizontal"
159
+ ]),
160
+ isSelectionButtonBelow: n.bool
161
+ };
162
+ static defaultProps = {
163
+ rationale: null,
164
+ checked: !1,
165
+ isEvaluateMode: !1
166
+ };
167
+ constructor(e) {
168
+ super(e), this.onToggleChoice = this.onToggleChoice.bind(this), this.choiceId = this.generateChoiceId(), this.descId = `${this.choiceId}-desc`;
169
+ }
170
+ onToggleChoice(e) {
171
+ this.props.onChange(e);
172
+ }
173
+ generateChoiceId() {
174
+ return "choice-" + (Math.random() * 1e4).toFixed();
175
+ }
176
+ handleKeyDown = (e) => {
177
+ let { choiceMode: t } = this.props;
178
+ if (t !== "checkbox") return;
179
+ let n = e.key === "ArrowDown", r = e.key === "ArrowUp";
180
+ if (!n && !r) return;
181
+ e.preventDefault();
182
+ let i = document.getElementById(this.choiceId);
183
+ if (!i) return;
184
+ let a = i.closest("fieldset");
185
+ if (!a) return;
186
+ let o = Array.from(a.querySelectorAll("input[type=\"checkbox\"]")), s = o.findIndex((e) => e === i);
187
+ if (s === -1) return;
188
+ let c = o[n ? s + 1 : s - 1];
189
+ c && c.focus();
190
+ };
191
+ render() {
192
+ let { choiceMode: t, disabled: n, displayKey: r, feedback: i, label: a, correctness: o, className: d, rationale: f, hideTick: p, isEvaluateMode: m, choicesLayout: h, value: g, checked: _, tagName: b, isSelectionButtonBelow: x } = this.props, S = t === "checkbox" ? M : P, k = t === "checkbox" ? "checkbox" : "radio-button", A = {
193
+ ...h === "horizontal" && { [`& .${C}`]: {
194
+ padding: "8px",
195
+ margin: "4px 0 4px 4px"
196
+ } },
197
+ ...x && h !== "grid" && { "& > label": { alignItems: "flex-start" } },
198
+ ...x && h === "grid" && {
199
+ justifyContent: "center",
200
+ "& > label": { alignItems: "center" }
201
+ }
202
+ }, j = typeof a == "string" && (a.includes("<math") || a.includes("\\(") || a.includes("\\[") || a.includes("<img") || a.includes("data-latex") || a.includes("data-raw") || a.includes("<mjx-container")), N = r ? /* @__PURE__ */ c(D, {
203
+ id: this.descId,
204
+ children: j ? `Pick the answer below, ${r}` : r
205
+ }) : null, F = /* @__PURE__ */ c(s, { children: r && !x ? /* @__PURE__ */ l(w, {
206
+ component: "span",
207
+ children: [/* @__PURE__ */ l("span", {
208
+ "aria-hidden": "true",
209
+ children: [
210
+ r,
211
+ ".",
212
+ "\xA0"
213
+ ]
214
+ }), /* @__PURE__ */ c(v, {
215
+ className: "prompt-label",
216
+ prompt: a,
217
+ tagName: "span"
218
+ })]
219
+ }) : /* @__PURE__ */ c(v, {
220
+ className: "prompt-label",
221
+ prompt: a,
222
+ tagName: "span"
223
+ }) }), I = {
224
+ disabled: n,
225
+ checked: _,
226
+ correctness: o,
227
+ tagName: b,
228
+ value: g,
229
+ id: this.choiceId,
230
+ onChange: this.onToggleChoice,
231
+ onKeyDown: this.handleKeyDown,
232
+ ...N ? { "aria-describedby": this.descId } : {}
233
+ }, L = x ? /* @__PURE__ */ l(E, { children: [
234
+ N,
235
+ /* @__PURE__ */ c(S, {
236
+ ...I,
237
+ style: { padding: 0 }
238
+ }),
239
+ /* @__PURE__ */ c("span", {
240
+ "aria-hidden": "true",
241
+ children: r ? `${r}.` : ""
242
+ })
243
+ ] }) : /* @__PURE__ */ l(s, { children: [N, /* @__PURE__ */ c(S, { ...I })] });
244
+ return /* @__PURE__ */ l("div", {
245
+ className: u(d, "corespring-" + k, "choice-input"),
246
+ children: [
247
+ /* @__PURE__ */ l(w, { children: [!p && m && /* @__PURE__ */ c(e, { correctness: o }), /* @__PURE__ */ c(T, {
248
+ className: "checkbox-holder",
249
+ sx: A,
250
+ children: /* @__PURE__ */ c(O, {
251
+ label: F,
252
+ value: g,
253
+ htmlFor: this.choiceId,
254
+ labelPlacement: x ? "top" : void 0,
255
+ control: L
256
+ })
257
+ })] }),
258
+ f && /* @__PURE__ */ c(v, {
259
+ className: "rationale",
260
+ defaultClassName: "rationale",
261
+ prompt: f
262
+ }),
263
+ /* @__PURE__ */ c(y, {
264
+ feedback: i,
265
+ correctness: o
266
+ })
267
+ ]
268
+ });
269
+ }
270
+ };
271
+ //#endregion
272
+ export { F as default };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/multiple-choice/src/choice.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ export declare class Choice extends React.Component {
11
+ static propTypes: {};
12
+ state: {
13
+ isHovered: boolean;
14
+ };
15
+ handleMouseEnter: any;
16
+ handleMouseLeave: any;
17
+ onChange: any;
18
+ render(): React.JSX.Element;
19
+ }
20
+ export default Choice;