@pie-element/multiple-choice 13.0.1 → 13.1.1-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 (272) hide show
  1. package/dist/author/defaults.d.ts +206 -0
  2. package/dist/author/defaults.d.ts.map +1 -0
  3. package/dist/author/defaults.js +151 -0
  4. package/dist/author/index.d.ts +27 -0
  5. package/dist/author/index.d.ts.map +1 -0
  6. package/dist/author/index.js +116 -0
  7. package/dist/author/main.d.ts +35 -0
  8. package/dist/author/main.d.ts.map +1 -0
  9. package/dist/author/main.js +290 -0
  10. package/dist/author/utils.d.ts +10 -0
  11. package/dist/author/utils.d.ts.map +1 -0
  12. package/dist/author/utils.js +7 -0
  13. package/dist/controller/defaults.d.ts +36 -0
  14. package/dist/controller/defaults.d.ts.map +1 -0
  15. package/dist/controller/defaults.js +29 -0
  16. package/dist/controller/index.d.ts +66 -0
  17. package/dist/controller/index.d.ts.map +1 -0
  18. package/dist/controller/index.js +124 -0
  19. package/dist/controller/utils.d.ts +11 -0
  20. package/dist/controller/utils.d.ts.map +1 -0
  21. package/dist/controller/utils.js +8 -0
  22. package/dist/delivery/choice-input.d.ts +45 -0
  23. package/dist/delivery/choice-input.d.ts.map +1 -0
  24. package/dist/delivery/choice-input.js +274 -0
  25. package/dist/delivery/choice.d.ts +21 -0
  26. package/dist/delivery/choice.d.ts.map +1 -0
  27. package/dist/delivery/choice.js +109 -0
  28. package/dist/delivery/feedback-tick.d.ts +21 -0
  29. package/dist/delivery/feedback-tick.d.ts.map +1 -0
  30. package/dist/delivery/feedback-tick.js +104 -0
  31. package/dist/delivery/index.d.ts +38 -0
  32. package/dist/delivery/index.d.ts.map +1 -0
  33. package/dist/delivery/index.js +217 -0
  34. package/dist/delivery/main.d.ts +32 -0
  35. package/dist/delivery/main.d.ts.map +1 -0
  36. package/dist/delivery/main.js +51 -0
  37. package/dist/delivery/multiple-choice.d.ts +63 -0
  38. package/dist/delivery/multiple-choice.d.ts.map +1 -0
  39. package/dist/delivery/multiple-choice.js +252 -0
  40. package/dist/delivery/session-updater.d.ts +11 -0
  41. package/dist/delivery/session-updater.d.ts.map +1 -0
  42. package/dist/delivery/session-updater.js +9 -0
  43. package/dist/index.d.ts +2 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.iife.d.ts +9 -0
  46. package/dist/index.iife.d.ts.map +1 -0
  47. package/dist/index.iife.js +148 -0
  48. package/dist/index.js +2 -0
  49. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js +6 -0
  50. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js +16 -0
  51. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js +16 -0
  52. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Map.js +6 -0
  53. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js +16 -0
  54. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js +6 -0
  55. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Set.js +6 -0
  56. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js +11 -0
  57. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js +13 -0
  58. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +5 -0
  59. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js +5 -0
  60. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js +6 -0
  61. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_apply.js +12 -0
  62. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js +7 -0
  63. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js +10 -0
  64. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  65. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js +7 -0
  66. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js +7 -0
  67. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignMergeValue.js +8 -0
  68. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js +10 -0
  69. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js +8 -0
  70. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js +8 -0
  71. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js +8 -0
  72. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js +12 -0
  73. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js +57 -0
  74. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js +14 -0
  75. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseFor.js +5 -0
  76. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  77. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +10 -0
  78. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js +9 -0
  79. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js +8 -0
  80. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
  81. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js +9 -0
  82. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js +11 -0
  83. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js +9 -0
  84. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  85. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js +12 -0
  86. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js +13 -0
  87. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMerge.js +19 -0
  88. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseMergeDeep.js +31 -0
  89. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js +9 -0
  90. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js +14 -0
  91. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js +7 -0
  92. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTrim.js +8 -0
  93. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js +8 -0
  94. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js +6 -0
  95. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  96. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js +10 -0
  97. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js +8 -0
  98. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js +8 -0
  99. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js +8 -0
  100. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  101. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js +8 -0
  102. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js +14 -0
  103. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js +8 -0
  104. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  105. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js +5 -0
  106. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createAssigner.js +15 -0
  107. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createBaseFor.js +12 -0
  108. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js +10 -0
  109. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js +35 -0
  110. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js +35 -0
  111. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js +32 -0
  112. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +4 -0
  113. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js +9 -0
  114. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  115. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js +8 -0
  116. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js +9 -0
  117. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js +5 -0
  118. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +14 -0
  119. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js +10 -0
  120. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  121. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js +23 -0
  122. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js +6 -0
  123. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js +7 -0
  124. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js +7 -0
  125. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js +13 -0
  126. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js +9 -0
  127. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js +9 -0
  128. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js +8 -0
  129. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js +33 -0
  130. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js +9 -0
  131. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js +8 -0
  132. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIterateeCall.js +12 -0
  133. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js +7 -0
  134. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js +11 -0
  135. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js +8 -0
  136. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js +6 -0
  137. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js +9 -0
  138. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js +8 -0
  139. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js +7 -0
  140. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js +8 -0
  141. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js +13 -0
  142. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  143. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js +7 -0
  144. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js +7 -0
  145. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js +8 -0
  146. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js +9 -0
  147. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js +5 -0
  148. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js +5 -0
  149. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  150. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +9 -0
  151. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
  152. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js +8 -0
  153. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js +13 -0
  154. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
  155. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_safeGet.js +6 -0
  156. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js +7 -0
  157. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js +6 -0
  158. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js +9 -0
  159. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js +6 -0
  160. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js +14 -0
  161. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js +7 -0
  162. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js +7 -0
  163. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js +6 -0
  164. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js +6 -0
  165. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js +16 -0
  166. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js +15 -0
  167. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_trimmedEndIndex.js +8 -0
  168. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js +8 -0
  169. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/constant.js +8 -0
  170. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/debounce.js +50 -0
  171. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/defaults.js +16 -0
  172. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/eq.js +6 -0
  173. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/identity.js +6 -0
  174. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js +10 -0
  175. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js +4 -0
  176. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js +8 -0
  177. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLikeObject.js +8 -0
  178. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js +6 -0
  179. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js +21 -0
  180. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEqual.js +7 -0
  181. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js +11 -0
  182. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +7 -0
  183. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isMap.js +7 -0
  184. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
  185. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
  186. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isPlainObject.js +14 -0
  187. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSet.js +7 -0
  188. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js +9 -0
  189. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +7 -0
  190. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keys.js +9 -0
  191. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +9 -0
  192. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/merge.js +8 -0
  193. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/now.js +7 -0
  194. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js +6 -0
  195. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +6 -0
  196. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toNumber.js +19 -0
  197. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toPlainObject.js +8 -0
  198. package/dist/print/index.d.ts +16 -0
  199. package/dist/print/index.d.ts.map +1 -0
  200. package/dist/print/index.js +44 -0
  201. package/package.json +58 -26
  202. package/{configure/lib/defaults.js → src/author/defaults.ts} +55 -90
  203. package/{configure/lib/index.js → src/author/index.ts} +98 -51
  204. package/src/author/main.tsx +509 -0
  205. package/src/author/utils.ts +25 -0
  206. package/{controller/lib/defaults.js → src/controller/defaults.ts} +11 -8
  207. package/{controller/lib/index.js → src/controller/index.ts} +123 -109
  208. package/src/controller/utils.ts +22 -0
  209. package/src/delivery/choice-input.tsx +413 -0
  210. package/src/delivery/choice.tsx +203 -0
  211. package/src/delivery/feedback-tick.tsx +156 -0
  212. package/src/delivery/index.ts +489 -0
  213. package/src/delivery/main.tsx +85 -0
  214. package/src/delivery/multiple-choice.tsx +485 -0
  215. package/{lib/session-updater.js → src/delivery/session-updater.ts} +17 -13
  216. package/src/index.iife.ts +16 -0
  217. package/src/index.ts +1 -0
  218. package/src/print/index.tsx +112 -0
  219. package/CHANGELOG.json +0 -1972
  220. package/CHANGELOG.md +0 -2690
  221. package/LICENSE.md +0 -5
  222. package/PRINT.md +0 -35
  223. package/README.md +0 -56
  224. package/choice.png +0 -0
  225. package/configure/CHANGELOG.json +0 -1387
  226. package/configure/CHANGELOG.md +0 -2046
  227. package/configure/lib/defaults.js.map +0 -1
  228. package/configure/lib/index.js.map +0 -1
  229. package/configure/lib/main.js +0 -477
  230. package/configure/lib/main.js.map +0 -1
  231. package/configure/lib/utils.js +0 -18
  232. package/configure/lib/utils.js.map +0 -1
  233. package/configure/package.json +0 -22
  234. package/controller/CHANGELOG.json +0 -527
  235. package/controller/CHANGELOG.md +0 -1388
  236. package/controller/lib/defaults.js.map +0 -1
  237. package/controller/lib/index.js.map +0 -1
  238. package/controller/lib/utils.js +0 -15
  239. package/controller/lib/utils.js.map +0 -1
  240. package/controller/package.json +0 -15
  241. package/docs/config-schema.json +0 -2993
  242. package/docs/config-schema.json.md +0 -2217
  243. package/docs/demo/config.js +0 -8
  244. package/docs/demo/generate.js +0 -61
  245. package/docs/demo/index.html +0 -1
  246. package/docs/demo/session.js +0 -7
  247. package/docs/pie-schema.json +0 -1332
  248. package/docs/pie-schema.json.md +0 -1015
  249. package/lib/choice-input.js +0 -380
  250. package/lib/choice-input.js.map +0 -1
  251. package/lib/choice.js +0 -197
  252. package/lib/choice.js.map +0 -1
  253. package/lib/feedback-tick.js +0 -134
  254. package/lib/feedback-tick.js.map +0 -1
  255. package/lib/index.js +0 -337
  256. package/lib/index.js.map +0 -1
  257. package/lib/main.js +0 -57
  258. package/lib/main.js.map +0 -1
  259. package/lib/multiple-choice.js +0 -385
  260. package/lib/multiple-choice.js.map +0 -1
  261. package/lib/print.js +0 -94
  262. package/lib/print.js.map +0 -1
  263. package/lib/session-updater.js.map +0 -1
  264. package/module/configure.js +0 -1
  265. package/module/controller.js +0 -3045
  266. package/module/demo.js +0 -86
  267. package/module/element.js +0 -1
  268. package/module/index.html +0 -21
  269. package/module/manifest.json +0 -14
  270. package/module/print-demo.js +0 -124
  271. package/module/print.html +0 -18
  272. package/module/print.js +0 -1
