@pie-element/inline-dropdown 9.0.0-beta.0 → 9.0.0-next.42
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 +0 -11
- package/configure/CHANGELOG.md +0 -11
- package/configure/lib/inline-dropdown-toolbar.js +40 -47
- package/configure/lib/inline-dropdown-toolbar.js.map +1 -1
- package/configure/lib/main.js +35 -12
- package/configure/lib/main.js.map +1 -1
- package/configure/lib/response-area.js +2 -2
- package/configure/lib/response-area.js.map +1 -1
- package/configure/package.json +8 -8
- package/controller/CHANGELOG.md +0 -11
- package/controller/package.json +4 -4
- package/module/configure.js +1 -0
- package/module/controller.js +6261 -0
- package/module/demo.js +101 -0
- package/module/element.js +1 -0
- package/module/index.html +21 -0
- package/module/manifest.json +18 -0
- package/module/print-demo.js +139 -0
- package/module/print.html +18 -0
- package/package.json +8 -8
package/module/demo.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import Configure from './configure.js';
|
|
2
|
+
import Element from './element.js';
|
|
3
|
+
import * as controller from './controller.js';
|
|
4
|
+
|
|
5
|
+
var generate = {};
|
|
6
|
+
|
|
7
|
+
generate.model = (id, element) => ({
|
|
8
|
+
id,
|
|
9
|
+
element,
|
|
10
|
+
disabled: false,
|
|
11
|
+
mode: 'gather',
|
|
12
|
+
prompt: 'Use the dropdowns to complete the sentence',
|
|
13
|
+
promptEnabled: true,
|
|
14
|
+
toolbarEditorPosition: 'bottom',
|
|
15
|
+
shuffle: true,
|
|
16
|
+
markup: '<div><p>The {{0}} jumped {{1}} the {{2}}</p></div>',
|
|
17
|
+
choices: {
|
|
18
|
+
0: [
|
|
19
|
+
{
|
|
20
|
+
label: 'cow ',
|
|
21
|
+
value: '0',
|
|
22
|
+
correct: true,
|
|
23
|
+
rationale: 'rationale cow',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: 'dog ',
|
|
27
|
+
value: '1',
|
|
28
|
+
correct: false,
|
|
29
|
+
rationale: 'rationale dog',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'cat ',
|
|
33
|
+
value: '2',
|
|
34
|
+
correct: false,
|
|
35
|
+
rationale: 'rationale car',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
1: [
|
|
39
|
+
{
|
|
40
|
+
label: 'over ',
|
|
41
|
+
value: '0',
|
|
42
|
+
correct: true,
|
|
43
|
+
rationale: 'rationale over',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: 'under ',
|
|
47
|
+
value: '1',
|
|
48
|
+
correct: false,
|
|
49
|
+
rationale: 'rationale under',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: 'across ',
|
|
53
|
+
value: '2',
|
|
54
|
+
correct: false,
|
|
55
|
+
rationale: 'rationale across',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
2: [
|
|
59
|
+
{
|
|
60
|
+
label: 'moon ',
|
|
61
|
+
value: '0',
|
|
62
|
+
correct: true,
|
|
63
|
+
rationale: 'rationale moon',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: 'sun',
|
|
67
|
+
value: '2',
|
|
68
|
+
correct: false,
|
|
69
|
+
rationale: 'rationale sun',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: 'house ',
|
|
73
|
+
value: '3',
|
|
74
|
+
correct: false,
|
|
75
|
+
rationale: 'rationale house',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
alternateResponse: {},
|
|
80
|
+
choiceRationaleEnabled: false,
|
|
81
|
+
rubricEnabled: false,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const { model } = generate;
|
|
85
|
+
|
|
86
|
+
var config = {
|
|
87
|
+
elements: {
|
|
88
|
+
'inline-dropdown': '../..',
|
|
89
|
+
},
|
|
90
|
+
models: [model('1', 'inline-dropdown')],
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
//Note: demo-el is a custom element loaded in the markup.
|
|
94
|
+
customElements.whenDefined("demo-el").then(() => {
|
|
95
|
+
config.models.forEach((m) => {
|
|
96
|
+
const de = document.createElement("demo-el");
|
|
97
|
+
document.body.appendChild(de);
|
|
98
|
+
de.def = { tagName: m.element, Element, Configure, controller };
|
|
99
|
+
de.model = m;
|
|
100
|
+
});
|
|
101
|
+
});
|