munchboka-edutools 0.2.3__py3-none-any.whl
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.
Potentially problematic release.
This version of munchboka-edutools might be problematic. Click here for more details.
- munchboka_edutools/__init__.py +184 -0
- munchboka_edutools/_plotmath_shim.py +126 -0
- munchboka_edutools/_version.py +2 -0
- munchboka_edutools/directives/__init__.py +1 -0
- munchboka_edutools/directives/admonitions.py +389 -0
- munchboka_edutools/directives/cas_popup.py +428 -0
- munchboka_edutools/directives/clear.py +103 -0
- munchboka_edutools/directives/dialogue.py +137 -0
- munchboka_edutools/directives/escape_room.py +296 -0
- munchboka_edutools/directives/escape_room2.py +318 -0
- munchboka_edutools/directives/factor_tree.py +552 -0
- munchboka_edutools/directives/flashcards.py +233 -0
- munchboka_edutools/directives/ggb.py +209 -0
- munchboka_edutools/directives/ggb_icon.py +105 -0
- munchboka_edutools/directives/ggb_popup.py +308 -0
- munchboka_edutools/directives/horner.py +326 -0
- munchboka_edutools/directives/interactive_code.py +75 -0
- munchboka_edutools/directives/jeopardy.py +252 -0
- munchboka_edutools/directives/jeopardy2.py +636 -0
- munchboka_edutools/directives/multi_plot.py +2524 -0
- munchboka_edutools/directives/multi_plot2.py +252 -0
- munchboka_edutools/directives/pair_puzzle.py +191 -0
- munchboka_edutools/directives/parsons.py +109 -0
- munchboka_edutools/directives/plot.py +3758 -0
- munchboka_edutools/directives/poly_icon.py +111 -0
- munchboka_edutools/directives/polydiv.py +346 -0
- munchboka_edutools/directives/popup.py +245 -0
- munchboka_edutools/directives/quiz.py +291 -0
- munchboka_edutools/directives/quiz2.py +453 -0
- munchboka_edutools/directives/signchart.py +519 -0
- munchboka_edutools/directives/signchart2.py +1545 -0
- munchboka_edutools/directives/timed_quiz.py +436 -0
- munchboka_edutools/directives/turtle.py +157 -0
- munchboka_edutools/static/css/admonitions.css +2012 -0
- munchboka_edutools/static/css/cas_popup.css +242 -0
- munchboka_edutools/static/css/code_mirror_themes/github_dark_cm.css +112 -0
- munchboka_edutools/static/css/code_mirror_themes/github_dark_default_cm.css +40 -0
- munchboka_edutools/static/css/code_mirror_themes/github_dark_high_contrast_cm.css +141 -0
- munchboka_edutools/static/css/code_mirror_themes/github_light_cm.css +120 -0
- munchboka_edutools/static/css/code_mirror_themes/github_light_default_cm.css +108 -0
- munchboka_edutools/static/css/code_mirror_themes/one_dark_cm.css +121 -0
- munchboka_edutools/static/css/dialogue.css +92 -0
- munchboka_edutools/static/css/escapeRoom/escape-room.css +223 -0
- munchboka_edutools/static/css/figures.css +321 -0
- munchboka_edutools/static/css/flashcards.css +219 -0
- munchboka_edutools/static/css/general_style.css +74 -0
- munchboka_edutools/static/css/github-dark-high-contrast.css +141 -0
- munchboka_edutools/static/css/github-dark.css +147 -0
- munchboka_edutools/static/css/github-light.css +155 -0
- munchboka_edutools/static/css/interactive_code/style.css +575 -0
- munchboka_edutools/static/css/interactive_code.css +582 -0
- munchboka_edutools/static/css/jeopardy.css +553 -0
- munchboka_edutools/static/css/pairPuzzle/style.css +177 -0
- munchboka_edutools/static/css/parsons/parsonsPuzzle.css +331 -0
- munchboka_edutools/static/css/popup.css +115 -0
- munchboka_edutools/static/css/quiz.css +377 -0
- munchboka_edutools/static/css/timedQuiz.css +375 -0
- munchboka_edutools/static/icons/ggb/mode_evaluate.svg +1 -0
- munchboka_edutools/static/icons/ggb/mode_extremum.svg +1 -0
- munchboka_edutools/static/icons/ggb/mode_intersect.svg +1 -0
- munchboka_edutools/static/icons/ggb/mode_nsolve.svg +1 -0
- munchboka_edutools/static/icons/ggb/mode_numeric.svg +1 -0
- munchboka_edutools/static/icons/ggb/mode_point.svg +1 -0
- munchboka_edutools/static/icons/ggb/mode_solve.svg +1 -0
- munchboka_edutools/static/icons/misc/windows-logo.svg +1 -0
- munchboka_edutools/static/icons/outline/dark_mode/academic.svg +3 -0
- munchboka_edutools/static/icons/outline/dark_mode/backward.svg +3 -0
- munchboka_edutools/static/icons/outline/dark_mode/book.svg +3 -0
- munchboka_edutools/static/icons/outline/dark_mode/chat_bubble.svg +3 -0
- munchboka_edutools/static/icons/outline/dark_mode/check.svg +3 -0
- munchboka_edutools/static/icons/outline/dark_mode/cmd_line.svg +3 -0
- munchboka_edutools/static/icons/outline/dark_mode/file.svg +1 -0
- munchboka_edutools/static/icons/outline/dark_mode/fire.svg +4 -0
- munchboka_edutools/static/icons/outline/dark_mode/key.svg +3 -0
- munchboka_edutools/static/icons/outline/dark_mode/magnifying.svg +3 -0
- munchboka_edutools/static/icons/outline/dark_mode/pencil_square.svg +3 -0
- munchboka_edutools/static/icons/outline/dark_mode/play.svg +3 -0
- munchboka_edutools/static/icons/outline/dark_mode/question.svg +3 -0
- munchboka_edutools/static/icons/outline/dark_mode/square_check.svg +1 -0
- munchboka_edutools/static/icons/outline/dark_mode/stop.svg +3 -0
- munchboka_edutools/static/icons/outline/dark_mode/summary.svg +3 -0
- munchboka_edutools/static/icons/outline/dark_mode/undo.svg +3 -0
- munchboka_edutools/static/icons/outline/dark_mode/unlock.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/academic.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/backward.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/book.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/chat_bubble.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/check.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/cmd_line.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/file.svg +1 -0
- munchboka_edutools/static/icons/outline/light_mode/fire.svg +4 -0
- munchboka_edutools/static/icons/outline/light_mode/key.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/magnifying.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/pencil_square.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/play.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/question.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/square_check.svg +1 -0
- munchboka_edutools/static/icons/outline/light_mode/stop.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/summary.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/undo.svg +3 -0
- munchboka_edutools/static/icons/outline/light_mode/unlock.svg +3 -0
- munchboka_edutools/static/icons/polyicons/cubicdown.svg +3 -0
- munchboka_edutools/static/icons/polyicons/cubicup.svg +3 -0
- munchboka_edutools/static/icons/polyicons/frown.svg +3 -0
- munchboka_edutools/static/icons/polyicons/smile.svg +3 -0
- munchboka_edutools/static/icons/solid/dark_mode/academic.svg +5 -0
- munchboka_edutools/static/icons/solid/dark_mode/backward.svg +3 -0
- munchboka_edutools/static/icons/solid/dark_mode/book.svg +3 -0
- munchboka_edutools/static/icons/solid/dark_mode/brain.svg +1 -0
- munchboka_edutools/static/icons/solid/dark_mode/file.svg +1 -0
- munchboka_edutools/static/icons/solid/dark_mode/fire.svg +3 -0
- munchboka_edutools/static/icons/solid/dark_mode/key.svg +3 -0
- munchboka_edutools/static/icons/solid/dark_mode/pencil_square.svg +4 -0
- munchboka_edutools/static/icons/solid/dark_mode/play.svg +3 -0
- munchboka_edutools/static/icons/solid/dark_mode/python.svg +1 -0
- munchboka_edutools/static/icons/solid/dark_mode/scroll.svg +1 -0
- munchboka_edutools/static/icons/solid/dark_mode/stop.svg +3 -0
- munchboka_edutools/static/icons/solid/light_mode/academic.svg +5 -0
- munchboka_edutools/static/icons/solid/light_mode/backward.svg +3 -0
- munchboka_edutools/static/icons/solid/light_mode/book.svg +3 -0
- munchboka_edutools/static/icons/solid/light_mode/brain.svg +1 -0
- munchboka_edutools/static/icons/solid/light_mode/file.svg +1 -0
- munchboka_edutools/static/icons/solid/light_mode/fire.svg +3 -0
- munchboka_edutools/static/icons/solid/light_mode/key.svg +3 -0
- munchboka_edutools/static/icons/solid/light_mode/pencil_square.svg +4 -0
- munchboka_edutools/static/icons/solid/light_mode/play.svg +3 -0
- munchboka_edutools/static/icons/solid/light_mode/python.svg +1 -0
- munchboka_edutools/static/icons/solid/light_mode/scroll.svg +1 -0
- munchboka_edutools/static/icons/solid/light_mode/stop.svg +3 -0
- munchboka_edutools/static/icons/stickers/edit.svg +1 -0
- munchboka_edutools/static/icons/stickers/pencil_square.svg +3 -0
- munchboka_edutools/static/js/casThemeManager.js +99 -0
- munchboka_edutools/static/js/escapeRoom/escape-room.js +219 -0
- munchboka_edutools/static/js/flashcards.js +199 -0
- munchboka_edutools/static/js/geogebra-setup.js +6 -0
- munchboka_edutools/static/js/highlight-init.js +6 -0
- munchboka_edutools/static/js/interactiveCode/codeEditor.js +648 -0
- munchboka_edutools/static/js/interactiveCode/interactiveCodeSetup.js +441 -0
- munchboka_edutools/static/js/interactiveCode/pythonRunner.js +336 -0
- munchboka_edutools/static/js/interactiveCode/turtleCode.js +203 -0
- munchboka_edutools/static/js/interactiveCode/workerManager.js +353 -0
- munchboka_edutools/static/js/jeopardy.js +560 -0
- munchboka_edutools/static/js/pairPuzzle/draggableItem.js +64 -0
- munchboka_edutools/static/js/pairPuzzle/dropZone.js +119 -0
- munchboka_edutools/static/js/pairPuzzle/game.js +160 -0
- munchboka_edutools/static/js/parsons/parsonsPuzzle.js +641 -0
- munchboka_edutools/static/js/popup.js +85 -0
- munchboka_edutools/static/js/quiz.js +566 -0
- munchboka_edutools/static/js/skulpt/skulpt.js +35721 -0
- munchboka_edutools/static/js/timedQuiz/multipleChoiceQuestion.js +184 -0
- munchboka_edutools/static/js/timedQuiz/timedMultipleChoiceQuiz.js +244 -0
- munchboka_edutools/static/js/timedQuiz/utils.js +6 -0
- munchboka_edutools/static/js/utils.js +3 -0
- munchboka_edutools-0.2.3.dist-info/METADATA +109 -0
- munchboka_edutools-0.2.3.dist-info/RECORD +157 -0
- munchboka_edutools-0.2.3.dist-info/WHEEL +4 -0
- munchboka_edutools-0.2.3.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
function renderMathIn(element) {
|
|
3
|
+
if (typeof window !== 'undefined' && typeof window.renderMathInElement === 'function') {
|
|
4
|
+
window.renderMathInElement(element, {
|
|
5
|
+
delimiters: [
|
|
6
|
+
{ left: '$$', right: '$$', display: true },
|
|
7
|
+
{ left: '$', right: '$', display: false },
|
|
8
|
+
{ left: '\\[', right: '\\]', display: true },
|
|
9
|
+
{ left: '\\(', right: '\\)', display: false },
|
|
10
|
+
],
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function highlightCode(element) {
|
|
16
|
+
if (typeof window !== 'undefined' && window.hljs && typeof window.hljs.highlightElement === 'function') {
|
|
17
|
+
const blocks = element.querySelectorAll('code');
|
|
18
|
+
blocks.forEach((b) => window.hljs.highlightElement(b));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function createFlashcards(root, cfg) {
|
|
23
|
+
const cards = Array.isArray(cfg.cards) ? cfg.cards.slice() : [];
|
|
24
|
+
const opts = cfg.options || {};
|
|
25
|
+
const showProgress = !!opts.show_progress;
|
|
26
|
+
let index = Number.isFinite(opts.start_index) ? Math.max(0, Math.min(cards.length - 1, opts.start_index)) : 0;
|
|
27
|
+
let side = 'front';
|
|
28
|
+
|
|
29
|
+
if (opts.shuffle && cards.length > 1) {
|
|
30
|
+
for (let i = cards.length - 1; i > 0; i -= 1) {
|
|
31
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
32
|
+
[cards[i], cards[j]] = [cards[j], cards[i]];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
root.innerHTML = '';
|
|
37
|
+
root.classList.add('flashcards-root');
|
|
38
|
+
|
|
39
|
+
const cardShell = document.createElement('div');
|
|
40
|
+
cardShell.className = 'flashcards-card-shell';
|
|
41
|
+
|
|
42
|
+
const card = document.createElement('div');
|
|
43
|
+
card.className = 'flashcards-card';
|
|
44
|
+
|
|
45
|
+
const header = document.createElement('div');
|
|
46
|
+
header.className = 'flashcards-header';
|
|
47
|
+
|
|
48
|
+
const sideLabel = document.createElement('div');
|
|
49
|
+
sideLabel.className = 'flashcards-pill';
|
|
50
|
+
|
|
51
|
+
const progress = document.createElement('div');
|
|
52
|
+
progress.className = 'flashcards-progress';
|
|
53
|
+
|
|
54
|
+
header.appendChild(sideLabel);
|
|
55
|
+
header.appendChild(progress);
|
|
56
|
+
|
|
57
|
+
const body = document.createElement('div');
|
|
58
|
+
body.className = 'flashcards-body';
|
|
59
|
+
|
|
60
|
+
const frontDiv = document.createElement('div');
|
|
61
|
+
frontDiv.className = 'flashcards-face front';
|
|
62
|
+
|
|
63
|
+
const backDiv = document.createElement('div');
|
|
64
|
+
backDiv.className = 'flashcards-face back';
|
|
65
|
+
|
|
66
|
+
body.appendChild(frontDiv);
|
|
67
|
+
body.appendChild(backDiv);
|
|
68
|
+
|
|
69
|
+
const footer = document.createElement('div');
|
|
70
|
+
footer.className = 'flashcards-footer';
|
|
71
|
+
|
|
72
|
+
const hint = document.createElement('div');
|
|
73
|
+
hint.textContent = 'Tips: bruk Space for å snu kortet';
|
|
74
|
+
|
|
75
|
+
const controls = document.createElement('div');
|
|
76
|
+
controls.className = 'flashcards-controls';
|
|
77
|
+
|
|
78
|
+
const prevBtn = document.createElement('button');
|
|
79
|
+
prevBtn.type = 'button';
|
|
80
|
+
prevBtn.className = 'flashcards-btn';
|
|
81
|
+
prevBtn.textContent = '← Forrige';
|
|
82
|
+
|
|
83
|
+
const flipBtn = document.createElement('button');
|
|
84
|
+
flipBtn.type = 'button';
|
|
85
|
+
flipBtn.className = 'flashcards-btn flashcards-btn-primary';
|
|
86
|
+
flipBtn.textContent = 'Snu kortet';
|
|
87
|
+
|
|
88
|
+
const nextBtn = document.createElement('button');
|
|
89
|
+
nextBtn.type = 'button';
|
|
90
|
+
nextBtn.className = 'flashcards-btn';
|
|
91
|
+
nextBtn.textContent = 'Neste →';
|
|
92
|
+
|
|
93
|
+
controls.appendChild(prevBtn);
|
|
94
|
+
controls.appendChild(flipBtn);
|
|
95
|
+
controls.appendChild(nextBtn);
|
|
96
|
+
|
|
97
|
+
footer.appendChild(hint);
|
|
98
|
+
footer.appendChild(controls);
|
|
99
|
+
|
|
100
|
+
card.appendChild(header);
|
|
101
|
+
card.appendChild(body);
|
|
102
|
+
card.appendChild(footer);
|
|
103
|
+
cardShell.appendChild(card);
|
|
104
|
+
root.appendChild(cardShell);
|
|
105
|
+
|
|
106
|
+
function update() {
|
|
107
|
+
if (!cards.length) {
|
|
108
|
+
frontDiv.innerHTML = '<em>Ingen kort.</em>';
|
|
109
|
+
backDiv.innerHTML = '';
|
|
110
|
+
sideLabel.textContent = 'Kort';
|
|
111
|
+
progress.textContent = '';
|
|
112
|
+
prevBtn.disabled = true;
|
|
113
|
+
nextBtn.disabled = true;
|
|
114
|
+
flipBtn.disabled = true;
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const current = cards[index] || { front: '', back: '' };
|
|
119
|
+
frontDiv.innerHTML = current.front || '';
|
|
120
|
+
backDiv.innerHTML = current.back || '';
|
|
121
|
+
root.dataset.side = side;
|
|
122
|
+
|
|
123
|
+
sideLabel.textContent = side === 'front' ? 'Forside' : 'Bakside';
|
|
124
|
+
progress.textContent = showProgress ? `Kort ${index + 1} / ${cards.length}` : '';
|
|
125
|
+
|
|
126
|
+
prevBtn.disabled = index === 0;
|
|
127
|
+
nextBtn.disabled = index === cards.length - 1;
|
|
128
|
+
|
|
129
|
+
[frontDiv, backDiv].forEach((el) => {
|
|
130
|
+
renderMathIn(el);
|
|
131
|
+
highlightCode(el);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function flip() {
|
|
136
|
+
side = side === 'front' ? 'back' : 'front';
|
|
137
|
+
card.classList.remove('flashcards-card-flip');
|
|
138
|
+
// Force reflow so the animation can restart
|
|
139
|
+
// eslint-disable-next-line no-unused-expressions
|
|
140
|
+
void card.offsetWidth;
|
|
141
|
+
card.classList.add('flashcards-card-flip');
|
|
142
|
+
update();
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function prev() {
|
|
146
|
+
if (index > 0) {
|
|
147
|
+
index -= 1;
|
|
148
|
+
side = 'front';
|
|
149
|
+
update();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function next() {
|
|
154
|
+
if (index < cards.length - 1) {
|
|
155
|
+
index += 1;
|
|
156
|
+
side = 'front';
|
|
157
|
+
update();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
flipBtn.addEventListener('click', flip);
|
|
162
|
+
prevBtn.addEventListener('click', prev);
|
|
163
|
+
nextBtn.addEventListener('click', next);
|
|
164
|
+
|
|
165
|
+
root.tabIndex = 0;
|
|
166
|
+
root.addEventListener('keydown', (ev) => {
|
|
167
|
+
if (ev.key === ' ' || ev.code === 'Space') {
|
|
168
|
+
ev.preventDefault();
|
|
169
|
+
flip();
|
|
170
|
+
} else if (ev.key === 'ArrowLeft') {
|
|
171
|
+
prev();
|
|
172
|
+
} else if (ev.key === 'ArrowRight') {
|
|
173
|
+
next();
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
update();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function init() {
|
|
181
|
+
const containers = document.querySelectorAll('.flashcards-container');
|
|
182
|
+
containers.forEach((c) => {
|
|
183
|
+
try {
|
|
184
|
+
const script = c.querySelector('.flashcards-data');
|
|
185
|
+
const raw = script && script.textContent ? script.textContent : c.getAttribute('data-config') || '{}';
|
|
186
|
+
const cfg = JSON.parse(raw);
|
|
187
|
+
createFlashcards(c, cfg);
|
|
188
|
+
} catch (e) {
|
|
189
|
+
console.error('flashcards: init failed', e);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (document.readyState === 'loading') {
|
|
195
|
+
document.addEventListener('DOMContentLoaded', init);
|
|
196
|
+
} else {
|
|
197
|
+
init();
|
|
198
|
+
}
|
|
199
|
+
})();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
function setupGeogebra(containerId, options) {
|
|
2
|
+
options.id = containerId + '-applet'; // Ensure unique ID for each applet
|
|
3
|
+
|
|
4
|
+
var applet = new GGBApplet(options, true); // 'true' for using HTML5
|
|
5
|
+
applet.inject(containerId); // This injects the applet into the container
|
|
6
|
+
}
|