@@ -1,40 +1,38 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.createCorrectResponseSession = void 0;
8
- exports.createDefaultModel = createDefaultModel;
9
- exports.getScore = exports.getLogTrace = void 0;
10
- exports.model = model;
11
- exports.normalize = void 0;
12
- exports.outcome = outcome;
13
- exports.validate = void 0;
14
- var _lodashEs = require("lodash-es");
15
- var _utils = require("./utils");
16
- var _defaults = _interopRequireDefault(require("./defaults"));
17
- var _controllerUtils = require("@pie-lib/controller-utils");
1
+ // @ts-nocheck
2
+ /**
3
+ * @synced-from pie-elements/packages/multiple-choice/controller/src/index.js
4
+ * @auto-generated
5
+ *
6
+ * This file is automatically synced from pie-elements and converted to TypeScript.
7
+ * Manual edits will be overwritten on next sync.
8
+ * To make changes, edit the upstream JavaScript file and run sync again.
9
+ */
10
+
18
11
  /* eslint-disable no-console */
12
+ import { isEmpty } from 'lodash-es';
13
+ import { isResponseCorrect } from './utils.js';
14
+ import defaults from './defaults.js';
15
+ import { lockChoices, partialScoring, getShuffledChoices } from '@pie-element/shared-controller-utils';
19
16
 
