@pie-element/select-text 6.5.2 → 6.5.3-next.1008
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 +194 -0
- package/configure/CHANGELOG.md +149 -0
- package/configure/lib/defaultConfiguration.js +18 -1
- package/configure/lib/defaultConfiguration.js.map +1 -1
- package/configure/lib/design.js +92 -12
- package/configure/lib/design.js.map +1 -1
- package/configure/lib/index.js +4 -8
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/utils.js +77 -26
- package/configure/lib/utils.js.map +1 -1
- package/configure/package.json +5 -5
- package/controller/CHANGELOG.md +100 -0
- package/controller/lib/index.js +37 -4
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +2 -1
- package/docs/config-schema.json +94 -0
- package/docs/config-schema.json.md +73 -1
- package/docs/demo/generate.js +116 -22
- package/docs/demo/session.js +18 -5
- package/docs/pie-schema.json +37 -0
- package/docs/pie-schema.json.md +31 -0
- package/lib/index.js +51 -3
- package/lib/index.js.map +1 -1
- package/lib/main.js +50 -30
- package/lib/main.js.map +1 -1
- package/lib/print.js +124 -0
- package/lib/print.js.map +1 -0
- package/lib/utils.js +106 -0
- package/lib/utils.js.map +1 -0
- package/package.json +11 -7
- package/module/configure.js +0 -3242
- package/module/controller.js +0 -18913
- package/module/demo.js +0 -219
- package/module/element.js +0 -2617
- package/module/index.html +0 -16
- package/module/manifest.json +0 -10
package/module/demo.js
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import Configure from './configure.js';
|
|
2
|
-
import Element from './element.js';
|
|
3
|
-
import * as controller from './controller.js';
|
|
4
|
-
|
|
5
|
-
const tokens = () => [
|
|
6
|
-
{
|
|
7
|
-
text: 'Rachel cut out 8 stars in 6 minutes.',
|
|
8
|
-
start: 0,
|
|
9
|
-
end: 36,
|
|
10
|
-
correct: true,
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
text: 'Lovelle cut out 6 stars in 4 minutes.',
|
|
14
|
-
start: 37,
|
|
15
|
-
end: 74,
|
|
16
|
-
correct: true,
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
text: 'Lovelle and Rachel cut the same number of stars in 6 minutes.',
|
|
20
|
-
start: 117,
|
|
21
|
-
end: 177,
|
|
22
|
-
},
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
const mathSampleText =
|
|
26
|
-
'<p><math xmlns="http://www.w3.org/1998/Math/MathML">\n <mstyle displaystyle="true">\n <mrow>\n <mo>(</mo>\n <mn>6</mn>\n <mi>x</mi>\n <mo>+</mo>\n <mn>2</mn>\n <mo>)</mo>\n </mrow>\n <mrow>\n <mo>(</mo>\n <mo>-</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>+</mo>\n <mn>3</mn>\n <mi>x</mi>\n <mo>-</mo>\n <mn>1</mn>\n <mo>)</mo>\n </mrow>\n <mrow>\n <mo>(</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>)</mo>\n </mrow>\n </mstyle>\n</math></p>\n\n<p><span class="lrn_token"><math xmlns="http://www.w3.org/1998/Math/MathML">\n <mstyle displaystyle="true">\n <mrow>\n <mo>[</mo>\n <mn>6</mn>\n <mi>x</mi>\n <mrow>\n <mo>(</mo>\n <mo>-</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>+</mo>\n <mn>3</mn>\n <mi>x</mi>\n <mo>-</mo>\n <mn>1</mn>\n <mo>)</mo>\n </mrow>\n <mo>+</mo>\n <mn>2</mn>\n <mrow>\n <mo>(</mo>\n <mo>-</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>+</mo>\n <mn>3</mn>\n <mi>x</mi>\n <mo>-</mo>\n <mn>1</mn>\n <mo>)</mo>\n </mrow>\n <mo>]</mo>\n </mrow>\n <mrow>\n <mo>(</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>)</mo>\n </mrow>\n </mstyle>\n</math></span></p>\n\n<p><span class="lrn_token"><math xmlns="http://www.w3.org/1998/Math/MathML">\n <mstyle displaystyle="true">\n <mrow>\n <mo>(</mo>\n <mo>-</mo>\n <mn>6</mn>\n <msup>\n <mi>x</mi>\n <mn>3</mn>\n </msup>\n <mo>+</mo>\n <mn>18</mn>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>-</mo>\n <mn>6</mn>\n <mi>x</mi>\n <mo>-</mo>\n <mn>2</mn>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>+</mo>\n <mn>6</mn>\n <mi>x</mi>\n <mo>-</mo>\n <mn>2</mn>\n <mo>)</mo>\n </mrow>\n <mrow>\n <mo>(</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>)</mo>\n </mrow>\n </mstyle>\n</math></span></p>\n\n<p><span class="lrn_token"><math xmlns="http://www.w3.org/1998/Math/MathML">\n <mstyle displaystyle="true">\n <mo>-</mo>\n <mn>6</mn>\n <msup>\n <mi>x</mi>\n <mn>3</mn>\n </msup>\n <mo>+</mo>\n <mn>18</mn>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>-</mo>\n <mn>6</mn>\n <mi>x</mi>\n <mo>-</mo>\n <mn>2</mn>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>+</mo>\n <mn>6</mn>\n <mi>x</mi>\n <mo>-</mo>\n <mn>2</mn>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n </mstyle>\n</math></span></p>\n\n<p><span class="lrn_token"><math xmlns="http://www.w3.org/1998/Math/MathML">\n <mstyle displaystyle="true">\n <mo>-</mo>\n <mn>6</mn>\n <msup>\n <mi>x</mi>\n <mn>3</mn>\n </msup>\n <mo>+</mo>\n <mn>14</mn>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n </mstyle>\n</math></span></p>';
|
|
27
|
-
|
|
28
|
-
const mathSampleTokens = [
|
|
29
|
-
{
|
|
30
|
-
start: 583,
|
|
31
|
-
end: 1465,
|
|
32
|
-
text:
|
|
33
|
-
'<span class="lrn_token"><math xmlns="http://www.w3.org/1998/Math/MathML">\n <mstyle displaystyle="true">\n <mrow>\n <mo>[</mo>\n <mn>6</mn>\n <mi>x</mi>\n <mrow>\n <mo>(</mo>\n <mo>-</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>+</mo>\n <mn>3</mn>\n <mi>x</mi>\n <mo>-</mo>\n <mn>1</mn>\n <mo>)</mo>\n </mrow>\n <mo>+</mo>\n <mn>2</mn>\n <mrow>\n <mo>(</mo>\n <mo>-</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>+</mo>\n <mn>3</mn>\n <mi>x</mi>\n <mo>-</mo>\n <mn>1</mn>\n <mo>)</mo>\n </mrow>\n <mo>]</mo>\n </mrow>\n <mrow>\n <mo>(</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>)</mo>\n </mrow>\n </mstyle>\n</math></span>',
|
|
34
|
-
correct: true,
|
|
35
|
-
},
|
|
36
|
-
{ start: 1474, end: 2218 },
|
|
37
|
-
{ start: 2227, end: 2797 },
|
|
38
|
-
{ start: 2806, end: 3112 },
|
|
39
|
-
];
|
|
40
|
-
|
|
41
|
-
const base = (extras) =>
|
|
42
|
-
Object.assign(
|
|
43
|
-
{},
|
|
44
|
-
{
|
|
45
|
-
highlightChoices: true,
|
|
46
|
-
feedback: {
|
|
47
|
-
correct: {
|
|
48
|
-
type: 'default',
|
|
49
|
-
default: 'Correct',
|
|
50
|
-
},
|
|
51
|
-
incorrect: {
|
|
52
|
-
type: 'default',
|
|
53
|
-
default: 'Incorrect',
|
|
54
|
-
},
|
|
55
|
-
partial: {
|
|
56
|
-
type: 'default',
|
|
57
|
-
default: 'Nearly',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
partialScoring: false,
|
|
61
|
-
maxSelections: 2,
|
|
62
|
-
mode: 'sentence',
|
|
63
|
-
rationale: 'Rationale goes here.',
|
|
64
|
-
prompt: 'What sentences contain the character 6 in them?',
|
|
65
|
-
promptEnabled: true,
|
|
66
|
-
text:
|
|
67
|
-
'Rachel cut out 8 stars in 6 minutes. Lovelle cut out 6 stars in 4 minutes. Rachel cut out 4 more stars than Lovelle. Lovelle and Rachel cut the same number of stars in 6 minutes.',
|
|
68
|
-
tokens: tokens(),
|
|
69
|
-
},
|
|
70
|
-
extras
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
const mathSample = (extras) => {
|
|
74
|
-
return Object.assign(
|
|
75
|
-
{},
|
|
76
|
-
{
|
|
77
|
-
highlightChoices: false,
|
|
78
|
-
feedback: {
|
|
79
|
-
correct: {
|
|
80
|
-
type: 'default',
|
|
81
|
-
default: 'Correct',
|
|
82
|
-
},
|
|
83
|
-
incorrect: {
|
|
84
|
-
type: 'default',
|
|
85
|
-
default: 'Incorrect',
|
|
86
|
-
},
|
|
87
|
-
partial: {
|
|
88
|
-
type: 'default',
|
|
89
|
-
default: 'Nearly',
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
partialScoring: false,
|
|
93
|
-
maxSelections: 2,
|
|
94
|
-
prompt: 'What sentences contain the character 6 in them?',
|
|
95
|
-
text: mathSampleText,
|
|
96
|
-
tokens: mathSampleTokens,
|
|
97
|
-
},
|
|
98
|
-
extras
|
|
99
|
-
);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
var model = (id, element) => {
|
|
103
|
-
return Object.assign({}, { id, element }, base({}));
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
var mathSample_1 = (id, element) => {
|
|
107
|
-
return Object.assign({}, { id, element }, mathSample({}));
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
var htmlSample = (id, element) => {
|
|
111
|
-
return Object.assign(
|
|
112
|
-
{},
|
|
113
|
-
{ id, element },
|
|
114
|
-
{
|
|
115
|
-
highlightChoices: true,
|
|
116
|
-
feedback: {
|
|
117
|
-
correct: {
|
|
118
|
-
type: 'default',
|
|
119
|
-
default: 'Correct',
|
|
120
|
-
},
|
|
121
|
-
incorrect: {
|
|
122
|
-
type: 'default',
|
|
123
|
-
default: 'Incorrect',
|
|
124
|
-
},
|
|
125
|
-
partial: {
|
|
126
|
-
type: 'default',
|
|
127
|
-
default: 'Nearly',
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
partialScoring: false,
|
|
131
|
-
text:
|
|
132
|
-
'<p style=\'padding: 20px\'>A flicker and then gone. In its wake, only <span class="lrn_token">the after-echo of a distant high-pitched ringing that vibrated through him even as it returned to silence once again</span>, as he stared into the smiling faces of the crew and told himself that yes he was meant to be here, that <span class="lrn_token">it had been his destiny to succeed and so he had succeeded</span>, the sense of panic already replaced by the pride of his accomplishment, replaced so completely that he would not remember that flicker, would not allow himself to remember, <span class="lrn_token">even after everything else had happened</span>. In his memory of that moment, <span class="lrn_token">he was an astronaut and they were welcoming him aboard the space station</span>. And in his memory he was smiling. Is this not what he was meant to do? Is the answer not as fixed and indisputable as any equation he might have been tasked to solve?</p>\n',
|
|
133
|
-
prompt:
|
|
134
|
-
'<p>Select the <span class="relative-emphasis">one</span> phrase below that suggests that in the future, Keith may interpret this moment differently.</p>',
|
|
135
|
-
maxSelections: 2,
|
|
136
|
-
mode: 'sentence',
|
|
137
|
-
rationale: 'Rationale goes here.',
|
|
138
|
-
tokens: [
|
|
139
|
-
{
|
|
140
|
-
correct: false,
|
|
141
|
-
start: 67,
|
|
142
|
-
end: 215,
|
|
143
|
-
text:
|
|
144
|
-
'<span class="lrn_token">the after-echo of a distant high-pitched ringing that vibrated through him even as it returned to silence once again</span>',
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
correct: false,
|
|
148
|
-
start: 321,
|
|
149
|
-
end: 410,
|
|
150
|
-
text:
|
|
151
|
-
'<span class="lrn_token">it had been his destiny to succeed and so he had succeeded</span>',
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
correct: true,
|
|
155
|
-
start: 585,
|
|
156
|
-
end: 655,
|
|
157
|
-
text:
|
|
158
|
-
'<span class="lrn_token">even after everything else had happened</span>',
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
correct: false,
|
|
162
|
-
start: 687,
|
|
163
|
-
end: 790,
|
|
164
|
-
text:
|
|
165
|
-
'<span class="lrn_token">he was an astronaut and they were welcoming him aboard the space station</span>',
|
|
166
|
-
},
|
|
167
|
-
],
|
|
168
|
-
}
|
|
169
|
-
);
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
var htmlAscii = (id, element) => ({
|
|
173
|
-
id,
|
|
174
|
-
element,
|
|
175
|
-
highlightChoices: true,
|
|
176
|
-
prompt: 'Select the parts that have references for Lucy',
|
|
177
|
-
text:
|
|
178
|
-
'<p>“Lucy? Are you using your time wisely to plan your project?” Mr. Wilson asked.</p><p> Lucy looked a little confused at first.</p>',
|
|
179
|
-
tokens: [
|
|
180
|
-
{
|
|
181
|
-
start: 10,
|
|
182
|
-
end: 68,
|
|
183
|
-
text: 'Lucy? Are you using your time wisely to plan your project?',
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
start: 106,
|
|
187
|
-
end: 145,
|
|
188
|
-
text: 'Lucy looked a little confused at first.',
|
|
189
|
-
},
|
|
190
|
-
],
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
var generate = {
|
|
194
|
-
model: model,
|
|
195
|
-
mathSample: mathSample_1,
|
|
196
|
-
htmlSample: htmlSample,
|
|
197
|
-
htmlAscii: htmlAscii
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
const { model: model$1, mathSample: mathSample$1, htmlSample: htmlSample$1, htmlAscii: htmlAscii$1 } = generate;
|
|
201
|
-
|
|
202
|
-
var config = {
|
|
203
|
-
elements: {
|
|
204
|
-
'select-text': '../..'
|
|
205
|
-
},
|
|
206
|
-
models: [
|
|
207
|
-
model$1('1', 'select-text')
|
|
208
|
-
]
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
//Note: demo-el is a custom element loaded in the markup.
|
|
212
|
-
customElements.whenDefined('demo-el').then(() => {
|
|
213
|
-
config.models.forEach(m => {
|
|
214
|
-
const de = document.createElement('demo-el');
|
|
215
|
-
document.body.appendChild(de);
|
|
216
|
-
de.def = { tagName: m.element, Element, Configure, controller };
|
|
217
|
-
de.model = m;
|
|
218
|
-
});
|
|
219
|
-
});
|