@pie-element/complex-rubric 2.10.1-next.11 → 2.10.1-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 (115) hide show
  1. package/configure/package.json +2 -2
  2. package/controller/package.json +1 -1
  3. package/module/configure.js +233613 -0
  4. package/module/controller.js +379 -0
  5. package/module/demo.js +221 -0
  6. package/module/element.js +231245 -0
  7. package/module/index.html +21 -0
  8. package/module/manifest.json +14 -0
  9. package/module/print-demo.js +259 -0
  10. package/module/print.html +18 -0
  11. package/module/print.js +231217 -0
  12. package/package.json +4 -4
  13. package/configure/node_modules/@pie-element/multi-trait-rubric/CHANGELOG.json +0 -1
  14. package/configure/node_modules/@pie-element/multi-trait-rubric/CHANGELOG.md +0 -1383
  15. package/configure/node_modules/@pie-element/multi-trait-rubric/LICENSE.md +0 -5
  16. package/configure/node_modules/@pie-element/multi-trait-rubric/README.md +0 -55
  17. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/CHANGELOG.json +0 -1
  18. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/CHANGELOG.md +0 -1270
  19. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js +0 -584
  20. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js.map +0 -1
  21. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/defaults.js +0 -143
  22. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/defaults.js.map +0 -1
  23. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/index.js +0 -204
  24. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/index.js.map +0 -1
  25. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/main.js +0 -602
  26. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/main.js.map +0 -1
  27. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/modals.js +0 -361
  28. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/modals.js.map +0 -1
  29. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/scale.js +0 -556
  30. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/scale.js.map +0 -1
  31. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/trait.js +0 -380
  32. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/trait.js.map +0 -1
  33. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js +0 -296
  34. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js.map +0 -1
  35. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/utils.js +0 -14
  36. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/utils.js.map +0 -1
  37. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/package.json +0 -18
  38. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/CHANGELOG.json +0 -1
  39. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/CHANGELOG.md +0 -544
  40. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/defaults.js +0 -94
  41. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/defaults.js.map +0 -1
  42. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/index.js +0 -215
  43. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/index.js.map +0 -1
  44. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/utils.js +0 -13
  45. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/utils.js.map +0 -1
  46. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/package.json +0 -15
  47. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/config-schema.json +0 -803
  48. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/config-schema.json.md +0 -602
  49. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/config.js +0 -8
  50. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/generate.js +0 -180
  51. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/index.html +0 -1
  52. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/session.js +0 -6
  53. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/pie-schema.json +0 -531
  54. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/pie-schema.json.md +0 -374
  55. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/index.js +0 -85
  56. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/index.js.map +0 -1
  57. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/main.js +0 -161
  58. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/main.js.map +0 -1
  59. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/scale.js +0 -330
  60. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/scale.js.map +0 -1
  61. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/trait.js +0 -103
  62. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/trait.js.map +0 -1
  63. package/configure/node_modules/@pie-element/multi-trait-rubric/package.json +0 -24
  64. package/configure/node_modules/@pie-element/rubric/CHANGELOG.json +0 -257
  65. package/configure/node_modules/@pie-element/rubric/CHANGELOG.md +0 -1640
  66. package/configure/node_modules/@pie-element/rubric/LICENSE.md +0 -5
  67. package/configure/node_modules/@pie-element/rubric/README.md +0 -3
  68. package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.json +0 -197
  69. package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.md +0 -1471
  70. package/configure/node_modules/@pie-element/rubric/configure/lib/defaults.js +0 -59
  71. package/configure/node_modules/@pie-element/rubric/configure/lib/defaults.js.map +0 -1
  72. package/configure/node_modules/@pie-element/rubric/configure/lib/index.js +0 -194
  73. package/configure/node_modules/@pie-element/rubric/configure/lib/index.js.map +0 -1
  74. package/configure/node_modules/@pie-element/rubric/configure/lib/main.js +0 -160
  75. package/configure/node_modules/@pie-element/rubric/configure/lib/main.js.map +0 -1
  76. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/authoring.js +0 -555
  77. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/authoring.js.map +0 -1
  78. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/index.js +0 -24
  79. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/index.js.map +0 -1
  80. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/point-menu.js +0 -172
  81. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/point-menu.js.map +0 -1
  82. package/configure/node_modules/@pie-element/rubric/configure/package.json +0 -17
  83. package/configure/node_modules/@pie-element/rubric/configure/src/__tests__/index.test.jsx +0 -173
  84. package/configure/node_modules/@pie-element/rubric/configure/src/defaults.js +0 -39
  85. package/configure/node_modules/@pie-element/rubric/configure/src/index.js +0 -127
  86. package/configure/node_modules/@pie-element/rubric/configure/src/main.jsx +0 -87
  87. package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/authoring.jsx +0 -427
  88. package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/index.js +0 -9
  89. package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/point-menu.jsx +0 -94
  90. package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.json +0 -17
  91. package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.md +0 -536
  92. package/configure/node_modules/@pie-element/rubric/controller/lib/index.js +0 -51
  93. package/configure/node_modules/@pie-element/rubric/controller/lib/index.js.map +0 -1
  94. package/configure/node_modules/@pie-element/rubric/controller/package.json +0 -13
  95. package/configure/node_modules/@pie-element/rubric/controller/src/__tests__/index.test.js +0 -31
  96. package/configure/node_modules/@pie-element/rubric/controller/src/index.js +0 -42
  97. package/configure/node_modules/@pie-element/rubric/docs/config-schema.json +0 -382
  98. package/configure/node_modules/@pie-element/rubric/docs/config-schema.json.md +0 -292
  99. package/configure/node_modules/@pie-element/rubric/docs/demo/config.js +0 -8
  100. package/configure/node_modules/@pie-element/rubric/docs/demo/generate.js +0 -8
  101. package/configure/node_modules/@pie-element/rubric/docs/demo/index.html +0 -2
  102. package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json +0 -226
  103. package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json.md +0 -161
  104. package/configure/node_modules/@pie-element/rubric/lib/index.js +0 -88
  105. package/configure/node_modules/@pie-element/rubric/lib/index.js.map +0 -1
  106. package/configure/node_modules/@pie-element/rubric/lib/main.js +0 -187
  107. package/configure/node_modules/@pie-element/rubric/lib/main.js.map +0 -1
  108. package/configure/node_modules/@pie-element/rubric/lib/print.js +0 -114
  109. package/configure/node_modules/@pie-element/rubric/lib/print.js.map +0 -1
  110. package/configure/node_modules/@pie-element/rubric/package.json +0 -26
  111. package/configure/node_modules/@pie-element/rubric/src/__tests__/__snapshots__/rubric-view.test.jsx.snap +0 -23003
  112. package/configure/node_modules/@pie-element/rubric/src/__tests__/rubric-view.test.jsx +0 -50
  113. package/configure/node_modules/@pie-element/rubric/src/index.js +0 -34
  114. package/configure/node_modules/@pie-element/rubric/src/main.jsx +0 -136
  115. package/configure/node_modules/@pie-element/rubric/src/print.js +0 -63
