@newtonschool/react_proctoring_library 0.0.105 → 0.0.107

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.
@@ -23,8 +23,19 @@ const OpenHeimdall = _ref => {
23
23
  } = _ref;
24
24
  const {
25
25
  permissionSetter,
26
- setPermissionErrors
26
+ setPermissionErrors,
27
+ endTimeStamp
27
28
  } = (0, _react.useContext)(proctoredContext);
29
+ (0, _react.useEffect)(() => {
30
+ if (endTimeStamp) {
31
+ var _window, _window$electron, _window$electron$acti;
32
+ if ((_window = window) !== null && _window !== void 0 && (_window$electron = _window.electron) !== null && _window$electron !== void 0 && (_window$electron$acti = _window$electron.actions) !== null && _window$electron$acti !== void 0 && _window$electron$acti.sendExamMappingDetails) {
33
+ window.electron.actions.sendExamMappingDetails({
34
+ endTimeStamp
35
+ });
36
+ }
37
+ }
38
+ }, [endTimeStamp]);
28
39
  (0, _react.useEffect)(() => {
29
40
  setAskPermissionAction(oldAskPermissionAction => _objectSpread(_objectSpread({}, oldAskPermissionAction), {}, {
30
41
  openHeimdall: async () => {
@@ -49,6 +49,7 @@ const ProctorApp = _ref => {
49
49
  const {
50
50
  permissions,
51
51
  references,
52
+ isElectronApp,
52
53
  permissionErrors,
53
54
  allPermissionGrantedOnce
54
55
  } = context;
@@ -118,7 +119,7 @@ const ProctorApp = _ref => {
118
119
  }), proctorParams.fullscreenExit && /*#__PURE__*/(0, _jsxRuntime.jsx)(_fullscreen.default, {
119
120
  proctorParams: proctorParams,
120
121
  setAskPermissionAction: setAskPermissionAction
121
- }), proctorParams.openHeimdall && /*#__PURE__*/(0, _jsxRuntime.jsx)(_OpenHeimdall.OpenHeimdall, {
122
+ }), proctorParams.openHeimdall && isElectronApp && /*#__PURE__*/(0, _jsxRuntime.jsx)(_OpenHeimdall.OpenHeimdall, {
122
123
  config: config,
123
124
  setAskPermissionAction: setAskPermissionAction,
124
125
  proctoredContext: proctoredContext
@@ -33,6 +33,7 @@ const ProctoredContextApp = _ref => {
33
33
  customContext = {}
34
34
  } = _ref;
35
35
  const proctorParams = (0, _react.useMemo)(() => _objectSpread(_objectSpread({}, _defaults.defaultConfig), config.proctorParams), [config.proctorParams]);
36
+ const [endTimeStamp, setEndTimeStamp] = (0, _react.useState)(null);
36
37
  const [, isElectronApp] = (0, _useIsElectron.default)();
37
38
  const [webCamDeviceId, setWebCamDeviceId] = (0, _react.useState)();
38
39
  const [screenShareDeviceId, setScreenShareDeviceId] = (0, _react.useState)();
@@ -70,6 +71,8 @@ const ProctoredContextApp = _ref => {
70
71
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Context.Provider, {
71
72
  value: _objectSpread(_objectSpread({}, customContext), {}, {
72
73
  permissions,
74
+ endTimeStamp,
75
+ setEndTimeStamp,
73
76
  allPermissionGrantedOnce,
74
77
  permissionSetter: {
75
78
  audio: setAudioPermission,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newtonschool/react_proctoring_library",
3
- "version": "0.0.105",
3
+ "version": "0.0.107",
4
4
  "description": "Used to proctor online tests",
5
5
  "author": "ayushkagrawal,shreyachandra,weastel",
6
6
  "main": "dist/index.js",