easyproctor 0.0.4 → 0.0.8
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 +58 -2
- package/package.json +2 -4
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ npm install --save easyproctor
|
|
|
12
12
|
|
|
13
13
|
Via CDN
|
|
14
14
|
```html
|
|
15
|
-
<script src="https://cdn.jsdelivr.net/npm/easyproctor
|
|
15
|
+
<script src="https://cdn.jsdelivr.net/npm/easyproctor/unpkg/easyproctor.min.js"></script>
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Utilização
|
|
@@ -24,9 +24,65 @@ import { useProctoring } from "easyproctor";
|
|
|
24
24
|
const { start, finish, pause, resume, onLostFocus } = useProctoring("e276b448-cbee-48ae-b82c-b493aa18166e");
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
## Exemplo completo
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<!DOCTYPE html>
|
|
31
|
+
<html lang="en">
|
|
32
|
+
|
|
33
|
+
<head>
|
|
34
|
+
<meta charset="UTF-8">
|
|
35
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
36
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
37
|
+
<title>Document</title>
|
|
38
|
+
|
|
39
|
+
<script src="/dist/unpkg/easyproctor.min.js"></script>
|
|
40
|
+
<script>
|
|
41
|
+
const { start, finish, pause, resume, onLostFocus } = useProctoring("125-125125-12512512-1251");
|
|
42
|
+
|
|
43
|
+
async function startExam() {
|
|
44
|
+
await start();
|
|
45
|
+
// or start().then(() => {})
|
|
46
|
+
// My personal logic
|
|
47
|
+
console.log("Exam started")
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function pauseExam() {
|
|
51
|
+
await pause();
|
|
52
|
+
// or pause().then(() => {})
|
|
53
|
+
// My personal logic
|
|
54
|
+
console.log("Exam paused")
|
|
55
|
+
}
|
|
56
|
+
async function resumeExam() {
|
|
57
|
+
await resume();
|
|
58
|
+
// or resume().then(() => {})
|
|
59
|
+
// My personal logic
|
|
60
|
+
console.log("Exam resumed")
|
|
61
|
+
}
|
|
62
|
+
async function finishExam() {
|
|
63
|
+
const [cameraFile, screenFile] = await finish();
|
|
64
|
+
// or finish().then(([cameraFile, screenFile]) => {})
|
|
65
|
+
// My personal logic
|
|
66
|
+
console.log("Exam finished")
|
|
67
|
+
}
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
</head>
|
|
71
|
+
|
|
72
|
+
<body>
|
|
73
|
+
<button onclick="startExam()">Iniciar prova</button>
|
|
74
|
+
<button onclick="pauseExam()">Pausar prova</button>
|
|
75
|
+
<button onclick="resumeExam()">Resumir prova</button>
|
|
76
|
+
<button onclick="finishExam()">Finalizar prova</button>
|
|
77
|
+
</body>
|
|
78
|
+
|
|
79
|
+
</html>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
|
|
27
83
|
Via CDN: A função "useProctoring" é injetada para ser utilizada globalmente
|
|
28
84
|
```html
|
|
29
|
-
<script src="https://cdn.jsdelivr.net/npm/easyproctor
|
|
85
|
+
<script src="https://cdn.jsdelivr.net/npm/easyproctor/unpkg/easyproctor.min.js"></script>
|
|
30
86
|
<script>
|
|
31
87
|
const { start, finish, pause, resume, onLostFocus } = useProctoring("cac34c6d-63ec-4f86-b5b0-bdeb52e8c146");
|
|
32
88
|
</script>
|
package/package.json
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easyproctor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Modulo web de gravação do EasyProctor",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
7
7
|
"unpkg": "./unpkg/easyproctor.min.js",
|
|
8
8
|
"types": "./index.d.ts",
|
|
9
|
-
"keywords": [
|
|
10
|
-
"proctoring"
|
|
11
|
-
],
|
|
9
|
+
"keywords": ["proctoring"],
|
|
12
10
|
"homepage": "https://github.com/Igor4505/render-function#readme",
|
|
13
11
|
"repository": {
|
|
14
12
|
"type": "git",
|