touchstudy-core 0.1.187 → 0.1.188

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
@@ -16,6 +16,13 @@ var moment = _interopDefault(require('moment'));
16
16
  var fa = require('react-icons/fa');
17
17
  var io = require('react-icons/io');
18
18
  var io5 = require('react-icons/io5');
19
+ var _$a = _interopDefault(require('lodash'));
20
+ var reactRedux = require('react-redux');
21
+ var axios = _interopDefault(require('axios'));
22
+ var reactGoogleLogin = require('@leecheuk/react-google-login');
23
+ require('moment/locale/ko.js');
24
+ require('moment/locale/en-au.js');
25
+ var reactVirtualized = require('react-virtualized');
19
26
  var MButton = _interopDefault(require('@mui/material/Button'));
20
27
  var DialogTitle = _interopDefault(require('@mui/material/DialogTitle'));
21
28
  var DialogContent = _interopDefault(require('@mui/material/DialogContent'));
@@ -26,13 +33,6 @@ var formik = require('formik');
26
33
  var Select = require('react-select');
27
34
  var Select__default = _interopDefault(Select);
28
35
  var CreatableSelect = _interopDefault(require('react-select/creatable'));
29
- var _$a = _interopDefault(require('lodash'));
30
- var reactRedux = require('react-redux');
31
- var axios = _interopDefault(require('axios'));
32
- var reactGoogleLogin = require('@leecheuk/react-google-login');
33
- require('moment/locale/ko.js');
34
- require('moment/locale/en-au.js');
35
- var reactVirtualized = require('react-virtualized');
36
36
  var tinymce = _interopDefault(require('tinymce'));
37
37
  require('@wiris/mathtype-tinymce6');
38
38
  var tinymceReact = require('@tinymce/tinymce-react');
@@ -5910,402 +5910,6 @@ var ConfirmDeleteDialogDefaultProps = {
5910
5910
  isDelete: true
5911
5911
  };
5912
5912
 
