@pie-element/math-inline 5.6.1 → 5.6.4-next.1014
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.
- package/CHANGELOG.md +214 -0
- package/configure/CHANGELOG.md +188 -0
- package/configure/lib/configure.js +44 -9
- package/configure/lib/configure.js.map +1 -1
- package/configure/lib/defaults.js +32 -2
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/general-config-block.js +109 -23
- package/configure/lib/general-config-block.js.map +1 -1
- package/configure/lib/index.js +17 -3
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/response.js +89 -36
- package/configure/lib/response.js.map +1 -1
- package/configure/lib/utils.js +18 -1
- package/configure/lib/utils.js.map +1 -1
- package/configure/package.json +5 -6
- package/controller/CHANGELOG.md +112 -0
- package/controller/lib/defaults.js +2 -1
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +148 -131
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +2 -2
- package/docs/config-schema.json +147 -0
- package/docs/config-schema.json.md +116 -1
- package/docs/demo/generate.js +6 -3
- package/docs/pie-schema.json +122 -3
- package/docs/pie-schema.json.md +103 -3
- package/lib/index.js +7 -4
- package/lib/index.js.map +1 -1
- package/lib/main.js +230 -55
- package/lib/main.js.map +1 -1
- package/lib/print.js +133 -0
- package/lib/print.js.map +1 -0
- package/lib/simple-question-block.js +50 -38
- package/lib/simple-question-block.js.map +1 -1
- package/package.json +11 -7
package/docs/pie-schema.json.md
CHANGED
|
@@ -81,7 +81,19 @@ This element must be one of the following enum values:
|
|
|
81
81
|
* `literal`
|
|
82
82
|
* `symbolic`
|
|
83
83
|
|
|
84
|
-
Default: `"is
|
|
84
|
+
Default: `"is literal"`
|
|
85
|
+
|
|
86
|
+
## `ignoreOrder` (boolean, required)
|
|
87
|
+
|
|
88
|
+
Indicates if the order of expression elements in literal validation can be ignore - whilst the expression is still mathematically correct
|
|
89
|
+
|
|
90
|
+
Default: `"is false"`
|
|
91
|
+
|
|
92
|
+
## `allowTrailingZeros` (boolean, required)
|
|
93
|
+
|
|
94
|
+
Indicates the allowance of trailing zeros in expressions - whilst the expression is still mathematically correct
|
|
95
|
+
|
|
96
|
+
Default: `"is false"`
|
|
85
97
|
|
|
86
98
|
## `answer` (string, required)
|
|
87
99
|
|
|
@@ -109,7 +121,19 @@ This element must be one of the following enum values:
|
|
|
109
121
|
* `literal`
|
|
110
122
|
* `symbolic`
|
|
111
123
|
|
|
112
|
-
Default: `"is
|
|
124
|
+
Default: `"is literal"`
|
|
125
|
+
|
|
126
|
+
## `ignoreOrder` (boolean, required)
|
|
127
|
+
|
|
128
|
+
Indicates if the order of expression elements in literal validation can be ignore - whilst the expression is still mathematically correct
|
|
129
|
+
|
|
130
|
+
Default: `"is false"`
|
|
131
|
+
|
|
132
|
+
## `allowTrailingZeros` (boolean, required)
|
|
133
|
+
|
|
134
|
+
Indicates the allowance of trailing zeros in expressions - whilst the expression is still mathematically correct
|
|
135
|
+
|
|
136
|
+
Default: `"is false"`
|
|
113
137
|
|
|
114
138
|
## `answer` (string, required)
|
|
115
139
|
|
|
@@ -125,6 +149,18 @@ an object with some alternatives for the correct answers
|
|
|
125
149
|
Indicates if partial scoring is allowed.
|
|
126
150
|
This property is not used yet.
|
|
127
151
|
|
|
152
|
+
# `ignoreOrderDefault` (boolean, required)
|
|
153
|
+
|
|
154
|
+
Indicates the default value for ignoreOrder, in case that it's not set
|
|
155
|
+
|
|
156
|
+
Default: `"is false"`
|
|
157
|
+
|
|
158
|
+
# `allowTrailingZerosDefault` (boolean, required)
|
|
159
|
+
|
|
160
|
+
Indicates the default value for allowTrailingZeros, in case that it's not set
|
|
161
|
+
|
|
162
|
+
Default: `"is false"`
|
|
163
|
+
|
|
128
164
|
# `rationale` (string)
|
|
129
165
|
|
|
130
166
|
Indicates the value for rationale
|
|
@@ -160,6 +196,10 @@ Indicates if Feedback is enabled
|
|
|
160
196
|
|
|
161
197
|
Indicates if Rationale are enabled
|
|
162
198
|
|
|
199
|
+
# `spellCheckEnabled` (boolean, required)
|
|
200
|
+
|
|
201
|
+
Indicates if spellcheck is enabled for the author. Default value is true
|
|
202
|
+
|
|
163
203
|
# `studentInstructionsEnabled` (boolean, required)
|
|
164
204
|
|
|
165
205
|
Indicates if Student Instructions are enabled
|
|
@@ -168,6 +208,21 @@ Indicates if Student Instructions are enabled
|
|
|
168
208
|
|
|
169
209
|
Indicates if Teacher Instructions are enabled
|
|
170
210
|
|
|
211
|
+
# `note` (string)
|
|
212
|
+
|
|
213
|
+
Indicates the note for the answer
|
|
214
|
+
|
|
215
|
+
# `toolbarEditorPosition` (string, enum)
|
|
216
|
+
|
|
217
|
+
Indicates the editor's toolbar position which can be 'bottom' or 'top'
|
|
218
|
+
|
|
219
|
+
This element must be one of the following enum values:
|
|
220
|
+
|
|
221
|
+
* `bottom`
|
|
222
|
+
* `top`
|
|
223
|
+
|
|
224
|
+
Default: `": 'bottom'"`
|
|
225
|
+
|
|
171
226
|
# `id` (string, required)
|
|
172
227
|
|
|
173
228
|
Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.
|
|
@@ -194,6 +249,39 @@ Indicates if the item has to be displayed in the Settings Panel
|
|
|
194
249
|
|
|
195
250
|
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
196
251
|
|
|
252
|
+
## `ConfigurePropWithEnabled` (object)
|
|
253
|
+
|
|
254
|
+
Properties of the `ConfigurePropWithEnabled` object:
|
|
255
|
+
|
|
256
|
+
### `settings` (boolean)
|
|
257
|
+
|
|
258
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
259
|
+
|
|
260
|
+
### `label` (string)
|
|
261
|
+
|
|
262
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
263
|
+
|
|
264
|
+
### `enabled` (boolean)
|
|
265
|
+
|
|
266
|
+
Indicates the value of the item if it affects config-ui
|
|
267
|
+
(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
|
|
268
|
+
|
|
269
|
+
## `ConfigureMaxImageDimensionsProp` (object)
|
|
270
|
+
|
|
271
|
+
Properties of the `ConfigureMaxImageDimensionsProp` object:
|
|
272
|
+
|
|
273
|
+
### `teacherInstructions` (number)
|
|
274
|
+
|
|
275
|
+
Indicates the max dimension for images in teacher instructions
|
|
276
|
+
|
|
277
|
+
### `prompt` (number)
|
|
278
|
+
|
|
279
|
+
Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
|
|
280
|
+
|
|
281
|
+
### `rationale` (number)
|
|
282
|
+
|
|
283
|
+
Indicates the max dimension for images in rationale
|
|
284
|
+
|
|
197
285
|
## `ComplexFeedbackType` (object)
|
|
198
286
|
|
|
199
287
|
Properties of the `ComplexFeedbackType` object:
|
|
@@ -260,7 +348,19 @@ This element must be one of the following enum values:
|
|
|
260
348
|
* `literal`
|
|
261
349
|
* `symbolic`
|
|
262
350
|
|
|
263
|
-
Default: `"is
|
|
351
|
+
Default: `"is literal"`
|
|
352
|
+
|
|
353
|
+
### `ignoreOrder` (boolean, required)
|
|
354
|
+
|
|
355
|
+
Indicates if the order of expression elements in literal validation can be ignore - whilst the expression is still mathematically correct
|
|
356
|
+
|
|
357
|
+
Default: `"is false"`
|
|
358
|
+
|
|
359
|
+
### `allowTrailingZeros` (boolean, required)
|
|
360
|
+
|
|
361
|
+
Indicates the allowance of trailing zeros in expressions - whilst the expression is still mathematically correct
|
|
362
|
+
|
|
363
|
+
Default: `"is false"`
|
|
264
364
|
|
|
265
365
|
### `answer` (string, required)
|
|
266
366
|
|
package/lib/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var _defaults = _interopRequireDefault(require("../configure/lib/defaults"));
|
|
|
41
41
|
|
|
42
42
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
43
43
|
|
|
44
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
44
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
45
|
|
|
46
46
|
var log = (0, _debug["default"])('pie-ui:math-inline');
|
|
47
47
|
|
|
@@ -56,8 +56,8 @@ var MathInline = /*#__PURE__*/function (_HTMLElement) {
|
|
|
56
56
|
(0, _classCallCheck2["default"])(this, MathInline);
|
|
57
57
|
_this = _super.call(this);
|
|
58
58
|
_this._configuration = _defaults["default"].configuration;
|
|
59
|
-
_this.sessionChangedEventCaller = _lodash["default"].debounce(function (
|
|
60
|
-
_this.dispatchEvent(new _piePlayerEvents.SessionChangedEvent(
|
|
59
|
+
_this.sessionChangedEventCaller = _lodash["default"].debounce(function () {
|
|
60
|
+
_this.dispatchEvent(new _piePlayerEvents.SessionChangedEvent(_this.tagName.toLowerCase(), true));
|
|
61
61
|
}, 1000);
|
|
62
62
|
return _this;
|
|
63
63
|
}
|
|
@@ -72,6 +72,9 @@ var MathInline = /*#__PURE__*/function (_HTMLElement) {
|
|
|
72
72
|
}
|
|
73
73
|
}, {
|
|
74
74
|
key: "session",
|
|
75
|
+
get: function get() {
|
|
76
|
+
return this._session;
|
|
77
|
+
},
|
|
75
78
|
set: function set(s) {
|
|
76
79
|
this._session = s;
|
|
77
80
|
|
|
@@ -92,7 +95,7 @@ var MathInline = /*#__PURE__*/function (_HTMLElement) {
|
|
|
92
95
|
Object.keys(s).map(function (key) {
|
|
93
96
|
_this2._session[key] = s[key];
|
|
94
97
|
});
|
|
95
|
-
this.sessionChangedEventCaller(
|
|
98
|
+
this.sessionChangedEventCaller();
|
|
96
99
|
log('session: ', this._session);
|
|
97
100
|
}
|
|
98
101
|
}, {
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["log","MathInline","_configuration","defaults","configuration","sessionChangedEventCaller","_","debounce","
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["log","MathInline","_configuration","defaults","configuration","sessionChangedEventCaller","_","debounce","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","m","_model","ModelSetEvent","_render","_session","s","c","Object","keys","map","key","el","React","createElement","Main","model","session","onSessionChange","sessionChanged","bind","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAIA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,oBAAN,CAAZ;;IAIqBC,U;;;;;AACnB,wBAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,cAAL,GAAsBC,qBAASC,aAA/B;AACA,UAAKC,yBAAL,GAAiCC,mBAAEC,QAAF,CAAW,YAAM;AAChD,YAAKC,aAAL,CAAmB,IAAIC,oCAAJ,CAAwB,MAAKC,OAAL,CAAaC,WAAb,EAAxB,EAAoD,IAApD,CAAnB;AACD,KAFgC,EAE9B,IAF8B,CAAjC;AAHY;AAMb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKC,MAAL,GAAcD,CAAd;AACA,WAAKJ,aAAL,CAAmB,IAAIM,8BAAJ,CAAkB,KAAKD,MAAvB,EAA+B,IAA/B,EAAqC,CAAC,CAAC,KAAKA,MAA5C,CAAnB;;AACA,WAAKE,OAAL;AACD;;;SAOD,eAAc;AACZ,aAAO,KAAKC,QAAZ;AACD,K;SAPD,aAAYC,CAAZ,EAAe;AACb,WAAKD,QAAL,GAAgBC,CAAhB;;AACA,WAAKF,OAAL;AACD;;;SAMD,aAAkBG,CAAlB,EAAqB;AACnB,WAAKhB,cAAL,GAAsBgB,CAAtB;;AACA,WAAKH,OAAL;AACD;;;WAED,wBAAeE,CAAf,EAAkB;AAAA;;AAChBE,MAAAA,MAAM,CAACC,IAAP,CAAYH,CAAZ,EAAeI,GAAf,CAAmB,UAAAC,GAAG,EAAI;AACxB,QAAA,MAAI,CAACN,QAAL,CAAcM,GAAd,IAAqBL,CAAC,CAACK,GAAD,CAAtB;AACD,OAFD;AAIA,WAAKjB,yBAAL;AACAL,MAAAA,GAAG,CAAC,WAAD,EAAc,KAAKgB,QAAnB,CAAH;AACD;;;WAED,6BAAoB;AAClB,WAAKD,OAAL;AACD;;;WAED,mBAAU;AACR,UAAI,CAAC,KAAKF,MAAN,IAAgB,CAAC,KAAKG,QAA1B,EAAoC;AAClC;AACD;;AAED,UAAMO,EAAE,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACnCC,QAAAA,KAAK,EAAE,KAAKd,MADuB;AAEnCe,QAAAA,OAAO,EAAE,KAAKZ,QAFqB;AAGnCZ,QAAAA,aAAa,EAAE,KAAKF,cAHe;AAInC2B,QAAAA,eAAe,EAAE,KAAKC,cAAL,CAAoBC,IAApB,CAAyB,IAAzB;AAJkB,OAA1B,CAAX;;AAOAC,2BAASC,MAAT,CAAgBV,EAAhB,EAAoB,IAApB;AACD;;;kDAvDqCW,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport Main from './main';\nimport debug from 'debug';\nimport _ from 'lodash';\n\nimport {\n ModelSetEvent,\n SessionChangedEvent,\n} from '@pie-framework/pie-player-events';\nimport defaults from '../configure/lib/defaults';\n\nconst log = debug('pie-ui:math-inline');\n\nexport { Main as Component };\n\nexport default class MathInline extends HTMLElement {\n constructor() {\n super();\n this._configuration = defaults.configuration;\n this.sessionChangedEventCaller = _.debounce(() => {\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), true));\n }, 1000);\n }\n\n set model(m) {\n this._model = m;\n this.dispatchEvent(new ModelSetEvent(this._model, true, !!this._model));\n this._render();\n }\n\n set session(s) {\n this._session = s;\n this._render();\n }\n\n get session() {\n return this._session;\n }\n\n set configuration(c) {\n this._configuration = c;\n this._render();\n }\n\n sessionChanged(s) {\n Object.keys(s).map(key => {\n this._session[key] = s[key];\n });\n\n this.sessionChangedEventCaller();\n log('session: ', this._session);\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n if (!this._model || !this._session) {\n return;\n }\n\n const el = React.createElement(Main, {\n model: this._model,\n session: this._session,\n configuration: this._configuration,\n onSessionChange: this.sessionChanged.bind(this),\n });\n\n ReactDOM.render(el, this);\n }\n}\n"],"file":"index.js"}
|