@pie-element/complex-rubric 1.1.1-next.5 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/configure/CHANGELOG.md +19 -0
- package/configure/package.json +1 -1
- package/controller/CHANGELOG.md +11 -0
- package/controller/package.json +1 -1
- package/package.json +3 -3
- package/configure/node_modules/@pie-element/rubric/CHANGELOG.json +0 -257
- package/configure/node_modules/@pie-element/rubric/CHANGELOG.md +0 -768
- package/configure/node_modules/@pie-element/rubric/LICENSE.md +0 -5
- package/configure/node_modules/@pie-element/rubric/README.md +0 -3
- package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.json +0 -197
- package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.md +0 -652
- package/configure/node_modules/@pie-element/rubric/configure/lib/defaults.js +0 -29
- package/configure/node_modules/@pie-element/rubric/configure/lib/defaults.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/lib/index.js +0 -130
- package/configure/node_modules/@pie-element/rubric/configure/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/lib/main.js +0 -96
- package/configure/node_modules/@pie-element/rubric/configure/lib/main.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/package.json +0 -18
- package/configure/node_modules/@pie-element/rubric/configure/src/defaults.js +0 -21
- package/configure/node_modules/@pie-element/rubric/configure/src/index.js +0 -64
- package/configure/node_modules/@pie-element/rubric/configure/src/main.jsx +0 -49
- package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.json +0 -17
- package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.md +0 -105
- package/configure/node_modules/@pie-element/rubric/controller/lib/index.js +0 -14
- package/configure/node_modules/@pie-element/rubric/controller/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/controller/package.json +0 -9
- package/configure/node_modules/@pie-element/rubric/controller/src/__tests__/index.test.js +0 -35
- package/configure/node_modules/@pie-element/rubric/controller/src/index.js +0 -6
- package/configure/node_modules/@pie-element/rubric/docs/config-schema.json +0 -24
- package/configure/node_modules/@pie-element/rubric/docs/config-schema.json.md +0 -19
- package/configure/node_modules/@pie-element/rubric/docs/demo/config.js +0 -8
- package/configure/node_modules/@pie-element/rubric/docs/demo/generate.js +0 -8
- package/configure/node_modules/@pie-element/rubric/docs/demo/index.html +0 -3
- package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json +0 -62
- package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json.md +0 -35
- package/configure/node_modules/@pie-element/rubric/lib/index.js +0 -88
- package/configure/node_modules/@pie-element/rubric/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/lib/main.js +0 -171
- package/configure/node_modules/@pie-element/rubric/lib/main.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/lib/print.js +0 -114
- package/configure/node_modules/@pie-element/rubric/lib/print.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/package.json +0 -25
- package/configure/node_modules/@pie-element/rubric/src/__tests__/__snapshots__/rubric-view.test.jsx.snap +0 -22767
- package/configure/node_modules/@pie-element/rubric/src/__tests__/rubric-view.test.jsx +0 -48
- package/configure/node_modules/@pie-element/rubric/src/index.js +0 -38
- package/configure/node_modules/@pie-element/rubric/src/main.jsx +0 -117
- package/configure/node_modules/@pie-element/rubric/src/print.js +0 -63
|
@@ -1,130 +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"] = 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 _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
23
|
-
|
|
24
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
|
-
var _pieConfigureEvents = require("@pie-framework/pie-configure-events");
|
|
27
|
-
|
|
28
|
-
var _react = _interopRequireDefault(require("react"));
|
|
29
|
-
|
|
30
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
31
|
-
|
|
32
|
-
var _debug = _interopRequireDefault(require("debug"));
|
|
33
|
-
|
|
34
|
-
var _main = _interopRequireDefault(require("./main"));
|
|
35
|
-
|
|
36
|
-
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
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
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
43
|
-
|
|
44
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
45
|
-
|
|
46
|
-
var modelWithDefaults = function modelWithDefaults(m) {
|
|
47
|
-
return _objectSpread(_objectSpread({}, _defaults["default"].model), m);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
var configurationWithDefaults = function configurationWithDefaults(c) {
|
|
51
|
-
return _objectSpread(_objectSpread({}, _defaults["default"].configuration), c);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
var RubricElement = /*#__PURE__*/function (_HTMLElement) {
|
|
55
|
-
(0, _inherits2["default"])(RubricElement, _HTMLElement);
|
|
56
|
-
|
|
57
|
-
var _super = _createSuper(RubricElement);
|
|
58
|
-
|
|
59
|
-
function RubricElement() {
|
|
60
|
-
var _this;
|
|
61
|
-
|
|
62
|
-
(0, _classCallCheck2["default"])(this, RubricElement);
|
|
63
|
-
_this = _super.call(this);
|
|
64
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onConfigurationChanged", function (c) {
|
|
65
|
-
_this._configuration = configurationWithDefaults(c);
|
|
66
|
-
|
|
67
|
-
if (_this._model) {
|
|
68
|
-
_this.onModelChanged(_this._model);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
_this._render();
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
_debug["default"].log('constructor called');
|
|
75
|
-
|
|
76
|
-
_this._model = modelWithDefaults();
|
|
77
|
-
_this._configuration = configurationWithDefaults();
|
|
78
|
-
_this.onModelChanged = _this.onModelChanged.bind((0, _assertThisInitialized2["default"])(_this));
|
|
79
|
-
_this.onConfigurationChanged = _this.onConfigurationChanged.bind((0, _assertThisInitialized2["default"])(_this));
|
|
80
|
-
return _this;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
(0, _createClass2["default"])(RubricElement, [{
|
|
84
|
-
key: "model",
|
|
85
|
-
set: function set(m) {
|
|
86
|
-
this._model = modelWithDefaults(m);
|
|
87
|
-
|
|
88
|
-
this._render();
|
|
89
|
-
}
|
|
90
|
-
}, {
|
|
91
|
-
key: "configuration",
|
|
92
|
-
set: function set(c) {
|
|
93
|
-
this._configuration = configurationWithDefaults(c);
|
|
94
|
-
|
|
95
|
-
this._render();
|
|
96
|
-
}
|
|
97
|
-
}, {
|
|
98
|
-
key: "onModelChanged",
|
|
99
|
-
value: function onModelChanged(m) {
|
|
100
|
-
this._model = m;
|
|
101
|
-
|
|
102
|
-
this._render();
|
|
103
|
-
|
|
104
|
-
this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(this._model, false));
|
|
105
|
-
}
|
|
106
|
-
}, {
|
|
107
|
-
key: "connectedCallback",
|
|
108
|
-
value: function connectedCallback() {
|
|
109
|
-
this._render();
|
|
110
|
-
}
|
|
111
|
-
}, {
|
|
112
|
-
key: "_render",
|
|
113
|
-
value: function _render() {
|
|
114
|
-
if (this._model) {
|
|
115
|
-
var element = /*#__PURE__*/_react["default"].createElement(_main["default"], {
|
|
116
|
-
model: this._model,
|
|
117
|
-
configuration: this._configuration,
|
|
118
|
-
onModelChanged: this.onModelChanged,
|
|
119
|
-
onConfigurationChanged: this.onConfigurationChanged
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
_reactDom["default"].render(element, this);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}]);
|
|
126
|
-
return RubricElement;
|
|
127
|
-
}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLElement));
|
|
128
|
-
|
|
129
|
-
exports["default"] = RubricElement;
|
|
130
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["modelWithDefaults","m","defaults","model","configurationWithDefaults","c","configuration","RubricElement","_configuration","_model","onModelChanged","_render","debug","log","bind","onConfigurationChanged","dispatchEvent","ModelUpdatedEvent","element","React","createElement","Main","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAAAC,CAAC;AAAA,yCAAUC,qBAASC,KAAnB,GAA6BF,CAA7B;AAAA,CAA3B;;AACA,IAAMG,yBAAyB,GAAG,SAA5BA,yBAA4B,CAAAC,CAAC;AAAA,yCAAUH,qBAASI,aAAnB,GAAqCD,CAArC;AAAA,CAAnC;;IAEqBE,a;;;;;AACnB,2BAAc;AAAA;;AAAA;AACZ;AADY,+GAyBW,UAACF,CAAD,EAAO;AAC9B,YAAKG,cAAL,GAAsBJ,yBAAyB,CAACC,CAAD,CAA/C;;AAEA,UAAI,MAAKI,MAAT,EAAiB;AACf,cAAKC,cAAL,CAAoB,MAAKD,MAAzB;AACD;;AAED,YAAKE,OAAL;AACD,KAjCa;;AAEZC,sBAAMC,GAAN,CAAU,oBAAV;;AACA,UAAKJ,MAAL,GAAcT,iBAAiB,EAA/B;AACA,UAAKQ,cAAL,GAAsBJ,yBAAyB,EAA/C;AACA,UAAKM,cAAL,GAAsB,MAAKA,cAAL,CAAoBI,IAApB,gDAAtB;AACA,UAAKC,sBAAL,GAA8B,MAAKA,sBAAL,CAA4BD,IAA5B,gDAA9B;AANY;AAOb;;;;SAED,aAAUb,CAAV,EAAa;AACX,WAAKQ,MAAL,GAAcT,iBAAiB,CAACC,CAAD,CAA/B;;AACA,WAAKU,OAAL;AACD;;;SAED,aAAkBN,CAAlB,EAAqB;AACnB,WAAKG,cAAL,GAAsBJ,yBAAyB,CAACC,CAAD,CAA/C;;AACA,WAAKM,OAAL;AACD;;;WAED,wBAAeV,CAAf,EAAkB;AAChB,WAAKQ,MAAL,GAAcR,CAAd;;AACA,WAAKU,OAAL;;AACA,WAAKK,aAAL,CAAmB,IAAIC,qCAAJ,CAAsB,KAAKR,MAA3B,EAAmC,KAAnC,CAAnB;AACD;;;WAYD,6BAAoB;AAClB,WAAKE,OAAL;AACD;;;WAED,mBAAU;AACR,UAAI,KAAKF,MAAT,EAAiB;AACf,YAAIS,OAAO,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACtClB,UAAAA,KAAK,EAAE,KAAKM,MAD0B;AAEtCH,UAAAA,aAAa,EAAE,KAAKE,cAFkB;AAGtCE,UAAAA,cAAc,EAAE,KAAKA,cAHiB;AAItCK,UAAAA,sBAAsB,EAAE,KAAKA;AAJS,SAA1B,CAAd;;AAOAO,6BAASC,MAAT,CAAgBL,OAAhB,EAAyB,IAAzB;AACD;AACF;;;kDAnDwCM,W","sourcesContent":["import { ModelUpdatedEvent } from '@pie-framework/pie-configure-events';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport debug from 'debug';\n\nimport Main from './main';\nimport defaults from './defaults';\n\nconst modelWithDefaults = m => ({ ...defaults.model, ...m });\nconst configurationWithDefaults = c => ({ ...defaults.configuration, ...c });\n\nexport default class RubricElement extends HTMLElement {\n constructor() {\n super();\n debug.log('constructor called');\n this._model = modelWithDefaults();\n this._configuration = configurationWithDefaults();\n this.onModelChanged = this.onModelChanged.bind(this);\n this.onConfigurationChanged = this.onConfigurationChanged.bind(this);\n }\n\n set model(m) {\n this._model = modelWithDefaults(m);\n this._render();\n }\n\n set configuration(c) {\n this._configuration = configurationWithDefaults(c);\n this._render();\n }\n\n onModelChanged(m) {\n this._model = m;\n this._render();\n this.dispatchEvent(new ModelUpdatedEvent(this._model, false));\n }\n\n onConfigurationChanged = (c) => {\n this._configuration = configurationWithDefaults(c);\n\n if (this._model) {\n this.onModelChanged(this._model);\n }\n\n this._render();\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n if (this._model) {\n let element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n });\n\n ReactDOM.render(element, this);\n }\n }\n}\n"],"file":"index.js"}
|
|
@@ -1,96 +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"] = 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 _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireDefault(require("react"));
|
|
21
|
-
|
|
22
|
-
var _rubric = require("@pie-lib/rubric");
|
|
23
|
-
|
|
24
|
-
var _styles = require("@material-ui/core/styles");
|
|
25
|
-
|
|
26
|
-
var _configUi = require("@pie-lib/config-ui");
|
|
27
|
-
|
|
28
|
-
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); }; }
|
|
29
|
-
|
|
30
|
-
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; } }
|
|
31
|
-
|
|
32
|
-
var Panel = _configUi.settings.Panel,
|
|
33
|
-
toggle = _configUi.settings.toggle;
|
|
34
|
-
var styles = {
|
|
35
|
-
design: {
|
|
36
|
-
fontFamily: 'Cerebri Sans',
|
|
37
|
-
fontSize: '14px'
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
var Main = /*#__PURE__*/function (_React$Component) {
|
|
42
|
-
(0, _inherits2["default"])(Main, _React$Component);
|
|
43
|
-
|
|
44
|
-
var _super = _createSuper(Main);
|
|
45
|
-
|
|
46
|
-
function Main() {
|
|
47
|
-
(0, _classCallCheck2["default"])(this, Main);
|
|
48
|
-
return _super.apply(this, arguments);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
(0, _createClass2["default"])(Main, [{
|
|
52
|
-
key: "render",
|
|
53
|
-
value: function render() {
|
|
54
|
-
var _ref = this.props || {},
|
|
55
|
-
model = _ref.model,
|
|
56
|
-
classes = _ref.classes,
|
|
57
|
-
configuration = _ref.configuration,
|
|
58
|
-
onConfigurationChanged = _ref.onConfigurationChanged,
|
|
59
|
-
onModelChanged = _ref.onModelChanged;
|
|
60
|
-
|
|
61
|
-
var _ref2 = configuration || {},
|
|
62
|
-
settingsPanelDisabled = _ref2.settingsPanelDisabled,
|
|
63
|
-
showExcludeZero = _ref2.showExcludeZero,
|
|
64
|
-
showMaxPoint = _ref2.showMaxPoint;
|
|
65
|
-
|
|
66
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
67
|
-
className: classes.design
|
|
68
|
-
}, settingsPanelDisabled ? /*#__PURE__*/_react["default"].createElement(_rubric.Authoring, {
|
|
69
|
-
value: model,
|
|
70
|
-
onChange: onModelChanged
|
|
71
|
-
}) : /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
72
|
-
settings: /*#__PURE__*/_react["default"].createElement(Panel, {
|
|
73
|
-
model: model,
|
|
74
|
-
onChangeModel: onModelChanged,
|
|
75
|
-
configuration: configuration,
|
|
76
|
-
onChangeConfiguration: onConfigurationChanged,
|
|
77
|
-
groups: {
|
|
78
|
-
Properties: {
|
|
79
|
-
excludeZeroEnabled: showExcludeZero.settings && toggle(showExcludeZero.label),
|
|
80
|
-
maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label)
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
}, /*#__PURE__*/_react["default"].createElement(_rubric.Authoring, {
|
|
85
|
-
value: model,
|
|
86
|
-
onChange: onModelChanged
|
|
87
|
-
})));
|
|
88
|
-
}
|
|
89
|
-
}]);
|
|
90
|
-
return Main;
|
|
91
|
-
}(_react["default"].Component);
|
|
92
|
-
|
|
93
|
-
var _default = (0, _styles.withStyles)(styles)(Main);
|
|
94
|
-
|
|
95
|
-
exports["default"] = _default;
|
|
96
|
-
//# sourceMappingURL=main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["Panel","settings","toggle","styles","design","fontFamily","fontSize","Main","props","model","classes","configuration","onConfigurationChanged","onModelChanged","settingsPanelDisabled","showExcludeZero","showMaxPoint","Properties","excludeZeroEnabled","label","maxPointsEnabled","React","Component"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAQA,KAAR,GAA0BC,kBAA1B,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA0BD,kBAA1B,CAAeC,MAAf;AAEA,IAAMC,MAAM,GAAG;AACbC,EAAAA,MAAM,EAAE;AACNC,IAAAA,UAAU,EAAE,cADN;AAENC,IAAAA,QAAQ,EAAE;AAFJ;AADK,CAAf;;IAOMC,I;;;;;;;;;;;;WACJ,kBAAS;AACP,iBAAkF,KAAKC,KAAL,IAAc,EAAhG;AAAA,UAAQC,KAAR,QAAQA,KAAR;AAAA,UAAeC,OAAf,QAAeA,OAAf;AAAA,UAAwBC,aAAxB,QAAwBA,aAAxB;AAAA,UAAuCC,sBAAvC,QAAuCA,sBAAvC;AAAA,UAA+DC,cAA/D,QAA+DA,cAA/D;;AACA,kBAIIF,aAAa,IAAI,EAJrB;AAAA,UACEG,qBADF,SACEA,qBADF;AAAA,UAEEC,eAFF,SAEEA,eAFF;AAAA,UAGEC,YAHF,SAGEA,YAHF;;AAKA,0BACE;AAAK,QAAA,SAAS,EAAEN,OAAO,CAACN;AAAxB,SACGU,qBAAqB,gBAAG,gCAAC,iBAAD;AAAW,QAAA,KAAK,EAAEL,KAAlB;AAAyB,QAAA,QAAQ,EAAEI;AAAnC,QAAH,gBACpB,gCAAC,gBAAD,CAAQ,YAAR;AACE,QAAA,QAAQ,eACN,gCAAC,KAAD;AACE,UAAA,KAAK,EAAEJ,KADT;AAEE,UAAA,aAAa,EAAEI,cAFjB;AAGE,UAAA,aAAa,EAAEF,aAHjB;AAIE,UAAA,qBAAqB,EAAEC,sBAJzB;AAKE,UAAA,MAAM,EAAE;AACNK,YAAAA,UAAU,EAAE;AACVC,cAAAA,kBAAkB,EAAEH,eAAe,CAACd,QAAhB,IAA4BC,MAAM,CAACa,eAAe,CAACI,KAAjB,CAD5C;AAEVC,cAAAA,gBAAgB,EAAEJ,YAAY,CAACf,QAAb,IAAyBC,MAAM,CAACc,YAAY,CAACG,KAAd;AAFvC;AADN;AALV;AAFJ,sBAgBE,gCAAC,iBAAD;AAAW,QAAA,KAAK,EAAEV,KAAlB;AAAyB,QAAA,QAAQ,EAAEI;AAAnC,QAhBF,CAFJ,CADF;AAuBD;;;EA/BgBQ,kBAAMC,S;;eAkCV,wBAAWnB,MAAX,EAAmBI,IAAnB,C","sourcesContent":["import React from 'react';\nimport { Authoring } from '@pie-lib/rubric';\nimport { withStyles } from '@material-ui/core/styles';\nimport { layout, settings } from '@pie-lib/config-ui';\n\nconst { Panel, toggle } = settings;\n\nconst styles = {\n design: {\n fontFamily: 'Cerebri Sans',\n fontSize: '14px',\n }\n};\n\nclass Main extends React.Component {\n render() {\n const { model, classes, configuration, onConfigurationChanged, onModelChanged } = this.props || {};\n const {\n settingsPanelDisabled,\n showExcludeZero,\n showMaxPoint\n } = configuration || {};\n return (\n <div className={classes.design}>\n {settingsPanelDisabled ? <Authoring value={model} onChange={onModelChanged} /> :\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n onChangeModel={onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Properties: {\n excludeZeroEnabled: showExcludeZero.settings && toggle(showExcludeZero.label),\n maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label),\n }\n }}\n />\n }\n >\n <Authoring value={model} onChange={onModelChanged} />\n </layout.ConfigLayout>}\n </div>\n )\n }\n}\n\nexport default withStyles(styles)(Main);\n"],"file":"main.js"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pie-element/rubric-configure",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "2.1.1",
|
|
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/config-ui": "^11.0.20",
|
|
12
|
-
"@pie-lib/rubric": "^0.6.0",
|
|
13
|
-
"debug": "^4.1.1",
|
|
14
|
-
"react": "^16.8.6",
|
|
15
|
-
"react-dom": "^16.8.6"
|
|
16
|
-
},
|
|
17
|
-
"license": "ISC"
|
|
18
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
model: {
|
|
3
|
-
points: ['', '', '', ''],
|
|
4
|
-
sampleAnswers: [null, null, null, null],
|
|
5
|
-
maxPoints: 4,
|
|
6
|
-
excludeZero: false,
|
|
7
|
-
excludeZeroEnabled: true,
|
|
8
|
-
maxPointsEnabled: true
|
|
9
|
-
},
|
|
10
|
-
configuration: {
|
|
11
|
-
showExcludeZero: {
|
|
12
|
-
settings: true,
|
|
13
|
-
label: 'Ability to exclude zero',
|
|
14
|
-
},
|
|
15
|
-
showMaxPoint: {
|
|
16
|
-
settings: true,
|
|
17
|
-
label: 'Show max points dropdown'
|
|
18
|
-
},
|
|
19
|
-
settingsPanelDisabled: false
|
|
20
|
-
}
|
|
21
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { ModelUpdatedEvent } from '@pie-framework/pie-configure-events';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import ReactDOM from 'react-dom';
|
|
4
|
-
import debug from 'debug';
|
|
5
|
-
|
|
6
|
-
import Main from './main';
|
|
7
|
-
import defaults from './defaults';
|
|
8
|
-
|
|
9
|
-
const modelWithDefaults = m => ({ ...defaults.model, ...m });
|
|
10
|
-
const configurationWithDefaults = c => ({ ...defaults.configuration, ...c });
|
|
11
|
-
|
|
12
|
-
export default class RubricElement extends HTMLElement {
|
|
13
|
-
constructor() {
|
|
14
|
-
super();
|
|
15
|
-
debug.log('constructor called');
|
|
16
|
-
this._model = modelWithDefaults();
|
|
17
|
-
this._configuration = configurationWithDefaults();
|
|
18
|
-
this.onModelChanged = this.onModelChanged.bind(this);
|
|
19
|
-
this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
set model(m) {
|
|
23
|
-
this._model = modelWithDefaults(m);
|
|
24
|
-
this._render();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
set configuration(c) {
|
|
28
|
-
this._configuration = configurationWithDefaults(c);
|
|
29
|
-
this._render();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
onModelChanged(m) {
|
|
33
|
-
this._model = m;
|
|
34
|
-
this._render();
|
|
35
|
-
this.dispatchEvent(new ModelUpdatedEvent(this._model, false));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
onConfigurationChanged = (c) => {
|
|
39
|
-
this._configuration = configurationWithDefaults(c);
|
|
40
|
-
|
|
41
|
-
if (this._model) {
|
|
42
|
-
this.onModelChanged(this._model);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
this._render();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
connectedCallback() {
|
|
49
|
-
this._render();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
_render() {
|
|
53
|
-
if (this._model) {
|
|
54
|
-
let element = React.createElement(Main, {
|
|
55
|
-
model: this._model,
|
|
56
|
-
configuration: this._configuration,
|
|
57
|
-
onModelChanged: this.onModelChanged,
|
|
58
|
-
onConfigurationChanged: this.onConfigurationChanged,
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
ReactDOM.render(element, this);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Authoring } from '@pie-lib/rubric';
|
|
3
|
-
import { withStyles } from '@material-ui/core/styles';
|
|
4
|
-
import { layout, settings } from '@pie-lib/config-ui';
|
|
5
|
-
|
|
6
|
-
const { Panel, toggle } = settings;
|
|
7
|
-
|
|
8
|
-
const styles = {
|
|
9
|
-
design: {
|
|
10
|
-
fontFamily: 'Cerebri Sans',
|
|
11
|
-
fontSize: '14px',
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
class Main extends React.Component {
|
|
16
|
-
render() {
|
|
17
|
-
const { model, classes, configuration, onConfigurationChanged, onModelChanged } = this.props || {};
|
|
18
|
-
const {
|
|
19
|
-
settingsPanelDisabled,
|
|
20
|
-
showExcludeZero,
|
|
21
|
-
showMaxPoint
|
|
22
|
-
} = configuration || {};
|
|
23
|
-
return (
|
|
24
|
-
<div className={classes.design}>
|
|
25
|
-
{settingsPanelDisabled ? <Authoring value={model} onChange={onModelChanged} /> :
|
|
26
|
-
<layout.ConfigLayout
|
|
27
|
-
settings={
|
|
28
|
-
<Panel
|
|
29
|
-
model={model}
|
|
30
|
-
onChangeModel={onModelChanged}
|
|
31
|
-
configuration={configuration}
|
|
32
|
-
onChangeConfiguration={onConfigurationChanged}
|
|
33
|
-
groups={{
|
|
34
|
-
Properties: {
|
|
35
|
-
excludeZeroEnabled: showExcludeZero.settings && toggle(showExcludeZero.label),
|
|
36
|
-
maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label),
|
|
37
|
-
}
|
|
38
|
-
}}
|
|
39
|
-
/>
|
|
40
|
-
}
|
|
41
|
-
>
|
|
42
|
-
<Authoring value={model} onChange={onModelChanged} />
|
|
43
|
-
</layout.ConfigLayout>}
|
|
44
|
-
</div>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export default withStyles(styles)(Main);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"type": "fix",
|
|
4
|
-
"scope": null,
|
|
5
|
-
"subject": "bump all packages to avoid tag conflict",
|
|
6
|
-
"merge": null,
|
|
7
|
-
"header": "fix: bump all packages to avoid tag conflict",
|
|
8
|
-
"body": null,
|
|
9
|
-
"footer": null,
|
|
10
|
-
"notes": [],
|
|
11
|
-
"hash": "d9ec9a8689f0a391594b5e2f4ea958c6dc9f6d7b",
|
|
12
|
-
"gitTags": " (develop)",
|
|
13
|
-
"committerDate": "2020-04-10 20:01:37 +0100",
|
|
14
|
-
"isTagged": true,
|
|
15
|
-
"tag": "@pie-element/rubric-controller@1.1.1"
|
|
16
|
-
}
|
|
17
|
-
]
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [1.2.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.2...@pie-element/rubric-controller@1.2.4) (2021-11-11)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## [1.2.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.2...@pie-element/rubric-controller@1.2.3) (2021-11-11)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## [1.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.0...@pie-element/rubric-controller@1.2.2) (2021-08-05)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
### Bug Fixes
|
|
26
|
-
|
|
27
|
-
* force bump ([5ea7295](https://github.com/pie-framework/pie-elements/commit/5ea7295e4755fbc492a76e7ec69e5fc35b196919))
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
# [1.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.1.8...@pie-element/rubric-controller@1.2.0) (2021-06-29)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
### Features
|
|
37
|
-
|
|
38
|
-
* **rubric:** Added sample answers to the model - PD-621 ([#559](https://github.com/pie-framework/pie-elements/issues/559)) ([d436b47](https://github.com/pie-framework/pie-elements/commit/d436b47b1cb8dd7cfbd82dbd2de4dd5eab36905c))
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
## [1.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.1.6...@pie-element/rubric-controller@1.1.8) (2021-03-03)
|
|
45
|
-
|
|
46
|
-
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
## [1.1.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.1.4...@pie-element/rubric-controller@1.1.6) (2021-03-03)
|
|
53
|
-
|
|
54
|
-
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
## [1.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.1.3...@pie-element/rubric-controller@1.1.4) (2020-05-25)
|
|
61
|
-
|
|
62
|
-
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
## [1.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.1.2...@pie-element/rubric-controller@1.1.3) (2020-05-25)
|
|
69
|
-
|
|
70
|
-
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
## [1.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.1.1...@pie-element/rubric-controller@1.1.2) (2020-04-14)
|
|
77
|
-
|
|
78
|
-
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
## [1.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.0.2...@pie-element/rubric-controller@1.1.1) (2020-04-10)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
### Bug Fixes
|
|
88
|
-
|
|
89
|
-
* bump all packages to avoid tag conflict ([d9ec9a8](https://github.com/pie-framework/pie-elements/commit/d9ec9a8))
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
## [1.0.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.0.1...@pie-element/rubric-controller@1.0.2) (2019-06-17)
|
|
96
|
-
|
|
97
|
-
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
## 1.0.1 (2019-05-31)
|
|
104
|
-
|
|
105
|
-
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.model = model;
|
|
7
|
-
|
|
8
|
-
function model(model, session, env) {
|
|
9
|
-
return new Promise(function (resolve) {
|
|
10
|
-
var modelResult = !model ? {} : model;
|
|
11
|
-
resolve(env && env.role && env.role === 'instructor' ? modelResult : {});
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["model","session","env","Promise","resolve","modelResult","role"],"mappings":";;;;;;;AAAO,SAASA,KAAT,CAAeA,KAAf,EAAsBC,OAAtB,EAA+BC,GAA/B,EAAoC;AACzC,SAAO,IAAIC,OAAJ,CAAY,UAAAC,OAAO,EAAI;AAC5B,QAAMC,WAAW,GAAG,CAACL,KAAD,GAAS,EAAT,GAAcA,KAAlC;AACAI,IAAAA,OAAO,CAAEF,GAAG,IAAIA,GAAG,CAACI,IAAX,IAAmBJ,GAAG,CAACI,IAAJ,KAAa,YAAjC,GAAiDD,WAAjD,GAA+D,EAAhE,CAAP;AACD,GAHM,CAAP;AAID","sourcesContent":["export function model(model, session, env) {\n return new Promise(resolve => {\n const modelResult = !model ? {} : model;\n resolve((env && env.role && env.role === 'instructor') ? modelResult : {});\n });\n}\n"],"file":"index.js"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { model } from '../index';
|
|
2
|
-
|
|
3
|
-
describe('rubric model', () => {
|
|
4
|
-
|
|
5
|
-
let state = {
|
|
6
|
-
points: ['nothing right', 'a teeny bit right', 'mostly right', 'bingo'],
|
|
7
|
-
sampleAnswers: [null, 'just right', 'not left', null],
|
|
8
|
-
maxPoints: 4,
|
|
9
|
-
excludeZero: false
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
let session = {};
|
|
13
|
-
let env, result;
|
|
14
|
-
|
|
15
|
-
it('returns no model for gather', async () => {
|
|
16
|
-
env = { mode: 'gather' };
|
|
17
|
-
result = await model(state, session, env);
|
|
18
|
-
expect(result).toEqual({});
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('returns no model for student role', async () => {
|
|
22
|
-
env = { mode: 'gather', role: 'student' };
|
|
23
|
-
result = await model(state, session, env);
|
|
24
|
-
expect(result).toEqual({});
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('returns model for instructor role', async () => {
|
|
28
|
-
env = { mode: 'gather', role: 'instructor' };
|
|
29
|
-
result = await model(state, session, env);
|
|
30
|
-
expect(result).toEqual(state);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "object",
|
|
3
|
-
"properties": {
|
|
4
|
-
"showPrompt": {
|
|
5
|
-
"description": "Determines whether prompt field will be displayed or not",
|
|
6
|
-
"default": true,
|
|
7
|
-
"type": "boolean",
|
|
8
|
-
"title": "showPrompt"
|
|
9
|
-
},
|
|
10
|
-
"promptLabel": {
|
|
11
|
-
"description": "The label for the item stem/prompt field",
|
|
12
|
-
"default": "Item Stemm",
|
|
13
|
-
"type": "string",
|
|
14
|
-
"title": "promptLabel"
|
|
15
|
-
},
|
|
16
|
-
"settingsPartialScoring": {
|
|
17
|
-
"description": "Indicates whether the settings panel wil allow the author to modify settings for partial scoring",
|
|
18
|
-
"default": true,
|
|
19
|
-
"type": "boolean",
|
|
20
|
-
"title": "settingsPartialScoring"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
24
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
The schema defines the following properties:
|
|
2
|
-
|
|
3
|
-
# `showPrompt` (boolean)
|
|
4
|
-
|
|
5
|
-
Determines whether prompt field will be displayed or not
|
|
6
|
-
|
|
7
|
-
Default: `true`
|
|
8
|
-
|
|
9
|
-
# `promptLabel` (string)
|
|
10
|
-
|
|
11
|
-
The label for the item stem/prompt field
|
|
12
|
-
|
|
13
|
-
Default: `"Item Stemm"`
|
|
14
|
-
|
|
15
|
-
# `settingsPartialScoring` (boolean)
|
|
16
|
-
|
|
17
|
-
Indicates whether the settings panel wil allow the author to modify settings for partial scoring
|
|
18
|
-
|
|
19
|
-
Default: `true`
|