@pie-element/multiple-choice 13.1.1-next.0 → 13.2.0-next.1

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 (271) hide show
  1. package/CHANGELOG.json +1972 -0
  2. package/CHANGELOG.md +2704 -0
  3. package/LICENSE.md +5 -0
  4. package/PRINT.md +35 -0
  5. package/README.md +56 -0
  6. package/choice.png +0 -0
  7. package/configure/CHANGELOG.json +1387 -0
  8. package/configure/CHANGELOG.md +2054 -0
  9. package/{src/author/defaults.ts → configure/lib/defaults.js} +90 -55
  10. package/configure/lib/defaults.js.map +1 -0
  11. package/{src/author/index.ts → configure/lib/index.js} +55 -99
  12. package/configure/lib/index.js.map +1 -0
  13. package/configure/lib/main.js +483 -0
  14. package/configure/lib/main.js.map +1 -0
  15. package/configure/lib/utils.js +18 -0
  16. package/configure/lib/utils.js.map +1 -0
  17. package/configure/package.json +22 -0
  18. package/controller/CHANGELOG.json +527 -0
  19. package/controller/CHANGELOG.md +1394 -0
  20. package/{src/controller/defaults.ts → controller/lib/defaults.js} +8 -11
  21. package/controller/lib/defaults.js.map +1 -0
  22. package/{src/controller/index.ts → controller/lib/index.js} +109 -123
  23. package/controller/lib/index.js.map +1 -0
  24. package/controller/lib/utils.js +15 -0
  25. package/controller/lib/utils.js.map +1 -0
  26. package/controller/package.json +15 -0
  27. package/docs/config-schema.json +2993 -0
  28. package/docs/config-schema.json.md +2217 -0
  29. package/docs/demo/config.js +8 -0
  30. package/docs/demo/generate.js +61 -0
  31. package/docs/demo/index.html +1 -0
  32. package/docs/demo/session.js +7 -0
  33. package/docs/pie-schema.json +1332 -0
  34. package/docs/pie-schema.json.md +1015 -0
  35. package/lib/choice-input.js +380 -0
  36. package/lib/choice-input.js.map +1 -0
  37. package/lib/choice.js +197 -0
  38. package/lib/choice.js.map +1 -0
  39. package/lib/feedback-tick.js +134 -0
  40. package/lib/feedback-tick.js.map +1 -0
  41. package/{src/delivery/index.ts → lib/index.js} +129 -211
  42. package/lib/index.js.map +1 -0
  43. package/lib/main.js +63 -0
  44. package/lib/main.js.map +1 -0
  45. package/lib/multiple-choice.js +412 -0
  46. package/lib/multiple-choice.js.map +1 -0
  47. package/lib/print.js +94 -0
  48. package/lib/print.js.map +1 -0
  49. package/{src/delivery/session-updater.ts → lib/session-updater.js} +13 -17
  50. package/lib/session-updater.js.map +1 -0
  51. package/module/configure.js +1 -0
  52. package/module/controller.js +3045 -0
  53. package/module/demo.js +86 -0
  54. package/module/element.js +1 -0
  55. package/module/index.html +21 -0
  56. package/module/manifest.json +14 -0
  57. package/module/print-demo.js +124 -0
  58. package/module/print.html +18 -0
  59. package/module/print.js +1 -0
  60. package/package.json +26 -58
  61. package/dist/author/defaults.d.ts +0 -206
  62. package/dist/author/defaults.d.ts.map +0 -1
  63. package/dist/author/defaults.js +0 -151
  64. package/dist/author/index.d.ts +0 -27
  65. package/dist/author/index.d.ts.map +0 -1
  66. package/dist/author/index.js +0 -116
  67. package/dist/author/main.d.ts +0 -35
  68. package/dist/author/main.d.ts.map +0 -1
  69. package/dist/author/main.js +0 -290
  70. package/dist/author/utils.d.ts +0 -10
  71. package/dist/author/utils.d.ts.map +0 -1
  72. package/dist/author/utils.js +0 -7
  73. package/dist/controller/defaults.d.ts +0 -36
  74. package/dist/controller/defaults.d.ts.map +0 -1
  75. package/dist/controller/defaults.js +0 -29
  76. package/dist/controller/index.d.ts +0 -66
  77. package/dist/controller/index.d.ts.map +0 -1
  78. package/dist/controller/index.js +0 -124
  79. package/dist/controller/utils.d.ts +0 -11
  80. package/dist/controller/utils.d.ts.map +0 -1
  81. package/dist/controller/utils.js +0 -8
  82. package/dist/delivery/choice-input.d.ts +0 -45
  83. package/dist/delivery/choice-input.d.ts.map +0 -1
  84. package/dist/delivery/choice-input.js +0 -274
  85. package/dist/delivery/choice.d.ts +0 -21
  86. package/dist/delivery/choice.d.ts.map +0 -1
  87. package/dist/delivery/choice.js +0 -109
  88. package/dist/delivery/feedback-tick.d.ts +0 -21
  89. package/dist/delivery/feedback-tick.d.ts.map +0 -1
  90. package/dist/delivery/feedback-tick.js +0 -104
  91. package/dist/delivery/index.d.ts +0 -38
  92. package/dist/delivery/index.d.ts.map +0 -1
  93. package/dist/delivery/index.js +0 -217
  94. package/dist/delivery/main.d.ts +0 -32
  95. package/dist/delivery/main.d.ts.map +0 -1
  96. package/dist/delivery/main.js +0 -51
  97. package/dist/delivery/multiple-choice.d.ts +0 -63
  98. package/dist/delivery/multiple-choice.d.ts.map +0 -1
  99. package/dist/delivery/multiple-choice.js +0 -252
  100. package/dist/delivery/session-updater.d.ts +0 -11
  101. package/dist/delivery/session-updater.d.ts.map +0 -1
  102. package/dist/delivery/session-updater.js +0 -9
  103. package/dist/index.d.ts +0 -2
  104. package/dist/index.d.ts.map +0 -1
  105. package/dist/index.iife.d.ts +0 -9
  106. package/dist/index.iife.d.ts.map +0 -1
  107. package/dist/index.iife.js +0 -148
  108. package/dist/index.js +0 -2
  109. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js +0 -6
  110. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js +0 -16
  111. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js +0 -16
  112. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Map.js +0 -6
  113. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js +0 -16
  114. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js +0 -6
  115. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Set.js +0 -6
  116. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js +0 -11
  117. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js +0 -13
  118. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +0 -5
  119. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js +0 -5
  120. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js +0 -6
  121. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_apply.js +0 -12
  122. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js +0 -7
  123. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js +0 -10
  124. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
  125. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js +0 -7
  126. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js +0 -7
  127. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignMergeValue.js +0 -8
  128. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js +0 -10
  129. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js +0 -8
  130. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js +0 -8
  131. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js +0 -8
  132. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js +0 -12
  133. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js +0 -57
  134. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js +0 -14
  135. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseFor.js +0 -5
  136. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  137. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +0 -10
  138. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js +0 -9
  139. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js +0 -8
  140. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
  141. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js +0 -9
  142. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js +0 -11
  143. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js +0 -9
  144. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
  145. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js +0 -12
  146. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js +0 -13
  147. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMerge.js +0 -19
  148. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMergeDeep.js +0 -31
  149. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js +0 -9
  150. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js +0 -14
  151. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js +0 -7
  152. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTrim.js +0 -8
  153. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js +0 -8
  154. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js +0 -6
  155. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  156. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js +0 -10
  157. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js +0 -8
  158. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js +0 -8
  159. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js +0 -8
  160. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  161. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js +0 -8
  162. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js +0 -14
  163. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js +0 -8
  164. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js +0 -8
  165. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js +0 -5
  166. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createAssigner.js +0 -15
  167. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createBaseFor.js +0 -12
  168. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js +0 -10
  169. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js +0 -35
  170. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js +0 -35
  171. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js +0 -32
  172. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +0 -4
  173. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js +0 -9
  174. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js +0 -9
  175. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js +0 -8
  176. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js +0 -9
  177. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js +0 -5
  178. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +0 -14
  179. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js +0 -10
  180. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js +0 -11
  181. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js +0 -23
  182. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js +0 -6
  183. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js +0 -7
  184. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js +0 -7
  185. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js +0 -13
  186. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js +0 -9
  187. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js +0 -9
  188. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js +0 -8
  189. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js +0 -33
  190. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js +0 -9
  191. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js +0 -8
  192. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIterateeCall.js +0 -12
  193. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js +0 -7
  194. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js +0 -11
  195. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js +0 -8
  196. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js +0 -6
  197. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js +0 -9
  198. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js +0 -8
  199. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js +0 -7
  200. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js +0 -8
  201. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js +0 -13
  202. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  203. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js +0 -7
  204. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js +0 -7
  205. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js +0 -8
  206. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js +0 -9
  207. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js +0 -5
  208. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js +0 -5
  209. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +0 -8
  210. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +0 -9
  211. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +0 -7
  212. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js +0 -8
  213. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js +0 -13
  214. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +0 -5
  215. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_safeGet.js +0 -6
  216. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js +0 -7
  217. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js +0 -6
  218. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js +0 -9
  219. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js +0 -6
  220. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js +0 -14
  221. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js +0 -7
  222. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js +0 -7
  223. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js +0 -6
  224. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js +0 -6
  225. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js +0 -16
  226. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js +0 -15
  227. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_trimmedEndIndex.js +0 -8
  228. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js +0 -8
  229. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/constant.js +0 -8
  230. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/debounce.js +0 -50
  231. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/defaults.js +0 -16
  232. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/eq.js +0 -6
  233. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/identity.js +0 -6
  234. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js +0 -10
  235. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js +0 -4
  236. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js +0 -8
  237. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  238. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js +0 -6
  239. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js +0 -21
  240. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEqual.js +0 -7
  241. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js +0 -11
  242. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +0 -7
  243. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isMap.js +0 -7
  244. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +0 -7
  245. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +0 -6
  246. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isPlainObject.js +0 -14
  247. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSet.js +0 -7
  248. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js +0 -9
  249. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +0 -7
  250. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keys.js +0 -9
  251. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +0 -9
  252. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/merge.js +0 -8
  253. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/now.js +0 -7
  254. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js +0 -6
  255. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +0 -6
  256. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toNumber.js +0 -19
  257. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toPlainObject.js +0 -8
  258. package/dist/print/index.d.ts +0 -16
  259. package/dist/print/index.d.ts.map +0 -1
  260. package/dist/print/index.js +0 -44
  261. package/src/author/main.tsx +0 -509
  262. package/src/author/utils.ts +0 -25
  263. package/src/controller/utils.ts +0 -22
  264. package/src/delivery/choice-input.tsx +0 -413
  265. package/src/delivery/choice.tsx +0 -203
  266. package/src/delivery/feedback-tick.tsx +0 -156
  267. package/src/delivery/main.tsx +0 -85
  268. package/src/delivery/multiple-choice.tsx +0 -485
  269. package/src/index.iife.ts +0 -16
  270. package/src/index.ts +0 -1
  271. package/src/print/index.tsx +0 -112
