@pie-element/image-cloze-association 3.5.0 → 3.5.1-beta.587
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 +478 -0
- package/configure/CHANGELOG.md +390 -0
- package/configure/lib/defaults.js +16 -0
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +17 -3
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/root.js +43 -13
- package/configure/lib/root.js.map +1 -1
- package/configure/package.json +4 -3
- package/configure/src/__tests__/index.test.js +12 -15
- package/configure/src/defaults.js +20 -4
- package/configure/src/index.js +23 -3
- package/configure/src/root.jsx +41 -25
- package/controller/CHANGELOG.md +63 -0
- package/controller/lib/index.js +9 -8
- package/controller/lib/index.js.map +1 -1
- package/controller/lib/utils.js +4 -4
- package/controller/lib/utils.js.map +1 -1
- package/controller/package.json +2 -2
- package/controller/src/__tests__/index.test.js +108 -62
- package/controller/src/index.js +40 -28
- package/controller/src/utils.js +10 -10
- package/docs/config-schema.json +160 -0
- package/docs/config-schema.json.md +127 -0
- package/docs/demo/config.js +2 -2
- package/docs/demo/generate.js +30 -25
- package/docs/demo/session.js +1 -1
- package/docs/pie-schema.json +378 -0
- package/docs/pie-schema.json.md +295 -0
- package/lib/constants.js.map +1 -1
- package/lib/evaluation-icon.js.map +1 -1
- package/lib/image-container.js +13 -6
- package/lib/image-container.js.map +1 -1
- package/lib/image-drop-target.js +7 -2
- package/lib/image-drop-target.js.map +1 -1
- package/lib/index.js +4 -1
- package/lib/index.js.map +1 -1
- package/lib/interactive-section.js +1 -1
- package/lib/interactive-section.js.map +1 -1
- package/lib/possible-response.js +17 -5
- package/lib/possible-response.js.map +1 -1
- package/lib/possible-responses.js.map +1 -1
- package/lib/root.js +140 -19
- package/lib/root.js.map +1 -1
- package/lib/utils-correctness.js +33 -5
- package/lib/utils-correctness.js.map +1 -1
- package/package.json +8 -5
- package/src/__tests__/__snapshots__/{image-container-test.jsx.snap → image-container.test.jsx.snap} +20 -0
- package/src/__tests__/__snapshots__/possible-response.test.jsx.snap +5 -0
- package/src/__tests__/__snapshots__/root.test.jsx.snap +50 -0
- package/src/__tests__/{image-container-test.jsx → image-container.test.jsx} +12 -5
- package/src/__tests__/{possible-response-test.jsx → possible-response.test.jsx} +5 -3
- package/src/__tests__/{root-test.jsx → root.test.jsx} +4 -3
- package/src/__tests__/utils.test.js +207 -0
- package/src/constants.js +3 -3
- package/src/evaluation-icon.jsx +8 -17
- package/src/image-container.jsx +14 -19
- package/src/image-drop-target.jsx +45 -38
- package/src/index.js +10 -18
- package/src/interactive-section.jsx +15 -22
- package/src/possible-response.jsx +43 -23
- package/src/possible-responses.jsx +17 -25
- package/src/root.jsx +174 -100
- package/src/utils-correctness.js +44 -14
- package/src/__tests__/__snapshots__/possible-response-test.jsx.snap +0 -13
- package/src/__tests__/__snapshots__/root-test.jsx.snap +0 -38
- package/src/__tests__/utils-test.js +0 -211
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Config Object for @pie-elements/image-cloze-association",
|
|
3
|
+
"additionalProperties": false,
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"maxImageWidth": {
|
|
7
|
+
"title": "ConfigureMaxImageDimensionsProp",
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"teacherInstructions": {
|
|
11
|
+
"description": "Indicates the max dimension for images in teacher instructions",
|
|
12
|
+
"type": "number",
|
|
13
|
+
"title": "teacherInstructions"
|
|
14
|
+
},
|
|
15
|
+
"prompt": {
|
|
16
|
+
"description": "Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified",
|
|
17
|
+
"type": "number",
|
|
18
|
+
"title": "prompt"
|
|
19
|
+
},
|
|
20
|
+
"rationale": {
|
|
21
|
+
"description": "Indicates the max dimension for images in rationale",
|
|
22
|
+
"type": "number",
|
|
23
|
+
"title": "rationale"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"maxImageHeight": {
|
|
28
|
+
"title": "ConfigureMaxImageDimensionsProp",
|
|
29
|
+
"type": "object",
|
|
30
|
+
"properties": {
|
|
31
|
+
"teacherInstructions": {
|
|
32
|
+
"description": "Indicates the max dimension for images in teacher instructions",
|
|
33
|
+
"type": "number",
|
|
34
|
+
"title": "teacherInstructions"
|
|
35
|
+
},
|
|
36
|
+
"prompt": {
|
|
37
|
+
"description": "Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified",
|
|
38
|
+
"type": "number",
|
|
39
|
+
"title": "prompt"
|
|
40
|
+
},
|
|
41
|
+
"rationale": {
|
|
42
|
+
"description": "Indicates the max dimension for images in rationale",
|
|
43
|
+
"type": "number",
|
|
44
|
+
"title": "rationale"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"settingsPanelDisabled": {
|
|
49
|
+
"description": "Indicates if the settings panel is not available",
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"title": "settingsPanelDisabled"
|
|
52
|
+
},
|
|
53
|
+
"spellCheck": {
|
|
54
|
+
"title": "ConfigureProp",
|
|
55
|
+
"type": "object",
|
|
56
|
+
"properties": {
|
|
57
|
+
"settings": {
|
|
58
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"title": "settings"
|
|
61
|
+
},
|
|
62
|
+
"label": {
|
|
63
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
64
|
+
"type": "string",
|
|
65
|
+
"title": "label"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"teacherInstructions": {
|
|
70
|
+
"title": "ConfigureProp",
|
|
71
|
+
"type": "object",
|
|
72
|
+
"properties": {
|
|
73
|
+
"settings": {
|
|
74
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"title": "settings"
|
|
77
|
+
},
|
|
78
|
+
"label": {
|
|
79
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
80
|
+
"type": "string",
|
|
81
|
+
"title": "label"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"withRubric": {
|
|
86
|
+
"title": "ConfigureProp",
|
|
87
|
+
"type": "object",
|
|
88
|
+
"properties": {
|
|
89
|
+
"settings": {
|
|
90
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
91
|
+
"type": "boolean",
|
|
92
|
+
"title": "settings"
|
|
93
|
+
},
|
|
94
|
+
"label": {
|
|
95
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
96
|
+
"type": "string",
|
|
97
|
+
"title": "label"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"showPrompt": {
|
|
102
|
+
"description": "Determines whether prompt field will be displayed or not",
|
|
103
|
+
"default": true,
|
|
104
|
+
"type": "boolean",
|
|
105
|
+
"title": "showPrompt"
|
|
106
|
+
},
|
|
107
|
+
"promptLabel": {
|
|
108
|
+
"description": "The label for the item stem/prompt field",
|
|
109
|
+
"default": "Item Stemm",
|
|
110
|
+
"type": "string",
|
|
111
|
+
"title": "promptLabel"
|
|
112
|
+
},
|
|
113
|
+
"settingsPartialScoring": {
|
|
114
|
+
"description": "Indicates whether the settings panel wil allow the author to modify settings for partial scoring",
|
|
115
|
+
"default": true,
|
|
116
|
+
"type": "boolean",
|
|
117
|
+
"title": "settingsPartialScoring"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"definitions": {
|
|
121
|
+
"ConfigureMaxImageDimensionsProp": {
|
|
122
|
+
"title": "ConfigureMaxImageDimensionsProp",
|
|
123
|
+
"type": "object",
|
|
124
|
+
"properties": {
|
|
125
|
+
"teacherInstructions": {
|
|
126
|
+
"description": "Indicates the max dimension for images in teacher instructions",
|
|
127
|
+
"type": "number",
|
|
128
|
+
"title": "teacherInstructions"
|
|
129
|
+
},
|
|
130
|
+
"prompt": {
|
|
131
|
+
"description": "Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified",
|
|
132
|
+
"type": "number",
|
|
133
|
+
"title": "prompt"
|
|
134
|
+
},
|
|
135
|
+
"rationale": {
|
|
136
|
+
"description": "Indicates the max dimension for images in rationale",
|
|
137
|
+
"type": "number",
|
|
138
|
+
"title": "rationale"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"ConfigureProp": {
|
|
143
|
+
"title": "ConfigureProp",
|
|
144
|
+
"type": "object",
|
|
145
|
+
"properties": {
|
|
146
|
+
"settings": {
|
|
147
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
148
|
+
"type": "boolean",
|
|
149
|
+
"title": "settings"
|
|
150
|
+
},
|
|
151
|
+
"label": {
|
|
152
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
153
|
+
"type": "string",
|
|
154
|
+
"title": "label"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
160
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
Config Object for @pie-elements/image-cloze-association
|
|
2
|
+
|
|
3
|
+
The schema defines the following properties:
|
|
4
|
+
|
|
5
|
+
# `maxImageWidth` (object)
|
|
6
|
+
|
|
7
|
+
Properties of the `maxImageWidth` object:
|
|
8
|
+
|
|
9
|
+
## `teacherInstructions` (number)
|
|
10
|
+
|
|
11
|
+
Indicates the max dimension for images in teacher instructions
|
|
12
|
+
|
|
13
|
+
## `prompt` (number)
|
|
14
|
+
|
|
15
|
+
Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
|
|
16
|
+
|
|
17
|
+
## `rationale` (number)
|
|
18
|
+
|
|
19
|
+
Indicates the max dimension for images in rationale
|
|
20
|
+
|
|
21
|
+
# `maxImageHeight` (object)
|
|
22
|
+
|
|
23
|
+
Properties of the `maxImageHeight` object:
|
|
24
|
+
|
|
25
|
+
## `teacherInstructions` (number)
|
|
26
|
+
|
|
27
|
+
Indicates the max dimension for images in teacher instructions
|
|
28
|
+
|
|
29
|
+
## `prompt` (number)
|
|
30
|
+
|
|
31
|
+
Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
|
|
32
|
+
|
|
33
|
+
## `rationale` (number)
|
|
34
|
+
|
|
35
|
+
Indicates the max dimension for images in rationale
|
|
36
|
+
|
|
37
|
+
# `settingsPanelDisabled` (boolean)
|
|
38
|
+
|
|
39
|
+
Indicates if the settings panel is not available
|
|
40
|
+
|
|
41
|
+
# `spellCheck` (object)
|
|
42
|
+
|
|
43
|
+
Properties of the `spellCheck` object:
|
|
44
|
+
|
|
45
|
+
## `settings` (boolean)
|
|
46
|
+
|
|
47
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
48
|
+
|
|
49
|
+
## `label` (string)
|
|
50
|
+
|
|
51
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
52
|
+
|
|
53
|
+
# `teacherInstructions` (object)
|
|
54
|
+
|
|
55
|
+
Properties of the `teacherInstructions` object:
|
|
56
|
+
|
|
57
|
+
## `settings` (boolean)
|
|
58
|
+
|
|
59
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
60
|
+
|
|
61
|
+
## `label` (string)
|
|
62
|
+
|
|
63
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
64
|
+
|
|
65
|
+
# `withRubric` (object)
|
|
66
|
+
|
|
67
|
+
Properties of the `withRubric` object:
|
|
68
|
+
|
|
69
|
+
## `settings` (boolean)
|
|
70
|
+
|
|
71
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
72
|
+
|
|
73
|
+
## `label` (string)
|
|
74
|
+
|
|
75
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
76
|
+
|
|
77
|
+
# `showPrompt` (boolean)
|
|
78
|
+
|
|
79
|
+
Determines whether prompt field will be displayed or not
|
|
80
|
+
|
|
81
|
+
Default: `true`
|
|
82
|
+
|
|
83
|
+
# `promptLabel` (string)
|
|
84
|
+
|
|
85
|
+
The label for the item stem/prompt field
|
|
86
|
+
|
|
87
|
+
Default: `"Item Stemm"`
|
|
88
|
+
|
|
89
|
+
# `settingsPartialScoring` (boolean)
|
|
90
|
+
|
|
91
|
+
Indicates whether the settings panel wil allow the author to modify settings for partial scoring
|
|
92
|
+
|
|
93
|
+
Default: `true`
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
# Sub Schemas
|
|
98
|
+
|
|
99
|
+
The schema defines the following additional types:
|
|
100
|
+
|
|
101
|
+
## `ConfigureMaxImageDimensionsProp` (object)
|
|
102
|
+
|
|
103
|
+
Properties of the `ConfigureMaxImageDimensionsProp` object:
|
|
104
|
+
|
|
105
|
+
### `teacherInstructions` (number)
|
|
106
|
+
|
|
107
|
+
Indicates the max dimension for images in teacher instructions
|
|
108
|
+
|
|
109
|
+
### `prompt` (number)
|
|
110
|
+
|
|
111
|
+
Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
|
|
112
|
+
|
|
113
|
+
### `rationale` (number)
|
|
114
|
+
|
|
115
|
+
Indicates the max dimension for images in rationale
|
|
116
|
+
|
|
117
|
+
## `ConfigureProp` (object)
|
|
118
|
+
|
|
119
|
+
Properties of the `ConfigureProp` object:
|
|
120
|
+
|
|
121
|
+
### `settings` (boolean)
|
|
122
|
+
|
|
123
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
124
|
+
|
|
125
|
+
### `label` (string)
|
|
126
|
+
|
|
127
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
package/docs/demo/config.js
CHANGED
package/docs/demo/generate.js
CHANGED
|
@@ -5,62 +5,67 @@ exports.model = (id, element) => ({
|
|
|
5
5
|
image: {
|
|
6
6
|
src: 'https://app.fluence.net/ia/image/6412223997a34018b15f8512bee6c04c',
|
|
7
7
|
width: 465,
|
|
8
|
-
scale: false,
|
|
9
|
-
height: 313
|
|
8
|
+
scale: false, // this is not used
|
|
9
|
+
height: 313,
|
|
10
10
|
},
|
|
11
11
|
response_container: {
|
|
12
|
+
// this is not used
|
|
12
13
|
wordwrap: true,
|
|
13
14
|
width: '130px',
|
|
14
|
-
height: '55px'
|
|
15
|
+
height: '55px',
|
|
15
16
|
},
|
|
16
|
-
metadata: {},
|
|
17
|
-
is_math: true,
|
|
18
|
-
response_id: '8a808081592940240159464a277609e7',
|
|
17
|
+
metadata: {}, // this is not used
|
|
18
|
+
is_math: true, // this is not used
|
|
19
|
+
response_id: '8a808081592940240159464a277609e7', // this is not used
|
|
19
20
|
response_containers: [
|
|
20
21
|
{
|
|
21
|
-
pointer: undefined,
|
|
22
|
-
wordwrap: true,
|
|
22
|
+
pointer: undefined, // this is not used
|
|
23
|
+
wordwrap: true, // this is not used
|
|
23
24
|
x: 64.3,
|
|
24
25
|
width: '35.70%',
|
|
25
26
|
y: 1.6,
|
|
26
27
|
height: '23.64%',
|
|
27
|
-
aria_label: ''
|
|
28
|
+
aria_label: '', // this is not used
|
|
28
29
|
},
|
|
29
30
|
{
|
|
30
|
-
pointer: 'undefined',
|
|
31
|
-
wordwrap: true,
|
|
31
|
+
pointer: 'undefined', // this is not used
|
|
32
|
+
wordwrap: true, // this is not used
|
|
32
33
|
x: 64.09,
|
|
33
34
|
width: '35.92%',
|
|
34
35
|
y: 39.62,
|
|
35
36
|
height: '23.32%',
|
|
36
|
-
aria_label: ''
|
|
37
|
-
}
|
|
37
|
+
aria_label: '', // this is not used
|
|
38
|
+
},
|
|
38
39
|
],
|
|
39
40
|
stimulus:
|
|
40
41
|
'<p>A car manufacturer proposes the development of a car tire disposal area near an important wetland habitat. In this area, tires will be broken into pieces and buried. The manufacturer needs to design this area to address the environmental concerns from the list in the passage. After breaking the tires into pieces, the manufacturer decides to recycle some of the pieces and dispose of the rest in this newly developed area. Drag and drop the data labels into the graph to show how this decision will likely affect the number of tire pieces collected from a sample area of the wetland after many years.</p>',
|
|
42
|
+
// this is not used
|
|
41
43
|
metadatadistractor_rationale:
|
|
42
44
|
'<p>A correct response is shown below. This response best shows how this decision will likely affect the number tire pieces collected.<img alt="image 03de38019abe41b1bc95d1199658327f" id="03de38019abe41b1bc95d1199658327f" src="https://localhost:8443/ia/image/03de38019abe41b1bc95d1199658327f" /></p>',
|
|
43
45
|
ui_style: {
|
|
44
|
-
|
|
46
|
+
// this is not used
|
|
47
|
+
fontsize: 'small',
|
|
45
48
|
},
|
|
46
49
|
possible_responses: [
|
|
47
50
|
'<img alt="" src="https://app.fluence.net/ia/image/9e5ed1d6762c4dac87b080e190af113d"/>',
|
|
48
|
-
'<img alt="" src="https://app.fluence.net/ia/image/729ca157d04c440ab7ae1c2abfb9c057"/>'
|
|
51
|
+
'<img alt="" src="https://app.fluence.net/ia/image/729ca157d04c440ab7ae1c2abfb9c057"/>',
|
|
49
52
|
],
|
|
50
53
|
validation: {
|
|
51
|
-
scoring_type: 'exactMatch',
|
|
54
|
+
scoring_type: 'exactMatch', // this is not used
|
|
52
55
|
valid_response: {
|
|
53
56
|
score: 1,
|
|
54
57
|
value: [
|
|
55
|
-
|
|
56
|
-
'<img alt="" src="https://app.fluence.net/ia/image/729ca157d04c440ab7ae1c2abfb9c057"/>'
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
'<img alt="" src="https://app.fluence.net/ia/image/9e5ed1d6762c4dac87b080e190af113d"/>'
|
|
60
|
-
|
|
61
|
-
]
|
|
62
|
-
}
|
|
58
|
+
{
|
|
59
|
+
images: ['<img alt="" src="https://app.fluence.net/ia/image/729ca157d04c440ab7ae1c2abfb9c057"/>'],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
images: ['<img alt="" src="https://app.fluence.net/ia/image/9e5ed1d6762c4dac87b080e190af113d"/>'],
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
63
66
|
},
|
|
67
|
+
showDashedBorder: false,
|
|
64
68
|
partialScoring: false,
|
|
65
|
-
shuffle: true
|
|
69
|
+
shuffle: true, // this is not used
|
|
70
|
+
rubricEnabled: false,
|
|
66
71
|
});
|
package/docs/demo/session.js
CHANGED