@pie-element/complex-rubric 2.1.2-next.57 → 2.1.2-next.72
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/configure/lib/defaults.js +37 -8
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +5 -1
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +45 -21
- package/configure/lib/main.js.map +1 -1
- package/configure/src/__tests__/__snapshots__/main.test.jsx.snap +33 -0
- package/configure/src/__tests__/main.test.jsx +1 -0
- package/configure/src/defaults.js +34 -3
- package/configure/src/index.js +9 -3
- package/configure/src/main.jsx +38 -14
- package/controller/lib/defaults.js +29 -2
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +6 -2
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +1 -1
- package/controller/src/__tests__/index.test.js +4 -0
- package/controller/src/defaults.js +29 -1
- package/controller/src/index.js +6 -1
- package/docs/config-schema.json +343 -0
- package/docs/config-schema.json.md +263 -1
- package/docs/demo/generate.js +6 -0
- package/docs/pie-schema.json +279 -0
- package/docs/pie-schema.json.md +202 -1
- package/lib/index.js +38 -1
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.js +36 -4
|
@@ -19,6 +19,11 @@ var rubricDefaultModel = {
|
|
|
19
19
|
maxPoints: 4,
|
|
20
20
|
excludeZero: false
|
|
21
21
|
};
|
|
22
|
+
var rubriclessDefaultModel = {
|
|
23
|
+
maxPoints: 100,
|
|
24
|
+
excludeZero: false,
|
|
25
|
+
rubriclessInstructionEnabled: true
|
|
26
|
+
};
|
|
22
27
|
var multiTraitDefaultConfiguration = {
|
|
23
28
|
settingsPanelDisabled: false,
|
|
24
29
|
excludeZeroDialogBoxContent: {
|
|
@@ -90,17 +95,39 @@ var rubricDefaultConfiguration = {
|
|
|
90
95
|
},
|
|
91
96
|
settingsPanelDisabled: false
|
|
92
97
|
};
|
|
98
|
+
var rubriclessDefaultConfiguration = {
|
|
99
|
+
showExcludeZero: {
|
|
100
|
+
settings: true,
|
|
101
|
+
label: 'Ability to exclude zero'
|
|
102
|
+
},
|
|
103
|
+
showMaxPoint: {
|
|
104
|
+
settings: true,
|
|
105
|
+
label: 'Show max points dropdown'
|
|
106
|
+
},
|
|
107
|
+
settingsPanelDisabled: false,
|
|
108
|
+
// shows us if it simple rubric or rubricless(simple rubric with less structure)
|
|
109
|
+
rubricless: true,
|
|
110
|
+
// scoring instruction for rubricless
|
|
111
|
+
rubriclessInstruction: {
|
|
112
|
+
settings: true,
|
|
113
|
+
label: 'Instruction'
|
|
114
|
+
},
|
|
115
|
+
maxMaxPoints: 100
|
|
116
|
+
};
|
|
93
117
|
var _default = {
|
|
94
118
|
model: {
|
|
119
|
+
rubricOptions: ['simpleRubric', 'multiTraitRubric', 'rubricless'],
|
|
95
120
|
rubricType: 'simpleRubric',
|
|
96
121
|
rubrics: {
|
|
97
122
|
simpleRubric: rubricDefaultModel,
|
|
98
|
-
multiTraitRubric: multiTraitDefaultModel
|
|
123
|
+
multiTraitRubric: multiTraitDefaultModel,
|
|
124
|
+
rubricless: rubriclessDefaultModel
|
|
99
125
|
}
|
|
100
126
|
},
|
|
101
127
|
configuration: {
|
|
102
128
|
multiTraitRubric: multiTraitDefaultConfiguration,
|
|
103
|
-
simpleRubric: rubricDefaultConfiguration
|
|
129
|
+
simpleRubric: rubricDefaultConfiguration,
|
|
130
|
+
rubricless: rubriclessDefaultConfiguration
|
|
104
131
|
}
|
|
105
132
|
};
|
|
106
133
|
exports["default"] = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["multiTraitDefaultModel","visibleToStudent","halfScoring","pointLabels","description","standards","scales","excludeZero","rubricDefaultModel","points","sampleAnswers","maxPoints","multiTraitDefaultConfiguration","settingsPanelDisabled","excludeZeroDialogBoxContent","title","text","includeZeroDialogBoxContent","deleteScaleDialogBoxContent","maxPointsDialogBoxContent","spellCheck","label","settings","enabled","showExcludeZero","showScorePointLabels","showDescription","showVisibleToStudent","showHalfScoring","width","showStandards","showLevelTagInput","dragAndDrop","rubricDefaultConfiguration","showMaxPoint","model","rubricType","rubrics","simpleRubric","multiTraitRubric","configuration"],"mappings":";;;;;;AAAA,IAAMA,sBAAsB,GAAG;AAC7BC,EAAAA,gBAAgB,EAAE,IADW;AAE7BC,EAAAA,WAAW,EAAE,KAFgB;AAG7BC,EAAAA,WAAW,EAAE,IAHgB;AAI7BC,EAAAA,WAAW,EAAE,KAJgB;AAK7BC,EAAAA,SAAS,EAAE,KALkB;AAM7BC,EAAAA,MAAM,EAAE,EANqB;AAO7BC,EAAAA,WAAW,EAAE;AAPgB,CAA/B;AAUA,IAAMC,kBAAkB,GAAG;AACzBC,EAAAA,MAAM,EAAE,CAAC,EAAD,EAAK,EAAL,EAAS,EAAT,EAAa,EAAb,CADiB;AAEzBC,EAAAA,aAAa,EAAE,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,CAFU;AAGzBC,EAAAA,SAAS,EAAE,CAHc;AAIzBJ,EAAAA,WAAW,EAAE;AAJY,CAA3B;AAOA,IAAMK,8BAA8B,GAAG;AACrCC,EAAAA,qBAAqB,EAAE,KADc;AAErCC,EAAAA,2BAA2B,EAAE;AAC3BC,IAAAA,KAAK,EAAE,2CADoB;AAE3BC,IAAAA,IAAI;AAFuB,GAFQ;AAoBrCC,EAAAA,2BAA2B,EAAE;AAC3BF,IAAAA,KAAK,EAAE,yCADoB;AAE3BC,IAAAA,IAAI;AAFuB,GApBQ;AAsCrCE,EAAAA,2BAA2B,EAAE;AAC3BH,IAAAA,KAAK,EAAE,cADoB;AAE3BC,IAAAA,IAAI,EAAE;AAFqB,GAtCQ;AA0CrCG,EAAAA,yBAAyB,EAAE;AACzBJ,IAAAA,KAAK,EAAE,wBADkB;AAEzBC,IAAAA,IAAI;AAFqB,GA1CU;AAgDrCI,EAAAA,UAAU,EAAE;AACVC,IAAAA,KAAK,EAA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;AAFK,GALmB;AASjCR,EAAAA,qBAAqB,EAAE;AATU,CAAnC;
|
|
1
|
+
{"version":3,"sources":["../src/defaults.js"],"names":["multiTraitDefaultModel","visibleToStudent","halfScoring","pointLabels","description","standards","scales","excludeZero","rubricDefaultModel","points","sampleAnswers","maxPoints","rubriclessDefaultModel","rubriclessInstructionEnabled","multiTraitDefaultConfiguration","settingsPanelDisabled","excludeZeroDialogBoxContent","title","text","includeZeroDialogBoxContent","deleteScaleDialogBoxContent","maxPointsDialogBoxContent","spellCheck","label","settings","enabled","showExcludeZero","showScorePointLabels","showDescription","showVisibleToStudent","showHalfScoring","width","showStandards","showLevelTagInput","dragAndDrop","rubricDefaultConfiguration","showMaxPoint","rubriclessDefaultConfiguration","rubricless","rubriclessInstruction","maxMaxPoints","model","rubricOptions","rubricType","rubrics","simpleRubric","multiTraitRubric","configuration"],"mappings":";;;;;;AAAA,IAAMA,sBAAsB,GAAG;AAC7BC,EAAAA,gBAAgB,EAAE,IADW;AAE7BC,EAAAA,WAAW,EAAE,KAFgB;AAG7BC,EAAAA,WAAW,EAAE,IAHgB;AAI7BC,EAAAA,WAAW,EAAE,KAJgB;AAK7BC,EAAAA,SAAS,EAAE,KALkB;AAM7BC,EAAAA,MAAM,EAAE,EANqB;AAO7BC,EAAAA,WAAW,EAAE;AAPgB,CAA/B;AAUA,IAAMC,kBAAkB,GAAG;AACzBC,EAAAA,MAAM,EAAE,CAAC,EAAD,EAAK,EAAL,EAAS,EAAT,EAAa,EAAb,CADiB;AAEzBC,EAAAA,aAAa,EAAE,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,CAFU;AAGzBC,EAAAA,SAAS,EAAE,CAHc;AAIzBJ,EAAAA,WAAW,EAAE;AAJY,CAA3B;AAOA,IAAMK,sBAAsB,GAAG;AAC7BD,EAAAA,SAAS,EAAE,GADkB;AAE7BJ,EAAAA,WAAW,EAAE,KAFgB;AAG7BM,EAAAA,4BAA4B,EAAE;AAHD,CAA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AAAoCsC,MAAAA,gBAAgB,EAAE9C,sBAAtD;AAA8EsC,MAAAA,UAAU,EAAE1B;AAA1F;AAHJ,GADM;AAMbmC,EAAAA,aAAa,EAAE;AACbD,IAAAA,gBAAgB,EAAEhC,8BADL;AAEb+B,IAAAA,YAAY,EAAEV,0BAFD;AAGbG,IAAAA,UAAU,EAAED;AAHC;AANF,C","sourcesContent":["const multiTraitDefaultModel = {\n visibleToStudent: true,\n halfScoring: false,\n pointLabels: true,\n description: false,\n standards: false,\n scales: [],\n excludeZero: false,\n};\n\nconst rubricDefaultModel = {\n points: ['', '', '', ''],\n sampleAnswers: [null, null, null, null],\n maxPoints: 4,\n excludeZero: false,\n};\n\nconst rubriclessDefaultModel = {\n maxPoints: 100,\n excludeZero: false,\n rubriclessInstructionEnabled: true,\n};\n\nconst multiTraitDefaultConfiguration = {\n settingsPanelDisabled: false,\n excludeZeroDialogBoxContent: {\n title: 'Exclude 0 (Zero) from Score Point Values.',\n text: `<div>\n You are about to exclude 0 from score point values.\n <br/>\n Some of the existing data has to be changed.\n <br/>\n Please choose if you want to:\n <ul>\n <li>\n shift Labels and Descriptions to the left\n </li>\n <li>\n remove 0 column with its Label and Description\n </li>\n </ul>\n </div>`,\n },\n includeZeroDialogBoxContent: {\n title: 'Include 0 (Zero) in Score Point Values.',\n text: `<div>\n You are about to include 0 in score point values.\n <br/>\n Some of the existing data has to be changed.\n <br/>\n Please choose if you want to:\n <ul>\n <li>\n shift Labels and Descriptions to the right\n </li>\n <li>\n add 0 column with empty Label and Descriptions\n </li>\n </ul>\n </div>`,\n },\n deleteScaleDialogBoxContent: {\n title: 'Delete Scale',\n text: 'Are you sure you want to delete this scale?',\n },\n maxPointsDialogBoxContent: {\n title: 'Decreasing Max Points.',\n text: ` You are about to decrease max score point value.\n <br/>\n All the Labels and Descriptions for scores above Max Point will be deleted.`,\n },\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n showExcludeZero: {\n settings: true,\n label: 'Exclude Zero',\n },\n showScorePointLabels: {\n settings: true,\n label: 'Show Score Point Labels',\n },\n showDescription: {\n settings: true,\n label: 'Show Description',\n },\n showVisibleToStudent: {\n settings: true,\n label: 'Visible to Student',\n },\n showHalfScoring: {\n settings: true,\n label: 'Half Scoring',\n },\n width: '900px',\n // these should not be set to true (should not be used) for now\n showStandards: {\n settings: false,\n label: 'Show Standards',\n },\n showLevelTagInput: {\n settings: false,\n label: 'Show Level Tag Input',\n enabled: false,\n },\n dragAndDrop: {\n settings: true,\n label: 'Enable Drag and Drop',\n enabled: false,\n },\n};\n\nconst rubricDefaultConfiguration = {\n showExcludeZero: {\n settings: true,\n label: 'Ability to exclude zero',\n },\n showMaxPoint: {\n settings: true,\n label: 'Show max points dropdown',\n },\n settingsPanelDisabled: false,\n};\n\nconst rubriclessDefaultConfiguration = {\n showExcludeZero: {\n settings: true,\n label: 'Ability to exclude zero',\n },\n showMaxPoint: {\n settings: true,\n label: 'Show max points dropdown',\n },\n settingsPanelDisabled: false,\n // shows us if it simple rubric or rubricless(simple rubric with less structure)\n rubricless: true,\n // scoring instruction for rubricless\n rubriclessInstruction: {\n settings: true,\n label: 'Instruction',\n },\n maxMaxPoints: 100,\n};\n\nexport default {\n model: {\n rubricOptions: ['simpleRubric', 'multiTraitRubric', 'rubricless'],\n rubricType: 'simpleRubric',\n rubrics: { simpleRubric: rubricDefaultModel, multiTraitRubric: multiTraitDefaultModel, rubricless: rubriclessDefaultModel },\n },\n configuration: {\n multiTraitRubric: multiTraitDefaultConfiguration,\n simpleRubric: rubricDefaultConfiguration,\n rubricless: rubriclessDefaultConfiguration,\n },\n};\n"],"file":"defaults.js"}
|
package/controller/lib/index.js
CHANGED
|
@@ -30,7 +30,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
30
30
|
// todo the import from pie-lib/rubric might break webpack
|
|
31
31
|
var RUBRIC_TYPES = {
|
|
32
32
|
SIMPLE_RUBRIC: 'simpleRubric',
|
|
33
|
-
MULTI_TRAIT_RUBRIC: 'multiTraitRubric'
|
|
33
|
+
MULTI_TRAIT_RUBRIC: 'multiTraitRubric',
|
|
34
|
+
'rubricless': 'rubricless'
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
function createDefaultModel() {
|
|
@@ -66,7 +67,7 @@ function _model() {
|
|
|
66
67
|
case 0:
|
|
67
68
|
normalizedQuestion = normalize(question);
|
|
68
69
|
|
|
69
|
-
if (!(normalizedQuestion.rubricType === RUBRIC_TYPES.SIMPLE_RUBRIC)) {
|
|
70
|
+
if (!(normalizedQuestion.rubricType === RUBRIC_TYPES.SIMPLE_RUBRIC || normalizedQuestion.rubricType === 'rubricless')) {
|
|
70
71
|
_context.next = 5;
|
|
71
72
|
break;
|
|
72
73
|
}
|
|
@@ -100,6 +101,9 @@ function _model() {
|
|
|
100
101
|
simpleRubric: _objectSpread(_objectSpread({}, normalizedQuestion.rubrics.simpleRubric), {}, {
|
|
101
102
|
visible: false
|
|
102
103
|
}),
|
|
104
|
+
rubricless: _objectSpread(_objectSpread({}, normalizedQuestion.rubrics.rubricless), {}, {
|
|
105
|
+
visible: false
|
|
106
|
+
}),
|
|
103
107
|
multiTraitRubric: _objectSpread(_objectSpread({}, normalizedQuestion.rubrics.multiTraitRubric), {}, {
|
|
104
108
|
scales: parsedScales
|
|
105
109
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["RUBRIC_TYPES","SIMPLE_RUBRIC","MULTI_TRAIT_RUBRIC","createDefaultModel","model","Promise","resolve","defaults","normalize","question","session","env","normalizedQuestion","rubricType","role","rubrics","multiTraitRubric","visible","visibleToStudent","scales","excludeZero","parsedScales","map","scale","simpleRubric","getScore","outcome","score","empty","createCorrectResponseSession","mode","id","validateSimpleRubric","points","errors","pointsDescriptorsErrors","forEach","point","index","identicalPointDescr","slice","some","p","Object","keys","length","validateMultiTraitRubric","description","pointLabels","traitsErrors","scorePointsErrors","scaleIndex","traits","scorePointsLabels","scaleErrors","scorePointsLabelsErrors","scorePointLabel","scoreIndex","identicalScorePointLabel","s","trait","traitIndex","name","identicalTraitName","t","identicalTraitDescr","validate","config"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA;AACA,IAAMA,YAAY,GAAG;AACnBC,EAAAA,aAAa,EAAE,cADI;AAEnBC,EAAAA,kBAAkB,EAAE;AAFD,CAArB;;AAKO,SAASC,kBAAT,GAAwC;AAAA,MAAZC,KAAY,uEAAJ,EAAI;AAC7C,SAAO,IAAIC,OAAJ,CAAY,UAACC,OAAD;AAAA,WAAaA,OAAO,iCAAMC,qBAASH,KAAf,GAAyBA,KAAzB,EAApB;AAAA,GAAZ,CAAP;AACD;;AAEM,IAAMI,SAAS,GAAG,SAAZA,SAAY,CAACC,QAAD;AAAA,yCAAoBF,qBAASH,KAA7B,GAAuCK,QAAvC;AAAA,CAAlB;AAEP;AACA;AACA;AACA;AACA;;;;;SACsBL,K;;;;;yFAAf,iBAAqBK,QAArB,EAA+BC,OAA/B,EAAwCC,GAAxC;AAAA;;AAAA;AAAA;AAAA;AAAA;AACCC,YAAAA,kBADD,GACsBJ,SAAS,CAACC,QAAD,CAD/B;;AAAA,kBAGDG,kBAAkB,CAACC,UAAnB,KAAkCb,YAAY,CAACC,aAH9C;AAAA;AAAA;AAAA;;AAAA,6CAII,IAAII,OAAJ,CAAY,UAACC,OAAD,EAAa;AAC9BA,cAAAA,OAAO,CACLK,GAAG,IAAIA,GAAG,CAACG,IAAX,IAAmBH,GAAG,CAACG,IAAJ,KAAa,YAAhC,mCAEOF,kBAFP;AAGIG,gBAAAA,OAAO,kCACFH,kBAAkB,CAACG,OADjB;AAELC,kBAAAA,gBAAgB,kCACXJ,kBAAkB,CAACG,OAAnB,CAA2BC,gBADhB;AAEdC,oBAAAA,OAAO,EAAE;AAFK;AAFX;AAHX,mBAWI,EAZC,CAAP;AAcD,aAfM,CAJJ;;AAAA;AAqBH,gBACE,CAACN,GAAG,CAAC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AACA;;AACF,SAAKxB,YAAY,CAACE,kBAAlB;AACEgC,MAAAA,MAAM,GAAGY,wBAAwB,CAAC9B,gBAAD,CAAjC;AACA;AAPJ;;AAUA,SAAOkB,MAAP;AACD,CAhBM","sourcesContent":["import defaults from './defaults';\nimport { markupToText } from './utils';\n\n// todo the import from pie-lib/rubric might break webpack\nconst RUBRIC_TYPES = {\n SIMPLE_RUBRIC: 'simpleRubric',\n MULTI_TRAIT_RUBRIC: 'multiTraitRubric',\n};\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => resolve({ ...defaults.model, ...model }));\n}\n\nexport const normalize = (question) => ({ ...defaults.model, ...question });\n\n/**\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n\n if (normalizedQuestion.rubricType === RUBRIC_TYPES.SIMPLE_RUBRIC) {\n return new Promise((resolve) => {\n resolve(\n env && env.role && env.role === 'instructor'\n ? {\n ...normalizedQuestion,\n rubrics: {\n ...normalizedQuestion.rubrics,\n multiTraitRubric: {\n ...normalizedQuestion.rubrics.multiTraitRubric,\n visible: false,\n },\n },\n }\n : {},\n );\n });\n } else {\n if (\n !env.role ||\n (env.role === 'student' && normalizedQuestion.rubrics && normalizedQuestion.rubrics.multiTraitRubric)\n ) {\n normalizedQuestion.rubrics.multiTraitRubric.visible = normalizedQuestion.visibleToStudent;\n } else {\n normalizedQuestion.rubrics.multiTraitRubric.visible = true;\n }\n\n // todo update pie-ui instead of parsing this here:\n const { scales, excludeZero } = normalizedQuestion.rubrics.multiTraitRubric || {};\n const parsedScales = (scales || []).map((scale) => ({ ...scale, excludeZero }));\n\n return {\n ...normalizedQuestion,\n rubrics: {\n ...normalizedQuestion.rubrics,\n simpleRubric: {\n ...normalizedQuestion.rubrics.simpleRubric,\n visible: false,\n },\n multiTraitRubric: {\n ...normalizedQuestion.rubrics.multiTraitRubric,\n scales: parsedScales,\n },\n },\n };\n }\n}\n\nexport const getScore = () => 0;\n\n/**\n * @param {Object} model - the main model\n * @param {*} session\n * @param {Object} env\n */\nexport function outcome() {\n return new Promise((resolve) => resolve({ score: 0, empty: true }));\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({ id: '1' });\n } else {\n resolve(null);\n }\n });\n};\n\n// IMPORTANT! This function is a duplicate of rubric/controller/validate function!\n// If you make any changes to this function, please make sure you also update rubric/controller/validate function!“.\nconst validateSimpleRubric = (model) => {\n const { points } = model;\n const errors = {};\n const pointsDescriptorsErrors = {};\n\n (points || []).forEach((point, index) => {\n if(!point|| point === '<div></div>') {\n pointsDescriptorsErrors[index] = 'Points descriptors cannot be empty.';\n }\n else{\n const identicalPointDescr = points.slice(index + 1).some(p => markupToText(p) === markupToText(point));\n\n if (identicalPointDescr) {\n pointsDescriptorsErrors[index] = 'Points descriptors should be unique.';\n }\n }\n });\n\n if(Object.keys(pointsDescriptorsErrors).length > 0){\n errors.pointsDescriptorsErrors = pointsDescriptorsErrors;\n }\n\n return errors;\n};\n\n// IMPORTANT! This function is a duplicate of multi-trait-rubric/controller/validate function!\n// If you make any changes to this function, please make sure you also update multi-trait-rubric/controller/validate function!“.\nconst validateMultiTraitRubric = (model) => {\n const { scales, description = false, pointLabels = false } = model;\n const errors = {};\n const traitsErrors = {};\n const scorePointsErrors = {};\n\n (scales || []).forEach((scale, scaleIndex) => {\n const { traits = [] } = scale;\n const { scorePointsLabels = [] } = scale;\n const scaleErrors = {};\n const scorePointsLabelsErrors = {};\n\n if(pointLabels) {\n scorePointsLabels.forEach((scorePointLabel, scoreIndex) => {\n if (!scorePointLabel || scorePointLabel === '<div></div>') {\n scorePointsLabelsErrors[scoreIndex] = 'Points labels should not be empty.';\n } else {\n const identicalScorePointLabel = scorePointsLabels.slice(scoreIndex + 1).some(s => markupToText(s) === markupToText(scorePointLabel));\n\n if (identicalScorePointLabel) {\n scorePointsLabelsErrors[scoreIndex] = 'Points labels should be unique.';\n }\n }\n })\n }\n\n if(Object.keys(scorePointsLabelsErrors).length > 0){\n scorePointsErrors[scaleIndex] = scorePointsLabelsErrors;\n }\n\n traits.forEach((trait, traitIndex) => {\n if(!trait.name || trait.name === '<div></div>') {\n scaleErrors[traitIndex] = {name: 'Trait names should not be empty.'};\n }\n else{\n const identicalTraitName = traits.slice(traitIndex + 1).some(t => markupToText(t.name) === markupToText(trait.name));\n\n if (identicalTraitName) {\n scaleErrors[traitIndex] = {name: 'Trait names should be unique.'};\n }\n }\n if(description && (!trait.description || trait.description === '<div></div>')) {\n scaleErrors[traitIndex] = {... scaleErrors[traitIndex], description: 'Trait description should not be empty'};\n }\n else{\n const identicalTraitDescr = traits.slice(traitIndex + 1).some(t => markupToText(t.description) === markupToText(trait.description));\n\n if (description && identicalTraitDescr) {\n scaleErrors[traitIndex] = {... scaleErrors[traitIndex], description: 'Trait descriptions should be unique.'};\n }\n }\n\n });\n if(Object.keys(scaleErrors).length > 0){\n traitsErrors[scaleIndex] = scaleErrors;\n }\n });\n\n if(Object.keys(traitsErrors).length > 0){\n errors.traitsErrors = traitsErrors;\n }\n\n if(Object.keys(scorePointsErrors).length > 0){\n errors.scorePointsErrors = scorePointsErrors;\n }\n\n return errors;\n};\n\n\nexport const validate = (model = {}, config = {}) => {\n const { rubrics = {}, rubricType } = model;\n const { multiTraitRubric = {}, simpleRubric = {} } = rubrics;\n let errors = {};\n\n switch (rubricType) {\n case RUBRIC_TYPES.SIMPLE_RUBRIC:\n default:\n errors = validateSimpleRubric(simpleRubric);\n break;\n case RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:\n errors = validateMultiTraitRubric(multiTraitRubric);\n break;\n }\n\n return errors;\n};\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["RUBRIC_TYPES","SIMPLE_RUBRIC","MULTI_TRAIT_RUBRIC","createDefaultModel","model","Promise","resolve","defaults","normalize","question","session","env","normalizedQuestion","rubricType","role","rubrics","multiTraitRubric","visible","visibleToStudent","scales","excludeZero","parsedScales","map","scale","simpleRubric","rubricless","getScore","outcome","score","empty","createCorrectResponseSession","mode","id","validateSimpleRubric","points","errors","pointsDescriptorsErrors","forEach","point","index","identicalPointDescr","slice","some","p","Object","keys","length","validateMultiTraitRubric","description","pointLabels","traitsErrors","scorePointsErrors","scaleIndex","traits","scorePointsLabels","scaleErrors","scorePointsLabelsErrors","scorePointLabel","scoreIndex","identicalScorePointLabel","s","trait","traitIndex","name","identicalTraitName","t","identicalTraitDescr","validate","config"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA;AACA,IAAMA,YAAY,GAAG;AACnBC,EAAAA,aAAa,EAAE,cADI;AAEnBC,EAAAA,kBAAkB,EAAE,kBAFD;AAGnB,gBAAc;AAHK,CAArB;;AAMO,SAASC,kBAAT,GAAwC;AAAA,MAAZC,KAAY,uEAAJ,EAAI;AAC7C,SAAO,IAAIC,OAAJ,CAAY,UAACC,OAAD;AAAA,WAAaA,OAAO,iCAAMC,qBAASH,KAAf,GAAyBA,KAAzB,EAApB;AAAA,GAAZ,CAAP;AACD;;AAEM,IAAMI,SAAS,GAAG,SAAZA,SAAY,CAACC,QAAD;AAAA,yCAAoBF,qBAASH,KAA7B,GAAuCK,QAAvC;AAAA,CAAlB;AAEP;AACA;AACA;AACA;AACA;;;;;SACsBL,K;;;;;yFAAf,iBAAqBK,QAArB,EAA+BC,OAA/B,EAAwCC,GAAxC;AAAA;;AAAA;AAAA;AAAA;AAAA;AACCC,YAAAA,kBADD,GACsBJ,SAAS,CAACC,QAAD,CAD/B;;AAAA,kBAGDG,kBAAkB,CAACC,UAAnB,KAAkCb,YAAY,CAACC,aAA/C,IAAgEW,kBAAkB,CAACC,UAAnB,KAAkC,YAHjG;AAAA;AAAA;AAAA;;AAAA,6CAII,IAAIR,OAAJ,CAAY,UAACC,OAAD,EAAa;AAC9BA,cAAAA,OAAO,CACLK,GAAG,IAAIA,GAAG,CAACG,I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qChE,KAArC,CAAQW,OAAR;AAAA,MAAQA,OAAR,+BAAkB,EAAlB;AAAA,MAAsBF,UAAtB,GAAqCT,KAArC,CAAsBS,UAAtB;AACA,8BAAqDE,OAArD,CAAQC,gBAAR;AAAA,MAAQA,gBAAR,sCAA2B,EAA3B;AAAA,8BAAqDD,OAArD,CAA+BS,YAA/B;AAAA,MAA+BA,YAA/B,sCAA8C,EAA9C;AACA,MAAIW,MAAM,GAAG,EAAb;;AAEA,UAAQtB,UAAR;AACE,SAAKb,YAAY,CAACC,aAAlB;AACA;AACEkC,MAAAA,MAAM,GAAGF,oBAAoB,CAACT,YAAD,CAA7B;AACA;;AACF,SAAKxB,YAAY,CAACE,kBAAlB;AACEiC,MAAAA,MAAM,GAAGY,wBAAwB,CAAC/B,gBAAD,CAAjC;AACA;AAPJ;;AAUA,SAAOmB,MAAP;AACD,CAhBM","sourcesContent":["import defaults from './defaults';\nimport { markupToText } from './utils';\n\n// todo the import from pie-lib/rubric might break webpack\nconst RUBRIC_TYPES = {\n SIMPLE_RUBRIC: 'simpleRubric',\n MULTI_TRAIT_RUBRIC: 'multiTraitRubric',\n 'rubricless': 'rubricless',\n};\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => resolve({ ...defaults.model, ...model }));\n}\n\nexport const normalize = (question) => ({ ...defaults.model, ...question });\n\n/**\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n\n if (normalizedQuestion.rubricType === RUBRIC_TYPES.SIMPLE_RUBRIC || normalizedQuestion.rubricType === 'rubricless') {\n return new Promise((resolve) => {\n resolve(\n env && env.role && env.role === 'instructor'\n ? {\n ...normalizedQuestion,\n rubrics: {\n ...normalizedQuestion.rubrics,\n multiTraitRubric: {\n ...normalizedQuestion.rubrics.multiTraitRubric,\n visible: false,\n },\n },\n }\n : {},\n );\n });\n } else {\n if (\n !env.role ||\n (env.role === 'student' && normalizedQuestion.rubrics && normalizedQuestion.rubrics.multiTraitRubric)\n ) {\n normalizedQuestion.rubrics.multiTraitRubric.visible = normalizedQuestion.visibleToStudent;\n } else {\n normalizedQuestion.rubrics.multiTraitRubric.visible = true;\n }\n\n // todo update pie-ui instead of parsing this here:\n const { scales, excludeZero } = normalizedQuestion.rubrics.multiTraitRubric || {};\n const parsedScales = (scales || []).map((scale) => ({ ...scale, excludeZero }));\n\n return {\n ...normalizedQuestion,\n rubrics: {\n ...normalizedQuestion.rubrics,\n simpleRubric: {\n ...normalizedQuestion.rubrics.simpleRubric,\n visible: false,\n },\n rubricless: {\n ...normalizedQuestion.rubrics.rubricless,\n visible: false,\n },\n multiTraitRubric: {\n ...normalizedQuestion.rubrics.multiTraitRubric,\n scales: parsedScales,\n },\n },\n };\n }\n}\n\nexport const getScore = () => 0;\n\n/**\n * @param {Object} model - the main model\n * @param {*} session\n * @param {Object} env\n */\nexport function outcome() {\n return new Promise((resolve) => resolve({ score: 0, empty: true }));\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({ id: '1' });\n } else {\n resolve(null);\n }\n });\n};\n\n// IMPORTANT! This function is a duplicate of rubric/controller/validate function!\n// If you make any changes to this function, please make sure you also update rubric/controller/validate function!“.\nconst validateSimpleRubric = (model) => {\n const { points } = model;\n const errors = {};\n const pointsDescriptorsErrors = {};\n\n (points || []).forEach((point, index) => {\n if(!point|| point === '<div></div>') {\n pointsDescriptorsErrors[index] = 'Points descriptors cannot be empty.';\n }\n else{\n const identicalPointDescr = points.slice(index + 1).some(p => markupToText(p) === markupToText(point));\n\n if (identicalPointDescr) {\n pointsDescriptorsErrors[index] = 'Points descriptors should be unique.';\n }\n }\n });\n\n if(Object.keys(pointsDescriptorsErrors).length > 0){\n errors.pointsDescriptorsErrors = pointsDescriptorsErrors;\n }\n\n return errors;\n};\n\n// IMPORTANT! This function is a duplicate of multi-trait-rubric/controller/validate function!\n// If you make any changes to this function, please make sure you also update multi-trait-rubric/controller/validate function!“.\nconst validateMultiTraitRubric = (model) => {\n const { scales, description = false, pointLabels = false } = model;\n const errors = {};\n const traitsErrors = {};\n const scorePointsErrors = {};\n\n (scales || []).forEach((scale, scaleIndex) => {\n const { traits = [] } = scale;\n const { scorePointsLabels = [] } = scale;\n const scaleErrors = {};\n const scorePointsLabelsErrors = {};\n\n if(pointLabels) {\n scorePointsLabels.forEach((scorePointLabel, scoreIndex) => {\n if (!scorePointLabel || scorePointLabel === '<div></div>') {\n scorePointsLabelsErrors[scoreIndex] = 'Points labels should not be empty.';\n } else {\n const identicalScorePointLabel = scorePointsLabels.slice(scoreIndex + 1).some(s => markupToText(s) === markupToText(scorePointLabel));\n\n if (identicalScorePointLabel) {\n scorePointsLabelsErrors[scoreIndex] = 'Points labels should be unique.';\n }\n }\n })\n }\n\n if(Object.keys(scorePointsLabelsErrors).length > 0){\n scorePointsErrors[scaleIndex] = scorePointsLabelsErrors;\n }\n\n traits.forEach((trait, traitIndex) => {\n if(!trait.name || trait.name === '<div></div>') {\n scaleErrors[traitIndex] = {name: 'Trait names should not be empty.'};\n }\n else{\n const identicalTraitName = traits.slice(traitIndex + 1).some(t => markupToText(t.name) === markupToText(trait.name));\n\n if (identicalTraitName) {\n scaleErrors[traitIndex] = {name: 'Trait names should be unique.'};\n }\n }\n if(description && (!trait.description || trait.description === '<div></div>')) {\n scaleErrors[traitIndex] = {... scaleErrors[traitIndex], description: 'Trait description should not be empty'};\n }\n else{\n const identicalTraitDescr = traits.slice(traitIndex + 1).some(t => markupToText(t.description) === markupToText(trait.description));\n\n if (description && identicalTraitDescr) {\n scaleErrors[traitIndex] = {... scaleErrors[traitIndex], description: 'Trait descriptions should be unique.'};\n }\n }\n\n });\n if(Object.keys(scaleErrors).length > 0){\n traitsErrors[scaleIndex] = scaleErrors;\n }\n });\n\n if(Object.keys(traitsErrors).length > 0){\n errors.traitsErrors = traitsErrors;\n }\n\n if(Object.keys(scorePointsErrors).length > 0){\n errors.scorePointsErrors = scorePointsErrors;\n }\n\n return errors;\n};\n\n\nexport const validate = (model = {}, config = {}) => {\n const { rubrics = {}, rubricType } = model;\n const { multiTraitRubric = {}, simpleRubric = {} } = rubrics;\n let errors = {};\n\n switch (rubricType) {\n case RUBRIC_TYPES.SIMPLE_RUBRIC:\n default:\n errors = validateSimpleRubric(simpleRubric);\n break;\n case RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:\n errors = validateMultiTraitRubric(multiTraitRubric);\n break;\n }\n\n return errors;\n};\n"],"file":"index.js"}
|
package/controller/package.json
CHANGED
|
@@ -15,6 +15,12 @@ const rubricDefaultModel = {
|
|
|
15
15
|
excludeZero: false,
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
const rubriclessDefaultModel = {
|
|
19
|
+
maxPoints: 100,
|
|
20
|
+
excludeZero: false,
|
|
21
|
+
rubriclessInstructionEnabled: true,
|
|
22
|
+
};
|
|
23
|
+
|
|
18
24
|
const multiTraitDefaultConfiguration = {
|
|
19
25
|
settingsPanelDisabled: false,
|
|
20
26
|
excludeZeroDialogBoxContent: {
|
|
@@ -118,13 +124,35 @@ const rubricDefaultConfiguration = {
|
|
|
118
124
|
settingsPanelDisabled: false,
|
|
119
125
|
};
|
|
120
126
|
|
|
127
|
+
const rubriclessDefaultConfiguration = {
|
|
128
|
+
showExcludeZero: {
|
|
129
|
+
settings: true,
|
|
130
|
+
label: 'Ability to exclude zero',
|
|
131
|
+
},
|
|
132
|
+
showMaxPoint: {
|
|
133
|
+
settings: true,
|
|
134
|
+
label: 'Show max points dropdown',
|
|
135
|
+
},
|
|
136
|
+
settingsPanelDisabled: false,
|
|
137
|
+
// shows us if it simple rubric or rubricless(simple rubric with less structure)
|
|
138
|
+
rubricless: true,
|
|
139
|
+
// scoring instruction for rubricless
|
|
140
|
+
rubriclessInstruction: {
|
|
141
|
+
settings: true,
|
|
142
|
+
label: 'Instruction',
|
|
143
|
+
},
|
|
144
|
+
maxMaxPoints: 100,
|
|
145
|
+
};
|
|
146
|
+
|
|
121
147
|
export default {
|
|
122
148
|
model: {
|
|
149
|
+
rubricOptions: ['simpleRubric', 'multiTraitRubric', 'rubricless'],
|
|
123
150
|
rubricType: 'simpleRubric',
|
|
124
|
-
rubrics: { simpleRubric: rubricDefaultModel, multiTraitRubric: multiTraitDefaultModel },
|
|
151
|
+
rubrics: { simpleRubric: rubricDefaultModel, multiTraitRubric: multiTraitDefaultModel, rubricless: rubriclessDefaultModel },
|
|
125
152
|
},
|
|
126
153
|
configuration: {
|
|
127
154
|
multiTraitRubric: multiTraitDefaultConfiguration,
|
|
128
155
|
simpleRubric: rubricDefaultConfiguration,
|
|
156
|
+
rubricless: rubriclessDefaultConfiguration,
|
|
129
157
|
},
|
|
130
158
|
};
|
package/controller/src/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { markupToText } from './utils';
|
|
|
5
5
|
const RUBRIC_TYPES = {
|
|
6
6
|
SIMPLE_RUBRIC: 'simpleRubric',
|
|
7
7
|
MULTI_TRAIT_RUBRIC: 'multiTraitRubric',
|
|
8
|
+
'rubricless': 'rubricless',
|
|
8
9
|
};
|
|
9
10
|
|
|
10
11
|
export function createDefaultModel(model = {}) {
|
|
@@ -21,7 +22,7 @@ export const normalize = (question) => ({ ...defaults.model, ...question });
|
|
|
21
22
|
export async function model(question, session, env) {
|
|
22
23
|
const normalizedQuestion = normalize(question);
|
|
23
24
|
|
|
24
|
-
if (normalizedQuestion.rubricType === RUBRIC_TYPES.SIMPLE_RUBRIC) {
|
|
25
|
+
if (normalizedQuestion.rubricType === RUBRIC_TYPES.SIMPLE_RUBRIC || normalizedQuestion.rubricType === 'rubricless') {
|
|
25
26
|
return new Promise((resolve) => {
|
|
26
27
|
resolve(
|
|
27
28
|
env && env.role && env.role === 'instructor'
|
|
@@ -60,6 +61,10 @@ export async function model(question, session, env) {
|
|
|
60
61
|
...normalizedQuestion.rubrics.simpleRubric,
|
|
61
62
|
visible: false,
|
|
62
63
|
},
|
|
64
|
+
rubricless: {
|
|
65
|
+
...normalizedQuestion.rubrics.rubricless,
|
|
66
|
+
visible: false,
|
|
67
|
+
},
|
|
63
68
|
multiTraitRubric: {
|
|
64
69
|
...normalizedQuestion.rubrics.multiTraitRubric,
|
|
65
70
|
scales: parsedScales,
|
package/docs/config-schema.json
CHANGED
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
"type": "string",
|
|
7
7
|
"title": "width"
|
|
8
8
|
},
|
|
9
|
+
"rubricOptions": {
|
|
10
|
+
"description": "Contains the available rubric types",
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
},
|
|
15
|
+
"title": "rubricOptions"
|
|
16
|
+
},
|
|
9
17
|
"simpleRubric": {
|
|
10
18
|
"title": "RubricConfigure",
|
|
11
19
|
"type": "object",
|
|
@@ -363,10 +371,178 @@
|
|
|
363
371
|
"required": [
|
|
364
372
|
"width"
|
|
365
373
|
]
|
|
374
|
+
},
|
|
375
|
+
"rubricless": {
|
|
376
|
+
"title": "RubriclessConfigure",
|
|
377
|
+
"type": "object",
|
|
378
|
+
"properties": {
|
|
379
|
+
"settingsPanelDisabled": {
|
|
380
|
+
"description": "Indicates if the settings panel is not available",
|
|
381
|
+
"type": "boolean",
|
|
382
|
+
"title": "settingsPanelDisabled"
|
|
383
|
+
},
|
|
384
|
+
"showExcludeZero": {
|
|
385
|
+
"title": "ConfigureProp",
|
|
386
|
+
"type": "object",
|
|
387
|
+
"properties": {
|
|
388
|
+
"settings": {
|
|
389
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
390
|
+
"type": "boolean",
|
|
391
|
+
"title": "settings"
|
|
392
|
+
},
|
|
393
|
+
"label": {
|
|
394
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
395
|
+
"type": "string",
|
|
396
|
+
"title": "label"
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
"showMaxPoint": {
|
|
401
|
+
"title": "ConfigureProp",
|
|
402
|
+
"type": "object",
|
|
403
|
+
"properties": {
|
|
404
|
+
"settings": {
|
|
405
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
406
|
+
"type": "boolean",
|
|
407
|
+
"title": "settings"
|
|
408
|
+
},
|
|
409
|
+
"label": {
|
|
410
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
411
|
+
"type": "string",
|
|
412
|
+
"title": "label"
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
"width": {
|
|
417
|
+
"description": "How large can the rubric be",
|
|
418
|
+
"type": "string",
|
|
419
|
+
"title": "width"
|
|
420
|
+
},
|
|
421
|
+
"mathMlOptions": {
|
|
422
|
+
"title": "ConfigureMathMLProp",
|
|
423
|
+
"type": "object",
|
|
424
|
+
"properties": {
|
|
425
|
+
"mmlOutput": {
|
|
426
|
+
"description": "Indicates if model should have mathML output instead of latex",
|
|
427
|
+
"type": "number",
|
|
428
|
+
"title": "mmlOutput"
|
|
429
|
+
},
|
|
430
|
+
"mmlEditing": {
|
|
431
|
+
"description": "Indicates if mathML that's already in model should be editable",
|
|
432
|
+
"type": "number",
|
|
433
|
+
"title": "mmlEditing"
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
"maxMaxPoints": {
|
|
438
|
+
"description": "Indicates the max limit for scoring points",
|
|
439
|
+
"type": "number",
|
|
440
|
+
"title": "maxMaxPoints"
|
|
441
|
+
},
|
|
442
|
+
"rubricless": {
|
|
443
|
+
"description": "Indicates that it is rubricless",
|
|
444
|
+
"type": "boolean",
|
|
445
|
+
"enum": [
|
|
446
|
+
true
|
|
447
|
+
],
|
|
448
|
+
"title": "rubricless"
|
|
449
|
+
},
|
|
450
|
+
"rubriclessInstruction": {
|
|
451
|
+
"type": "object",
|
|
452
|
+
"properties": {
|
|
453
|
+
"settings": {
|
|
454
|
+
"type": "boolean",
|
|
455
|
+
"enum": [
|
|
456
|
+
true
|
|
457
|
+
],
|
|
458
|
+
"title": "settings"
|
|
459
|
+
},
|
|
460
|
+
"label": {
|
|
461
|
+
"type": "string",
|
|
462
|
+
"enum": [
|
|
463
|
+
"Instruction"
|
|
464
|
+
],
|
|
465
|
+
"title": "label"
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
"required": [
|
|
469
|
+
"label",
|
|
470
|
+
"settings"
|
|
471
|
+
],
|
|
472
|
+
"title": "rubriclessInstruction"
|
|
473
|
+
},
|
|
474
|
+
"showPrompt": {
|
|
475
|
+
"description": "Determines whether prompt field will be displayed or not",
|
|
476
|
+
"default": true,
|
|
477
|
+
"type": "boolean",
|
|
478
|
+
"title": "showPrompt"
|
|
479
|
+
},
|
|
480
|
+
"promptLabel": {
|
|
481
|
+
"description": "The label for the item stem/prompt field",
|
|
482
|
+
"default": "Item Stemm",
|
|
483
|
+
"type": "string",
|
|
484
|
+
"title": "promptLabel"
|
|
485
|
+
},
|
|
486
|
+
"contentDimensions": {
|
|
487
|
+
"description": "Indicates the dimensions configuration for the authoring container\nNote: Some items have a default minimum width because of their content, but if\nthe minWidth is lower than this, the overflow behavior will take care of that",
|
|
488
|
+
"default": ": {}",
|
|
489
|
+
"type": "object",
|
|
490
|
+
"properties": {
|
|
491
|
+
"maxHeight": {
|
|
492
|
+
"description": "Indicates the max height of the authoring container",
|
|
493
|
+
"default": "undefined",
|
|
494
|
+
"type": [
|
|
495
|
+
"string",
|
|
496
|
+
"number"
|
|
497
|
+
],
|
|
498
|
+
"title": "maxHeight"
|
|
499
|
+
},
|
|
500
|
+
"maxWidth": {
|
|
501
|
+
"description": "Indicates the max width of the authoring container",
|
|
502
|
+
"default": "undefined",
|
|
503
|
+
"type": [
|
|
504
|
+
"string",
|
|
505
|
+
"number"
|
|
506
|
+
],
|
|
507
|
+
"title": "maxWidth"
|
|
508
|
+
},
|
|
509
|
+
"minHeight": {
|
|
510
|
+
"description": "Indicates the min height of the authoring container",
|
|
511
|
+
"default": "undefined",
|
|
512
|
+
"type": [
|
|
513
|
+
"string",
|
|
514
|
+
"number"
|
|
515
|
+
],
|
|
516
|
+
"title": "minHeight"
|
|
517
|
+
},
|
|
518
|
+
"minWidth": {
|
|
519
|
+
"description": "Indicates the min width of the authoring container",
|
|
520
|
+
"default": "undefined",
|
|
521
|
+
"type": [
|
|
522
|
+
"string",
|
|
523
|
+
"number"
|
|
524
|
+
],
|
|
525
|
+
"title": "minWidth"
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
"title": "contentDimensions"
|
|
529
|
+
},
|
|
530
|
+
"settingsPartialScoring": {
|
|
531
|
+
"description": "Indicates whether the settings panel wil allow the author to modify settings for partial scoring",
|
|
532
|
+
"default": true,
|
|
533
|
+
"type": "boolean",
|
|
534
|
+
"title": "settingsPartialScoring"
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
"required": [
|
|
538
|
+
"rubricless",
|
|
539
|
+
"rubriclessInstruction"
|
|
540
|
+
]
|
|
366
541
|
}
|
|
367
542
|
},
|
|
368
543
|
"required": [
|
|
369
544
|
"multiTraitRubric",
|
|
545
|
+
"rubricless",
|
|
370
546
|
"simpleRubric"
|
|
371
547
|
],
|
|
372
548
|
"definitions": {
|
|
@@ -775,6 +951,173 @@
|
|
|
775
951
|
"title": "text"
|
|
776
952
|
}
|
|
777
953
|
}
|
|
954
|
+
},
|
|
955
|
+
"RubriclessConfigure": {
|
|
956
|
+
"title": "RubriclessConfigure",
|
|
957
|
+
"type": "object",
|
|
958
|
+
"properties": {
|
|
959
|
+
"settingsPanelDisabled": {
|
|
960
|
+
"description": "Indicates if the settings panel is not available",
|
|
961
|
+
"type": "boolean",
|
|
962
|
+
"title": "settingsPanelDisabled"
|
|
963
|
+
},
|
|
964
|
+
"showExcludeZero": {
|
|
965
|
+
"title": "ConfigureProp",
|
|
966
|
+
"type": "object",
|
|
967
|
+
"properties": {
|
|
968
|
+
"settings": {
|
|
969
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
970
|
+
"type": "boolean",
|
|
971
|
+
"title": "settings"
|
|
972
|
+
},
|
|
973
|
+
"label": {
|
|
974
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
975
|
+
"type": "string",
|
|
976
|
+
"title": "label"
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
},
|
|
980
|
+
"showMaxPoint": {
|
|
981
|
+
"title": "ConfigureProp",
|
|
982
|
+
"type": "object",
|
|
983
|
+
"properties": {
|
|
984
|
+
"settings": {
|
|
985
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
986
|
+
"type": "boolean",
|
|
987
|
+
"title": "settings"
|
|
988
|
+
},
|
|
989
|
+
"label": {
|
|
990
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
991
|
+
"type": "string",
|
|
992
|
+
"title": "label"
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
},
|
|
996
|
+
"width": {
|
|
997
|
+
"description": "How large can the rubric be",
|
|
998
|
+
"type": "string",
|
|
999
|
+
"title": "width"
|
|
1000
|
+
},
|
|
1001
|
+
"mathMlOptions": {
|
|
1002
|
+
"title": "ConfigureMathMLProp",
|
|
1003
|
+
"type": "object",
|
|
1004
|
+
"properties": {
|
|
1005
|
+
"mmlOutput": {
|
|
1006
|
+
"description": "Indicates if model should have mathML output instead of latex",
|
|
1007
|
+
"type": "number",
|
|
1008
|
+
"title": "mmlOutput"
|
|
1009
|
+
},
|
|
1010
|
+
"mmlEditing": {
|
|
1011
|
+
"description": "Indicates if mathML that's already in model should be editable",
|
|
1012
|
+
"type": "number",
|
|
1013
|
+
"title": "mmlEditing"
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
"maxMaxPoints": {
|
|
1018
|
+
"description": "Indicates the max limit for scoring points",
|
|
1019
|
+
"type": "number",
|
|
1020
|
+
"title": "maxMaxPoints"
|
|
1021
|
+
},
|
|
1022
|
+
"rubricless": {
|
|
1023
|
+
"description": "Indicates that it is rubricless",
|
|
1024
|
+
"type": "boolean",
|
|
1025
|
+
"enum": [
|
|
1026
|
+
true
|
|
1027
|
+
],
|
|
1028
|
+
"title": "rubricless"
|
|
1029
|
+
},
|
|
1030
|
+
"rubriclessInstruction": {
|
|
1031
|
+
"type": "object",
|
|
1032
|
+
"properties": {
|
|
1033
|
+
"settings": {
|
|
1034
|
+
"type": "boolean",
|
|
1035
|
+
"enum": [
|
|
1036
|
+
true
|
|
1037
|
+
],
|
|
1038
|
+
"title": "settings"
|
|
1039
|
+
},
|
|
1040
|
+
"label": {
|
|
1041
|
+
"type": "string",
|
|
1042
|
+
"enum": [
|
|
1043
|
+
"Instruction"
|
|
1044
|
+
],
|
|
1045
|
+
"title": "label"
|
|
1046
|
+
}
|
|
1047
|
+
},
|
|
1048
|
+
"required": [
|
|
1049
|
+
"label",
|
|
1050
|
+
"settings"
|
|
1051
|
+
],
|
|
1052
|
+
"title": "rubriclessInstruction"
|
|
1053
|
+
},
|
|
1054
|
+
"showPrompt": {
|
|
1055
|
+
"description": "Determines whether prompt field will be displayed or not",
|
|
1056
|
+
"default": true,
|
|
1057
|
+
"type": "boolean",
|
|
1058
|
+
"title": "showPrompt"
|
|
1059
|
+
},
|
|
1060
|
+
"promptLabel": {
|
|
1061
|
+
"description": "The label for the item stem/prompt field",
|
|
1062
|
+
"default": "Item Stemm",
|
|
1063
|
+
"type": "string",
|
|
1064
|
+
"title": "promptLabel"
|
|
1065
|
+
},
|
|
1066
|
+
"contentDimensions": {
|
|
1067
|
+
"description": "Indicates the dimensions configuration for the authoring container\nNote: Some items have a default minimum width because of their content, but if\nthe minWidth is lower than this, the overflow behavior will take care of that",
|
|
1068
|
+
"default": ": {}",
|
|
1069
|
+
"type": "object",
|
|
1070
|
+
"properties": {
|
|
1071
|
+
"maxHeight": {
|
|
1072
|
+
"description": "Indicates the max height of the authoring container",
|
|
1073
|
+
"default": "undefined",
|
|
1074
|
+
"type": [
|
|
1075
|
+
"string",
|
|
1076
|
+
"number"
|
|
1077
|
+
],
|
|
1078
|
+
"title": "maxHeight"
|
|
1079
|
+
},
|
|
1080
|
+
"maxWidth": {
|
|
1081
|
+
"description": "Indicates the max width of the authoring container",
|
|
1082
|
+
"default": "undefined",
|
|
1083
|
+
"type": [
|
|
1084
|
+
"string",
|
|
1085
|
+
"number"
|
|
1086
|
+
],
|
|
1087
|
+
"title": "maxWidth"
|
|
1088
|
+
},
|
|
1089
|
+
"minHeight": {
|
|
1090
|
+
"description": "Indicates the min height of the authoring container",
|
|
1091
|
+
"default": "undefined",
|
|
1092
|
+
"type": [
|
|
1093
|
+
"string",
|
|
1094
|
+
"number"
|
|
1095
|
+
],
|
|
1096
|
+
"title": "minHeight"
|
|
1097
|
+
},
|
|
1098
|
+
"minWidth": {
|
|
1099
|
+
"description": "Indicates the min width of the authoring container",
|
|
1100
|
+
"default": "undefined",
|
|
1101
|
+
"type": [
|
|
1102
|
+
"string",
|
|
1103
|
+
"number"
|
|
1104
|
+
],
|
|
1105
|
+
"title": "minWidth"
|
|
1106
|
+
}
|
|
1107
|
+
},
|
|
1108
|
+
"title": "contentDimensions"
|
|
1109
|
+
},
|
|
1110
|
+
"settingsPartialScoring": {
|
|
1111
|
+
"description": "Indicates whether the settings panel wil allow the author to modify settings for partial scoring",
|
|
1112
|
+
"default": true,
|
|
1113
|
+
"type": "boolean",
|
|
1114
|
+
"title": "settingsPartialScoring"
|
|
1115
|
+
}
|
|
1116
|
+
},
|
|
1117
|
+
"required": [
|
|
1118
|
+
"rubricless",
|
|
1119
|
+
"rubriclessInstruction"
|
|
1120
|
+
]
|
|
778
1121
|
}
|
|
779
1122
|
},
|
|
780
1123
|
"$schema": "http://json-schema.org/draft-07/schema#"
|