@@ -1,290 +0,0 @@
1
- import e from "../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/merge.js";
2
- import { generateValidationMessage as t } from "./utils.js";
3
- import n from "react";
4
- import r from "prop-types";
5
- import { color as i } from "@pie-lib/render-ui";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- import { styled as s } from "@mui/material/styles";
8
- import c from "@mui/material/Box";
9
- import l from "@pie-lib/editable-html-tip-tap";
10
- import { AlertDialog as u, ChoiceConfiguration as ee, InputContainer as d, choiceUtils as f, layout as te, settings as p } from "@pie-lib/config-ui";
11
- import m from "@mui/material/Button";
12
- import h from "@mui/material/Tooltip";
13
- import g from "@mui/material/Typography";
14
- import ne from "@mui/icons-material/Info";
15
- //#region src/author/main.tsx
16
- var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = s(d)(({ theme: e }) => ({
17
- width: "100%",
18
- paddingTop: e.spacing(2),
19
- marginBottom: e.spacing(2)
20
- })), ae = s(d)(({ theme: e }) => ({
21
- flex: 1,
22
- marginTop: e.spacing(1.5),
23
- paddingTop: e.spacing(2),
24
- marginLeft: e.spacing(3.5)
25
- })), oe = s(d)(({ theme: e }) => ({
26
- display: "flex",
27
- flexDirection: "column",
28
- marginBottom: e.spacing(1),
29
- width: "100%"
30
- })), x = s(m)(({ theme: e }) => ({
31
- marginTop: e.spacing(1),
32
- float: "right"
33
- })), se = s(x)({
34
- cursor: "not-allowed",
35
- pointerEvents: "all",
36
- backgroundColor: i.disabled(),
37
- "&:hover": { backgroundColor: i.disabled() },
38
- "&:focus": { backgroundColor: i.disabled() }
39
- }), ce = s(c)({
40
- display: "flex",
41
- alignItems: "center"
42
- }), le = s(g)(({ theme: e }) => ({
43
- fontSize: e.typography.fontSize + 2,
44
- marginRight: e.spacing(1)
45
- })), S = s(h)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
46
- fontSize: e.typography.fontSize - 2,
47
- whiteSpace: "pre",
48
- maxWidth: "500px"
49
- } })), C = s("div")(({ theme: e }) => ({
50
- fontSize: e.typography.fontSize - 2,
51
- color: e.palette.error.main,
52
- paddingTop: e.spacing(1)
53
- })), w = (e) => {
54
- let { model: n, configuration: r, onPromptChanged: i, onChoiceChanged: s, onRemoveChoice: c, onAddChoice: u, imageSupport: d, uploadSoundSupport: f, onChangeModel: p, onConfigurationChanged: m, onTeacherInstructionsChanged: h } = e, { addChoiceButton: g = {}, contentDimensions: w = {}, feedback: T = {}, deleteChoice: ue = {}, choiceMode: de = {}, choicePrefix: fe = {}, partialScoring: E = {}, lockChoiceOrder: D = {}, teacherInstructions: O = {}, studentInstructions: k = {}, rationale: A = {}, scoringType: j = {}, sequentialChoiceLabels: M = {}, settingsPanelDisabled: pe, choicesLayout: N, spellCheck: P = {}, gridColumns: me, maxImageWidth: F = {}, maxImageHeight: I = {}, prompt: L = {}, withRubric: R = {}, mathMlOptions: z = {}, language: B = {}, languageChoices: V = {} } = r || {}, { maxAnswerChoices: H } = r || {}, { limitChoicesNumber: he, teacherInstructionsEnabled: ge, rationaleEnabled: _e, feedbackEnabled: ve, promptEnabled: ye, spellCheckEnabled: U, choices: W, errors: be, toolbarEditorPosition: xe, extraCSSRules: Se } = n || {}, { answerChoices: G, choices: Ce, correctResponse: K, prompt: q, rationale: J, teacherInstructions: Y } = be || {}, we = W?.length ? Array.from({ length: W.length }, (e, t) => `${t + 1}`) : [], { baseInputConfiguration: Te = {} } = r, X = { position: xe === "top" ? "top" : "bottom" };
55
- he && (H = b);
56
- let Z = (e = {}) => ({
57
- ...Te,
58
- ...e
59
- }), Ee = t(r), Q = F && F.prompt, $ = I && I.prompt, De = H && W?.length >= H ? `Only ${H} allowed maximum` : "", Oe = {
60
- choiceMode: de.settings && v(de.label, ["checkbox", "radio"]),
61
- "sequentialChoiceLabels.enabled": M.settings && _(M.label, !0),
62
- choicePrefix: fe.settings && v(fe.label, ["numbers", "letters"]),
63
- partialScoring: E.settings && _(E.label),
64
- lockChoiceOrder: D.settings && _(D.label),
65
- feedbackEnabled: T.settings && _(T.label),
66
- choicesLayout: N.settings && y(N.label, [
67
- "vertical",
68
- "grid",
69
- "horizontal"
70
- ]),
71
- gridColumns: N.settings && n.choicesLayout === "grid" && we.length > 0 && y(me.label, we),
72
- "language.enabled": B.settings && _(B.label, !0),
73
- language: B.settings && B.enabled && y(V.label, V.options)
74
- }, ke = {
75
- teacherInstructionsEnabled: O.settings && _(O.label),
76
- studentInstructionsEnabled: k.settings && _(k.label),
77
- promptEnabled: L.settings && _(L.label),
78
- rationaleEnabled: A.settings && _(A.label),
79
- spellCheckEnabled: P.settings && _(P.label),
80
- scoringType: j.settings && v(j.label, ["auto", "rubric"]),
81
- rubricEnabled: R?.settings && _(R?.label)
82
- };
83
- return /* @__PURE__ */ o(te.ConfigLayout, {
84
- dimensions: w,
85
- hideSettings: pe,
86
- extraCSSRules: Se,
87
- classes: {},
88
- settings: /* @__PURE__ */ a(re, {
89
- model: n,
90
- onChangeModel: p,
91
- configuration: r,
92
- onChangeConfiguration: m,
93
- groups: {
94
- Settings: Oe,
95
- Properties: ke
96
- }
97
- }),
98
- children: [
99
- ge && /* @__PURE__ */ o(ie, {
100
- label: O.label,
101
- children: [/* @__PURE__ */ a(l, {
102
- markup: n.teacherInstructions || "",
103
- onChange: h,
104
- imageSupport: d,
105
- nonEmpty: !1,
106
- disableUnderline: !0,
107
- error: Y,
108
- toolbarOpts: X,
109
- pluginProps: Z(r?.teacherInstructions?.inputConfiguration),
110
- spellCheck: U,
111
- maxImageWidth: F && F.teacherInstructions || Q,
112
- maxImageHeight: I && I.teacherInstructions || $,
113
- uploadSoundSupport: f,
114
- languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
115
- mathMlOptions: z
116
- }), Y && /* @__PURE__ */ a(C, { children: Y })]
117
- }),
118
- ye && /* @__PURE__ */ o(ie, {
119
- label: L.label,
120
- children: [/* @__PURE__ */ a(l, {
121
- markup: n.prompt,
122
- onChange: i,
123
- imageSupport: d,
124
- nonEmpty: !1,
125
- disableUnderline: !0,
126
- error: q,
127
- toolbarOpts: X,
128
- pluginProps: Z(r?.prompt?.inputConfiguration),
129
- spellCheck: U,
130
- maxImageWidth: F && F.prompt,
131
- maxImageHeight: I && I.prompt,
132
- uploadSoundSupport: f,
133
- languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
134
- mathMlOptions: z
135
- }), q && /* @__PURE__ */ a(C, { children: q })]
136
- }),
137
- /* @__PURE__ */ o(ce, { children: [/* @__PURE__ */ a(le, {
138
- component: "div",
139
- children: "Choices"
140
- }), /* @__PURE__ */ a(S, {
141
- disableFocusListener: !0,
142
- disableTouchListener: !0,
143
- placement: "right",
144
- title: Ee,
145
- children: /* @__PURE__ */ a(ne, {
146
- fontSize: "small",
147
- color: "primary"
148
- })
149
- })] }),
150
- W.map((e, t) => /* @__PURE__ */ o(oe, { children: [/* @__PURE__ */ a(ee, {
151
- index: t + 1,
152
- useLetterOrdering: n.choicePrefix === "letters",
153
- mode: n.choiceMode,
154
- data: e,
155
- defaultFeedback: {},
156
- imageSupport: d,
157
- disableImageAlignmentButtons: !0,
158
- onDelete: () => c(t),
159
- onChange: (e) => s(t, e),
160
- allowFeedBack: ve,
161
- allowDelete: ue.settings,
162
- noLabels: !0,
163
- pluginOpts: Z(r?.choices?.inputConfiguration),
164
- toolbarOpts: X,
165
- spellCheck: U,
166
- error: Ce?.[e.value] || null,
167
- noCorrectAnswerError: K,
168
- maxImageWidth: F && F.choices || Q,
169
- maxImageHeight: I && I.choices || $,
170
- uploadSoundSupport: f,
171
- mathMlOptions: z
172
- }, t), _e && /* @__PURE__ */ o(ae, {
173
- label: A.label,
174
- children: [/* @__PURE__ */ a(l, {
175
- markup: e.rationale || "",
176
- onChange: (n) => s(t, {
177
- ...e,
178
- rationale: n
179
- }),
180
- imageSupport: d,
181
- error: J?.[e.value] || null,
182
- toolbarOpts: X,
183
- pluginProps: Z(r?.rationale?.inputConfiguration),
184
- spellCheck: U,
185
- maxImageWidth: F && F.rationale || Q,
186
- maxImageHeight: I && I.rationale || $,
187
- uploadSoundSupport: f,
188
- languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
189
- mathMlOptions: z
190
- }), J?.[e.value] && /* @__PURE__ */ a(C, { children: J?.[e.value] })]
191
- }, `rationale-${t}`)] }, `choice-${t}`)),
192
- K && /* @__PURE__ */ a(C, { children: K }),
193
- G && /* @__PURE__ */ a(C, { children: G }),
194
- g.settings && /* @__PURE__ */ a(S, {
195
- title: De,
196
- children: H && W?.length >= H ? /* @__PURE__ */ a(se, {
197
- variant: "contained",
198
- color: "primary",
199
- onClick: u,
200
- disabled: !0,
201
- children: g.label
202
- }) : /* @__PURE__ */ a(x, {
203
- variant: "contained",
204
- color: "primary",
205
- onClick: u,
206
- children: g.label
207
- })
208
- })
209
- ]
210
- });
211
- }, T = class extends n.Component {
212
- static propTypes = {
213
- model: r.object.isRequired,
214
- configuration: r.object.isRequired,
215
- disableSidePanel: r.bool,
216
- onModelChanged: r.func.isRequired,
217
- onConfigurationChanged: r.func.isRequired,
218
- imageSupport: r.shape({
219
- add: r.func.isRequired,
220
- delete: r.func.isRequired
221
- })
222
- };
223
- state = { showWarning: !1 };
224
- onRemoveChoice = (e) => {
225
- let { model: t, configuration: n, onModelChanged: r } = this.props, { minAnswerChoices: i } = n || {};
226
- if (i && t.choices.length === i) {
227
- this.setState({ showWarning: !0 });
228
- return;
229
- }
230
- t.choices.splice(e, 1), r(t);
231
- };
232
- onAddChoice = () => {
233
- let { model: e, configuration: t, onModelChanged: n } = this.props, { maxAnswerChoices: r } = t || {}, { limitChoicesNumber: i } = e || {};
234
- i && (r = b), !(r && e.choices.length >= r) && (e.choices.push({
235
- label: "",
236
- value: f.firstAvailableIndex(e.choices.map((e) => e.value), 0),
237
- feedback: { type: "none" }
238
- }), n(e));
239
- };
240
- onChoiceChanged = (t, n) => {
241
- let { model: r, onModelChanged: i } = this.props;
242
- n.correct && r.choiceMode === "radio" && (r.choices = r.choices.map((t) => e({}, t, { correct: !1 }))), r.choices.splice(t, 1, n), i(r);
243
- };
244
- onPromptChanged = (e) => {
245
- this.props.onModelChanged({
246
- ...this.props.model,
247
- prompt: e
248
- });
249
- };
250
- onTeacherInstructionsChanged = (e) => {
251
- this.props.onModelChanged({
252
- ...this.props.model,
253
- teacherInstructions: e
254
- });
255
- };
256
- onModelChanged = (e, t) => {
257
- let { onModelChanged: n } = this.props;
258
- switch (t) {
259
- case "choiceMode":
260
- if (e.choiceMode === "radio") {
261
- let t = !1;
262
- e.choices = e.choices.map((e) => t ? (e.correct = !1, e) : (e.correct && (t = !0), e));
263
- }
264
- n(e, !0);
265
- break;
266
- default:
267
- n(e);
268
- break;
269
- }
270
- };
271
- render() {
272
- let { configuration: { minAnswerChoices: e } = {} } = this.props, { showWarning: t } = this.state;
273
- return /* @__PURE__ */ o(n.Fragment, { children: [/* @__PURE__ */ a(u, {
274
- open: t,
275
- title: "Warning",
276
- text: `There can't be less than ${e || 0} choices.`,
277
- onConfirm: () => this.setState({ showWarning: !1 })
278
- }), /* @__PURE__ */ a(w, {
279
- ...this.props,
280
- onChangeModel: this.onModelChanged,
281
- onRemoveChoice: this.onRemoveChoice,
282
- onChoiceChanged: this.onChoiceChanged,
283
- onAddChoice: this.onAddChoice,
284
- onPromptChanged: this.onPromptChanged,
285
- onTeacherInstructionsChanged: this.onTeacherInstructionsChanged
286
- })] });
287
- }
288
- };
289
- //#endregion
290
- export { T as default };
@@ -1,10 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/multiple-choice/configure/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 generateValidationMessage: (config: any) => string;
10
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/author/utils.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,eAAO,MAAM,yBAAyB,GAAI,WAAM,WAc/C,CAAC"}
@@ -1,7 +0,0 @@
1
- //#region src/author/utils.ts
2
- var e = (e) => {
3
- let { minAnswerChoices: t, maxAnswerChoices: n } = e;
4
- return "Validation requirements:" + (`\nThere should be at least ${t} ` + (n ? `and at most ${n} ` : "") + "answer choices defined.\nEvery answer choice should be non-blank and unique.") + "\nA correct answer must be defined.";
5
- };
6
- //#endregion
7
- export { e as generateValidationMessage };
@@ -1,36 +0,0 @@
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;
36
- //# sourceMappingURL=defaults.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/controller/defaults.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,wBAyBE"}
@@ -1,29 +0,0 @@
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 };
@@ -1,66 +0,0 @@
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?: {}) => {};
66
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/controller/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAsCH,wBAAgB,kBAAkB,CAAC,KAAK,KAAK,oBAE5C;AAED,eAAO,MAAM,SAAS,GAAI,aAAQ,QAUjC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,KAAK,CAAC,QAAQ,KAAA,EAAE,OAAO,KAAA,EAAE,GAAG,KAAA,EAAE,aAAa,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDhE;AAED,eAAO,MAAM,QAAQ,GAAI,WAAM,EAAE,YAAO,WAwBvC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,UAAK,EAAE,YAAO,EAAE,QAAG,aAiC9C,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,KAAK,KAAA,EAAE,OAAO,KAAA,EAAE,GAAG,KAAA,oBAgB1C;AAED,eAAO,MAAM,4BAA4B,GAAI,aAAQ,EAAE,QAAG,qBAazD,CAAC;AAQF,eAAO,MAAM,QAAQ,GAAI,UAAU,EAAE,WAAW,OA2D/C,CAAC"}
@@ -1,124 +0,0 @@
1
- import e from "../node_modules/.bun/lodash-es@4.17.23/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) ? 1 : 0), 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 ? 1 : 0,
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 };
@@ -1,11 +0,0 @@
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;
11
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/controller/utils.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAIH,eAAO,MAAM,kBAAkB,GAAI,YAAO,QAI/B,CAAC;AAEZ,eAAO,MAAM,iBAAiB,GAAI,aAAQ,EAAE,YAAO,QAGlD,CAAC"}
@@ -1,8 +0,0 @@
1
- import e from "../node_modules/.bun/lodash-es@4.17.23/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 };
@@ -1,45 +0,0 @@
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;
45
- //# sourceMappingURL=choice-input.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"choice-input.d.ts","sourceRoot":"","sources":["../../src/delivery/choice-input.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAoFnC,eAAO,MAAM,sBAAsB,EAAE,GASnC,CAAC;AA+DH,eAAO,MAAM,cAAc,GAAI,UAAK,sBAgBnC,CAAC;AAqBF,eAAO,MAAM,WAAW,GAAI,UAAK,sBAgBhC,CAAC;AAEF,qBAAa,WAAY,SAAQ,KAAK,CAAC,SAAS;IAC9C,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;MAiBd;IAEF,MAAM,CAAC,YAAY;;;;MAIjB;gBAEU,KAAK,KAAA;IAOjB,cAAc,CAAC,KAAK,KAAA;IAIpB,gBAAgB;IAIhB,aAAa,EAAE,GAAG,CA6BhB;IAEF,MAAM;CAmHP;AAED,eAAe,WAAW,CAAC"}