jclic 2.2.0 → 2.3.0
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/README.md +5 -7
- package/dist-node/jclic-node.js +14157 -0
- package/dist-node/jclic-node.umd.cjs +530 -0
- package/package.json +38 -26
- package/.vscode/launch.json +0 -33
- package/.vscode/settings.json +0 -13
- package/CHANGELOG.md +0 -664
- package/TRANSLATIONS.md +0 -11
- package/build-locales.mjs +0 -82
- package/dist/jclic-node.js +0 -31678
- package/dist/jclic-node.js.map +0 -1
- package/dist/jclic.components.LICENSE +0 -2254
- package/dist/jclic.min.js +0 -27
- package/dist/jclic.min.js.map +0 -1
- package/eslint.config.mjs +0 -31
- package/jsdoc.config.js +0 -71
- package/locales/ar.po +0 -244
- package/locales/ast.po +0 -246
- package/locales/bs.po +0 -247
- package/locales/ca.po +0 -248
- package/locales/ca_ES@valencia.po +0 -248
- package/locales/cs.po +0 -244
- package/locales/da.po +0 -244
- package/locales/de.po +0 -246
- package/locales/el.po +0 -244
- package/locales/es.po +0 -248
- package/locales/eu.po +0 -244
- package/locales/fr.po +0 -244
- package/locales/gl.po +0 -244
- package/locales/he.po +0 -244
- package/locales/hr.po +0 -245
- package/locales/it.po +0 -246
- package/locales/ja.po +0 -242
- package/locales/jclic.js.pot +0 -241
- package/locales/nb_NO.po +0 -244
- package/locales/nl.po +0 -244
- package/locales/pl.po +0 -244
- package/locales/pt.po +0 -244
- package/locales/pt_BR.po +0 -248
- package/locales/ro.po +0 -248
- package/locales/ru.po +0 -245
- package/locales/ta.po +0 -244
- package/locales/tr.po +0 -246
- package/locales/uk.po +0 -247
- package/locales/vec.po +0 -244
- package/locales/zh_TW.po +0 -246
- package/patches/po2json+1.0.0-beta-3.patch +0 -12
- package/src/AWT.js +0 -2067
- package/src/Activity.js +0 -1311
- package/src/Deps.js +0 -232
- package/src/GlobalData.js +0 -5
- package/src/JClic.js +0 -196
- package/src/JClicPlayer.js +0 -1308
- package/src/PlayerHistory.js +0 -305
- package/src/Utils.js +0 -1355
- package/src/activities/associations/ComplexAssociation.js +0 -321
- package/src/activities/associations/SimpleAssociation.js +0 -519
- package/src/activities/memory/MemoryGame.js +0 -423
- package/src/activities/panels/Explore.js +0 -349
- package/src/activities/panels/Identify.js +0 -356
- package/src/activities/panels/InformationScreen.js +0 -262
- package/src/activities/panels/Menu.js +0 -209
- package/src/activities/panels/icons/ico00.png +0 -0
- package/src/activities/panels/icons/ico01.png +0 -0
- package/src/activities/panels/icons/ico02.png +0 -0
- package/src/activities/panels/icons/ico03.png +0 -0
- package/src/activities/panels/icons/icofolder.png +0 -0
- package/src/activities/puzzles/DoublePuzzle.js +0 -424
- package/src/activities/puzzles/ExchangePuzzle.js +0 -374
- package/src/activities/puzzles/HolePuzzle.js +0 -360
- package/src/activities/text/Complete.js +0 -127
- package/src/activities/text/Evaluator.js +0 -534
- package/src/activities/text/FillInBlanks.js +0 -426
- package/src/activities/text/IdentifyText.js +0 -253
- package/src/activities/text/OrderText.js +0 -421
- package/src/activities/text/TextActivityBase.js +0 -557
- package/src/activities/text/TextActivityDocument.js +0 -658
- package/src/activities/text/WrittenAnswer.js +0 -557
- package/src/activities/textGrid/CrossWord.js +0 -565
- package/src/activities/textGrid/WordSearch.js +0 -458
- package/src/activities/textGrid/icons/hIcon.svg +0 -3
- package/src/activities/textGrid/icons/vIcon.svg +0 -3
- package/src/automation/AutoContentProvider.js +0 -182
- package/src/automation/arith/Arith.js +0 -864
- package/src/bags/ActivitySequence.js +0 -318
- package/src/bags/ActivitySequenceElement.js +0 -161
- package/src/bags/ActivitySequenceJump.js +0 -140
- package/src/bags/ConditionalJumpInfo.js +0 -113
- package/src/bags/JumpInfo.js +0 -136
- package/src/bags/MediaBag.js +0 -215
- package/src/bags/MediaBagElement.js +0 -516
- package/src/boxes/AbstractBox.js +0 -699
- package/src/boxes/ActiveBagContent.js +0 -494
- package/src/boxes/ActiveBox.js +0 -810
- package/src/boxes/ActiveBoxBag.js +0 -357
- package/src/boxes/ActiveBoxContent.js +0 -484
- package/src/boxes/ActiveBoxGrid.js +0 -179
- package/src/boxes/BoxBag.js +0 -500
- package/src/boxes/BoxBase.js +0 -398
- package/src/boxes/BoxConnector.js +0 -325
- package/src/boxes/TextGrid.js +0 -887
- package/src/boxes/TextGridContent.js +0 -215
- package/src/init-jsdom.js +0 -65
- package/src/jclic-node.js +0 -219
- package/src/media/ActiveMediaBag.js +0 -145
- package/src/media/ActiveMediaPlayer.js +0 -297
- package/src/media/AudioBuffer.js +0 -219
- package/src/media/EventSounds.js +0 -169
- package/src/media/EventSoundsElement.js +0 -155
- package/src/media/MediaContent.js +0 -328
- package/src/media/MidiAudioPlayer.js +0 -254
- package/src/media/icons/audio.svg +0 -3
- package/src/media/icons/generic.svg +0 -3
- package/src/media/icons/mic.svg +0 -3
- package/src/media/icons/movie.svg +0 -3
- package/src/media/icons/music.svg +0 -3
- package/src/media/icons/url.svg +0 -3
- package/src/media/sounds/actionError.mp3 +0 -0
- package/src/media/sounds/actionOk.mp3 +0 -0
- package/src/media/sounds/click.mp3 +0 -0
- package/src/media/sounds/finishedError.mp3 +0 -0
- package/src/media/sounds/finishedOk.mp3 +0 -0
- package/src/media/sounds/start.mp3 +0 -0
- package/src/project/JClicProject.js +0 -282
- package/src/project/ProjectSettings.js +0 -273
- package/src/report/ActionReg.js +0 -123
- package/src/report/ActivityReg.js +0 -271
- package/src/report/EncryptMin.js +0 -210
- package/src/report/Reporter.js +0 -727
- package/src/report/SCORM.js +0 -272
- package/src/report/SequenceReg.js +0 -275
- package/src/report/SessionReg.js +0 -340
- package/src/report/SessionStorageReporter.js +0 -131
- package/src/report/TCPReporter.js +0 -628
- package/src/shapers/ClassicJigSaw.js +0 -138
- package/src/shapers/Holes.js +0 -77
- package/src/shapers/JigSaw.js +0 -161
- package/src/shapers/Rectangular.js +0 -78
- package/src/shapers/Shaper.js +0 -386
- package/src/shapers/TriangularJigSaw.js +0 -121
- package/src/skins/BlueSkin.js +0 -80
- package/src/skins/Counter.js +0 -152
- package/src/skins/CustomSkin.js +0 -412
- package/src/skins/DefaultSkin.js +0 -376
- package/src/skins/EmptySkin.js +0 -82
- package/src/skins/GreenSkin.js +0 -94
- package/src/skins/MiniSkin.js +0 -130
- package/src/skins/OrangeSkin.js +0 -78
- package/src/skins/SimpleSkin.js +0 -92
- package/src/skins/Skin.js +0 -1021
- package/src/skins/assets/actionsIcon.svg +0 -3
- package/src/skins/assets/appLogo.svg +0 -8
- package/src/skins/assets/basic.css +0 -41
- package/src/skins/assets/closeDialogIcon.svg +0 -3
- package/src/skins/assets/closeIcon.svg +0 -3
- package/src/skins/assets/copyIcon.svg +0 -3
- package/src/skins/assets/fullScreenExitIcon.svg +0 -3
- package/src/skins/assets/fullScreenIcon.svg +0 -3
- package/src/skins/assets/infoIcon.svg +0 -3
- package/src/skins/assets/main.css +0 -43
- package/src/skins/assets/mainHalf.css +0 -23
- package/src/skins/assets/mainTwoThirds.css +0 -23
- package/src/skins/assets/mini.css +0 -15
- package/src/skins/assets/nextIcon.svg +0 -3
- package/src/skins/assets/okDialogIcon.svg +0 -3
- package/src/skins/assets/prevIcon.svg +0 -3
- package/src/skins/assets/reports.css +0 -156
- package/src/skins/assets/reportsIcon.svg +0 -3
- package/src/skins/assets/scoreIcon.svg +0 -3
- package/src/skins/assets/simple.css +0 -16
- package/src/skins/assets/simpleHalf.css +0 -11
- package/src/skins/assets/simpleTwoThirds.css +0 -11
- package/src/skins/assets/timeIcon.svg +0 -4
- package/src/skins/assets/waitAnim.css +0 -54
- package/src/skins/assets/waitImgBig.svg +0 -3
- package/src/skins/assets/waitImgSmall.svg +0 -3
- package/webpack.config.mjs +0 -169
package/src/report/EncryptMin.js
DELETED
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File : report/Encryption.js
|
|
3
|
-
* Created : 18/06/2015
|
|
4
|
-
* By : Francesc Busquets <francesc@gmail.com>
|
|
5
|
-
*
|
|
6
|
-
* JClic.js
|
|
7
|
-
* An HTML5 player of JClic activities
|
|
8
|
-
* https://projectestac.github.io/jclic.js
|
|
9
|
-
*
|
|
10
|
-
* @source https://github.com/projectestac/jclic.js
|
|
11
|
-
*
|
|
12
|
-
* @license EUPL-1.2
|
|
13
|
-
* @licstart
|
|
14
|
-
* (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
|
|
15
|
-
*
|
|
16
|
-
* Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
|
|
17
|
-
* the European Commission- subsequent versions of the EUPL (the "Licence");
|
|
18
|
-
* You may not use this work except in compliance with the Licence.
|
|
19
|
-
*
|
|
20
|
-
* You may obtain a copy of the Licence at:
|
|
21
|
-
* https://joinup.ec.europa.eu/software/page/eupl
|
|
22
|
-
*
|
|
23
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
24
|
-
* distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
|
|
25
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
26
|
-
* Licence for the specific language governing permissions and limitations
|
|
27
|
-
* under the Licence.
|
|
28
|
-
* @licend
|
|
29
|
-
* @module
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* Utilities to encrypt and decrypt strings using simple methods, just to avoid write
|
|
35
|
-
* passwords in plain text in data and configuration files. Do not use it as a
|
|
36
|
-
* secure cryptographic system!
|
|
37
|
-
*
|
|
38
|
-
* Based on {@link https://github.com/projectestac/jclic/blob/master/src/utilities/edu/xtec/util/Encryption.java Encryption}
|
|
39
|
-
* utilities, created by Albert Llastarri for {@link https://github.com/projectestac/jclic JClic}.
|
|
40
|
-
*
|
|
41
|
-
* IMPORTANT: This is a shortened version of Encryption with only the methods needed to decrypt
|
|
42
|
-
* stored passwords. Full version is on file `src/misc/encryption/Encryption.js`
|
|
43
|
-
*
|
|
44
|
-
* @abstract
|
|
45
|
-
*/
|
|
46
|
-
export class Encryption {
|
|
47
|
-
/**
|
|
48
|
-
* Decrypts the given code
|
|
49
|
-
* @param {string} txt - Code to be decrypted
|
|
50
|
-
* @returns {string}
|
|
51
|
-
*/
|
|
52
|
-
static Decrypt(txt) {
|
|
53
|
-
if (txt === null || txt.length === 0)
|
|
54
|
-
return null;
|
|
55
|
-
const s = Encryption.decodify(txt);
|
|
56
|
-
return s === Encryption.BLANK ? '' : s;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @param {string} cA (was char[])
|
|
61
|
-
* @param {number} fromIndex
|
|
62
|
-
* @returns {string} (was char)
|
|
63
|
-
*/
|
|
64
|
-
static hexCharArrayToChar(cA, fromIndex) {
|
|
65
|
-
let n = 0;
|
|
66
|
-
for (let i = 0; i <= 3; i++) {
|
|
67
|
-
const j = Number.parseInt(cA[fromIndex + i], 16);
|
|
68
|
-
if (isNaN(j))
|
|
69
|
-
throw 'Invalid expression!';
|
|
70
|
-
else
|
|
71
|
-
n = n * 16 + j;
|
|
72
|
-
}
|
|
73
|
-
return String.fromCharCode(n);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* @param {string} cA - (was char[])
|
|
78
|
-
* @param {number} fromIndex
|
|
79
|
-
* @returns {number}
|
|
80
|
-
*/
|
|
81
|
-
static hexCharArrayToInt(cA, fromIndex) {
|
|
82
|
-
let n = 0;
|
|
83
|
-
for (let i = 0; i <= 1; i++) {
|
|
84
|
-
const j = Number.parseInt(cA[fromIndex + i], 16);
|
|
85
|
-
if (isNaN(j))
|
|
86
|
-
throw 'Invalid expression!';
|
|
87
|
-
else
|
|
88
|
-
n = n * 16 + j;
|
|
89
|
-
}
|
|
90
|
-
return n;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* @param {string} cA - (was char[])
|
|
95
|
-
* @returns {string}
|
|
96
|
-
*/
|
|
97
|
-
static decodifyZerosField(cA) {
|
|
98
|
-
let
|
|
99
|
-
sb = '',
|
|
100
|
-
num = Number.parseInt(cA[0], 32),
|
|
101
|
-
k = 0,
|
|
102
|
-
i = 0;
|
|
103
|
-
|
|
104
|
-
for (i = 0; num !== 0; i++) {
|
|
105
|
-
while (num > 0) {
|
|
106
|
-
sb = sb + cA[i * 3 + 1] + cA[i * 3 + 2];
|
|
107
|
-
num--;
|
|
108
|
-
k++;
|
|
109
|
-
}
|
|
110
|
-
if (cA.length > i * 3 + 3)
|
|
111
|
-
num = Number.parseInt(cA[i * 3 + 3], 32);
|
|
112
|
-
else
|
|
113
|
-
num = 0;
|
|
114
|
-
}
|
|
115
|
-
for (let j = i * 3 + 1; j < cA.length; j++)
|
|
116
|
-
sb = sb + cA[j];
|
|
117
|
-
|
|
118
|
-
return Number.parseInt(k, 32) + sb;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* @param {string} cA - (was char[])
|
|
123
|
-
* @returns {string} (was StringBuilder)
|
|
124
|
-
*/
|
|
125
|
-
static decompressZeros(cA) {
|
|
126
|
-
cA = Encryption.decodifyZerosField(cA);
|
|
127
|
-
let
|
|
128
|
-
numBytesZeros = Number.parseInt(cA[0], 32),
|
|
129
|
-
iniNoZeros = numBytesZeros * 2 + 1,
|
|
130
|
-
bFi = false,
|
|
131
|
-
sb = '';
|
|
132
|
-
|
|
133
|
-
for (let i = 0; i < numBytesZeros && !bFi; i++) {
|
|
134
|
-
const zeros = Encryption.hexCharArrayToInt(cA, 1 + i * 2);
|
|
135
|
-
let s = zeros.toString(2);
|
|
136
|
-
while (s.length < 8)
|
|
137
|
-
s = '0' + s;
|
|
138
|
-
for (let j = 0; j <= 7 && !bFi; j++) {
|
|
139
|
-
if (s[j] === '1')
|
|
140
|
-
sb = sb + '0';
|
|
141
|
-
else if (iniNoZeros < cA.length)
|
|
142
|
-
sb = sb + cA[iniNoZeros++];
|
|
143
|
-
else
|
|
144
|
-
bFi = true;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return sb;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* @param {string} sb1 - (was StringBuilder)
|
|
152
|
-
* @returns {string}
|
|
153
|
-
*/
|
|
154
|
-
static decodifyFromHex(sb1) {
|
|
155
|
-
let sb = '', j = 0;
|
|
156
|
-
for (let i = 0; j < sb1.length; i++) {
|
|
157
|
-
const c = Encryption.hexCharArrayToChar(sb1, j);
|
|
158
|
-
sb = sb + c;
|
|
159
|
-
j += 4;
|
|
160
|
-
}
|
|
161
|
-
return sb;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* @param {string} s
|
|
166
|
-
* @returns {string} (was char[])
|
|
167
|
-
*/
|
|
168
|
-
static unchangeOrder(s) {
|
|
169
|
-
let m = 0, n = s.length - 1;
|
|
170
|
-
const cA = [];
|
|
171
|
-
for (let p = 0; p < s.length; p++)
|
|
172
|
-
cA[p] = '';
|
|
173
|
-
for (let i = 0; i < s.length; i++)
|
|
174
|
-
if (i % 2 === 0)
|
|
175
|
-
cA[i] = s[m++];
|
|
176
|
-
else
|
|
177
|
-
cA[i] = s[n--];
|
|
178
|
-
return cA.join('');
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* @param {string} word
|
|
183
|
-
* @returns {string}
|
|
184
|
-
*/
|
|
185
|
-
static codify(word) {
|
|
186
|
-
if (word.length > 24)
|
|
187
|
-
throw 'Password is too large!';
|
|
188
|
-
return Encryption.changeOrder(Encryption.compressZeros(Encryption.codifyToHexWord(word)));
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* @param {string} word
|
|
193
|
-
* @returns {string}
|
|
194
|
-
*/
|
|
195
|
-
static decodify(word) {
|
|
196
|
-
try {
|
|
197
|
-
return Encryption.decodifyFromHex(Encryption.decompressZeros(Encryption.unchangeOrder(word)));
|
|
198
|
-
} catch (_ex) { //The supplied word was not codified using this system
|
|
199
|
-
return '';
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Default bank password
|
|
206
|
-
* @type {string}
|
|
207
|
-
*/
|
|
208
|
-
Encryption.BLANK = '___blank___##';
|
|
209
|
-
|
|
210
|
-
export default Encryption;
|