@pie-element/inline-dropdown 10.1.1 → 10.1.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 (262) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/defaults.d.ts +194 -0
  4. package/dist/author/defaults.js +130 -0
  5. package/dist/author/index.d.ts +43 -0
  6. package/dist/author/index.js +83 -0
  7. package/dist/author/inline-dropdown-toolbar.d.ts +48 -0
  8. package/dist/author/inline-dropdown-toolbar.js +269 -0
  9. package/dist/author/main.d.ts +49 -0
  10. package/dist/author/main.js +384 -0
  11. package/dist/author/markupUtils.d.ts +12 -0
  12. package/dist/author/markupUtils.js +23 -0
  13. package/dist/author/response-area.d.ts +20 -0
  14. package/dist/author/response-area.js +32 -0
  15. package/dist/author/utils.d.ts +10 -0
  16. package/dist/author/utils.js +10 -0
  17. package/dist/browser/Close-CMvmRhfL.js +9015 -0
  18. package/dist/browser/Close-CMvmRhfL.js.map +1 -0
  19. package/dist/browser/author/index.js +41184 -0
  20. package/dist/browser/author/index.js.map +1 -0
  21. package/dist/browser/controller/index.js +215 -0
  22. package/dist/browser/controller/index.js.map +1 -0
  23. package/dist/browser/delivery/index.js +2714 -0
  24. package/dist/browser/delivery/index.js.map +1 -0
  25. package/dist/browser/inline-dropdown.css +2 -0
  26. package/dist/browser/isEmpty-BAznrYT5.js +433 -0
  27. package/dist/browser/isEmpty-BAznrYT5.js.map +1 -0
  28. package/dist/browser/reduce-2sGcZtv4.js +446 -0
  29. package/dist/browser/reduce-2sGcZtv4.js.map +1 -0
  30. package/dist/controller/defaults.d.ts +27 -0
  31. package/dist/controller/defaults.js +21 -0
  32. package/dist/controller/index.d.ts +54 -0
  33. package/dist/controller/index.js +126 -0
  34. package/dist/controller/utils.d.ts +12 -0
  35. package/dist/controller/utils.js +13 -0
  36. package/dist/delivery/index.d.ts +20 -0
  37. package/dist/delivery/index.js +60 -0
  38. package/dist/delivery/inline-dropdown.d.ts +38 -0
  39. package/dist/delivery/inline-dropdown.js +109 -0
  40. package/dist/index.d.ts +1 -0
  41. package/dist/index.iife.d.ts +8 -0
  42. package/dist/index.iife.js +148 -0
  43. package/dist/index.js +2 -0
  44. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +6 -0
  45. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +16 -0
  46. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +16 -0
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +6 -0
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +16 -0
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +6 -0
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +6 -0
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +11 -0
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +14 -0
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +5 -0
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +6 -0
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +12 -0
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +7 -0
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +10 -0
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +7 -0
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +7 -0
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js +8 -0
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +7 -0
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +10 -0
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +8 -0
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +8 -0
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +8 -0
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +12 -0
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +57 -0
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +14 -0
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js +6 -0
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseExtremum.js +11 -0
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +5 -0
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js +8 -0
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +10 -0
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGt.js +6 -0
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js +6 -0
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +9 -0
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +8 -0
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +9 -0
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMatch.js +26 -0
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +11 -0
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +9 -0
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIteratee.js +11 -0
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +12 -0
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +13 -0
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMap.js +11 -0
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.js +12 -0
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.js +8 -0
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js +9 -0
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyOf.js +8 -0
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js +8 -0
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +9 -0
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +14 -0
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +7 -0
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +15 -0
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +8 -0
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +6 -0
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castFunction.js +7 -0
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +10 -0
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +10 -0
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +8 -0
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +8 -0
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +8 -0
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +8 -0
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +14 -0
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +8 -0
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +5 -0
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js +12 -0
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +12 -0
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +10 -0
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +35 -0
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +35 -0
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +32 -0
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_escapeHtmlChar.js +11 -0
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +9 -0
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +8 -0
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMatchData.js +16 -0
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +9 -0
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +5 -0
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +10 -0
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +23 -0
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +6 -0
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js +18 -0
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +7 -0
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +7 -0
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +13 -0
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +9 -0
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +9 -0
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +8 -0
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +33 -0
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +9 -0
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +8 -0
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +12 -0
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +11 -0
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +7 -0
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +11 -0
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +8 -0
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isStrictComparable.js +7 -0
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +6 -0
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +9 -0
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +8 -0
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +7 -0
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +8 -0
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +13 -0
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +7 -0
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +7 -0
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +8 -0
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +9 -0
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +11 -0
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +5 -0
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +5 -0
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +9 -0
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +8 -0
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +13 -0
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +7 -0
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +6 -0
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +9 -0
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +6 -0
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +14 -0
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +7 -0
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +7 -0
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +6 -0
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +6 -0
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +16 -0
  183. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +10 -0
  184. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +10 -0
  185. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +15 -0
  186. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +8 -0
  187. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +8 -0
  188. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +16 -0
  189. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +6 -0
  190. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/escape.js +9 -0
  191. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/forEach.js +10 -0
  192. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js +8 -0
  193. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js +8 -0
  194. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +6 -0
  195. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +10 -0
  196. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +4 -0
  197. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +8 -0
  198. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +6 -0
  199. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +21 -0
  200. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +7 -0
  201. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +11 -0
  202. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +7 -0
  203. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +7 -0
  204. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
  205. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
  206. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +7 -0
  207. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +9 -0
  208. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +7 -0
  209. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isUndefined.js +6 -0
  210. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +9 -0
  211. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +9 -0
  212. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/map.js +10 -0
  213. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/max.js +9 -0
  214. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +16 -0
  215. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/property.js +10 -0
  216. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js +12 -0
  217. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +6 -0
  218. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +6 -0
  219. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +7 -0
  220. package/package.json +79 -18
  221. package/CHANGELOG.json +0 -1082
  222. package/CHANGELOG.md +0 -2185
  223. package/LICENSE.md +0 -5
  224. package/README.md +0 -1
  225. package/configure/CHANGELOG.json +0 -647
  226. package/configure/CHANGELOG.md +0 -1942
  227. package/configure/lib/defaults.js +0 -192
  228. package/configure/lib/defaults.js.map +0 -1
  229. package/configure/lib/index.js +0 -135
  230. package/configure/lib/index.js.map +0 -1
  231. package/configure/lib/inline-dropdown-toolbar.js +0 -457
  232. package/configure/lib/inline-dropdown-toolbar.js.map +0 -1
  233. package/configure/lib/main.js +0 -603
  234. package/configure/lib/main.js.map +0 -1
  235. package/configure/lib/markupUtils.js +0 -50
  236. package/configure/lib/markupUtils.js.map +0 -1
  237. package/configure/lib/response-area.js +0 -48
  238. package/configure/lib/response-area.js.map +0 -1
  239. package/configure/lib/utils.js +0 -22
  240. package/configure/lib/utils.js.map +0 -1
  241. package/configure/package.json +0 -24
  242. package/controller/CHANGELOG.json +0 -467
  243. package/controller/CHANGELOG.md +0 -1283
  244. package/controller/lib/defaults.js +0 -25
  245. package/controller/lib/defaults.js.map +0 -1
  246. package/controller/lib/index.js +0 -295
  247. package/controller/lib/index.js.map +0 -1
  248. package/controller/lib/utils.js +0 -32
  249. package/controller/lib/utils.js.map +0 -1
  250. package/controller/package.json +0 -16
  251. package/docs/config-schema.json +0 -2854
  252. package/docs/config-schema.json.md +0 -2106
  253. package/docs/demo/config.js +0 -8
  254. package/docs/demo/generate.js +0 -76
  255. package/docs/demo/index.html +0 -1
  256. package/docs/demo/session.js +0 -11
  257. package/docs/pie-schema.json +0 -1152
  258. package/docs/pie-schema.json.md +0 -814
  259. package/lib/index.js +0 -85
  260. package/lib/index.js.map +0 -1
  261. package/lib/inline-dropdown.js +0 -176
  262. package/lib/inline-dropdown.js.map +0 -1
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _default = exports.default = {
8
- alternateResponse: {},
9
- choiceRationaleEnabled: true,
10
- choices: {},
11
- disabled: false,
12
- displayType: 'block',
13
- markup: '',
14
- mode: 'gather',
15
- prompt: '',
16
- promptEnabled: true,
17
- rationale: '',
18
- rationaleEnabled: true,
19
- shuffle: true,
20
- studentInstructionsEnabled: true,
21
- teacherInstructions: '',
22
- teacherInstructionsEnabled: true,
23
- toolbarEditorPosition: 'bottom'
24
- };
25
- //# sourceMappingURL=defaults.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defaults.js","names":["alternateResponse","choiceRationaleEnabled","choices","disabled","displayType","markup","mode","prompt","promptEnabled","rationale","rationaleEnabled","shuffle","studentInstructionsEnabled","teacherInstructions","teacherInstructionsEnabled","toolbarEditorPosition"],"sources":["../src/defaults.js"],"sourcesContent":["export default {\n alternateResponse: {},\n choiceRationaleEnabled: true,\n choices: {},\n disabled: false,\n displayType: 'block',\n markup: '',\n mode: 'gather',\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n shuffle: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n"],"mappings":";;;;;;iCAAe;EACbA,iBAAiB,EAAE,CAAC,CAAC;EACrBC,sBAAsB,EAAE,IAAI;EAC5BC,OAAO,EAAE,CAAC,CAAC;EACXC,QAAQ,EAAE,KAAK;EACfC,WAAW,EAAE,OAAO;EACpBC,MAAM,EAAE,EAAE;EACVC,IAAI,EAAE,QAAQ;EACdC,MAAM,EAAE,EAAE;EACVC,aAAa,EAAE,IAAI;EACnBC,SAAS,EAAE,EAAE;EACbC,gBAAgB,EAAE,IAAI;EACtBC,OAAO,EAAE,IAAI;EACbC,0BAA0B,EAAE,IAAI;EAChCC,mBAAmB,EAAE,EAAE;EACvBC,0BAA0B,EAAE,IAAI;EAChCC,qBAAqB,EAAE;AACzB,CAAC","ignoreList":[]}
@@ -1,295 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.getScore = exports.getLogTrace = exports.createCorrectResponseSession = void 0;
8
- exports.model = model;
9
- exports.normalize = void 0;
10
- exports.outcome = outcome;
11
- exports.validate = void 0;
12
- var _lodashEs = require("lodash-es");
13
- var _controllerUtils = require("@pie-lib/controller-utils");
14
- var _defaults = _interopRequireDefault(require("./defaults"));
15
- var _utils = require("./utils");
16
- const getFeedback = correct => {
17
- if (correct) {
18
- return 'correct';
19
- }
20
- return 'incorrect';
21
- };
22
- const normalize = question => ({
23
- ..._defaults.default,
24
- ...question
25
- });
26
-
27
- /**
28
- *
29
- * @param {*} question
30
- * @param {*} session
31
- * @param {*} env
32
- * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.
33
- */
34
- exports.normalize = normalize;
35
- async function model(question, session, env, updateSession) {
36
- const normalizedQuestion = normalize(question);
37
- const {
38
- value = {}
39
- } = session || {};
40
- let choices = (0, _lodashEs.reduce)(normalizedQuestion.choices, (obj, area, key) => {
41
- obj[key] = (0, _lodashEs.map)(area, choice => choice);
42
- return obj;
43
- }, {});
44
- let feedback = {};
45
- if (env.mode === 'evaluate') {
46
- const allCorrectResponses = (0, _utils.getAllCorrectResponses)(normalizedQuestion);
47
- const respAreaLength = Object.keys(allCorrectResponses).length;
48
- let correctResponses = 0;
49
- for (let i = 0; i < respAreaLength; i++) {
50
- const result = (0, _lodashEs.reduce)(allCorrectResponses, (obj, choices, key) => {
51
- const answer = value && value[key] || '';
52
- const correctChoice = choices[i] || '';
53
- const isCorrect = answer && correctChoice && correctChoice === answer;
54
- obj.feedback[key] = getFeedback(isCorrect);
55
- if (isCorrect) {
56
- obj.correctResponses += 1;
57
- }
58
- return obj;
59
- }, {
60
- correctResponses: 0,
61
- feedback: {}
62
- });
63
- if (result.correctResponses >= correctResponses) {
64
- correctResponses = result.correctResponses;
65
- feedback = result.feedback;
66
- }
67
- if (result.correctResponses === respAreaLength) {
68
- break;
69
- }
70
- }
71
- }
72
- const lockChoiceOrder = (0, _controllerUtils.lockChoices)(normalizedQuestion, session, env);
73
- if (!lockChoiceOrder) {
74
- const shuffledValues = {};
75
- const keys = Object.keys(choices);
76
- const us = part => (id, element, update) => {
77
- return new Promise(resolve => {
78
- shuffledValues[part] = update.shuffledValues;
79
- resolve();
80
- });
81
- };
82
- let i;
83
- for (i = 0; i < keys.length; i++) {
84
- const key = keys[i];
85
- const storedValues = session?.shuffledValues?.[key];
86
- choices[key] = await (0, _controllerUtils.getShuffledChoices)(choices[key],
87
- // the shuffledValues structure was updated to an object like { choice_key: [] }
88
- // and we need to override shuffledValues if it's not an array
89
- {
90
- shuffledValues: Array.isArray(storedValues) ? storedValues : []
91
- }, us(key), 'value');
92
- }
93
- if (!(0, _lodashEs.isEmpty)(shuffledValues)) {
94
- if (session && updateSession && typeof updateSession === 'function') {
95
- updateSession(session.id, session.element, {
96
- shuffledValues
97
- }).catch(e => {
98
- // eslint-disable-next-line no-console
99
- console.error('update session failed', e);
100
- });
101
- }
102
- }
103
- }
104
- let teacherInstructions = null;
105
- let rationale = null;
106
- const choicesWillNullRationales = (Object.keys(choices) || []).reduce((acc, currentValue) => {
107
- acc[currentValue] = (choices[currentValue] || []).map(choice => ({
108
- ...choice,
109
- rationale: null
110
- }));
111
- return acc;
112
- }, {});
113
- if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {
114
- rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;
115
- teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;
116
- choices = normalizedQuestion.choiceRationaleEnabled ? normalizedQuestion.choices : choicesWillNullRationales;
117
- } else {
118
- rationale = null;
119
- teacherInstructions = null;
120
- choices = choicesWillNullRationales;
121
- }
122
- const out = {
123
- disabled: env.mode !== 'gather',
124
- mode: env.mode,
125
- prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,
126
- displayType: normalizedQuestion.displayType,
127
- markup: normalizedQuestion.markup,
128
- choices,
129
- feedback,
130
- responseCorrect: env.mode === 'evaluate' ? getScore(normalizedQuestion, session) === 1 : undefined,
131
- rationale,
132
- teacherInstructions,
133
- language: normalizedQuestion.language,
134
- extraCSSRules: normalizedQuestion.extraCSSRules
135
- };
136
- return out;
137
- }
138
- const getScore = (config, session) => {
139
- const {
140
- value = {}
141
- } = session || {};
142
- const maxScore = config && config.choices ? Object.keys(config.choices).length : 0;
143
- const allCorrectResponses = (0, _utils.getAllCorrectResponses)(config);
144
- let correctCount = 0;
145
- for (let i = 0; i < maxScore; i++) {
146
- const result = (0, _lodashEs.reduce)(allCorrectResponses, (total, choices, key) => {
147
- const answer = value && value[key] || '';
148
- const correctChoice = choices[i] || '';
149
- if (correctChoice && answer && correctChoice === answer) {
150
- return total;
151
- }
152
- return total - 1;
153
- }, maxScore);
154
- if (result > correctCount) {
155
- correctCount = result;
156
- }
157
- if (result === maxScore) {
158
- break;
159
- }
160
- }
161
- const str = (correctCount / maxScore).toFixed(2);
162
- return parseFloat(str);
163
- };
164
-
165
- /**
166
- * Generates detailed trace log for scoring evaluation
167
- * @param {Object} model - the question model
168
- * @param {Object} session - the student session
169
- * @param {Object} env - the environment
170
- * @returns {Array} traceLog - array of trace messages
171
- */
172
- exports.getScore = getScore;
173
- const getLogTrace = (model, session, env) => {
174
- const traceLog = [];
175
- const {
176
- value = {}
177
- } = session || {};
178
- const allCorrectResponses = (0, _utils.getAllCorrectResponses)(model);
179
- const responseAreaKeys = Object.keys(allCorrectResponses);
180
- const totalAreas = responseAreaKeys.length;
181
- traceLog.push(`${totalAreas} dropdown response area(s) defined in this question.`);
182
- if (value && Object.keys(value).length > 0) {
183
- const selectedAreas = Object.entries(value).filter(([key, val]) => val && val.trim()).length;
184
- traceLog.push(`Student selected options in ${selectedAreas} out of ${totalAreas} dropdown(s).`);
185
- responseAreaKeys.forEach(areaKey => {
186
- const studentSelection = value && value[areaKey] || '';
187
- const correctOptions = allCorrectResponses[areaKey] || [];
188
- if (studentSelection.trim()) {
189
- traceLog.push(`Dropdown ${parseInt(areaKey) + 1}: student selected '${studentSelection}' (correct options: [${correctOptions.map(opt => `'${opt}'`).join(', ')}]).`);
190
- } else {
191
- traceLog.push(`Dropdown ${parseInt(areaKey) + 1}: no selection made (correct options: [${correctOptions.map(opt => `'${opt}'`).join(', ')}]).`);
192
- }
193
- });
194
- } else {
195
- traceLog.push('Student did not make any selections in the dropdowns.');
196
- }
197
- const partialScoringEnabled = _controllerUtils.partialScoring.enabled(model, env);
198
- traceLog.push(`Scoring method: ${partialScoringEnabled ? 'partial scoring' : 'all-or-nothing scoring'}.`);
199
- const score = getScore(model, session);
200
- traceLog.push(`Final score: ${score}.`);
201
- return traceLog;
202
- };
203
-
204
- /**
205
- *
206
- * The score is partial by default for checkbox mode, allOrNothing for radio mode.
207
- * To disable partial scoring for checkbox mode you either set model.partialScoring = false or env.partialScoring =
208
- * false. the value in `env` will override the value in `model`.
209
- * @param {Object} model - the main model
210
- * @param {boolean} model.partialScoring - is partial scoring enabled (if undefined set to to true)
211
- * @param {*} session
212
- * @param {Object} env
213
- * @param {boolean} env.partialScoring - is partial scoring enabled (if undefined default to true) This overrides
214
- * `model.partialScoring`.
215
- */
216
- exports.getLogTrace = getLogTrace;
217
- function outcome(model, session, env = {}) {
218
- return new Promise(resolve => {
219
- if (!session || (0, _lodashEs.isEmpty)(session)) {
220
- resolve({
221
- score: 0,
222
- empty: true,
223
- traceLog: ['Student did not make any selections in the dropdowns. Score is 0.']
224
- });
225
- } else {
226
- const traceLog = getLogTrace(model, session, env);
227
- const score = getScore(model, session);
228
- const partialScoringEnabled = _controllerUtils.partialScoring.enabled(model, env);
229
- resolve({
230
- score: partialScoringEnabled ? score : Math.floor(score),
231
- empty: false,
232
- traceLog
233
- });
234
- }
235
- });
236
- }
237
- const createCorrectResponseSession = (question, env) => {
238
- return new Promise(resolve => {
239
- if (env.mode !== 'evaluate' && env.role === 'instructor') {
240
- const {
241
- choices
242
- } = question;
243
- const value = {};
244
- if (choices) {
245
- Object.keys(choices).forEach((key, i) => {
246
- const correctChoices = choices[key] && choices[key].filter(c => c.correct);
247
- value[i] = correctChoices && correctChoices[0].value;
248
- });
249
- }
250
- resolve({
251
- id: '1',
252
- value
253
- });
254
- } else {
255
- resolve(null);
256
- }
257
- });
258
- };
259
-
260
- // remove all html tags
261
- exports.createCorrectResponseSession = createCorrectResponseSession;
262
- const getInnerText = html => (html || '').replaceAll(/<[^>]*>/g, '');
263
-
264
- // remove all html tags except img, iframe and source tag for audio
265
- const getContent = html => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
266
- const validate = (model = {}, config = {}) => {
267
- const {
268
- markup,
269
- choices
270
- } = model;
271
- const {
272
- maxResponseAreas,
273
- maxResponseAreaChoices
274
- } = config;
275
- const errors = {};
276
- ['teacherInstructions', 'prompt', 'rationale'].forEach(field => {
277
- if (config[field]?.required && !getContent(model[field])) {
278
- errors[field] = 'This field is required.';
279
- }
280
- });
281
- const nbOfResponseAreas = ((markup || '').match(/\{\{(\d+)\}\}/g) || []).length;
282
- if (nbOfResponseAreas > maxResponseAreas) {
283
- errors.responseAreasError = `No more than ${maxResponseAreas} response areas should be defined.`;
284
- } else if (nbOfResponseAreas < 1) {
285
- errors.responseAreasError = 'There should be defined at least 1 response area.';
286
- }
287
- (Object.keys(choices) || []).forEach(choiceKey => {
288
- if (choices[choiceKey] && choices[choiceKey].length > maxResponseAreaChoices) {
289
- errors.responseAreaChoicesError = `No more than ${maxResponseAreaChoices} choices per response area should be defined.`;
290
- }
291
- });
292
- return errors;
293
- };
294
- exports.validate = validate;
295
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["_lodashEs","require","_controllerUtils","_defaults","_interopRequireDefault","_utils","getFeedback","correct","normalize","question","defaults","exports","model","session","env","updateSession","normalizedQuestion","value","choices","reduce","obj","area","key","map","choice","feedback","mode","allCorrectResponses","getAllCorrectResponses","respAreaLength","Object","keys","length","correctResponses","i","result","answer","correctChoice","isCorrect","lockChoiceOrder","lockChoices","shuffledValues","us","part","id","element","update","Promise","resolve","storedValues","getShuffledChoices","Array","isArray","isEmpty","catch","e","console","error","teacherInstructions","rationale","choicesWillNullRationales","acc","currentValue","role","rationaleEnabled","teacherInstructionsEnabled","choiceRationaleEnabled","out","disabled","prompt","promptEnabled","displayType","markup","responseCorrect","getScore","undefined","language","extraCSSRules","config","maxScore","correctCount","total","str","toFixed","parseFloat","getLogTrace","traceLog","responseAreaKeys","totalAreas","push","selectedAreas","entries","filter","val","trim","forEach","areaKey","studentSelection","correctOptions","parseInt","opt","join","partialScoringEnabled","partialScoring","enabled","score","outcome","empty","Math","floor","createCorrectResponseSession","correctChoices","c","getInnerText","html","replaceAll","getContent","replace","validate","maxResponseAreas","maxResponseAreaChoices","errors","field","required","nbOfResponseAreas","match","responseAreasError","choiceKey","responseAreaChoicesError"],"sources":["../src/index.js"],"sourcesContent":["import { isEmpty, map, reduce } from 'lodash-es';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-lib/controller-utils';\nimport defaults from './defaults';\n\nimport { getAllCorrectResponses } from './utils';\n\nconst getFeedback = (correct) => {\n if (correct) {\n return 'correct';\n }\n\n return 'incorrect';\n};\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.\n */\nexport async function model(question, session, env, updateSession) {\n const normalizedQuestion = normalize(question);\n const { value = {} } = session || {};\n let choices = reduce(\n normalizedQuestion.choices,\n (obj, area, key) => {\n obj[key] = map(area, (choice) => choice);\n\n return obj;\n },\n {},\n );\n\n let feedback = {};\n\n if (env.mode === 'evaluate') {\n const allCorrectResponses = getAllCorrectResponses(normalizedQuestion);\n const respAreaLength = Object.keys(allCorrectResponses).length;\n let correctResponses = 0;\n\n for (let i = 0; i < respAreaLength; i++) {\n const result = reduce(\n allCorrectResponses,\n (obj, choices, key) => {\n const answer = (value && value[key]) || '';\n const correctChoice = choices[i] || '';\n const isCorrect = answer && correctChoice && correctChoice === answer;\n\n obj.feedback[key] = getFeedback(isCorrect);\n\n if (isCorrect) {\n obj.correctResponses += 1;\n }\n\n return obj;\n },\n { correctResponses: 0, feedback: {} },\n );\n\n if (result.correctResponses >= correctResponses) {\n correctResponses = result.correctResponses;\n feedback = result.feedback;\n }\n\n if (result.correctResponses === respAreaLength) {\n break;\n }\n }\n }\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n if (!lockChoiceOrder) {\n const shuffledValues = {};\n const keys = Object.keys(choices);\n\n const us = (part) => (id, element, update) => {\n return new Promise((resolve) => {\n shuffledValues[part] = update.shuffledValues;\n resolve();\n });\n };\n\n let i;\n\n for (i = 0; i < keys.length; i++) {\n const key = keys[i];\n const storedValues = session?.shuffledValues?.[key];\n\n choices[key] = await getShuffledChoices(\n choices[key],\n // the shuffledValues structure was updated to an object like { choice_key: [] }\n // and we need to override shuffledValues if it's not an array\n { shuffledValues: Array.isArray(storedValues) ? storedValues : [] },\n us(key),\n 'value',\n );\n }\n\n if (!isEmpty(shuffledValues)) {\n if (session && updateSession && typeof updateSession === 'function') {\n updateSession(session.id, session.element, {\n shuffledValues,\n }).catch((e) => {\n // eslint-disable-next-line no-console\n console.error('update session failed', e);\n });\n }\n }\n }\n\n let teacherInstructions = null;\n let rationale = null;\n\n const choicesWillNullRationales = (Object.keys(choices) || []).reduce((acc, currentValue) => {\n acc[currentValue] = (choices[currentValue] || []).map((choice) => ({\n ...choice,\n rationale: null,\n }));\n\n return acc;\n }, {});\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;\n\n choices = normalizedQuestion.choiceRationaleEnabled ? normalizedQuestion.choices : choicesWillNullRationales;\n } else {\n rationale = null;\n teacherInstructions = null;\n choices = choicesWillNullRationales;\n }\n\n const out = {\n disabled: env.mode !== 'gather',\n mode: env.mode,\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n displayType: normalizedQuestion.displayType,\n markup: normalizedQuestion.markup,\n choices,\n feedback,\n\n responseCorrect: env.mode === 'evaluate' ? getScore(normalizedQuestion, session) === 1 : undefined,\n rationale,\n teacherInstructions,\n language: normalizedQuestion.language,\n extraCSSRules: normalizedQuestion.extraCSSRules,\n };\n\n return out;\n}\n\nexport const getScore = (config, session) => {\n const { value = {} } = session || {};\n const maxScore = config && config.choices ? Object.keys(config.choices).length : 0;\n const allCorrectResponses = getAllCorrectResponses(config);\n let correctCount = 0;\n\n for (let i = 0; i < maxScore; i++) {\n const result = reduce(\n allCorrectResponses,\n (total, choices, key) => {\n const answer = (value && value[key]) || '';\n const correctChoice = choices[i] || '';\n\n if (correctChoice && answer && correctChoice === answer) {\n return total;\n }\n\n return total - 1;\n },\n maxScore,\n );\n\n if (result > correctCount) {\n correctCount = result;\n }\n\n if (result === maxScore) {\n break;\n }\n }\n\n const str = (correctCount / maxScore).toFixed(2);\n\n return parseFloat(str);\n};\n\n/**\n * Generates detailed trace log for scoring evaluation\n * @param {Object} model - the question model\n * @param {Object} session - the student session\n * @param {Object} env - the environment\n * @returns {Array} traceLog - array of trace messages\n */\nexport const getLogTrace = (model, session, env) => {\n const traceLog = [];\n const { value = {} } = session || {};\n const allCorrectResponses = getAllCorrectResponses(model);\n const responseAreaKeys = Object.keys(allCorrectResponses);\n const totalAreas = responseAreaKeys.length;\n \n traceLog.push(`${totalAreas} dropdown response area(s) defined in this question.`);\n \n if (value && Object.keys(value).length > 0) {\n const selectedAreas = Object.entries(value).filter(([key, val]) => val && val.trim()).length;\n traceLog.push(`Student selected options in ${selectedAreas} out of ${totalAreas} dropdown(s).`);\n \n responseAreaKeys.forEach((areaKey) => {\n const studentSelection = (value && value[areaKey]) || '';\n const correctOptions = allCorrectResponses[areaKey] || [];\n \n if (studentSelection.trim()) {\n traceLog.push(`Dropdown ${parseInt(areaKey) + 1}: student selected '${studentSelection}' (correct options: [${correctOptions.map(opt => `'${opt}'`).join(', ')}]).`);\n } else {\n traceLog.push(`Dropdown ${parseInt(areaKey) + 1}: no selection made (correct options: [${correctOptions.map(opt => `'${opt}'`).join(', ')}]).`);\n }\n });\n } else {\n traceLog.push('Student did not make any selections in the dropdowns.');\n }\n\n const partialScoringEnabled = partialScoring.enabled(model, env);\n traceLog.push(\n `Scoring method: ${\n partialScoringEnabled ? 'partial scoring' : 'all-or-nothing scoring'\n }.`\n );\n\n const score = getScore(model, session);\n traceLog.push(`Final score: ${score}.`);\n\n return traceLog;\n}\n\n/**\n *\n * The score is partial by default for checkbox mode, allOrNothing for radio mode.\n * To disable partial scoring for checkbox mode you either set model.partialScoring = false or env.partialScoring =\n * false. the value in `env` will override the value in `model`.\n * @param {Object} model - the main model\n * @param {boolean} model.partialScoring - is partial scoring enabled (if undefined set to to true)\n * @param {*} session\n * @param {Object} env\n * @param {boolean} env.partialScoring - is partial scoring enabled (if undefined default to true) This overrides\n * `model.partialScoring`.\n */\nexport function outcome(model, session, env = {}) {\n return new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ \n score: 0, \n empty: true, \n traceLog: ['Student did not make any selections in the dropdowns. Score is 0.'] \n });\n } else {\n const traceLog = getLogTrace(model, session, env);\n const score = getScore(model, session);\n const partialScoringEnabled = partialScoring.enabled(model, env);\n\n resolve({\n score: partialScoringEnabled ? score : Math.floor(score),\n empty: false,\n traceLog\n });\n }\n });\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { choices } = question;\n const value = {};\n\n if (choices) {\n Object.keys(choices).forEach((key, i) => {\n const correctChoices = choices[key] && choices[key].filter((c) => c.correct);\n\n value[i] = correctChoices && correctChoices[0].value;\n });\n }\n\n resolve({\n id: '1',\n value,\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { markup, choices } = model;\n const { maxResponseAreas, maxResponseAreaChoices } = config;\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n const nbOfResponseAreas = ((markup || '').match(/\\{\\{(\\d+)\\}\\}/g) || []).length;\n\n if (nbOfResponseAreas > maxResponseAreas) {\n errors.responseAreasError = `No more than ${maxResponseAreas} response areas should be defined.`;\n } else if (nbOfResponseAreas < 1) {\n errors.responseAreasError = 'There should be defined at least 1 response area.';\n }\n\n (Object.keys(choices) || []).forEach((choiceKey) => {\n if (choices[choiceKey] && choices[choiceKey].length > maxResponseAreaChoices) {\n errors.responseAreaChoicesError = `No more than ${maxResponseAreaChoices} choices per response area should be defined.`;\n }\n });\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;A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AGwF,sBAAsB,EAAE;MAC5EC,MAAM,CAACO,wBAAwB,GAAG,gBAAgBR,sBAAsB,+CAA+C;IACzH;EACF,CAAC,CAAC;EAEF,OAAOC,MAAM;AACf,CAAC;AAAC9G,OAAA,CAAA2G,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getAllCorrectResponses = void 0;
7
- var _lodashEs = require("lodash-es");
8
- const getAllCorrectResponses = ({
9
- choices,
10
- alternateResponse
11
- }) => {
12
- alternateResponse = alternateResponse || {};
13
- const correctAnswers = {};
14
- (0, _lodashEs.forEach)(choices, (respArea, key) => {
15
- if (!correctAnswers[key]) {
16
- correctAnswers[key] = [];
17
- }
18
- if (respArea) {
19
- respArea.forEach(choice => {
20
- if (choice.correct) {
21
- correctAnswers[key].push(choice.value);
22
- if (alternateResponse[key]) {
23
- correctAnswers[key] = [...correctAnswers[key], ...alternateResponse[key]];
24
- }
25
- }
26
- });
27
- }
28
- });
29
- return correctAnswers;
30
- };
31
- exports.getAllCorrectResponses = getAllCorrectResponses;
32
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","names":["_lodashEs","require","getAllCorrectResponses","choices","alternateResponse","correctAnswers","forEach","respArea","key","choice","correct","push","value","exports"],"sources":["../src/utils.js"],"sourcesContent":["import { forEach } from 'lodash-es';\n\nexport const getAllCorrectResponses = ({ choices, alternateResponse }) => {\n alternateResponse = alternateResponse || {};\n const correctAnswers = {};\n\n forEach(choices, (respArea, key) => {\n if (!correctAnswers[key]) {\n correctAnswers[key] = [];\n }\n\n if (respArea) {\n respArea.forEach((choice) => {\n if (choice.correct) {\n correctAnswers[key].push(choice.value);\n\n if (alternateResponse[key]) {\n correctAnswers[key] = [...correctAnswers[key], ...alternateResponse[key]];\n }\n }\n });\n }\n });\n\n return correctAnswers;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEO,MAAMC,sBAAsB,GAAGA,CAAC;EAAEC,OAAO;EAAEC;AAAkB,CAAC,KAAK;EACxEA,iBAAiB,GAAGA,iBAAiB,IAAI,CAAC,CAAC;EAC3C,MAAMC,cAAc,GAAG,CAAC,CAAC;EAEzB,IAAAC,iBAAO,EAACH,OAAO,EAAE,CAACI,QAAQ,EAAEC,GAAG,KAAK;IAClC,IAAI,CAACH,cAAc,CAACG,GAAG,CAAC,EAAE;MACxBH,cAAc,CAACG,GAAG,CAAC,GAAG,EAAE;IAC1B;IAEA,IAAID,QAAQ,EAAE;MACZA,QAAQ,CAACD,OAAO,CAAEG,MAAM,IAAK;QAC3B,IAAIA,MAAM,CAACC,OAAO,EAAE;UAClBL,cAAc,CAACG,GAAG,CAAC,CAACG,IAAI,CAACF,MAAM,CAACG,KAAK,CAAC;UAEtC,IAAIR,iBAAiB,CAACI,GAAG,CAAC,EAAE;YAC1BH,cAAc,CAACG,GAAG,CAAC,GAAG,CAAC,GAAGH,cAAc,CAACG,GAAG,CAAC,EAAE,GAAGJ,iBAAiB,CAACI,GAAG,CAAC,CAAC;UAC3E;QACF;MACF,CAAC,CAAC;IACJ;EACF,CAAC,CAAC;EAEF,OAAOH,cAAc;AACvB,CAAC;AAACQ,OAAA,CAAAX,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -1,16 +0,0 @@
1
- {
2
- "name": "@pie-element/inline-dropdown-controller",
3
- "private": true,
4
- "version": "9.1.1",
5
- "description": "",
6
- "main": "lib/index.js",
7
- "module": "src/index.js",
8
- "author": "",
9
- "license": "ISC",
10
- "dependencies": {
11
- "@pie-lib/controller-utils": "2.0.2",
12
- "debug": "^4.1.1",
13
- "lodash-es": "^4.17.23",
14
- "type-of": "^2.0.1"
15
- }
16
- }