@@ -1,172 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = exports.IconMenu = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
-
16
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
-
18
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
-
20
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
-
22
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
-
24
- var _Menu = _interopRequireDefault(require("@material-ui/core/Menu"));
25
-
26
- var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
27
-
28
- var _MoreVert = _interopRequireDefault(require("@material-ui/icons/MoreVert"));
29
-
30
- var _MoreHoriz = _interopRequireDefault(require("@material-ui/icons/MoreHoriz"));
31
-
32
- var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
33
-
34
- var _propTypes = _interopRequireDefault(require("prop-types"));
35
-
36
- var _react = _interopRequireDefault(require("react"));
37
-
38
- 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); }; }
39
-
40
- 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; } }
41
-
42
- var IconMenu = /*#__PURE__*/function (_React$Component) {
43
- (0, _inherits2["default"])(IconMenu, _React$Component);
44
-
45
- var _super = _createSuper(IconMenu);
46
-
47
- function IconMenu(props) {
48
- var _this;
49
-
50
- (0, _classCallCheck2["default"])(this, IconMenu);
51
- _this = _super.call(this, props);
52
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClick", function (event) {
53
- return _this.setState({
54
- open: true,
55
- anchorEl: event.currentTarget
56
- });
57
- });
58
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleRequestClose", function () {
59
- return _this.setState({
60
- open: false
61
- });
62
- });
63
- _this.state = {
64
- anchorEl: undefined,
65
- open: false
66
- };
67
- return _this;
68
- }
69
-
70
- (0, _createClass2["default"])(IconMenu, [{
71
- key: "render",
72
- value: function render() {
73
- var _this2 = this;
74
-
75
- var _this$props = this.props,
76
- opts = _this$props.opts,
77
- onClick = _this$props.onClick,
78
- classes = _this$props.classes;
79
- var _this$state = this.state,
80
- open = _this$state.open,
81
- anchorEl = _this$state.anchorEl;
82
- var keys = Object.keys(opts) || [];
83
-
84
- var handleMenuClick = function handleMenuClick(key) {
85
- return function () {
86
- onClick(key);
87
-
88
- _this2.handleRequestClose();
89
- };
90
- };
91
-
92
- var iconColor = open ? 'inherit' : 'disabled';
93
- return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
94
- onClick: this.handleClick
95
- }, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
96
- className: classes.icon
97
- }, open ? /*#__PURE__*/_react["default"].createElement(_MoreVert["default"], {
98
- color: iconColor
99
- }) : /*#__PURE__*/_react["default"].createElement(_MoreHoriz["default"], {
100
- color: iconColor
101
- }))), /*#__PURE__*/_react["default"].createElement(_Menu["default"], {
102
- id: "point-menu",
103
- anchorEl: anchorEl,
104
- open: open,
105
- onClose: this.handleRequestClose,
106
- style: {
107
- transform: 'translate(-15px, -15px)'
108
- },
109
- transformOrigin: {
110
- vertical: 'center',
111
- horizontal: 'right'
112
- }
113
- }, keys.map(function (k, index) {
114
- return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
115
- key: index,
116
- onClick: handleMenuClick(k)
117
- }, opts[k]);
118
- })));
119
- }
120
- }]);
121
- return IconMenu;
122
- }(_react["default"].Component);
123
-
124
- exports.IconMenu = IconMenu;
125
- (0, _defineProperty2["default"])(IconMenu, "propTypes", {
126
- opts: _propTypes["default"].object,
127
- onClick: _propTypes["default"].func.isRequired,
128
- classes: _propTypes["default"].object.isRequired
129
- });
130
-
131
- var PointMenu = /*#__PURE__*/function (_React$Component2) {
132
- (0, _inherits2["default"])(PointMenu, _React$Component2);
133
-
134
- var _super2 = _createSuper(PointMenu);
135
-
136
- function PointMenu() {
137
- (0, _classCallCheck2["default"])(this, PointMenu);
138
- return _super2.apply(this, arguments);
139
- }
140
-
141
- (0, _createClass2["default"])(PointMenu, [{
142
- key: "render",
143
- value: function render() {
144
- var _this$props2 = this.props,
145
- onChange = _this$props2.onChange,
146
- classes = _this$props2.classes,
147
- showSampleAnswer = _this$props2.showSampleAnswer;
148
- var sampleText = showSampleAnswer ? 'Provide Sample Response' : 'Remove Sample Response';
149
- return /*#__PURE__*/_react["default"].createElement(IconMenu, {
150
- onClick: function onClick(key) {
151
- return onChange(key);
152
- },
153
- opts: {
154
- sample: sampleText
155
- },
156
- classes: classes
157
- });
158
- }
159
- }]);
160
- return PointMenu;
161
- }(_react["default"].Component);
162
-
163
- exports["default"] = PointMenu;
164
- (0, _defineProperty2["default"])(PointMenu, "propTypes", {
165
- onChange: _propTypes["default"].func.isRequired,
166
- classes: _propTypes["default"].object.isRequired,
167
- showSampleAnswer: _propTypes["default"].bool.isRequired
168
- });
169
- (0, _defineProperty2["default"])(PointMenu, "defaultProps", {
170
- classes: {}
171
- });
172
- //# sourceMappingURL=point-menu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/pie-toolbox-rubric/point-menu.jsx"],"names":["IconMenu","props","event","setState","open","anchorEl","currentTarget","state","undefined","opts","onClick","classes","keys","Object","handleMenuClick","key","handleRequestClose","iconColor","handleClick","icon","transform","vertical","horizontal","map","k","index","React","Component","PropTypes","object","func","isRequired","PointMenu","onChange","showSampleAnswer","sampleText","sample","bool"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;IAEaA,Q;;;;;AAOX,oBAAYC,KAAZ,EAAmB;AAAA;;AAAA;AACjB,8BAAMA,KAAN;AADiB,oGAQL,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AUE,IAAV,CAAeC,UADR;AAEjBpB,EAAAA,OAAO,EAAEiB,sBAAUC,MAAV,CAAiBE,UAFT;AAGjBG,EAAAA,gBAAgB,EAAEN,sBAAUS,IAAV,CAAeN;AAHhB,C;iCADAC,S,kBAOG;AACpBrB,EAAAA,OAAO,EAAE;AADW,C","sourcesContent":["import Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\nimport MoreHorizIcon from '@material-ui/icons/MoreHoriz';\nimport IconButton from '@material-ui/core/IconButton';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nexport class IconMenu extends React.Component {\n static propTypes = {\n opts: PropTypes.object,\n onClick: PropTypes.func.isRequired,\n classes: PropTypes.object.isRequired,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n anchorEl: undefined,\n open: false,\n };\n }\n\n handleClick = (event) => this.setState({ open: true, anchorEl: event.currentTarget });\n\n handleRequestClose = () => this.setState({ open: false });\n\n render() {\n const { opts, onClick, classes } = this.props;\n const { open, anchorEl } = this.state;\n const keys = Object.keys(opts) || [];\n\n const handleMenuClick = (key) => () => {\n onClick(key);\n this.handleRequestClose();\n };\n\n const iconColor = open ? 'inherit' : 'disabled';\n\n return (\n <div>\n <div onClick={this.handleClick}>\n <IconButton className={classes.icon}>\n {open ? <MoreVertIcon color={iconColor} /> : <MoreHorizIcon color={iconColor} />}\n </IconButton>\n </div>\n <Menu\n id=\"point-menu\"\n anchorEl={anchorEl}\n open={open}\n onClose={this.handleRequestClose}\n style={{ transform: 'translate(-15px, -15px)' }}\n transformOrigin={{\n vertical: 'center',\n horizontal: 'right',\n }}\n >\n {keys.map((k, index) => (\n <MenuItem key={index} onClick={handleMenuClick(k)}>\n {opts[k]}\n </MenuItem>\n ))}\n </Menu>\n </div>\n );\n }\n}\n\nexport default class PointMenu extends React.Component {\n static propTypes = {\n onChange: PropTypes.func.isRequired,\n classes: PropTypes.object.isRequired,\n showSampleAnswer: PropTypes.bool.isRequired,\n };\n\n static defaultProps = {\n classes: {},\n };\n\n render() {\n const { onChange, classes, showSampleAnswer } = this.props;\n const sampleText = showSampleAnswer ? 'Provide Sample Response' : 'Remove Sample Response';\n\n return (\n <IconMenu\n onClick={(key) => onChange(key)}\n opts={{\n sample: sampleText,\n }}\n classes={classes}\n />\n );\n }\n}\n"],"file":"point-menu.js"}
@@ -1,17 +0,0 @@
1
- {
2
- "name": "@pie-element/rubric-configure",
3
- "private": true,
4
- "version": "3.9.0",
5
- "description": "Rubric authoring view",
6
- "main": "lib/index.js",
7
- "author": "Pie Framework Authors",
8
- "dependencies": {
9
- "@material-ui/core": "^3.9.2",
10
- "@pie-framework/pie-configure-events": "^1.3.0",
11
- "@pie-lib/pie-toolbox": "1.16.1-next.28",
12
- "debug": "^4.1.1",
13
- "react": "^16.8.6",
14
- "react-dom": "^16.8.6"
15
- },
16
- "license": "ISC"
17
- }
@@ -1,173 +0,0 @@
1
- import RubricElement from '../index';
2
- import defaults from '../defaults';
3
- import { ModelUpdatedEvent, InsertSoundEvent, DeleteSoundEvent } from '@pie-framework/pie-configure-events';
4
- import React from "react";
5
-
6
- jest.mock('react-dom', () => ({
7
- render: jest.fn(),
8
- }));
9
-
10
- const model = (extras) => ({
11
- id: '1',
12
- element: 'pie-rubric',
13
- points: ['A', 'B', 'C', 'D'],
14
- sampleAnswers: [true, true, false, false],
15
- maxPoints: 3,
16
- excludeZero: false,
17
- excludeZeroEnabled: true,
18
- maxPointsEnabled: true,
19
- ...extras,
20
- });
21
-
22
- const invalidModel = (extras) => ({
23
- id: '2',
24
- element: 'pie-rubric',
25
- points: ['A', 'B', 'C', 'D'],
26
- sampleAnswers: [true, true, false, false],
27
- maxPoints: 5,
28
- excludeZero: false,
29
- excludeZeroEnabled: true,
30
- maxPointsEnabled: true,
31
- ...extras,
32
- });
33
- const configuration = (c) => ({...defaults.configuration, ...c});
34
-
35
- describe('RubricElement', () => {
36
- let element;
37
-
38
- beforeEach(() => {
39
- element = new RubricElement();
40
- });
41
-
42
- afterEach(() => {
43
- jest.clearAllMocks();
44
- });
45
-
46
- describe('set model', () => {
47
- it('should set the model correctly', () => {
48
- const newModel = model();
49
- element.model = newModel;
50
- expect(element._model).toEqual(newModel);
51
- });
52
- });
53
-
54
- describe('onModelChanged', () => {
55
- it('should dispatch ModelUpdatedEvent on model change', () => {
56
- const newModel = model();
57
- const dispatchEventSpy = jest.spyOn(element, 'dispatchEvent');
58
- element.onModelChanged(newModel);
59
- expect(element._model).toEqual(newModel);
60
- expect(dispatchEventSpy).toHaveBeenCalledWith(new ModelUpdatedEvent(newModel, false));
61
- });
62
- });
63
-
64
- describe('set configuration', () => {
65
- it('should set the configuration correctly', () => {
66
- const newConfiguration = configuration();
67
- element.configuration = newConfiguration;
68
- expect(element._configuration).toEqual(newConfiguration);
69
- });
70
- });
71
-
72
- describe('onConfigurationChanged', () => {
73
- it('should call _render method on configuration change and overwrite the defaults with the new values', () => {
74
- const newConfiguration = configuration({maxMaxPoints: 10});
75
- const renderSpy = jest.spyOn(element, '_render');
76
- element.onConfigurationChanged(newConfiguration);
77
- expect(element._configuration.maxMaxPoints).toEqual(10);
78
- expect(renderSpy).toHaveBeenCalled();
79
- });
80
- });
81
-
82
- describe('updateModelAccordingToReceivedProps', () => {
83
- it('should return the same model if it is already valid', () => {
84
- const validModel = model();
85
- const validatedModel = element.updateModelAccordingToReceivedProps(validModel);
86
- expect(validatedModel).toEqual(validModel);
87
- });
88
-
89
- it('should return an empty model if the input model is undefined', () => {
90
- const validatedModel = element.updateModelAccordingToReceivedProps(undefined);
91
- expect(validatedModel).toEqual(defaults.model);
92
- });
93
-
94
- it('should return an empty model if the input model is null', () => {
95
- const validatedModel = element.updateModelAccordingToReceivedProps(null);
96
- expect(validatedModel).toEqual(defaults.model);
97
- });
98
-
99
- it('should handle undefined properties in the input model', () => {
100
- const validatedModel = element.updateModelAccordingToReceivedProps({});
101
- expect(validatedModel).toEqual({"points": [], "sampleAnswers": []});
102
- });
103
-
104
- it('should handle null properties in the input model', () => {
105
- const validatedModel = element.updateModelAccordingToReceivedProps({ maxPoints: null, excludeZero: null });
106
- expect(validatedModel).toEqual( {"excludeZero": null, "maxPoints": null, "points": ["", ""], "sampleAnswers": [null, null]});
107
- });
108
-
109
- it('should handle undefined points and sampleAnswers arrays', () => {
110
- const validatedModel = element.updateModelAccordingToReceivedProps({ maxPoints: 5, excludeZero: false });
111
- expect(validatedModel.points).toEqual(['', '', '', '', '', '']);
112
- expect(validatedModel.sampleAnswers).toEqual([null, null, null, null, null, null]);
113
- });
114
-
115
- it('should handle case when howManyPointsDoesItHave is less than howManyPointsShouldHave with maxPoints & excludeZero changed', () => {
116
- const nextModel = model({
117
- maxPoints: 7,
118
- excludeZero: true,
119
- });
120
- const result = element.updateModelAccordingToReceivedProps(nextModel);
121
- expect(result.points).toEqual(['A', 'B', 'C', 'D', '', '', '']);
122
- expect(result.sampleAnswers).toEqual([true, true, false, false, null, null, null]);
123
- });
124
-
125
- it('should handle case when howManyPointsDoesItHave is less than howManyPointsShouldHave and maxPointsChanged', () => {
126
- const nextModel = model({
127
- maxPoints: 4,
128
- excludeZero: false
129
- });
130
- const result = element.updateModelAccordingToReceivedProps(nextModel);
131
- expect(result.points).toEqual(['A', 'B', 'C', 'D', '']);
132
- expect(result.sampleAnswers).toEqual([true, true, false, false, null]);
133
- });
134
-
135
- it('should handle case when howManyPointsDoesItHave is greater than howManyPointsShouldHave and excludeZeroChanged', () => {
136
- const nextModel = model({
137
- maxPoints: 3,
138
- excludeZero: true,
139
- });
140
- const result = element.updateModelAccordingToReceivedProps(nextModel);
141
- expect(result.points).toEqual(['B', 'C', 'D']);
142
- expect(result.sampleAnswers).toEqual([true, false, false]);
143
- });
144
-
145
- it('should handle case when howManyPointsDoesItHave is greater than howManyPointsShouldHave and maxPointsChanged', () => {
146
- const nextModel = model({
147
- maxPoints: 1,
148
- excludeZero: false,
149
- });
150
- const result = element.updateModelAccordingToReceivedProps(nextModel);
151
- expect(result.points).toEqual(['A','B']);
152
- expect(result.sampleAnswers).toEqual([true, true]);
153
- });
154
-
155
- it('should handle case when howManyPointsDoesItHave is greater than howManyPointsShouldHave, maxPointsChanged & excludeZeroChanged', () => {
156
- const nextModel = model({
157
- maxPoints: 1,
158
- excludeZero: true,
159
- });
160
- const result = element.updateModelAccordingToReceivedProps(nextModel);
161
- expect(result.points).toEqual(['B']);
162
- expect(result.sampleAnswers).toEqual([true]);
163
- });
164
-
165
- it('should handle case if invalid model is set, after updateModelAccordingToReceivedProps the returned model is valid', () => {
166
- const newModel = invalidModel();
167
- element.onModelChanged(newModel);
168
- expect(element._model.points).toEqual(["A", "B", "C", "D", "", ""]);
169
- expect(element._model.sampleAnswers).toEqual([true, true, false, false, null, null]);
170
- });
171
- });
172
-
173
- });
@@ -1,39 +0,0 @@
1
- export default {
2
- model: {
3
- points: ['', '', '', ''],
4
- sampleAnswers: [null, null, null, null],
5
- maxPoints: 3,
6
- excludeZero: false,
7
- excludeZeroEnabled: true,
8
- maxPointsEnabled: true,
9
- },
10
- configuration: {
11
- baseInputConfiguration: {
12
- audio: { disabled: false },
13
- video: { disabled: false },
14
- image: { disabled: false },
15
- },
16
- rubriclessInstruction: {
17
- inputConfiguration: {
18
- audio: { disabled: false },
19
- video: { disabled: false },
20
- image: { disabled: false },
21
- },
22
- },
23
- showExcludeZero: {
24
- settings: true,
25
- label: 'Ability to exclude zero',
26
- },
27
- showMaxPoint: {
28
- settings: true,
29
- label: 'Show max points dropdown',
30
- },
31
- settingsPanelDisabled: false,
32
- // width: '500px'
33
- mathMlOptions: {
34
- mmlOutput: false,
35
- mmlEditing: false,
36
- },
37
- maxMaxPoints: 9,
38
- },
39
- };
@@ -1,127 +0,0 @@
1
- import {
2
- ModelUpdatedEvent,
3
- InsertImageEvent,
4
- DeleteImageEvent
5
- } from '@pie-framework/pie-configure-events';
6
- import React from 'react';
7
- import ReactDOM from 'react-dom';
8
- import debug from 'debug';
9
-
10
- import Main from './main';
11
- import defaults from './defaults';
12
-
13
- const modelWithDefaults = (m) => ({...defaults.model, ...m});
14
- const configurationWithDefaults = (c) => ({...defaults.configuration, ...c});
15
-
16
- export default class RubricElement extends HTMLElement {
17
-
18
-
19
- constructor() {
20
- super();
21
- debug.log('constructor called');
22
- this._model = modelWithDefaults();
23
- this._configuration = configurationWithDefaults();
24
- this.onModelChanged = this.onModelChanged.bind(this);
25
- this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
26
- }
27
-
28
- updateModelAccordingToReceivedProps = (nextModel) => {
29
- const currentModel = {...this._model};
30
- if (!nextModel) {
31
- return currentModel;
32
- }
33
-
34
- const validatedModel = nextModel;
35
- const { maxPoints, excludeZero } = validatedModel || {};
36
-
37
- validatedModel.points = validatedModel.points ? [...validatedModel.points] : [];
38
- validatedModel.sampleAnswers = validatedModel.sampleAnswers ? [...validatedModel.sampleAnswers] : [];
39
-
40
- const howManyPointsShouldHave = excludeZero ? maxPoints : maxPoints + 1;
41
- const howManyPointsDoesItHave = validatedModel.points.length;
42
-
43
- const excludeZeroChanged = currentModel?.excludeZero !== nextModel?.excludeZero;
44
- const maxPointsChanged = currentModel?.maxPoints !== nextModel?.maxPoints;
45
-
46
- if (howManyPointsDoesItHave < howManyPointsShouldHave) {
47
- if (excludeZeroChanged && !excludeZero) {
48
- validatedModel.points = ['', ...validatedModel.points];
49
- validatedModel.sampleAnswers = [null, ...validatedModel.sampleAnswers];
50
- }
51
- if (maxPointsChanged) {
52
- for (let i = 0; i < howManyPointsShouldHave - howManyPointsDoesItHave; i++) {
53
- validatedModel.points.push('');
54
- validatedModel.sampleAnswers.push(null);
55
- }
56
- }
57
- }
58
- else if (howManyPointsDoesItHave > howManyPointsShouldHave) {
59
- if (excludeZeroChanged && excludeZero) {
60
- validatedModel.points = validatedModel.points.slice(1);
61
- validatedModel.sampleAnswers = validatedModel.sampleAnswers.slice(1);
62
- }
63
- if (maxPointsChanged) {
64
- validatedModel.points = validatedModel.points.slice(0, howManyPointsShouldHave);
65
- validatedModel.sampleAnswers = validatedModel.sampleAnswers.slice(0, howManyPointsShouldHave);
66
- }
67
- }
68
-
69
- return validatedModel;
70
- }
71
-
72
- set model(m) {
73
- this._model = this.updateModelAccordingToReceivedProps(modelWithDefaults(m));
74
- this._render();
75
- }
76
-
77
- set configuration(c) {
78
- this._configuration = configurationWithDefaults(c);
79
- this._render();
80
- }
81
-
82
- onModelChanged(m) {
83
- this._model = this.updateModelAccordingToReceivedProps(m);
84
- this._render();
85
- this.dispatchEvent(new ModelUpdatedEvent(this._model, false));
86
- }
87
-
88
- onConfigurationChanged = (c) => {
89
- this._configuration = configurationWithDefaults(c);
90
-
91
- if (this._model) {
92
- this.onModelChanged(this._model);
93
- }
94
-
95
- this._render();
96
- };
97
-
98
- insertImage(handler) {
99
- this.dispatchEvent(new InsertImageEvent(handler));
100
- }
101
-
102
- onDeleteImage(src, done) {
103
- this.dispatchEvent(new DeleteImageEvent(src, done));
104
- }
105
-
106
- connectedCallback() {
107
- this._render();
108
- }
109
-
110
- _render() {
111
- console.log('THE MODEL', this._model);
112
- if (this._model) {
113
- let element = React.createElement(Main, {
114
- model: this._model,
115
- configuration: this._configuration,
116
- onModelChanged: this.onModelChanged,
117
- onConfigurationChanged: this.onConfigurationChanged,
118
- imageSupport: {
119
- add: this.insertImage.bind(this),
120
- delete: this.onDeleteImage.bind(this),
121
- },
122
- });
123
-
124
- ReactDOM.render(element, this);
125
- }
126
- }
127
- }
@@ -1,87 +0,0 @@
1
- import React from 'react';
2
- import { Authoring } from './pie-toolbox-rubric/index';
3
- import { withStyles } from '@material-ui/core/styles';
4
- import { layout, settings } from '@pie-lib/pie-toolbox/config-ui';
5
-
6
- const { Panel, toggle } = settings;
7
-
8
- const styles = (theme) => ({
9
- design: {
10
- fontFamily: 'Cerebri Sans',
11
- fontSize: theme.typography.fontSize,
12
- },
13
- });
14
-
15
- class Main extends React.Component {
16
- verifyRubriclessModel = (m, config) => {
17
- const { rubricless = false } = config || {};
18
- return rubricless ? (({ points, sampleAnswers, ...rest }) => rest)(m) : m;
19
- };
20
-
21
- render() {
22
- const { model, configuration, onConfigurationChanged, onModelChanged, imageSupport } = this.props || {};
23
- const {
24
- baseInputConfiguration = {},
25
- contentDimensions = {},
26
- settingsPanelDisabled,
27
- showExcludeZero = {},
28
- showMaxPoint = {},
29
- mathMlOptions = {},
30
- rubricless = false,
31
- rubriclessInstruction,
32
- width,
33
- } = configuration || {};
34
-
35
- // ensure to eliminate points and sampleAnswers in case of rubricless
36
- const value = this.verifyRubriclessModel(model, configuration);
37
-
38
- const panelProperties = {
39
- excludeZeroEnabled: showExcludeZero.settings && toggle(showExcludeZero.label),
40
- maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label),
41
- rubriclessInstructionEnabled: rubricless && rubriclessInstruction.settings && toggle(rubriclessInstruction.label),
42
- };
43
-
44
- const getPluginProps = (props) => {
45
- return Object.assign(
46
- {
47
- ...baseInputConfiguration,
48
- },
49
- props || {},
50
- );
51
- };
52
-
53
- return (
54
- <layout.ConfigLayout
55
- dimensions={contentDimensions}
56
- hideSettings={settingsPanelDisabled}
57
- settings={
58
- <Panel
59
- model={model}
60
- onChangeModel={onModelChanged}
61
- configuration={configuration}
62
- onChangeConfiguration={onConfigurationChanged}
63
- pluginOpts={getPluginProps(rubriclessInstruction?.inputConfiguration)}
64
- groups={{
65
- Properties: panelProperties,
66
- }}
67
- imageSupport={imageSupport}
68
- />
69
- }
70
- >
71
- <div style={{ maxWidth: width }}>
72
- <Authoring
73
- value={value}
74
- config={configuration}
75
- onChange={onModelChanged}
76
- mathMlOptions={mathMlOptions}
77
- rubricless={rubricless}
78
- pluginOpts={baseInputConfiguration}
79
- imageSupport={imageSupport}
80
- />
81
- </div>
82
- </layout.ConfigLayout>
83
- );
84
- }
85
- }
86
-
87
- export default withStyles(styles)(Main);