easyproctor-hml 0.0.50 → 0.0.52
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 +15 -15
- package/index.js +15 -15
- package/package.json +1 -1
- package/plugins/mouseTracker.d.ts +15 -0
- package/unpkg/easyproctor.min.js +19 -19
- package/unpkg/easyproctor.min.js.map +0 -7
package/esm/index.js
CHANGED
|
@@ -15053,21 +15053,21 @@ async function checkPermissions() {
|
|
|
15053
15053
|
}
|
|
15054
15054
|
async function checkIfhasMultipleMonitors() {
|
|
15055
15055
|
return new Promise((resolve, reject) => {
|
|
15056
|
-
|
|
15057
|
-
|
|
15056
|
+
const checked = window.screen.isExtended;
|
|
15057
|
+
if (checked) {
|
|
15058
|
+
resolve(checked);
|
|
15059
|
+
} else {
|
|
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
|
+
}
|
|
15058
15070
|
}
|
|
15059
|
-
const presentationRequest = new PresentationRequest("receiver.html");
|
|
15060
|
-
presentationRequest.getAvailability().then((availability) => {
|
|
15061
|
-
console.log("availability.value");
|
|
15062
|
-
console.log(availability);
|
|
15063
|
-
let hasMultipleMonitors = availability.value;
|
|
15064
|
-
availability.addEventListener("change", function() {
|
|
15065
|
-
hasMultipleMonitors = availability.value;
|
|
15066
|
-
});
|
|
15067
|
-
setTimeout(() => {
|
|
15068
|
-
resolve(hasMultipleMonitors);
|
|
15069
|
-
}, 1e3);
|
|
15070
|
-
}).catch((error) => reject(error));
|
|
15071
15071
|
});
|
|
15072
15072
|
}
|
|
15073
15073
|
|
|
@@ -17470,7 +17470,7 @@ Setting: ${settings}`);
|
|
|
17470
17470
|
let imageFile;
|
|
17471
17471
|
this.configImageCapture();
|
|
17472
17472
|
this.imageInterval = setInterval(async () => {
|
|
17473
|
-
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);
|
|
17474
17474
|
const image_data_url = this.canvas.toDataURL("image/jpeg");
|
|
17475
17475
|
imageFile = await this.getFile(image_data_url, `${this.proctoringId}_${this.imageCount + 1}.jpg`, "image/jpeg");
|
|
17476
17476
|
if (imageFile && this.upload && this.backendToken) {
|
package/index.js
CHANGED
|
@@ -25773,21 +25773,21 @@ async function checkPermissions() {
|
|
|
25773
25773
|
}
|
|
25774
25774
|
async function checkIfhasMultipleMonitors() {
|
|
25775
25775
|
return new Promise((resolve, reject) => {
|
|
25776
|
-
|
|
25777
|
-
|
|
25776
|
+
const checked = window.screen.isExtended;
|
|
25777
|
+
if (checked) {
|
|
25778
|
+
resolve(checked);
|
|
25779
|
+
} else {
|
|
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
|
+
}
|
|
25778
25790
|
}
|
|
25779
|
-
const presentationRequest = new PresentationRequest("receiver.html");
|
|
25780
|
-
presentationRequest.getAvailability().then((availability) => {
|
|
25781
|
-
console.log("availability.value");
|
|
25782
|
-
console.log(availability);
|
|
25783
|
-
let hasMultipleMonitors = availability.value;
|
|
25784
|
-
availability.addEventListener("change", function() {
|
|
25785
|
-
hasMultipleMonitors = availability.value;
|
|
25786
|
-
});
|
|
25787
|
-
setTimeout(() => {
|
|
25788
|
-
resolve(hasMultipleMonitors);
|
|
25789
|
-
}, 1e3);
|
|
25790
|
-
}).catch((error) => reject(error));
|
|
25791
25791
|
});
|
|
25792
25792
|
}
|
|
25793
25793
|
|
|
@@ -29018,7 +29018,7 @@ Setting: ${settings}`);
|
|
|
29018
29018
|
let imageFile;
|
|
29019
29019
|
this.configImageCapture();
|
|
29020
29020
|
this.imageInterval = setInterval(async () => {
|
|
29021
|
-
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);
|
|
29022
29022
|
const image_data_url = this.canvas.toDataURL("image/jpeg");
|
|
29023
29023
|
imageFile = await this.getFile(image_data_url, `${this.proctoringId}_${this.imageCount + 1}.jpg`, "image/jpeg");
|
|
29024
29024
|
if (imageFile && this.upload && this.backendToken) {
|
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 {};
|