@newtonschool/react_proctoring_library 0.0.115 → 0.0.117
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.
|
@@ -35,31 +35,31 @@ const OpenHeimdall = _ref => {
|
|
|
35
35
|
}, [config]);
|
|
36
36
|
(0, _react.useEffect)(() => {
|
|
37
37
|
if (endTimeStamp) {
|
|
38
|
-
var _window$electron$acti2;
|
|
39
|
-
(_window$electron$acti2 = window.electron.actions) === null || _window$electron$acti2 === void 0 ? void 0 : _window$electron$acti2.
|
|
38
|
+
var _window$electron$acti2, _window$electron$acti3;
|
|
39
|
+
(_window$electron$acti2 = (_window$electron$acti3 = window.electron.actions).sendExamMappingDetails) === null || _window$electron$acti2 === void 0 ? void 0 : _window$electron$acti2.call(_window$electron$acti3, {
|
|
40
40
|
endTimeStamp
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
}, [endTimeStamp]);
|
|
44
44
|
(0, _react.useEffect)(() => {
|
|
45
|
-
var _window$electron$
|
|
45
|
+
var _window$electron$acti0, _window$electron$acti1, _window$electron$chec, _window$electron;
|
|
46
46
|
setAskPermissionAction(oldAskPermissionAction => _objectSpread(_objectSpread({}, oldAskPermissionAction), {}, {
|
|
47
47
|
openHeimdall: async () => {
|
|
48
|
-
var _window$electron$
|
|
49
|
-
await ((_window$electron$
|
|
50
|
-
(_window$electron$
|
|
48
|
+
var _window$electron$acti4, _window$electron$acti5, _window$electron$acti6, _window$electron$acti7;
|
|
49
|
+
await ((_window$electron$acti4 = (_window$electron$acti5 = window.electron.actions).openHeimdall) === null || _window$electron$acti4 === void 0 ? void 0 : _window$electron$acti4.call(_window$electron$acti5));
|
|
50
|
+
(_window$electron$acti6 = (_window$electron$acti7 = window.electron.actions).sendFileUploadConfig) === null || _window$electron$acti6 === void 0 ? void 0 : _window$electron$acti6.call(_window$electron$acti7, config.fileUploadConfig);
|
|
51
51
|
},
|
|
52
52
|
downloadHeimdall: async () => {
|
|
53
53
|
if (downloadHeimdallUrl.current) {
|
|
54
|
-
var _window$electron$
|
|
55
|
-
const res = await ((_window$electron$
|
|
54
|
+
var _window$electron$acti8, _window$electron$acti9;
|
|
55
|
+
const res = await ((_window$electron$acti8 = (_window$electron$acti9 = window.electron.actions).downloadHeimdall) === null || _window$electron$acti8 === void 0 ? void 0 : _window$electron$acti8.call(_window$electron$acti9, downloadHeimdallUrl.current));
|
|
56
56
|
if (res.success) {
|
|
57
57
|
setIsHeimdallSuccessfullyInstalledByScript(true);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}));
|
|
62
|
-
(_window$electron$
|
|
62
|
+
(_window$electron$acti0 = (_window$electron$acti1 = window.electron.actions).onHeimdallStatusChange) === null || _window$electron$acti0 === void 0 ? void 0 : _window$electron$acti0.call(_window$electron$acti1, status => {
|
|
63
63
|
try {
|
|
64
64
|
permissionSetter.setOpenHeimdallAppPermission(status);
|
|
65
65
|
setPermissionErrors(oldErrors => _objectSpread(_objectSpread({}, oldErrors), {}, {
|
|
@@ -72,7 +72,7 @@ const OpenHeimdall = _ref => {
|
|
|
72
72
|
console.log(error);
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
|
-
window.electron.checkIsHeimdallInstalled().then(isInstalled => {
|
|
75
|
+
(_window$electron$chec = (_window$electron = window.electron).checkIsHeimdallInstalled) === null || _window$electron$chec === void 0 ? void 0 : _window$electron$chec.call(_window$electron).then(isInstalled => {
|
|
76
76
|
setShouldShowDownloadHeimdallButton(!isInstalled);
|
|
77
77
|
});
|
|
78
78
|
}, []);
|
|
@@ -84,7 +84,7 @@ function ElectronScreenShare(_ref) {
|
|
|
84
84
|
};
|
|
85
85
|
const screenShareConfig = config === null || config === void 0 ? void 0 : (_config$fileUploadCon = config.fileUploadConfig) === null || _config$fileUploadCon === void 0 ? void 0 : _config$fileUploadCon.screenShare;
|
|
86
86
|
(0, _react.useEffect)(() => {
|
|
87
|
-
if (streamDeviceId
|
|
87
|
+
if (streamDeviceId) {
|
|
88
88
|
const snapshotIntervalID = startScreenShareSnapshot(streamDeviceId);
|
|
89
89
|
return () => {
|
|
90
90
|
endScreenShareSnapshot(snapshotIntervalID);
|
|
@@ -27,10 +27,10 @@ const getMacBookDevice = function getMacBookDevice() {
|
|
|
27
27
|
if (!devices) {
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return
|
|
30
|
+
// supports Apple Silicon macbook camera only
|
|
31
|
+
const macbookCamera = devices.find(device => device.label.includes('MacBook Pro Camera') || device.label.includes('MacBook Air Camera'));
|
|
32
|
+
console.log('macbookCamera label', macbookCamera.label);
|
|
33
|
+
return macbookCamera;
|
|
34
34
|
};
|
|
35
35
|
function ElectronWebCam(_ref) {
|
|
36
36
|
let {
|
|
@@ -85,7 +85,7 @@ const useTrackBreachParameters = _ref => {
|
|
|
85
85
|
sendProctoredParamValues(true, breachData.breachedParam, breachDetails);
|
|
86
86
|
if (isElectronApp) {
|
|
87
87
|
var _window$electron$acti, _window$electron$acti2;
|
|
88
|
-
//
|
|
88
|
+
// snapshots are captured when there is a breach
|
|
89
89
|
if ((_window$electron$acti = window.electron.actions) !== null && _window$electron$acti !== void 0 && _window$electron$acti.captureAndSendSnapshot) {
|
|
90
90
|
window.electron.actions.captureAndSendSnapshot({});
|
|
91
91
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newtonschool/react_proctoring_library",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.117",
|
|
4
4
|
"description": "Used to proctor online tests",
|
|
5
5
|
"author": "ayushkagrawal,shreyachandra,weastel",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -57,4 +57,4 @@
|
|
|
57
57
|
".": "./dist/index.js",
|
|
58
58
|
"./useCleanupPermissions": "./dist/useCleanupPermissions.js"
|
|
59
59
|
}
|
|
60
|
-
}
|
|
60
|
+
}
|