5913
- var ConfirmDialog = function ConfirmDialog(_ref) {
5914
- var open = _ref.open,
5915
- text = _ref.text,
5916
- cancelText = _ref.cancelText,
5917
- okText = _ref.okText,
5918
- isDelete = _ref.isDelete,
5919
- title = _ref.title,
5920
- confirmText = _ref.confirmText,
5921
- titleStyle = _ref.titleStyle,
5922
- titleClassName = _ref.titleClassName,
5923
- contentStyle = _ref.contentStyle,
5924
- cancelButtonStyle = _ref.cancelButtonStyle,
5925
- contentTextStyle = _ref.contentTextStyle,
5926
- okButtonStyle = _ref.okButtonStyle,
5927
- actionStyle = _ref.actionStyle,
5928
- _ref$okButtonVariant = _ref.okButtonVariant,
5929
- okButtonVariant = _ref$okButtonVariant === void 0 ? "contained" : _ref$okButtonVariant,
5930
- _ref$cancelButtonVari = _ref.cancelButtonVariant,
5931
- cancelButtonVariant = _ref$cancelButtonVari === void 0 ? "contained" : _ref$cancelButtonVari,
5932
- _ref$zIndex = _ref.zIndex,
5933
- zIndex = _ref$zIndex === void 0 ? 1102 : _ref$zIndex,
5934
- toggle = _ref.toggle,
5935
- onConfirm = _ref.onConfirm;
5936
- var _useState = React.useState(),
5937
- confirmTextValue = _useState[0],
5938
- setConfirmTextValue = _useState[1];
5939
- var _useTranslation = reactI18next.useTranslation(),
5940
- t = _useTranslation.t;
5941
- var handleConfirm = function handleConfirm() {
5942
- onConfirm();
5943
- };
5944
- var handleChangeConfirmText = function handleChangeConfirmText(e) {
5945
- setConfirmTextValue(e.target.value);
5946
- };
5947
- var handlePaste = function handlePaste(_) {};
5948
- React.useEffect(function () {
5949
- !open && setConfirmTextValue(undefined);
5950
- }, [open]);
5951
- var isValid = !!confirmText && !!confirmTextValue && confirmTextValue.trim() === confirmText.trim();
5952
- var isDisableDelete = !!confirmText && (confirmTextValue === null || confirmTextValue === void 0 ? void 0 : confirmTextValue.trim()) !== confirmText.trim();
5953
- return React__default.createElement(material.Dialog, {
5954
- open: open,
5955
- onClose: toggle,
5956
- sx: {
5957
- zIndex: zIndex
5958
- }
5959
- }, React__default.createElement(React.Fragment, null, React__default.createElement(material.DialogTitle, {
5960
- className: "border border-start-0 border-end-0 border-top-0 border-1 " + titleClassName,
5961
- sx: _extends({
5962
- fontSize: 16
5963
- }, titleStyle)
5964
- }, title || t('confirmation')), React__default.createElement(material.IconButton, {
5965
- "aria-label": "close",
5966
- onClick: toggle,
5967
- sx: {
5968
- position: "absolute",
5969
- right: 8,
5970
- top: 8,
5971
- color: function color(theme) {
5972
- return theme.palette.grey[500];
5973
- }
5974
- }
5975
- }, React__default.createElement(io5.IoClose, null))), React__default.createElement(material.DialogContent, {
5976
- sx: _extends({
5977
- pt: 0.5
5978
- }, contentStyle)
5979
- }, React__default.createElement(material.Typography, {
5980
- className: "mb-1",
5981
- sx: _extends({
5982
- fontWeight: 700
5983
- }, contentTextStyle)
5984
- }, text), !!confirmText && React__default.createElement("div", {
5985
- className: "w-100"
5986
- }, React__default.createElement("p", {
5987
- className: "mb-3"
5988
- }, t("enter_text_to_confirm_delete", {
5989
- text: confirmText
5990
- })), React__default.createElement(material.TextField, {
5991
- className: "w-100",
5992
- sx: {
5993
- "& input": {
5994
- py: 1
5995
- }
5996
- },
5997
- value: confirmTextValue,
5998
- onChange: handleChangeConfirmText,
5999
- placeholder: t('please_enter'),
6000
- onPaste: handlePaste,
6001
- error: !isValid && confirmTextValue !== undefined,
6002
- color: isValid ? "success" : confirmTextValue !== undefined ? "error" : undefined
6003
- }))), React__default.createElement(material.DialogActions, {
6004
- className: "border border-start-0 border-end-0 border-bottom-0 border-1 " + titleClassName,
6005
- sx: _extends({
6006
- paddingTop: 1
6007
- }, actionStyle)
6008
- }, React__default.createElement(material.Button, {
6009
- variant: cancelButtonVariant,
6010
- color: cancelButtonVariant !== "contained" ? "primary" : "secondary",
6011
- className: "px-3 " + (cancelButtonVariant !== "contained" ? "primary" : "bg-secondary"),
6012
- onClick: toggle,
6013
- sx: cancelButtonStyle
6014
- }, cancelText || t("no")), React__default.createElement(material.Button, {
6015
- variant: okButtonVariant,
6016
- color: isDelete ? "error" : "primary",
6017
- className: "px-3",
6018
- disabled: isDisableDelete,
6019
- onClick: handleConfirm,
6020
- sx: _extends({}, okButtonStyle, isDelete && {
6021
- backgroundColor: "#db4d4d",
6022
- color: "#FFFFFF",
6023
- "&:hover": {
6024
- backgroundColor: "#C41414"
6025
- }
6026
- })
6027
- }, okText || t('yes'))));
6028
- };
6029
-
6030
- var ConfirmDeleteDialog = function ConfirmDeleteDialog(props) {
6031
- return React__default.createElement(ConfirmDialog, Object.assign({}, ConfirmDeleteDialogDefaultProps, props));
6032
- };
6033
-
6034
- var iconCloseDialog = function iconCloseDialog(_ref) {
6035
- var _ref$width = _ref.width,
6036
- width = _ref$width === void 0 ? "24" : _ref$width,
6037
- _ref$height = _ref.height,
6038
- height = _ref$height === void 0 ? "25" : _ref$height,
6039
- color = _ref.color;
6040
- return React__default.createElement("svg", {
6041
- width: width,
6042
- height: height,
6043
- viewBox: "0 0 24 25",
6044
- fill: color,
6045
- xmlns: "http://www.w3.org/2000/svg"
6046
- }, React__default.createElement("path", {
6047
- d: "M13.5909 12.5L18.0441 8.04687C18.2554 7.8359 18.3743 7.54962 18.3745 7.25099C18.3748 6.95237 18.2564 6.66587 18.0455 6.45453C17.8345 6.24319 17.5482 6.12431 17.2496 6.12404C16.951 6.12378 16.6645 6.24215 16.4531 6.45312L12 10.9062L7.54687 6.45312C7.33553 6.24178 7.04888 6.12305 6.75 6.12305C6.45111 6.12305 6.16447 6.24178 5.95312 6.45312C5.74178 6.66447 5.62305 6.95111 5.62305 7.25C5.62305 7.54888 5.74178 7.83553 5.95312 8.04687L10.4062 12.5L5.95312 16.9531C5.74178 17.1645 5.62305 17.4511 5.62305 17.75C5.62305 18.0489 5.74178 18.3355 5.95312 18.5469C6.16447 18.7582 6.45111 18.8769 6.75 18.8769C7.04888 18.8769 7.33553 18.7582 7.54687 18.5469L12 14.0937L16.4531 18.5469C16.6645 18.7582 16.9511 18.8769 17.25 18.8769C17.5489 18.8769 17.8355 18.7582 18.0469 18.5469C18.2582 18.3355 18.3769 18.0489 18.3769 17.75C18.3769 17.4511 18.2582 17.1645 18.0469 16.9531L13.5909 12.5Z",
6048
- fill: "#202B37"
6049
- }));
6050
- };
6051
-
6052
- var iconWarning = function iconWarning(_ref) {
6053
- var _ref$width = _ref.width,
6054
- width = _ref$width === void 0 ? "17" : _ref$width,
6055
- _ref$height = _ref.height,
6056
- height = _ref$height === void 0 ? "16" : _ref$height,
6057
- color = _ref.color;
6058
- return React__default.createElement("svg", {
6059
- width: width,
6060
- height: height,
6061
- viewBox: "0 0 17 16",
6062
- fill: color,
6063
- xmlns: "http://www.w3.org/2000/svg"
6064
- }, React__default.createElement("path", {
6065
- d: "M14.5335 12.4712L9.20754 2.58062C8.83004 1.87937 7.82441 1.87937 7.4466 2.58062L2.12097 12.4712C2.03901 12.6235 1.99792 12.7944 2.00171 12.9672C2.00549 13.1401 2.05404 13.309 2.14259 13.4575C2.23115 13.606 2.3567 13.729 2.50698 13.8145C2.65726 13.9 2.82714 13.9451 3.00004 13.9453H13.6529C13.8259 13.9453 13.996 13.9005 14.1465 13.8151C14.2969 13.7297 14.4227 13.6067 14.5115 13.4582C14.6002 13.3096 14.6489 13.1406 14.6527 12.9676C14.6566 12.7946 14.6155 12.6236 14.5335 12.4712ZM8.32722 12.4141C8.20361 12.4141 8.08277 12.3774 7.97999 12.3087C7.87721 12.2401 7.7971 12.1424 7.7498 12.0282C7.7025 11.914 7.69012 11.7884 7.71423 11.6671C7.73835 11.5459 7.79787 11.4345 7.88528 11.3471C7.97269 11.2597 8.08405 11.2002 8.20529 11.1761C8.32653 11.152 8.4522 11.1643 8.5664 11.2116C8.6806 11.2589 8.77822 11.3391 8.84689 11.4418C8.91557 11.5446 8.95222 11.6654 8.95222 11.7891C8.95222 11.8711 8.93606 11.9524 8.90465 12.0282C8.87324 12.1041 8.8272 12.173 8.76917 12.231C8.71113 12.289 8.64223 12.3351 8.5664 12.3665C8.49057 12.3979 8.4093 12.4141 8.32722 12.4141ZM9.00597 6.12813L8.8266 9.94063C8.8266 10.0732 8.77392 10.2004 8.68015 10.2942C8.58638 10.3879 8.45921 10.4406 8.3266 10.4406C8.19399 10.4406 8.06681 10.3879 7.97305 10.2942C7.87928 10.2004 7.8266 10.0732 7.8266 9.94063L7.64722 6.12969C7.64319 6.03862 7.65754 5.94768 7.6894 5.86227C7.72127 5.77687 7.77 5.69875 7.8327 5.63259C7.8954 5.56642 7.97078 5.51355 8.05434 5.47713C8.13791 5.44072 8.22795 5.4215 8.3191 5.42063H8.32566C8.41743 5.42058 8.50826 5.43912 8.59267 5.47515C8.67708 5.51117 8.75331 5.56392 8.81677 5.63021C8.88023 5.6965 8.92961 5.77497 8.96191 5.86087C8.99421 5.94676 9.00878 6.03832 9.00472 6.13L9.00597 6.12813Z",
6066
- fill: "#DB4D4D"
6067
- }));
6068
- };
6069
-
6070
- var styles$1 = {"lighter":"#F0FFF6","light":"#89F0B2","less_dark":"#3DC674","dark":"#349056","darker":"#18442A","gray_50":"#FBFBF9","gray_100":"#EAEAE5","gray_300":"#D0D0C8","gray_500":"#9A9A98","gray_700":"#5D5D5B","gray_900":"#363634","red_900":"#DB4D4D","green_support_900":"#3ACB46","yellow_900":"#FEAF06","purple_900":"#C3099A","titleBox":"_2mYOt","title":"_1H9qR","point":"_2rTfh","buttonGroup":"_W5dic","btnFeedback":"_FmMYN","btnTerminate":"_3kv6J","myanswer":"_1jZV7","titleMyAnswer1":"_1aYD1","titleMyAnswer2":"_2Oc4x","contentMyAnswer":"__LRYW","myAnswerItem":"_1U-Kx","time":"_2PXiz","timeCol":"_1zcfJ","answer-response":"_18ZNf","answer-response-0":"_3nbRi","answer-response-1":"_3NEHk","answer-response-2":"_Et0ih","answer-response-3":"_5Vc3v","answer-response-4":"_2SMBR","overall-response-1":"_1ImE5","overall-response-2":"_1oVKC","overall-response-3":"_2wXCw","answerCorrect":"_gE8qM","answerIncorrect":"_3kRqE","answerNograss":"_22Pi3","answerEasy":"_1C7aw","answerDiscrimination":"__YGYX","answerTrap":"_3AkGb","answerNoTime":"_3l-yC","questionOrder":"_2mK7U","myTimeLabel":"_3ZOZs","myPoolTime":"_1Gajr","topTimeLabel":"_62PzE","topTime":"_3HUx1","meanTimeLabel":"_Yu8Oq","meanTime":"_18kZu","compareChart":"_2MTOH","prevChart":"_JoHQL","chart":"_29iCQ","nextChart":"_3hjxI","titleChart":"_2Z42z","titleCompareGrass":"_34RN_","tableCompareGrass":"_2lzlQ","thcolumn1":"_2MSIH","tdcolumn1":"_1I06v","tdcolumn3":"_VpMQ5","classification":"_3t41M","wrapperProblem":"_2vh8v","titleProblem":"_3YfGm","titleProblemClose":"_34388","titleTrickyProblem":"_INxbh","wrongQuestions":"_35DcB","question":"_10SAW","assignedQuestions":"_oEGQ_","wrapperContent":"_zhZ1O","content":"_NGHD4","contentColumn1":"_v5SKe","span1":"_28SHT","span2":"_1raLd","contentColumn2":"_-xJ34","duration":"_1YGAg","topDuration":"_3DiyY","overallCorrectRate":"_DnkyV","answer":"_29MTE","contentVulnerable":"_3x1PG","wrappContentProblem":"_2saM2","contentProblem":"_1hTJx","labelProblem":"_3BXO9","name":"_1cUZW","percent":"_3CLEc","slider":"_3LCEY","track":"_3I8mi","noData":"_1oZ-s","loading":"_Nm201","table-responsive":"_3zQL-","form-label":"_3Vpmh","form-control":"_DafKE","form-label-dialog":"_3NjaH","btn-cancel":"_sLxwL","btn-register":"_4ZKQY","pdfBtnBox":"_2zUJf","pdfBtn":"_y_Cr7","form-select":"_HCIxD","loader":"_3aDIU","dot":"_JGCIL","bounce":"_3M62i"};
6071
-
6072
- var DropdownIndicator = function DropdownIndicator(props) {
6073
- return React__default.createElement(Select.components.DropdownIndicator, Object.assign({}, props), React__default.createElement(fa.FaCaretDown, {
6074
- size: 20,
6075
- color: styles.darker
6076
- }));
6077
- };
6078
- var CustomOption = function CustomOption(props) {
6079
- return React__default.createElement(Select.components.Option, Object.assign({}, props), React__default.createElement("div", {
6080
- style: {
6081
- fontSize: "14px",
6082
- fontWeight: 500
6083
- }
6084
- }, props.data.label));
6085
- };
6086
-
6087
- var customStyles = {
6088
- control: function control(baseStyles, state) {
6089
- return _extends({}, baseStyles, {
6090
- fontSize: "14px",
6091
- fontWeight: 700,
6092
- color: styles.darker,
6093
- borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark,
6094
- boxShadow: state.isFocused ? "0 0 0 1px " + styles.dark + "4D" : baseStyles.boxShadow,
6095
- "&:active": {
6096
- borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
6097
- },
6098
- "&:hover": {
6099
- borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
6100
- }
6101
- });
6102
- },
6103
- input: function input(baseStyles, _) {
6104
- return _extends({}, baseStyles, {
6105
- fontSize: "14px",
6106
- fontWeight: 700,
6107
- color: styles.darker
6108
- });
6109
- },
6110
- placeholder: function placeholder(baseStyles, _) {
6111
- return _extends({}, baseStyles, {
6112
- whiteSpace: "nowrap"
6113
- });
6114
- },
6115
- singleValue: function singleValue(baseStyles) {
6116
- return _extends({}, baseStyles, {
6117
- fontSize: "14px",
6118
- fontWeight: 700,
6119
- color: styles.darker
6120
- });
6121
- },
6122
- option: function option(baseStyles, state) {
6123
- return _extends({}, baseStyles, {
6124
- zIndex: 999,
6125
- backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.light : 'white',
6126
- "&:active": {
6127
- backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.less_dark : baseStyles.backgroundColor
6128
- }
6129
- });
6130
- },
6131
- menuPortal: function menuPortal(base) {
6132
- return _extends({}, base, {
6133
- zIndex: 99
6134
- });
6135
- }
6136
- };
6137
-
6138
- var _excluded = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
6139
- var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
6140
- var _value$;
6141
- var isDefault = _ref.isDefault,
6142
- options = _ref.options,
6143
- isDisabled = _ref.isDisabled,
6144
- scrollBottom = _ref.scrollBottom,
6145
- value = _ref.value,
6146
- isMulti = _ref.isMulti,
6147
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
6148
- var isOptionValue = (value === null || value === void 0 ? void 0 : value.value) || (value === null || value === void 0 ? void 0 : (_value$ = value[0]) === null || _value$ === void 0 ? void 0 : _value$.value);
6149
- var initialValues = isOptionValue ? value : Array.isArray(value) ? options.filter(function (i) {
6150
- return value.includes(i.value);
6151
- }) : isMulti ? options.filter(function (i) {
6152
- return i.value == value;
6153
- }) : options.find(function (i) {
6154
- return i.value == value;
6155
- });
6156
- var _useTranslation = reactI18next.useTranslation(),
6157
- t = _useTranslation.t;
6158
- return React__default.createElement(Select__default, Object.assign({
6159
- isDisabled: isDisabled,
6160
- options: options,
6161
- value: !isDefault ? initialValues : undefined,
6162
- defaultValue: isDefault ? initialValues : undefined,
6163
- menuPlacement: scrollBottom ? "top" : "auto",
6164
- isMulti: isMulti,
6165
- components: {
6166
- IndicatorSeparator: function IndicatorSeparator() {
6167
- return null;
6168
- },
6169
- DropdownIndicator: DropdownIndicator,
6170
- Option: CustomOption
6171
- },
6172
- styles: customStyles,
6173
- placeholder: t("select_placeholder")
6174
- }, rest));
6175
- };
6176
-
6177
- var _excluded$1 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
6178
- var CustomCreatable = function CustomCreatable(_ref) {
6179
- var options = _ref.options,
6180
- isDisabled = _ref.isDisabled,
6181
- scrollBottom = _ref.scrollBottom,
6182
- value = _ref.value,
6183
- isMulti = _ref.isMulti,
6184
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
6185
- var initialValues = Array.isArray(value) ? options.filter(function (i) {
6186
- return value.includes(i.value);
6187
- }) : isMulti ? options.filter(function (i) {
6188
- return i.value == value;
6189
- }) : options.find(function (i) {
6190
- return i.value == value;
6191
- });
6192
- var _useTranslation = reactI18next.useTranslation(),
6193
- t = _useTranslation.t;
6194
- return React__default.createElement(CreatableSelect, Object.assign({
6195
- isClearable: true,
6196
- isDisabled: isDisabled,
6197
- options: options,
6198
- value: initialValues,
6199
- menuPlacement: scrollBottom ? "top" : "auto",
6200
- isMulti: isMulti,
6201
- components: {
6202
- IndicatorSeparator: function IndicatorSeparator() {
6203
- return null;
6204
- },
6205
- DropdownIndicator: DropdownIndicator,
6206
- Option: CustomOption
6207
- },
6208
- styles: customStyles,
6209
- placeholder: t("select_placeholder")
6210
- }, rest));
6211
- };
6212
-
6213
- var _excluded$2 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti", "optionValue", "styles"];
6214
- var CustomSelect = function CustomSelect(_ref) {
6215
- var isDefault = _ref.isDefault,
6216
- options = _ref.options,
6217
- isDisabled = _ref.isDisabled,
6218
- scrollBottom = _ref.scrollBottom,
6219
- value = _ref.value,
6220
- isMulti = _ref.isMulti,
6221
- optionValue = _ref.optionValue,
6222
- styles = _ref.styles,
6223
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
6224
- var _useTranslation = reactI18next.useTranslation(),
6225
- t = _useTranslation.t;
6226
- var initialValues = optionValue != null ? optionValue : value === undefined || value === null ? null : Array.isArray(value) ? options.filter(function (i) {
6227
- return value.includes(i.value);
6228
- }) : isMulti ? options === null || options === void 0 ? void 0 : options.filter(function (i) {
6229
- return i.value == value;
6230
- }) : options === null || options === void 0 ? void 0 : options.find(function (i) {
6231
- return i.value == value;
6232
- });
6233
- return React__default.createElement(Select__default, Object.assign({
6234
- isDisabled: isDisabled,
6235
- options: options,
6236
- value: !isDefault ? initialValues != null ? initialValues : null : undefined,
6237
- defaultValue: isDefault ? initialValues : undefined,
6238
- menuPlacement: scrollBottom ? "top" : "auto",
6239
- components: {
6240
- IndicatorSeparator: function IndicatorSeparator() {
6241
- return null;
6242
- },
6243
- DropdownIndicator: DropdownIndicator,
6244
- Option: CustomOption
6245
- },
6246
- styles: _extends({}, customStyles, styles),
6247
- isMulti: isMulti,
6248
- placeholder: t("select_placeholder")
6249
- }, rest));
6250
- };
6251
-
6252
- var _excluded$3 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti", "valueById", "isTextbook"];
6253
- var CustomSelectOption = function CustomSelectOption(_ref) {
6254
- var defaultValue = _ref.defaultValue,
6255
- options = _ref.options,
6256
- isDisabled = _ref.isDisabled,
6257
- scrollBottom = _ref.scrollBottom,
6258
- value = _ref.value,
6259
- isMulti = _ref.isMulti,
6260
- valueById = _ref.valueById,
6261
- isTextbook = _ref.isTextbook,
6262
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
6263
- var _useTranslation = reactI18next.useTranslation(),
6264
- t = _useTranslation.t;
6265
- var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
6266
- return option.value === defaultValue;
6267
- })) || null : null;
6268
- var optionValue = valueById !== null && typeof valueById !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
6269
- return option.value == valueById;
6270
- })) || {
6271
- label: valueById,
6272
- value: valueById
6273
- } : null;
6274
- return isTextbook ? React__default.createElement(CreatableSelect, Object.assign({
6275
- isDisabled: isDisabled,
6276
- options: options,
6277
- value: optionValue || value,
6278
- defaultValue: initialValues,
6279
- menuPlacement: scrollBottom ? "top" : "auto",
6280
- isMulti: isMulti,
6281
- components: {
6282
- IndicatorSeparator: function IndicatorSeparator() {
6283
- return null;
6284
- },
6285
- DropdownIndicator: DropdownIndicator,
6286
- Option: CustomOption
6287
- },
6288
- styles: customStyles,
6289
- placeholder: t("select_placeholder")
6290
- }, rest)) : React__default.createElement(Select__default, Object.assign({
6291
- isDisabled: isDisabled,
6292
- options: options,
6293
- value: optionValue || value,
6294
- defaultValue: initialValues,
6295
- menuPlacement: scrollBottom ? "top" : "auto",
6296
- isMulti: isMulti,
6297
- components: {
6298
- IndicatorSeparator: function IndicatorSeparator() {
6299
- return null;
6300
- },
6301
- DropdownIndicator: DropdownIndicator,
6302
- Option: CustomOption
6303
- },
6304
- styles: customStyles,
6305
- placeholder: t("select_placeholder")
6306
- }, rest));
6307
- };
6308
-
6309
5913
  (function (PreparedType) {
6310
5914
  PreparedType[PreparedType["csat_past_questions"] = 1] = "csat_past_questions";
6311
5915
  PreparedType[PreparedType["official_mock_exam"] = 2] = "official_mock_exam";
@@ -6757,6 +6361,10 @@ var handleKeyDown = function handleKeyDown(e) {
6757
6361
  e.preventDefault();
6758
6362
  }
6759
6363
  };
6364
+ var getPercentage = function getPercentage(current, max) {
6365
+ if (!max) return 0;
6366
+ return current * 100 / max;
6367
+ };
6760
6368
 
6761
6369
  var isTextType = function isTextType(type) {
6762
6370
  return type === exports.QuestionAnswerType.ShortAnswer || type === exports.QuestionAnswerType.OrderMatters || type === exports.QuestionAnswerType.OrderDoesNotMatters || type === exports.QuestionAnswerType.SynonymProcessing;
@@ -7069,7 +6677,7 @@ var useKeyboardVisible = function useKeyboardVisible() {
7069
6677
  var isTabletUp = material.useMediaQuery(theme.breakpoints.up('lg'));
7070
6678
  var isFullScreen = !!document.fullscreenElement;
7071
6679
  var pageSxProps = _extends({}, !isTabletUp && isKeyboardVisible && isFullScreen && {
7072
- marginBlock: "3rem 50vh"
6680
+ marginBlock: "3rem 50dvh"
7073
6681
  });
7074
6682
  var handleInputFocus = function handleInputFocus() {
7075
6683
  setIsKeyboardVisible(true);
@@ -7713,6 +7321,412 @@ var useVirtualizeList = function useVirtualizeList(totalItems, rowHeight, offset
7713
7321
  OrderBy["DESC"] = "DESC";
7714
7322
  })(exports.OrderBy || (exports.OrderBy = {}));
7715
7323
 
7324
+ var ConfirmDialog = function ConfirmDialog(_ref) {
7325
+ var open = _ref.open,
7326
+ text = _ref.text,
7327
+ cancelText = _ref.cancelText,
7328
+ okText = _ref.okText,
7329
+ isDelete = _ref.isDelete,
7330
+ title = _ref.title,
7331
+ confirmText = _ref.confirmText,
7332
+ titleStyle = _ref.titleStyle,
7333
+ titleClassName = _ref.titleClassName,
7334
+ contentStyle = _ref.contentStyle,
7335
+ cancelButtonStyle = _ref.cancelButtonStyle,
7336
+ contentTextStyle = _ref.contentTextStyle,
7337
+ okButtonStyle = _ref.okButtonStyle,
7338
+ actionStyle = _ref.actionStyle,
7339
+ _ref$okButtonVariant = _ref.okButtonVariant,
7340
+ okButtonVariant = _ref$okButtonVariant === void 0 ? "contained" : _ref$okButtonVariant,
7341
+ _ref$cancelButtonVari = _ref.cancelButtonVariant,
7342
+ cancelButtonVariant = _ref$cancelButtonVari === void 0 ? "contained" : _ref$cancelButtonVari,
7343
+ _ref$zIndex = _ref.zIndex,
7344
+ zIndex = _ref$zIndex === void 0 ? 1102 : _ref$zIndex,
7345
+ toggle = _ref.toggle,
7346
+ onConfirm = _ref.onConfirm;
7347
+ var _useState = React.useState(),
7348
+ confirmTextValue = _useState[0],
7349
+ setConfirmTextValue = _useState[1];
7350
+ var _useTranslation = reactI18next.useTranslation(),
7351
+ t = _useTranslation.t;
7352
+ var _useKeyboardVisible = useKeyboardVisible(),
7353
+ pageSxProps = _useKeyboardVisible.pageSxProps,
7354
+ handleInputFocus = _useKeyboardVisible.handleInputFocus,
7355
+ handleInputBlur = _useKeyboardVisible.handleInputBlur;
7356
+ var handleConfirm = function handleConfirm() {
7357
+ onConfirm();
7358
+ };
7359
+ var handleChangeConfirmText = function handleChangeConfirmText(e) {
7360
+ setConfirmTextValue(e.target.value);
7361
+ };
7362
+ var handlePaste = function handlePaste(_) {};
7363
+ React.useEffect(function () {
7364
+ !open && setConfirmTextValue(undefined);
7365
+ }, [open]);
7366
+ var isValid = !!confirmText && !!confirmTextValue && confirmTextValue.trim() === confirmText.trim();
7367
+ var isDisableDelete = !!confirmText && (confirmTextValue === null || confirmTextValue === void 0 ? void 0 : confirmTextValue.trim()) !== confirmText.trim();
7368
+ return React__default.createElement(material.Dialog, {
7369
+ open: open,
7370
+ onClose: toggle,
7371
+ sx: {
7372
+ zIndex: zIndex
7373
+ },
7374
+ scroll: "body",
7375
+ PaperProps: {
7376
+ sx: _extends({}, pageSxProps)
7377
+ }
7378
+ }, React__default.createElement(React.Fragment, null, React__default.createElement(material.DialogTitle, {
7379
+ className: "border border-start-0 border-end-0 border-top-0 border-1 " + titleClassName,
7380
+ sx: _extends({
7381
+ fontSize: 16
7382
+ }, titleStyle)
7383
+ }, title || t('confirmation')), React__default.createElement(material.IconButton, {
7384
+ "aria-label": "close",
7385
+ onClick: toggle,
7386
+ sx: {
7387
+ position: "absolute",
7388
+ right: 8,
7389
+ top: 8,
7390
+ color: function color(theme) {
7391
+ return theme.palette.grey[500];
7392
+ }
7393
+ }
7394
+ }, React__default.createElement(io5.IoClose, null))), React__default.createElement(material.DialogContent, {
7395
+ sx: _extends({
7396
+ pt: 0.5
7397
+ }, contentStyle)
7398
+ }, React__default.createElement(material.Typography, {
7399
+ className: "mb-1",
7400
+ sx: _extends({
7401
+ fontWeight: 700
7402
+ }, contentTextStyle)
7403
+ }, text), !!confirmText && React__default.createElement("div", {
7404
+ className: "w-100"
7405
+ }, React__default.createElement("p", {
7406
+ className: "mb-3"
7407
+ }, t("enter_text_to_confirm_delete", {
7408
+ text: confirmText
7409
+ })), React__default.createElement(material.TextField, {
7410
+ className: "w-100",
7411
+ sx: {
7412
+ "& input": {
7413
+ py: 1
7414
+ }
7415
+ },
7416
+ value: confirmTextValue,
7417
+ onChange: handleChangeConfirmText,
7418
+ placeholder: t('please_enter'),
7419
+ onPaste: handlePaste,
7420
+ error: !isValid && confirmTextValue !== undefined,
7421
+ color: isValid ? "success" : confirmTextValue !== undefined ? "error" : undefined,
7422
+ onFocus: handleInputFocus,
7423
+ onBlur: handleInputBlur
7424
+ }))), React__default.createElement(material.DialogActions, {
7425
+ className: "border border-start-0 border-end-0 border-bottom-0 border-1 " + titleClassName,
7426
+ sx: _extends({
7427
+ paddingTop: 1
7428
+ }, actionStyle)
7429
+ }, React__default.createElement(material.Button, {
7430
+ variant: cancelButtonVariant,
7431
+ color: cancelButtonVariant !== "contained" ? "primary" : "secondary",
7432
+ className: "px-3 " + (cancelButtonVariant !== "contained" ? "primary" : "bg-secondary"),
7433
+ onClick: toggle,
7434
+ sx: cancelButtonStyle
7435
+ }, cancelText || t("no")), React__default.createElement(material.Button, {
7436
+ variant: okButtonVariant,
7437
+ color: isDelete ? "error" : "primary",
7438
+ className: "px-3",
7439
+ disabled: isDisableDelete,
7440
+ onClick: handleConfirm,
7441
+ sx: _extends({}, okButtonStyle, isDelete && {
7442
+ backgroundColor: "#db4d4d",
7443
+ color: "#FFFFFF",
7444
+ "&:hover": {
7445
+ backgroundColor: "#C41414"
7446
+ }
7447
+ })
7448
+ }, okText || t('yes'))));
7449
+ };
7450
+
7451
+ var ConfirmDeleteDialog = function ConfirmDeleteDialog(props) {
7452
+ return React__default.createElement(ConfirmDialog, Object.assign({}, ConfirmDeleteDialogDefaultProps, props));
7453
+ };
7454
+
7455
+ var iconCloseDialog = function iconCloseDialog(_ref) {
7456
+ var _ref$width = _ref.width,
7457
+ width = _ref$width === void 0 ? "24" : _ref$width,
7458
+ _ref$height = _ref.height,
7459
+ height = _ref$height === void 0 ? "25" : _ref$height,
7460
+ color = _ref.color;
7461
+ return React__default.createElement("svg", {
7462
+ width: width,
7463
+ height: height,
7464
+ viewBox: "0 0 24 25",
7465
+ fill: color,
7466
+ xmlns: "http://www.w3.org/2000/svg"
7467
+ }, React__default.createElement("path", {
7468
+ d: "M13.5909 12.5L18.0441 8.04687C18.2554 7.8359 18.3743 7.54962 18.3745 7.25099C18.3748 6.95237 18.2564 6.66587 18.0455 6.45453C17.8345 6.24319 17.5482 6.12431 17.2496 6.12404C16.951 6.12378 16.6645 6.24215 16.4531 6.45312L12 10.9062L7.54687 6.45312C7.33553 6.24178 7.04888 6.12305 6.75 6.12305C6.45111 6.12305 6.16447 6.24178 5.95312 6.45312C5.74178 6.66447 5.62305 6.95111 5.62305 7.25C5.62305 7.54888 5.74178 7.83553 5.95312 8.04687L10.4062 12.5L5.95312 16.9531C5.74178 17.1645 5.62305 17.4511 5.62305 17.75C5.62305 18.0489 5.74178 18.3355 5.95312 18.5469C6.16447 18.7582 6.45111 18.8769 6.75 18.8769C7.04888 18.8769 7.33553 18.7582 7.54687 18.5469L12 14.0937L16.4531 18.5469C16.6645 18.7582 16.9511 18.8769 17.25 18.8769C17.5489 18.8769 17.8355 18.7582 18.0469 18.5469C18.2582 18.3355 18.3769 18.0489 18.3769 17.75C18.3769 17.4511 18.2582 17.1645 18.0469 16.9531L13.5909 12.5Z",
7469
+ fill: "#202B37"
7470
+ }));
7471
+ };
7472
+
7473
+ var iconWarning = function iconWarning(_ref) {
7474
+ var _ref$width = _ref.width,
7475
+ width = _ref$width === void 0 ? "17" : _ref$width,
7476
+ _ref$height = _ref.height,
7477
+ height = _ref$height === void 0 ? "16" : _ref$height,
7478
+ color = _ref.color;
7479
+ return React__default.createElement("svg", {
7480
+ width: width,
7481
+ height: height,
7482
+ viewBox: "0 0 17 16",
7483
+ fill: color,
7484
+ xmlns: "http://www.w3.org/2000/svg"
7485
+ }, React__default.createElement("path", {
7486
+ d: "M14.5335 12.4712L9.20754 2.58062C8.83004 1.87937 7.82441 1.87937 7.4466 2.58062L2.12097 12.4712C2.03901 12.6235 1.99792 12.7944 2.00171 12.9672C2.00549 13.1401 2.05404 13.309 2.14259 13.4575C2.23115 13.606 2.3567 13.729 2.50698 13.8145C2.65726 13.9 2.82714 13.9451 3.00004 13.9453H13.6529C13.8259 13.9453 13.996 13.9005 14.1465 13.8151C14.2969 13.7297 14.4227 13.6067 14.5115 13.4582C14.6002 13.3096 14.6489 13.1406 14.6527 12.9676C14.6566 12.7946 14.6155 12.6236 14.5335 12.4712ZM8.32722 12.4141C8.20361 12.4141 8.08277 12.3774 7.97999 12.3087C7.87721 12.2401 7.7971 12.1424 7.7498 12.0282C7.7025 11.914 7.69012 11.7884 7.71423 11.6671C7.73835 11.5459 7.79787 11.4345 7.88528 11.3471C7.97269 11.2597 8.08405 11.2002 8.20529 11.1761C8.32653 11.152 8.4522 11.1643 8.5664 11.2116C8.6806 11.2589 8.77822 11.3391 8.84689 11.4418C8.91557 11.5446 8.95222 11.6654 8.95222 11.7891C8.95222 11.8711 8.93606 11.9524 8.90465 12.0282C8.87324 12.1041 8.8272 12.173 8.76917 12.231C8.71113 12.289 8.64223 12.3351 8.5664 12.3665C8.49057 12.3979 8.4093 12.4141 8.32722 12.4141ZM9.00597 6.12813L8.8266 9.94063C8.8266 10.0732 8.77392 10.2004 8.68015 10.2942C8.58638 10.3879 8.45921 10.4406 8.3266 10.4406C8.19399 10.4406 8.06681 10.3879 7.97305 10.2942C7.87928 10.2004 7.8266 10.0732 7.8266 9.94063L7.64722 6.12969C7.64319 6.03862 7.65754 5.94768 7.6894 5.86227C7.72127 5.77687 7.77 5.69875 7.8327 5.63259C7.8954 5.56642 7.97078 5.51355 8.05434 5.47713C8.13791 5.44072 8.22795 5.4215 8.3191 5.42063H8.32566C8.41743 5.42058 8.50826 5.43912 8.59267 5.47515C8.67708 5.51117 8.75331 5.56392 8.81677 5.63021C8.88023 5.6965 8.92961 5.77497 8.96191 5.86087C8.99421 5.94676 9.00878 6.03832 9.00472 6.13L9.00597 6.12813Z",
7487
+ fill: "#DB4D4D"
7488
+ }));
7489
+ };
7490
+
7491
+ var styles$1 = {"lighter":"#F0FFF6","light":"#89F0B2","less_dark":"#3DC674","dark":"#349056","darker":"#18442A","gray_50":"#FBFBF9","gray_100":"#EAEAE5","gray_300":"#D0D0C8","gray_500":"#9A9A98","gray_700":"#5D5D5B","gray_900":"#363634","red_900":"#DB4D4D","green_support_900":"#3ACB46","yellow_900":"#FEAF06","purple_900":"#C3099A","titleBox":"_2mYOt","title":"_1H9qR","point":"_2rTfh","buttonGroup":"_W5dic","btnFeedback":"_FmMYN","btnTerminate":"_3kv6J","myanswer":"_1jZV7","titleMyAnswer1":"_1aYD1","titleMyAnswer2":"_2Oc4x","contentMyAnswer":"__LRYW","myAnswerItem":"_1U-Kx","time":"_2PXiz","timeCol":"_1zcfJ","answer-response":"_18ZNf","answer-response-0":"_3nbRi","answer-response-1":"_3NEHk","answer-response-2":"_Et0ih","answer-response-3":"_5Vc3v","answer-response-4":"_2SMBR","overall-response-1":"_1ImE5","overall-response-2":"_1oVKC","overall-response-3":"_2wXCw","answerCorrect":"_gE8qM","answerIncorrect":"_3kRqE","answerNograss":"_22Pi3","answerEasy":"_1C7aw","answerDiscrimination":"__YGYX","answerTrap":"_3AkGb","answerNoTime":"_3l-yC","questionOrder":"_2mK7U","myTimeLabel":"_3ZOZs","myPoolTime":"_1Gajr","topTimeLabel":"_62PzE","topTime":"_3HUx1","meanTimeLabel":"_Yu8Oq","meanTime":"_18kZu","compareChart":"_2MTOH","prevChart":"_JoHQL","chart":"_29iCQ","nextChart":"_3hjxI","titleChart":"_2Z42z","titleCompareGrass":"_34RN_","tableCompareGrass":"_2lzlQ","thcolumn1":"_2MSIH","tdcolumn1":"_1I06v","tdcolumn3":"_VpMQ5","classification":"_3t41M","wrapperProblem":"_2vh8v","titleProblem":"_3YfGm","titleProblemClose":"_34388","titleTrickyProblem":"_INxbh","wrongQuestions":"_35DcB","question":"_10SAW","assignedQuestions":"_oEGQ_","wrapperContent":"_zhZ1O","content":"_NGHD4","contentColumn1":"_v5SKe","span1":"_28SHT","span2":"_1raLd","contentColumn2":"_-xJ34","duration":"_1YGAg","topDuration":"_3DiyY","overallCorrectRate":"_DnkyV","answer":"_29MTE","contentVulnerable":"_3x1PG","wrappContentProblem":"_2saM2","contentProblem":"_1hTJx","labelProblem":"_3BXO9","name":"_1cUZW","percent":"_3CLEc","slider":"_3LCEY","track":"_3I8mi","noData":"_1oZ-s","loading":"_Nm201","table-responsive":"_3zQL-","form-label":"_3Vpmh","form-control":"_DafKE","form-label-dialog":"_3NjaH","btn-cancel":"_sLxwL","btn-register":"_4ZKQY","pdfBtnBox":"_2zUJf","pdfBtn":"_y_Cr7","form-select":"_HCIxD","loader":"_3aDIU","dot":"_JGCIL","bounce":"_3M62i"};
7492
+
7493
+ var DropdownIndicator = function DropdownIndicator(props) {
7494
+ return React__default.createElement(Select.components.DropdownIndicator, Object.assign({}, props), React__default.createElement(fa.FaCaretDown, {
7495
+ size: 20,
7496
+ color: styles.darker
7497
+ }));
7498
+ };
7499
+ var CustomOption = function CustomOption(props) {
7500
+ return React__default.createElement(Select.components.Option, Object.assign({}, props), React__default.createElement("div", {
7501
+ style: {
7502
+ fontSize: "14px",
7503
+ fontWeight: 500
7504
+ }
7505
+ }, props.data.label));
7506
+ };
7507
+
7508
+ var customStyles = {
7509
+ control: function control(baseStyles, state) {
7510
+ return _extends({}, baseStyles, {
7511
+ fontSize: "14px",
7512
+ fontWeight: 700,
7513
+ color: styles.darker,
7514
+ borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark,
7515
+ boxShadow: state.isFocused ? "0 0 0 1px " + styles.dark + "4D" : baseStyles.boxShadow,
7516
+ "&:active": {
7517
+ borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
7518
+ },
7519
+ "&:hover": {
7520
+ borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
7521
+ }
7522
+ });
7523
+ },
7524
+ input: function input(baseStyles, _) {
7525
+ return _extends({}, baseStyles, {
7526
+ fontSize: "14px",
7527
+ fontWeight: 700,
7528
+ color: styles.darker
7529
+ });
7530
+ },
7531
+ placeholder: function placeholder(baseStyles, _) {
7532
+ return _extends({}, baseStyles, {
7533
+ whiteSpace: "nowrap"
7534
+ });
7535
+ },
7536
+ singleValue: function singleValue(baseStyles) {
7537
+ return _extends({}, baseStyles, {
7538
+ fontSize: "14px",
7539
+ fontWeight: 700,
7540
+ color: styles.darker
7541
+ });
7542
+ },
7543
+ option: function option(baseStyles, state) {
7544
+ return _extends({}, baseStyles, {
7545
+ zIndex: 999,
7546
+ backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.light : 'white',
7547
+ "&:active": {
7548
+ backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.less_dark : baseStyles.backgroundColor
7549
+ }
7550
+ });
7551
+ },
7552
+ menuPortal: function menuPortal(base) {
7553
+ return _extends({}, base, {
7554
+ zIndex: 99
7555
+ });
7556
+ }
7557
+ };
7558
+
7559
+ var _excluded = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
7560
+ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
7561
+ var _value$;
7562
+ var isDefault = _ref.isDefault,
7563
+ options = _ref.options,
7564
+ isDisabled = _ref.isDisabled,
7565
+ scrollBottom = _ref.scrollBottom,
7566
+ value = _ref.value,
7567
+ isMulti = _ref.isMulti,
7568
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
7569
+ var isOptionValue = (value === null || value === void 0 ? void 0 : value.value) || (value === null || value === void 0 ? void 0 : (_value$ = value[0]) === null || _value$ === void 0 ? void 0 : _value$.value);
7570
+ var initialValues = isOptionValue ? value : Array.isArray(value) ? options.filter(function (i) {
7571
+ return value.includes(i.value);
7572
+ }) : isMulti ? options.filter(function (i) {
7573
+ return i.value == value;
7574
+ }) : options.find(function (i) {
7575
+ return i.value == value;
7576
+ });
7577
+ var _useTranslation = reactI18next.useTranslation(),
7578
+ t = _useTranslation.t;
7579
+ return React__default.createElement(Select__default, Object.assign({
7580
+ isDisabled: isDisabled,
7581
+ options: options,
7582
+ value: !isDefault ? initialValues : undefined,
7583
+ defaultValue: isDefault ? initialValues : undefined,
7584
+ menuPlacement: scrollBottom ? "top" : "auto",
7585
+ isMulti: isMulti,
7586
+ components: {
7587
+ IndicatorSeparator: function IndicatorSeparator() {
7588
+ return null;
7589
+ },
7590
+ DropdownIndicator: DropdownIndicator,
7591
+ Option: CustomOption
7592
+ },
7593
+ styles: customStyles,
7594
+ placeholder: t("select_placeholder")
7595
+ }, rest));
7596
+ };
7597
+
7598
+ var _excluded$1 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
7599
+ var CustomCreatable = function CustomCreatable(_ref) {
7600
+ var options = _ref.options,
7601
+ isDisabled = _ref.isDisabled,
7602
+ scrollBottom = _ref.scrollBottom,
7603
+ value = _ref.value,
7604
+ isMulti = _ref.isMulti,
7605
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
7606
+ var initialValues = Array.isArray(value) ? options.filter(function (i) {
7607
+ return value.includes(i.value);
7608
+ }) : isMulti ? options.filter(function (i) {
7609
+ return i.value == value;
7610
+ }) : options.find(function (i) {
7611
+ return i.value == value;
7612
+ });
7613
+ var _useTranslation = reactI18next.useTranslation(),
7614
+ t = _useTranslation.t;
7615
+ return React__default.createElement(CreatableSelect, Object.assign({
7616
+ isClearable: true,
7617
+ isDisabled: isDisabled,
7618
+ options: options,
7619
+ value: initialValues,
7620
+ menuPlacement: scrollBottom ? "top" : "auto",
7621
+ isMulti: isMulti,
7622
+ components: {
7623
+ IndicatorSeparator: function IndicatorSeparator() {
7624
+ return null;
7625
+ },
7626
+ DropdownIndicator: DropdownIndicator,
7627
+ Option: CustomOption
7628
+ },
7629
+ styles: customStyles,
7630
+ placeholder: t("select_placeholder")
7631
+ }, rest));
7632
+ };
7633
+
7634
+ var _excluded$2 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti", "optionValue", "styles"];
7635
+ var CustomSelect = function CustomSelect(_ref) {
7636
+ var isDefault = _ref.isDefault,
7637
+ options = _ref.options,
7638
+ isDisabled = _ref.isDisabled,
7639
+ scrollBottom = _ref.scrollBottom,
7640
+ value = _ref.value,
7641
+ isMulti = _ref.isMulti,
7642
+ optionValue = _ref.optionValue,
7643
+ styles = _ref.styles,
7644
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
7645
+ var _useTranslation = reactI18next.useTranslation(),
7646
+ t = _useTranslation.t;
7647
+ var initialValues = optionValue != null ? optionValue : value === undefined || value === null ? null : Array.isArray(value) ? options.filter(function (i) {
7648
+ return value.includes(i.value);
7649
+ }) : isMulti ? options === null || options === void 0 ? void 0 : options.filter(function (i) {
7650
+ return i.value == value;
7651
+ }) : options === null || options === void 0 ? void 0 : options.find(function (i) {
7652
+ return i.value == value;
7653
+ });
7654
+ return React__default.createElement(Select__default, Object.assign({
7655
+ isDisabled: isDisabled,
7656
+ options: options,
7657
+ value: !isDefault ? initialValues != null ? initialValues : null : undefined,
7658
+ defaultValue: isDefault ? initialValues : undefined,
7659
+ menuPlacement: scrollBottom ? "top" : "auto",
7660
+ components: {
7661
+ IndicatorSeparator: function IndicatorSeparator() {
7662
+ return null;
7663
+ },
7664
+ DropdownIndicator: DropdownIndicator,
7665
+ Option: CustomOption
7666
+ },
7667
+ styles: _extends({}, customStyles, styles),
7668
+ isMulti: isMulti,
7669
+ placeholder: t("select_placeholder")
7670
+ }, rest));
7671
+ };
7672
+
7673
+ var _excluded$3 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti", "valueById", "isTextbook"];
7674
+ var CustomSelectOption = function CustomSelectOption(_ref) {
7675
+ var defaultValue = _ref.defaultValue,
7676
+ options = _ref.options,
7677
+ isDisabled = _ref.isDisabled,
7678
+ scrollBottom = _ref.scrollBottom,
7679
+ value = _ref.value,
7680
+ isMulti = _ref.isMulti,
7681
+ valueById = _ref.valueById,
7682
+ isTextbook = _ref.isTextbook,
7683
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
7684
+ var _useTranslation = reactI18next.useTranslation(),
7685
+ t = _useTranslation.t;
7686
+ var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
7687
+ return option.value === defaultValue;
7688
+ })) || null : null;
7689
+ var optionValue = valueById !== null && typeof valueById !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
7690
+ return option.value == valueById;
7691
+ })) || {
7692
+ label: valueById,
7693
+ value: valueById
7694
+ } : null;
7695
+ return isTextbook ? React__default.createElement(CreatableSelect, Object.assign({
7696
+ isDisabled: isDisabled,
7697
+ options: options,
7698
+ value: optionValue || value,
7699
+ defaultValue: initialValues,
7700
+ menuPlacement: scrollBottom ? "top" : "auto",
7701
+ isMulti: isMulti,
7702
+ components: {
7703
+ IndicatorSeparator: function IndicatorSeparator() {
7704
+ return null;
7705
+ },
7706
+ DropdownIndicator: DropdownIndicator,
7707
+ Option: CustomOption
7708
+ },
7709
+ styles: customStyles,
7710
+ placeholder: t("select_placeholder")
7711
+ }, rest)) : React__default.createElement(Select__default, Object.assign({
7712
+ isDisabled: isDisabled,
7713
+ options: options,
7714
+ value: optionValue || value,
7715
+ defaultValue: initialValues,
7716
+ menuPlacement: scrollBottom ? "top" : "auto",
7717
+ isMulti: isMulti,
7718
+ components: {
7719
+ IndicatorSeparator: function IndicatorSeparator() {
7720
+ return null;
7721
+ },
7722
+ DropdownIndicator: DropdownIndicator,
7723
+ Option: CustomOption
7724
+ },
7725
+ styles: customStyles,
7726
+ placeholder: t("select_placeholder")
7727
+ }, rest));
7728
+ };
7729
+
7716
7730
  function CommonCreateNewQuestionDialog(_ref) {
7717
7731
  var handleCreateQuestion = _ref.handleCreateQuestion,
7718
7732
  openDialog = _ref.openDialog,
@@ -23971,20 +23985,20 @@ var useOverallChartContainer = function useOverallChartContainer(isStudent, exam
23971
23985
  }, [examCode, isStudent, code, examSessionId, studentId]);
