@pie-element/ebsr 10.7.2 → 10.7.3-next.12

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 (66) hide show
  1. package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.json +1972 -0
  2. package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.md +4144 -0
  3. package/configure/node_modules/@pie-element/multiple-choice/LICENSE.md +5 -0
  4. package/configure/node_modules/@pie-element/multiple-choice/PRINT.md +35 -0
  5. package/configure/node_modules/@pie-element/multiple-choice/README.md +56 -0
  6. package/configure/node_modules/@pie-element/multiple-choice/choice.png +0 -0
  7. package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.json +1387 -0
  8. package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.md +3316 -0
  9. package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js +202 -0
  10. package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js.map +1 -0
  11. package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js +248 -0
  12. package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js.map +1 -0
  13. package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js +597 -0
  14. package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js.map +1 -0
  15. package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js +18 -0
  16. package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js.map +1 -0
  17. package/configure/node_modules/@pie-element/multiple-choice/configure/package.json +18 -0
  18. package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.json +527 -0
  19. package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.md +2281 -0
  20. package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js +34 -0
  21. package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js.map +1 -0
  22. package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js +346 -0
  23. package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js.map +1 -0
  24. package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js +28 -0
  25. package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js.map +1 -0
  26. package/configure/node_modules/@pie-element/multiple-choice/controller/package.json +15 -0
  27. package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json +2993 -0
  28. package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json.md +2217 -0
  29. package/configure/node_modules/@pie-element/multiple-choice/docs/demo/config.js +8 -0
  30. package/configure/node_modules/@pie-element/multiple-choice/docs/demo/generate.js +61 -0
  31. package/configure/node_modules/@pie-element/multiple-choice/docs/demo/index.html +1 -0
  32. package/configure/node_modules/@pie-element/multiple-choice/docs/demo/session.js +7 -0
  33. package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json +1332 -0
  34. package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json.md +1015 -0
  35. package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js +427 -0
  36. package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js.map +1 -0
  37. package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js +252 -0
  38. package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js.map +1 -0
  39. package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js +174 -0
  40. package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js.map +1 -0
  41. package/configure/node_modules/@pie-element/multiple-choice/lib/index.js +388 -0
  42. package/configure/node_modules/@pie-element/multiple-choice/lib/index.js.map +1 -0
  43. package/configure/node_modules/@pie-element/multiple-choice/lib/main.js +108 -0
  44. package/configure/node_modules/@pie-element/multiple-choice/lib/main.js.map +1 -0
  45. package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js +469 -0
  46. package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js.map +1 -0
  47. package/configure/node_modules/@pie-element/multiple-choice/lib/print.js +129 -0
  48. package/configure/node_modules/@pie-element/multiple-choice/lib/print.js.map +1 -0
  49. package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js +48 -0
  50. package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js.map +1 -0
  51. package/configure/node_modules/@pie-element/multiple-choice/module/configure.js +1 -0
  52. package/configure/node_modules/@pie-element/multiple-choice/module/controller.js +3611 -0
  53. package/configure/node_modules/@pie-element/multiple-choice/module/demo.js +86 -0
  54. package/configure/node_modules/@pie-element/multiple-choice/module/element.js +1 -0
  55. package/configure/node_modules/@pie-element/multiple-choice/module/index.html +21 -0
  56. package/configure/node_modules/@pie-element/multiple-choice/module/manifest.json +10 -0
  57. package/configure/node_modules/@pie-element/multiple-choice/module/print-demo.js +124 -0
  58. package/configure/node_modules/@pie-element/multiple-choice/module/print.html +18 -0
  59. package/configure/node_modules/@pie-element/multiple-choice/module/print.js +1 -0
  60. package/configure/node_modules/@pie-element/multiple-choice/package.json +32 -0
  61. package/module/element.js +1 -1
  62. package/module/index.html +1 -1
  63. package/module/manifest.json +5 -1
  64. package/module/print.html +1 -1
  65. package/module/print.js +1 -1
  66. package/package.json +3 -3
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/print.js"],"names":["log","preparePrintModel","model","opts","instr","role","prompt","promptEnabled","undefined","teacherInstructions","teacherInstructionsEnabled","showTeacherInstructions","alwaysShowCorrect","mode","disabled","animationsDisabled","lockChoiceOrder","choicesLayout","choices","map","c","rationale","rationaleEnabled","hideTick","feedback","keyMode","choicePrefix","MultipleChoicePrint","_options","_model","_session","_rerender","printModel","element","React","createElement","Main","session","ReactDOM","render","leading","trailing","o","s","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,mCAAN,CAAZ;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAA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,IAAsB,SAAtC;AAEA,SAAOxB,KAAP;AACD,CA3BD;;IA6BqByB,mB;;;;;AACnB,iCAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,QAAL,GAAgB,IAAhB;AACA,UAAKC,MAAL,GAAc,IAAd;AACA,UAAKC,QAAL,GAAgB,EAAhB;AACA,UAAKC,SAAL,GAAiB,0BACf,YAAM;AACJ,UAAI,MAAKF,MAAL,IAAe,MAAKC,QAAxB,EAAkC;AAChC,YAAME,UAAU,GAAG/B,iBAAiB,CAAC,MAAK4B,MAAN,EAAc,MAAKD,QAAnB,CAApC;;AAEA,YAAMK,OAAO,GACX,MAAKL,QAAL,iBACAM,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACxBlC,UAAAA,KAAK,EAAE8B,UADiB;AAExBK,UAAAA,OAAO,EAAE;AAFe,SAA1B,CAFF;;AAOAC,6BAASC,MAAT,CAAgBN,OAAhB,kDAA+B,YAAM;AACnCjC,UAAAA,GAAG,CAAC,+BAAD,CAAH;AACA;AACD,SAHD;AAID,OAdD,MAcO;AACLA,QAAAA,GAAG,CAAC,MAAD,CAAH;AACD;AACF,KAnBc,EAoBf,EApBe,EAqBf;AAAEwC,MAAAA,OAAO,EAAE,KAAX;AAAkBC,MAAAA,QAAQ,EAAE;AAA5B,KArBe,CAAjB;AALY;AA4Bb;;;;SACD,aAAYC,CAAZ,EAAe;AACb,WAAKd,QAAL,GAAgBc,CAAhB;AACD;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKd,MAAL,GAAcc,CAAd;;AACA,WAAKZ,SAAL;AACD;;;WAED,6BAAoB,CAAE;;;kDAvCyBa,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport debounce from 'lodash/debounce';\nimport cloneDeep from 'lodash/cloneDeep';\nimport Main from './main';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering';\nimport debug from 'debug';\n\nconst log = debug('pie-element:multiple-choice:print');\n\n/**\n * Live in same package as main element - so we can access some of the shared comps!\n *\n * - update pslb to build print if src/print.js is there\n * - update demo el\n * - get configure/controller building\n */\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n\n model.prompt = model.promptEnabled !== false ? model.prompt : undefined;\n model.teacherInstructions =\n instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;\n model.showTeacherInstructions = instr;\n model.alwaysShowCorrect = instr;\n model.mode = instr ? 'evaluate' : model.mode;\n\n model.disabled = true;\n model.animationsDisabled = true;\n model.lockChoiceOrder = true;\n model.choicesLayout = model.choicesLayout || 'vertical';\n\n const choices = cloneDeep(model.choices);\n\n model.choices = choices.map((c) => {\n c.rationale = instr && model.rationaleEnabled !== false ? c.rationale : undefined;\n c.hideTick = instr;\n c.feedback = undefined;\n return c;\n });\n\n model.keyMode = model.choicePrefix || 'letters';\n\n return model;\n};\n\nexport default class MultipleChoicePrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element =\n this._options &&\n React.createElement(Main, {\n model: printModel,\n session: {},\n });\n\n ReactDOM.render(element, this, () => {\n log('render complete - render math');\n renderMath(this);\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n set options(o) {\n this._options = o;\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\n}\n"],"file":"print.js"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.updateSessionMetadata = updateSessionMetadata;
9
+ exports.updateSessionValue = updateSessionValue;
10
+
11
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
12
+
13
+ function updateSessionValue(session, choiceMode, data) {
14
+ session.value = session.value || [];
15
+
16
+ if (choiceMode === 'checkbox') {
17
+ if (data.selected) {
18
+ session.value = Array.from(new Set([].concat((0, _toConsumableArray2["default"])(session.value), [data.value])));
19
+ } else {
20
+ session.value = session.value.filter(function (v) {
21
+ return v !== data.value;
22
+ });
23
+ }
24
+ }
25
+
26
+ if (choiceMode === 'radio') {
27
+ if (data.selected) {
28
+ session.value = [data.value];
29
+ } else {
30
+ session.value = [];
31
+ }
32
+ } //update session value metadata
33
+
34
+
35
+ session.selector = data.selector; //the input method used to select the choice (e.g. mouse, keyboard)
36
+ }
37
+
38
+ function updateSessionMetadata(session, metadata) {
39
+ session.audioStartTime = session.audioStartTime || metadata.audioStartTime; //timestamp when auto-played audio started playing
40
+
41
+ session.audioEndTime = session.audioEndTime || metadata.audioEndTime; //timestamp when auto-played audio completed playing
42
+
43
+ if (!session.waitTime && session.audioStartTime && session.audioEndTime) {
44
+ // waitTime is elapsed time the user waited for auto-played audio to finish
45
+ session.waitTime = session.audioEndTime - session.audioStartTime;
46
+ }
47
+ }
48
+ //# sourceMappingURL=session-updater.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/session-updater.js"],"names":["updateSessionValue","session","choiceMode","data","value","selected","Array","from","Set","filter","v","selector","updateSessionMetadata","metadata","audioStartTime","audioEndTime","waitTime"],"mappings":";;;;;;;;;;;;AAAO,SAASA,kBAAT,CAA4BC,OAA5B,EAAqCC,UAArC,EAAiDC,IAAjD,EAAuD;AAC5DF,EAAAA,OAAO,CAACG,KAAR,GAAgBH,OAAO,CAACG,KAAR,IAAiB,EAAjC;;AACA,MAAIF,UAAU,KAAK,UAAnB,EAA+B;AAC7B,QAAIC,IAAI,CAACE,QAAT,EAAmB;AACjBJ,MAAAA,OAAO,CAACG,KAAR,GAAgBE,KAAK,CAACC,IAAN,CAAW,IAAIC,GAAJ,+CAAYP,OAAO,CAACG,KAApB,IAA2BD,IAAI,CAACC,KAAhC,GAAX,CAAhB;AACD,KAFD,MAEO;AACLH,MAAAA,OAAO,CAACG,KAAR,GAAgBH,OAAO,CAACG,KAAR,CAAcK,MAAd,CAAqB,UAAAC,CAAC;AAAA,eAAIA,CAAC,KAAKP,IAAI,CAACC,KAAf;AAAA,OAAtB,CAAhB;AACD;AACF;;AAED,MAAIF,UAAU,KAAK,OAAnB,EAA4B;AAC1B,QAAIC,IAAI,CAACE,QAAT,EAAmB;AACjBJ,MAAAA,OAAO,CAACG,KAAR,GAAgB,CAACD,IAAI,CAACC,KAAN,CAAhB;AACD,KAFD,MAEO;AACLH,MAAAA,OAAO,CAACG,KAAR,GAAgB,EAAhB;AACD;AACF,GAhB2D,CAkB5D;;;AACAH,EAAAA,OAAO,CAACU,QAAR,GAAmBR,IAAI,CAACQ,QAAxB,CAnB4D,CAmB1B;AACnC;;AAEM,SAASC,qBAAT,CAA+BX,OAA/B,EAAwCY,QAAxC,EAAkD;AACvDZ,EAAAA,OAAO,CAACa,cAAR,GAAyBb,OAAO,CAACa,cAAR,IAA0BD,QAAQ,CAACC,cAA5D,CADuD,CACqB;;AAC5Eb,EAAAA,OAAO,CAACc,YAAR,GAAuBd,OAAO,CAACc,YAAR,IAAwBF,QAAQ,CAACE,YAAxD,CAFuD,CAEe;;AAEtE,MAAG,CAACd,OAAO,CAACe,QAAT,IAAqBf,OAAO,CAACa,cAA7B,IAA+Cb,OAAO,CAACc,YAA1D,EAAwE;AACtE;AACAd,IAAAA,OAAO,CAACe,QAAR,GAAoBf,OAAO,CAACc,YAAR,GAAuBd,OAAO,CAACa,cAAnD;AACD;AACF","sourcesContent":["export function updateSessionValue(session, choiceMode, data) {\n session.value = session.value || [];\n if (choiceMode === 'checkbox') {\n if (data.selected) {\n session.value = Array.from(new Set([...session.value, data.value]));\n } else {\n session.value = session.value.filter(v => v !== data.value);\n }\n }\n\n if (choiceMode === 'radio') {\n if (data.selected) {\n session.value = [data.value];\n } else {\n session.value = [];\n }\n }\n \n //update session value metadata\n session.selector = data.selector; //the input method used to select the choice (e.g. mouse, keyboard)\n}\n\nexport function updateSessionMetadata(session, metadata) {\n session.audioStartTime = session.audioStartTime || metadata.audioStartTime; //timestamp when auto-played audio started playing\n session.audioEndTime = session.audioEndTime || metadata.audioEndTime; //timestamp when auto-played audio completed playing\n \n if(!session.waitTime && session.audioStartTime && session.audioEndTime) {\n // waitTime is elapsed time the user waited for auto-played audio to finish\n session.waitTime = (session.audioEndTime - session.audioStartTime);\n }\n}\n"],"file":"session-updater.js"}