@cuemath/leap 3.1.7 → 3.1.8-aa0
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/assets/illustrations/illustrations.js +1 -1
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/constants/country.js +994 -2
- package/dist/constants/country.js.map +1 -1
- package/dist/features/auth/account-selector/account-selector-styled.js +9 -0
- package/dist/features/auth/account-selector/account-selector-styled.js.map +1 -0
- package/dist/features/auth/account-selector/account-selector.js +60 -36
- package/dist/features/auth/account-selector/account-selector.js.map +1 -1
- package/dist/features/auth/comps/auth-page-layout/{auth-page-layout-styles.js → auth-page-layout-styled.js} +1 -1
- package/dist/features/auth/comps/auth-page-layout/{auth-page-layout-styles.js.map → auth-page-layout-styled.js.map} +1 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +20 -9
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
- package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js +1 -1
- package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js.map +1 -1
- package/dist/features/auth/forgot-password/forgot-password-styled.js +30 -4
- package/dist/features/auth/forgot-password/forgot-password-styled.js.map +1 -1
- package/dist/features/auth/forgot-password/otp-form/otp-form.js +27 -29
- package/dist/features/auth/forgot-password/otp-form/otp-form.js.map +1 -1
- package/dist/features/auth/forgot-password/reset-password-form/reset-password-form.js +22 -27
- package/dist/features/auth/forgot-password/reset-password-form/reset-password-form.js.map +1 -1
- package/dist/features/auth/forgot-password/user-identifier-form/user-identifier-form.js +25 -28
- package/dist/features/auth/forgot-password/user-identifier-form/user-identifier-form.js.map +1 -1
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js +17 -4
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js.map +1 -1
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form.js +88 -79
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form.js.map +1 -1
- package/dist/features/auth/login/login-styled.js +26 -0
- package/dist/features/auth/login/login-styled.js.map +1 -0
- package/dist/features/auth/login/social-account-not-found/social-account-not-found.js +27 -21
- package/dist/features/auth/login/social-account-not-found/social-account-not-found.js.map +1 -1
- package/dist/features/auth/login/social-login-methods/social-login-methods-styled.js +9 -0
- package/dist/features/auth/login/social-login-methods/social-login-methods-styled.js.map +1 -0
- package/dist/features/auth/login/social-login-methods/social-login-methods.js +43 -34
- package/dist/features/auth/login/social-login-methods/social-login-methods.js.map +1 -1
- package/dist/features/auth/login/username-password-form/username-password-form.js +68 -71
- package/dist/features/auth/login/username-password-form/username-password-form.js.map +1 -1
- package/dist/features/auth/signup/custom-input-field/country-selector/country-list-menu.js +1 -1
- package/dist/features/auth/signup/custom-input-field/country-selector/country-list-menu.js.map +1 -1
- package/dist/features/auth/signup/signup-constants.js +6 -998
- package/dist/features/auth/signup/signup-constants.js.map +1 -1
- package/dist/features/auth/user-list/user-item/user-item.js +33 -32
- package/dist/features/auth/user-list/user-item/user-item.js.map +1 -1
- package/dist/features/auth/user-list/user-list.js +60 -51
- package/dist/features/auth/user-list/user-list.js.map +1 -1
- package/dist/features/hooks/use-viewport/use-viewport.js +21 -0
- package/dist/features/hooks/use-viewport/use-viewport.js.map +1 -0
- package/dist/features/ui/buttons/button/button-styled.js +29 -29
- package/dist/features/ui/buttons/button/button-styled.js.map +1 -1
- package/dist/features/utils/media.js +16 -0
- package/dist/features/utils/media.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-question/subjective-feedback.js +60 -60
- package/dist/features/worksheet/worksheet/worksheet-question/subjective-feedback.js.map +1 -1
- package/dist/index.d.ts +22 -15
- package/dist/index.js +56 -52
- package/dist/index.js.map +1 -1
- package/dist/static/cuemath-app-qr-code.7205ee79.svg +1 -0
- package/package.json +1 -1
@@ -1,109 +1,109 @@
|
|
1
1
|
import { jsx as e, jsxs as l, Fragment as M } from "react/jsx-runtime";
|
2
2
|
import { h as ee } from "../../../../node_modules/humanize-plus/dist/humanize.js";
|
3
|
-
import { memo as te, useState as
|
3
|
+
import { memo as te, useState as y, useMemo as A, useCallback as s } from "react";
|
4
4
|
import re from "../../../../assets/line-icons/icons/down.js";
|
5
5
|
import ie from "../../../../assets/line-icons/icons/up.js";
|
6
|
-
import
|
7
|
-
import
|
6
|
+
import R from "../../../ui/buttons/button/button.js";
|
7
|
+
import D from "../../../ui/buttons/clickable/clickable.js";
|
8
8
|
import ce from "../../../ui/buttons/text-button/text-button.js";
|
9
9
|
import m from "../../../ui/layout/flex-view.js";
|
10
10
|
import u from "../../../ui/separator/separator.js";
|
11
11
|
import f from "../../../ui/text/text.js";
|
12
|
-
import
|
13
|
-
import { TextArea as
|
14
|
-
const se = { type: "subjective_response" },
|
12
|
+
import oe from "../hooks/use-s3-helper.js";
|
13
|
+
import { TextArea as ne, FileInputLabel as le, FileInput as ae } from "./subjective-styled.js";
|
14
|
+
const se = { type: "subjective_response" }, Ie = te(
|
15
15
|
({
|
16
|
-
responses:
|
17
|
-
response:
|
18
|
-
nextQuestionId:
|
16
|
+
responses: S,
|
17
|
+
response: r,
|
18
|
+
nextQuestionId: x,
|
19
19
|
responseId: h,
|
20
|
-
studentId:
|
20
|
+
studentId: E,
|
21
21
|
onAddReviewComment: g,
|
22
22
|
openImagesReviewModal: b,
|
23
|
-
handleReviewSubmit:
|
24
|
-
isSubmittingReview:
|
23
|
+
handleReviewSubmit: L,
|
24
|
+
isSubmittingReview: z
|
25
25
|
}) => {
|
26
|
-
var
|
27
|
-
const { score:
|
28
|
-
((
|
29
|
-
),
|
30
|
-
var t,
|
31
|
-
return ((t =
|
32
|
-
}, [d,
|
33
|
-
var
|
34
|
-
if (!
|
26
|
+
var F, T;
|
27
|
+
const { score: B } = r ?? {}, { max_score: $, score: H } = B ?? {}, O = (r == null ? void 0 : r.response) !== void 0, [d, _] = y(((F = r == null ? void 0 : r.teacherReview) == null ? void 0 : F.reviewComment) ?? ""), [q, j] = y(!1), [c, U] = y(H ?? 0), [o, C] = y(
|
28
|
+
((T = r == null ? void 0 : r.teacherReview) == null ? void 0 : T.images) ?? []
|
29
|
+
), v = o.length, K = A(() => {
|
30
|
+
var t, i, n;
|
31
|
+
return ((t = r == null ? void 0 : r.teacherReview) == null ? void 0 : t.reviewComment) === d && ((i = r.teacherReview.images) == null ? void 0 : i.length) === o.length && ((n = r.score) == null ? void 0 : n.score) === c;
|
32
|
+
}, [d, r, c, o.length]), W = A(() => {
|
33
|
+
var i, n, a, p;
|
34
|
+
if (!S) return !1;
|
35
35
|
let t = !0;
|
36
|
-
for (const
|
37
|
-
const P = !!
|
36
|
+
for (const w of Object.values(S)) {
|
37
|
+
const P = !!w.response, Z = ((i = w.teacherReview) == null ? void 0 : i.images) && ((a = (n = w.teacherReview) == null ? void 0 : n.images) == null ? void 0 : a.length) > 0 || !!((p = w.teacherReview) != null && p.reviewComment);
|
38
38
|
if (P && !Z) {
|
39
39
|
t = !1;
|
40
40
|
break;
|
41
41
|
}
|
42
42
|
}
|
43
43
|
return t;
|
44
|
-
}, [
|
45
|
-
studentId:
|
44
|
+
}, [S]), k = oe({
|
45
|
+
studentId: E,
|
46
46
|
query: se
|
47
47
|
}), N = s((t) => {
|
48
|
-
|
48
|
+
_(t.target.value);
|
49
49
|
}, []), Q = s(() => {
|
50
|
-
|
50
|
+
U(c + 0.5);
|
51
51
|
}, [c]), V = s(() => {
|
52
|
-
|
52
|
+
U(c - 0.5);
|
53
53
|
}, [c]), I = s(
|
54
54
|
(t) => {
|
55
|
-
|
56
|
-
const
|
57
|
-
t &&
|
55
|
+
j(!1);
|
56
|
+
const i = o.filter((a) => typeof a == "string"), n = t ? [...i, ...t] : i;
|
57
|
+
t && C(n), g == null || g(h, {
|
58
58
|
score: {
|
59
59
|
score: c,
|
60
|
-
max_score:
|
60
|
+
max_score: $
|
61
61
|
},
|
62
62
|
teacherReview: {
|
63
63
|
reviewComment: d,
|
64
|
-
images:
|
64
|
+
images: n
|
65
65
|
}
|
66
66
|
});
|
67
67
|
},
|
68
|
-
[d,
|
68
|
+
[d, $, g, h, c, o]
|
69
69
|
), Y = s(() => {
|
70
|
-
const t =
|
71
|
-
t.length > 0 ? (
|
70
|
+
const t = o.filter((i) => typeof i != "string");
|
71
|
+
t.length > 0 ? (j(!0), k({
|
72
72
|
fileKey: `subjective-responses/${h}/`,
|
73
73
|
onSuccess: I,
|
74
74
|
onError: () => {
|
75
75
|
},
|
76
76
|
images: t
|
77
77
|
})) : I();
|
78
|
-
}, [I, h,
|
78
|
+
}, [I, h, o, k]), X = s(
|
79
79
|
({ filteredImages: t }) => {
|
80
|
-
|
80
|
+
C(t);
|
81
81
|
},
|
82
82
|
[]
|
83
83
|
), G = s(() => {
|
84
|
-
const t =
|
84
|
+
const t = o.map((i) => typeof i == "string" ? i : i.url);
|
85
85
|
t && (b == null || b({
|
86
86
|
isReviewed: !1,
|
87
87
|
disableScoreForm: !1,
|
88
88
|
imageUrls: t,
|
89
|
-
filteredImageUrls:
|
90
|
-
uploadedImages:
|
89
|
+
filteredImageUrls: X,
|
90
|
+
uploadedImages: o
|
91
91
|
}));
|
92
|
-
}, [b,
|
93
|
-
const { files:
|
94
|
-
if (!
|
95
|
-
const
|
96
|
-
const
|
97
|
-
return { file: a, url:
|
92
|
+
}, [b, X, o]), J = s((t) => {
|
93
|
+
const { files: i } = t.currentTarget;
|
94
|
+
if (!i) return;
|
95
|
+
const n = Array.from(i).map((a) => {
|
96
|
+
const p = URL.createObjectURL(a);
|
97
|
+
return { file: a, url: p };
|
98
98
|
});
|
99
|
-
|
99
|
+
C((a) => [...a, ...n]);
|
100
100
|
}, []);
|
101
|
-
return
|
101
|
+
return r ? !O && x ? /* @__PURE__ */ e(f, { $renderAs: "body1", children: " The student did not attempt this questions." }) : /* @__PURE__ */ l(M, { children: [
|
102
102
|
/* @__PURE__ */ l(m, { $flexDirection: "row", $justifyContent: "space-between", children: [
|
103
103
|
/* @__PURE__ */ l(m, { children: [
|
104
104
|
/* @__PURE__ */ l(f, { $renderAs: "body3", children: [
|
105
105
|
"Score (out of ",
|
106
|
-
|
106
|
+
$,
|
107
107
|
")"
|
108
108
|
] }),
|
109
109
|
/* @__PURE__ */ e(u, { heightX: 1 }),
|
@@ -122,16 +122,16 @@ const se = { type: "subjective_response" }, xe = te(
|
|
122
122
|
),
|
123
123
|
/* @__PURE__ */ e(u, { width: 16 }),
|
124
124
|
/* @__PURE__ */ l(m, { $background: "WHITE", $gutterX: 0.5, $gapX: 0.5, children: [
|
125
|
-
/* @__PURE__ */ e(
|
125
|
+
/* @__PURE__ */ e(D, { label: "up", onClick: Q, disabled: c === $, children: /* @__PURE__ */ e(ie, {}) }),
|
126
126
|
/* @__PURE__ */ e(u, { height: 16 }),
|
127
|
-
/* @__PURE__ */ e(
|
127
|
+
/* @__PURE__ */ e(D, { label: "down", onClick: V, disabled: c === 0, children: /* @__PURE__ */ e(re, {}) })
|
128
128
|
] })
|
129
129
|
] })
|
130
130
|
] }),
|
131
131
|
/* @__PURE__ */ l(m, { children: [
|
132
132
|
/* @__PURE__ */ e(f, { $renderAs: "body1", children: "Comments" }),
|
133
133
|
/* @__PURE__ */ e(u, { heightX: 1 }),
|
134
|
-
/* @__PURE__ */ e(
|
134
|
+
/* @__PURE__ */ e(ne, { value: d, onChange: N })
|
135
135
|
] }),
|
136
136
|
/* @__PURE__ */ l(m, { $alignItems: "center", children: [
|
137
137
|
/* @__PURE__ */ l(f, { $renderAs: "body1", children: [
|
@@ -155,7 +155,7 @@ const se = { type: "subjective_response" }, xe = te(
|
|
155
155
|
ce,
|
156
156
|
{
|
157
157
|
onClick: G,
|
158
|
-
label:
|
158
|
+
label: v ? `${v} ${ee.pluralize(v, "file")}` : "No files"
|
159
159
|
}
|
160
160
|
)
|
161
161
|
] })
|
@@ -170,7 +170,7 @@ const se = { type: "subjective_response" }, xe = te(
|
|
170
170
|
$gapX: 1,
|
171
171
|
children: [
|
172
172
|
/* @__PURE__ */ e(
|
173
|
-
|
173
|
+
R,
|
174
174
|
{
|
175
175
|
widthX: 6,
|
176
176
|
renderAs: "secondary",
|
@@ -182,15 +182,15 @@ const se = { type: "subjective_response" }, xe = te(
|
|
182
182
|
}
|
183
183
|
),
|
184
184
|
/* @__PURE__ */ e(u, { width: 20 }),
|
185
|
-
!
|
186
|
-
|
185
|
+
!x && /* @__PURE__ */ e(
|
186
|
+
R,
|
187
187
|
{
|
188
188
|
widthX: 6,
|
189
189
|
renderAs: "secondary",
|
190
190
|
size: "small",
|
191
191
|
label: "Submit Review",
|
192
|
-
onClick:
|
193
|
-
busy:
|
192
|
+
onClick: L,
|
193
|
+
busy: z,
|
194
194
|
disabled: !W
|
195
195
|
}
|
196
196
|
)
|
@@ -201,6 +201,6 @@ const se = { type: "subjective_response" }, xe = te(
|
|
201
201
|
}
|
202
202
|
);
|
203
203
|
export {
|
204
|
-
|
204
|
+
Ie as default
|
205
205
|
};
|
206
206
|
//# sourceMappingURL=subjective-feedback.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subjective-feedback.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-question/subjective-feedback.tsx"],"sourcesContent":["import type { ISubjectiveQuestionReviewProps, IFile } from './subjective-review';\nimport type { FC } from 'react';\n\nimport { pluralize } from 'humanize-plus';\nimport { memo, useCallback, useMemo, useState } from 'react';\n\nimport DownIcon from '../../../../assets/line-icons/icons/down';\nimport UpIcon from '../../../../assets/line-icons/icons/up';\nimport Button from '../../../ui/buttons/button/button';\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport useS3ImageUploadHelper from '../hooks/use-s3-helper';\nimport { TextArea, FileInput, FileInputLabel } from './subjective-styled';\n\nconst QUERY = { type: 'subjective_response' };\n\nconst SubjectiveQuestionFeedback: FC<ISubjectiveQuestionReviewProps> = memo(\n ({\n responses,\n response,\n nextQuestionId,\n responseId,\n studentId,\n onAddReviewComment,\n openImagesReviewModal,\n handleReviewSubmit,\n isSubmittingReview,\n }) => {\n const { score: responseScore } = response ?? {};\n const { max_score: maxScore, score } = responseScore ?? {};\n const isAttempted = responseScore && 'score' in responseScore && 'max_score' in responseScore;\n const [comment, setComment] = useState(response?.teacherReview?.reviewComment ?? '');\n const [isUploading, setIsUploading] = useState<boolean>(false);\n const [scored, setScored] = useState(score ?? 0.0);\n const [selectedImages, setSelectedImage] = useState<(string | IFile)[]>(\n response?.teacherReview?.images ?? [],\n );\n const noOfImages = selectedImages.length;\n const isSaveDisabled = useMemo(() => {\n if (\n response?.teacherReview?.reviewComment === comment &&\n response.teacherReview.images?.length === selectedImages.length &&\n response.score?.score === scored\n ) {\n return true;\n }\n\n return false;\n }, [comment, response, scored, selectedImages.length]);\n\n const canSubmitReview = useMemo(() => {\n if (!responses) return false;\n\n let canSubmit = true;\n\n for (const item of Object.values(responses)) {\n const currResponse = item.response;\n\n const isCurrItemAttempted = !!currResponse;\n const currentItemReviewed =\n (item.teacherReview?.images && item.teacherReview?.images?.length > 0) ||\n !!item.teacherReview?.reviewComment;\n\n if (isCurrItemAttempted && !currentItemReviewed) {\n canSubmit = false;\n break;\n }\n }\n\n return canSubmit;\n }, [responses]);\n\n const uploadImages = useS3ImageUploadHelper({\n studentId,\n query: QUERY,\n });\n\n const onCommentChange = useCallback((e: { target: { value: string } }) => {\n setComment(e.target.value);\n }, []);\n\n const onScoreUp = useCallback(() => {\n setScored(scored + 0.5);\n }, [scored]);\n\n const onScoreDown = useCallback(() => {\n setScored(scored - 0.5);\n }, [scored]);\n\n const onSuccess = useCallback(\n (images?: string[]) => {\n setIsUploading(false);\n const reponseImages = selectedImages.filter(item => typeof item === 'string');\n const allImages = images ? [...reponseImages, ...images] : reponseImages;\n\n if (images) {\n setSelectedImage(allImages);\n }\n onAddReviewComment?.(responseId, {\n score: {\n score: scored,\n max_score: maxScore as number,\n },\n teacherReview: {\n reviewComment: comment,\n images: allImages,\n },\n });\n },\n [comment, maxScore, onAddReviewComment, responseId, scored, selectedImages],\n );\n\n const handleSave = useCallback(() => {\n const imagesToUpload = selectedImages.filter(images => typeof images !== 'string');\n\n if (imagesToUpload.length > 0) {\n setIsUploading(true);\n uploadImages({\n fileKey: `subjective-responses/${responseId}/`,\n onSuccess: onSuccess,\n onError: () => {},\n images: imagesToUpload,\n });\n } else {\n onSuccess();\n }\n }, [onSuccess, responseId, selectedImages, uploadImages]);\n\n const updateImages = useCallback(\n ({ filteredImages }: { filteredImages: string[]; newImages: IFile[] }) => {\n setSelectedImage(filteredImages);\n },\n [],\n );\n\n const openImagesModal = useCallback(() => {\n const previewImages = selectedImages.map(item => {\n if (typeof item === 'string') return item;\n\n return item.url;\n });\n\n if (!previewImages) return;\n\n openImagesReviewModal?.({\n isReviewed: false,\n disableScoreForm: false,\n imageUrls: previewImages,\n filteredImageUrls: updateImages,\n uploadedImages: selectedImages,\n });\n }, [openImagesReviewModal, updateImages, selectedImages]);\n\n const onSelectImages = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\n const { files } = e.currentTarget;\n\n if (!files) return;\n\n const newFilesList = Array.from(files).map(file => {\n const url = URL.createObjectURL(file);\n\n return { file, url };\n });\n\n setSelectedImage(prevImages => [...prevImages, ...newFilesList]);\n }, []);\n\n if (!response) {\n return null;\n }\n\n if (!isAttempted && nextQuestionId) {\n return <Text $renderAs=\"body1\"> The student did not attempt this questions.</Text>;\n }\n\n return (\n <>\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\">\n <FlexView>\n <Text $renderAs=\"body3\">Score (out of {maxScore})</Text>\n <Separator heightX={1} />\n <FlexView $flexDirection=\"row\" $gapX={0.5}>\n <FlexView\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $borderColor=\"BLACK\"\n $width={50}\n $height={50}\n $background=\"WHITE\"\n >\n <Text $renderAs=\"body1\">{scored}</Text>\n </FlexView>\n <Separator width={16} />\n <FlexView $background=\"WHITE\" $gutterX={0.5} $gapX={0.5}>\n <Clickable label=\"up\" onClick={onScoreUp} disabled={scored === maxScore}>\n <UpIcon />\n </Clickable>\n <Separator height={16} />\n <Clickable label=\"down\" onClick={onScoreDown} disabled={scored === 0}>\n <DownIcon />\n </Clickable>\n </FlexView>\n </FlexView>\n </FlexView>\n <FlexView>\n <Text $renderAs=\"body1\">Comments</Text>\n <Separator heightX={1} />\n <TextArea value={comment} onChange={onCommentChange} />\n </FlexView>\n <FlexView $alignItems=\"center\">\n <Text $renderAs=\"body1\">\n Upload Images <small>(max 12)</small>\n </Text>\n <Separator heightX={1} />\n <FileInputLabel htmlFor={`files${responseId}`}>Browse</FileInputLabel>\n <Separator heightX={1} />\n <FileInput\n type=\"file\"\n accept=\".jpeg, .jpg, .png\"\n id={`files${responseId}`}\n multiple\n onChange={onSelectImages}\n />\n <TextButton\n onClick={openImagesModal}\n label={noOfImages ? `${noOfImages} ${pluralize(noOfImages, 'file')}` : 'No files'}\n />\n </FlexView>\n </FlexView>\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $gutterX={1}\n $gapX={1}\n >\n <Button\n widthX={6}\n renderAs=\"secondary\"\n size=\"small\"\n label=\"Save\"\n onClick={handleSave}\n busy={isUploading}\n disabled={isSaveDisabled}\n />\n <Separator width={20} />\n {!nextQuestionId && (\n <Button\n widthX={6}\n renderAs=\"secondary\"\n size=\"small\"\n label=\"Submit Review\"\n onClick={handleReviewSubmit}\n busy={isSubmittingReview}\n disabled={!canSubmitReview}\n />\n )}\n </FlexView>\n </>\n );\n },\n);\n\nexport default SubjectiveQuestionFeedback;\n"],"names":["QUERY","SubjectiveQuestionFeedback","memo","responses","response","nextQuestionId","responseId","studentId","onAddReviewComment","openImagesReviewModal","handleReviewSubmit","isSubmittingReview","responseScore","maxScore","score","isAttempted","comment","setComment","useState","_a","isUploading","setIsUploading","scored","setScored","selectedImages","setSelectedImage","_b","noOfImages","isSaveDisabled","useMemo","_c","canSubmitReview","canSubmit","item","isCurrItemAttempted","currentItemReviewed","_d","uploadImages","useS3ImageUploadHelper","onCommentChange","useCallback","e","onScoreUp","onScoreDown","onSuccess","images","reponseImages","allImages","handleSave","imagesToUpload","updateImages","filteredImages","openImagesModal","previewImages","onSelectImages","files","newFilesList","file","url","prevImages","jsx","Text","jsxs","Fragment","FlexView","Separator","Clickable","UpIcon","DownIcon","TextArea","FileInputLabel","FileInput","TextButton","pluralize","Button"],"mappings":";;;;;;;;;;;;;AAiBA,MAAMA,KAAQ,EAAE,MAAM,yBAEhBC,KAAiEC;AAAA,EACrE,CAAC;AAAA,IACC,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,MACI;;AACJ,UAAM,EAAE,OAAOC,MAAkBR,KAAY,CAAA,GACvC,EAAE,WAAWS,GAAU,OAAAC,EAAM,IAAIF,KAAiB,CAAA,GAClDG,IAAcH,KAAiB,WAAWA,KAAiB,eAAeA,GAC1E,CAACI,GAASC,CAAU,IAAIC,IAASC,IAAAf,KAAA,gBAAAA,EAAU,kBAAV,gBAAAe,EAAyB,kBAAiB,EAAE,GAC7E,CAACC,GAAaC,CAAc,IAAIH,EAAkB,EAAK,GACvD,CAACI,GAAQC,CAAS,IAAIL,EAASJ,KAAS,CAAG,GAC3C,CAACU,GAAgBC,CAAgB,IAAIP;AAAA,QACzCQ,IAAAtB,KAAA,gBAAAA,EAAU,kBAAV,gBAAAsB,EAAyB,WAAU,CAAC;AAAA,IAAA,GAEhCC,IAAaH,EAAe,QAC5BI,IAAiBC,EAAQ,MAAM;;AACnC,eACEV,IAAAf,KAAA,gBAAAA,EAAU,kBAAV,gBAAAe,EAAyB,mBAAkBH,OAC3CU,IAAAtB,EAAS,cAAc,WAAvB,gBAAAsB,EAA+B,YAAWF,EA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;AAAA,MACA,gBAAAmC;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,gBAAe;AAAA,UACf,aAAY;AAAA,UACZ,iBAAgB;AAAA,UAChB,UAAU;AAAA,UACV,OAAO;AAAA,UAEP,UAAA;AAAA,YAAA,gBAAAJ;AAAA,cAACc;AAAA,cAAA;AAAA,gBACC,QAAQ;AAAA,gBACR,UAAS;AAAA,gBACT,MAAK;AAAA,gBACL,OAAM;AAAA,gBACN,SAAS1B;AAAA,gBACT,MAAM5B;AAAA,gBACN,UAAUQ;AAAA,cAAA;AAAA,YACZ;AAAA,YACA,gBAAAgC,EAACK,GAAU,EAAA,OAAO,GAAI,CAAA;AAAA,YACrB,CAAC5D,KACA,gBAAAuD;AAAA,cAACc;AAAA,cAAA;AAAA,gBACC,QAAQ;AAAA,gBACR,UAAS;AAAA,gBACT,MAAK;AAAA,gBACL,OAAM;AAAA,gBACN,SAAShE;AAAA,gBACT,MAAMC;AAAA,gBACN,UAAU,CAACoB;AAAA,cAAA;AAAA,YACb;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IACF,EAAA,CAAA,IA1FO;AAAA,EA4FX;AACF;"}
|
1
|
+
{"version":3,"file":"subjective-feedback.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-question/subjective-feedback.tsx"],"sourcesContent":["import type { ISubjectiveQuestionReviewProps, IFile } from './subjective-review';\nimport type { FC } from 'react';\n\nimport { pluralize } from 'humanize-plus';\nimport { memo, useCallback, useMemo, useState } from 'react';\n\nimport DownIcon from '../../../../assets/line-icons/icons/down';\nimport UpIcon from '../../../../assets/line-icons/icons/up';\nimport Button from '../../../ui/buttons/button/button';\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport useS3ImageUploadHelper from '../hooks/use-s3-helper';\nimport { TextArea, FileInput, FileInputLabel } from './subjective-styled';\n\nconst QUERY = { type: 'subjective_response' };\n\nconst SubjectiveQuestionFeedback: FC<ISubjectiveQuestionReviewProps> = memo(\n ({\n responses,\n response,\n nextQuestionId,\n responseId,\n studentId,\n onAddReviewComment,\n openImagesReviewModal,\n handleReviewSubmit,\n isSubmittingReview,\n }) => {\n const { score: responseScore } = response ?? {};\n const { max_score: maxScore, score } = responseScore ?? {};\n const isAttempted = response?.response !== undefined;\n const [comment, setComment] = useState(response?.teacherReview?.reviewComment ?? '');\n const [isUploading, setIsUploading] = useState<boolean>(false);\n const [scored, setScored] = useState(score ?? 0.0);\n const [selectedImages, setSelectedImage] = useState<(string | IFile)[]>(\n response?.teacherReview?.images ?? [],\n );\n const noOfImages = selectedImages.length;\n const isSaveDisabled = useMemo(() => {\n if (\n response?.teacherReview?.reviewComment === comment &&\n response.teacherReview.images?.length === selectedImages.length &&\n response.score?.score === scored\n ) {\n return true;\n }\n\n return false;\n }, [comment, response, scored, selectedImages.length]);\n\n const canSubmitReview = useMemo(() => {\n if (!responses) return false;\n\n let canSubmit = true;\n\n for (const item of Object.values(responses)) {\n const currResponse = item.response;\n\n const isCurrItemAttempted = !!currResponse;\n const currentItemReviewed =\n (item.teacherReview?.images && item.teacherReview?.images?.length > 0) ||\n !!item.teacherReview?.reviewComment;\n\n if (isCurrItemAttempted && !currentItemReviewed) {\n canSubmit = false;\n break;\n }\n }\n\n return canSubmit;\n }, [responses]);\n\n const uploadImages = useS3ImageUploadHelper({\n studentId,\n query: QUERY,\n });\n\n const onCommentChange = useCallback((e: { target: { value: string } }) => {\n setComment(e.target.value);\n }, []);\n\n const onScoreUp = useCallback(() => {\n setScored(scored + 0.5);\n }, [scored]);\n\n const onScoreDown = useCallback(() => {\n setScored(scored - 0.5);\n }, [scored]);\n\n const onSuccess = useCallback(\n (images?: string[]) => {\n setIsUploading(false);\n const reponseImages = selectedImages.filter(item => typeof item === 'string');\n const allImages = images ? [...reponseImages, ...images] : reponseImages;\n\n if (images) {\n setSelectedImage(allImages);\n }\n onAddReviewComment?.(responseId, {\n score: {\n score: scored,\n max_score: maxScore as number,\n },\n teacherReview: {\n reviewComment: comment,\n images: allImages,\n },\n });\n },\n [comment, maxScore, onAddReviewComment, responseId, scored, selectedImages],\n );\n\n const handleSave = useCallback(() => {\n const imagesToUpload = selectedImages.filter(images => typeof images !== 'string');\n\n if (imagesToUpload.length > 0) {\n setIsUploading(true);\n uploadImages({\n fileKey: `subjective-responses/${responseId}/`,\n onSuccess: onSuccess,\n onError: () => {},\n images: imagesToUpload,\n });\n } else {\n onSuccess();\n }\n }, [onSuccess, responseId, selectedImages, uploadImages]);\n\n const updateImages = useCallback(\n ({ filteredImages }: { filteredImages: string[]; newImages: IFile[] }) => {\n setSelectedImage(filteredImages);\n },\n [],\n );\n\n const openImagesModal = useCallback(() => {\n const previewImages = selectedImages.map(item => {\n if (typeof item === 'string') return item;\n\n return item.url;\n });\n\n if (!previewImages) return;\n\n openImagesReviewModal?.({\n isReviewed: false,\n disableScoreForm: false,\n imageUrls: previewImages,\n filteredImageUrls: updateImages,\n uploadedImages: selectedImages,\n });\n }, [openImagesReviewModal, updateImages, selectedImages]);\n\n const onSelectImages = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\n const { files } = e.currentTarget;\n\n if (!files) return;\n\n const newFilesList = Array.from(files).map(file => {\n const url = URL.createObjectURL(file);\n\n return { file, url };\n });\n\n setSelectedImage(prevImages => [...prevImages, ...newFilesList]);\n }, []);\n\n if (!response) {\n return null;\n }\n\n if (!isAttempted && nextQuestionId) {\n return <Text $renderAs=\"body1\"> The student did not attempt this questions.</Text>;\n }\n\n return (\n <>\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\">\n <FlexView>\n <Text $renderAs=\"body3\">Score (out of {maxScore})</Text>\n <Separator heightX={1} />\n <FlexView $flexDirection=\"row\" $gapX={0.5}>\n <FlexView\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $borderColor=\"BLACK\"\n $width={50}\n $height={50}\n $background=\"WHITE\"\n >\n <Text $renderAs=\"body1\">{scored}</Text>\n </FlexView>\n <Separator width={16} />\n <FlexView $background=\"WHITE\" $gutterX={0.5} $gapX={0.5}>\n <Clickable label=\"up\" onClick={onScoreUp} disabled={scored === maxScore}>\n <UpIcon />\n </Clickable>\n <Separator height={16} />\n <Clickable label=\"down\" onClick={onScoreDown} disabled={scored === 0}>\n <DownIcon />\n </Clickable>\n </FlexView>\n </FlexView>\n </FlexView>\n <FlexView>\n <Text $renderAs=\"body1\">Comments</Text>\n <Separator heightX={1} />\n <TextArea value={comment} onChange={onCommentChange} />\n </FlexView>\n <FlexView $alignItems=\"center\">\n <Text $renderAs=\"body1\">\n Upload Images <small>(max 12)</small>\n </Text>\n <Separator heightX={1} />\n <FileInputLabel htmlFor={`files${responseId}`}>Browse</FileInputLabel>\n <Separator heightX={1} />\n <FileInput\n type=\"file\"\n accept=\".jpeg, .jpg, .png\"\n id={`files${responseId}`}\n multiple\n onChange={onSelectImages}\n />\n <TextButton\n onClick={openImagesModal}\n label={noOfImages ? `${noOfImages} ${pluralize(noOfImages, 'file')}` : 'No files'}\n />\n </FlexView>\n </FlexView>\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $gutterX={1}\n $gapX={1}\n >\n <Button\n widthX={6}\n renderAs=\"secondary\"\n size=\"small\"\n label=\"Save\"\n onClick={handleSave}\n busy={isUploading}\n disabled={isSaveDisabled}\n />\n <Separator width={20} />\n {!nextQuestionId && (\n <Button\n widthX={6}\n renderAs=\"secondary\"\n size=\"small\"\n label=\"Submit Review\"\n onClick={handleReviewSubmit}\n busy={isSubmittingReview}\n disabled={!canSubmitReview}\n />\n )}\n </FlexView>\n </>\n );\n },\n);\n\nexport default SubjectiveQuestionFeedback;\n"],"names":["QUERY","SubjectiveQuestionFeedback","memo","responses","response","nextQuestionId","responseId","studentId","onAddReviewComment","openImagesReviewModal","handleReviewSubmit","isSubmittingReview","responseScore","maxScore","score","isAttempted","comment","setComment","useState","_a","isUploading","setIsUploading","scored","setScored","selectedImages","setSelectedImage","_b","noOfImages","isSaveDisabled","useMemo","_c","canSubmitReview","canSubmit","item","isCurrItemAttempted","currentItemReviewed","_d","uploadImages","useS3ImageUploadHelper","onCommentChange","useCallback","e","onScoreUp","onScoreDown","onSuccess","images","reponseImages","allImages","handleSave","imagesToUpload","updateImages","filteredImages","openImagesModal","previewImages","onSelectImages","files","newFilesList","file","url","prevImages","jsx","Text","jsxs","Fragment","FlexView","Separator","Clickable","UpIcon","DownIcon","TextArea","FileInputLabel","FileInput","TextButton","pluralize","Button"],"mappings":";;;;;;;;;;;;;AAiBA,MAAMA,KAAQ,EAAE,MAAM,yBAEhBC,KAAiEC;AAAA,EACrE,CAAC;AAAA,IACC,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,MACI;;AACJ,UAAM,EAAE,OAAOC,MAAkBR,KAAY,CAAA,GACvC,EAAE,WAAWS,GAAU,OAAAC,EAAM,IAAIF,KAAiB,CAAA,GAClDG,KAAcX,KAAA,gBAAAA,EAAU,cAAa,QACrC,CAACY,GAASC,CAAU,IAAIC,IAASC,IAAAf,KAAA,gBAAAA,EAAU,kBAAV,gBAAAe,EAAyB,kBAAiB,EAAE,GAC7E,CAACC,GAAaC,CAAc,IAAIH,EAAkB,EAAK,GACvD,CAACI,GAAQC,CAAS,IAAIL,EAASJ,KAAS,CAAG,GAC3C,CAACU,GAAgBC,CAAgB,IAAIP;AAAA,QACzCQ,IAAAtB,KAAA,gBAAAA,EAAU,kBAAV,gBAAAsB,EAAyB,WAAU,CAAC;AAAA,IAAA,GAEhCC,IAAaH,EAAe,QAC5BI,IAAiBC,EAAQ,MAAM;;AACnC,eACEV,IAAAf,KAAA,gBAAAA,EAAU,kBAAV,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AAA9C,GAAY,MAAM,CAAC,KAAK;AAAA,YAAA;AAAA,UACzE;AAAA,QAAA,GACF;AAAA,MAAA,GACF;AAAA,MACA,gBAAAmC;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,gBAAe;AAAA,UACf,aAAY;AAAA,UACZ,iBAAgB;AAAA,UAChB,UAAU;AAAA,UACV,OAAO;AAAA,UAEP,UAAA;AAAA,YAAA,gBAAAJ;AAAA,cAACc;AAAA,cAAA;AAAA,gBACC,QAAQ;AAAA,gBACR,UAAS;AAAA,gBACT,MAAK;AAAA,gBACL,OAAM;AAAA,gBACN,SAAS1B;AAAA,gBACT,MAAM5B;AAAA,gBACN,UAAUQ;AAAA,cAAA;AAAA,YACZ;AAAA,YACA,gBAAAgC,EAACK,GAAU,EAAA,OAAO,GAAI,CAAA;AAAA,YACrB,CAAC5D,KACA,gBAAAuD;AAAA,cAACc;AAAA,cAAA;AAAA,gBACC,QAAQ;AAAA,gBACR,UAAS;AAAA,gBACT,MAAK;AAAA,gBACL,OAAM;AAAA,gBACN,SAAShE;AAAA,gBACT,MAAMC;AAAA,gBACN,UAAU,CAACoB;AAAA,cAAA;AAAA,YACb;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IACF,EAAA,CAAA,IA1FO;AAAA,EA4FX;AACF;"}
|
package/dist/index.d.ts
CHANGED
@@ -758,7 +758,7 @@ declare interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>,
|
|
758
758
|
shape?: 'curved' | 'square';
|
759
759
|
disabled?: boolean;
|
760
760
|
busy?: boolean;
|
761
|
-
width?: number;
|
761
|
+
width?: number | string;
|
762
762
|
widthX?: number;
|
763
763
|
Icon?: React.FC<React.SVGProps<SVGSVGElement>>;
|
764
764
|
iconPosition?: 'left' | 'right';
|
@@ -1168,16 +1168,6 @@ declare interface ICountdownTimer {
|
|
1168
1168
|
theme: 'GREEN_1' | 'ORANGE_1';
|
1169
1169
|
}
|
1170
1170
|
|
1171
|
-
declare interface ICountryOption {
|
1172
|
-
code: string;
|
1173
|
-
id: string;
|
1174
|
-
value: string;
|
1175
|
-
label: string;
|
1176
|
-
icon: string;
|
1177
|
-
url: string;
|
1178
|
-
geoIPCountryCode: string;
|
1179
|
-
}
|
1180
|
-
|
1181
1171
|
export declare interface ICreateUserPayloadDal {
|
1182
1172
|
username: string;
|
1183
1173
|
grade: string;
|
@@ -2503,7 +2493,7 @@ declare interface IOTPResendProps {
|
|
2503
2493
|
showVoiceOTP?: boolean;
|
2504
2494
|
disabled?: boolean;
|
2505
2495
|
renderAs?: 'submit' | 'text';
|
2506
|
-
width?: number;
|
2496
|
+
width?: number | string;
|
2507
2497
|
}
|
2508
2498
|
|
2509
2499
|
declare interface IOutcomeConfig {
|
@@ -3055,7 +3045,8 @@ declare interface ISingleFieldFormProps {
|
|
3055
3045
|
|
3056
3046
|
declare interface ISocialAccountNotFoundProps {
|
3057
3047
|
onRetryLogin: () => void;
|
3058
|
-
onGoToSignup
|
3048
|
+
onGoToSignup?: () => void;
|
3049
|
+
showSignupButton?: boolean;
|
3059
3050
|
}
|
3060
3051
|
|
3061
3052
|
declare interface ISocialLoginMethodsProps {
|
@@ -3628,6 +3619,12 @@ declare interface IUseTrialSessionMessageBroker {
|
|
3628
3619
|
};
|
3629
3620
|
}
|
3630
3621
|
|
3622
|
+
declare interface IUseViewportReturn {
|
3623
|
+
isCompact: boolean;
|
3624
|
+
isMobile: boolean;
|
3625
|
+
isDesktop: boolean;
|
3626
|
+
}
|
3627
|
+
|
3631
3628
|
declare interface IUseWorksheetLayout {
|
3632
3629
|
(options: {
|
3633
3630
|
userType: TUserTypes;
|
@@ -4096,6 +4093,11 @@ export declare const Maintenance: React_2.FC<IMaintenanceProps>;
|
|
4096
4093
|
|
4097
4094
|
declare const MASTERY: "mastery";
|
4098
4095
|
|
4096
|
+
export declare const media: {
|
4097
|
+
minDesktop: string;
|
4098
|
+
minLarge: string;
|
4099
|
+
};
|
4100
|
+
|
4099
4101
|
export declare const MilestoneActionWidget: React_2.FC<IMilestoneActionWidgetProps>;
|
4100
4102
|
|
4101
4103
|
export declare const MilestoneCreate: React.FC<IMileStoneCreateContainerProps>;
|
@@ -4520,7 +4522,7 @@ export declare const SkipColoredIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
4520
4522
|
|
4521
4523
|
export declare const SkipIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
4522
4524
|
|
4523
|
-
export declare const SocialAccountNotFound: MemoExoticComponent<({ onRetryLogin, onGoToSignup }: ISocialAccountNotFoundProps) => JSX_2.Element>;
|
4525
|
+
export declare const SocialAccountNotFound: MemoExoticComponent<({ onRetryLogin, onGoToSignup, showSignupButton, }: ISocialAccountNotFoundProps) => JSX_2.Element>;
|
4524
4526
|
|
4525
4527
|
export declare const SocialLoginMethods: NamedExoticComponent<ISocialLoginMethodsProps>;
|
4526
4528
|
|
@@ -5476,7 +5478,10 @@ declare type TSectionSummary = {
|
|
5476
5478
|
modules: TSATModule[];
|
5477
5479
|
};
|
5478
5480
|
|
5479
|
-
export declare type TSelectedCountry =
|
5481
|
+
export declare type TSelectedCountry = {
|
5482
|
+
id: string;
|
5483
|
+
code: string;
|
5484
|
+
};
|
5480
5485
|
|
5481
5486
|
declare type TSheetAttemptLocation = keyof typeof SHEET_ATTEMPT_LOCATION;
|
5482
5487
|
|
@@ -5852,6 +5857,8 @@ export declare const useTrialSessionMessageBroker: IUseTrialSessionMessageBroker
|
|
5852
5857
|
|
5853
5858
|
export declare const useUIContext: () => UIContextProps;
|
5854
5859
|
|
5860
|
+
export declare const useViewport: () => IUseViewportReturn;
|
5861
|
+
|
5855
5862
|
export declare const useWorksheetLayout: IUseWorksheetLayout;
|
5856
5863
|
|
5857
5864
|
export declare const useZoomDisable: () => void;
|