23972
23986
  var myData = React.useMemo(function () {
23973
23987
  if (!overallData || !overallData.data[0]) return [0, 0, 0, 0, 0, 0];
23974
- var highLevelQuestions = overallData.data[0].highLevelQuestions * 100 / overallData.maxData.highLevelQuestions;
23975
- var lowLevelQuestions = overallData.data[0].lowLevelQuestions * 100 / overallData.maxData.lowLevelQuestions;
23976
- var questionLongestTime = overallData.data[0].questionLongestTime * 100 / overallData.maxData.questionLongestTime;
23977
- var problemSolvingTime = overallData.data[0].problemSolvingTime * 100 / overallData.maxData.problemSolvingTime;
23978
- var totalAsteriskQuestions = overallData.data[0].totalAsteriskQuestions * 100 / overallData.maxData.totalAsteriskQuestions;
23988
+ var highLevelQuestions = getPercentage(overallData.data[0].highLevelQuestions, overallData.maxData.highLevelQuestions);
23989
+ var lowLevelQuestions = getPercentage(overallData.data[0].lowLevelQuestions, overallData.maxData.lowLevelQuestions);
23990
+ var questionLongestTime = getPercentage(overallData.data[0].questionLongestTime, overallData.maxData.questionLongestTime);
23991
+ var problemSolvingTime = getPercentage(overallData.data[0].problemSolvingTime, overallData.maxData.problemSolvingTime);
23992
+ var totalAsteriskQuestions = getPercentage(overallData.data[0].totalAsteriskQuestions, overallData.maxData.totalAsteriskQuestions);
23979
23993
  return [overallData.data[0].correctRate, highLevelQuestions, questionLongestTime, problemSolvingTime, totalAsteriskQuestions, lowLevelQuestions];
23980
23994
  }, [JSON.stringify(overallData)]);
