easyproctor 0.0.73 → 0.0.75
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/README.md +2 -3
- package/esm/index.js +66 -32
- package/index.d.ts +1 -0
- package/index.js +66 -32
- package/package.json +1 -1
- package/unpkg/easyproctor.min.js +21 -19
package/README.md
CHANGED
|
@@ -219,10 +219,9 @@ const {
|
|
|
219
219
|
});
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
-
## Release Note V 0.0.
|
|
222
|
+
## Release Note V 0.0.75
|
|
223
223
|
|
|
224
|
-
- Mudança de
|
|
225
|
-
- Checar alteração de devices
|
|
224
|
+
- Mudança de fluxo de upload e download para safeBrowser e não safeBrowser
|
|
226
225
|
|
|
227
226
|
## License
|
|
228
227
|
|
package/esm/index.js
CHANGED
|
@@ -28561,6 +28561,8 @@ var containerName = "";
|
|
|
28561
28561
|
var sas = "";
|
|
28562
28562
|
var blobServiceClient;
|
|
28563
28563
|
var message = "";
|
|
28564
|
+
var loadingInterval;
|
|
28565
|
+
var loadingBoolean = true;
|
|
28564
28566
|
async function setConfiguration(_account, _cointainerName, _sas) {
|
|
28565
28567
|
account = _account;
|
|
28566
28568
|
containerName = _cointainerName;
|
|
@@ -28648,6 +28650,32 @@ async function uploadBackup(data, config2, proctoringToken) {
|
|
|
28648
28650
|
} catch (err) {
|
|
28649
28651
|
message += "\n\u2022 Error on AWS upload\n ";
|
|
28650
28652
|
message += err;
|
|
28653
|
+
try {
|
|
28654
|
+
download(data);
|
|
28655
|
+
} catch (err2) {
|
|
28656
|
+
throw err2;
|
|
28657
|
+
}
|
|
28658
|
+
throw err;
|
|
28659
|
+
}
|
|
28660
|
+
}
|
|
28661
|
+
function download(data) {
|
|
28662
|
+
try {
|
|
28663
|
+
const { file, onProgress } = data;
|
|
28664
|
+
const url = URL.createObjectURL(file);
|
|
28665
|
+
const a = document.createElement("a");
|
|
28666
|
+
document.body.appendChild(a);
|
|
28667
|
+
a.style.display = "none";
|
|
28668
|
+
a.href = url;
|
|
28669
|
+
a.download = file.name;
|
|
28670
|
+
a.click();
|
|
28671
|
+
window.URL.revokeObjectURL(url);
|
|
28672
|
+
loadingBoolean = false;
|
|
28673
|
+
clearInterval(loadingInterval);
|
|
28674
|
+
onProgress && onProgress(Math.round(100));
|
|
28675
|
+
} catch (err) {
|
|
28676
|
+
message += `
|
|
28677
|
+
\u2022 Error on machine download -> ${data.file.name}
|
|
28678
|
+
`;
|
|
28651
28679
|
throw err;
|
|
28652
28680
|
}
|
|
28653
28681
|
}
|
|
@@ -28758,7 +28786,8 @@ var defaultProctoringOptions = {
|
|
|
28758
28786
|
allowOnlyFirstMonitor: true,
|
|
28759
28787
|
captureScreen: true,
|
|
28760
28788
|
proctoringType: "IMAGE",
|
|
28761
|
-
insights: ""
|
|
28789
|
+
insights: "",
|
|
28790
|
+
previousDownload: false
|
|
28762
28791
|
};
|
|
28763
28792
|
var azureBlobUrl = "";
|
|
28764
28793
|
var _captureScreen = true;
|
|
@@ -28773,7 +28802,7 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
28773
28802
|
if (!navigator.mediaDevices.getDisplayMedia || !window.indexedDB) {
|
|
28774
28803
|
throw INCOMPATIBLE_NAVIGATOR;
|
|
28775
28804
|
}
|
|
28776
|
-
function
|
|
28805
|
+
function download2(file) {
|
|
28777
28806
|
const url = URL.createObjectURL(file);
|
|
28778
28807
|
const a = document.createElement("a");
|
|
28779
28808
|
document.body.appendChild(a);
|
|
@@ -28796,6 +28825,7 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
28796
28825
|
let cancelCallback = null;
|
|
28797
28826
|
let lastClick = 0;
|
|
28798
28827
|
const delay = 20;
|
|
28828
|
+
let previousDownload;
|
|
28799
28829
|
function _clear() {
|
|
28800
28830
|
cameraBuffer = [];
|
|
28801
28831
|
screenBuffer = [];
|
|
@@ -28930,6 +28960,7 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
28930
28960
|
throw PROCTORING_ALREADY_STARTED;
|
|
28931
28961
|
lastClick = Date.now();
|
|
28932
28962
|
const { cameraId, microphoneId, allowOnlyFirstMonitor = true, allowMultipleMonitors = false, captureScreen = true, proctoringType } = options;
|
|
28963
|
+
previousDownload = !options.previousDownload;
|
|
28933
28964
|
try {
|
|
28934
28965
|
await initConfig();
|
|
28935
28966
|
} catch (err) {
|
|
@@ -29206,36 +29237,39 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
29206
29237
|
} catch (error) {
|
|
29207
29238
|
trackers.registerFinish(proctoringId, false, "finish error: " + error);
|
|
29208
29239
|
}
|
|
29209
|
-
|
|
29210
|
-
|
|
29211
|
-
|
|
29212
|
-
|
|
29213
|
-
|
|
29214
|
-
|
|
29215
|
-
|
|
29216
|
-
|
|
29217
|
-
|
|
29218
|
-
|
|
29219
|
-
|
|
29220
|
-
|
|
29221
|
-
|
|
29222
|
-
|
|
29223
|
-
|
|
29224
|
-
|
|
29225
|
-
|
|
29226
|
-
|
|
29227
|
-
|
|
29228
|
-
|
|
29229
|
-
|
|
29230
|
-
|
|
29231
|
-
|
|
29232
|
-
|
|
29233
|
-
|
|
29234
|
-
|
|
29235
|
-
|
|
29236
|
-
|
|
29237
|
-
|
|
29238
|
-
|
|
29240
|
+
if (previousDownload) {
|
|
29241
|
+
try {
|
|
29242
|
+
trackers.registerUploadVideo(proctoringId, true, "Starting download");
|
|
29243
|
+
allFiles.map((c) => {
|
|
29244
|
+
download2(c);
|
|
29245
|
+
});
|
|
29246
|
+
trackers.registerUploadVideo(proctoringId, true, "Finish download");
|
|
29247
|
+
} catch (error) {
|
|
29248
|
+
console.log("Enviando tracker de error");
|
|
29249
|
+
trackers.registerUploadVideo(proctoringId, false, "erro no download " + error);
|
|
29250
|
+
}
|
|
29251
|
+
} else {
|
|
29252
|
+
try {
|
|
29253
|
+
trackers.registerUploadVideo(proctoringId, true, "Starting upload");
|
|
29254
|
+
const timeBefore = performance.now();
|
|
29255
|
+
const uploadPromises = allFiles.map((c, i) => {
|
|
29256
|
+
return upload({
|
|
29257
|
+
file: c,
|
|
29258
|
+
onProgress: (progress) => {
|
|
29259
|
+
uploadProgress[i] = progress;
|
|
29260
|
+
handleOnProgress();
|
|
29261
|
+
}
|
|
29262
|
+
}, proctoringId, config, proctoringOptions.token);
|
|
29263
|
+
});
|
|
29264
|
+
const timeAfter = performance.now();
|
|
29265
|
+
await Promise.all(uploadPromises);
|
|
29266
|
+
const executionTime = timeAfter - timeBefore;
|
|
29267
|
+
onProgress && onProgress(Math.round(100));
|
|
29268
|
+
trackers.registerUploadVideo(proctoringId, true, "Finish upload", executionTime);
|
|
29269
|
+
} catch (error) {
|
|
29270
|
+
console.log("Enviando tracker de error");
|
|
29271
|
+
trackers.registerUploadVideo(proctoringId, false, "" + error);
|
|
29272
|
+
}
|
|
29239
29273
|
}
|
|
29240
29274
|
await clearBuffers("exams");
|
|
29241
29275
|
cameraBuffer = [];
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -40082,6 +40082,8 @@ var containerName = "";
|
|
|
40082
40082
|
var sas = "";
|
|
40083
40083
|
var blobServiceClient;
|
|
40084
40084
|
var message = "";
|
|
40085
|
+
var loadingInterval;
|
|
40086
|
+
var loadingBoolean = true;
|
|
40085
40087
|
async function setConfiguration(_account, _cointainerName, _sas) {
|
|
40086
40088
|
account = _account;
|
|
40087
40089
|
containerName = _cointainerName;
|
|
@@ -40169,6 +40171,32 @@ async function uploadBackup(data, config2, proctoringToken) {
|
|
|
40169
40171
|
} catch (err) {
|
|
40170
40172
|
message += "\n\u2022 Error on AWS upload\n ";
|
|
40171
40173
|
message += err;
|
|
40174
|
+
try {
|
|
40175
|
+
download(data);
|
|
40176
|
+
} catch (err2) {
|
|
40177
|
+
throw err2;
|
|
40178
|
+
}
|
|
40179
|
+
throw err;
|
|
40180
|
+
}
|
|
40181
|
+
}
|
|
40182
|
+
function download(data) {
|
|
40183
|
+
try {
|
|
40184
|
+
const { file, onProgress } = data;
|
|
40185
|
+
const url2 = URL.createObjectURL(file);
|
|
40186
|
+
const a = document.createElement("a");
|
|
40187
|
+
document.body.appendChild(a);
|
|
40188
|
+
a.style.display = "none";
|
|
40189
|
+
a.href = url2;
|
|
40190
|
+
a.download = file.name;
|
|
40191
|
+
a.click();
|
|
40192
|
+
window.URL.revokeObjectURL(url2);
|
|
40193
|
+
loadingBoolean = false;
|
|
40194
|
+
clearInterval(loadingInterval);
|
|
40195
|
+
onProgress && onProgress(Math.round(100));
|
|
40196
|
+
} catch (err) {
|
|
40197
|
+
message += `
|
|
40198
|
+
\u2022 Error on machine download -> ${data.file.name}
|
|
40199
|
+
`;
|
|
40172
40200
|
throw err;
|
|
40173
40201
|
}
|
|
40174
40202
|
}
|
|
@@ -40279,7 +40307,8 @@ var defaultProctoringOptions = {
|
|
|
40279
40307
|
allowOnlyFirstMonitor: true,
|
|
40280
40308
|
captureScreen: true,
|
|
40281
40309
|
proctoringType: "IMAGE",
|
|
40282
|
-
insights: ""
|
|
40310
|
+
insights: "",
|
|
40311
|
+
previousDownload: false
|
|
40283
40312
|
};
|
|
40284
40313
|
var azureBlobUrl = "";
|
|
40285
40314
|
var _captureScreen = true;
|
|
@@ -40294,7 +40323,7 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
40294
40323
|
if (!navigator.mediaDevices.getDisplayMedia || !window.indexedDB) {
|
|
40295
40324
|
throw INCOMPATIBLE_NAVIGATOR;
|
|
40296
40325
|
}
|
|
40297
|
-
function
|
|
40326
|
+
function download2(file) {
|
|
40298
40327
|
const url2 = URL.createObjectURL(file);
|
|
40299
40328
|
const a = document.createElement("a");
|
|
40300
40329
|
document.body.appendChild(a);
|
|
@@ -40317,6 +40346,7 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
40317
40346
|
let cancelCallback = null;
|
|
40318
40347
|
let lastClick = 0;
|
|
40319
40348
|
const delay = 20;
|
|
40349
|
+
let previousDownload;
|
|
40320
40350
|
function _clear() {
|
|
40321
40351
|
cameraBuffer = [];
|
|
40322
40352
|
screenBuffer = [];
|
|
@@ -40451,6 +40481,7 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
40451
40481
|
throw PROCTORING_ALREADY_STARTED;
|
|
40452
40482
|
lastClick = Date.now();
|
|
40453
40483
|
const { cameraId, microphoneId, allowOnlyFirstMonitor = true, allowMultipleMonitors = false, captureScreen = true, proctoringType } = options;
|
|
40484
|
+
previousDownload = !options.previousDownload;
|
|
40454
40485
|
try {
|
|
40455
40486
|
await initConfig();
|
|
40456
40487
|
} catch (err) {
|
|
@@ -40727,36 +40758,39 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
40727
40758
|
} catch (error) {
|
|
40728
40759
|
trackers.registerFinish(proctoringId, false, "finish error: " + error);
|
|
40729
40760
|
}
|
|
40730
|
-
|
|
40731
|
-
|
|
40732
|
-
|
|
40733
|
-
|
|
40734
|
-
|
|
40735
|
-
|
|
40736
|
-
|
|
40737
|
-
|
|
40738
|
-
|
|
40739
|
-
|
|
40740
|
-
|
|
40741
|
-
|
|
40742
|
-
|
|
40743
|
-
|
|
40744
|
-
|
|
40745
|
-
|
|
40746
|
-
|
|
40747
|
-
|
|
40748
|
-
|
|
40749
|
-
|
|
40750
|
-
|
|
40751
|
-
|
|
40752
|
-
|
|
40753
|
-
|
|
40754
|
-
|
|
40755
|
-
|
|
40756
|
-
|
|
40757
|
-
|
|
40758
|
-
|
|
40759
|
-
|
|
40761
|
+
if (previousDownload) {
|
|
40762
|
+
try {
|
|
40763
|
+
trackers.registerUploadVideo(proctoringId, true, "Starting download");
|
|
40764
|
+
allFiles.map((c) => {
|
|
40765
|
+
download2(c);
|
|
40766
|
+
});
|
|
40767
|
+
trackers.registerUploadVideo(proctoringId, true, "Finish download");
|
|
40768
|
+
} catch (error) {
|
|
40769
|
+
console.log("Enviando tracker de error");
|
|
40770
|
+
trackers.registerUploadVideo(proctoringId, false, "erro no download " + error);
|
|
40771
|
+
}
|
|
40772
|
+
} else {
|
|
40773
|
+
try {
|
|
40774
|
+
trackers.registerUploadVideo(proctoringId, true, "Starting upload");
|
|
40775
|
+
const timeBefore = performance.now();
|
|
40776
|
+
const uploadPromises = allFiles.map((c, i) => {
|
|
40777
|
+
return upload({
|
|
40778
|
+
file: c,
|
|
40779
|
+
onProgress: (progress) => {
|
|
40780
|
+
uploadProgress[i] = progress;
|
|
40781
|
+
handleOnProgress();
|
|
40782
|
+
}
|
|
40783
|
+
}, proctoringId, config, proctoringOptions.token);
|
|
40784
|
+
});
|
|
40785
|
+
const timeAfter = performance.now();
|
|
40786
|
+
await Promise.all(uploadPromises);
|
|
40787
|
+
const executionTime = timeAfter - timeBefore;
|
|
40788
|
+
onProgress && onProgress(Math.round(100));
|
|
40789
|
+
trackers.registerUploadVideo(proctoringId, true, "Finish upload", executionTime);
|
|
40790
|
+
} catch (error) {
|
|
40791
|
+
console.log("Enviando tracker de error");
|
|
40792
|
+
trackers.registerUploadVideo(proctoringId, false, "" + error);
|
|
40793
|
+
}
|
|
40760
40794
|
}
|
|
40761
40795
|
await clearBuffers("exams");
|
|
40762
40796
|
cameraBuffer = [];
|