@cuemath/leap 4.1.4-as1 → 4.1.4-as2
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/dist/features/fraud-detection/api/report-fraudulent-login.js +9 -0
- package/dist/features/fraud-detection/api/report-fraudulent-login.js.map +1 -0
- package/dist/features/fraud-detection/hooks/use-report-fraud.js +61 -71
- package/dist/features/fraud-detection/hooks/use-report-fraud.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/fraud-detection/api/send-email.js +0 -9
- package/dist/features/fraud-detection/api/send-email.js.map +0 -1
- package/dist/features/fraud-detection/hooks/report-fraud-helper.js +0 -65
- package/dist/features/fraud-detection/hooks/report-fraud-helper.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createPostAPI as t } from "@cuemath/rest-api";
|
|
2
|
+
import { BASE_URL_V1 as r } from "../../../constants/api.js";
|
|
3
|
+
const { usePost: u } = t({
|
|
4
|
+
getURL: ({ student_classroom_id: o }) => `${r}/student-classrooms/${o}/report-fraudulent-login`
|
|
5
|
+
});
|
|
6
|
+
export {
|
|
7
|
+
u as useReportFraudulentLogin
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=report-fraudulent-login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-fraudulent-login.js","sources":["../../../../src/features/fraud-detection/api/report-fraudulent-login.ts"],"sourcesContent":["import { createPostAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../constants/api';\nimport { type IReportFraudulentLoginPayload } from '../hooks/report-fraud-types';\n\nexport const { usePost: useReportFraudulentLogin } = createPostAPI<\n null,\n IReportFraudulentLoginPayload\n>({\n getURL: ({ student_classroom_id }: { student_classroom_id: string }) =>\n `${BASE_URL_V1}/student-classrooms/${student_classroom_id}/report-fraudulent-login`,\n});\n"],"names":["useReportFraudulentLogin","createPostAPI","student_classroom_id","BASE_URL_V1"],"mappings":";;AAKO,MAAM,EAAE,SAASA,EAAyB,IAAIC,EAGnD;AAAA,EACA,QAAQ,CAAC,EAAE,sBAAAC,QACT,GAAGC,CAAW,uBAAuBD,CAAoB;AAC7D,CAAC;"}
|
|
@@ -1,98 +1,88 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { useLocalPeer as
|
|
3
|
-
import { useUIContext as
|
|
4
|
-
import { base64ToFile as
|
|
5
|
-
import { FRAUD_DETECTION_ANALYTICS_EVENTS as
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
teacherId: i,
|
|
1
|
+
import { useState as S, useCallback as m, useEffect as T } from "react";
|
|
2
|
+
import { useLocalPeer as $, useRemotePeers as U, useCaptureMediaStreamImage as L } from "@cuemath/av";
|
|
3
|
+
import { useUIContext as N } from "../../ui/context/context.js";
|
|
4
|
+
import { base64ToFile as D } from "../fraud-alert-modal/fraud-alert-modal-helpers.js";
|
|
5
|
+
import { FRAUD_DETECTION_ANALYTICS_EVENTS as y } from "./report-fraud-analytics.js";
|
|
6
|
+
import k from "../../hooks/use-s3-helper/use-s3-helper.js";
|
|
7
|
+
import { useReportFraudulentLogin as v } from "../api/report-fraudulent-login.js";
|
|
8
|
+
const w = { type: "class_fraud_login" }, b = ({
|
|
9
|
+
teacherId: a,
|
|
11
10
|
studentId: n,
|
|
12
|
-
studentClassroomId:
|
|
13
|
-
teacherClassroomId:
|
|
14
|
-
classStartTs:
|
|
15
|
-
studentName:
|
|
11
|
+
studentClassroomId: r,
|
|
12
|
+
teacherClassroomId: u,
|
|
13
|
+
classStartTs: i,
|
|
14
|
+
studentName: f
|
|
16
15
|
}) => {
|
|
17
|
-
const { onEvent:
|
|
16
|
+
const { onEvent: s } = N(), [p, g] = S(!1), e = $(), t = U().find((o) => o.userId === a), c = L(), E = k({
|
|
18
17
|
studentId: n,
|
|
19
18
|
query: w
|
|
20
|
-
}), { post:
|
|
21
|
-
(
|
|
22
|
-
_
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class_start_ts: new Date(u * 1e3),
|
|
26
|
-
teacher_id: i,
|
|
19
|
+
}), { post: d } = v(), F = m(
|
|
20
|
+
(o) => {
|
|
21
|
+
const _ = {
|
|
22
|
+
class_start_ts: i,
|
|
23
|
+
student_classroom_id: r,
|
|
27
24
|
student_id: n,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
classStartTs: u,
|
|
39
|
-
teacherClassroomId: r,
|
|
40
|
-
studentClassroomId: o,
|
|
41
|
-
teacherUrl: t[0] || "",
|
|
42
|
-
studentUrl: t[1] || ""
|
|
43
|
-
})
|
|
44
|
-
});
|
|
25
|
+
student_name: f,
|
|
26
|
+
teacher_classroom_id: u,
|
|
27
|
+
teacher_id: a,
|
|
28
|
+
teacher_url: o[0] || "",
|
|
29
|
+
student_url: o[1] || ""
|
|
30
|
+
};
|
|
31
|
+
s(y.FRAUD_LOGIN_TEACHER_ENTERED_CLASS_AS_STUDENT, {
|
|
32
|
+
..._,
|
|
33
|
+
class_start_ts: new Date(i * 1e3)
|
|
34
|
+
}), d(_);
|
|
45
35
|
},
|
|
46
36
|
[
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
o,
|
|
51
|
-
n,
|
|
52
|
-
m,
|
|
37
|
+
i,
|
|
38
|
+
s,
|
|
39
|
+
d,
|
|
53
40
|
r,
|
|
54
|
-
|
|
41
|
+
n,
|
|
42
|
+
f,
|
|
43
|
+
u,
|
|
44
|
+
a
|
|
55
45
|
]
|
|
56
|
-
),
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
return
|
|
60
|
-
if (!
|
|
46
|
+
), R = m(() => {
|
|
47
|
+
s("fraud_detection_images_failed", { classStartTs: i, teacherId: a, studentId: n });
|
|
48
|
+
}, [i, s, n, a]);
|
|
49
|
+
return T(() => {
|
|
50
|
+
if (!p || !(t != null && t.id) || !(e != null && e.id))
|
|
61
51
|
return;
|
|
62
|
-
const { image:
|
|
63
|
-
!
|
|
52
|
+
const { image: o } = c(t == null ? void 0 : t.id, "camera"), { image: _ } = c(e == null ? void 0 : e.id, "camera"), l = D(o, `teacher-${Date.now()}.png`), A = D(_, `student-${Date.now()}.png`);
|
|
53
|
+
!l || !A || (E({
|
|
64
54
|
fileKey: "media/class_fraud_login/",
|
|
65
|
-
onSuccess:
|
|
66
|
-
onError:
|
|
55
|
+
onSuccess: F,
|
|
56
|
+
onError: R,
|
|
67
57
|
images: [
|
|
68
58
|
{
|
|
69
|
-
file:
|
|
70
|
-
name: `teacher_${
|
|
59
|
+
file: l,
|
|
60
|
+
name: `teacher_${u}_${a}`,
|
|
71
61
|
url: ""
|
|
72
62
|
},
|
|
73
63
|
{
|
|
74
|
-
file:
|
|
75
|
-
name: `student_${
|
|
64
|
+
file: A,
|
|
65
|
+
name: `student_${r}_${n}`,
|
|
76
66
|
url: ""
|
|
77
67
|
}
|
|
78
68
|
]
|
|
79
|
-
}),
|
|
69
|
+
}), g(!1));
|
|
80
70
|
}, [
|
|
81
|
-
|
|
71
|
+
p,
|
|
82
72
|
c,
|
|
83
73
|
e == null ? void 0 : e.id,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
o,
|
|
88
|
-
n,
|
|
74
|
+
R,
|
|
75
|
+
F,
|
|
76
|
+
t == null ? void 0 : t.id,
|
|
89
77
|
r,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
78
|
+
n,
|
|
79
|
+
u,
|
|
80
|
+
a,
|
|
81
|
+
E
|
|
82
|
+
]), m(() => {
|
|
83
|
+
g(!0);
|
|
94
84
|
}, []);
|
|
95
|
-
}, K =
|
|
85
|
+
}, K = b;
|
|
96
86
|
export {
|
|
97
87
|
K as default
|
|
98
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-report-fraud.js","sources":["../../../../src/features/fraud-detection/hooks/use-report-fraud.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport { useCaptureMediaStreamImage, useLocalPeer, useRemotePeers } from '@cuemath/av';\n\nimport { useUIContext } from '../../ui/context/context';\nimport { base64ToFile } from '../fraud-alert-modal/fraud-alert-modal-helpers';\nimport { type IUseFraudAlertProps } from './report-fraud-types';\nimport { FRAUD_DETECTION_ANALYTICS_EVENTS } from './report-fraud-analytics';\nimport useS3ImageUploadHelper from '../../hooks/use-s3-helper/use-s3-helper';\nimport {
|
|
1
|
+
{"version":3,"file":"use-report-fraud.js","sources":["../../../../src/features/fraud-detection/hooks/use-report-fraud.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport { useCaptureMediaStreamImage, useLocalPeer, useRemotePeers } from '@cuemath/av';\n\nimport { useUIContext } from '../../ui/context/context';\nimport { base64ToFile } from '../fraud-alert-modal/fraud-alert-modal-helpers';\nimport { type IUseFraudAlertProps } from './report-fraud-types';\nimport { FRAUD_DETECTION_ANALYTICS_EVENTS } from './report-fraud-analytics';\nimport useS3ImageUploadHelper from '../../hooks/use-s3-helper/use-s3-helper';\nimport { useReportFraudulentLogin } from '../api/report-fraudulent-login';\n\nconst QUERY = { type: 'class_fraud_login' };\n\nconst useReportFraud = ({\n teacherId,\n studentId,\n studentClassroomId,\n teacherClassroomId,\n classStartTs,\n studentName,\n}: IUseFraudAlertProps) => {\n const { onEvent } = useUIContext();\n\n const [canTrackEvent, setCanTrackEvent] = useState(false);\n const localpeer = useLocalPeer();\n const remotePeer = useRemotePeers().find(peer => peer.userId === teacherId);\n const captureMediaStreamImage = useCaptureMediaStreamImage();\n const uploadImages = useS3ImageUploadHelper({\n studentId,\n query: QUERY,\n });\n const { post: reportFraud } = useReportFraudulentLogin();\n const onSuccess = useCallback(\n (urls: string[]) => {\n const fraudPayload = {\n class_start_ts: classStartTs,\n student_classroom_id: studentClassroomId,\n student_id: studentId,\n student_name: studentName,\n teacher_classroom_id: teacherClassroomId,\n teacher_id: teacherId,\n teacher_url: urls[0] || '',\n student_url: urls[1] || '',\n };\n\n onEvent(FRAUD_DETECTION_ANALYTICS_EVENTS.FRAUD_LOGIN_TEACHER_ENTERED_CLASS_AS_STUDENT, {\n ...fraudPayload,\n class_start_ts: new Date(classStartTs * 1000),\n });\n\n reportFraud(fraudPayload);\n },\n [\n classStartTs,\n onEvent,\n reportFraud,\n studentClassroomId,\n studentId,\n studentName,\n teacherClassroomId,\n teacherId,\n ],\n );\n\n const onError = useCallback(() => {\n onEvent('fraud_detection_images_failed', { classStartTs, teacherId, studentId });\n }, [classStartTs, onEvent, studentId, teacherId]);\n\n useEffect(() => {\n if (!canTrackEvent || !remotePeer?.id || !localpeer?.id) {\n return;\n }\n\n const { image: teacherImage } = captureMediaStreamImage(remotePeer?.id, 'camera');\n const { image: studentImage } = captureMediaStreamImage(localpeer?.id, 'camera');\n const teacherFile = base64ToFile(teacherImage, `teacher-${Date.now()}.png`);\n const studentFile = base64ToFile(studentImage, `student-${Date.now()}.png`);\n\n if (!teacherFile || !studentFile) {\n return;\n }\n\n uploadImages({\n fileKey: `media/class_fraud_login/`,\n onSuccess,\n onError,\n images: [\n {\n file: teacherFile,\n name: `teacher_${teacherClassroomId}_${teacherId}`,\n url: '',\n },\n {\n file: studentFile,\n name: `student_${studentClassroomId}_${studentId}`,\n url: '',\n },\n ],\n });\n\n setCanTrackEvent(false);\n }, [\n canTrackEvent,\n captureMediaStreamImage,\n localpeer?.id,\n onError,\n onSuccess,\n remotePeer?.id,\n studentClassroomId,\n studentId,\n teacherClassroomId,\n teacherId,\n uploadImages,\n ]);\n\n const captureAndReportFraudImages = useCallback(() => {\n setCanTrackEvent(true);\n }, []);\n\n return captureAndReportFraudImages;\n};\n\nexport default useReportFraud;\n"],"names":["QUERY","useReportFraud","teacherId","studentId","studentClassroomId","teacherClassroomId","classStartTs","studentName","onEvent","useUIContext","canTrackEvent","setCanTrackEvent","useState","localpeer","useLocalPeer","remotePeer","useRemotePeers","peer","captureMediaStreamImage","useCaptureMediaStreamImage","uploadImages","useS3ImageUploadHelper","reportFraud","useReportFraudulentLogin","onSuccess","useCallback","urls","fraudPayload","FRAUD_DETECTION_ANALYTICS_EVENTS","onError","useEffect","teacherImage","studentImage","teacherFile","base64ToFile","studentFile","useReportFraud$1"],"mappings":";;;;;;;AAWA,MAAMA,IAAQ,EAAE,MAAM,uBAEhBC,IAAiB,CAAC;AAAA,EACtB,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AACF,MAA2B;AACnB,QAAA,EAAE,SAAAC,MAAYC,KAEd,CAACC,GAAeC,CAAgB,IAAIC,EAAS,EAAK,GAClDC,IAAYC,KACZC,IAAaC,EAAe,EAAE,KAAK,CAAQC,MAAAA,EAAK,WAAWf,CAAS,GACpEgB,IAA0BC,KAC1BC,IAAeC,EAAuB;AAAA,IAC1C,WAAAlB;AAAA,IACA,OAAOH;AAAA,EAAA,CACR,GACK,EAAE,MAAMsB,EAAY,IAAIC,EAAyB,GACjDC,IAAYC;AAAA,IAChB,CAACC,MAAmB;AAClB,YAAMC,IAAe;AAAA,QACnB,gBAAgBrB;AAAA,QAChB,sBAAsBF;AAAA,QACtB,YAAYD;AAAA,QACZ,cAAcI;AAAA,QACd,sBAAsBF;AAAA,QACtB,YAAYH;AAAA,QACZ,aAAawB,EAAK,CAAC,KAAK;AAAA,QACxB,aAAaA,EAAK,CAAC,KAAK;AAAA,MAAA;AAG1B,MAAAlB,EAAQoB,EAAiC,8CAA8C;AAAA,QACrF,GAAGD;AAAA,QACH,gBAAgB,IAAI,KAAKrB,IAAe,GAAI;AAAA,MAAA,CAC7C,GAEDgB,EAAYK,CAAY;AAAA,IAC1B;AAAA,IACA;AAAA,MACErB;AAAA,MACAE;AAAA,MACAc;AAAA,MACAlB;AAAA,MACAD;AAAA,MACAI;AAAA,MACAF;AAAA,MACAH;AAAA,IACF;AAAA,EAAA,GAGI2B,IAAUJ,EAAY,MAAM;AAChC,IAAAjB,EAAQ,iCAAiC,EAAE,cAAAF,GAAc,WAAAJ,GAAW,WAAAC,EAAW,CAAA;AAAA,KAC9E,CAACG,GAAcE,GAASL,GAAWD,CAAS,CAAC;AAEhD,SAAA4B,EAAU,MAAM;AACd,QAAI,CAACpB,KAAiB,EAACK,KAAA,QAAAA,EAAY,OAAM,EAACF,KAAA,QAAAA,EAAW;AACnD;AAGF,UAAM,EAAE,OAAOkB,MAAiBb,EAAwBH,KAAA,gBAAAA,EAAY,IAAI,QAAQ,GAC1E,EAAE,OAAOiB,MAAiBd,EAAwBL,KAAA,gBAAAA,EAAW,IAAI,QAAQ,GACzEoB,IAAcC,EAAaH,GAAc,WAAW,KAAK,IAAA,CAAK,MAAM,GACpEI,IAAcD,EAAaF,GAAc,WAAW,KAAK,IAAA,CAAK,MAAM;AAEtE,IAAA,CAACC,KAAe,CAACE,MAIRf,EAAA;AAAA,MACX,SAAS;AAAA,MACT,WAAAI;AAAA,MACA,SAAAK;AAAA,MACA,QAAQ;AAAA,QACN;AAAA,UACE,MAAMI;AAAA,UACN,MAAM,WAAW5B,CAAkB,IAAIH,CAAS;AAAA,UAChD,KAAK;AAAA,QACP;AAAA,QACA;AAAA,UACE,MAAMiC;AAAA,UACN,MAAM,WAAW/B,CAAkB,IAAID,CAAS;AAAA,UAChD,KAAK;AAAA,QACP;AAAA,MACF;AAAA,IAAA,CACD,GAEDQ,EAAiB,EAAK;AAAA,EAAA,GACrB;AAAA,IACDD;AAAA,IACAQ;AAAA,IACAL,KAAA,gBAAAA,EAAW;AAAA,IACXgB;AAAA,IACAL;AAAA,IACAT,KAAA,gBAAAA,EAAY;AAAA,IACZX;AAAA,IACAD;AAAA,IACAE;AAAA,IACAH;AAAA,IACAkB;AAAA,EAAA,CACD,GAEmCK,EAAY,MAAM;AACpD,IAAAd,EAAiB,EAAI;AAAA,EACvB,GAAG,CAAE,CAAA;AAGP,GAEAyB,IAAenC;"}
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createPostAPI as t } from "@cuemath/rest-api";
|
|
2
|
-
import { BASE_URL_V1 as e } from "../../../constants/api.js";
|
|
3
|
-
const { usePost: m } = t({
|
|
4
|
-
getURL: () => `${e}/utility/send-email`
|
|
5
|
-
});
|
|
6
|
-
export {
|
|
7
|
-
m as useSendEmail
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=send-email.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"send-email.js","sources":["../../../../src/features/fraud-detection/api/send-email.tsx"],"sourcesContent":["import { createPostAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../constants/api';\nimport { type IFraudEmailPayload } from '../hooks/report-fraud-types';\n\nexport const { usePost: useSendEmail } = createPostAPI<null, IFraudEmailPayload>({\n getURL: () => `${BASE_URL_V1}/utility/send-email`,\n});\n"],"names":["useSendEmail","createPostAPI","BASE_URL_V1"],"mappings":";;AAKO,MAAM,EAAE,SAASA,EAAa,IAAIC,EAAwC;AAAA,EAC/E,QAAQ,MAAM,GAAGC,CAAW;AAC9B,CAAC;"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
const p = ({
|
|
2
|
-
teacherId: t,
|
|
3
|
-
studentName: e,
|
|
4
|
-
studentId: o,
|
|
5
|
-
classStartTs: d,
|
|
6
|
-
teacherClassroomId: r,
|
|
7
|
-
studentClassroomId: l,
|
|
8
|
-
teacherUrl: a,
|
|
9
|
-
studentUrl: n
|
|
10
|
-
}) => `
|
|
11
|
-
<div style="font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; max-width: 800px; margin: 0 auto; background-color: #ffffff; padding: 30px; border: 1px solid #e0e0e0; border-radius: 8px;">
|
|
12
|
-
<h2 style="margin: 0; font-weight: 500;">A teacher has been flagged for breach of professional standards due to fraud login during a regular class session.</h2>
|
|
13
|
-
<h3 style=" margin: 30px 0 15px 0; font-size: 18px; font-weight: 600; padding-bottom: 8px;">📋 Evidence Captured:</h3>
|
|
14
|
-
<table style="border-collapse: collapse; width: 80%; margin: 20px auto; box-shadow: 0 2px 4px rgba(0,0,0,0.08); border-radius: 8px; overflow: hidden;">
|
|
15
|
-
<tbody>
|
|
16
|
-
<tr style="background-color: #f8f9fa;">
|
|
17
|
-
<td style="padding: 14px 16px; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: #424242; width: 40%;">Tutor ID</td>
|
|
18
|
-
<td style="padding: 14px 16px; border-bottom: 1px solid #e0e0e0; color: #212121;">${t}</td>
|
|
19
|
-
</tr>
|
|
20
|
-
<tr style="background-color: #ffffff;">
|
|
21
|
-
<td style="padding: 14px 16px; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: #424242;">Student Name</td>
|
|
22
|
-
<td style="padding: 14px 16px; border-bottom: 1px solid #e0e0e0; color: #212121;">${e}</td>
|
|
23
|
-
</tr>
|
|
24
|
-
<tr style="background-color: #f8f9fa;">
|
|
25
|
-
<td style="padding: 14px 16px; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: #424242;">Student ID</td>
|
|
26
|
-
<td style="padding: 14px 16px; border-bottom: 1px solid #e0e0e0; color: #212121;">${o}</td>
|
|
27
|
-
</tr>
|
|
28
|
-
<tr style="background-color: #ffffff;">
|
|
29
|
-
<td style="padding: 14px 16px; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: #424242;">Class Date & Time</td>
|
|
30
|
-
<td style="padding: 14px 16px; border-bottom: 1px solid #e0e0e0; color: #212121;">${new Date(
|
|
31
|
-
d * 1e3
|
|
32
|
-
).toLocaleString()}</td>
|
|
33
|
-
</tr>
|
|
34
|
-
<tr style="background-color: #f8f9fa;">
|
|
35
|
-
<td style="padding: 14px 16px; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: #424242;">Teacher Classroom ID</td>
|
|
36
|
-
<td style="padding: 14px 16px; border-bottom: 1px solid #e0e0e0; color: #212121; font-family: monospace; font-size: 13px;">${r}</td>
|
|
37
|
-
</tr>
|
|
38
|
-
<tr style="background-color: #ffffff;">
|
|
39
|
-
<td style="padding: 14px 16px; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: #424242;">Student Classroom ID</td>
|
|
40
|
-
<td style="padding: 14px 16px; border-bottom: 1px solid #e0e0e0; color: #212121; font-family: monospace; font-size: 13px;">${l}</td>
|
|
41
|
-
</tr>
|
|
42
|
-
<tr style="background-color: #f8f9fa;">
|
|
43
|
-
<td style="padding: 14px 16px; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: #424242;">Teacher Screenshot</td>
|
|
44
|
-
<td style="padding: 14px 16px; border-bottom: 1px solid #e0e0e0;">
|
|
45
|
-
<a href="${a}" style="color: #1976d2; text-decoration: none; font-weight: 500; display: inline-flex; align-items: center;">
|
|
46
|
-
<span style="margin-right: 6px;">🔗</span> View Screenshot
|
|
47
|
-
</a>
|
|
48
|
-
</td>
|
|
49
|
-
</tr>
|
|
50
|
-
<tr style="background-color: #ffffff;">
|
|
51
|
-
<td style="padding: 14px 16px; font-weight: 600; color: #424242;">Student Screenshot</td>
|
|
52
|
-
<td style="padding: 14px 16px;">
|
|
53
|
-
<a href="${n}" style="color: #1976d2; text-decoration: none; font-weight: 500; display: inline-flex; align-items: center;">
|
|
54
|
-
<span style="margin-right: 6px;">🔗</span> View Screenshot
|
|
55
|
-
</a>
|
|
56
|
-
</td>
|
|
57
|
-
</tr>
|
|
58
|
-
</tbody>
|
|
59
|
-
</table>
|
|
60
|
-
</div>
|
|
61
|
-
`;
|
|
62
|
-
export {
|
|
63
|
-
p as generateEmailBody
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=report-fraud-helper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"report-fraud-helper.js","sources":["../../../../src/features/fraud-detection/hooks/report-fraud-helper.ts"],"sourcesContent":["export const generateEmailBody = ({\n teacherId,\n studentName,\n studentId,\n classStartTs,\n teacherClassroomId,\n studentClassroomId,\n teacherUrl,\n studentUrl,\n}: {\n teacherId: string;\n studentName: string;\n studentId: string;\n classStartTs: number;\n teacherClassroomId: string;\n studentClassroomId: string;\n teacherUrl: string;\n studentUrl: string;\n}) => `\n <div style=\"font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; max-width: 800px; margin: 0 auto; background-color: #ffffff; padding: 30px; border: 1px solid #e0e0e0; border-radius: 8px;\">\n <h2 style=\"margin: 0; font-weight: 500;\">A teacher has been flagged for breach of professional standards due to fraud login during a regular class session.</h2>\n <h3 style=\" margin: 30px 0 15px 0; font-size: 18px; font-weight: 600; padding-bottom: 8px;\">📋 Evidence Captured:</h3>\n <table style=\"border-collapse: collapse; width: 80%; margin: 20px auto; box-shadow: 0 2px 4px rgba(0,0,0,0.08); border-radius: 8px; overflow: hidden;\">\n <tbody>\n <tr style=\"background-color: #f8f9fa;\">\n <td style=\"padding: 14px 16px; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: #424242; width: 40%;\">Tutor ID</td>\n <td style=\"padding: 14px 16px; border-bottom: 1px solid #e0e0e0; color: #212121;\">${teacherId}</td>\n </tr>\n <tr style=\"background-color: #ffffff;\">\n <td style=\"padding: 14px 16px; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: #424242;\">Student Name</td>\n <td style=\"padding: 14px 16px; border-bottom: 1px solid #e0e0e0; color: #212121;\">${studentName}</td>\n </tr>\n <tr style=\"background-color: #f8f9fa;\">\n <td style=\"padding: 14px 16px; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: #424242;\">Student ID</td>\n <td style=\"padding: 14px 16px; border-bottom: 1px solid #e0e0e0; color: #212121;\">${studentId}</td>\n </tr>\n <tr style=\"background-color: #ffffff;\">\n <td style=\"padding: 14px 16px; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: #424242;\">Class Date & Time</td>\n <td style=\"padding: 14px 16px; border-bottom: 1px solid #e0e0e0; color: #212121;\">${new Date(\n classStartTs * 1000,\n ).toLocaleString()}</td>\n </tr>\n <tr style=\"background-color: #f8f9fa;\">\n <td style=\"padding: 14px 16px; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: #424242;\">Teacher Classroom ID</td>\n <td style=\"padding: 14px 16px; border-bottom: 1px solid #e0e0e0; color: #212121; font-family: monospace; font-size: 13px;\">${teacherClassroomId}</td>\n </tr>\n <tr style=\"background-color: #ffffff;\">\n <td style=\"padding: 14px 16px; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: #424242;\">Student Classroom ID</td>\n <td style=\"padding: 14px 16px; border-bottom: 1px solid #e0e0e0; color: #212121; font-family: monospace; font-size: 13px;\">${studentClassroomId}</td>\n </tr>\n <tr style=\"background-color: #f8f9fa;\">\n <td style=\"padding: 14px 16px; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: #424242;\">Teacher Screenshot</td>\n <td style=\"padding: 14px 16px; border-bottom: 1px solid #e0e0e0;\">\n <a href=\"${teacherUrl}\" style=\"color: #1976d2; text-decoration: none; font-weight: 500; display: inline-flex; align-items: center;\">\n <span style=\"margin-right: 6px;\">🔗</span> View Screenshot\n </a>\n </td>\n </tr>\n <tr style=\"background-color: #ffffff;\">\n <td style=\"padding: 14px 16px; font-weight: 600; color: #424242;\">Student Screenshot</td>\n <td style=\"padding: 14px 16px;\">\n <a href=\"${studentUrl}\" style=\"color: #1976d2; text-decoration: none; font-weight: 500; display: inline-flex; align-items: center;\">\n <span style=\"margin-right: 6px;\">🔗</span> View Screenshot\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n`;\n"],"names":["generateEmailBody","teacherId","studentName","studentId","classStartTs","teacherClassroomId","studentClassroomId","teacherUrl","studentUrl"],"mappings":"AAAO,MAAMA,IAAoB,CAAC;AAAA,EAChC,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AACF,MASM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8FAQwFP,CAAS;AAAA;AAAA;AAAA;AAAA,8FAITC,CAAW;AAAA;AAAA;AAAA;AAAA,8FAIXC,CAAS;AAAA;AAAA;AAAA;AAAA,8FAIT,IAAI;AAAA,EACtFC,IAAe;AACjB,EAAE,gBAAgB;AAAA;AAAA;AAAA;AAAA,uIAI2GC,CAAkB;AAAA;AAAA;AAAA;AAAA,uIAIlBC,CAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,uBAKlIC,CAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAQVC,CAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|