@pie-element/drawing-response 11.0.0-next.42 → 11.0.0-next.43
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/package.json +4 -4
- package/module/configure.js +0 -1
- package/module/controller.js +0 -77
- package/module/demo.js +0 -39
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -14
- package/module/print-demo.js +0 -77
- package/module/print.html +0 -18
package/module/index.html
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/drawing-response@11.0.0-beta.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,77 +0,0 @@
|
|
|
1
|
-
import PrintElement from './print.js';
|
|
2
|
-
|
|
3
|
-
var generate = {};
|
|
4
|
-
|
|
5
|
-
generate.model = (id, element) => ({
|
|
6
|
-
id,
|
|
7
|
-
element,
|
|
8
|
-
prompt: 'This is the question prompt',
|
|
9
|
-
promptEnabled: true,
|
|
10
|
-
backgroundImageEnabled: true,
|
|
11
|
-
toolbarEditorPosition: 'bottom',
|
|
12
|
-
imageUrl: '',
|
|
13
|
-
imageDimensions: {
|
|
14
|
-
height: 0,
|
|
15
|
-
width: 0,
|
|
16
|
-
},
|
|
17
|
-
rubricEnabled: false,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const { model } = generate;
|
|
21
|
-
|
|
22
|
-
var config = {
|
|
23
|
-
elements: {
|
|
24
|
-
'drawing-response': '../..',
|
|
25
|
-
},
|
|
26
|
-
models: [model('1', 'drawing-response')],
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// new init - just shows off print!
|
|
30
|
-
|
|
31
|
-
const init = async () => {
|
|
32
|
-
console.log('define the element...');
|
|
33
|
-
await Promise.all(
|
|
34
|
-
config.models.map(async (m) => {
|
|
35
|
-
try {
|
|
36
|
-
const printTag = `${m.element}-print`;
|
|
37
|
-
if (customElements.get(printTag)) {
|
|
38
|
-
return true;
|
|
39
|
-
} else {
|
|
40
|
-
customElements.define(printTag, PrintElement);
|
|
41
|
-
await customElements.whenDefined(printTag);
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
} catch (e) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
console.log('now apply the model...');
|
|
51
|
-
config.models.forEach((m) => {
|
|
52
|
-
const printTag = `${m.element}-print`;
|
|
53
|
-
const h3s = document.createElement('h3');
|
|
54
|
-
h3s.textContent = 'student mode';
|
|
55
|
-
document.body.appendChild(h3s);
|
|
56
|
-
const de = document.createElement(printTag);
|
|
57
|
-
document.body.appendChild(de);
|
|
58
|
-
de.options = {};
|
|
59
|
-
de.model = m;
|
|
60
|
-
|
|
61
|
-
const h3 = document.createElement('h3');
|
|
62
|
-
h3.textContent = 'instructor mode';
|
|
63
|
-
document.body.appendChild(h3);
|
|
64
|
-
const instr = document.createElement(printTag);
|
|
65
|
-
document.body.appendChild(instr);
|
|
66
|
-
instr.options = { mode: 'instructor' };
|
|
67
|
-
instr.model = JSON.parse(JSON.stringify(m));
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
init()
|
|
72
|
-
.then(() => {
|
|
73
|
-
console.log('ready');
|
|
74
|
-
})
|
|
75
|
-
.catch((e) => {
|
|
76
|
-
console.error(e);
|
|
77
|
-
});
|
package/module/print.html
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/drawing-response@11.0.0-beta.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>
|