23981
23995
  var avgData = React.useMemo(function () {
23982
23996
  if (!overallData || !overallData.data[1]) return [0, 0, 0, 0, 0, 0];
23983
- var highLevelQuestions = overallData.data[1].highLevelQuestions * 100 / overallData.maxData.highLevelQuestions;
23984
- var lowLevelQuestions = overallData.data[1].lowLevelQuestions * 100 / overallData.maxData.lowLevelQuestions;
23985
- var questionLongestTime = overallData.data[1].questionLongestTime * 100 / overallData.maxData.questionLongestTime;
23986
- var problemSolvingTime = overallData.data[1].problemSolvingTime * 100 / overallData.maxData.problemSolvingTime;
23987
- var totalAsteriskQuestions = overallData.data[1].totalAsteriskQuestions * 100 / overallData.maxData.totalAsteriskQuestions;
23997
+ var highLevelQuestions = getPercentage(overallData.data[1].highLevelQuestions, overallData.maxData.highLevelQuestions);
23998
+ var lowLevelQuestions = getPercentage(overallData.data[1].lowLevelQuestions, overallData.maxData.lowLevelQuestions);
23999
+ var questionLongestTime = getPercentage(overallData.data[1].questionLongestTime, overallData.maxData.questionLongestTime);
24000
+ var problemSolvingTime = getPercentage(overallData.data[1].problemSolvingTime, overallData.maxData.problemSolvingTime);
24001
+ var totalAsteriskQuestions = getPercentage(overallData.data[1].totalAsteriskQuestions, overallData.maxData.totalAsteriskQuestions);
23988
24002
  return [overallData.data[1].correctRate, highLevelQuestions, questionLongestTime, problemSolvingTime, totalAsteriskQuestions, lowLevelQuestions];
23989
24003
  }, [JSON.stringify(overallData)]);