20
- const prepareChoice = (model, env, defaultFeedback) => choice => {
21
- const {
22
- role,
23
- mode
24
- } = env || {};
17
+ const prepareChoice = (model, env, defaultFeedback) => (choice) => {
18
+ const { role, mode } = env || {};
25
19
  const out = {
26
20
  label: choice.label,
27
- value: choice.value
21
+ value: choice.value,
28
22
  };
23
+
29
24
  if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {
30
25
  out.rationale = model.rationaleEnabled ? choice.rationale : null;
31
26
  } else {
32
27
  out.rationale = null;
33
28
  }
29
+
34
30
  if (mode === 'evaluate') {
35
31
  out.correct = !!choice.correct;
32
+
36
33
  if (model.feedbackEnabled) {
37
- const feedbackType = choice.feedback && choice.feedback.type || 'none';
34
+ const feedbackType = (choice.feedback && choice.feedback.type) || 'none';
35
+
38
36
  if (feedbackType === 'default') {
39
37
  out.feedback = defaultFeedback[choice.correct ? 'correct' : 'incorrect'];
40
38
  } else if (feedbackType === 'custom') {
@@ -42,26 +40,23 @@ const prepareChoice = (model, env, defaultFeedback) => choice => {
42
40
  }
43
41
  }
44
42
  }
43
+
45
44
  return out;
46
45
  };
47
- function createDefaultModel(model = {}) {
48
- return new Promise(resolve => resolve({
49
- ..._defaults.default,
50
- ...model
51
- }));
46
+
47
+ export function createDefaultModel(model = {}) {
48
+ return new Promise((resolve) => resolve({ ...defaults, ...model }));
52
49
  }
53
- const normalize = question => {
54
- const {
55
- verticalMode,
56
- choicesLayout,
57
- ...questionProps
58
- } = question || {};
50
+
51
+ export const normalize = (question) => {
52
+ const { verticalMode, choicesLayout, ...questionProps } = question || {};
53
+
59
54
  return {
60
- ..._defaults.default,
55
+ ...defaults,
61
56
  ...questionProps,
62
57
  // This is used for offering support for old models which have the property verticalMode
63
58
  // Same thing is set in authoring : packages/multiple-choice/configure/src/index.jsx - createDefaultModel
64
- choicesLayout: choicesLayout || verticalMode === false && 'horizontal' || _defaults.default.choicesLayout
59
+ choicesLayout: choicesLayout || (verticalMode === false && 'horizontal') || defaults.choicesLayout,
65
60
  };
66
61
  };
67
62
 
@@ -72,18 +67,22 @@ const normalize = question => {
72
67
  * @param {*} env
73
68
  * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.
74
69
  */
75
- exports.normalize = normalize;
76
- async function model(question, session, env, updateSession) {
70
+ export async function model(question, session, env, updateSession) {
77
71
  const normalizedQuestion = normalize(question);
78
- const defaultFeedback = Object.assign({
79
- correct: 'Correct',
80
- incorrect: 'Incorrect'
81
- }, normalizedQuestion.defaultFeedback);
72
+
73
+ const defaultFeedback = Object.assign(
74
+ { correct: 'Correct', incorrect: 'Incorrect' },
75
+ normalizedQuestion.defaultFeedback,
76
+ );
77
+
82
78
  let choices = (normalizedQuestion.choices || []).map(prepareChoice(normalizedQuestion, env, defaultFeedback));
83
- const lockChoiceOrder = (0, _controllerUtils.lockChoices)(normalizedQuestion, session, env);
79
+
80
+ const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);
81
+
84
82
  if (!lockChoiceOrder) {
85
- choices = await (0, _controllerUtils.getShuffledChoices)(choices, session, updateSession, 'value');
83
+ choices = await getShuffledChoices(choices, session, updateSession, 'value');
86
84
  }
85
+
87
86
  const out = {
88
87
  disabled: env.mode !== 'gather',
89
88
  mode: env.mode,
@@ -93,7 +92,7 @@ async function model(question, session, env, updateSession) {
93
92
  choiceMode: normalizedQuestion.choiceMode,
94
93
  keyMode: normalizedQuestion.choicePrefix,
95
94
  choices,
96
- responseCorrect: env.mode === 'evaluate' ? (0, _utils.isResponseCorrect)(normalizedQuestion, session) : undefined,
95
+ responseCorrect: env.mode === 'evaluate' ? isResponseCorrect(normalizedQuestion, session) : undefined,
97
96
  language: normalizedQuestion.language,
98
97
  extraCSSRules: normalizedQuestion.extraCSSRules,
99
98
  fontSizeFactor: normalizedQuestion.fontSizeFactor,
@@ -109,33 +108,45 @@ async function model(question, session, env, updateSession) {
109
108
  keyboardEventsEnabled: normalizedQuestion.keyboardEventsEnabled,
110
109
  autoplayAudioEnabled: normalizedQuestion.autoplayAudioEnabled,
111
110
  completeAudioEnabled: normalizedQuestion.completeAudioEnabled,
112
- customAudioButton: normalizedQuestion.customAudioButton
111
+ customAudioButton: normalizedQuestion.customAudioButton,
113
112
  };
114
- const {
115
- role,
116
- mode
117
- } = env || {};
113
+
114
+ const { role, mode } = env || {};
115
+
118
116
  if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {
119
- out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;
117
+ out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled
118
+ ? normalizedQuestion.teacherInstructions
119
+ : null;
120
120
  } else {
121
121
  out.teacherInstructions = null;
122
122
  }
123
+
123
124
  return out;
124
125
  }
125
- const getScore = (config, session) => {
126
- if (!session || (0, _lodashEs.isEmpty)(session)) {
126
+
127
+ export const getScore = (config, session) => {
128
+ if (!session || isEmpty(session)) {
127
129
  return 0;
128
130
  }
131
+
129
132
  const selectedChoices = session.value || [];
130
- const correctChoices = (config.choices || []).filter(ch => ch.correct);
131
- let score = selectedChoices.reduce((acc, selectedChoice) => acc + (correctChoices.find(ch => ch.value === selectedChoice) ? 1 : 0), 0);
133
+ const correctChoices = (config.choices || []).filter((ch) => ch.correct);
134
+
135
+ let score = selectedChoices.reduce(
136
+ (acc, selectedChoice) => acc + (correctChoices.find((ch) => ch.value === selectedChoice) ? 1 : 0),
137
+ 0,
138
+ );
139
+
132
140
  if (correctChoices.length < selectedChoices.length) {
133
141
  score -= selectedChoices.length - correctChoices.length;
142
+
134
143
  if (score < 0) {
135
144
  score = 0;
136
145
  }
137
146
  }
147
+
138
148
  const str = correctChoices.length ? score / correctChoices.length : 0;
149
+
139
150
  return parseFloat(str.toFixed(2));
140
151
  };
141
152
 
@@ -146,30 +157,38 @@ const getScore = (config, session) => {
146
157
  * @param {Object} env - the environment
147
158
  * @returns {Array} traceLog - array of trace messages
148
159
  */
149
- exports.getScore = getScore;
150
- const getLogTrace = (model, session, env) => {
160
+ export const getLogTrace = (model, session, env) => {
151
161
  const traceLog = [];
152
162
  const selected = session?.value || [];
163
+
153
164
  const questionType = model.choiceMode === 'radio' ? 'multiple-choice (radio)' : 'multiple-select (checkbox)';
154
165
  traceLog.push(`Question type: ${questionType}.`);
166
+
155
167
  if (selected.length) {
156
168
  traceLog.push(`Student selected ${selected.length} answer(s): ${selected.join(', ')}.`);
157
169
  } else {
158
170
  traceLog.push('Student did not select any answers.');
159
171
  }
160
- const correctChoices = (model.choices || []).filter(c => c.correct);
161
- const correctValues = correctChoices.map(c => c.value);
172
+
173
+ const correctChoices = (model.choices || []).filter((c) => c.correct);
174
+ const correctValues = correctChoices.map((c) => c.value);
162
175
  traceLog.push(`${correctChoices.length} correct answer(s) are defined for this question.`);
176
+
163
177
  if (selected.length) {
164
- const correctSelected = selected.filter(v => correctValues.includes(v));
165
- const incorrectSelected = selected.filter(v => !correctValues.includes(v));
166
- traceLog.push(`Student selected ${correctSelected.length} correct and ${incorrectSelected.length} incorrect answer(s).`);
178
+ const correctSelected = selected.filter((v) => correctValues.includes(v));
179
+ const incorrectSelected = selected.filter((v) => !correctValues.includes(v));
180
+ traceLog.push(
181
+ `Student selected ${correctSelected.length} correct and ${incorrectSelected.length} incorrect answer(s).`
182
+ );
167
183
  }
168
- const partialScoringEnabled = _controllerUtils.partialScoring.enabled(model, env) && model.choiceMode !== 'radio';
184
+
185
+ const partialScoringEnabled = partialScoring.enabled(model, env) && model.choiceMode !== 'radio';
169
186
  const scoringMethod = partialScoringEnabled ? 'partial scoring' : 'all-or-nothing scoring';
170
187
  traceLog.push(`Score calculated using ${scoringMethod}.`);
188
+
171
189
  const score = getScore(model, session);
172
190
  traceLog.push(`Final score: ${score}.`);
191
+
173
192
  return traceLog;
174
193
  };
175
194
 
@@ -182,38 +201,32 @@ const getLogTrace = (model, session, env) => {
182
201
  * @param {*} session
183
202
  * @param {Object} env
184
203
  */
185
- exports.getLogTrace = getLogTrace;
186
- function outcome(model, session, env) {
187
- return new Promise(resolve => {
188
- if (!session || (0, _lodashEs.isEmpty)(session)) {
189
- resolve({
190
- score: 0,
191
- empty: true,
192
- traceLog: ['Student did not select any answers. Score is 0.']
193
- });
204
+ export function outcome(model, session, env) {
205
+ return new Promise((resolve) => {
206
+ if (!session || isEmpty(session)) {
207
+ resolve({ score: 0, empty: true, traceLog: ['Student did not select any answers. Score is 0.'] });
194
208
  } else {
195
209
  const traceLog = getLogTrace(model, session, env);
196
210
  const score = getScore(model, session);
197
- const partialScoringEnabled = _controllerUtils.partialScoring.enabled(model, env) && model.choiceMode !== 'radio';
198
- resolve({
199
- score: partialScoringEnabled ? score : score === 1 ? 1 : 0,
200
- empty: false,
201
- traceLog
211
+ const partialScoringEnabled = partialScoring.enabled(model, env) && model.choiceMode !== 'radio';
212
+
213
+ resolve({
214
+ score: partialScoringEnabled ? score : score === 1 ? 1 : 0,
215
+ empty: false,
216
+ traceLog
202
217
  });
203
218
  }
204
219
  });
205
220
  }
206
- const createCorrectResponseSession = (question, env) => {
207
- return new Promise(resolve => {
221
+
222
+ export const createCorrectResponseSession = (question, env) => {
223
+ return new Promise((resolve) => {
208
224
  if (env.mode !== 'evaluate' && env.role === 'instructor') {
209
- const {
210
- choices
211
- } = question || {
212
- choices: []
213
- };
225
+ const { choices } = question || { choices: [] };
226
+
214
227
  resolve({
215
228
  id: '1',
216
- value: choices.filter(c => c.correct).map(c => c.value)
229
+ value: choices.filter((c) => c.correct).map((c) => c.value),
217
230
  });
218
231
  } else {
219
232
  resolve(null);
@@ -222,67 +235,68 @@ const createCorrectResponseSession = (question, env) => {
222
235
  };
223
236
 
224
237
  // remove all html tags
225
- exports.createCorrectResponseSession = createCorrectResponseSession;
226
- const getInnerText = html => (html || '').replaceAll(/<[^>]*>/g, '');
238
+ const getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');
227
239
 
228
240
  // remove all html tags except img, iframe and source tag for audio
229
- const getContent = html => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
230
- const validate = (model = {}, config = {}) => {
231
- const {
232
- choices
233
- } = model;
234
- const {
235
- minAnswerChoices = 2,
236
- maxAnswerChoices
237
- } = config;
241
+ const getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
242
+
243
+ export const validate = (model = {}, config = {}) => {
244
+ const { choices } = model;
245
+ const { minAnswerChoices = 2, maxAnswerChoices } = config;
238
246
  const reversedChoices = [...(choices || [])].reverse();
239
247
  const choicesErrors = {};
240
248
  const rationaleErrors = {};
241
249
  const errors = {};
242
- ['teacherInstructions', 'prompt'].forEach(field => {
250
+
251
+ ['teacherInstructions', 'prompt'].forEach((field) => {
243
252
  if (config[field]?.required && !getContent(model[field])) {
244
253
  errors[field] = 'This field is required.';
245
254
  }
246
255
  });
256
+
247
257
  let hasCorrectResponse = false;
258
+
248
259
  reversedChoices.forEach((choice, index) => {
249
- const {
250
- correct,
251
- value,
252
- label,
253
- rationale
254
- } = choice;
260
+ const { correct, value, label, rationale } = choice;
261
+
255
262
  if (correct) {
256
263
  hasCorrectResponse = true;
257
264
  }
265
+
258
266
  if (!getContent(label)) {
259
267
  choicesErrors[value] = 'Content should not be empty.';
260
268
  } else {
261
- const identicalAnswer = reversedChoices.slice(index + 1).some(c => c.label === label);
269
+ const identicalAnswer = reversedChoices.slice(index + 1).some((c) => c.label === label);
270
+
262
271
  if (identicalAnswer) {
263
272
  choicesErrors[value] = 'Content should be unique.';
264
273
  }
265
274
  }
275
+
266
276
  if (config.rationale?.required && !getContent(rationale)) {
267
277
  rationaleErrors[value] = 'This field is required.';
268
278
  }
269
279
  });
280
+
270
281
  const nbOfChoices = (choices || []).length;
282
+
271
283
  if (nbOfChoices < minAnswerChoices) {
272
284
  errors.answerChoices = `There should be at least ${minAnswerChoices} choices defined.`;
273
285
  } else if (nbOfChoices > maxAnswerChoices) {
274
286
  errors.answerChoices = `No more than ${maxAnswerChoices} choices should be defined.`;
275
287
  }
288
+
276
289
  if (!hasCorrectResponse) {
277
290
  errors.correctResponse = 'No correct response defined.';
278
291
  }
279
- if (!(0, _lodashEs.isEmpty)(choicesErrors)) {
292
+
293
+ if (!isEmpty(choicesErrors)) {
280
294
  errors.choices = choicesErrors;
281
295
  }
282
- if (!(0, _lodashEs.isEmpty)(rationaleErrors)) {
296
+
297
+ if (!isEmpty(rationaleErrors)) {
283
298
  errors.rationale = rationaleErrors;
284
299
  }
300
+
285
301
  return errors;
286
302
  };
287
- exports.validate = validate;
288
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,22 @@
1
+ // @ts-nocheck
2
+ /**
3
+ * @synced-from pie-elements/packages/multiple-choice/controller/src/utils.js
4
+ * @auto-generated
5
+ *
6
+ * This file is automatically synced from pie-elements and converted to TypeScript.
7
+ * Manual edits will be overwritten on next sync.
8
+ * To make changes, edit the upstream JavaScript file and run sync again.
9
+ */
10
+
11
+ import { isEqual } from 'lodash-es';
12
+
13
+ export const getCorrectResponse = (choices) =>
14
+ choices
15
+ .filter((c) => c.correct)
16
+ .map((c) => c.value)
17
+ .sort();
18
+
19
+ export const isResponseCorrect = (question, session) => {
20
+ let correctResponse = getCorrectResponse(question.choices);
21
+ return session && isEqual((session.value || []).sort(), correctResponse);
22
+ };