@newtonschool/react_proctoring_library 0.0.108 → 0.0.110
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.
|
@@ -24,7 +24,10 @@ const OpenHeimdall = _ref => {
|
|
|
24
24
|
const {
|
|
25
25
|
permissionSetter,
|
|
26
26
|
setPermissionErrors,
|
|
27
|
-
|
|
27
|
+
downloadHeimdallUrl,
|
|
28
|
+
endTimeStamp,
|
|
29
|
+
setShouldShowDownloadHeimdallButton,
|
|
30
|
+
setIsHeimdallSuccessfullyInstalledByScript
|
|
28
31
|
} = (0, _react.useContext)(proctoredContext);
|
|
29
32
|
(0, _react.useEffect)(() => {
|
|
30
33
|
if (endTimeStamp) {
|
|
@@ -39,8 +42,26 @@ const OpenHeimdall = _ref => {
|
|
|
39
42
|
(0, _react.useEffect)(() => {
|
|
40
43
|
setAskPermissionAction(oldAskPermissionAction => _objectSpread(_objectSpread({}, oldAskPermissionAction), {}, {
|
|
41
44
|
openHeimdall: async () => {
|
|
42
|
-
await window.electron.
|
|
43
|
-
|
|
45
|
+
const streams = await window.electron.streams.getScreenStream();
|
|
46
|
+
if (streams.length > 1) {
|
|
47
|
+
setPermissionErrors(oldErrors => _objectSpread(_objectSpread({}, oldErrors), {}, {
|
|
48
|
+
openHeimdall: 'Multiple Screens found. Please use only one during proctoring'
|
|
49
|
+
}));
|
|
50
|
+
} else {
|
|
51
|
+
await window.electron.actions.openHeimdall();
|
|
52
|
+
window.electron.actions.sendFileUploadConfig(config.fileUploadConfig);
|
|
53
|
+
setPermissionErrors(oldErrors => _objectSpread(_objectSpread({}, oldErrors), {}, {
|
|
54
|
+
openHeimdall: null
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
downloadHeimdall: async () => {
|
|
59
|
+
if (downloadHeimdallUrl.current) {
|
|
60
|
+
const res = await window.electron.actions.downloadHeimdall(downloadHeimdallUrl.current);
|
|
61
|
+
if (res.success) {
|
|
62
|
+
setIsHeimdallSuccessfullyInstalledByScript(true);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
44
65
|
}
|
|
45
66
|
}));
|
|
46
67
|
window.electron.actions.onHeimdallStatusChange(status => {
|
|
@@ -56,6 +77,9 @@ const OpenHeimdall = _ref => {
|
|
|
56
77
|
console.log(error);
|
|
57
78
|
}
|
|
58
79
|
});
|
|
80
|
+
window.electron.checkIsHeimdallInstalled().then(isInstalled => {
|
|
81
|
+
setShouldShowDownloadHeimdallButton(!isInstalled);
|
|
82
|
+
});
|
|
59
83
|
}, []);
|
|
60
84
|
return null;
|
|
61
85
|
};
|
|
@@ -39,6 +39,9 @@ const ProctoredContextApp = _ref => {
|
|
|
39
39
|
const [screenShareDeviceId, setScreenShareDeviceId] = (0, _react.useState)();
|
|
40
40
|
const [audioPermisison, setAudioPermission] = (0, _react.useState)();
|
|
41
41
|
const [videoPermission, setVideoPermission] = (0, _react.useState)();
|
|
42
|
+
const [shouldShowDownloadHeimdallButton, setShouldShowDownloadHeimdallButton] = (0, _react.useState)(false);
|
|
43
|
+
const [isHeimdallSuccessfullyInstalledByScript, setIsHeimdallSuccessfullyInstalledByScript] = (0, _react.useState)(false);
|
|
44
|
+
const downloadHeimdallUrl = (0, _react.useRef)(null);
|
|
42
45
|
const allPermissionGrantedOnce = (0, _react.useRef)(false);
|
|
43
46
|
const [permissionErrors, setPermissionErrors] = (0, _react.useState)({
|
|
44
47
|
audio: null,
|
|
@@ -97,7 +100,12 @@ const ProctoredContextApp = _ref => {
|
|
|
97
100
|
screenshareReference
|
|
98
101
|
},
|
|
99
102
|
screenshareStream,
|
|
100
|
-
forceUpdate
|
|
103
|
+
forceUpdate,
|
|
104
|
+
shouldShowDownloadHeimdallButton,
|
|
105
|
+
setShouldShowDownloadHeimdallButton,
|
|
106
|
+
isHeimdallSuccessfullyInstalledByScript,
|
|
107
|
+
setIsHeimdallSuccessfullyInstalledByScript,
|
|
108
|
+
downloadHeimdallUrl
|
|
101
109
|
}),
|
|
102
110
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ElectronContext.ElectronContextProvider, {
|
|
103
111
|
value: isElectronApp,
|
|
@@ -44,7 +44,8 @@ const proctorParamsToPermission = exports.proctorParamsToPermission = {
|
|
|
44
44
|
webcamSnapshots: 'video',
|
|
45
45
|
screenshareSnapshots: 'screenshare',
|
|
46
46
|
audio: 'audio',
|
|
47
|
-
openHeimdall: 'openHeimdall'
|
|
47
|
+
openHeimdall: 'openHeimdall',
|
|
48
|
+
downloadHeimdall: 'downloadHeimdall'
|
|
48
49
|
};
|
|
49
50
|
const evaluateVideoIntervalInSeconds = exports.evaluateVideoIntervalInSeconds = 5;
|
|
50
51
|
const gpuTypes = exports.gpuTypes = ['intel', 'apple', 'amd', 'radeon', 'nvidia', 'geforce'];
|