@digabi/exam-engine-rendering 23.15.1 → 23.15.2
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
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@digabi/exam-engine-rendering",
|
3
|
-
"version": "23.15.
|
3
|
+
"version": "23.15.2",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"license": "EUPL-1.1",
|
6
6
|
"files": [
|
@@ -13,7 +13,7 @@
|
|
13
13
|
"@babel/polyfill": "^7.8.7",
|
14
14
|
"@babel/preset-env": "^7.8.7",
|
15
15
|
"@babel/runtime": "^7.8.7",
|
16
|
-
"@digabi/exam-engine-core": "23.15.
|
16
|
+
"@digabi/exam-engine-core": "23.15.2",
|
17
17
|
"@fortawesome/fontawesome-svg-core": "^6.4.0",
|
18
18
|
"babel-loader": "^10.0.0",
|
19
19
|
"child-process-promise": "^2.2.1",
|
@@ -33,7 +33,7 @@
|
|
33
33
|
"react": "^18.2.0",
|
34
34
|
"react-dom": "^18.2.0",
|
35
35
|
"react-router5": "^8.0.1",
|
36
|
-
"rich-text-editor": "8.
|
36
|
+
"rich-text-editor": "8.10.0",
|
37
37
|
"router5": "^8.0.1",
|
38
38
|
"router5-plugin-browser": "^8.0.1",
|
39
39
|
"tmp-promise": "^3.0.2",
|
@@ -42,5 +42,5 @@
|
|
42
42
|
"webpack-dev-server": "^5.0.0",
|
43
43
|
"webpack-merge": "^6.0.1"
|
44
44
|
},
|
45
|
-
"gitHead": "
|
45
|
+
"gitHead": "e8ad6b9c4a85bd54e97efebf37b8329fbbdb1a39"
|
46
46
|
}
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import { ExamServerAPI } from '@digabi/exam-engine-core';
|
2
|
-
/** Creates a mock Exam Server API, backed by a local IndexedDB database. */
|
3
|
-
export default function indexedDBExamServerAPI(examUuid: string, resolveAttachment: (s: string) => string): ExamServerAPI;
|
4
|
-
//# sourceMappingURL=indexedDBExamServerAPI.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"indexedDBExamServerAPI.d.ts","sourceRoot":"","sources":["../../src/utils/indexedDBExamServerAPI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAGpE,4EAA4E;AAC5E,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,GACvC,aAAa,CAoEf"}
|
@@ -1,72 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.default = indexedDBExamServerAPI;
|
7
|
-
const dexie_1 = __importDefault(require("dexie"));
|
8
|
-
/** Creates a mock Exam Server API, backed by a local IndexedDB database. */
|
9
|
-
function indexedDBExamServerAPI(examUuid, resolveAttachment) {
|
10
|
-
const db = new (class extends dexie_1.default {
|
11
|
-
constructor() {
|
12
|
-
super('exam');
|
13
|
-
this.version(1).stores({
|
14
|
-
answer: '[examUuid+questionId], examUuid'
|
15
|
-
});
|
16
|
-
}
|
17
|
-
})();
|
18
|
-
// Emulate real exam restricted audio playback by playing the audio files in a
|
19
|
-
// HTML5 <audio> tag. The tag is made visible when starting playback and hidden
|
20
|
-
// when playback finishes.
|
21
|
-
const audioPlayer = new Audio();
|
22
|
-
audioPlayer.classList.add('audio-player');
|
23
|
-
audioPlayer.controls = true;
|
24
|
-
audioPlayer.onended = () => {
|
25
|
-
audioPlayer.classList.add('audio-player--animating');
|
26
|
-
audioPlayer.classList.remove('audio-player--visible');
|
27
|
-
};
|
28
|
-
const animationFinished = () => audioPlayer.classList.remove('audio-player--animating');
|
29
|
-
audioPlayer.addEventListener('transitionend', animationFinished);
|
30
|
-
audioPlayer.addEventListener('transitioncancel', animationFinished);
|
31
|
-
document.body.appendChild(audioPlayer);
|
32
|
-
const examServerApi = {
|
33
|
-
setCasStatus: casStatus => Promise.resolve(casStatus),
|
34
|
-
getAnswers: () => db.answer.where({ examUuid }).toArray(),
|
35
|
-
saveAnswer: async (answer) => {
|
36
|
-
await db.answer.put({ ...answer, examUuid });
|
37
|
-
},
|
38
|
-
async playAudio(src) {
|
39
|
-
audioPlayer.src = resolveAttachment(src);
|
40
|
-
try {
|
41
|
-
await audioPlayer.play();
|
42
|
-
audioPlayer.classList.add('audio-player--visible', 'audio-player--animating');
|
43
|
-
return 'ok';
|
44
|
-
}
|
45
|
-
catch (err) {
|
46
|
-
console.error(err);
|
47
|
-
return 'other-error';
|
48
|
-
}
|
49
|
-
},
|
50
|
-
async playRestrictedAudio(src) {
|
51
|
-
return examServerApi.playAudio(src);
|
52
|
-
},
|
53
|
-
getRestrictedAudio() {
|
54
|
-
throw new Error('other-error');
|
55
|
-
},
|
56
|
-
saveScreenshot(_, file) {
|
57
|
-
return new Promise((resolve, reject) => {
|
58
|
-
const reader = new FileReader();
|
59
|
-
reader.onload = () => {
|
60
|
-
resolve(String(reader.result));
|
61
|
-
};
|
62
|
-
reader.onerror = () => {
|
63
|
-
reader.abort();
|
64
|
-
reject(reader.error);
|
65
|
-
};
|
66
|
-
reader.readAsDataURL(file);
|
67
|
-
});
|
68
|
-
}
|
69
|
-
};
|
70
|
-
return examServerApi;
|
71
|
-
}
|
72
|
-
//# sourceMappingURL=indexedDBExamServerAPI.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"indexedDBExamServerAPI.js","sourceRoot":"","sources":["../../src/utils/indexedDBExamServerAPI.ts"],"names":[],"mappings":";;;;;AAIA,yCAuEC;AA1ED,kDAAyB;AAEzB,4EAA4E;AAC5E,SAAwB,sBAAsB,CAC5C,QAAgB,EAChB,iBAAwC;IAExC,MAAM,EAAE,GAAG,IAAI,C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