@newtonschool/react_proctoring_library 0.0.107 → 0.0.109
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) {
|
|
@@ -41,6 +44,14 @@ const OpenHeimdall = _ref => {
|
|
|
41
44
|
openHeimdall: async () => {
|
|
42
45
|
await window.electron.actions.openHeimdall();
|
|
43
46
|
window.electron.actions.sendFileUploadConfig(config.fileUploadConfig);
|
|
47
|
+
},
|
|
48
|
+
downloadHeimdall: async () => {
|
|
49
|
+
if (downloadHeimdallUrl.current) {
|
|
50
|
+
const res = await window.electron.actions.downloadHeimdall(downloadHeimdallUrl.current);
|
|
51
|
+
if (res.success) {
|
|
52
|
+
setIsHeimdallSuccessfullyInstalledByScript(true);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
44
55
|
}
|
|
45
56
|
}));
|
|
46
57
|
window.electron.actions.onHeimdallStatusChange(status => {
|
|
@@ -56,6 +67,9 @@ const OpenHeimdall = _ref => {
|
|
|
56
67
|
console.log(error);
|
|
57
68
|
}
|
|
58
69
|
});
|
|
70
|
+
window.electron.checkIsHeimdallInstalled().then(isInstalled => {
|
|
71
|
+
setShouldShowDownloadHeimdallButton(!isInstalled);
|
|
72
|
+
});
|
|
59
73
|
}, []);
|
|
60
74
|
return null;
|
|
61
75
|
};
|
|
@@ -24,6 +24,7 @@ var _useGenericWakeUpLock = _interopRequireDefault(require("../../hooks/useGener
|
|
|
24
24
|
var _breachParameters = _interopRequireDefault(require("../breach-parameters"));
|
|
25
25
|
var _permission = require("../../utils/permission");
|
|
26
26
|
var _OpenHeimdall = require("../OpenHeimdall");
|
|
27
|
+
var _ElectronContext = require("../../contexts/ElectronContext");
|
|
27
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
29
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
30
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
@@ -46,10 +47,10 @@ const ProctorApp = _ref => {
|
|
|
46
47
|
logger = () => {}
|
|
47
48
|
} = _ref;
|
|
48
49
|
const context = (0, _react.useContext)(proctoredContext);
|
|
50
|
+
const isElectronApp = (0, _react.useContext)(_ElectronContext.ElectronContext);
|
|
49
51
|
const {
|
|
50
52
|
permissions,
|
|
51
53
|
references,
|
|
52
|
-
isElectronApp,
|
|
53
54
|
permissionErrors,
|
|
54
55
|
allPermissionGrantedOnce
|
|
55
56
|
} = context;
|
|
@@ -62,7 +63,8 @@ const ProctorApp = _ref => {
|
|
|
62
63
|
fullscreen: () => {},
|
|
63
64
|
video: () => {},
|
|
64
65
|
audio: () => {},
|
|
65
|
-
openHeimdall: () => {}
|
|
66
|
+
openHeimdall: () => {},
|
|
67
|
+
downloadHeimdall: () => {}
|
|
66
68
|
});
|
|
67
69
|
(0, _react.useEffect)(() => {
|
|
68
70
|
acquireWakeUpLock();
|
|
@@ -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'];
|