touchstudy-core 0.1.152 → 0.1.154

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.
@@ -8,7 +8,7 @@ export declare type ConversationResponse = {
8
8
  };
9
9
  export declare type ConversationsResponse = {
10
10
  id: number;
11
- studentExamSessionId: number;
11
+ studentExamSessionId?: number;
12
12
  courseId: number | null;
13
13
  courseTitle: string | null;
14
14
  score?: number | null;
@@ -22,7 +22,8 @@ export declare type ConversationsResponse = {
22
22
  lastMessage: string | null;
23
23
  examTitle: string;
24
24
  examId: number;
25
- examSessionId: number;
25
+ examSessionId?: number;
26
+ studentTextbookSessionId?: number;
26
27
  duration: string;
27
28
  startTime: string;
28
29
  examCreatedAt: string;
@@ -1,7 +1,9 @@
1
1
  import { StudentClassQuery, StudentClassResponse, UserClassSortBy } from "../configs/types";
2
2
  import { ChangeEvent, FC, RefObject } from "react";
3
3
  import { PagingResponse } from "../../../utils/types/pagingResponse";
4
+ import { Role } from "../../../utils";
4
5
  interface Props {
6
+ role: Role;
5
7
  history: any;
6
8
  onAdd?: Function;
7
9
  paging: PagingResponse;
@@ -17,6 +19,7 @@ interface Props {
17
19
  handleChangeSearchText: (e: ChangeEvent<HTMLInputElement>) => void;
18
20
  handleChangePage: (_: any, page: number) => void;
19
21
  handleRemoveStudentFromClass: () => Promise<void>;
22
+ onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
20
23
  }
21
24
  declare const StudentList: FC<Props>;
22
25
  export default StudentList;
@@ -5,6 +5,7 @@ interface Props {
5
5
  classListUrl: string;
6
6
  history: any;
7
7
  role: Role;
8
+ onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
8
9
  }
9
10
  declare const ClassDetail: FC<Props>;
10
11
  export default ClassDetail;
@@ -1,5 +1,6 @@
1
1
  import { QuestionAnswerType } from './../../../utils/enums/examStatus';
2
2
  import { CategoryResponse } from "../../../utils/types/examResults";
3
+ import { Role } from '../../../utils';
3
4
  export interface CategoryFormat extends CategoryResponse {
4
5
  totalSolveTime: number;
5
6
  }
@@ -99,5 +100,6 @@ export declare type ExamResultV2Props = {
99
100
  code?: string;
100
101
  isMyStoryStudent?: boolean;
101
102
  chapterId?: number;
102
- onViewExamQuestion?: (studentId: number, examSessionId?: number, questionId?: number) => void;
103
+ role: Role;
104
+ onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
103
105
  };
@@ -1,8 +1,10 @@
1
1
  import React from "react";
2
2
  import { Theme } from "@mui/material";
3
3
  import { PreparedFilterType, PreparedType, Textbook } from "../configs/types";
4
+ import { Role } from "../../../utils";
4
5
  declare type Props = {
5
6
  t: any;
7
+ role: Role;
6
8
  user: any;
7
9
  theme: Theme;
8
10
  textbook: Textbook;
@@ -12,6 +14,7 @@ declare type Props = {
12
14
  preparedType?: PreparedType;
13
15
  preparedFilterType?: PreparedFilterType;
14
16
  getTextbookList: () => void;
17
+ onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
15
18
  };
16
- declare const Textbook: ({ t, user, theme, textbook, isStudent, isSuperAdmin, navigate, preparedType, preparedFilterType, getTextbookList }: Props) => React.JSX.Element;
19
+ declare const Textbook: ({ t, role, user, theme, textbook, isStudent, isSuperAdmin, navigate, preparedType, preparedFilterType, getTextbookList, onViewQA }: Props) => React.JSX.Element;
17
20
  export default Textbook;
@@ -1,6 +1,8 @@
1
1
  import React from "react";
2
2
  import { Theme } from "@mui/material";
3
+ import { Role } from "../../../../utils";
3
4
  declare type Props = {
5
+ role: Role;
4
6
  open: boolean;
5
7
  onClose: () => void;
6
8
  theme: Theme;
@@ -8,6 +10,7 @@ declare type Props = {
8
10
  history: any;
9
11
  chapterId?: number;
10
12
  studentId?: number;
13
+ onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
11
14
  };
12
- declare const ChapterProblemSolvingResultsDialog: ({ t, onClose, open, history, chapterId, studentId }: Props) => React.JSX.Element;
15
+ declare const ChapterProblemSolvingResultsDialog: ({ t, role, onClose, open, history, chapterId, studentId, onViewQA }: Props) => React.JSX.Element;
13
16
  export default ChapterProblemSolvingResultsDialog;
@@ -9,6 +9,7 @@ declare type Props = {
9
9
  navigate?: any;
10
10
  width?: number | string;
11
11
  anchor?: "left" | "top" | "right" | "bottom";
12
+ onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
12
13
  };
13
- declare const TextbookDrawer: ({ isOpen, role, width, textbookId, studentId, anchor, navigate, onClose }: Props) => React.JSX.Element;
14
+ declare const TextbookDrawer: ({ isOpen, role, width, textbookId, studentId, anchor, navigate, onClose, onViewQA }: Props) => React.JSX.Element;
14
15
  export default TextbookDrawer;
@@ -1,8 +1,11 @@
1
1
  import React from 'react';
2
+ import { Role } from '../../../utils';
2
3
  declare type Props = {
4
+ role: Role;
3
5
  preparedType?: any;
4
6
  preparedFilterType?: any;
5
7
  navigate?: any;
8
+ onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
6
9
  };
7
- declare const PreparedItem: ({ preparedType, preparedFilterType, navigate }: Props) => React.JSX.Element;
10
+ declare const PreparedItem: ({ role, preparedType, preparedFilterType, navigate, onViewQA }: Props) => React.JSX.Element;
8
11
  export default PreparedItem;
@@ -1,9 +1,12 @@
1
1
  import { FC } from "react";
2
2
  import { TabContentProps } from "../../configs/interfaces";
3
3
  import { StudentInfo } from "../../configs/types";
4
+ import { Role } from "../../../../utils";
4
5
  interface Props extends TabContentProps {
6
+ role: Role;
5
7
  history: any;
6
8
  student?: StudentInfo;
9
+ onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
7
10
  }
8
11
  declare const DrawerExamResultTab: FC<Props>;
9
12
  export default DrawerExamResultTab;
@@ -1,6 +1,8 @@
1
1
  import { FC } from "react";
2
2
  import { ExamSessionResponse, StudentInfo } from "../../configs/types";
3
+ import { Role } from "../../../../utils";
3
4
  interface Props {
5
+ role: Role;
4
6
  open?: boolean;
5
7
  student?: StudentInfo;
6
8
  anchor?: "left" | "top" | "right" | "bottom";
@@ -8,6 +10,7 @@ interface Props {
8
10
  width?: number | string;
9
11
  data?: ExamSessionResponse;
10
12
  history: any;
13
+ onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
11
14
  }
12
15
  declare const ExamResultDrawer: FC<Props>;
13
16
  export default ExamResultDrawer;
@@ -1,7 +1,10 @@
1
1
  import { FC } from "react";
2
2
  import { TabContentProps } from "../../configs/interfaces";
3
+ import { Role } from "../../../../utils";
3
4
  interface Props extends TabContentProps {
5
+ role: Role;
4
6
  history: any;
7
+ onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
5
8
  }
6
9
  declare const DrawerTextbookResultTab: FC<Props>;
7
10
  export default DrawerTextbookResultTab;
@@ -1,7 +1,9 @@
1
1
  import { BoxProps } from "@mui/material";
2
2
  import { DrawerTab } from "./enums";
3
3
  import { CourseAttendanceResponse, ExamSessionResponse, LessonResponse, TextbookResponse } from "./types";
4
+ import { Role } from "../../../utils";
4
5
  export interface StudentInfoDrawerProps {
6
+ role: Role;
5
7
  studentId?: number;
6
8
  open: boolean;
7
9
  inert?: boolean;
@@ -9,6 +11,7 @@ export interface StudentInfoDrawerProps {
9
11
  onClose?: () => void;
10
12
  width?: number | string;
11
13
  history: any;
14
+ onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
12
15
  }
13
16
  export interface TabContentProps {
14
17
  studentId: number;
@@ -3,6 +3,7 @@ import { Role } from "../../../utils/constants";
3
3
  interface Props {
4
4
  role: Role;
5
5
  history: any;
6
+ onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
6
7
  }
7
8
  declare const UserList: FC<Props>;
8
9
  export default UserList;
package/dist/index.js CHANGED
@@ -15155,8 +15155,9 @@ var useVirtualList = function useVirtualList(studentId, defaultFilter, getItemsA
15155
15155
  return;
15156
15156
  }
15157
15157
  setFilter(function (state) {
15158
+ var _filter$currentPage;
15158
15159
  return !state ? state : _extends({}, state, {
15159
- currentPage: 1
15160
+ currentPage: ((_filter$currentPage = filter.currentPage) != null ? _filter$currentPage : 0) + 1
15160
15161
  });
15161
15162
  });
15162
15163
  }, [filter === null || filter === void 0 ? void 0 : filter.currentPage, totalPages]);
@@ -19419,7 +19420,6 @@ var PrintExamResult = function PrintExamResult(_ref) {
19419
19420
  sx: textStyle
19420
19421
  }, i18n.t(TabList$2[0].label)), chapterId ? textbookResult && React__default.createElement(TextbookMyAnswer, {
19421
19422
  data: textbookResult,
19422
- categories: categoryResponses,
19423
19423
  isStudent: isStudent
19424
19424
  }) : resultData && React__default.createElement(MyAnswer, {
19425
19425
  data: resultData,
@@ -20374,7 +20374,7 @@ var useExamResult = function useExamResult(props) {
20374
20374
  studentId = _props$studentId === void 0 ? 0 : _props$studentId,
20375
20375
  code = props.code,
20376
20376
  chapterId = props.chapterId,
20377
- onViewExamQuestion = props.onViewExamQuestion;
20377
+ onViewQA = props.onViewQA;
20378
20378
  var _useTranslation = reactI18next.useTranslation(),
20379
20379
  t = _useTranslation.t;
20380
20380
  var _useTab = useTab(),
@@ -20424,7 +20424,7 @@ var useExamResult = function useExamResult(props) {
20424
20424
  var handleViewQAndA = function handleViewQAndA(e, note) {
20425
20425
  e.stopPropagation();
20426
20426
  if (!note.examSessionId || !note.questionId) return;
20427
- onViewExamQuestion === null || onViewExamQuestion === void 0 ? void 0 : onViewExamQuestion(note.userId, note.examSessionId, note.questionId);
20427
+ onViewQA === null || onViewQA === void 0 ? void 0 : onViewQA(note.userId, note.examSessionId, note.questionId);
20428
20428
  };
20429
20429
  var fileExamName = !resultData ? "" : "Exam-Result_" + resultData.student.fullName + "_" + resultData.title + "_(" + utcToLocalTime(resultData.startTime, "MM-DD-YYYY HH:mm") + ")";
20430
20430
  var fileTextbookName = !textbookResult ? "" : "Textbook-Result_" + textbookResult.chapterName + "_(" + utcToLocalTime(textbookResult.startTime, "MM-DD-YYYY HH:mm") + ")";
@@ -20451,9 +20451,12 @@ var useExamResult = function useExamResult(props) {
20451
20451
  };
20452
20452
 
20453
20453
  var ExamResultV2 = function ExamResultV2(props) {
20454
- var isMyStoryStudent = props.isMyStoryStudent,
20455
- onViewExamQuestion = props.onViewExamQuestion,
20456
- chapterId = props.chapterId;
20454
+ var role = props.role,
20455
+ isMyStoryStudent = props.isMyStoryStudent,
20456
+ onViewQA = props.onViewQA,
20457
+ chapterId = props.chapterId,
20458
+ studentId = props.studentId;
20459
+ var isAdminSite = role === exports.Role.Admin;
20457
20460
  var _useExamResult = useExamResult(props),
20458
20461
  t = _useExamResult.t,
20459
20462
  fileName = _useExamResult.fileName,
@@ -20571,7 +20574,13 @@ var ExamResultV2 = function ExamResultV2(props) {
20571
20574
  onItemClick: handleOpenNoteDrawer,
20572
20575
  isLoading: isLoadingNotes
20573
20576
  };
20574
- var questionActions = [{
20577
+ var questionActions = chapterId ? [{
20578
+ label: "ask_a_question",
20579
+ textStyle: {
20580
+ color: "#3dc674"
20581
+ },
20582
+ onClick: handleOpenQuestionDialog
20583
+ }] : [{
20575
20584
  label: "write_a_note_of_incorrect_answers",
20576
20585
  textStyle: {
20577
20586
  color: "#3dc674"
@@ -20590,6 +20599,14 @@ var ExamResultV2 = function ExamResultV2(props) {
20590
20599
  onOpenContextMenu: handleOpenQuestionContextMenu,
20591
20600
  isStudent: isStudent
20592
20601
  };
20602
+ var handleViewTextbookQA = function handleViewTextbookQA() {
20603
+ if (!studentId) return;
20604
+ onViewQA === null || onViewQA === void 0 ? void 0 : onViewQA(+studentId, textbookResult === null || textbookResult === void 0 ? void 0 : textbookResult.studentTextbookSessionId, undefined, true);
20605
+ };
20606
+ var handleViewExamQA = function handleViewExamQA() {
20607
+ if (!resultData) return;
20608
+ onViewQA === null || onViewQA === void 0 ? void 0 : onViewQA(resultData.student.id, resultData.examSessionId);
20609
+ };
20593
20610
  return React__default.createElement(React.Fragment, null, React__default.createElement(LoadingComponent, {
20594
20611
  isLoading: !!isLoading
20595
20612
  }), timelyOrderQuestions[dataChartIndex] && longTimeSpend && effectSize ? React__default.createElement("div", {
@@ -20736,7 +20753,7 @@ var ExamResultV2 = function ExamResultV2(props) {
20736
20753
  direction: "row",
20737
20754
  gap: "8px",
20738
20755
  alignItems: "center"
20739
- }, React__default.createElement(material.Button, {
20756
+ }, !isAdminSite && React__default.createElement(material.Button, {
20740
20757
  variant: "outlined",
20741
20758
  sx: {
20742
20759
  color: styles.less_dark,
@@ -20752,7 +20769,7 @@ var ExamResultV2 = function ExamResultV2(props) {
20752
20769
  size: "14px"
20753
20770
  })),
20754
20771
  onClick: function onClick(e) {
20755
- return isStudent ? handleOpenQuestionDialog(e) : onViewExamQuestion === null || onViewExamQuestion === void 0 ? void 0 : onViewExamQuestion(resultData.student.id, resultData.examSessionId);
20772
+ return isStudent ? handleOpenQuestionDialog(e) : handleViewExamQA();
20756
20773
  }
20757
20774
  }, t(isStudent ? "ask_a_question2" : "check_q&a")), React__default.createElement(material.Button, {
20758
20775
  variant: "outlined",
@@ -20810,7 +20827,7 @@ var ExamResultV2 = function ExamResultV2(props) {
20810
20827
  direction: "row",
20811
20828
  gap: "8px",
20812
20829
  alignItems: "center"
20813
- }, React__default.createElement(material.Button, {
20830
+ }, !isAdminSite && React__default.createElement(material.Button, {
20814
20831
  variant: "outlined",
20815
20832
  sx: {
20816
20833
  color: styles.less_dark,
@@ -20826,7 +20843,7 @@ var ExamResultV2 = function ExamResultV2(props) {
20826
20843
  size: "14px"
20827
20844
  })),
20828
20845
  onClick: function onClick(e) {
20829
- return handleOpenQuestionDialog(e);
20846
+ return isStudent ? handleOpenQuestionDialog(e) : handleViewTextbookQA();
20830
20847
  }
20831
20848
  }, t(isStudent ? "ask_a_question2" : "check_q&a")), React__default.createElement(material.Button, {
20832
20849
  variant: "outlined",
@@ -21213,12 +21230,14 @@ var PrintExamResultView = function PrintExamResultView(_ref) {
21213
21230
 
21214
21231
  var ExamResultDrawer = function ExamResultDrawer(_ref) {
21215
21232
  var _BRIEF_GRADE_OPTIONS$;
21216
- var history = _ref.history,
21233
+ var role = _ref.role,
21234
+ history = _ref.history,
21217
21235
  open = _ref.open,
21218
21236
  anchor = _ref.anchor,
21219
21237
  width = _ref.width,
21220
21238
  student = _ref.student,
21221
21239
  data = _ref.data,
21240
+ onViewQA = _ref.onViewQA,
21222
21241
  onClose = _ref.onClose;
21223
21242
  var _useTranslation = reactI18next.useTranslation(),
21224
21243
  t = _useTranslation.t;
@@ -21227,16 +21246,6 @@ var ExamResultDrawer = function ExamResultDrawer(_ref) {
21227
21246
  return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.language;
21228
21247
  });
21229
21248
  var search = window.location.search;
21230
- var searchParams = new URLSearchParams(search);
21231
- var handleViewExamQuestion = function handleViewExamQuestion(studentId, examSessionId, questionId) {
21232
- searchParams.set("sId", "" + studentId);
21233
- examSessionId && searchParams.set("eId", "" + examSessionId);
21234
- questionId && searchParams.set("qId", "" + questionId);
21235
- pushTo(history, {
21236
- pathname: "/teacher/question-and-answers",
21237
- search: searchParams.toString()
21238
- });
21239
- };
21240
21249
  var studentId = student === null || student === void 0 ? void 0 : student.id;
21241
21250
  var code = data === null || data === void 0 ? void 0 : data.code;
21242
21251
  var examSessionId = data === null || data === void 0 ? void 0 : data.id;
@@ -21336,21 +21345,24 @@ var ExamResultDrawer = function ExamResultDrawer(_ref) {
21336
21345
  pb: 4
21337
21346
  }
21338
21347
  }, examSessionId && React__default.createElement(ExamResultV2, {
21348
+ role: role,
21339
21349
  history: history,
21340
21350
  searchParams: search,
21341
21351
  code: code,
21342
21352
  examSessionId: examSessionId,
21343
21353
  studentId: studentId,
21344
- onViewExamQuestion: handleViewExamQuestion
21354
+ onViewQA: onViewQA
21345
21355
  })));
21346
21356
  };
21347
21357
 
21348
21358
  var DrawerExamResultTab = function DrawerExamResultTab(_ref) {
21349
- var history = _ref.history,
21359
+ var role = _ref.role,
21360
+ history = _ref.history,
21350
21361
  student = _ref.student,
21351
21362
  selectedTab = _ref.selectedTab,
21352
21363
  value = _ref.value,
21353
- studentId = _ref.studentId;
21364
+ studentId = _ref.studentId,
21365
+ onViewQA = _ref.onViewQA;
21354
21366
  var _useVirtualList = useVirtualList(studentId, EXAM_SESSION_DEFAULT_FILTER, getExamSessionListApi),
21355
21367
  items = _useVirtualList.items,
21356
21368
  selectedItem = _useVirtualList.selectedItem,
@@ -21385,13 +21397,15 @@ var DrawerExamResultTab = function DrawerExamResultTab(_ref) {
21385
21397
  onItemClick: handleChangeSelectedItem,
21386
21398
  listHeight: 0
21387
21399
  })), React__default.createElement(ExamResultDrawer, {
21400
+ role: role,
21388
21401
  open: !!selectedItem,
21389
21402
  data: selectedItem,
21390
21403
  student: student,
21391
21404
  anchor: "right",
21392
21405
  width: "80dvw",
21393
21406
  onClose: handleCloseDrawer,
21394
- history: history
21407
+ history: history,
21408
+ onViewQA: onViewQA
21395
21409
  }));
21396
21410
  };
21397
21411
 
@@ -22400,11 +22414,13 @@ var ChapterDetail = function ChapterDetail(_ref) {
22400
22414
 
22401
22415
  var ChapterProblemSolvingResultsDialog = function ChapterProblemSolvingResultsDialog(_ref) {
22402
22416
  var t = _ref.t,
22417
+ role = _ref.role,
22403
22418
  onClose = _ref.onClose,
22404
22419
  open = _ref.open,
22405
22420
  history = _ref.history,
22406
22421
  chapterId = _ref.chapterId,
22407
- studentId = _ref.studentId;
22422
+ studentId = _ref.studentId,
22423
+ onViewQA = _ref.onViewQA;
22408
22424
  return React__default.createElement(material.Dialog, {
22409
22425
  onClose: onClose,
22410
22426
  open: open,
@@ -22436,11 +22452,13 @@ var ChapterProblemSolvingResultsDialog = function ChapterProblemSolvingResultsDi
22436
22452
  }, React__default.createElement(material.Stack, {
22437
22453
  mx: "24px"
22438
22454
  }, React__default.createElement(ExamResultV2, {
22455
+ role: role,
22439
22456
  history: history,
22440
22457
  searchParams: "",
22441
22458
  chapterId: chapterId,
22442
22459
  studentId: studentId,
22443
- isMyStoryStudent: false
22460
+ isMyStoryStudent: false,
22461
+ onViewQA: onViewQA
22444
22462
  })), React__default.createElement(material.DialogActions, {
22445
22463
  sx: {
22446
22464
  display: "flex",
@@ -22716,7 +22734,8 @@ var TextbookDrawer = function TextbookDrawer(_ref) {
22716
22734
  studentId = _ref.studentId,
22717
22735
  anchor = _ref.anchor,
22718
22736
  navigate = _ref.navigate,
22719
- onClose = _ref.onClose;
22737
+ onClose = _ref.onClose,
22738
+ onViewQA = _ref.onViewQA;
22720
22739
  var isStudent = role === exports.Role.Student;
22721
22740
  var _useTextbookDrawer = useTextbookDrawer({
22722
22741
  isStudent: isStudent,
@@ -22990,12 +23009,14 @@ var TextbookDrawer = function TextbookDrawer(_ref) {
22990
23009
  });
22991
23010
  }))))), React__default.createElement(ChapterProblemSolvingResultsDialog, {
22992
23011
  t: t,
23012
+ role: role,
22993
23013
  theme: theme,
22994
23014
  history: history,
22995
23015
  chapterId: chapterSelected === null || chapterSelected === void 0 ? void 0 : chapterSelected.id,
22996
23016
  studentId: studentId,
22997
23017
  open: isOpenChapterDialog,
22998
- onClose: handleCloseChapterDialog
23018
+ onClose: handleCloseChapterDialog,
23019
+ onViewQA: onViewQA
22999
23020
  }), React__default.createElement(StartPageDialog, {
23000
23021
  options: startPageOptions,
23001
23022
  t: t,
@@ -23344,6 +23365,7 @@ var TextbookInfoDrawer = function TextbookInfoDrawer(_ref) {
23344
23365
  var Textbook = function Textbook(_ref) {
23345
23366
  var _textbook$createdBy, _textbook$createdBy2;
23346
23367
  var t = _ref.t,
23368
+ role = _ref.role,
23347
23369
  user = _ref.user,
23348
23370
  theme = _ref.theme,
23349
23371
  textbook = _ref.textbook,
@@ -23352,7 +23374,8 @@ var Textbook = function Textbook(_ref) {
23352
23374
  navigate = _ref.navigate,
23353
23375
  preparedType = _ref.preparedType,
23354
23376
  preparedFilterType = _ref.preparedFilterType,
23355
- getTextbookList = _ref.getTextbookList;
23377
+ getTextbookList = _ref.getTextbookList,
23378
+ onViewQA = _ref.onViewQA;
23356
23379
  var isTabletUp = material.useMediaQuery(theme.breakpoints.up("lg"));
23357
23380
  var _useDrawer = useDrawer(),
23358
23381
  isOpenDialog = _useDrawer.isOpenDialog,
@@ -23492,15 +23515,16 @@ var Textbook = function Textbook(_ref) {
23492
23515
  }, React__default.createElement(io5.IoTrash, {
23493
23516
  size: "20px"
23494
23517
  }), t("delete_test"))), isOpenDialog && React__default.createElement(TextbookDrawer, {
23495
- role: isStudent ? exports.Role.Student : exports.Role.Teacher,
23518
+ role: role,
23496
23519
  isOpen: isOpenDialog,
23497
23520
  onClose: handleCloseDialog,
23498
23521
  textbookId: textbook.id,
23499
23522
  navigate: navigate,
23500
23523
  width: !isTabletUp ? "100dvw" : "50dvw",
23501
- anchor: "right"
23524
+ anchor: "right",
23525
+ onViewQA: onViewQA
23502
23526
  }), openDetailDialog && React__default.createElement(TextbookInfoDrawer, {
23503
- role: isStudent ? exports.Role.Student : exports.Role.Teacher,
23527
+ role: role,
23504
23528
  user: user,
23505
23529
  isSuperAdmin: isSuperAdmin,
23506
23530
  isOpen: openDetailDialog,
@@ -23519,9 +23543,11 @@ var Textbook = function Textbook(_ref) {
23519
23543
  };
23520
23544
 
23521
23545
  var PreparedItem = function PreparedItem(_ref) {
23522
- var preparedType = _ref.preparedType,
23546
+ var role = _ref.role,
23547
+ preparedType = _ref.preparedType,
23523
23548
  preparedFilterType = _ref.preparedFilterType,
23524
- navigate = _ref.navigate;
23549
+ navigate = _ref.navigate,
23550
+ onViewQA = _ref.onViewQA;
23525
23551
  var _useExpand = useExpand(),
23526
23552
  expanded = _useExpand.expanded,
23527
23553
  handleCloseExpand = _useExpand.handleCloseExpand,
@@ -24049,6 +24075,7 @@ var PreparedItem = function PreparedItem(_ref) {
24049
24075
  }, textbookList === null || textbookList === void 0 ? void 0 : textbookList.map(function (textbook) {
24050
24076
  return React__default.createElement(Textbook, {
24051
24077
  t: t,
24078
+ role: role,
24052
24079
  user: user,
24053
24080
  theme: theme,
24054
24081
  textbook: textbook,
@@ -24057,7 +24084,8 @@ var PreparedItem = function PreparedItem(_ref) {
24057
24084
  navigate: navigate,
24058
24085
  getTextbookList: getTextbookList,
24059
24086
  preparedType: preparedType,
24060
- preparedFilterType: preparedFilterType
24087
+ preparedFilterType: preparedFilterType,
24088
+ onViewQA: onViewQA
24061
24089
  });
24062
24090
  }), React__default.createElement(material.Stack, {
24063
24091
  display: "flex",
@@ -24072,10 +24100,12 @@ var PreparedItem = function PreparedItem(_ref) {
24072
24100
  };
24073
24101
 
24074
24102
  var DrawerTextbookResultTab = function DrawerTextbookResultTab(_ref) {
24075
- var history = _ref.history,
24103
+ var role = _ref.role,
24104
+ history = _ref.history,
24076
24105
  studentId = _ref.studentId,
24077
24106
  selectedTab = _ref.selectedTab,
24078
- value = _ref.value;
24107
+ value = _ref.value,
24108
+ onViewQA = _ref.onViewQA;
24079
24109
  var _useVirtualList = useVirtualList(studentId, TEXTBOOK_DEFAULT_FILTER, getTextbookListApi),
24080
24110
  items = _useVirtualList.items,
24081
24111
  selectedItem = _useVirtualList.selectedItem,
@@ -24110,14 +24140,15 @@ var DrawerTextbookResultTab = function DrawerTextbookResultTab(_ref) {
24110
24140
  onItemClick: handleChangeSelectedItem,
24111
24141
  listHeight: 0
24112
24142
  })), React__default.createElement(TextbookDrawer, {
24113
- role: exports.Role.Teacher,
24143
+ role: role,
24114
24144
  navigate: history,
24115
24145
  isOpen: !!selectedItem,
24116
24146
  width: "80dvw",
24117
24147
  onClose: handleCloseDrawer,
24118
24148
  textbookId: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.id,
24119
24149
  studentId: studentId,
24120
- anchor: "right"
24150
+ anchor: "right",
24151
+ onViewQA: onViewQA
24121
24152
  }));
24122
24153
  };
24123
24154
 
@@ -24749,7 +24780,9 @@ var StudentInfoDrawer = function StudentInfoDrawer(props) {
24749
24780
  studentId = props.studentId,
24750
24781
  anchor = props.anchor,
24751
24782
  width = props.width,
24752
- history = props.history;
24783
+ history = props.history,
24784
+ role = props.role,
24785
+ onViewQA = props.onViewQA;
24753
24786
  var _useStudentInfoDrawer = useStudentInfoDrawer(props),
24754
24787
  loadedTabs = _useStudentInfoDrawer.loadedTabs,
24755
24788
  isLoading = _useStudentInfoDrawer.isLoading,
@@ -24793,21 +24826,26 @@ var StudentInfoDrawer = function StudentInfoDrawer(props) {
24793
24826
  data: studentInfo,
24794
24827
  isLoading: isLoading
24795
24828
  }), loadedTabs[DrawerTab.Exam] && React__default.createElement(DrawerExamResultTab, {
24829
+ role: role,
24796
24830
  value: DrawerTab.Exam,
24797
24831
  selectedTab: selectedTab,
24798
24832
  studentId: studentId,
24799
24833
  student: studentInfo,
24800
- history: history
24834
+ history: history,
24835
+ onViewQA: onViewQA
24801
24836
  }), loadedTabs[DrawerTab.Textbook] && React__default.createElement(DrawerTextbookResultTab, {
24837
+ role: role,
24802
24838
  value: DrawerTab.Textbook,
24803
24839
  selectedTab: selectedTab,
24804
24840
  studentId: studentId,
24805
- history: history
24841
+ history: history,
24842
+ onViewQA: onViewQA
24806
24843
  }))));
24807
24844
  };
24808
24845
 
24809
24846
  var StudentList = function StudentList(_ref) {
24810
- var history = _ref.history,
24847
+ var role = _ref.role,
24848
+ history = _ref.history,
24811
24849
  onAdd = _ref.onAdd,
24812
24850
  paging = _ref.paging,
24813
24851
  classList = _ref.classList,
@@ -24821,7 +24859,8 @@ var StudentList = function StudentList(_ref) {
24821
24859
  handleSort = _ref.handleSort,
24822
24860
  handleChangeSearchText = _ref.handleChangeSearchText,
24823
24861
  handleChangePage = _ref.handleChangePage,
24824
- handleRemoveStudentFromClass = _ref.handleRemoveStudentFromClass;
24862
+ handleRemoveStudentFromClass = _ref.handleRemoveStudentFromClass,
24863
+ onViewQA = _ref.onViewQA;
24825
24864
  var _useState = React.useState(),
24826
24865
  selectedViewStudent = _useState[0],
24827
24866
  setSelectedViewStudent = _useState[1];
@@ -24951,13 +24990,15 @@ var StudentList = function StudentList(_ref) {
24951
24990
  onConfirm: handleRemoveStudentFromClass,
24952
24991
  isDelete: true
24953
24992
  }), React__default.createElement(StudentInfoDrawer, {
24993
+ role: role,
24954
24994
  open: !!selectedViewStudent,
24955
24995
  studentId: (selectedViewStudent === null || selectedViewStudent === void 0 ? void 0 : selectedViewStudent.studentId) || 0,
24956
24996
  onClose: handleCloseStudentInfo,
24957
24997
  anchor: "right",
24958
24998
  width: "80dvw",
24959
24999
  history: history,
24960
- inert: true
25000
+ inert: true,
25001
+ onViewQA: onViewQA
24961
25002
  }));
24962
25003
  };
24963
25004
 
@@ -26535,7 +26576,8 @@ var ClassDetail = function ClassDetail(_ref) {
26535
26576
  var id = _ref.id,
26536
26577
  history = _ref.history,
26537
26578
  classListUrl = _ref.classListUrl,
26538
- role = _ref.role;
26579
+ role = _ref.role,
26580
+ onViewQA = _ref.onViewQA;
26539
26581
  var classId = !id || Number.isNaN(+id) ? 0 : +id;
26540
26582
  var _useClassDetail = useClassDetail({
26541
26583
  history: history,
@@ -26650,10 +26692,13 @@ var ClassDetail = function ClassDetail(_ref) {
26650
26692
  value: selected,
26651
26693
  index: TabList$1[1].value
26652
26694
  }, !!classId && selected === TabList$1[1].value && React__default.createElement(StudentList, Object.assign({
26695
+ role: role,
26653
26696
  disabled: isDisabled && !isTeacher,
26654
26697
  onAdd: handleOpenSelectDialog,
26655
26698
  history: history
26656
- }, studentListProps))), React__default.createElement(CustomTabPanel, {
26699
+ }, studentListProps, {
26700
+ onViewQA: onViewQA
26701
+ }))), React__default.createElement(CustomTabPanel, {
26657
26702
  value: selected,
26658
26703
  index: TabList$1[2].value
26659
26704
  }, !!classId && selected === TabList$1[2].value && React__default.createElement(TeacherList, Object.assign({
@@ -28386,7 +28431,8 @@ var UserRow = function UserRow(_ref) {
28386
28431
 
28387
28432
  var UserList = function UserList(_ref) {
28388
28433
  var role = _ref.role,
28389
- history = _ref.history;
28434
+ history = _ref.history,
28435
+ onViewQA = _ref.onViewQA;
28390
28436
  var isSuperAdmin = reactRedux.useSelector(function (state) {
28391
28437
  var _state$common, _state$common$user;
28392
28438
  return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : (_state$common$user = _state$common.user) === null || _state$common$user === void 0 ? void 0 : _state$common$user.isSuperAdmin;
@@ -28592,12 +28638,14 @@ var UserList = function UserList(_ref) {
28592
28638
  onClose: handleCloseRecentUserActionDialog,
28593
28639
  recentUserActions: recentUserActions
28594
28640
  }), React__default.createElement(StudentInfoDrawer, {
28641
+ role: role,
28595
28642
  open: !!selectedStudent,
28596
28643
  studentId: selectedStudent === null || selectedStudent === void 0 ? void 0 : selectedStudent.id,
28597
28644
  width: "80dvw",
28598
28645
  anchor: "right",
28599
28646
  onClose: handleCloseStudentInfo,
28600
28647
  history: history,
28648
+ onViewQA: onViewQA,
28601
28649
  inert: true
28602
28650
  }), (isAdmin || isSuperAdmin) && React__default.createElement(DeleteUserCsvDialog, {
28603
28651
  open: isOpenDeleteUserCsv,