@pie-element/ebsr 7.0.22 → 7.0.24-next.2
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 +0 -16
- package/configure/CHANGELOG.md +0 -16
- package/configure/lib/main.js +6 -4
- package/configure/lib/main.js.map +1 -1
- package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.json +1972 -0
- package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.md +1793 -0
- package/{LICENSE.md → configure/node_modules/@pie-element/multiple-choice/LICENSE.md} +0 -0
- package/configure/node_modules/@pie-element/multiple-choice/PRINT.md +35 -0
- package/configure/node_modules/@pie-element/multiple-choice/README.md +56 -0
- package/configure/node_modules/@pie-element/multiple-choice/choice.png +0 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.json +1387 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.md +1334 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js +104 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js +198 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js +599 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js +18 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/package.json +20 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.json +527 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.md +768 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js +18 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js +305 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js +36 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/package.json +15 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json +353 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json.md +277 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/config.js +8 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/generate.js +52 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/index.html +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/session.js +7 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json +338 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json.md +274 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js +298 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js +157 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js +174 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/index.js +151 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/main.js +97 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/main.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js +254 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/print.js +129 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/print.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js +35 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/configure.js +843 -0
- package/{module → configure/node_modules/@pie-element/multiple-choice/module}/controller.js +17304 -17374
- package/configure/node_modules/@pie-element/multiple-choice/module/demo.js +77 -0
- package/{module → configure/node_modules/@pie-element/multiple-choice/module}/element.js +42 -171
- package/{module → configure/node_modules/@pie-element/multiple-choice/module}/index.html +1 -1
- package/{module → configure/node_modules/@pie-element/multiple-choice/module}/manifest.json +4 -4
- package/{module → configure/node_modules/@pie-element/multiple-choice/module}/print-demo.js +46 -46
- package/{module → configure/node_modules/@pie-element/multiple-choice/module}/print.html +1 -1
- package/{module → configure/node_modules/@pie-element/multiple-choice/module}/print.js +70 -259
- package/configure/node_modules/@pie-element/multiple-choice/package.json +34 -0
- package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.json +672 -0
- package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.md +427 -0
- package/configure/node_modules/@pie-lib/math-rendering/LICENSE.md +5 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/index.js +30 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js +316 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/index.js +23 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/mml.js +123 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/mml.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/normalization.js +103 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/normalization.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/render-math.js +275 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/render-math.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/package.json +19 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/demo.html +872 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/demo.js +108 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/main.html +156 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/main.js +16 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/webpack.config.js +29 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/index.js +4 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/chtml.js +215 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/index.js +13 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/mml.js +24 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/normalization.js +69 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/render-math.js +234 -0
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.json +937 -0
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.md +602 -0
- package/configure/node_modules/@pie-lib/render-ui/LICENSE.md +5 -0
- package/configure/node_modules/@pie-lib/render-ui/README.md +33 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js +146 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/color.js +134 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/color.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js +160 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js +24 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js +102 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/index.js +104 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js +60 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js +133 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js +162 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js +28 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/readable.js +28 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/readable.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js +160 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js +206 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/package.json +30 -0
- package/configure/node_modules/@pie-lib/render-ui/src/collapsible/index.jsx +68 -0
- package/configure/node_modules/@pie-lib/render-ui/src/color.js +48 -0
- package/configure/node_modules/@pie-lib/render-ui/src/feedback.jsx +100 -0
- package/configure/node_modules/@pie-lib/render-ui/src/has-text.js +14 -0
- package/configure/node_modules/@pie-lib/render-ui/src/html-and-math.js +40 -0
- package/configure/node_modules/@pie-lib/render-ui/src/index.js +27 -0
- package/configure/node_modules/@pie-lib/render-ui/src/input-container.jsx +41 -0
- package/configure/node_modules/@pie-lib/render-ui/src/preview-layout.jsx +77 -0
- package/configure/node_modules/@pie-lib/render-ui/src/preview-prompt.jsx +90 -0
- package/configure/node_modules/@pie-lib/render-ui/src/purpose.jsx +19 -0
- package/configure/node_modules/@pie-lib/render-ui/src/readable.jsx +19 -0
- package/configure/node_modules/@pie-lib/render-ui/src/response-indicators.jsx +89 -0
- package/configure/node_modules/@pie-lib/render-ui/src/withUndoReset.jsx +118 -0
- package/configure/package.json +3 -3
- package/configure/src/__tests__/index.test.js +4 -2
- package/configure/src/main.jsx +8 -3
- package/controller/lib/index.js +79 -3
- package/controller/lib/index.js.map +1 -1
- package/controller/src/index.js +55 -0
- package/package.json +3 -3
- package/module/configure.js +0 -472
- package/module/demo.js +0 -77
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {_dll_prop_types, _dll_react_dom, _dll_react, _dll_material_ui__core_styles, _dll_pie_lib__render_ui, _dll_material_ui__core, _dll_classnames, _dll_pie_lib__correct_answer_toggle, _dll_lodash, _dll_debug} from "../../../@pie-lib/shared-module@^1.4.
|
|
2
|
-
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.1.
|
|
1
|
+
import {_dll_prop_types, _dll_react_dom, _dll_react, _dll_material_ui__core_styles, _dll_pie_lib__render_ui, _dll_material_ui__core, _dll_classnames, _dll_pie_lib__correct_answer_toggle, _dll_lodash, _dll_debug} from "../../../@pie-lib/shared-module@^1.4.17/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.1.5/module/index.js";
|
|
3
3
|
function getDefaultExportFromCjs(x) {
|
|
4
4
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
5
5
|
}
|
|
@@ -1259,6 +1259,7 @@ const {color: color$1} = _dll_pie_lib__render_ui;
|
|
|
1259
1259
|
const {PreviewPrompt: PreviewPrompt$1} = _dll_pie_lib__render_ui;
|
|
1260
1260
|
const classNames$3 = _dll_classnames;
|
|
1261
1261
|
const _jsxFileName$3 = "/home/circleci/repo/packages/multiple-choice/src/choice-input.jsx";
|
|
1262
|
+
const CLASS_NAME = 'multiple-choice-component';
|
|
1262
1263
|
const styleSheet = () => ({
|
|
1263
1264
|
row: {
|
|
1264
1265
|
display: 'flex',
|
|
@@ -1273,6 +1274,11 @@ const styleSheet = () => ({
|
|
|
1273
1274
|
'& label': {
|
|
1274
1275
|
color: color$1.text()
|
|
1275
1276
|
}
|
|
1277
|
+
},
|
|
1278
|
+
horizontalLayout: {
|
|
1279
|
+
[`& .${CLASS_NAME}`]: {
|
|
1280
|
+
paddingRight: '8px'
|
|
1281
|
+
}
|
|
1276
1282
|
}
|
|
1277
1283
|
});
|
|
1278
1284
|
const formStyleSheet = {
|
|
@@ -1291,10 +1297,9 @@ const StyledFormControlLabel = withStyles$3(formStyleSheet, {
|
|
|
1291
1297
|
__self: undefined,
|
|
1292
1298
|
__source: {
|
|
1293
1299
|
fileName: _jsxFileName$3,
|
|
1294
|
-
lineNumber:
|
|
1300
|
+
lineNumber: 46
|
|
1295
1301
|
}
|
|
1296
1302
|
}));
|
|
1297
|
-
const CLASS_NAME = 'multiple-choice-component';
|
|
1298
1303
|
const colorStyle = (varName, fallback) => ({
|
|
1299
1304
|
[`&.${CLASS_NAME}`]: {
|
|
1300
1305
|
color: `var(--choice-input-${varName}, ${fallback}) !important`
|
|
@@ -1346,7 +1351,7 @@ const StyledCheckbox = withStyles$3(inputStyles)(props => {
|
|
|
1346
1351
|
__self: undefined,
|
|
1347
1352
|
__source: {
|
|
1348
1353
|
fileName: _jsxFileName$3,
|
|
1349
|
-
lineNumber:
|
|
1354
|
+
lineNumber: 97
|
|
1350
1355
|
}
|
|
1351
1356
|
});
|
|
1352
1357
|
});
|
|
@@ -1375,7 +1380,7 @@ const StyledRadio = withStyles$3(inputStyles)(props => {
|
|
|
1375
1380
|
__self: undefined,
|
|
1376
1381
|
__source: {
|
|
1377
1382
|
fileName: _jsxFileName$3,
|
|
1378
|
-
lineNumber:
|
|
1383
|
+
lineNumber: 130
|
|
1379
1384
|
}
|
|
1380
1385
|
});
|
|
1381
1386
|
});
|
|
@@ -1396,7 +1401,8 @@ class ChoiceInput extends React$4.Component {
|
|
|
1396
1401
|
classes: PropTypes$3.object,
|
|
1397
1402
|
className: PropTypes$3.string,
|
|
1398
1403
|
hideTick: PropTypes$3.bool,
|
|
1399
|
-
isEvaluateMode: PropTypes$3.bool
|
|
1404
|
+
isEvaluateMode: PropTypes$3.bool,
|
|
1405
|
+
choicesLayout: PropTypes$3.oneOf(['vertical', 'grid', 'horizontal'])
|
|
1400
1406
|
};
|
|
1401
1407
|
}
|
|
1402
1408
|
static __initStatic2() {
|
|
@@ -1418,36 +1424,39 @@ class ChoiceInput extends React$4.Component {
|
|
|
1418
1424
|
});
|
|
1419
1425
|
}
|
|
1420
1426
|
render() {
|
|
1421
|
-
const {choiceMode, disabled, displayKey, feedback, label, checked, correctness, classes, className, rationale, accessibility, hideTick, isEvaluateMode} = this.props;
|
|
1427
|
+
const {choiceMode, disabled, displayKey, feedback, label, checked, correctness, classes, className, rationale, accessibility, hideTick, isEvaluateMode, choicesLayout} = this.props;
|
|
1422
1428
|
const Tag = choiceMode === 'checkbox' ? StyledCheckbox : StyledRadio;
|
|
1423
1429
|
const classSuffix = choiceMode === 'checkbox' ? 'checkbox' : 'radio-button';
|
|
1430
|
+
const holderClassNames = classNames$3(classes.checkboxHolder, {
|
|
1431
|
+
[classes.horizontalLayout]: choicesLayout === 'horizontal'
|
|
1432
|
+
});
|
|
1424
1433
|
return React$4.createElement('div', {
|
|
1425
1434
|
className: classNames$3(className, 'corespring-' + classSuffix, 'choice-input'),
|
|
1426
1435
|
__self: this,
|
|
1427
1436
|
__source: {
|
|
1428
1437
|
fileName: _jsxFileName$3,
|
|
1429
|
-
lineNumber:
|
|
1438
|
+
lineNumber: 208
|
|
1430
1439
|
}
|
|
1431
1440
|
}, React$4.createElement('div', {
|
|
1432
1441
|
className: classes.row,
|
|
1433
1442
|
__self: this,
|
|
1434
1443
|
__source: {
|
|
1435
1444
|
fileName: _jsxFileName$3,
|
|
1436
|
-
lineNumber:
|
|
1445
|
+
lineNumber: 209
|
|
1437
1446
|
}
|
|
1438
1447
|
}, !hideTick && isEvaluateMode && React$4.createElement(FeedbackTick$1, {
|
|
1439
1448
|
correctness: correctness,
|
|
1440
1449
|
__self: this,
|
|
1441
1450
|
__source: {
|
|
1442
1451
|
fileName: _jsxFileName$3,
|
|
1443
|
-
lineNumber:
|
|
1452
|
+
lineNumber: 210
|
|
1444
1453
|
}
|
|
1445
1454
|
}), React$4.createElement('div', {
|
|
1446
|
-
className: classNames$3(
|
|
1455
|
+
className: classNames$3(holderClassNames, 'checkbox-holder'),
|
|
1447
1456
|
__self: this,
|
|
1448
1457
|
__source: {
|
|
1449
1458
|
fileName: _jsxFileName$3,
|
|
1450
|
-
lineNumber:
|
|
1459
|
+
lineNumber: 211
|
|
1451
1460
|
}
|
|
1452
1461
|
}, React$4.createElement(StyledFormControlLabel, {
|
|
1453
1462
|
disabled: disabled,
|
|
@@ -1460,13 +1469,13 @@ class ChoiceInput extends React$4.Component {
|
|
|
1460
1469
|
__self: this,
|
|
1461
1470
|
__source: {
|
|
1462
1471
|
fileName: _jsxFileName$3,
|
|
1463
|
-
lineNumber:
|
|
1472
|
+
lineNumber: 216
|
|
1464
1473
|
}
|
|
1465
1474
|
}),
|
|
1466
1475
|
__self: this,
|
|
1467
1476
|
__source: {
|
|
1468
1477
|
fileName: _jsxFileName$3,
|
|
1469
|
-
lineNumber:
|
|
1478
|
+
lineNumber: 212
|
|
1470
1479
|
}
|
|
1471
1480
|
}), React$4.createElement(PreviewPrompt$1, {
|
|
1472
1481
|
className: "label",
|
|
@@ -1476,7 +1485,7 @@ class ChoiceInput extends React$4.Component {
|
|
|
1476
1485
|
__self: this,
|
|
1477
1486
|
__source: {
|
|
1478
1487
|
fileName: _jsxFileName$3,
|
|
1479
|
-
lineNumber:
|
|
1488
|
+
lineNumber: 224
|
|
1480
1489
|
}
|
|
1481
1490
|
}))), rationale && React$4.createElement(PreviewPrompt$1, {
|
|
1482
1491
|
className: "rationale",
|
|
@@ -1485,7 +1494,7 @@ class ChoiceInput extends React$4.Component {
|
|
|
1485
1494
|
__self: this,
|
|
1486
1495
|
__source: {
|
|
1487
1496
|
fileName: _jsxFileName$3,
|
|
1488
|
-
lineNumber:
|
|
1497
|
+
lineNumber: 233
|
|
1489
1498
|
}
|
|
1490
1499
|
}), React$4.createElement(Feedback, {
|
|
1491
1500
|
feedback: feedback,
|
|
@@ -1493,7 +1502,7 @@ class ChoiceInput extends React$4.Component {
|
|
|
1493
1502
|
__self: this,
|
|
1494
1503
|
__source: {
|
|
1495
1504
|
fileName: _jsxFileName$3,
|
|
1496
|
-
lineNumber:
|
|
1505
|
+
lineNumber: 235
|
|
1497
1506
|
}
|
|
1498
1507
|
}));
|
|
1499
1508
|
}
|
|
@@ -1537,7 +1546,8 @@ class Choice extends React$3.Component {
|
|
|
1537
1546
|
isEvaluateMode
|
|
1538
1547
|
};
|
|
1539
1548
|
const names = classNames$2(classes.choice, {
|
|
1540
|
-
[classes.noBorder]: index === choicesLength - 1 || choicesLayout !== 'vertical'
|
|
1549
|
+
[classes.noBorder]: index === choicesLength - 1 || choicesLayout !== 'vertical',
|
|
1550
|
+
[classes.horizontalLayout]: choicesLayout === 'horizontal'
|
|
1541
1551
|
});
|
|
1542
1552
|
return React$3.createElement('div', {
|
|
1543
1553
|
className: choiceClass,
|
|
@@ -1545,7 +1555,7 @@ class Choice extends React$3.Component {
|
|
|
1545
1555
|
__self: this,
|
|
1546
1556
|
__source: {
|
|
1547
1557
|
fileName: _jsxFileName$2,
|
|
1548
|
-
lineNumber:
|
|
1558
|
+
lineNumber: 57
|
|
1549
1559
|
}
|
|
1550
1560
|
}, React$3.createElement(ChoiceInput$1, {
|
|
1551
1561
|
...choiceProps,
|
|
@@ -1553,7 +1563,7 @@ class Choice extends React$3.Component {
|
|
|
1553
1563
|
__self: this,
|
|
1554
1564
|
__source: {
|
|
1555
1565
|
fileName: _jsxFileName$2,
|
|
1556
|
-
lineNumber:
|
|
1566
|
+
lineNumber: 58
|
|
1557
1567
|
}
|
|
1558
1568
|
}));
|
|
1559
1569
|
}
|
|
@@ -1582,6 +1592,12 @@ var StyledChoice = withStyles$2({
|
|
|
1582
1592
|
},
|
|
1583
1593
|
noBorder: {
|
|
1584
1594
|
borderBottom: 'none'
|
|
1595
|
+
},
|
|
1596
|
+
horizontalLayout: {
|
|
1597
|
+
paddingRight: '20px',
|
|
1598
|
+
'& label': {
|
|
1599
|
+
marginRight: '8px'
|
|
1600
|
+
}
|
|
1585
1601
|
}
|
|
1586
1602
|
})(Choice);
|
|
1587
1603
|
const React$2 = _dll_react;
|
|
@@ -1615,7 +1631,7 @@ const styles = {
|
|
|
1615
1631
|
} : undefined;
|
|
1616
1632
|
}
|
|
1617
1633
|
};
|
|
1618
|
-
class MultipleChoice
|
|
1634
|
+
class MultipleChoice extends React$2.Component {
|
|
1619
1635
|
static __initStatic() {
|
|
1620
1636
|
this.propTypes = {
|
|
1621
1637
|
mode: PropTypes$1.oneOf(['gather', 'view', 'evaluate']),
|
|
@@ -1638,7 +1654,7 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
1638
1654
|
}
|
|
1639
1655
|
constructor(props) {
|
|
1640
1656
|
super(props);
|
|
1641
|
-
MultipleChoice
|
|
1657
|
+
MultipleChoice.prototype.__init.call(this);
|
|
1642
1658
|
this.state = {
|
|
1643
1659
|
showCorrect: this.props.alwaysShowCorrect || false
|
|
1644
1660
|
};
|
|
@@ -1811,13 +1827,13 @@ class MultipleChoice$1 extends React$2.Component {
|
|
|
1811
1827
|
}))));
|
|
1812
1828
|
}
|
|
1813
1829
|
}
|
|
1814
|
-
MultipleChoice
|
|
1815
|
-
MultipleChoice
|
|
1830
|
+
MultipleChoice.__initStatic();
|
|
1831
|
+
MultipleChoice.defaultProps = {
|
|
1816
1832
|
session: {
|
|
1817
1833
|
value: []
|
|
1818
1834
|
}
|
|
1819
1835
|
};
|
|
1820
|
-
var MultipleChoice$
|
|
1836
|
+
var MultipleChoice$1 = withStyles$1(styles)(MultipleChoice);
|
|
1821
1837
|
const React$1 = _dll_react;
|
|
1822
1838
|
const PropTypes = _dll_prop_types;
|
|
1823
1839
|
const {withStyles: withStyles} = _dll_material_ui__core_styles;
|
|
@@ -1865,7 +1881,7 @@ class Main extends React$1.Component {
|
|
|
1865
1881
|
fileName: _jsxFileName,
|
|
1866
1882
|
lineNumber: 32
|
|
1867
1883
|
}
|
|
1868
|
-
}, React$1.createElement(MultipleChoice$
|
|
1884
|
+
}, React$1.createElement(MultipleChoice$1, {
|
|
1869
1885
|
...model,
|
|
1870
1886
|
session: session,
|
|
1871
1887
|
onChoiceChanged: onChoiceChanged,
|
|
@@ -1902,154 +1918,20 @@ const Root = props => React$1.createElement(MuiThemeProvider, {
|
|
|
1902
1918
|
lineNumber: 54
|
|
1903
1919
|
}
|
|
1904
1920
|
}));
|
|
1905
|
-
const {concat: concat} = _dll_lodash;
|
|
1906
|
-
const {uniq: uniq} = _dll_lodash;
|
|
1907
|
-
const {without: without} = _dll_lodash;
|
|
1908
|
-
function updateSessionValue(session, choiceMode, data) {
|
|
1909
|
-
session.value = session.value || [];
|
|
1910
|
-
if (choiceMode === 'checkbox') {
|
|
1911
|
-
if (data.selected) {
|
|
1912
|
-
session.value = uniq(concat(session.value, [data.value]));
|
|
1913
|
-
} else {
|
|
1914
|
-
session.value = without(session.value, data.value);
|
|
1915
|
-
}
|
|
1916
|
-
}
|
|
1917
|
-
if (choiceMode === 'radio') {
|
|
1918
|
-
if (data.selected) {
|
|
1919
|
-
session.value = [data.value];
|
|
1920
|
-
} else {
|
|
1921
|
-
session.value = [];
|
|
1922
|
-
}
|
|
1923
|
-
}
|
|
1924
|
-
}
|
|
1925
1921
|
const React = _dll_react;
|
|
1926
1922
|
const ReactDOM = _dll_react_dom;
|
|
1927
1923
|
const {debounce: debounce} = _dll_lodash;
|
|
1928
|
-
const debug$1 = _dll_debug;
|
|
1929
|
-
const {renderMath: renderMath} = _dll_pie_lib__math_rendering;
|
|
1930
|
-
const log$1 = debug$1('pie-ui:multiple-choice');
|
|
1931
|
-
const isComplete = session => !!(session && session.value && session.value.length);
|
|
1932
|
-
class MultipleChoice extends HTMLElement {
|
|
1933
|
-
constructor() {
|
|
1934
|
-
super();
|
|
1935
|
-
this._model = null;
|
|
1936
|
-
this._session = null;
|
|
1937
|
-
this._rerender = debounce(() => {
|
|
1938
|
-
if (this._model && this._session) {
|
|
1939
|
-
var element = React.createElement(Root, {
|
|
1940
|
-
model: this._model,
|
|
1941
|
-
session: this._session,
|
|
1942
|
-
onChoiceChanged: this._onChange.bind(this)
|
|
1943
|
-
});
|
|
1944
|
-
ReactDOM.render(element, this, () => {
|
|
1945
|
-
log$1('render complete - render math');
|
|
1946
|
-
renderMath(this);
|
|
1947
|
-
});
|
|
1948
|
-
} else {
|
|
1949
|
-
log$1('skip');
|
|
1950
|
-
}
|
|
1951
|
-
}, 50, {
|
|
1952
|
-
leading: false,
|
|
1953
|
-
trailing: true
|
|
1954
|
-
});
|
|
1955
|
-
this._dispatchResponseChanged = debounce(() => {
|
|
1956
|
-
var event = new CustomEvent('session-changed', {
|
|
1957
|
-
bubbles: true,
|
|
1958
|
-
composed: true,
|
|
1959
|
-
detail: {
|
|
1960
|
-
complete: isComplete(this._session),
|
|
1961
|
-
component: this.tagName.toLowerCase()
|
|
1962
|
-
}
|
|
1963
|
-
});
|
|
1964
|
-
this.dispatchEvent(event);
|
|
1965
|
-
});
|
|
1966
|
-
this._dispatchModelSet = debounce(() => {
|
|
1967
|
-
this.dispatchEvent(new CustomEvent('model-set', {
|
|
1968
|
-
bubbles: true,
|
|
1969
|
-
composed: true,
|
|
1970
|
-
detail: {
|
|
1971
|
-
complete: isComplete(this._session),
|
|
1972
|
-
component: this.tagName.toLowerCase(),
|
|
1973
|
-
hasModel: this._model !== undefined
|
|
1974
|
-
}
|
|
1975
|
-
}));
|
|
1976
|
-
}, 50, {
|
|
1977
|
-
leading: false,
|
|
1978
|
-
trailing: true
|
|
1979
|
-
});
|
|
1980
|
-
}
|
|
1981
|
-
set model(s) {
|
|
1982
|
-
this._model = s;
|
|
1983
|
-
this._rerender();
|
|
1984
|
-
this._dispatchModelSet();
|
|
1985
|
-
}
|
|
1986
|
-
get session() {
|
|
1987
|
-
return this._session;
|
|
1988
|
-
}
|
|
1989
|
-
set session(s) {
|
|
1990
|
-
this._session = s;
|
|
1991
|
-
this._rerender();
|
|
1992
|
-
this._dispatchResponseChanged();
|
|
1993
|
-
}
|
|
1994
|
-
_onChange(data) {
|
|
1995
|
-
updateSessionValue(this._session, this._model.choiceMode, data);
|
|
1996
|
-
this._dispatchResponseChanged();
|
|
1997
|
-
this._rerender();
|
|
1998
|
-
}
|
|
1999
|
-
connectedCallback() {
|
|
2000
|
-
this._rerender();
|
|
2001
|
-
}
|
|
2002
|
-
}
|
|
2003
|
-
var lib = {};
|
|
2004
|
-
Object.defineProperty(lib, "__esModule", {
|
|
2005
|
-
value: true
|
|
2006
|
-
});
|
|
2007
|
-
class ModelSetEvent extends CustomEvent {
|
|
2008
|
-
constructor(component, complete, hasModel) {
|
|
2009
|
-
super(ModelSetEvent.TYPE, {
|
|
2010
|
-
bubbles: true,
|
|
2011
|
-
composed: true,
|
|
2012
|
-
detail: {
|
|
2013
|
-
complete,
|
|
2014
|
-
component,
|
|
2015
|
-
hasModel
|
|
2016
|
-
}
|
|
2017
|
-
});
|
|
2018
|
-
this.component = component;
|
|
2019
|
-
this.complete = complete;
|
|
2020
|
-
}
|
|
2021
|
-
}
|
|
2022
|
-
ModelSetEvent.TYPE = 'model-set';
|
|
2023
|
-
lib.ModelSetEvent = ModelSetEvent;
|
|
2024
|
-
class SessionChangedEvent extends CustomEvent {
|
|
2025
|
-
constructor(component, complete) {
|
|
2026
|
-
super(SessionChangedEvent.TYPE, {
|
|
2027
|
-
bubbles: true,
|
|
2028
|
-
composed: true,
|
|
2029
|
-
detail: {
|
|
2030
|
-
complete,
|
|
2031
|
-
component
|
|
2032
|
-
}
|
|
2033
|
-
});
|
|
2034
|
-
this.component = component;
|
|
2035
|
-
this.complete = complete;
|
|
2036
|
-
}
|
|
2037
|
-
}
|
|
2038
|
-
SessionChangedEvent.TYPE = 'session-changed';
|
|
2039
|
-
var SessionChangedEvent_1 = lib.SessionChangedEvent = SessionChangedEvent;
|
|
2040
1924
|
const {cloneDeep: cloneDeep} = _dll_lodash;
|
|
2041
|
-
const {get: get} = _dll_lodash;
|
|
2042
1925
|
const debug = _dll_debug;
|
|
2043
|
-
const
|
|
2044
|
-
const
|
|
2045
|
-
const log = debug('pie-element:ebsr:print');
|
|
1926
|
+
const {renderMath: renderMath} = _dll_pie_lib__math_rendering;
|
|
1927
|
+
const log = debug('pie-element:multiple-choice:print');
|
|
2046
1928
|
const preparePrintModel = (model, opts) => {
|
|
2047
1929
|
const instr = opts.role === 'instructor';
|
|
2048
1930
|
model.prompt = model.promptEnabled !== false ? model.prompt : undefined;
|
|
2049
1931
|
model.teacherInstructions = instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;
|
|
2050
1932
|
model.showTeacherInstructions = instr;
|
|
2051
1933
|
model.alwaysShowCorrect = instr;
|
|
2052
|
-
model.mode = instr ? 'evaluate' :
|
|
1934
|
+
model.mode = instr ? 'evaluate' : model.mode;
|
|
2053
1935
|
model.disabled = true;
|
|
2054
1936
|
model.animationsDisabled = true;
|
|
2055
1937
|
model.lockChoiceOrder = true;
|
|
@@ -2064,109 +1946,38 @@ const preparePrintModel = (model, opts) => {
|
|
|
2064
1946
|
model.keyMode = model.choicePrefix || 'letters';
|
|
2065
1947
|
return model;
|
|
2066
1948
|
};
|
|
2067
|
-
class
|
|
2068
|
-
const defineMultipleChoice = () => {
|
|
2069
|
-
if (!customElements.get(MC_TAG_NAME)) {
|
|
2070
|
-
customElements.define(MC_TAG_NAME, EbsrMC);
|
|
2071
|
-
}
|
|
2072
|
-
};
|
|
2073
|
-
defineMultipleChoice();
|
|
2074
|
-
const isNonEmptyArray = a => Array.isArray(a) && a.length > 0;
|
|
2075
|
-
const isSessionComplete = session => {
|
|
2076
|
-
const a = get(session, 'value.partA.value');
|
|
2077
|
-
const b = get(session, 'value.partB.value');
|
|
2078
|
-
return isNonEmptyArray(a) && isNonEmptyArray(b);
|
|
2079
|
-
};
|
|
2080
|
-
class Ebsr extends HTMLElement {
|
|
1949
|
+
class MultipleChoicePrint extends HTMLElement {
|
|
2081
1950
|
constructor() {
|
|
2082
1951
|
super();
|
|
2083
|
-
Ebsr.prototype.__init.call(this);
|
|
2084
|
-
this._model = {};
|
|
2085
|
-
this._session = {};
|
|
2086
1952
|
this._options = null;
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
this.
|
|
2090
|
-
if (
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
1953
|
+
this._model = null;
|
|
1954
|
+
this._session = [];
|
|
1955
|
+
this._rerender = debounce(() => {
|
|
1956
|
+
if (this._model && this._session) {
|
|
1957
|
+
const printModel = preparePrintModel(this._model, this._options);
|
|
1958
|
+
const element = this._options && React.createElement(Root, {
|
|
1959
|
+
model: printModel,
|
|
1960
|
+
session: {}
|
|
1961
|
+
});
|
|
1962
|
+
ReactDOM.render(element, this, () => {
|
|
1963
|
+
log('render complete - render math');
|
|
1964
|
+
renderMath(this);
|
|
1965
|
+
});
|
|
1966
|
+
} else {
|
|
1967
|
+
log('skip');
|
|
2102
1968
|
}
|
|
2103
|
-
}
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
this._model = m;
|
|
2107
|
-
customElements.whenDefined(MC_TAG_NAME).then(() => {
|
|
2108
|
-
this.setPartModel(this.partA, 'partA');
|
|
2109
|
-
this.setPartModel(this.partB, 'partB');
|
|
2110
|
-
});
|
|
2111
|
-
}
|
|
2112
|
-
set session(s) {
|
|
2113
|
-
this._session = s;
|
|
2114
|
-
customElements.whenDefined(MC_TAG_NAME).then(() => {
|
|
2115
|
-
this.setPartSession(this.partA, 'partA');
|
|
2116
|
-
this.setPartSession(this.partB, 'partB');
|
|
1969
|
+
}, 50, {
|
|
1970
|
+
leading: false,
|
|
1971
|
+
trailing: true
|
|
2117
1972
|
});
|
|
2118
1973
|
}
|
|
2119
|
-
setPartModel(part, key) {
|
|
2120
|
-
if (this._model && this._model[key]) {
|
|
2121
|
-
part.model = {
|
|
2122
|
-
...preparePrintModel(this._model[key], this._options),
|
|
2123
|
-
keyMode: this._model[key].choicePrefix
|
|
2124
|
-
};
|
|
2125
|
-
if (!part._session) {
|
|
2126
|
-
part.session = {};
|
|
2127
|
-
}
|
|
2128
|
-
}
|
|
2129
|
-
}
|
|
2130
1974
|
set options(o) {
|
|
2131
1975
|
this._options = o;
|
|
2132
1976
|
}
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
part.session = value && value[key] ? value[key] : {
|
|
2137
|
-
id: key
|
|
2138
|
-
};
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
2141
|
-
dispatchSessionChanged(partSession, key) {
|
|
2142
|
-
this._session.value = {
|
|
2143
|
-
...this._session.value,
|
|
2144
|
-
[key]: partSession
|
|
2145
|
-
};
|
|
2146
|
-
log('[onSessionChanged] session: ', this._session);
|
|
2147
|
-
const complete = isSessionComplete(this._session);
|
|
2148
|
-
this.dispatchEvent(new SessionChangedEvent_1(this.tagName.toLowerCase(), complete));
|
|
2149
|
-
}
|
|
2150
|
-
get partA() {
|
|
2151
|
-
return this.querySelector(`${MC_TAG_NAME}#a`);
|
|
2152
|
-
}
|
|
2153
|
-
get partB() {
|
|
2154
|
-
return this.querySelector(`${MC_TAG_NAME}#b`);
|
|
2155
|
-
}
|
|
2156
|
-
connectedCallback() {
|
|
2157
|
-
this._render();
|
|
2158
|
-
this.addEventListener(SESSION_CHANGED, this.onSessionUpdated);
|
|
2159
|
-
}
|
|
2160
|
-
disconnectedCallback() {
|
|
2161
|
-
this.removeEventListener(SESSION_CHANGED, this.onSessionUpdated);
|
|
2162
|
-
}
|
|
2163
|
-
_render() {
|
|
2164
|
-
this.innerHTML = `
|
|
2165
|
-
<div>
|
|
2166
|
-
<${MC_TAG_NAME} id="a"></${MC_TAG_NAME}>
|
|
2167
|
-
<${MC_TAG_NAME} id="b"></${MC_TAG_NAME}>
|
|
2168
|
-
</div>
|
|
2169
|
-
`;
|
|
1977
|
+
set model(s) {
|
|
1978
|
+
this._model = s;
|
|
1979
|
+
this._rerender();
|
|
2170
1980
|
}
|
|
1981
|
+
connectedCallback() {}
|
|
2171
1982
|
}
|
|
2172
|
-
export {
|
|
1983
|
+
export {MultipleChoicePrint as default};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pie-element/multiple-choice",
|
|
3
|
+
"repository": "pie-framework/pie-elements",
|
|
4
|
+
"version": "6.3.2",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@material-ui/core": "^3.9.2",
|
|
10
|
+
"@pie-lib/config-ui": "^10.13.0",
|
|
11
|
+
"@pie-lib/correct-answer-toggle": "^2.3.36",
|
|
12
|
+
"@pie-lib/math-rendering": "^2.4.0",
|
|
13
|
+
"@pie-lib/render-ui": "^4.12.6",
|
|
14
|
+
"classnames": "^2.2.5",
|
|
15
|
+
"debug": "^4.1.1",
|
|
16
|
+
"enzyme-to-json": "^3.3.3",
|
|
17
|
+
"lodash": "^4.17.10",
|
|
18
|
+
"prop-types": "^15.6.1",
|
|
19
|
+
"react": "^16.8.1",
|
|
20
|
+
"react-dom": "^16.8.1",
|
|
21
|
+
"react-test-renderer": "^16.3.2",
|
|
22
|
+
"react-transition-group": "^2.3.1"
|
|
23
|
+
},
|
|
24
|
+
"gitHead": "8ea971e13e74d785cd35a04fd9fe1abe1fa2dabf",
|
|
25
|
+
"scripts": {
|
|
26
|
+
"postpublish": "../../scripts/postpublish"
|
|
27
|
+
},
|
|
28
|
+
"main": "lib/index.js",
|
|
29
|
+
"module": "src/index.js",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": "./src/index.js",
|
|
32
|
+
"./print": "./src/print.js"
|
|
33
|
+
}
|
|
34
|
+
}
|