easyproctor 0.0.5 → 0.0.9

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