@pie-element/complex-rubric 1.2.5-next.5 → 1.2.5-next.57

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.
@@ -12,7 +12,7 @@ const rubricDefaultModel = {
12
12
  points: ['', '', '', ''],
13
13
  sampleAnswers: [null, null, null, null],
14
14
  maxPoints: 4,
15
- excludeZero: false
15
+ excludeZero: false,
16
16
  };
17
17
 
18
18
  const multiTraitDefaultConfiguration = {
@@ -33,7 +33,7 @@ const multiTraitDefaultConfiguration = {
33
33
  remove 0 column with its Label and Description
34
34
  </li>
35
35
  </ul>
36
- </div>`
36
+ </div>`,
37
37
  },
38
38
  includeZeroDialogBoxContent: {
39
39
  title: 'Include 0 (Zero) in Score Point Values.',
@@ -51,26 +51,26 @@ const multiTraitDefaultConfiguration = {
51
51
  add 0 column with empty Label and Descriptions
52
52
  </li>
53
53
  </ul>
54
- </div>`
54
+ </div>`,
55
55
  },
56
56
  deleteTraitDialogBoxContent: {
57
57
  title: 'Delete Trait',
58
- text: 'Are you sure you want to delete this trait?'
58
+ text: 'Are you sure you want to delete this trait?',
59
59
  },
60
60
  deleteScaleDialogBoxContent: {
61
61
  title: 'Delete Scale',
62
- text: 'Are you sure you want to delete this scale?'
62
+ text: 'Are you sure you want to delete this scale?',
63
63
  },
64
64
  maxPointsDialogBoxContent: {
65
65
  title: 'Decreasing Max Points.',
66
66
  text: ` You are about to decrease max score point value.
67
67
  <br/>
68
- All the Labels and Descriptions for scores above Max Point will be deleted.`
68
+ All the Labels and Descriptions for scores above Max Point will be deleted.`,
69
69
  },
70
70
  spellCheck: {
71
71
  label: 'Spellcheck',
72
72
  settings: false,
73
- enabled: true
73
+ enabled: true,
74
74
  },
75
75
  showExcludeZero: {
76
76
  settings: true,
@@ -101,13 +101,13 @@ const multiTraitDefaultConfiguration = {
101
101
  showLevelTagInput: {
102
102
  settings: false,
103
103
  label: 'Show Level Tag Input',
104
- enabled: false
104
+ enabled: false,
105
105
  },
106
106
  dragAndDrop: {
107
107
  settings: true,
108
108
  label: 'Enable Drag and Drop',
109
109
  enabled: false,
110
- }
110
+ },
111
111
  };
112
112
 
113
113
  const rubricDefaultConfiguration = {
@@ -117,18 +117,18 @@ const rubricDefaultConfiguration = {
117
117
  },
118
118
  showMaxPoint: {
119
119
  settings: true,
120
- label: 'Show max points dropdown'
120
+ label: 'Show max points dropdown',
121
121
  },
122
- settingsPanelDisabled: false
122
+ settingsPanelDisabled: false,
123
123
  };
124
124
 
125
125
  export default {
126
126
  model: {
127
127
  rubricType: 'simpleRubric',
128
- rubrics: { simpleRubric: rubricDefaultModel, multiTraitRubric: multiTraitDefaultModel }
128
+ rubrics: { simpleRubric: rubricDefaultModel, multiTraitRubric: multiTraitDefaultModel },
129
129
  },
130
130
  configuration: {
131
131
  multiTraitRubric: multiTraitDefaultConfiguration,
132
- simpleRubric : rubricDefaultConfiguration
133
- }
132
+ simpleRubric: rubricDefaultConfiguration,
133
+ },
134
134
  };
@@ -2,10 +2,10 @@ import defaults from './defaults';
2
2
  import { RUBRIC_TYPES } from '@pie-lib/rubric';
3
3
 
4
4
  export function createDefaultModel(model = {}) {
5
- return new Promise(resolve => resolve({ ...defaults.model, ...model }));
5
+ return new Promise((resolve) => resolve({ ...defaults.model, ...model }));
6
6
  }
7
7
 
8
- export const normalize = question => ({ ...defaults.model, ...question });
8
+ export const normalize = (question) => ({ ...defaults.model, ...question });
9
9
 
10
10
  /**
11
11
  *
@@ -17,22 +17,27 @@ export async function model(question, session, env) {
17
17
  const normalizedQuestion = normalize(question);
18
18
 
19
19
  if (normalizedQuestion.rubricType === RUBRIC_TYPES.SIMPLE_RUBRIC) {
20
- return new Promise(resolve => {
21
- resolve((env && env.role && env.role === 'instructor') ?
22
- {
23
- ...normalizedQuestion,
24
- rubrics: {
25
- ...normalizedQuestion.rubrics,
26
- multiTraitRubric: {
27
- ...normalizedQuestion.rubrics.multiTraitRubric,
28
- visible: false
20
+ return new Promise((resolve) => {
21
+ resolve(
22
+ env && env.role && env.role === 'instructor'
23
+ ? {
24
+ ...normalizedQuestion,
25
+ rubrics: {
26
+ ...normalizedQuestion.rubrics,
27
+ multiTraitRubric: {
28
+ ...normalizedQuestion.rubrics.multiTraitRubric,
29
+ visible: false,
30
+ },
31
+ },
29
32
  }
30
- }
31
- }
32
- : {});
33
+ : {},
34
+ );
33
35
  });
34
36
  } else {
35
- if (!env.role || env.role === 'student' && normalizedQuestion.rubrics && normalizedQuestion.rubrics.multiTraitRubric) {
37
+ if (
38
+ !env.role ||
39
+ (env.role === 'student' && normalizedQuestion.rubrics && normalizedQuestion.rubrics.multiTraitRubric)
40
+ ) {
36
41
  normalizedQuestion.rubrics.multiTraitRubric.visible = normalizedQuestion.visibleToStudent;
37
42
  } else {
38
43
  normalizedQuestion.rubrics.multiTraitRubric.visible = true;
@@ -40,7 +45,7 @@ export async function model(question, session, env) {
40
45
 
41
46
  // todo update pie-ui instead of parsing this here:
42
47
  const { scales, excludeZero } = normalizedQuestion.rubrics.multiTraitRubric || {};
43
- const parsedScales = (scales || []).map(scale => ({ ...scale, excludeZero }));
48
+ const parsedScales = (scales || []).map((scale) => ({ ...scale, excludeZero }));
44
49
 
45
50
  return {
46
51
  ...normalizedQuestion,
@@ -48,13 +53,13 @@ export async function model(question, session, env) {
48
53
  ...normalizedQuestion.rubrics,
49
54
  simpleRubric: {
50
55
  ...normalizedQuestion.rubrics.simpleRubric,
51
- visible: false
56
+ visible: false,
52
57
  },
53
58
  multiTraitRubric: {
54
59
  ...normalizedQuestion.rubrics.multiTraitRubric,
55
- scales: parsedScales
56
- }
57
- }
60
+ scales: parsedScales,
61
+ },
62
+ },
58
63
  };
59
64
  }
60
65
  }
@@ -67,11 +72,11 @@ export const getScore = () => 0;
67
72
  * @param {Object} env
68
73
  */
69
74
  export function outcome(model, session, env) {
70
- return new Promise(resolve => resolve({ score: 0, empty: true }));
75
+ return new Promise((resolve) => resolve({ score: 0, empty: true }));
71
76
  }
72
77
 
73
78
  export const createCorrectResponseSession = (question, env) => {
74
- return new Promise(resolve => {
79
+ return new Promise((resolve) => {
75
80
  if (env.mode !== 'evaluate' && env.role === 'instructor') {
76
81
  resolve({ id: '1' });
77
82
  } else {
@@ -312,4 +312,4 @@ Indicates if the item has to be displayed in the Settings Panel
312
312
 
313
313
  ### `label` (string)
314
314
 
315
- Indicates the label for the item that has to be displayed in the Settings Panel
315
+ Indicates the label for the item that has to be displayed in the Settings Panel
@@ -2,7 +2,7 @@ const { model } = require('./generate');
2
2
 
3
3
  module.exports = {
4
4
  elements: {
5
- 'complex-rubric': '../..'
5
+ 'complex-rubric': '../..',
6
6
  },
7
- models: [model('1', 'complex-rubric')]
7
+ models: [model('1', 'complex-rubric')],
8
8
  };
@@ -7,7 +7,7 @@ exports.model = (id, element) => ({
7
7
  points: ['nothing right', 'a teeny bit right', 'mostly right', 'bingo'],
8
8
  sampleAnswers: [null, 'just right', 'not left', null],
9
9
  maxPoints: 4,
10
- excludeZero: false
10
+ excludeZero: false,
11
11
  },
12
12
  multiTraitRubric: {
13
13
  visibleToStudent: true,
@@ -40,10 +40,42 @@ exports.model = (id, element) => ({
40
40
  description: 'the internal structure of the piece',
41
41
  scorePointsDescriptors: [
42
42
  'Student’s response is blank, not in English, not legible, or does not respond to the prompt.',
43
- 'Does not have a beginning, middle and/or end\n' + '\n' + 'Does not have a lead and/or conclusion\n' + '\n' + 'Transitions confusing and/or not present\n' + '\n' + 'Not written in logical order\n' + '\n' + 'No sign of paragraphing / incorrect paragraphing',
44
- 'Weak beginning, middle and end\n' + '\n' + 'Has evidence of a lead and/or conclusion but missing elements\n' + '\n' + 'Transitions are used sometimes\n' + '\n' + 'Some logical order\n' + '\n' + 'Most paragraphing incorrect',
45
- 'Has an acceptable beginning, middle and end\n' + '\n' + 'Includes a lead and conclusion\n' + '\n' + 'Transitions are used correctly\n' + '\n' + 'Mostly logical order\n' + '\n' + 'Mostly correct paragraphing',
46
- 'Has an effective beginning, middle and end\n' + '\n' + 'Powerful introduction / lead and conclusion\n' + '\n' + 'Effective transitions\n' + '\n' + 'Logical order / sequencing\n' + '\n' + 'Uses appropriate paragraphing',
43
+ 'Does not have a beginning, middle and/or end\n' +
44
+ '\n' +
45
+ 'Does not have a lead and/or conclusion\n' +
46
+ '\n' +
47
+ 'Transitions confusing and/or not present\n' +
48
+ '\n' +
49
+ 'Not written in logical order\n' +
50
+ '\n' +
51
+ 'No sign of paragraphing / incorrect paragraphing',
52
+ 'Weak beginning, middle and end\n' +
53
+ '\n' +
54
+ 'Has evidence of a lead and/or conclusion but missing elements\n' +
55
+ '\n' +
56
+ 'Transitions are used sometimes\n' +
57
+ '\n' +
58
+ 'Some logical order\n' +
59
+ '\n' +
60
+ 'Most paragraphing incorrect',
61
+ 'Has an acceptable beginning, middle and end\n' +
62
+ '\n' +
63
+ 'Includes a lead and conclusion\n' +
64
+ '\n' +
65
+ 'Transitions are used correctly\n' +
66
+ '\n' +
67
+ 'Mostly logical order\n' +
68
+ '\n' +
69
+ 'Mostly correct paragraphing',
70
+ 'Has an effective beginning, middle and end\n' +
71
+ '\n' +
72
+ 'Powerful introduction / lead and conclusion\n' +
73
+ '\n' +
74
+ 'Effective transitions\n' +
75
+ '\n' +
76
+ 'Logical order / sequencing\n' +
77
+ '\n' +
78
+ 'Uses appropriate paragraphing',
47
79
  ],
48
80
  },
49
81
  {
@@ -52,9 +84,17 @@ exports.model = (id, element) => ({
52
84
  description: 'the vocabulary a writer chooses to convey meaning',
53
85
  scorePointsDescriptors: [
54
86
  'Student’s response is blank, not in English, not legible, or does not respond to the prompt.',
55
- 'Vocabulary is limited/used incorrectly\n' + '\n' + 'No figurative language; words do not convey meaning',
56
- 'Generally correct words\n' + '\n' + 'Attempt at figurative language\n' + '\n' + 'and/or words convey general meaning',
57
- 'Some active verbs and precise nouns\n' + '\n' + 'Effective use of figurative language and/or words that enhance meaning',
87
+ 'Vocabulary is limited/used incorrectly\n' +
88
+ '\n' +
89
+ 'No figurative language; words do not convey meaning',
90
+ 'Generally correct words\n' +
91
+ '\n' +
92
+ 'Attempt at figurative language\n' +
93
+ '\n' +
94
+ 'and/or words convey general meaning',
95
+ 'Some active verbs and precise nouns\n' +
96
+ '\n' +
97
+ 'Effective use of figurative language and/or words that enhance meaning',
58
98
  'Powerful and engaging words\n' + '\n' + 'Artful use of figurative language and/or sensory detail',
59
99
  ],
60
100
  },
@@ -64,10 +104,26 @@ exports.model = (id, element) => ({
64
104
  description: 'the rhythm and flow of the language',
65
105
  scorePointsDescriptors: [
66
106
  'Student’s response is blank, not in English, not legible, or does not respond to the prompt.',
67
- 'No sentences are clear\n' + '\n' + 'No variety in sentence structure\n' + '\n' + 'Frequent run-ons and/or fragments are present',
68
- 'Some sentences are clear\n' + '\n' + 'Sentence variety used rarely\n' + '\n' + 'Some run-ons and/or fragments are present',
69
- 'Most sentences are clear\n' + '\n' + 'Some sentence variety is used\n' + '\n' + 'Run-ons and/or fragments are rare',
70
- 'All Sentences are clear\n' + '\n' + 'Variety of sentence structure is used\n' + '\n' + 'Run-ons and/or fragments are not present',
107
+ 'No sentences are clear\n' +
108
+ '\n' +
109
+ 'No variety in sentence structure\n' +
110
+ '\n' +
111
+ 'Frequent run-ons and/or fragments are present',
112
+ 'Some sentences are clear\n' +
113
+ '\n' +
114
+ 'Sentence variety used rarely\n' +
115
+ '\n' +
116
+ 'Some run-ons and/or fragments are present',
117
+ 'Most sentences are clear\n' +
118
+ '\n' +
119
+ 'Some sentence variety is used\n' +
120
+ '\n' +
121
+ 'Run-ons and/or fragments are rare',
122
+ 'All Sentences are clear\n' +
123
+ '\n' +
124
+ 'Variety of sentence structure is used\n' +
125
+ '\n' +
126
+ 'Run-ons and/or fragments are not present',
71
127
  ],
72
128
  },
73
129
  {
@@ -85,16 +141,32 @@ exports.model = (id, element) => ({
85
141
  {
86
142
  name: 'Voice',
87
143
  standards: [],
88
- description: 'the personal tone and flavor of the author\'s message',
144
+ description: "the personal tone and flavor of the author's message",
89
145
  scorePointsDescriptors: [
90
146
  'Student’s response is blank, not in English, not legible, or does not respond to the prompt.',
91
- 'Not concerned with audience or purpose\n' + '\n' + 'No viewpoint (perspective) used\n' + '\n' + 'Writing is mechanical and lifeless',
92
- 'Shows beginning awareness of audience/purpose\n' + '\n' + 'Some viewpoint (perspective) used throughout the piece\n' + '\n' + 'Writing is distant, too formal or informal',
93
- 'Awareness of audience; purpose is clear most of the time\n' + '\n' + 'Uses viewpoint (perspective) throughout most of the paper\n' + '\n' + 'Writing is pleasant, agreeable and satisfying',
94
- 'Powerful connection with audience; purpose is clearly communicated\n' + '\n' + 'Maintains strong viewpoint (perspective) throughout entire piece\n' + '\n' + 'Writing is expressive, engaging and has lots of energy',
147
+ 'Not concerned with audience or purpose\n' +
148
+ '\n' +
149
+ 'No viewpoint (perspective) used\n' +
150
+ '\n' +
151
+ 'Writing is mechanical and lifeless',
152
+ 'Shows beginning awareness of audience/purpose\n' +
153
+ '\n' +
154
+ 'Some viewpoint (perspective) used throughout the piece\n' +
155
+ '\n' +
156
+ 'Writing is distant, too formal or informal',
157
+ 'Awareness of audience; purpose is clear most of the time\n' +
158
+ '\n' +
159
+ 'Uses viewpoint (perspective) throughout most of the paper\n' +
160
+ '\n' +
161
+ 'Writing is pleasant, agreeable and satisfying',
162
+ 'Powerful connection with audience; purpose is clearly communicated\n' +
163
+ '\n' +
164
+ 'Maintains strong viewpoint (perspective) throughout entire piece\n' +
165
+ '\n' +
166
+ 'Writing is expressive, engaging and has lots of energy',
95
167
  ],
96
- }
97
- ]
168
+ },
169
+ ],
98
170
  },
99
171
  {
100
172
  maxPoints: 5,
@@ -111,9 +183,9 @@ exports.model = (id, element) => ({
111
183
  'Handwriting is generally legible\n' + '\n' + 'Overall appearance is acceptable or better',
112
184
  ],
113
185
  },
114
- ]
115
- }
116
- ]
117
- }
118
- }
186
+ ],
187
+ },
188
+ ],
189
+ },
190
+ },
119
191
  });
@@ -2,5 +2,5 @@ module.exports = [
2
2
  {
3
3
  id: '1',
4
4
  element: 'complex-rubric',
5
- }
5
+ },
6
6
  ];
@@ -657,4 +657,4 @@ Trait description
657
657
 
658
658
  Score point descriptors. Starting from 0 to max.
659
659
 
660
- The object is an array with all elements of the type `string`.
660
+ The object is an array with all elements of the type `string`.
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["RUBRIC_TAG_NAME","MULTI_TRAIT_RUBRIC_TAG_NAME","ComplexRubricSimple","Rubric","ComplexRubricMultiTrait","MultiTraitRubric","defineRubrics","customElements","get","define","ComplexRubric","_model","_type","RUBRIC_TYPES","SIMPLE_RUBRIC","t","m","oldType","type","rubricType","whenDefined","then","setRubricModel","simpleRubric","MULTI_TRAIT_RUBRIC","setMultiTraitRubricModel","multiTraitRubric","_render","rubrics","mode","model","querySelector","innerHTML","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,eAAe,GAAG,uBAAxB;AACA,IAAMC,2BAA2B,GAAG,4BAApC;;IAEMC,mB;;;;;;;;;;;EAA4BC,kB;;IAC5BC,uB;;;;;;;;;;;EAAgCC,4B;;AAEtC,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,GAAM;AAC1B,MAAI,CAACC,cAAc,CAACC,GAAf,CAAmBR,eAAnB,CAAL,EAA0C;AACxCO,IAAAA,cAAc,CAACE,MAAf,CAAsBT,eAAtB,EAAuCE,mBAAvC;AACD;;AAED,MAAI,CAACK,cAAc,CAACC,GAAf,CAAmBP,2BAAnB,CAAL,EAAsD;AACpDM,IAAAA,cAAc,CAACE,MAAf,CAAsBR,2BAAtB,EAAmDG,uBAAnD;AACD;AACF,CARD;;AAUAE,aAAa;;IAEPI,a;;;;;AACJ,2BAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,MAAL,GAAc,EAAd;AACA,UAAKC,KAAL,GAAaC,sBAAaC,aAA1B;AAHY;AAIb;;;;SAMD,eAAW;AACT,aAAO,KAAKF,KAAZ;AACD,K;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AR;AAEAH,QAAAA,gBAAgB,CAACI,KAAjB,mCACK,KAAKnB,MAAL,CAAYiB,OAAZ,CAAoBF,gBADzB;AAEEG,UAAAA,IAAI,EAAJA;AAFF;AAID;AACF;;;SAED,eAAuB;AACrB,aAAO,KAAKE,aAAL,WAAsB9B,2BAAtB,uBAAP;AACD;;;SAED,eAAmB;AACjB,aAAO,KAAK8B,aAAL,WAAsB/B,eAAtB,mBAAP;AACD;;;WAED,6BAAoB;AAClB,WAAK2B,OAAL;AACD;;;WAED,mBAAU;AACR,WAAKK,SAAL,iDAEkB,KAAKpB,KAAL,KAAeC,sBAAaC,aAA5B,+CAFlB,iBAEgHd,eAFhH,oCAEuJA,eAFvJ,2CAGkB,KAAKY,KAAL,KAAeC,sBAAaC,aAA5B,+CAHlB,kBAGiHb,2BAHjH,wCAGwKA,2BAHxK;AAMD;;;kDAhFyBgC,W;;eAmFbvB,a","sourcesContent":["import Rubric from '@pie-element/rubric';\nimport MultiTraitRubric from '@pie-element/multi-trait-rubric';\nimport { RUBRIC_TYPES } from '@pie-lib/rubric';\n\nconst RUBRIC_TAG_NAME = 'complex-rubric-simple';\nconst MULTI_TRAIT_RUBRIC_TAG_NAME = 'complex-rubric-multi-trait';\n\nclass ComplexRubricSimple extends Rubric {}\nclass ComplexRubricMultiTrait extends MultiTraitRubric {}\n\nconst defineRubrics = () => {\n if (!customElements.get(RUBRIC_TAG_NAME)) {\n customElements.define(RUBRIC_TAG_NAME, ComplexRubricSimple);\n }\n\n if (!customElements.get(MULTI_TRAIT_RUBRIC_TAG_NAME)) {\n customElements.define(MULTI_TRAIT_RUBRIC_TAG_NAME, ComplexRubricMultiTrait);\n }\n};\n\ndefineRubrics();\n\nclass ComplexRubric extends HTMLElement {\n constructor() {\n super();\n this._model = {};\n this._type = RUBRIC_TYPES.SIMPLE_RUBRIC;\n }\n\n set type(t) {\n this._type = t;\n }\n\n get type() {\n return this._type;\n }\n\n set model(m) {\n this._model = m;\n const oldType = this._type;\n this.type = m.rubricType;\n\n switch (this._type) {\n case RUBRIC_TYPES.SIMPLE_RUBRIC:\n default:\n customElements.whenDefined(RUBRIC_TAG_NAME).then(() => {\n this.setRubricModel(this.simpleRubric);\n });\n break;\n case RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:\n customElements.whenDefined(MULTI_TRAIT_RUBRIC_TAG_NAME).then(() =>{\n this.setMultiTraitRubricModel(this.multiTraitRubric);\n });\n break;\n }\n\n if (oldType !== this.type) {\n this._render();\n }\n }\n\n setRubricModel(simpleRubric) {\n if (this._model && this._model.rubrics && this._model.rubrics.simpleRubric) {\n const { mode } = this._model;\n\n simpleRubric.model = {\n ...this._model.rubrics.simpleRubric,\n mode\n };\n }\n }\n\n setMultiTraitRubricModel(multiTraitRubric) {\n if (this._model && this._model.rubrics && this._model.rubrics.multiTraitRubric) {\n const { mode } = this._model;\n\n multiTraitRubric.model = {\n ...this._model.rubrics.multiTraitRubric,\n mode\n };\n }\n }\n\n get multiTraitRubric() {\n return this.querySelector(`${MULTI_TRAIT_RUBRIC_TAG_NAME}#multiTraitRubric`);\n }\n\n get simpleRubric() {\n return this.querySelector(`${RUBRIC_TAG_NAME}#simpleRubric`);\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n this.innerHTML = `\n <div>\n <div style=\"${this._type === RUBRIC_TYPES.SIMPLE_RUBRIC ? `visibility: visible` : `visibility: hidden`}\"><${RUBRIC_TAG_NAME} id=\"simpleRubric\"></${RUBRIC_TAG_NAME}></div>\n <div style=\"${this._type !== RUBRIC_TYPES.SIMPLE_RUBRIC ? `visibility: visible` : `visibility: hidden`}\"> <${MULTI_TRAIT_RUBRIC_TAG_NAME} id=\"multiTraitRubric\"></${MULTI_TRAIT_RUBRIC_TAG_NAME}></div>\n </div>\n `;\n }\n}\n\nexport default ComplexRubric;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.js"],"names":["RUBRIC_TAG_NAME","MULTI_TRAIT_RUBRIC_TAG_NAME","ComplexRubricSimple","Rubric","ComplexRubricMultiTrait","MultiTraitRubric","defineRubrics","customElements","get","define","ComplexRubric","_model","_type","RUBRIC_TYPES","SIMPLE_RUBRIC","t","m","oldType","type","rubricType","whenDefined","then","setRubricModel","simpleRubric","MULTI_TRAIT_RUBRIC","setMultiTraitRubricModel","multiTraitRubric","_render","rubrics","mode","model","querySelector","innerHTML","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,eAAe,GAAG,uBAAxB;AACA,IAAMC,2BAA2B,GAAG,4BAApC;;IAEMC,mB;;;;;;;;;;;EAA4BC,kB;;IAC5BC,uB;;;;;;;;;;;EAAgCC,4B;;AAEtC,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,GAAM;AAC1B,MAAI,CAACC,cAAc,CAACC,GAAf,CAAmBR,eAAnB,CAAL,EAA0C;AACxCO,IAAAA,cAAc,CAACE,MAAf,CAAsBT,eAAtB,EAAuCE,mBAAvC;AACD;;AAED,MAAI,CAACK,cAAc,CAACC,GAAf,CAAmBP,2BAAnB,CAAL,EAAsD;AACpDM,IAAAA,cAAc,CAACE,MAAf,CAAsBR,2BAAtB,EAAmDG,uBAAnD;AACD;AACF,CARD;;AAUAE,aAAa;;IAEPI,a;;;;;AACJ,2BAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,MAAL,GAAc,EAAd;AACA,UAAKC,KAAL,GAAaC,sBAAaC,aAA1B;AAHY;AAIb;;;;SAMD,eAAW;AACT,aAAO,KAAKF,KAAZ;AACD,K;SAND,aAASG,CAAT,EAAY;AACV,WAAKH,KAAL,GAAaG,CAAb;AACD;;;SAMD,aAAUC,CAAV,EAAa;AAAA;;AACX,WAAKL,MAAL,GAAcK,CAAd;AACA,UAAMC,OAAO,GAAG,KAAKL,KAArB;AACA,WAAKM,IAAL,GAAYF,CAAC,CAACG,UAAd;;AAEA,cAAQ,KAAKP,KAAb;AACE,aAAKC,sBAAaC,aAAlB;AACA;AACEP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ACD;;;WAED,6BAAoB;AAClB,WAAK2B,OAAL;AACD;;;WAED,mBAAU;AACR,WAAKK,SAAL,iDAGM,KAAKpB,KAAL,KAAeC,sBAAaC,aAA5B,+CAHN,iBAIUd,eAJV,oCAIiDA,eAJjD,2CAMM,KAAKY,KAAL,KAAeC,sBAAaC,aAA5B,+CANN,kBAOWb,2BAPX,wCAOkEA,2BAPlE;AAUD;;;kDApFyBgC,W;;eAuFbvB,a","sourcesContent":["import Rubric from '@pie-element/rubric';\nimport MultiTraitRubric from '@pie-element/multi-trait-rubric';\nimport { RUBRIC_TYPES } from '@pie-lib/rubric';\n\nconst RUBRIC_TAG_NAME = 'complex-rubric-simple';\nconst MULTI_TRAIT_RUBRIC_TAG_NAME = 'complex-rubric-multi-trait';\n\nclass ComplexRubricSimple extends Rubric {}\nclass ComplexRubricMultiTrait extends MultiTraitRubric {}\n\nconst defineRubrics = () => {\n if (!customElements.get(RUBRIC_TAG_NAME)) {\n customElements.define(RUBRIC_TAG_NAME, ComplexRubricSimple);\n }\n\n if (!customElements.get(MULTI_TRAIT_RUBRIC_TAG_NAME)) {\n customElements.define(MULTI_TRAIT_RUBRIC_TAG_NAME, ComplexRubricMultiTrait);\n }\n};\n\ndefineRubrics();\n\nclass ComplexRubric extends HTMLElement {\n constructor() {\n super();\n this._model = {};\n this._type = RUBRIC_TYPES.SIMPLE_RUBRIC;\n }\n\n set type(t) {\n this._type = t;\n }\n\n get type() {\n return this._type;\n }\n\n set model(m) {\n this._model = m;\n const oldType = this._type;\n this.type = m.rubricType;\n\n switch (this._type) {\n case RUBRIC_TYPES.SIMPLE_RUBRIC:\n default:\n customElements.whenDefined(RUBRIC_TAG_NAME).then(() => {\n this.setRubricModel(this.simpleRubric);\n });\n break;\n case RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:\n customElements.whenDefined(MULTI_TRAIT_RUBRIC_TAG_NAME).then(() => {\n this.setMultiTraitRubricModel(this.multiTraitRubric);\n });\n break;\n }\n\n if (oldType !== this.type) {\n this._render();\n }\n }\n\n setRubricModel(simpleRubric) {\n if (this._model && this._model.rubrics && this._model.rubrics.simpleRubric) {\n const { mode } = this._model;\n\n simpleRubric.model = {\n ...this._model.rubrics.simpleRubric,\n mode,\n };\n }\n }\n\n setMultiTraitRubricModel(multiTraitRubric) {\n if (this._model && this._model.rubrics && this._model.rubrics.multiTraitRubric) {\n const { mode } = this._model;\n\n multiTraitRubric.model = {\n ...this._model.rubrics.multiTraitRubric,\n mode,\n };\n }\n }\n\n get multiTraitRubric() {\n return this.querySelector(`${MULTI_TRAIT_RUBRIC_TAG_NAME}#multiTraitRubric`);\n }\n\n get simpleRubric() {\n return this.querySelector(`${RUBRIC_TAG_NAME}#simpleRubric`);\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n this.innerHTML = `\n <div>\n <div style=\"${\n this._type === RUBRIC_TYPES.SIMPLE_RUBRIC ? `visibility: visible` : `visibility: hidden`\n }\"><${RUBRIC_TAG_NAME} id=\"simpleRubric\"></${RUBRIC_TAG_NAME}></div>\n <div style=\"${\n this._type !== RUBRIC_TYPES.SIMPLE_RUBRIC ? `visibility: visible` : `visibility: hidden`\n }\"> <${MULTI_TRAIT_RUBRIC_TAG_NAME} id=\"multiTraitRubric\"></${MULTI_TRAIT_RUBRIC_TAG_NAME}></div>\n </div>\n `;\n }\n}\n\nexport default ComplexRubric;\n"],"file":"index.js"}
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@pie-element/complex-rubric",
3
3
  "repository": "pie-framework/pie-elements",
4
- "version": "1.2.5-next.5+7ba6e589b",
4
+ "version": "1.2.5-next.57+749d34ccd",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
8
  "dependencies": {
9
9
  "@material-ui/core": "^3.9.2",
10
- "@pie-element/multi-trait-rubric": "^2.2.2-next.5+7ba6e589b",
11
- "@pie-element/rubric": "^2.1.4-next.5+7ba6e589b",
10
+ "@pie-element/multi-trait-rubric": "^2.2.2-next.57+749d34ccd",
11
+ "@pie-element/rubric": "^2.1.4-next.57+749d34ccd",
12
12
  "@pie-framework/pie-player-events": "^0.1.0",
13
- "@pie-lib/rubric": "^0.6.3",
13
+ "@pie-lib/rubric": "^0.6.6",
14
14
  "classnames": "^2.2.5",
15
15
  "debug": "^4.1.1",
16
16
  "lodash": "^4.17.11",
17
17
  "prop-types": "^15.7.2"
18
18
  },
19
- "gitHead": "7ba6e589bd229421bea7efd640b64e56df62b8bc",
19
+ "gitHead": "749d34ccd164ce7a61c4d928abf3650820c285db",
20
20
  "scripts": {
21
21
  "postpublish": "../../scripts/postpublish"
22
22
  },
@@ -3,8 +3,8 @@ jest.mock('@pie-element/multi-trait-rubric', () => jest.fn());
3
3
  jest.mock('@pie-lib/rubric', () => ({
4
4
  RUBRIC_TYPES: {
5
5
  SIMPLE_RUBRIC: 'simpleRubric',
6
- MULTI_TRAIT_RUBRIC: 'multiTraitRubric'
7
- }
6
+ MULTI_TRAIT_RUBRIC: 'multiTraitRubric',
7
+ },
8
8
  }));
9
9
 
10
10
  const defaultModel = {
@@ -14,7 +14,7 @@ const defaultModel = {
14
14
  points: ['nothing right', 'a teeny bit right', 'mostly right', 'bingo'],
15
15
  sampleAnswers: [null, 'just right', 'not left', null],
16
16
  maxPoints: 4,
17
- excludeZero: false
17
+ excludeZero: false,
18
18
  },
19
19
  multiTraitRubric: {
20
20
  visibleToStudent: true,
@@ -47,10 +47,42 @@ const defaultModel = {
47
47
  description: 'the internal structure of the piece',
48
48
  scorePointsDescriptors: [
49
49
  'Student’s response is blank, not in English, not legible, or does not respond to the prompt.',
50
- 'Does not have a beginning, middle and/or end\n' + '\n' + 'Does not have a lead and/or conclusion\n' + '\n' + 'Transitions confusing and/or not present\n' + '\n' + 'Not written in logical order\n' + '\n' + 'No sign of paragraphing / incorrect paragraphing',
51
- 'Weak beginning, middle and end\n' + '\n' + 'Has evidence of a lead and/or conclusion but missing elements\n' + '\n' + 'Transitions are used sometimes\n' + '\n' + 'Some logical order\n' + '\n' + 'Most paragraphing incorrect',
52
- 'Has an acceptable beginning, middle and end\n' + '\n' + 'Includes a lead and conclusion\n' + '\n' + 'Transitions are used correctly\n' + '\n' + 'Mostly logical order\n' + '\n' + 'Mostly correct paragraphing',
53
- 'Has an effective beginning, middle and end\n' + '\n' + 'Powerful introduction / lead and conclusion\n' + '\n' + 'Effective transitions\n' + '\n' + 'Logical order / sequencing\n' + '\n' + 'Uses appropriate paragraphing',
50
+ 'Does not have a beginning, middle and/or end\n' +
51
+ '\n' +
52
+ 'Does not have a lead and/or conclusion\n' +
53
+ '\n' +
54
+ 'Transitions confusing and/or not present\n' +
55
+ '\n' +
56
+ 'Not written in logical order\n' +
57
+ '\n' +
58
+ 'No sign of paragraphing / incorrect paragraphing',
59
+ 'Weak beginning, middle and end\n' +
60
+ '\n' +
61
+ 'Has evidence of a lead and/or conclusion but missing elements\n' +
62
+ '\n' +
63
+ 'Transitions are used sometimes\n' +
64
+ '\n' +
65
+ 'Some logical order\n' +
66
+ '\n' +
67
+ 'Most paragraphing incorrect',
68
+ 'Has an acceptable beginning, middle and end\n' +
69
+ '\n' +
70
+ 'Includes a lead and conclusion\n' +
71
+ '\n' +
72
+ 'Transitions are used correctly\n' +
73
+ '\n' +
74
+ 'Mostly logical order\n' +
75
+ '\n' +
76
+ 'Mostly correct paragraphing',
77
+ 'Has an effective beginning, middle and end\n' +
78
+ '\n' +
79
+ 'Powerful introduction / lead and conclusion\n' +
80
+ '\n' +
81
+ 'Effective transitions\n' +
82
+ '\n' +
83
+ 'Logical order / sequencing\n' +
84
+ '\n' +
85
+ 'Uses appropriate paragraphing',
54
86
  ],
55
87
  },
56
88
  {
@@ -59,9 +91,17 @@ const defaultModel = {
59
91
  description: 'the vocabulary a writer chooses to convey meaning',
60
92
  scorePointsDescriptors: [
61
93
  'Student’s response is blank, not in English, not legible, or does not respond to the prompt.',
62
- 'Vocabulary is limited/used incorrectly\n' + '\n' + 'No figurative language; words do not convey meaning',
63
- 'Generally correct words\n' + '\n' + 'Attempt at figurative language\n' + '\n' + 'and/or words convey general meaning',
64
- 'Some active verbs and precise nouns\n' + '\n' + 'Effective use of figurative language and/or words that enhance meaning',
94
+ 'Vocabulary is limited/used incorrectly\n' +
95
+ '\n' +
96
+ 'No figurative language; words do not convey meaning',
97
+ 'Generally correct words\n' +
98
+ '\n' +
99
+ 'Attempt at figurative language\n' +
100
+ '\n' +
101
+ 'and/or words convey general meaning',
102
+ 'Some active verbs and precise nouns\n' +
103
+ '\n' +
104
+ 'Effective use of figurative language and/or words that enhance meaning',
65
105
  'Powerful and engaging words\n' + '\n' + 'Artful use of figurative language and/or sensory detail',
66
106
  ],
67
107
  },
@@ -71,10 +111,26 @@ const defaultModel = {
71
111
  description: 'the rhythm and flow of the language',
72
112
  scorePointsDescriptors: [
73
113
  'Student’s response is blank, not in English, not legible, or does not respond to the prompt.',
74
- 'No sentences are clear\n' + '\n' + 'No variety in sentence structure\n' + '\n' + 'Frequent run-ons and/or fragments are present',
75
- 'Some sentences are clear\n' + '\n' + 'Sentence variety used rarely\n' + '\n' + 'Some run-ons and/or fragments are present',
76
- 'Most sentences are clear\n' + '\n' + 'Some sentence variety is used\n' + '\n' + 'Run-ons and/or fragments are rare',
77
- 'All Sentences are clear\n' + '\n' + 'Variety of sentence structure is used\n' + '\n' + 'Run-ons and/or fragments are not present',
114
+ 'No sentences are clear\n' +
115
+ '\n' +
116
+ 'No variety in sentence structure\n' +
117
+ '\n' +
118
+ 'Frequent run-ons and/or fragments are present',
119
+ 'Some sentences are clear\n' +
120
+ '\n' +
121
+ 'Sentence variety used rarely\n' +
122
+ '\n' +
123
+ 'Some run-ons and/or fragments are present',
124
+ 'Most sentences are clear\n' +
125
+ '\n' +
126
+ 'Some sentence variety is used\n' +
127
+ '\n' +
128
+ 'Run-ons and/or fragments are rare',
129
+ 'All Sentences are clear\n' +
130
+ '\n' +
131
+ 'Variety of sentence structure is used\n' +
132
+ '\n' +
133
+ 'Run-ons and/or fragments are not present',
78
134
  ],
79
135
  },
80
136
  {
@@ -92,16 +148,32 @@ const defaultModel = {
92
148
  {
93
149
  name: 'Voice',
94
150
  standards: [],
95
- description: 'the personal tone and flavor of the author\'s message',
151
+ description: "the personal tone and flavor of the author's message",
96
152
  scorePointsDescriptors: [
97
153
  'Student’s response is blank, not in English, not legible, or does not respond to the prompt.',
98
- 'Not concerned with audience or purpose\n' + '\n' + 'No viewpoint (perspective) used\n' + '\n' + 'Writing is mechanical and lifeless',
99
- 'Shows beginning awareness of audience/purpose\n' + '\n' + 'Some viewpoint (perspective) used throughout the piece\n' + '\n' + 'Writing is distant, too formal or informal',
100
- 'Awareness of audience; purpose is clear most of the time\n' + '\n' + 'Uses viewpoint (perspective) throughout most of the paper\n' + '\n' + 'Writing is pleasant, agreeable and satisfying',
101
- 'Powerful connection with audience; purpose is clearly communicated\n' + '\n' + 'Maintains strong viewpoint (perspective) throughout entire piece\n' + '\n' + 'Writing is expressive, engaging and has lots of energy',
154
+ 'Not concerned with audience or purpose\n' +
155
+ '\n' +
156
+ 'No viewpoint (perspective) used\n' +
157
+ '\n' +
158
+ 'Writing is mechanical and lifeless',
159
+ 'Shows beginning awareness of audience/purpose\n' +
160
+ '\n' +
161
+ 'Some viewpoint (perspective) used throughout the piece\n' +
162
+ '\n' +
163
+ 'Writing is distant, too formal or informal',
164
+ 'Awareness of audience; purpose is clear most of the time\n' +
165
+ '\n' +
166
+ 'Uses viewpoint (perspective) throughout most of the paper\n' +
167
+ '\n' +
168
+ 'Writing is pleasant, agreeable and satisfying',
169
+ 'Powerful connection with audience; purpose is clearly communicated\n' +
170
+ '\n' +
171
+ 'Maintains strong viewpoint (perspective) throughout entire piece\n' +
172
+ '\n' +
173
+ 'Writing is expressive, engaging and has lots of energy',
102
174
  ],
103
- }
104
- ]
175
+ },
176
+ ],
105
177
  },
106
178
  {
107
179
  maxPoints: 5,
@@ -118,11 +190,11 @@ const defaultModel = {
118
190
  'Handwriting is generally legible\n' + '\n' + 'Overall appearance is acceptable or better',
119
191
  ],
120
192
  },
121
- ]
122
- }
123
- ]
124
- }
125
- }
193
+ ],
194
+ },
195
+ ],
196
+ },
197
+ },
126
198
  };
127
199
 
128
200
  describe('complex-rubric', () => {