@pie-element/select-text 12.1.0-next.0 → 12.1.1-next.1
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 +1036 -2577
- package/LICENSE.md +5 -0
- package/configure/CHANGELOG.md +887 -2308
- package/configure/lib/defaultConfiguration.js +177 -0
- package/configure/lib/defaultConfiguration.js.map +1 -0
- package/configure/lib/design.js +406 -0
- package/configure/lib/design.js.map +1 -0
- package/configure/lib/index.js +128 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/utils.js +92 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +4 -4
- package/controller/CHANGELOG.md +636 -1690
- package/controller/lib/defaults.js +25 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +196 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/package.json +3 -3
- package/package.json +6 -6
- package/module/configure.js +0 -1
- package/module/controller.js +0 -1121
- package/module/demo.js +0 -301
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -14
- package/module/print-demo.js +0 -339
- package/module/print.html +0 -18
- package/module/print.js +0 -1
package/module/index.html
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/select-text@12.1.0-next.1</title>
|
|
6
|
-
<script
|
|
7
|
-
type="module"
|
|
8
|
-
src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
|
|
9
|
-
|
|
10
|
-
<link
|
|
11
|
-
href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
|
|
12
|
-
rel="stylesheet"
|
|
13
|
-
/>
|
|
14
|
-
<style>
|
|
15
|
-
html, body {
|
|
16
|
-
font-family: 'Roboto', sans-serif;
|
|
17
|
-
}
|
|
18
|
-
</style>
|
|
19
|
-
<script type="module" src="./demo.js"></script>
|
|
20
|
-
</head>
|
|
21
|
-
</html>
|
package/module/manifest.json
DELETED
package/module/print-demo.js
DELETED
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
import PrintElement from './print.js';
|
|
2
|
-
|
|
3
|
-
var generate = {};
|
|
4
|
-
|
|
5
|
-
const tokens = () => [
|
|
6
|
-
{
|
|
7
|
-
text: "If 'tweren't for sight and sound and smell,",
|
|
8
|
-
start: 0,
|
|
9
|
-
end: 43,
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
text: "I'd like the city pretty well,",
|
|
13
|
-
start: 44,
|
|
14
|
-
end: 74,
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
text: 'But when it comes to getting rest,',
|
|
18
|
-
start: 75,
|
|
19
|
-
end: 109,
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
text: 'I like the country lots the best.',
|
|
23
|
-
start: 110,
|
|
24
|
-
end: 143,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
text: 'Sometimes it seems to me I must',
|
|
28
|
-
start: 145,
|
|
29
|
-
end: 176,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
text: "Just quit the city's din and dust,",
|
|
33
|
-
start: 177,
|
|
34
|
-
end: 211,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
text: 'And get out where the sky is blue,',
|
|
38
|
-
start: 212,
|
|
39
|
-
end: 246,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
text: 'And say, now, how does it seem to you?',
|
|
43
|
-
start: 247,
|
|
44
|
-
end: 285,
|
|
45
|
-
},
|
|
46
|
-
];
|
|
47
|
-
|
|
48
|
-
const mathSampleTokens = [
|
|
49
|
-
{
|
|
50
|
-
start: 583,
|
|
51
|
-
end: 1465,
|
|
52
|
-
text: '<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>',
|
|
53
|
-
correct: true,
|
|
54
|
-
},
|
|
55
|
-
{ start: 1474, end: 2218 },
|
|
56
|
-
{ start: 2227, end: 2797 },
|
|
57
|
-
{ start: 2806, end: 3112 },
|
|
58
|
-
];
|
|
59
|
-
|
|
60
|
-
const base = (extras) =>
|
|
61
|
-
Object.assign(
|
|
62
|
-
{},
|
|
63
|
-
{
|
|
64
|
-
// highlightChoices: true,
|
|
65
|
-
feedback: {
|
|
66
|
-
correct: {
|
|
67
|
-
type: 'default',
|
|
68
|
-
default: 'Correct',
|
|
69
|
-
},
|
|
70
|
-
incorrect: {
|
|
71
|
-
type: 'default',
|
|
72
|
-
default: 'Incorrect',
|
|
73
|
-
},
|
|
74
|
-
partial: {
|
|
75
|
-
type: 'default',
|
|
76
|
-
default: 'Nearly',
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
partialScoring: false,
|
|
80
|
-
maxSelections: 2,
|
|
81
|
-
mode: 'sentence',
|
|
82
|
-
rationale: 'Rationale goes here.',
|
|
83
|
-
prompt: 'What sentences contain the character 6 in them?',
|
|
84
|
-
promptEnabled: true,
|
|
85
|
-
toolbarEditorPosition: 'bottom',
|
|
86
|
-
// text: `<p>Warhol was born in 1928 in Pittsburgh, Pennsylvania. When he was eight years old, he became very sick and had to stay in bed for months. To help him pass the time his mother, who was an artist, taught him how to draw. He took to it like a fish to water. Art became the center of Andy's world. A year later he added picture-taking to his interests when his mother gave him a camera. He also became fascinated with movies.</p><p>Andy studied art in school and learned many ways to make art. He learned how to use different art materials, such as oil paints, metal, clay, and wood. In 1949 he moved to New York City, where he got a job drawing and painting pictures for magazines.</p>`,
|
|
87
|
-
text: `<p>If 'tweren't for sight and sound and smell,<br />
|
|
88
|
-
I'd like the city pretty well,<br />
|
|
89
|
-
But when it comes to getting rest,<br />
|
|
90
|
-
I like the country lots the best.</p>
|
|
91
|
-
|
|
92
|
-
<p>Sometimes it seems to me I must<br />
|
|
93
|
-
Just quit the city's din and dust,<br />
|
|
94
|
-
And get out where the sky is blue,<br />
|
|
95
|
-
And say, now, how does it seem to you?</p>`,
|
|
96
|
-
tokens: tokens(),
|
|
97
|
-
},
|
|
98
|
-
extras,
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
const mathSample = (extras) => {
|
|
102
|
-
return Object.assign(
|
|
103
|
-
{},
|
|
104
|
-
{
|
|
105
|
-
highlightChoices: false,
|
|
106
|
-
feedback: {
|
|
107
|
-
correct: {
|
|
108
|
-
type: 'default',
|
|
109
|
-
default: 'Correct',
|
|
110
|
-
},
|
|
111
|
-
incorrect: {
|
|
112
|
-
type: 'default',
|
|
113
|
-
default: 'Incorrect',
|
|
114
|
-
},
|
|
115
|
-
partial: {
|
|
116
|
-
type: 'default',
|
|
117
|
-
default: 'Nearly',
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
partialScoring: false,
|
|
121
|
-
maxSelections: 2,
|
|
122
|
-
prompt: 'What sentences contain the character 6 in them?',
|
|
123
|
-
text: `<p>If 'tweren't for sight and sound and smell,<br />
|
|
124
|
-
I'd like the city pretty well,<br />
|
|
125
|
-
But when it comes to getting rest,<br />
|
|
126
|
-
I like the country lots the best.</p>
|
|
127
|
-
|
|
128
|
-
<p>Sometimes it seems to me I must<br />
|
|
129
|
-
Just quit the city's din and dust,<br />
|
|
130
|
-
And get out where the sky is blue,<br />
|
|
131
|
-
And say, now, how does it seem to you?</p>`,
|
|
132
|
-
tokens: mathSampleTokens,
|
|
133
|
-
},
|
|
134
|
-
extras,
|
|
135
|
-
);
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
generate.mathSample = (id, element) => {
|
|
139
|
-
return Object.assign({}, { id, element }, mathSample({}));
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
generate.htmlSample = (id, element) => {
|
|
143
|
-
return Object.assign(
|
|
144
|
-
{},
|
|
145
|
-
{ id, element },
|
|
146
|
-
{
|
|
147
|
-
highlightChoices: true,
|
|
148
|
-
feedback: {
|
|
149
|
-
correct: {
|
|
150
|
-
type: 'default',
|
|
151
|
-
default: 'Correct',
|
|
152
|
-
},
|
|
153
|
-
incorrect: {
|
|
154
|
-
type: 'default',
|
|
155
|
-
default: 'Incorrect',
|
|
156
|
-
},
|
|
157
|
-
partial: {
|
|
158
|
-
type: 'default',
|
|
159
|
-
default: 'Nearly',
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
partialScoring: false,
|
|
163
|
-
text: '<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',
|
|
164
|
-
prompt:
|
|
165
|
-
'<p>Select the <span class="relative-emphasis">one</span> phrase below that suggests that in the future, Keith may interpret this moment differently.</p>',
|
|
166
|
-
maxSelections: 2,
|
|
167
|
-
mode: 'sentence',
|
|
168
|
-
rationale: 'Rationale goes here.',
|
|
169
|
-
tokens: [
|
|
170
|
-
{
|
|
171
|
-
correct: false,
|
|
172
|
-
start: 67,
|
|
173
|
-
end: 215,
|
|
174
|
-
text: '<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>',
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
correct: false,
|
|
178
|
-
start: 321,
|
|
179
|
-
end: 410,
|
|
180
|
-
text: '<span class="lrn_token">it had been his destiny to succeed and so he had succeeded</span>',
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
correct: true,
|
|
184
|
-
start: 585,
|
|
185
|
-
end: 655,
|
|
186
|
-
text: '<span class="lrn_token">even after everything else had happened</span>',
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
correct: false,
|
|
190
|
-
start: 687,
|
|
191
|
-
end: 790,
|
|
192
|
-
text: '<span class="lrn_token">he was an astronaut and they were welcoming him aboard the space station</span>',
|
|
193
|
-
},
|
|
194
|
-
],
|
|
195
|
-
},
|
|
196
|
-
);
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
generate.htmlAscii = (id, element) => ({
|
|
200
|
-
id,
|
|
201
|
-
element,
|
|
202
|
-
highlightChoices: true,
|
|
203
|
-
prompt: 'Select the parts that have references for Lucy',
|
|
204
|
-
text: '<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>',
|
|
205
|
-
tokens: [
|
|
206
|
-
{
|
|
207
|
-
start: 10,
|
|
208
|
-
end: 68,
|
|
209
|
-
text: 'Lucy? Are you using your time wisely to plan your project?',
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
start: 106,
|
|
213
|
-
end: 145,
|
|
214
|
-
text: 'Lucy looked a little confused at first.',
|
|
215
|
-
},
|
|
216
|
-
],
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
generate.model = (id, element) => {
|
|
220
|
-
return Object.assign(
|
|
221
|
-
{},
|
|
222
|
-
{ id, element },
|
|
223
|
-
base({
|
|
224
|
-
// "id": "8a808081701d693801703174fb900421",
|
|
225
|
-
teacherInstructions: '',
|
|
226
|
-
partialScoring: true,
|
|
227
|
-
prompt:
|
|
228
|
-
'<p>Select the sentence from "The Gymnast" that <span class="relative-emphasis">best</span> represents the theme.</p>',
|
|
229
|
-
rationale:
|
|
230
|
-
'<p>The final sentence of the passage best exemplifies the theme of the short story because Natasha's practice and determination finally pays off.</p>',
|
|
231
|
-
tokens: [
|
|
232
|
-
{
|
|
233
|
-
text: 'She thought about what she had to do, struggling to rein in her wild, fearful thoughts.',
|
|
234
|
-
end: 90,
|
|
235
|
-
start: 3,
|
|
236
|
-
correct: false,
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
start: 449,
|
|
240
|
-
end: 585,
|
|
241
|
-
text: 'Just for a hair of a moment, Natasha wondered if she really wanted a perfect 10, so weary was she of trying for but never achieving one.',
|
|
242
|
-
correct: false,
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
end: 627,
|
|
246
|
-
correct: false,
|
|
247
|
-
text: "At last Natasha's moment arrived.",
|
|
248
|
-
start: 594,
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
end: 743,
|
|
252
|
-
text: "The faces of past giants of gymnastics swam before her mind's eye, now razor–sharp with fierce determination.",
|
|
253
|
-
correct: false,
|
|
254
|
-
start: 628,
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
text: 'Suddenly, the din of the gymnasium was silent to her.',
|
|
258
|
-
end: 997,
|
|
259
|
-
correct: false,
|
|
260
|
-
start: 944,
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
end: 1087,
|
|
264
|
-
start: 998,
|
|
265
|
-
correct: false,
|
|
266
|
-
text: 'Forcing all sound out of her mind, she focused on the gleaming balance beam ahead of her.',
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
correct: true,
|
|
270
|
-
start: 1088,
|
|
271
|
-
end: 1225,
|
|
272
|
-
text: 'Taking a deep breath, Natasha made her graceful, yet powerful approach, mounted the beam flawlessly, and...executed her first perfect 10.',
|
|
273
|
-
},
|
|
274
|
-
],
|
|
275
|
-
// "element": "select-text",
|
|
276
|
-
text: "<p>She thought about what she had to do, struggling to rein in her wild, fearful thoughts. Coach Cummings always said that an undisciplined mind never scored a perfect 10. Natasha wanted to please her Coach, yet sometimes his approval wasn't as exciting as his anger. The gymnasts were unanimous about one thing: Coach Cummings's fits of disapproving rage were much more humorous to witness than his infrequent, backslapping moments of high praise. Just for a hair of a moment, Natasha wondered if she really wanted a perfect 10, so weary was she of trying for but never achieving one.</p>\n\n<p>At last Natasha's moment arrived. The faces of past giants of gymnastics swam before her mind's eye, now razor–sharp with fierce determination. \"I am talented. I am not afraid. I will make a perfect 10,\" she spoke aloud to herself, as she approached the mat, dusted her hands with chalk to prevent slippage, and returned to her starting point. Suddenly, the din of the gymnasium was silent to her. Forcing all sound out of her mind, she focused on the gleaming balance beam ahead of her. Taking a deep breath, Natasha made her graceful, yet powerful approach, mounted the beam flawlessly, and...executed her first perfect 10.</p>\n",
|
|
277
|
-
rubricEnabled: false,
|
|
278
|
-
}),
|
|
279
|
-
);
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
const { model } = generate;
|
|
283
|
-
|
|
284
|
-
var config = {
|
|
285
|
-
elements: {
|
|
286
|
-
'select-text': '../..',
|
|
287
|
-
},
|
|
288
|
-
models: [model('1', 'select-text')],
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
// new init - just shows off print!
|
|
292
|
-
|
|
293
|
-
const init = async () => {
|
|
294
|
-
console.log('define the element...');
|
|
295
|
-
await Promise.all(
|
|
296
|
-
config.models.map(async (m) => {
|
|
297
|
-
try {
|
|
298
|
-
const printTag = `${m.element}-print`;
|
|
299
|
-
if (customElements.get(printTag)) {
|
|
300
|
-
return true;
|
|
301
|
-
} else {
|
|
302
|
-
customElements.define(printTag, PrintElement);
|
|
303
|
-
await customElements.whenDefined(printTag);
|
|
304
|
-
return true;
|
|
305
|
-
}
|
|
306
|
-
} catch (e) {
|
|
307
|
-
return false;
|
|
308
|
-
}
|
|
309
|
-
})
|
|
310
|
-
);
|
|
311
|
-
|
|
312
|
-
console.log('now apply the model...');
|
|
313
|
-
config.models.forEach((m) => {
|
|
314
|
-
const printTag = `${m.element}-print`;
|
|
315
|
-
const h3s = document.createElement('h3');
|
|
316
|
-
h3s.textContent = 'student mode';
|
|
317
|
-
document.body.appendChild(h3s);
|
|
318
|
-
const de = document.createElement(printTag);
|
|
319
|
-
document.body.appendChild(de);
|
|
320
|
-
de.options = {};
|
|
321
|
-
de.model = m;
|
|
322
|
-
|
|
323
|
-
const h3 = document.createElement('h3');
|
|
324
|
-
h3.textContent = 'instructor mode';
|
|
325
|
-
document.body.appendChild(h3);
|
|
326
|
-
const instr = document.createElement(printTag);
|
|
327
|
-
document.body.appendChild(instr);
|
|
328
|
-
instr.options = { mode: 'instructor' };
|
|
329
|
-
instr.model = JSON.parse(JSON.stringify(m));
|
|
330
|
-
});
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
init()
|
|
334
|
-
.then(() => {
|
|
335
|
-
console.log('ready');
|
|
336
|
-
})
|
|
337
|
-
.catch((e) => {
|
|
338
|
-
console.error(e);
|
|
339
|
-
});
|
package/module/print.html
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/select-text@12.1.0-next.1</title>
|
|
6
|
-
<link
|
|
7
|
-
href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
|
|
8
|
-
rel="stylesheet"
|
|
9
|
-
/>
|
|
10
|
-
<style>
|
|
11
|
-
html, body {
|
|
12
|
-
font-family: 'Roboto', sans-serif;
|
|
13
|
-
}
|
|
14
|
-
</style>
|
|
15
|
-
<script type="module" src="./print-demo.js"></script>
|
|
16
|
-
</head>
|
|
17
|
-
<body></body>
|
|
18
|
-
</html>
|