easyproctor 1.1.6 → 1.1.8
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/esm/index.js +22 -6
- package/index.js +22 -6
- package/new-flow/recorders/CameraRecorder.d.ts +1 -0
- package/package.json +1 -1
- package/plugins/mouseTracker.d.ts +15 -0
- package/unpkg/easyproctor.min.js +22 -22
- package/unpkg/easyproctor.min.js.map +2 -2
package/esm/index.js
CHANGED
|
@@ -15057,11 +15057,16 @@ async function checkIfhasMultipleMonitors() {
|
|
|
15057
15057
|
if (checked) {
|
|
15058
15058
|
resolve(checked);
|
|
15059
15059
|
} else {
|
|
15060
|
-
|
|
15061
|
-
|
|
15062
|
-
totalScreens =
|
|
15063
|
-
|
|
15064
|
-
|
|
15060
|
+
const isFirefox = navigator.userAgent.indexOf("Firefox") > -1;
|
|
15061
|
+
if (!isFirefox) {
|
|
15062
|
+
let totalScreens = [];
|
|
15063
|
+
window.getScreenDetails().then(function(details) {
|
|
15064
|
+
totalScreens = details;
|
|
15065
|
+
resolve(totalScreens.screens.length >= 2);
|
|
15066
|
+
});
|
|
15067
|
+
} else {
|
|
15068
|
+
resolve(false);
|
|
15069
|
+
}
|
|
15065
15070
|
}
|
|
15066
15071
|
});
|
|
15067
15072
|
}
|
|
@@ -17465,7 +17470,7 @@ Setting: ${settings}`);
|
|
|
17465
17470
|
let imageFile;
|
|
17466
17471
|
this.configImageCapture();
|
|
17467
17472
|
this.imageInterval = setInterval(async () => {
|
|
17468
|
-
this.canvas.getContext("2d").drawImage(this.video, 0, 0,
|
|
17473
|
+
this.canvas.getContext("2d").drawImage(this.video, 0, 0, this.videoOptions.width, this.videoOptions.height);
|
|
17469
17474
|
const image_data_url = this.canvas.toDataURL("image/jpeg");
|
|
17470
17475
|
imageFile = await this.getFile(image_data_url, `${this.proctoringId}_${this.imageCount + 1}.jpg`, "image/jpeg");
|
|
17471
17476
|
if (imageFile && this.upload && this.backendToken) {
|
|
@@ -17480,6 +17485,16 @@ Setting: ${settings}`);
|
|
|
17480
17485
|
}
|
|
17481
17486
|
}, this.imageParams.uploadInterval * 1e3);
|
|
17482
17487
|
}
|
|
17488
|
+
download(file) {
|
|
17489
|
+
const url = URL.createObjectURL(file);
|
|
17490
|
+
const a = document.createElement("a");
|
|
17491
|
+
document.body.appendChild(a);
|
|
17492
|
+
a.style.display = "none";
|
|
17493
|
+
a.href = url;
|
|
17494
|
+
a.download = file.name;
|
|
17495
|
+
a.click();
|
|
17496
|
+
window.URL.revokeObjectURL(url);
|
|
17497
|
+
}
|
|
17483
17498
|
async saveOnSession(session) {
|
|
17484
17499
|
const settings = this.cameraStream.getVideoTracks()[0].getSettings();
|
|
17485
17500
|
const settingsAudio = this.cameraStream.getAudioTracks()[0].getSettings();
|
|
@@ -17948,6 +17963,7 @@ var DeviceChecker = class {
|
|
|
17948
17963
|
divCamera.style.justifyContent = "space-between";
|
|
17949
17964
|
divCamera.style.borderBottom = "2px solid rgba(0, 0, 0, .1)";
|
|
17950
17965
|
divCamera.style.paddingBottom = "15px";
|
|
17966
|
+
divCamera.style.transform = "rotateY(180deg)";
|
|
17951
17967
|
video.style.width = "20rem";
|
|
17952
17968
|
video.style.backgroundColor = "#000";
|
|
17953
17969
|
video.style.borderRadius = "10px";
|
package/index.js
CHANGED
|
@@ -25777,11 +25777,16 @@ async function checkIfhasMultipleMonitors() {
|
|
|
25777
25777
|
if (checked) {
|
|
25778
25778
|
resolve(checked);
|
|
25779
25779
|
} else {
|
|
25780
|
-
|
|
25781
|
-
|
|
25782
|
-
totalScreens =
|
|
25783
|
-
|
|
25784
|
-
|
|
25780
|
+
const isFirefox = navigator.userAgent.indexOf("Firefox") > -1;
|
|
25781
|
+
if (!isFirefox) {
|
|
25782
|
+
let totalScreens = [];
|
|
25783
|
+
window.getScreenDetails().then(function(details) {
|
|
25784
|
+
totalScreens = details;
|
|
25785
|
+
resolve(totalScreens.screens.length >= 2);
|
|
25786
|
+
});
|
|
25787
|
+
} else {
|
|
25788
|
+
resolve(false);
|
|
25789
|
+
}
|
|
25785
25790
|
}
|
|
25786
25791
|
});
|
|
25787
25792
|
}
|
|
@@ -29013,7 +29018,7 @@ Setting: ${settings}`);
|
|
|
29013
29018
|
let imageFile;
|
|
29014
29019
|
this.configImageCapture();
|
|
29015
29020
|
this.imageInterval = setInterval(async () => {
|
|
29016
|
-
this.canvas.getContext("2d").drawImage(this.video, 0, 0,
|
|
29021
|
+
this.canvas.getContext("2d").drawImage(this.video, 0, 0, this.videoOptions.width, this.videoOptions.height);
|
|
29017
29022
|
const image_data_url = this.canvas.toDataURL("image/jpeg");
|
|
29018
29023
|
imageFile = await this.getFile(image_data_url, `${this.proctoringId}_${this.imageCount + 1}.jpg`, "image/jpeg");
|
|
29019
29024
|
if (imageFile && this.upload && this.backendToken) {
|
|
@@ -29028,6 +29033,16 @@ Setting: ${settings}`);
|
|
|
29028
29033
|
}
|
|
29029
29034
|
}, this.imageParams.uploadInterval * 1e3);
|
|
29030
29035
|
}
|
|
29036
|
+
download(file) {
|
|
29037
|
+
const url2 = URL.createObjectURL(file);
|
|
29038
|
+
const a = document.createElement("a");
|
|
29039
|
+
document.body.appendChild(a);
|
|
29040
|
+
a.style.display = "none";
|
|
29041
|
+
a.href = url2;
|
|
29042
|
+
a.download = file.name;
|
|
29043
|
+
a.click();
|
|
29044
|
+
window.URL.revokeObjectURL(url2);
|
|
29045
|
+
}
|
|
29031
29046
|
async saveOnSession(session) {
|
|
29032
29047
|
const settings = this.cameraStream.getVideoTracks()[0].getSettings();
|
|
29033
29048
|
const settingsAudio = this.cameraStream.getAudioTracks()[0].getSettings();
|
|
@@ -29496,6 +29511,7 @@ var DeviceChecker = class {
|
|
|
29496
29511
|
divCamera.style.justifyContent = "space-between";
|
|
29497
29512
|
divCamera.style.borderBottom = "2px solid rgba(0, 0, 0, .1)";
|
|
29498
29513
|
divCamera.style.paddingBottom = "15px";
|
|
29514
|
+
divCamera.style.transform = "rotateY(180deg)";
|
|
29499
29515
|
video.style.width = "20rem";
|
|
29500
29516
|
video.style.backgroundColor = "#000";
|
|
29501
29517
|
video.style.borderRadius = "10px";
|
|
@@ -43,6 +43,7 @@ export declare class CameraRecorder implements IRecorder {
|
|
|
43
43
|
pauseRecording(): Promise<void>;
|
|
44
44
|
resumeRecording(): Promise<void>;
|
|
45
45
|
photoShotsCycle(): void;
|
|
46
|
+
download(file: File): void;
|
|
46
47
|
saveOnSession(session: ProctoringSession): Promise<void>;
|
|
47
48
|
getFile(file: string, name: string, type: string): Promise<File>;
|
|
48
49
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BackendService } from "../new-flow/backend/BackendService";
|
|
2
|
+
interface mousePosition {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
export declare class MouseTracker {
|
|
7
|
+
backend: BackendService;
|
|
8
|
+
tracking: boolean;
|
|
9
|
+
mousePositions: mousePosition[];
|
|
10
|
+
constructor();
|
|
11
|
+
init(): void;
|
|
12
|
+
stop(): void;
|
|
13
|
+
send(): any;
|
|
14
|
+
}
|
|
15
|
+
export {};
|