23990
24004
  var categories = [t("correct_rate"), t("high_level"), t("longest_time"), t("solving_time"), t("asterisks"), t("low_level")];
@@ -24100,13 +24114,13 @@ var useCategoriesOverallChartContainer = function useCategoriesOverallChartConta
24100
24114
  var myData = React.useMemo(function () {
24101
24115
  if (!(overallData !== null && overallData !== void 0 && overallData.length)) return [0, 0, 0, 0, 0, 0];
24102
24116
  return overallData.map(function (i) {
24103
- return !i.totalQuestions ? 0 : i.totalCorrectQuestions * 100 / i.totalQuestions;
24117
+ return getPercentage(i.totalCorrectQuestions, i.totalQuestions);
24104
24118
  });
24105
24119
  }, [JSON.stringify(overallData)]);
24106
24120
  var avgData = React.useMemo(function () {
24107
24121
  if (!(overallData !== null && overallData !== void 0 && overallData.length)) return [0, 0, 0, 0, 0, 0];
24108
24122
  return overallData.map(function (i) {
24109
- return !i.totalQuestions ? 0 : i.avgCorrectQuestions * 100 / i.totalQuestions;
24123
+ return getPercentage(i.avgCorrectQuestions, i.totalQuestions);
24110
24124
  });
24111
24125
  }, [JSON.stringify(overallData)]);
24112
24126
  var categories = React.useMemo(function () {
@@ -39308,6 +39322,7 @@ exports.getLanguage = getLanguage;
39308
39322
  exports.getLearningSpace = getLearningSpace;
39309
39323
  exports.getLocalDayOfWeek = getLocalDayOfWeek;
39310
39324
  exports.getOrdinalSuffix = getOrdinalSuffix;
39325
+ exports.getPercentage = getPercentage;
39311
39326
  exports.getPreviousQuestinGroupCategory = getPreviousQuestinGroupCategory;
39312
39327
  exports.getQuestionGroupsAfterQuestionCountChanged = getQuestionGroupsAfterQuestionCountChanged;
39313
39328
  exports.getRecentUserActionListApi = getRecentUserActionListApi;