touchstudy-core 0.1.151 → 0.1.153

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/index.js CHANGED
@@ -6516,26 +6516,23 @@ var formatDataMyAnswer = function formatDataMyAnswer(inputData, categories) {
6516
6516
  });
6517
6517
  return questionsByCategory;
6518
6518
  };
6519
- var formatTextbookDataMyAnswer = function formatTextbookDataMyAnswer(inputData, categories) {
6520
- var uniqueCategories = new Set();
6521
- var filterCategories = categories.filter(function (category) {
6522
- if (!uniqueCategories.has(category.name)) {
6523
- uniqueCategories.add(category.name);
6524
- return true;
6525
- }
6526
- return false;
6527
- });
6528
- var questionsByCategory = filterCategories.map(function (category) {
6519
+ var formatTextbookDataMyAnswer = function formatTextbookDataMyAnswer(inputData, questionGroupIds) {
6520
+ var questionsByCategories = questionGroupIds.map(function (questionGroupId) {
6521
+ var _questions$, _questions$$categorie, _questions$2, _questions$2$categori;
6522
+ var questions = inputData.studentQuestionResults.filter(function (question) {
6523
+ return question.questionGroupId === questionGroupId;
6524
+ });
6525
+ var category = questions === null || questions === void 0 ? void 0 : (_questions$ = questions[0]) === null || _questions$ === void 0 ? void 0 : (_questions$$categorie = _questions$.categories) === null || _questions$$categorie === void 0 ? void 0 : _questions$$categorie[0];
6526
+ var subcategory = !category ? null : questions === null || questions === void 0 ? void 0 : (_questions$2 = questions[0]) === null || _questions$2 === void 0 ? void 0 : (_questions$2$categori = _questions$2.categories) === null || _questions$2$categori === void 0 ? void 0 : _questions$2$categori.find(function (c) {
6527
+ return !!c.parentCategoryId && c.parentCategoryId === (category === null || category === void 0 ? void 0 : category.id);
6528
+ });
6529
6529
  return {
6530
- category: category,
6531
- questions: inputData.studentQuestionResults.filter(function (question) {
6532
- return !!question.categories.find(function (i) {
6533
- return i.name === category.name;
6534
- });
6535
- })
6530
+ categories: category && subcategory ? [category, subcategory] : category ? [category] : [],
6531
+ questions: questions,
6532
+ questionGroupId: questionGroupId
6536
6533
  };
6537
6534
  });
6538
- return questionsByCategory;
6535
+ return questionsByCategories;
6539
6536
  };
6540
6537
  var totalSolveTimeCategories = function totalSolveTimeCategories(inputData, categories) {
6541
6538
  var uniqueCategories = new Set();
@@ -18498,7 +18495,7 @@ var TextbookAnswerItem = function TextbookAnswerItem(_ref) {
18498
18495
  nextData = _ref.nextData,
18499
18496
  isFirst = _ref.isFirst,
18500
18497
  isLast = _ref.isLast,
18501
- categoryId = _ref.categoryId,
18498
+ questionGroupId = _ref.questionGroupId,
18502
18499
  _ref$menuContextActio = _ref.menuContextActions,
18503
18500
  menuContextActions = _ref$menuContextActio === void 0 ? [] : _ref$menuContextActio,
18504
18501
  openContextMenu = _ref.openContextMenu,
@@ -18510,14 +18507,14 @@ var TextbookAnswerItem = function TextbookAnswerItem(_ref) {
18510
18507
  var isLearningSpace = getLearningSpace();
18511
18508
  var handleCloseContextMenu = function handleCloseContextMenu() {
18512
18509
  onCloseContextMenu === null || onCloseContextMenu === void 0 ? void 0 : onCloseContextMenu(_extends({}, data, {
18513
- id: ((data === null || data === void 0 ? void 0 : data.id) || 0) + categoryId
18510
+ id: ((data === null || data === void 0 ? void 0 : data.id) || 0) + questionGroupId
18514
18511
  }));
18515
18512
  };
18516
18513
  var handleMoreClick = function handleMoreClick(e) {
18517
18514
  e.preventDefault();
18518
18515
  e.stopPropagation();
18519
18516
  onOpenContextMenu === null || onOpenContextMenu === void 0 ? void 0 : onOpenContextMenu(_extends({}, data, {
18520
- id: ((data === null || data === void 0 ? void 0 : data.id) || 0) + categoryId
18517
+ id: ((data === null || data === void 0 ? void 0 : data.id) || 0) + questionGroupId
18521
18518
  }));
18522
18519
  };
18523
18520
  return React__default.createElement("div", {
@@ -18644,24 +18641,28 @@ var TextbookAnswerItem = function TextbookAnswerItem(_ref) {
18644
18641
 
18645
18642
  var TextbookMyAnswer = function TextbookMyAnswer(_ref) {
18646
18643
  var data = _ref.data,
18647
- categories = _ref.categories,
18648
18644
  itemProps = _ref.itemProps,
18649
18645
  questionIdContextMenu = _ref.questionIdContextMenu,
18650
18646
  isStudent = _ref.isStudent;
18651
- var formattedData = formatTextbookDataMyAnswer(data, categories);
18647
+ var questionGroupIds = Array.from(new Set(data.studentQuestionResults.map(function (i) {
18648
+ return i.questionGroupId;
18649
+ }))).sort(function (a, b) {
18650
+ return a - b;
18651
+ });
18652
+ var formattedData = formatTextbookDataMyAnswer(data, questionGroupIds);
18652
18653
  var _useTranslation = reactI18next.useTranslation(),
18653
18654
  t = _useTranslation.t;
18654
- var renderAnswer = function renderAnswer(item, index, questions, categoryId) {
18655
+ var renderAnswer = function renderAnswer(item, index, questions, questionGroupId) {
18655
18656
  var nextItem = index < questions.length - 1 ? questions[index + 1] : undefined;
18656
18657
  var isLast = index === questions.length - 1;
18657
18658
  var isFirst = index === 0;
18658
- var isSelected = (item === null || item === void 0 ? void 0 : item.id) + categoryId === questionIdContextMenu;
18659
+ var isSelected = (item === null || item === void 0 ? void 0 : item.id) + questionGroupId === questionIdContextMenu;
18659
18660
  return React__default.createElement(TextbookAnswerItem, Object.assign({
18660
18661
  key: index
18661
18662
  }, itemProps, {
18662
18663
  openContextMenu: isSelected,
18663
18664
  data: item,
18664
- categoryId: categoryId,
18665
+ questionGroupId: questionGroupId,
18665
18666
  nextData: nextItem,
18666
18667
  isLast: isLast,
18667
18668
  isFirst: isFirst,
@@ -18671,8 +18672,9 @@ var TextbookMyAnswer = function TextbookMyAnswer(_ref) {
18671
18672
  return React__default.createElement("div", {
18672
18673
  className: "" + styles$4["myanswer"]
18673
18674
  }, formattedData && formattedData.length > 0 && formattedData.map(function (item) {
18675
+ var _item$categories;
18674
18676
  return React__default.createElement("div", {
18675
- key: item.category.id
18677
+ key: item.questionGroupId
18676
18678
  }, React__default.createElement("div", {
18677
18679
  className: "" + printStyles["avoid-break-inside"]
18678
18680
  }, React__default.createElement(material.Stack, {
@@ -18770,12 +18772,14 @@ var TextbookMyAnswer = function TextbookMyAnswer(_ref) {
18770
18772
  fontSize: "12px",
18771
18773
  fontWeight: 700
18772
18774
  }
18773
- }, item.category.name))), React__default.createElement("div", {
18775
+ }, (_item$categories = item.categories) === null || _item$categories === void 0 ? void 0 : _item$categories.map(function (i) {
18776
+ return i.name;
18777
+ }).join(" / ")))), React__default.createElement("div", {
18774
18778
  className: styles$4["contentMyAnswer"]
18775
18779
  }, React__default.createElement(ListView, {
18776
18780
  data: item.questions,
18777
18781
  render: function render(question, index) {
18778
- return renderAnswer(question, index, item.questions, item.category.id);
18782
+ return renderAnswer(question, index, item.questions, item.questionGroupId);
18779
18783
  }
18780
18784
  })));
18781
18785
  }));
@@ -19415,7 +19419,6 @@ var PrintExamResult = function PrintExamResult(_ref) {
19415
19419
  sx: textStyle
19416
19420
  }, i18n.t(TabList$2[0].label)), chapterId ? textbookResult && React__default.createElement(TextbookMyAnswer, {
19417
19421
  data: textbookResult,
19418
- categories: categoryResponses,
19419
19422
  isStudent: isStudent
19420
19423
  }) : resultData && React__default.createElement(MyAnswer, {
19421
19424
  data: resultData,
@@ -20370,7 +20373,7 @@ var useExamResult = function useExamResult(props) {
20370
20373
  studentId = _props$studentId === void 0 ? 0 : _props$studentId,
20371
20374
  code = props.code,
20372
20375
  chapterId = props.chapterId,
20373
- onViewExamQuestion = props.onViewExamQuestion;
20376
+ onViewQA = props.onViewQA;
20374
20377
  var _useTranslation = reactI18next.useTranslation(),
20375
20378
  t = _useTranslation.t;
20376
20379
  var _useTab = useTab(),
@@ -20420,7 +20423,7 @@ var useExamResult = function useExamResult(props) {
20420
20423
  var handleViewQAndA = function handleViewQAndA(e, note) {
20421
20424
  e.stopPropagation();
20422
20425
  if (!note.examSessionId || !note.questionId) return;
20423
- onViewExamQuestion === null || onViewExamQuestion === void 0 ? void 0 : onViewExamQuestion(note.userId, note.examSessionId, note.questionId);
20426
+ onViewQA === null || onViewQA === void 0 ? void 0 : onViewQA(note.userId, note.examSessionId, note.questionId);
20424
20427
  };
20425
20428
  var fileExamName = !resultData ? "" : "Exam-Result_" + resultData.student.fullName + "_" + resultData.title + "_(" + utcToLocalTime(resultData.startTime, "MM-DD-YYYY HH:mm") + ")";
20426
20429
  var fileTextbookName = !textbookResult ? "" : "Textbook-Result_" + textbookResult.chapterName + "_(" + utcToLocalTime(textbookResult.startTime, "MM-DD-YYYY HH:mm") + ")";
@@ -20447,9 +20450,12 @@ var useExamResult = function useExamResult(props) {
20447
20450
  };
20448
20451
 
20449
20452
  var ExamResultV2 = function ExamResultV2(props) {
20450
- var isMyStoryStudent = props.isMyStoryStudent,
20451
- onViewExamQuestion = props.onViewExamQuestion,
20452
- chapterId = props.chapterId;
20453
+ var role = props.role,
20454
+ isMyStoryStudent = props.isMyStoryStudent,
20455
+ onViewQA = props.onViewQA,
20456
+ chapterId = props.chapterId,
20457
+ studentId = props.studentId;
20458
+ var isAdminSite = role === exports.Role.Admin;
20453
20459
  var _useExamResult = useExamResult(props),
20454
20460
  t = _useExamResult.t,
20455
20461
  fileName = _useExamResult.fileName,
@@ -20567,7 +20573,13 @@ var ExamResultV2 = function ExamResultV2(props) {
20567
20573
  onItemClick: handleOpenNoteDrawer,
20568
20574
  isLoading: isLoadingNotes
20569
20575
  };
20570
- var questionActions = [{
20576
+ var questionActions = chapterId ? [{
20577
+ label: "ask_a_question",
20578
+ textStyle: {
20579
+ color: "#3dc674"
20580
+ },
20581
+ onClick: handleOpenQuestionDialog
20582
+ }] : [{
20571
20583
  label: "write_a_note_of_incorrect_answers",
20572
20584
  textStyle: {
20573
20585
  color: "#3dc674"
@@ -20586,6 +20598,14 @@ var ExamResultV2 = function ExamResultV2(props) {
20586
20598
  onOpenContextMenu: handleOpenQuestionContextMenu,
20587
20599
  isStudent: isStudent
20588
20600
  };
20601
+ var handleViewTextbookQA = function handleViewTextbookQA() {
20602
+ if (!studentId) return;
20603
+ onViewQA === null || onViewQA === void 0 ? void 0 : onViewQA(+studentId, textbookResult === null || textbookResult === void 0 ? void 0 : textbookResult.studentTextbookSessionId, undefined, true);
20604
+ };
20605
+ var handleViewExamQA = function handleViewExamQA() {
20606
+ if (!resultData) return;
20607
+ onViewQA === null || onViewQA === void 0 ? void 0 : onViewQA(resultData.student.id, resultData.examSessionId);
20608
+ };
20589
20609
  return React__default.createElement(React.Fragment, null, React__default.createElement(LoadingComponent, {
20590
20610
  isLoading: !!isLoading
20591
20611
  }), timelyOrderQuestions[dataChartIndex] && longTimeSpend && effectSize ? React__default.createElement("div", {
@@ -20732,7 +20752,7 @@ var ExamResultV2 = function ExamResultV2(props) {
20732
20752
  direction: "row",
20733
20753
  gap: "8px",
20734
20754
  alignItems: "center"
20735
- }, React__default.createElement(material.Button, {
20755
+ }, !isAdminSite && React__default.createElement(material.Button, {
20736
20756
  variant: "outlined",
20737
20757
  sx: {
20738
20758
  color: styles.less_dark,
@@ -20748,7 +20768,7 @@ var ExamResultV2 = function ExamResultV2(props) {
20748
20768
  size: "14px"
20749
20769
  })),
20750
20770
  onClick: function onClick(e) {
20751
- return isStudent ? handleOpenQuestionDialog(e) : onViewExamQuestion === null || onViewExamQuestion === void 0 ? void 0 : onViewExamQuestion(resultData.student.id, resultData.examSessionId);
20771
+ return isStudent ? handleOpenQuestionDialog(e) : handleViewExamQA();
20752
20772
  }
20753
20773
  }, t(isStudent ? "ask_a_question2" : "check_q&a")), React__default.createElement(material.Button, {
20754
20774
  variant: "outlined",
@@ -20806,7 +20826,7 @@ var ExamResultV2 = function ExamResultV2(props) {
20806
20826
  direction: "row",
20807
20827
  gap: "8px",
20808
20828
  alignItems: "center"
20809
- }, React__default.createElement(material.Button, {
20829
+ }, !isAdminSite && React__default.createElement(material.Button, {
20810
20830
  variant: "outlined",
20811
20831
  sx: {
20812
20832
  color: styles.less_dark,
@@ -20822,7 +20842,7 @@ var ExamResultV2 = function ExamResultV2(props) {
20822
20842
  size: "14px"
20823
20843
  })),
20824
20844
  onClick: function onClick(e) {
20825
- return handleOpenQuestionDialog(e);
20845
+ return isStudent ? handleOpenQuestionDialog(e) : handleViewTextbookQA();
20826
20846
  }
20827
20847
  }, t(isStudent ? "ask_a_question2" : "check_q&a")), React__default.createElement(material.Button, {
20828
20848
  variant: "outlined",
@@ -20887,7 +20907,6 @@ var ExamResultV2 = function ExamResultV2(props) {
20887
20907
  index: 0
20888
20908
  }, chapterId ? textbookResult && React__default.createElement(TextbookMyAnswer, {
20889
20909
  data: textbookResult,
20890
- categories: categoryResponses,
20891
20910
  isStudent: isStudent,
20892
20911
  questionIdContextMenu: questionIdContextMenu,
20893
20912
  itemProps: questionItemProp
@@ -21210,12 +21229,14 @@ var PrintExamResultView = function PrintExamResultView(_ref) {
21210
21229
 
21211
21230
  var ExamResultDrawer = function ExamResultDrawer(_ref) {
21212
21231
  var _BRIEF_GRADE_OPTIONS$;
21213
- var history = _ref.history,
21232
+ var role = _ref.role,
21233
+ history = _ref.history,
21214
21234
  open = _ref.open,
21215
21235
  anchor = _ref.anchor,
21216
21236
  width = _ref.width,
21217
21237
  student = _ref.student,
21218
21238
  data = _ref.data,
21239
+ onViewQA = _ref.onViewQA,
21219
21240
  onClose = _ref.onClose;
21220
21241
  var _useTranslation = reactI18next.useTranslation(),
21221
21242
  t = _useTranslation.t;
@@ -21224,16 +21245,6 @@ var ExamResultDrawer = function ExamResultDrawer(_ref) {
21224
21245
  return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.language;
21225
21246
  });
21226
21247
  var search = window.location.search;
21227
- var searchParams = new URLSearchParams(search);
21228
- var handleViewExamQuestion = function handleViewExamQuestion(studentId, examSessionId, questionId) {
21229
- searchParams.set("sId", "" + studentId);
21230
- examSessionId && searchParams.set("eId", "" + examSessionId);
21231
- questionId && searchParams.set("qId", "" + questionId);
21232
- pushTo(history, {
21233
- pathname: "/teacher/question-and-answers",
21234
- search: searchParams.toString()
21235
- });
21236
- };
21237
21248
  var studentId = student === null || student === void 0 ? void 0 : student.id;
21238
21249
  var code = data === null || data === void 0 ? void 0 : data.code;
21239
21250
  var examSessionId = data === null || data === void 0 ? void 0 : data.id;
@@ -21333,21 +21344,24 @@ var ExamResultDrawer = function ExamResultDrawer(_ref) {
21333
21344
  pb: 4
21334
21345
  }
21335
21346
  }, examSessionId && React__default.createElement(ExamResultV2, {
21347
+ role: role,
21336
21348
  history: history,
21337
21349
  searchParams: search,
21338
21350
  code: code,
21339
21351
  examSessionId: examSessionId,
21340
21352
  studentId: studentId,
21341
- onViewExamQuestion: handleViewExamQuestion
21353
+ onViewQA: onViewQA
21342
21354
  })));
21343
21355
  };
21344
21356
 
21345
21357
  var DrawerExamResultTab = function DrawerExamResultTab(_ref) {
21346
- var history = _ref.history,
21358
+ var role = _ref.role,
21359
+ history = _ref.history,
21347
21360
  student = _ref.student,
21348
21361
  selectedTab = _ref.selectedTab,
21349
21362
  value = _ref.value,
21350
- studentId = _ref.studentId;
21363
+ studentId = _ref.studentId,
21364
+ onViewQA = _ref.onViewQA;
21351
21365
  var _useVirtualList = useVirtualList(studentId, EXAM_SESSION_DEFAULT_FILTER, getExamSessionListApi),
21352
21366
  items = _useVirtualList.items,
21353
21367
  selectedItem = _useVirtualList.selectedItem,
@@ -21382,13 +21396,15 @@ var DrawerExamResultTab = function DrawerExamResultTab(_ref) {
21382
21396
  onItemClick: handleChangeSelectedItem,
21383
21397
  listHeight: 0
21384
21398
  })), React__default.createElement(ExamResultDrawer, {
21399
+ role: role,
21385
21400
  open: !!selectedItem,
21386
21401
  data: selectedItem,
21387
21402
  student: student,
21388
21403
  anchor: "right",
21389
21404
  width: "80dvw",
21390
21405
  onClose: handleCloseDrawer,
21391
- history: history
21406
+ history: history,
21407
+ onViewQA: onViewQA
21392
21408
  }));
21393
21409
  };
21394
21410
 
@@ -22397,11 +22413,13 @@ var ChapterDetail = function ChapterDetail(_ref) {
22397
22413
 
22398
22414
  var ChapterProblemSolvingResultsDialog = function ChapterProblemSolvingResultsDialog(_ref) {
22399
22415
  var t = _ref.t,
22416
+ role = _ref.role,
22400
22417
  onClose = _ref.onClose,
22401
22418
  open = _ref.open,
22402
22419
  history = _ref.history,
22403
22420
  chapterId = _ref.chapterId,
22404
- studentId = _ref.studentId;
22421
+ studentId = _ref.studentId,
22422
+ onViewQA = _ref.onViewQA;
22405
22423
  return React__default.createElement(material.Dialog, {
22406
22424
  onClose: onClose,
22407
22425
  open: open,
@@ -22433,11 +22451,13 @@ var ChapterProblemSolvingResultsDialog = function ChapterProblemSolvingResultsDi
22433
22451
  }, React__default.createElement(material.Stack, {
22434
22452
  mx: "24px"
22435
22453
  }, React__default.createElement(ExamResultV2, {
22454
+ role: role,
22436
22455
  history: history,
22437
22456
  searchParams: "",
22438
22457
  chapterId: chapterId,
22439
22458
  studentId: studentId,
22440
- isMyStoryStudent: false
22459
+ isMyStoryStudent: false,
22460
+ onViewQA: onViewQA
22441
22461
  })), React__default.createElement(material.DialogActions, {
22442
22462
  sx: {
22443
22463
  display: "flex",
@@ -22713,7 +22733,8 @@ var TextbookDrawer = function TextbookDrawer(_ref) {
22713
22733
  studentId = _ref.studentId,
22714
22734
  anchor = _ref.anchor,
22715
22735
  navigate = _ref.navigate,
22716
- onClose = _ref.onClose;
22736
+ onClose = _ref.onClose,
22737
+ onViewQA = _ref.onViewQA;
22717
22738
  var isStudent = role === exports.Role.Student;
22718
22739
  var _useTextbookDrawer = useTextbookDrawer({
22719
22740
  isStudent: isStudent,
@@ -22987,12 +23008,14 @@ var TextbookDrawer = function TextbookDrawer(_ref) {
22987
23008
  });
22988
23009
  }))))), React__default.createElement(ChapterProblemSolvingResultsDialog, {
22989
23010
  t: t,
23011
+ role: role,
22990
23012
  theme: theme,
22991
23013
  history: history,
22992
23014
  chapterId: chapterSelected === null || chapterSelected === void 0 ? void 0 : chapterSelected.id,
22993
23015
  studentId: studentId,
22994
23016
  open: isOpenChapterDialog,
22995
- onClose: handleCloseChapterDialog
23017
+ onClose: handleCloseChapterDialog,
23018
+ onViewQA: onViewQA
22996
23019
  }), React__default.createElement(StartPageDialog, {
22997
23020
  options: startPageOptions,
22998
23021
  t: t,
@@ -23341,6 +23364,7 @@ var TextbookInfoDrawer = function TextbookInfoDrawer(_ref) {
23341
23364
  var Textbook = function Textbook(_ref) {
23342
23365
  var _textbook$createdBy, _textbook$createdBy2;
23343
23366
  var t = _ref.t,
23367
+ role = _ref.role,
23344
23368
  user = _ref.user,
23345
23369
  theme = _ref.theme,
23346
23370
  textbook = _ref.textbook,
@@ -23349,7 +23373,8 @@ var Textbook = function Textbook(_ref) {
23349
23373
  navigate = _ref.navigate,
23350
23374
  preparedType = _ref.preparedType,
23351
23375
  preparedFilterType = _ref.preparedFilterType,
23352
- getTextbookList = _ref.getTextbookList;
23376
+ getTextbookList = _ref.getTextbookList,
23377
+ onViewQA = _ref.onViewQA;
23353
23378
  var isTabletUp = material.useMediaQuery(theme.breakpoints.up("lg"));
23354
23379
  var _useDrawer = useDrawer(),
23355
23380
  isOpenDialog = _useDrawer.isOpenDialog,
@@ -23489,15 +23514,16 @@ var Textbook = function Textbook(_ref) {
23489
23514
  }, React__default.createElement(io5.IoTrash, {
23490
23515
  size: "20px"
23491
23516
  }), t("delete_test"))), isOpenDialog && React__default.createElement(TextbookDrawer, {
23492
- role: isStudent ? exports.Role.Student : exports.Role.Teacher,
23517
+ role: role,
23493
23518
  isOpen: isOpenDialog,
23494
23519
  onClose: handleCloseDialog,
23495
23520
  textbookId: textbook.id,
23496
23521
  navigate: navigate,
23497
23522
  width: !isTabletUp ? "100dvw" : "50dvw",
23498
- anchor: "right"
23523
+ anchor: "right",
23524
+ onViewQA: onViewQA
23499
23525
  }), openDetailDialog && React__default.createElement(TextbookInfoDrawer, {
23500
- role: isStudent ? exports.Role.Student : exports.Role.Teacher,
23526
+ role: role,
23501
23527
  user: user,
23502
23528
  isSuperAdmin: isSuperAdmin,
23503
23529
  isOpen: openDetailDialog,
@@ -23516,9 +23542,11 @@ var Textbook = function Textbook(_ref) {
23516
23542
  };
23517
23543
 
23518
23544
  var PreparedItem = function PreparedItem(_ref) {
23519
- var preparedType = _ref.preparedType,
23545
+ var role = _ref.role,
23546
+ preparedType = _ref.preparedType,
23520
23547
  preparedFilterType = _ref.preparedFilterType,
23521
- navigate = _ref.navigate;
23548
+ navigate = _ref.navigate,
23549
+ onViewQA = _ref.onViewQA;
23522
23550
  var _useExpand = useExpand(),
23523
23551
  expanded = _useExpand.expanded,
23524
23552
  handleCloseExpand = _useExpand.handleCloseExpand,
@@ -24046,6 +24074,7 @@ var PreparedItem = function PreparedItem(_ref) {
24046
24074
  }, textbookList === null || textbookList === void 0 ? void 0 : textbookList.map(function (textbook) {
24047
24075
  return React__default.createElement(Textbook, {
24048
24076
  t: t,
24077
+ role: role,
24049
24078
  user: user,
24050
24079
  theme: theme,
24051
24080
  textbook: textbook,
@@ -24054,7 +24083,8 @@ var PreparedItem = function PreparedItem(_ref) {
24054
24083
  navigate: navigate,
24055
24084
  getTextbookList: getTextbookList,
24056
24085
  preparedType: preparedType,
24057
- preparedFilterType: preparedFilterType
24086
+ preparedFilterType: preparedFilterType,
24087
+ onViewQA: onViewQA
24058
24088
  });
24059
24089
  }), React__default.createElement(material.Stack, {
24060
24090
  display: "flex",
@@ -24069,10 +24099,12 @@ var PreparedItem = function PreparedItem(_ref) {
24069
24099
  };
24070
24100
 
24071
24101
  var DrawerTextbookResultTab = function DrawerTextbookResultTab(_ref) {
24072
- var history = _ref.history,
24102
+ var role = _ref.role,
24103
+ history = _ref.history,
24073
24104
  studentId = _ref.studentId,
24074
24105
  selectedTab = _ref.selectedTab,
24075
- value = _ref.value;
24106
+ value = _ref.value,
24107
+ onViewQA = _ref.onViewQA;
24076
24108
  var _useVirtualList = useVirtualList(studentId, TEXTBOOK_DEFAULT_FILTER, getTextbookListApi),
24077
24109
  items = _useVirtualList.items,
24078
24110
  selectedItem = _useVirtualList.selectedItem,
@@ -24107,14 +24139,15 @@ var DrawerTextbookResultTab = function DrawerTextbookResultTab(_ref) {
24107
24139
  onItemClick: handleChangeSelectedItem,
24108
24140
  listHeight: 0
24109
24141
  })), React__default.createElement(TextbookDrawer, {
24110
- role: exports.Role.Teacher,
24142
+ role: role,
24111
24143
  navigate: history,
24112
24144
  isOpen: !!selectedItem,
24113
24145
  width: "80dvw",
24114
24146
  onClose: handleCloseDrawer,
24115
24147
  textbookId: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.id,
24116
24148
  studentId: studentId,
24117
- anchor: "right"
24149
+ anchor: "right",
24150
+ onViewQA: onViewQA
24118
24151
  }));
24119
24152
  };
24120
24153
 
@@ -24746,7 +24779,9 @@ var StudentInfoDrawer = function StudentInfoDrawer(props) {
24746
24779
  studentId = props.studentId,
24747
24780
  anchor = props.anchor,
24748
24781
  width = props.width,
24749
- history = props.history;
24782
+ history = props.history,
24783
+ role = props.role,
24784
+ onViewQA = props.onViewQA;
24750
24785
  var _useStudentInfoDrawer = useStudentInfoDrawer(props),
24751
24786
  loadedTabs = _useStudentInfoDrawer.loadedTabs,
24752
24787
  isLoading = _useStudentInfoDrawer.isLoading,
@@ -24790,21 +24825,26 @@ var StudentInfoDrawer = function StudentInfoDrawer(props) {
24790
24825
  data: studentInfo,
24791
24826
  isLoading: isLoading
24792
24827
  }), loadedTabs[DrawerTab.Exam] && React__default.createElement(DrawerExamResultTab, {
24828
+ role: role,
24793
24829
  value: DrawerTab.Exam,
24794
24830
  selectedTab: selectedTab,
24795
24831
  studentId: studentId,
24796
24832
  student: studentInfo,
24797
- history: history
24833
+ history: history,
24834
+ onViewQA: onViewQA
24798
24835
  }), loadedTabs[DrawerTab.Textbook] && React__default.createElement(DrawerTextbookResultTab, {
24836
+ role: role,
24799
24837
  value: DrawerTab.Textbook,
24800
24838
  selectedTab: selectedTab,
24801
24839
  studentId: studentId,
24802
- history: history
24840
+ history: history,
24841
+ onViewQA: onViewQA
24803
24842
  }))));
24804
24843
  };
24805
24844
 
24806
24845
  var StudentList = function StudentList(_ref) {
24807
- var history = _ref.history,
24846
+ var role = _ref.role,
24847
+ history = _ref.history,
24808
24848
  onAdd = _ref.onAdd,
24809
24849
  paging = _ref.paging,
24810
24850
  classList = _ref.classList,
@@ -24818,7 +24858,8 @@ var StudentList = function StudentList(_ref) {
24818
24858
  handleSort = _ref.handleSort,
24819
24859
  handleChangeSearchText = _ref.handleChangeSearchText,
24820
24860
  handleChangePage = _ref.handleChangePage,
24821
- handleRemoveStudentFromClass = _ref.handleRemoveStudentFromClass;
24861
+ handleRemoveStudentFromClass = _ref.handleRemoveStudentFromClass,
24862
+ onViewQA = _ref.onViewQA;
24822
24863
  var _useState = React.useState(),
24823
24864
  selectedViewStudent = _useState[0],
24824
24865
  setSelectedViewStudent = _useState[1];
@@ -24948,13 +24989,15 @@ var StudentList = function StudentList(_ref) {
24948
24989
  onConfirm: handleRemoveStudentFromClass,
24949
24990
  isDelete: true
24950
24991
  }), React__default.createElement(StudentInfoDrawer, {
24992
+ role: role,
24951
24993
  open: !!selectedViewStudent,
24952
24994
  studentId: (selectedViewStudent === null || selectedViewStudent === void 0 ? void 0 : selectedViewStudent.studentId) || 0,
24953
24995
  onClose: handleCloseStudentInfo,
24954
24996
  anchor: "right",
24955
24997
  width: "80dvw",
24956
24998
  history: history,
24957
- inert: true
24999
+ inert: true,
25000
+ onViewQA: onViewQA
24958
25001
  }));
24959
25002
  };
24960
25003
 
@@ -26532,7 +26575,8 @@ var ClassDetail = function ClassDetail(_ref) {
26532
26575
  var id = _ref.id,
26533
26576
  history = _ref.history,
26534
26577
  classListUrl = _ref.classListUrl,
26535
- role = _ref.role;
26578
+ role = _ref.role,
26579
+ onViewQA = _ref.onViewQA;
26536
26580
  var classId = !id || Number.isNaN(+id) ? 0 : +id;
26537
26581
  var _useClassDetail = useClassDetail({
26538
26582
  history: history,
@@ -26647,10 +26691,13 @@ var ClassDetail = function ClassDetail(_ref) {
26647
26691
  value: selected,
26648
26692
  index: TabList$1[1].value
26649
26693
  }, !!classId && selected === TabList$1[1].value && React__default.createElement(StudentList, Object.assign({
26694
+ role: role,
26650
26695
  disabled: isDisabled && !isTeacher,
26651
26696
  onAdd: handleOpenSelectDialog,
26652
26697
  history: history
26653
- }, studentListProps))), React__default.createElement(CustomTabPanel, {
26698
+ }, studentListProps, {
26699
+ onViewQA: onViewQA
26700
+ }))), React__default.createElement(CustomTabPanel, {
26654
26701
  value: selected,
26655
26702
  index: TabList$1[2].value
26656
26703
  }, !!classId && selected === TabList$1[2].value && React__default.createElement(TeacherList, Object.assign({
@@ -28383,7 +28430,8 @@ var UserRow = function UserRow(_ref) {
28383
28430
 
28384
28431
  var UserList = function UserList(_ref) {
28385
28432
  var role = _ref.role,
28386
- history = _ref.history;
28433
+ history = _ref.history,
28434
+ onViewQA = _ref.onViewQA;
28387
28435
  var isSuperAdmin = reactRedux.useSelector(function (state) {
28388
28436
  var _state$common, _state$common$user;
28389
28437
  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;
@@ -28589,12 +28637,14 @@ var UserList = function UserList(_ref) {
28589
28637
  onClose: handleCloseRecentUserActionDialog,
28590
28638
  recentUserActions: recentUserActions
28591
28639
  }), React__default.createElement(StudentInfoDrawer, {
28640
+ role: role,
28592
28641
  open: !!selectedStudent,
28593
28642
  studentId: selectedStudent === null || selectedStudent === void 0 ? void 0 : selectedStudent.id,
28594
28643
  width: "80dvw",
28595
28644
  anchor: "right",
28596
28645
  onClose: handleCloseStudentInfo,
28597
28646
  history: history,
28647
+ onViewQA: onViewQA,
28598
28648
  inert: true
28599
28649
  }), (isAdmin || isSuperAdmin) && React__default.createElement(DeleteUserCsvDialog, {
28600
28650
  open: isOpenDeleteUserCsv,