scorm-again 1.7.1 → 2.0.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/.babelrc +18 -7
- package/.github/dependabot.yml +5 -0
- package/.github/workflows/main.yml +79 -0
- package/.jsdoc.json +4 -5
- package/.mocharc.json +8 -0
- package/.run/Mocha Unit Tests.run.xml +5 -2
- package/CONTRIBUTING.md +1 -1
- package/README.md +14 -1
- package/dist/aicc.js +3661 -7170
- package/dist/aicc.js.map +1 -1
- package/dist/aicc.min.js +2 -40
- package/dist/aicc.min.js.map +1 -0
- package/dist/scorm-again.js +5671 -10695
- package/dist/scorm-again.js.map +1 -1
- package/dist/scorm-again.min.js +2 -52
- package/dist/scorm-again.min.js.map +1 -0
- package/dist/scorm12.js +2871 -5433
- package/dist/scorm12.js.map +1 -1
- package/dist/scorm12.min.js +2 -34
- package/dist/scorm12.min.js.map +1 -0
- package/dist/scorm2004.js +3868 -6797
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +2 -40
- package/dist/scorm2004.min.js.map +1 -0
- package/eslint.config.js +21 -0
- package/package.json +72 -34
- package/results.json +34254 -0
- package/src/{AICC.js → AICC.ts} +27 -21
- package/src/BaseAPI.ts +1449 -0
- package/src/Scorm12API.ts +360 -0
- package/src/{Scorm2004API.js → Scorm2004API.ts} +245 -163
- package/src/cmi/aicc_cmi.ts +1248 -0
- package/src/cmi/common.ts +411 -0
- package/src/cmi/scorm12_cmi.ts +1426 -0
- package/src/cmi/scorm2004_cmi.ts +1874 -0
- package/src/constants/api_constants.ts +318 -0
- package/src/constants/error_codes.ts +88 -0
- package/src/constants/language_constants.ts +394 -0
- package/src/constants/regex.ts +97 -0
- package/src/constants/{response_constants.js → response_constants.ts} +67 -62
- package/src/exceptions.ts +133 -0
- package/src/exports/aicc.js +1 -1
- package/src/exports/scorm-again.js +3 -3
- package/src/exports/scorm12.js +1 -1
- package/src/exports/scorm2004.js +1 -1
- package/src/{utilities.js → utilities.ts} +114 -74
- package/tea.yaml +6 -0
- package/test/{AICC.spec.js → AICC.spec.ts} +70 -72
- package/test/Scorm12API.spec.ts +580 -0
- package/test/Scorm2004API.spec.ts +812 -0
- package/test/api_helpers.ts +176 -0
- package/test/cmi/{aicc_cmi.spec.js → aicc_cmi.spec.ts} +193 -209
- package/test/cmi/{scorm12_cmi.spec.js → scorm12_cmi.spec.ts} +251 -269
- package/test/cmi/scorm2004_cmi.spec.ts +1031 -0
- package/test/cmi_helpers.ts +207 -0
- package/test/exceptions.spec.ts +79 -0
- package/test/field_values.ts +202 -0
- package/test/utilities.spec.ts +322 -0
- package/tsconfig.json +18 -0
- package/webpack.config.js +65 -0
- package/.circleci/config.yml +0 -99
- package/.codeclimate.yml +0 -7
- package/.eslintrc.js +0 -36
- package/src/.flowconfig +0 -11
- package/src/BaseAPI.js +0 -1275
- package/src/Scorm12API.js +0 -308
- package/src/cmi/aicc_cmi.js +0 -1141
- package/src/cmi/common.js +0 -328
- package/src/cmi/scorm12_cmi.js +0 -1312
- package/src/cmi/scorm2004_cmi.js +0 -1692
- package/src/constants/api_constants.js +0 -218
- package/src/constants/error_codes.js +0 -87
- package/src/constants/language_constants.js +0 -76
- package/src/constants/regex.js +0 -84
- package/src/exceptions.js +0 -104
- package/test/Scorm12API.spec.js +0 -528
- package/test/Scorm2004API.spec.js +0 -775
- package/test/abstract_classes.spec.js +0 -17
- package/test/api_helpers.js +0 -128
- package/test/cmi/scorm2004_cmi.spec.js +0 -1066
- package/test/cmi_helpers.js +0 -161
- package/test/exceptions.spec.js +0 -71
- package/test/field_values.js +0 -353
- package/test/utilities.spec.js +0 -339
- package/webpack.js +0 -78
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
const ValidLanguages: string[] = [
|
|
2
|
+
"aa",
|
|
3
|
+
"ab",
|
|
4
|
+
"ae",
|
|
5
|
+
"af",
|
|
6
|
+
"ak",
|
|
7
|
+
"am",
|
|
8
|
+
"an",
|
|
9
|
+
"ar",
|
|
10
|
+
"as",
|
|
11
|
+
"av",
|
|
12
|
+
"ay",
|
|
13
|
+
"az",
|
|
14
|
+
"ba",
|
|
15
|
+
"be",
|
|
16
|
+
"bg",
|
|
17
|
+
"bh",
|
|
18
|
+
"bi",
|
|
19
|
+
"bm",
|
|
20
|
+
"bn",
|
|
21
|
+
"bo",
|
|
22
|
+
"br",
|
|
23
|
+
"bs",
|
|
24
|
+
"ca",
|
|
25
|
+
"ce",
|
|
26
|
+
"ch",
|
|
27
|
+
"co",
|
|
28
|
+
"cr",
|
|
29
|
+
"cs",
|
|
30
|
+
"cu",
|
|
31
|
+
"cv",
|
|
32
|
+
"cy",
|
|
33
|
+
"da",
|
|
34
|
+
"de",
|
|
35
|
+
"dv",
|
|
36
|
+
"dz",
|
|
37
|
+
"ee",
|
|
38
|
+
"el",
|
|
39
|
+
"en",
|
|
40
|
+
"eo",
|
|
41
|
+
"es",
|
|
42
|
+
"et",
|
|
43
|
+
"eu",
|
|
44
|
+
"fa",
|
|
45
|
+
"ff",
|
|
46
|
+
"fi",
|
|
47
|
+
"fj",
|
|
48
|
+
"fo",
|
|
49
|
+
"fr",
|
|
50
|
+
"fy",
|
|
51
|
+
"ga",
|
|
52
|
+
"gd",
|
|
53
|
+
"gl",
|
|
54
|
+
"gn",
|
|
55
|
+
"gu",
|
|
56
|
+
"gv",
|
|
57
|
+
"ha",
|
|
58
|
+
"he",
|
|
59
|
+
"hi",
|
|
60
|
+
"ho",
|
|
61
|
+
"hr",
|
|
62
|
+
"ht",
|
|
63
|
+
"hu",
|
|
64
|
+
"hy",
|
|
65
|
+
"hz",
|
|
66
|
+
"ia",
|
|
67
|
+
"id",
|
|
68
|
+
"ie",
|
|
69
|
+
"ig",
|
|
70
|
+
"ii",
|
|
71
|
+
"ik",
|
|
72
|
+
"io",
|
|
73
|
+
"is",
|
|
74
|
+
"it",
|
|
75
|
+
"iu",
|
|
76
|
+
"ja",
|
|
77
|
+
"jv",
|
|
78
|
+
"ka",
|
|
79
|
+
"kg",
|
|
80
|
+
"ki",
|
|
81
|
+
"kj",
|
|
82
|
+
"kk",
|
|
83
|
+
"kl",
|
|
84
|
+
"km",
|
|
85
|
+
"kn",
|
|
86
|
+
"ko",
|
|
87
|
+
"kr",
|
|
88
|
+
"ks",
|
|
89
|
+
"ku",
|
|
90
|
+
"kv",
|
|
91
|
+
"kw",
|
|
92
|
+
"ky",
|
|
93
|
+
"la",
|
|
94
|
+
"lb",
|
|
95
|
+
"lg",
|
|
96
|
+
"li",
|
|
97
|
+
"ln",
|
|
98
|
+
"lo",
|
|
99
|
+
"lt",
|
|
100
|
+
"lu",
|
|
101
|
+
"lv",
|
|
102
|
+
"mg",
|
|
103
|
+
"mh",
|
|
104
|
+
"mi",
|
|
105
|
+
"mk",
|
|
106
|
+
"ml",
|
|
107
|
+
"mn",
|
|
108
|
+
"mo",
|
|
109
|
+
"mr",
|
|
110
|
+
"ms",
|
|
111
|
+
"mt",
|
|
112
|
+
"my",
|
|
113
|
+
"na",
|
|
114
|
+
"nb",
|
|
115
|
+
"nd",
|
|
116
|
+
"ne",
|
|
117
|
+
"ng",
|
|
118
|
+
"nl",
|
|
119
|
+
"nn",
|
|
120
|
+
"no",
|
|
121
|
+
"nr",
|
|
122
|
+
"nv",
|
|
123
|
+
"ny",
|
|
124
|
+
"oc",
|
|
125
|
+
"oj",
|
|
126
|
+
"om",
|
|
127
|
+
"or",
|
|
128
|
+
"os",
|
|
129
|
+
"pa",
|
|
130
|
+
"pi",
|
|
131
|
+
"pl",
|
|
132
|
+
"ps",
|
|
133
|
+
"pt",
|
|
134
|
+
"qu",
|
|
135
|
+
"rm",
|
|
136
|
+
"rn",
|
|
137
|
+
"ro",
|
|
138
|
+
"ru",
|
|
139
|
+
"rw",
|
|
140
|
+
"sa",
|
|
141
|
+
"sc",
|
|
142
|
+
"sd",
|
|
143
|
+
"se",
|
|
144
|
+
"sg",
|
|
145
|
+
"sh",
|
|
146
|
+
"si",
|
|
147
|
+
"sk",
|
|
148
|
+
"sl",
|
|
149
|
+
"sm",
|
|
150
|
+
"sn",
|
|
151
|
+
"so",
|
|
152
|
+
"sq",
|
|
153
|
+
"sr",
|
|
154
|
+
"ss",
|
|
155
|
+
"st",
|
|
156
|
+
"su",
|
|
157
|
+
"sv",
|
|
158
|
+
"sw",
|
|
159
|
+
"ta",
|
|
160
|
+
"te",
|
|
161
|
+
"tg",
|
|
162
|
+
"th",
|
|
163
|
+
"ti",
|
|
164
|
+
"tk",
|
|
165
|
+
"tl",
|
|
166
|
+
"tn",
|
|
167
|
+
"to",
|
|
168
|
+
"tr",
|
|
169
|
+
"ts",
|
|
170
|
+
"tt",
|
|
171
|
+
"tw",
|
|
172
|
+
"ty",
|
|
173
|
+
"ug",
|
|
174
|
+
"uk",
|
|
175
|
+
"ur",
|
|
176
|
+
"uz",
|
|
177
|
+
"ve",
|
|
178
|
+
"vi",
|
|
179
|
+
"vo",
|
|
180
|
+
"wa",
|
|
181
|
+
"wo",
|
|
182
|
+
"xh",
|
|
183
|
+
"yi",
|
|
184
|
+
"yo",
|
|
185
|
+
"za",
|
|
186
|
+
"zh",
|
|
187
|
+
"zu",
|
|
188
|
+
"aar",
|
|
189
|
+
"abk",
|
|
190
|
+
"ave",
|
|
191
|
+
"afr",
|
|
192
|
+
"aka",
|
|
193
|
+
"amh",
|
|
194
|
+
"arg",
|
|
195
|
+
"ara",
|
|
196
|
+
"asm",
|
|
197
|
+
"ava",
|
|
198
|
+
"aym",
|
|
199
|
+
"aze",
|
|
200
|
+
"bak",
|
|
201
|
+
"bel",
|
|
202
|
+
"bul",
|
|
203
|
+
"bih",
|
|
204
|
+
"bis",
|
|
205
|
+
"bam",
|
|
206
|
+
"ben",
|
|
207
|
+
"tib",
|
|
208
|
+
"bod",
|
|
209
|
+
"bre",
|
|
210
|
+
"bos",
|
|
211
|
+
"cat",
|
|
212
|
+
"che",
|
|
213
|
+
"cha",
|
|
214
|
+
"cos",
|
|
215
|
+
"cre",
|
|
216
|
+
"cze",
|
|
217
|
+
"ces",
|
|
218
|
+
"chu",
|
|
219
|
+
"chv",
|
|
220
|
+
"wel",
|
|
221
|
+
"cym",
|
|
222
|
+
"dan",
|
|
223
|
+
"ger",
|
|
224
|
+
"deu",
|
|
225
|
+
"div",
|
|
226
|
+
"dzo",
|
|
227
|
+
"ewe",
|
|
228
|
+
"gre",
|
|
229
|
+
"ell",
|
|
230
|
+
"eng",
|
|
231
|
+
"epo",
|
|
232
|
+
"spa",
|
|
233
|
+
"est",
|
|
234
|
+
"baq",
|
|
235
|
+
"eus",
|
|
236
|
+
"per",
|
|
237
|
+
"fas",
|
|
238
|
+
"ful",
|
|
239
|
+
"fin",
|
|
240
|
+
"fij",
|
|
241
|
+
"fao",
|
|
242
|
+
"fre",
|
|
243
|
+
"fra",
|
|
244
|
+
"fry",
|
|
245
|
+
"gle",
|
|
246
|
+
"gla",
|
|
247
|
+
"glg",
|
|
248
|
+
"grn",
|
|
249
|
+
"guj",
|
|
250
|
+
"glv",
|
|
251
|
+
"hau",
|
|
252
|
+
"heb",
|
|
253
|
+
"hin",
|
|
254
|
+
"hmo",
|
|
255
|
+
"hrv",
|
|
256
|
+
"hat",
|
|
257
|
+
"hun",
|
|
258
|
+
"arm",
|
|
259
|
+
"hye",
|
|
260
|
+
"her",
|
|
261
|
+
"ina",
|
|
262
|
+
"ind",
|
|
263
|
+
"ile",
|
|
264
|
+
"ibo",
|
|
265
|
+
"iii",
|
|
266
|
+
"ipk",
|
|
267
|
+
"ido",
|
|
268
|
+
"ice",
|
|
269
|
+
"isl",
|
|
270
|
+
"ita",
|
|
271
|
+
"iku",
|
|
272
|
+
"jpn",
|
|
273
|
+
"jav",
|
|
274
|
+
"geo",
|
|
275
|
+
"kat",
|
|
276
|
+
"kon",
|
|
277
|
+
"kik",
|
|
278
|
+
"kua",
|
|
279
|
+
"kaz",
|
|
280
|
+
"kal",
|
|
281
|
+
"khm",
|
|
282
|
+
"kan",
|
|
283
|
+
"kor",
|
|
284
|
+
"kau",
|
|
285
|
+
"kas",
|
|
286
|
+
"kur",
|
|
287
|
+
"kom",
|
|
288
|
+
"cor",
|
|
289
|
+
"kir",
|
|
290
|
+
"lat",
|
|
291
|
+
"ltz",
|
|
292
|
+
"lug",
|
|
293
|
+
"lim",
|
|
294
|
+
"lin",
|
|
295
|
+
"lao",
|
|
296
|
+
"lit",
|
|
297
|
+
"lub",
|
|
298
|
+
"lav",
|
|
299
|
+
"mlg",
|
|
300
|
+
"mah",
|
|
301
|
+
"mao",
|
|
302
|
+
"mri",
|
|
303
|
+
"mac",
|
|
304
|
+
"mkd",
|
|
305
|
+
"mal",
|
|
306
|
+
"mon",
|
|
307
|
+
"mol",
|
|
308
|
+
"mar",
|
|
309
|
+
"may",
|
|
310
|
+
"msa",
|
|
311
|
+
"mlt",
|
|
312
|
+
"bur",
|
|
313
|
+
"mya",
|
|
314
|
+
"nau",
|
|
315
|
+
"nob",
|
|
316
|
+
"nde",
|
|
317
|
+
"nep",
|
|
318
|
+
"ndo",
|
|
319
|
+
"dut",
|
|
320
|
+
"nld",
|
|
321
|
+
"nno",
|
|
322
|
+
"nor",
|
|
323
|
+
"nbl",
|
|
324
|
+
"nav",
|
|
325
|
+
"nya",
|
|
326
|
+
"oci",
|
|
327
|
+
"oji",
|
|
328
|
+
"orm",
|
|
329
|
+
"ori",
|
|
330
|
+
"oss",
|
|
331
|
+
"pan",
|
|
332
|
+
"pli",
|
|
333
|
+
"pol",
|
|
334
|
+
"pus",
|
|
335
|
+
"por",
|
|
336
|
+
"que",
|
|
337
|
+
"roh",
|
|
338
|
+
"run",
|
|
339
|
+
"rum",
|
|
340
|
+
"ron",
|
|
341
|
+
"rus",
|
|
342
|
+
"kin",
|
|
343
|
+
"san",
|
|
344
|
+
"srd",
|
|
345
|
+
"snd",
|
|
346
|
+
"sme",
|
|
347
|
+
"sag",
|
|
348
|
+
"slo",
|
|
349
|
+
"sin",
|
|
350
|
+
"slk",
|
|
351
|
+
"slv",
|
|
352
|
+
"smo",
|
|
353
|
+
"sna",
|
|
354
|
+
"som",
|
|
355
|
+
"alb",
|
|
356
|
+
"sqi",
|
|
357
|
+
"srp",
|
|
358
|
+
"ssw",
|
|
359
|
+
"sot",
|
|
360
|
+
"sun",
|
|
361
|
+
"swe",
|
|
362
|
+
"swa",
|
|
363
|
+
"tam",
|
|
364
|
+
"tel",
|
|
365
|
+
"tgk",
|
|
366
|
+
"tha",
|
|
367
|
+
"tir",
|
|
368
|
+
"tuk",
|
|
369
|
+
"tgl",
|
|
370
|
+
"tsn",
|
|
371
|
+
"ton",
|
|
372
|
+
"tur",
|
|
373
|
+
"tso",
|
|
374
|
+
"tat",
|
|
375
|
+
"twi",
|
|
376
|
+
"tah",
|
|
377
|
+
"uig",
|
|
378
|
+
"ukr",
|
|
379
|
+
"urd",
|
|
380
|
+
"uzb",
|
|
381
|
+
"ven",
|
|
382
|
+
"vie",
|
|
383
|
+
"vol",
|
|
384
|
+
"wln",
|
|
385
|
+
"wol",
|
|
386
|
+
"xho",
|
|
387
|
+
"yid",
|
|
388
|
+
"yor",
|
|
389
|
+
"zha",
|
|
390
|
+
"chi",
|
|
391
|
+
"zho",
|
|
392
|
+
"zul",
|
|
393
|
+
];
|
|
394
|
+
export default ValidLanguages;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const scorm12 = {
|
|
2
|
+
CMIString256: "^.{0,255}$",
|
|
3
|
+
CMIString4096: "^.{0,4096}$",
|
|
4
|
+
CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",
|
|
5
|
+
CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",
|
|
6
|
+
|
|
7
|
+
CMIInteger: "^\\d+$",
|
|
8
|
+
CMISInteger: "^-?([0-9]+)$",
|
|
9
|
+
CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$",
|
|
10
|
+
|
|
11
|
+
CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$",
|
|
12
|
+
CMIFeedback: "^.{0,255}$",
|
|
13
|
+
// This must be redefined
|
|
14
|
+
CMIIndex: "[._](\\d+).",
|
|
15
|
+
// Vocabulary Data Type Definition
|
|
16
|
+
CMIStatus: "^(passed|completed|failed|incomplete|browsed)$",
|
|
17
|
+
CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$",
|
|
18
|
+
CMIExit: "^(time-out|suspend|logout|)$",
|
|
19
|
+
CMIType:
|
|
20
|
+
"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",
|
|
21
|
+
CMIResult:
|
|
22
|
+
"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",
|
|
23
|
+
NAVEvent: "^(previous|continue)$",
|
|
24
|
+
// Data ranges
|
|
25
|
+
score_range: "0#100",
|
|
26
|
+
audio_range: "-1#100",
|
|
27
|
+
speed_range: "-100#100",
|
|
28
|
+
weighting_range: "-100#100",
|
|
29
|
+
text_range: "-1#1",
|
|
30
|
+
};
|
|
31
|
+
const aicc = {
|
|
32
|
+
...scorm12,
|
|
33
|
+
...{
|
|
34
|
+
CMIIdentifier: "^\\w{1,255}$",
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
const scorm2004 = {
|
|
38
|
+
CMIString200: "^[\\u0000-\\uFFFF]{0,200}$",
|
|
39
|
+
CMIString250: "^[\\u0000-\\uFFFF]{0,250}$",
|
|
40
|
+
CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$",
|
|
41
|
+
CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$",
|
|
42
|
+
CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$",
|
|
43
|
+
CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",
|
|
44
|
+
|
|
45
|
+
CMILangString250:
|
|
46
|
+
"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",
|
|
47
|
+
|
|
48
|
+
CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",
|
|
49
|
+
|
|
50
|
+
CMILangString250cr:
|
|
51
|
+
"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",
|
|
52
|
+
|
|
53
|
+
CMILangString4000:
|
|
54
|
+
"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",
|
|
55
|
+
|
|
56
|
+
CMITime:
|
|
57
|
+
"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",
|
|
58
|
+
CMITimespan:
|
|
59
|
+
"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",
|
|
60
|
+
CMIInteger: "^\\d+$",
|
|
61
|
+
CMISInteger: "^-?([0-9]+)$",
|
|
62
|
+
CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",
|
|
63
|
+
CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$",
|
|
64
|
+
CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$",
|
|
65
|
+
CMILongIdentifier:
|
|
66
|
+
"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",
|
|
67
|
+
// need to re-examine this
|
|
68
|
+
CMIFeedback: "^.*$",
|
|
69
|
+
// This must be redefined
|
|
70
|
+
CMIIndex: "[._](\\d+).",
|
|
71
|
+
CMIIndexStore: ".N(\\d+).",
|
|
72
|
+
// Vocabulary Data Type Definition
|
|
73
|
+
CMICStatus: "^(completed|incomplete|not attempted|unknown)$",
|
|
74
|
+
CMISStatus: "^(passed|failed|unknown)$",
|
|
75
|
+
CMIExit: "^(time-out|suspend|logout|normal)$",
|
|
76
|
+
CMIType:
|
|
77
|
+
"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",
|
|
78
|
+
CMIResult:
|
|
79
|
+
"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",
|
|
80
|
+
NAVEvent:
|
|
81
|
+
"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|{target=\\S{0,200}[a-zA-Z0-9]}choice|jump)$",
|
|
82
|
+
|
|
83
|
+
NAVBoolean: "^(unknown|true|false$)",
|
|
84
|
+
NAVTarget: "^(previous|continue|choice.{target=\\S{0,200}[a-zA-Z0-9]})$",
|
|
85
|
+
// Data ranges
|
|
86
|
+
scaled_range: "-1#1",
|
|
87
|
+
audio_range: "0#*",
|
|
88
|
+
speed_range: "0#*",
|
|
89
|
+
text_range: "-1#1",
|
|
90
|
+
progress_range: "0#1",
|
|
91
|
+
};
|
|
92
|
+
const Regex = {
|
|
93
|
+
aicc: aicc,
|
|
94
|
+
scorm12: scorm12,
|
|
95
|
+
scorm2004: scorm2004,
|
|
96
|
+
};
|
|
97
|
+
export default Regex;
|
|
@@ -1,151 +1,148 @@
|
|
|
1
|
-
|
|
2
|
-
import Regex from './regex';
|
|
1
|
+
import Regex from "./regex";
|
|
3
2
|
|
|
4
3
|
const scorm2004_regex = Regex.scorm2004;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
format: '^true$|^false$',
|
|
4
|
+
export const LearnerResponses: Responses = {
|
|
5
|
+
"true-false": {
|
|
6
|
+
format: "^true$|^false$",
|
|
9
7
|
max: 1,
|
|
10
|
-
delimiter:
|
|
8
|
+
delimiter: "",
|
|
11
9
|
unique: false,
|
|
12
10
|
},
|
|
13
|
-
|
|
11
|
+
choice: {
|
|
14
12
|
format: scorm2004_regex.CMILongIdentifier,
|
|
15
13
|
max: 36,
|
|
16
|
-
delimiter:
|
|
14
|
+
delimiter: "[,]",
|
|
17
15
|
unique: true,
|
|
18
16
|
},
|
|
19
|
-
|
|
17
|
+
"fill-in": {
|
|
20
18
|
format: scorm2004_regex.CMILangString250,
|
|
21
19
|
max: 10,
|
|
22
|
-
delimiter:
|
|
20
|
+
delimiter: "[,]",
|
|
23
21
|
unique: false,
|
|
24
22
|
},
|
|
25
|
-
|
|
23
|
+
"long-fill-in": {
|
|
26
24
|
format: scorm2004_regex.CMILangString4000,
|
|
27
25
|
max: 1,
|
|
28
|
-
delimiter:
|
|
26
|
+
delimiter: "",
|
|
29
27
|
unique: false,
|
|
30
28
|
},
|
|
31
|
-
|
|
29
|
+
matching: {
|
|
32
30
|
format: scorm2004_regex.CMIShortIdentifier,
|
|
33
31
|
format2: scorm2004_regex.CMIShortIdentifier,
|
|
34
32
|
max: 36,
|
|
35
|
-
delimiter:
|
|
36
|
-
delimiter2:
|
|
33
|
+
delimiter: "[,]",
|
|
34
|
+
delimiter2: "[.]",
|
|
37
35
|
unique: false,
|
|
38
36
|
},
|
|
39
|
-
|
|
40
|
-
format:
|
|
41
|
-
format2:
|
|
42
|
-
|
|
37
|
+
performance: {
|
|
38
|
+
format: "^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
39
|
+
format2:
|
|
40
|
+
scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
43
41
|
max: 250,
|
|
44
|
-
delimiter:
|
|
45
|
-
delimiter2:
|
|
42
|
+
delimiter: "[,]",
|
|
43
|
+
delimiter2: "[.]",
|
|
46
44
|
unique: false,
|
|
47
45
|
},
|
|
48
|
-
|
|
46
|
+
sequencing: {
|
|
49
47
|
format: scorm2004_regex.CMIShortIdentifier,
|
|
50
48
|
max: 36,
|
|
51
|
-
delimiter:
|
|
49
|
+
delimiter: "[,]",
|
|
52
50
|
unique: false,
|
|
53
51
|
},
|
|
54
|
-
|
|
52
|
+
likert: {
|
|
55
53
|
format: scorm2004_regex.CMIShortIdentifier,
|
|
56
54
|
max: 1,
|
|
57
|
-
delimiter:
|
|
55
|
+
delimiter: "",
|
|
58
56
|
unique: false,
|
|
59
57
|
},
|
|
60
|
-
|
|
58
|
+
numeric: {
|
|
61
59
|
format: scorm2004_regex.CMIDecimal,
|
|
62
60
|
max: 1,
|
|
63
|
-
delimiter:
|
|
61
|
+
delimiter: "",
|
|
64
62
|
unique: false,
|
|
65
63
|
},
|
|
66
|
-
|
|
64
|
+
other: {
|
|
67
65
|
format: scorm2004_regex.CMIString4000,
|
|
68
66
|
max: 1,
|
|
69
|
-
delimiter:
|
|
67
|
+
delimiter: "",
|
|
70
68
|
unique: false,
|
|
71
69
|
},
|
|
72
70
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
'true-false': {
|
|
71
|
+
export const CorrectResponses: Responses = {
|
|
72
|
+
"true-false": {
|
|
76
73
|
max: 1,
|
|
77
|
-
delimiter:
|
|
74
|
+
delimiter: "",
|
|
78
75
|
unique: false,
|
|
79
76
|
duplicate: false,
|
|
80
|
-
format:
|
|
77
|
+
format: "^true$|^false$",
|
|
81
78
|
limit: 1,
|
|
82
79
|
},
|
|
83
|
-
|
|
80
|
+
choice: {
|
|
84
81
|
max: 36,
|
|
85
|
-
delimiter:
|
|
82
|
+
delimiter: "[,]",
|
|
86
83
|
unique: true,
|
|
87
84
|
duplicate: false,
|
|
88
85
|
format: scorm2004_regex.CMILongIdentifier,
|
|
89
86
|
},
|
|
90
|
-
|
|
87
|
+
"fill-in": {
|
|
91
88
|
max: 10,
|
|
92
|
-
delimiter:
|
|
89
|
+
delimiter: "[,]",
|
|
93
90
|
unique: false,
|
|
94
91
|
duplicate: false,
|
|
95
92
|
format: scorm2004_regex.CMILangString250cr,
|
|
96
93
|
},
|
|
97
|
-
|
|
94
|
+
"long-fill-in": {
|
|
98
95
|
max: 1,
|
|
99
|
-
delimiter:
|
|
96
|
+
delimiter: "",
|
|
100
97
|
unique: false,
|
|
101
98
|
duplicate: true,
|
|
102
99
|
format: scorm2004_regex.CMILangString4000,
|
|
103
100
|
},
|
|
104
|
-
|
|
101
|
+
matching: {
|
|
105
102
|
max: 36,
|
|
106
|
-
delimiter:
|
|
107
|
-
delimiter2:
|
|
103
|
+
delimiter: "[,]",
|
|
104
|
+
delimiter2: "[.]",
|
|
108
105
|
unique: false,
|
|
109
106
|
duplicate: false,
|
|
110
107
|
format: scorm2004_regex.CMIShortIdentifier,
|
|
111
108
|
format2: scorm2004_regex.CMIShortIdentifier,
|
|
112
109
|
},
|
|
113
|
-
|
|
110
|
+
performance: {
|
|
114
111
|
max: 250,
|
|
115
|
-
delimiter:
|
|
116
|
-
delimiter2:
|
|
112
|
+
delimiter: "[,]",
|
|
113
|
+
delimiter2: "[.]",
|
|
117
114
|
unique: false,
|
|
118
115
|
duplicate: false,
|
|
119
|
-
format:
|
|
120
|
-
format2:
|
|
121
|
-
|
|
116
|
+
format: "^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
117
|
+
format2:
|
|
118
|
+
scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier,
|
|
122
119
|
},
|
|
123
|
-
|
|
120
|
+
sequencing: {
|
|
124
121
|
max: 36,
|
|
125
|
-
delimiter:
|
|
122
|
+
delimiter: "[,]",
|
|
126
123
|
unique: false,
|
|
127
124
|
duplicate: false,
|
|
128
125
|
format: scorm2004_regex.CMIShortIdentifier,
|
|
129
126
|
},
|
|
130
|
-
|
|
127
|
+
likert: {
|
|
131
128
|
max: 1,
|
|
132
|
-
delimiter:
|
|
129
|
+
delimiter: "",
|
|
133
130
|
unique: false,
|
|
134
131
|
duplicate: false,
|
|
135
132
|
format: scorm2004_regex.CMIShortIdentifier,
|
|
136
133
|
limit: 1,
|
|
137
134
|
},
|
|
138
|
-
|
|
135
|
+
numeric: {
|
|
139
136
|
max: 2,
|
|
140
|
-
delimiter:
|
|
137
|
+
delimiter: "[:]",
|
|
141
138
|
unique: false,
|
|
142
139
|
duplicate: false,
|
|
143
140
|
format: scorm2004_regex.CMIDecimal,
|
|
144
141
|
limit: 1,
|
|
145
142
|
},
|
|
146
|
-
|
|
143
|
+
other: {
|
|
147
144
|
max: 1,
|
|
148
|
-
delimiter:
|
|
145
|
+
delimiter: "",
|
|
149
146
|
unique: false,
|
|
150
147
|
duplicate: false,
|
|
151
148
|
format: scorm2004_regex.CMIString4000,
|
|
@@ -153,9 +150,17 @@ const correct = {
|
|
|
153
150
|
},
|
|
154
151
|
};
|
|
155
152
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
153
|
+
export type ResponseType = {
|
|
154
|
+
format: string;
|
|
155
|
+
max: number;
|
|
156
|
+
delimiter: string;
|
|
157
|
+
unique: boolean;
|
|
158
|
+
duplicate?: boolean;
|
|
159
|
+
format2?: string;
|
|
160
|
+
delimiter2?: string;
|
|
161
|
+
limit?: number;
|
|
159
162
|
};
|
|
160
163
|
|
|
161
|
-
export
|
|
164
|
+
export type Responses = {
|
|
165
|
+
[key: string]: ResponseType;
|
|
166
|
+
};
|