@pie-element/placement-ordering 13.0.0-beta.0 → 13.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/choice-tile.js +3 -3
- package/configure/lib/choice-tile.js.map +1 -1
- package/configure/lib/design.js +6 -6
- package/configure/lib/design.js.map +1 -1
- package/configure/package.json +9 -9
- package/controller/CHANGELOG.md +0 -11
- package/controller/package.json +6 -6
- package/module/configure.js +1 -0
- package/module/controller.js +24482 -0
- package/module/demo.js +75 -0
- package/module/element.js +1 -0
- package/module/index.html +21 -0
- package/module/manifest.json +18 -0
- package/module/print-demo.js +113 -0
- package/module/print.html +18 -0
- package/package.json +11 -12
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<title>@pie-element/placement-ordering@13.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>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pie-element/placement-ordering",
|
|
3
|
+
"version": "13.0.0-beta.1",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"name": "@pie-lib/shared-module",
|
|
7
|
+
"version": "^3.0.5"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"name": "@pie-lib/math-rendering-module",
|
|
11
|
+
"version": "^4.0.5"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "@pie-lib/drag-module",
|
|
15
|
+
"version": "^3.0.5"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import PrintElement from './print.js';
|
|
2
|
+
|
|
3
|
+
var generate = {};
|
|
4
|
+
|
|
5
|
+
generate.model = (id, element) => ({
|
|
6
|
+
id,
|
|
7
|
+
element,
|
|
8
|
+
choiceLabel: 'Choices',
|
|
9
|
+
choices: [
|
|
10
|
+
{
|
|
11
|
+
id: 'c1',
|
|
12
|
+
label: 'Blueberry',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: 'c2',
|
|
16
|
+
label: 'Lemon',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: 'c3',
|
|
20
|
+
label: 'Melon',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'c4',
|
|
24
|
+
label: 'Pear',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
correctResponse: ['c1', 'c2', 'c3', 'c4'],
|
|
28
|
+
alternateResponses: [{ response: ['c4', 'c3', 'c2', 'c1'] }],
|
|
29
|
+
feedback: {
|
|
30
|
+
correct: {
|
|
31
|
+
type: 'custom',
|
|
32
|
+
custom: 'foo',
|
|
33
|
+
},
|
|
34
|
+
incorrect: {
|
|
35
|
+
type: 'custom',
|
|
36
|
+
custom: 'no',
|
|
37
|
+
},
|
|
38
|
+
partial: {
|
|
39
|
+
type: 'custom',
|
|
40
|
+
custom: 'nearly',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
feedbackEnabled: true,
|
|
44
|
+
prompt: 'Arrange the fruits alphabetically',
|
|
45
|
+
promptEnabled: true,
|
|
46
|
+
numberedGuides: false,
|
|
47
|
+
orientation: 'vertical',
|
|
48
|
+
partialScoring: false,
|
|
49
|
+
placementArea: false,
|
|
50
|
+
scoringType: 'auto',
|
|
51
|
+
targetLabel: 'Answers',
|
|
52
|
+
toolbarEditorPosition: 'bottom',
|
|
53
|
+
rubricEnabled: false,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const { model } = generate;
|
|
57
|
+
|
|
58
|
+
var config = {
|
|
59
|
+
elements: {
|
|
60
|
+
'placement-ordering': '../..',
|
|
61
|
+
},
|
|
62
|
+
models: [model('1', 'placement-ordering')],
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// new init - just shows off print!
|
|
66
|
+
|
|
67
|
+
const init = async () => {
|
|
68
|
+
console.log('define the element...');
|
|
69
|
+
await Promise.all(
|
|
70
|
+
config.models.map(async (m) => {
|
|
71
|
+
try {
|
|
72
|
+
const printTag = `${m.element}-print`;
|
|
73
|
+
if (customElements.get(printTag)) {
|
|
74
|
+
return true;
|
|
75
|
+
} else {
|
|
76
|
+
customElements.define(printTag, PrintElement);
|
|
77
|
+
await customElements.whenDefined(printTag);
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
} catch (e) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
console.log('now apply the model...');
|
|
87
|
+
config.models.forEach((m) => {
|
|
88
|
+
const printTag = `${m.element}-print`;
|
|
89
|
+
const h3s = document.createElement('h3');
|
|
90
|
+
h3s.textContent = 'student mode';
|
|
91
|
+
document.body.appendChild(h3s);
|
|
92
|
+
const de = document.createElement(printTag);
|
|
93
|
+
document.body.appendChild(de);
|
|
94
|
+
de.options = {};
|
|
95
|
+
de.model = m;
|
|
96
|
+
|
|
97
|
+
const h3 = document.createElement('h3');
|
|
98
|
+
h3.textContent = 'instructor mode';
|
|
99
|
+
document.body.appendChild(h3);
|
|
100
|
+
const instr = document.createElement(printTag);
|
|
101
|
+
document.body.appendChild(instr);
|
|
102
|
+
instr.options = { mode: 'instructor' };
|
|
103
|
+
instr.model = JSON.parse(JSON.stringify(m));
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
init()
|
|
108
|
+
.then(() => {
|
|
109
|
+
console.log('ready');
|
|
110
|
+
})
|
|
111
|
+
.catch((e) => {
|
|
112
|
+
console.error(e);
|
|
113
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<title>@pie-element/placement-ordering@13.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>
|
package/package.json
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/placement-ordering",
|
|
3
|
-
"version": "13.0.0-
|
|
3
|
+
"version": "13.0.0-next.42+bb1f3eb4e",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "pie-framework/pie-elements",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@dnd-kit/core": "^6.1
|
|
10
|
+
"@dnd-kit/core": "^6.3.1",
|
|
11
11
|
"@emotion/react": "^11.14.0",
|
|
12
12
|
"@emotion/style": "^0.8.0",
|
|
13
13
|
"@mui/icons-material": "^7.3.4",
|
|
14
14
|
"@mui/material": "^7.3.4",
|
|
15
15
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
16
|
-
"@pie-lib/correct-answer-toggle": "
|
|
17
|
-
"@pie-lib/drag": "
|
|
18
|
-
"@pie-lib/math-rendering": "
|
|
19
|
-
"@pie-lib/render-ui": "
|
|
20
|
-
"@pie-lib/translator": "
|
|
16
|
+
"@pie-lib/correct-answer-toggle": "3.1.1-next.0",
|
|
17
|
+
"@pie-lib/drag": "3.1.1-next.0",
|
|
18
|
+
"@pie-lib/math-rendering": "4.1.1-next.0",
|
|
19
|
+
"@pie-lib/render-ui": "5.1.1-next.0",
|
|
20
|
+
"@pie-lib/translator": "3.1.1-next.0",
|
|
21
21
|
"debug": "^4.1.1",
|
|
22
22
|
"decimal.js": "^10.0.0",
|
|
23
|
-
"lodash": "^4.17.
|
|
24
|
-
"prop-types": "^15.
|
|
23
|
+
"lodash": "^4.17.23",
|
|
24
|
+
"prop-types": "^15.8.1",
|
|
25
25
|
"react": "18.2.0",
|
|
26
26
|
"react-dom": "18.2.0",
|
|
27
|
-
"react-
|
|
28
|
-
"react-transition-group": "^2.3.1"
|
|
27
|
+
"react-transition-group": "^4.4.5"
|
|
29
28
|
},
|
|
30
29
|
"author": "",
|
|
31
30
|
"license": "ISC",
|
|
32
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "bb1f3eb4e3b5b1cb15024d459ffd6e94bf419712",
|
|
33
32
|
"scripts": {
|
|
34
33
|
"postpublish": "../../scripts/postpublish"
|
|
35
34
|
},
|