@pie-element/rubric 3.5.1 → 3.5.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 CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.5.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@3.5.1...@pie-element/rubric@3.5.2) (2024-03-22)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * don't push a value for empty sample answer ([0628eee](https://github.com/pie-framework/pie-elements/commit/0628eeeece526b11115e5608675f7846b2a73703))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [3.5.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@3.5.0...@pie-element/rubric@3.5.1) (2024-03-22)
7
18
 
8
19
 
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.5.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@3.5.1...@pie-element/rubric-configure@3.5.2) (2024-03-22)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * don't push a value for empty sample answer ([0628eee](https://github.com/pie-framework/pie-elements/commit/0628eeeece526b11115e5608675f7846b2a73703))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [3.5.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@3.5.0...@pie-element/rubric-configure@3.5.1) (2024-03-22)
7
18
 
8
19
 
@@ -79,13 +79,13 @@ var RubricElement = /*#__PURE__*/function (_HTMLElement) {
79
79
  if (howManyPointsDoesItHave < howManyPointsShouldHave) {
80
80
  if (excludeZeroChanged && !excludeZero) {
81
81
  validatedModel.points = [''].concat((0, _toConsumableArray2["default"])(validatedModel.points));
82
- validatedModel.sampleAnswers = [''].concat((0, _toConsumableArray2["default"])(validatedModel.sampleAnswers));
82
+ validatedModel.sampleAnswers = [null].concat((0, _toConsumableArray2["default"])(validatedModel.sampleAnswers));
83
83
  }
84
84
 
85
85
  if (maxPointsChanged) {
86
86
  for (var i = 0; i < howManyPointsShouldHave - howManyPointsDoesItHave; i++) {
87
87
  validatedModel.points.push('');
88
- validatedModel.sampleAnswers.push('');
88
+ validatedModel.sampleAnswers.push(null);
89
89
  }
90
90
  }
91
91
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["modelWithDefaults","m","defaults","model","configurationWithDefaults","c","configuration","RubricElement","nextModel","currentModel","_model","validatedModel","maxPoints","excludeZero","points","sampleAnswers","howManyPointsShouldHave","howManyPointsDoesItHave","length","excludeZeroChanged","maxPointsChanged","i","push","slice","_configuration","onModelChanged","_render","debug","log","bind","onConfigurationChanged","validateModel","dispatchEvent","ModelUpdatedEvent","console","element","React","createElement","Main","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,CAAD;AAAA,yCAAYC,qBAASC,KAArB,GAA+BF,CAA/B;AAAA,CAA1B;;AACA,IAAMG,yBAAyB,GAAG,SAA5BA,yBAA4B,CAACC,CAAD;AAAA,yCAAYH,qBAASI,aAArB,GAAuCD,CAAvC;AAAA,CAAlC;;IAEqBE,a;;;;;AAGjB,2BAAc;AAAA;;AAAA;AACV;AADU,sGASE,UAACC,SAAD,EAAe;AAC3B,UAAMC,YAAY,qBAAO,MAAKC,MAAZ,CAAlB;;AACA,UAAMC,cAAc,GAAGH,SAAvB;AACA,UAAOI,SAAP,GAAiCD,cAAjC,CAAOC,SAAP;AAAA,UAAkBC,WAAlB,GAAiCF,cAAjC,CAAkBE,WAAlB;AAEAF,MAAAA,cAAc,CAACG,MAAf,uCAA4BH,cAAc,CAACG,MAA3C;AACAH,MAAA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WAAKyB,OAAL;;AACA,WAAKM,aAAL,CAAmB,IAAIC,qCAAJ,CAAsB,KAAKvB,MAA3B,EAAmC,KAAnC,CAAnB;AACH;;;WAYD,6BAAoB;AAChB,WAAKgB,OAAL;AACH;;;WAED,mBAAU;AACNQ,MAAAA,OAAO,CAACN,GAAR,CAAY,WAAZ,EAAyB,KAAKlB,MAA9B;;AACA,UAAI,KAAKA,MAAT,EAAiB;AACb,YAAIyB,OAAO,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACpCnC,UAAAA,KAAK,EAAE,KAAKO,MADwB;AAEpCJ,UAAAA,aAAa,EAAE,KAAKkB,cAFgB;AAGpCC,UAAAA,cAAc,EAAE,KAAKA,cAHe;AAIpCK,UAAAA,sBAAsB,EAAE,KAAKA;AAJO,SAA1B,CAAd;;AAOAS,6BAASC,MAAT,CAAgBL,OAAhB,EAAyB,IAAzB;AACH;AACJ;;;kDAjGsCM,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\n\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 validateModel = (nextModel) => {\n const currentModel = {...this._model};\n const validatedModel = nextModel;\n const {maxPoints, excludeZero} = validatedModel;\n\n validatedModel.points = [...validatedModel.points];\n validatedModel.sampleAnswers = [...validatedModel.sampleAnswers];\n\n const howManyPointsShouldHave = excludeZero ? maxPoints : maxPoints + 1;\n const howManyPointsDoesItHave = validatedModel.points.length;\n\n const excludeZeroChanged = currentModel?.excludeZero !== nextModel?.excludeZero;\n const maxPointsChanged = currentModel?.maxPoints !== nextModel?.maxPoints;\n\n if (howManyPointsDoesItHave < howManyPointsShouldHave) {\n if (excludeZeroChanged && !excludeZero) {\n validatedModel.points = ['', ...validatedModel.points];\n validatedModel.sampleAnswers = ['', ...validatedModel.sampleAnswers];\n }\n if (maxPointsChanged) {\n for (let i = 0; i < howManyPointsShouldHave - howManyPointsDoesItHave; i++) {\n validatedModel.points.push('');\n validatedModel.sampleAnswers.push('');\n }\n }\n\n return validatedModel;\n }\n\n if (howManyPointsDoesItHave > howManyPointsShouldHave) {\n if (excludeZeroChanged && excludeZero) {\n validatedModel.points = validatedModel.points.slice(1);\n validatedModel.sampleAnswers = validatedModel.sampleAnswers.slice(1);\n }\n if (maxPointsChanged) {\n validatedModel.points = validatedModel.points.slice(0, howManyPointsShouldHave);\n validatedModel.sampleAnswers = validatedModel.sampleAnswers.slice(0, howManyPointsShouldHave);\n }\n }\n\n return validatedModel;\n }\n\n set model(m) {\n this._model = this.validateModel(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 = this.validateModel(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 console.log('THE MODEL', this._model);\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
+ {"version":3,"sources":["../src/index.js"],"names":["modelWithDefaults","m","defaults","model","configurationWithDefaults","c","configuration","RubricElement","nextModel","currentModel","_model","validatedModel","maxPoints","excludeZero","points","sampleAnswers","howManyPointsShouldHave","howManyPointsDoesItHave","length","excludeZeroChanged","maxPointsChanged","i","push","slice","_configuration","onModelChanged","_render","debug","log","bind","onConfigurationChanged","validateModel","dispatchEvent","ModelUpdatedEvent","console","element","React","createElement","Main","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,CAAD;AAAA,yCAAYC,qBAASC,KAArB,GAA+BF,CAA/B;AAAA,CAA1B;;AACA,IAAMG,yBAAyB,GAAG,SAA5BA,yBAA4B,CAACC,CAAD;AAAA,yCAAYH,qBAASI,aAArB,GAAuCD,CAAvC;AAAA,CAAlC;;IAEqBE,a;;;;;AAGjB,2BAAc;AAAA;;AAAA;AACV;AADU,sGASE,UAACC,SAAD,EAAe;AAC3B,UAAMC,YAAY,qBAAO,MAAKC,MAAZ,CAAlB;;AACA,UAAMC,cAAc,GAAGH,SAAvB;AACA,UAAOI,SAAP,GAAiCD,cAAjC,CAAOC,SAAP;AAAA,UAAkBC,WAAlB,GAAiCF,cAAjC,CAAkBE,WAAlB;AAEAF,MAAAA,cAAc,CAACG,MAAf,uCAA4BH,cAAc,CAACG,MAA3C;AACAH,MAAAA,cAAc,CAACI,aAAf,uCAAmCJ,cAAc,CAACI,aAAlD;AAEA,UAAMC,uBAAuB,GAAGH,WAAW,GAAGD,SAAH,GAAeA,SAAS,GAAG,CAAtE;AACA,UAAMK,uBAAuB,GAAGN,cAAc,CAACG,MAAf,CAAsBI,MAAtD;AAEA,UAAMC,kBAAkB,GAAG,CAAAV,YAAY,SAAZ,IAAAA,YAAY,WAAZ,YAAAA,YAAY,CAAEI,WAAd,OAA8BL,SAA9B,aAA8BA,SAA9B,uBAA8BA,SAAS,CAAEK,WAAzC,CAA3B;AACA,UAAMO,gBAAgB,GAAG,CAAAX,YAAY,SAAZ,IAAAA,YAAY,WAAZ,YAAAA,YAAY,CAAEG,S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E,KAAKA,cAHe;AAIpCK,UAAAA,sBAAsB,EAAE,KAAKA;AAJO,SAA1B,CAAd;;AAOAS,6BAASC,MAAT,CAAgBL,OAAhB,EAAyB,IAAzB;AACH;AACJ;;;kDAjGsCM,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\n\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 validateModel = (nextModel) => {\n const currentModel = {...this._model};\n const validatedModel = nextModel;\n const {maxPoints, excludeZero} = validatedModel;\n\n validatedModel.points = [...validatedModel.points];\n validatedModel.sampleAnswers = [...validatedModel.sampleAnswers];\n\n const howManyPointsShouldHave = excludeZero ? maxPoints : maxPoints + 1;\n const howManyPointsDoesItHave = validatedModel.points.length;\n\n const excludeZeroChanged = currentModel?.excludeZero !== nextModel?.excludeZero;\n const maxPointsChanged = currentModel?.maxPoints !== nextModel?.maxPoints;\n\n if (howManyPointsDoesItHave < howManyPointsShouldHave) {\n if (excludeZeroChanged && !excludeZero) {\n validatedModel.points = ['', ...validatedModel.points];\n validatedModel.sampleAnswers = [null, ...validatedModel.sampleAnswers];\n }\n if (maxPointsChanged) {\n for (let i = 0; i < howManyPointsShouldHave - howManyPointsDoesItHave; i++) {\n validatedModel.points.push('');\n validatedModel.sampleAnswers.push(null);\n }\n }\n\n return validatedModel;\n }\n\n if (howManyPointsDoesItHave > howManyPointsShouldHave) {\n if (excludeZeroChanged && excludeZero) {\n validatedModel.points = validatedModel.points.slice(1);\n validatedModel.sampleAnswers = validatedModel.sampleAnswers.slice(1);\n }\n if (maxPointsChanged) {\n validatedModel.points = validatedModel.points.slice(0, howManyPointsShouldHave);\n validatedModel.sampleAnswers = validatedModel.sampleAnswers.slice(0, howManyPointsShouldHave);\n }\n }\n\n return validatedModel;\n }\n\n set model(m) {\n this._model = this.validateModel(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 = this.validateModel(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 console.log('THE MODEL', this._model);\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,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/rubric-configure",
3
3
  "private": true,
4
- "version": "3.5.1",
4
+ "version": "3.5.2",
5
5
  "description": "Rubric authoring view",
6
6
  "main": "lib/index.js",
7
7
  "author": "Pie Framework Authors",
@@ -38,12 +38,12 @@ export default class RubricElement extends HTMLElement {
38
38
  if (howManyPointsDoesItHave < howManyPointsShouldHave) {
39
39
  if (excludeZeroChanged && !excludeZero) {
40
40
  validatedModel.points = ['', ...validatedModel.points];
41
- validatedModel.sampleAnswers = ['', ...validatedModel.sampleAnswers];
41
+ validatedModel.sampleAnswers = [null, ...validatedModel.sampleAnswers];
42
42
  }
43
43
  if (maxPointsChanged) {
44
44
  for (let i = 0; i < howManyPointsShouldHave - howManyPointsDoesItHave; i++) {
45
45
  validatedModel.points.push('');
46
- validatedModel.sampleAnswers.push('');
46
+ validatedModel.sampleAnswers.push(null);
47
47
  }
48
48
  }
49
49
 
@@ -42517,12 +42517,12 @@ const require$$13 = _dll_debug;
42517
42517
  if (howManyPointsDoesItHave < howManyPointsShouldHave) {
42518
42518
  if (excludeZeroChanged && !excludeZero) {
42519
42519
  validatedModel.points = [''].concat((0, _toConsumableArray2["default"])(validatedModel.points));
42520
- validatedModel.sampleAnswers = [''].concat((0, _toConsumableArray2["default"])(validatedModel.sampleAnswers));
42520
+ validatedModel.sampleAnswers = [null].concat((0, _toConsumableArray2["default"])(validatedModel.sampleAnswers));
42521
42521
  }
42522
42522
  if (maxPointsChanged) {
42523
42523
  for (var i = 0; i < howManyPointsShouldHave - howManyPointsDoesItHave; i++) {
42524
42524
  validatedModel.points.push('');
42525
- validatedModel.sampleAnswers.push('');
42525
+ validatedModel.sampleAnswers.push(null);
42526
42526
  }
42527
42527
  }
42528
42528
  return validatedModel;
package/module/index.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/rubric@3.5.0</title>
5
+ <title>@pie-element/rubric@3.5.1</title>
6
6
  <script
7
7
  type="module"
8
8
  src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/rubric",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
package/module/print.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/rubric@3.5.0</title>
5
+ <title>@pie-element/rubric@3.5.1</title>
6
6
  <link
7
7
  href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
8
  rel="stylesheet"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/rubric",
3
- "version": "3.5.1",
3
+ "version": "3.5.2",
4
4
  "main": "lib/index.js",
5
5
  "module": "src/index.js",
6
6
  "description": "Rubric Scoring Interaction",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "author": "pie framework developers",
17
17
  "license": "ISC",
18
- "gitHead": "d3aedbd26d0879223fc186049e7919ac5e36709c",
18
+ "gitHead": "7f5e2ca327cab00a53242b4381692c5f197b634a",
19
19
  "scripts": {
20
20
  "postpublish": "../../scripts/postpublish"
21
21
  },