touchstudy-core 0.1.73 → 0.1.75
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/components/Loading/LoadingComponent.d.ts +4 -2
- package/dist/containers/ExamResult/components/Charts/TimeOrderChart.d.ts +10 -0
- package/dist/containers/ExamResult/components/CompareGrass/index.d.ts +0 -1
- package/dist/containers/ExamResult/components/Dialog/PrintDialog.d.ts +6 -0
- package/dist/containers/ExamResult/components/GradesByTerritory/index.d.ts +3 -5
- package/dist/containers/ExamResult/components/LoadingDots.d.ts +6 -0
- package/dist/containers/ExamResult/components/MyAnswer/index.d.ts +1 -2
- package/dist/containers/ExamResult/components/ProtractedProblem/index.d.ts +4 -5
- package/dist/containers/ExamResult/components/TrickyProblem/index.d.ts +4 -5
- package/dist/containers/ExamResult/components/Vulnerable/index.d.ts +4 -5
- package/dist/containers/ExamResult/configs/functions.d.ts +1 -0
- package/dist/containers/ExamResult/configs/types.d.ts +13 -0
- package/dist/containers/ExamResult/hooks/useExamResult.d.ts +16 -6
- package/dist/containers/ExamResult/hooks/usePrintExamResult.d.ts +10 -0
- package/dist/containers/ExamResult/hooks/usePrintView.d.ts +8 -0
- package/dist/containers/ExamResult/views/ExamResultView.d.ts +11 -0
- package/dist/containers/ExamResult/views/PrintExamResult.d.ts +19 -0
- package/dist/containers/ExamResult/views/PrintExamResultView.d.ts +12 -0
- package/dist/containers/ExamResult/views/PrintPdfExamResult.d.ts +12 -0
- package/dist/containers/Exams/components/ArticleGroupView.d.ts +2 -0
- package/dist/containers/Exams/hooks/useExamDetailView.d.ts +2 -2
- package/dist/containers/Select/Category/hook/useCategorySelect.d.ts +2 -1
- package/dist/containers/Select/Subject/hook/useSubjectSelect.d.ts +6 -2
- package/dist/index.css +33 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +844 -938
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +841 -937
- package/dist/index.modern.js.map +1 -1
- package/dist/layouts/Header.d.ts +1 -0
- package/dist/layouts/LayoutContext.d.ts +1 -0
- package/dist/layouts/TheAcademyDropdown.d.ts +1 -0
- package/dist/utils/hooks/useLayoutContext.d.ts +1 -1
- package/dist/utils/hooks/useSwitchAcademy.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -17,7 +17,8 @@ require('moment/locale/ko.js');
|
|
17
17
|
require('moment/locale/en-au.js');
|
18
18
|
var Pusher = _interopDefault(require('pusher-js'));
|
19
19
|
var io5 = require('react-icons/io5');
|
20
|
-
var i18n =
|
20
|
+
var i18n = require('i18next');
|
21
|
+
var i18n__default = _interopDefault(i18n);
|
21
22
|
var Box = _interopDefault(require('@mui/material/Box'));
|
22
23
|
var Popover = _interopDefault(require('@mui/material/Popover'));
|
23
24
|
var MenuItem = _interopDefault(require('@mui/material/MenuItem'));
|
@@ -32,13 +33,12 @@ var io = require('react-icons/io');
|
|
32
33
|
var _ = _interopDefault(require('lodash'));
|
33
34
|
var fa6 = require('react-icons/fa6');
|
34
35
|
var CreatableSelect = _interopDefault(require('react-select/creatable'));
|
35
|
-
var html2canvas = _interopDefault(require('html2canvas'));
|
36
|
-
var jspdf = require('jspdf');
|
37
36
|
var Button = _interopDefault(require('@mui/material/Button'));
|
38
37
|
var DialogTitle = _interopDefault(require('@mui/material/DialogTitle'));
|
39
38
|
var DialogContent = _interopDefault(require('@mui/material/DialogContent'));
|
40
39
|
var DialogActions = _interopDefault(require('@mui/material/DialogActions'));
|
41
40
|
var Typography = _interopDefault(require('@mui/material/Typography'));
|
41
|
+
var html2pdf = _interopDefault(require('html2pdf.js'));
|
42
42
|
var Avatar = _interopDefault(require('@mui/material/Avatar'));
|
43
43
|
var TextField = _interopDefault(require('@mui/material/TextField'));
|
44
44
|
var Paper = _interopDefault(require('@mui/material/Paper'));
|
@@ -123,10 +123,6 @@ var RecentUserAction = {
|
|
123
123
|
AddedStudentToClass: "added_student_to_class",
|
124
124
|
RemovedStudentFromClass: "removed_student_from_class"
|
125
125
|
};
|
126
|
-
var PrintHeaderClassName = "print-header";
|
127
|
-
var PrintTitleClassName = "print-title";
|
128
|
-
var PrintContentClassName = "print-content";
|
129
|
-
var PrintContainerClassName = "print-container";
|
130
126
|
|
131
127
|
var utcToLocalTime = (function (time, FORMAT) {
|
132
128
|
if (time === DATE_MIN_VALUE || time === DATE_TIME_MIN_VALUE) return "";
|
@@ -176,194 +172,11 @@ function _taggedTemplateLiteralLoose(strings, raw) {
|
|
176
172
|
var styles = {"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","btn-login-google":"_2HqmH","block-login":"_wWIyO","box-login":"_38Lo1","btn-primary":"_rd4Uy","dropdown-menu":"_1krbH","header-avatar":"_RQaHE","dropdown-menu-flag":"_XK8oS","dropdown-content":"_3ys4W","dropdown-change":"_ToOW_","item-address":"_3sQlR","item-logout":"_3bqSM","title-address":"_1jgSI","img-avatar":"_35Ttz","item-contact":"_1wc7o","content-text":"_3S4f2","dropdown-content-language":"_3ajui","dropdown-item-language":"_3Y_y4","dropdown-item-language-active":"_CzNMi","dropdown-academy":"_3CMVp","image-academy":"_2ibYC","academy-btn":"_1JMRU","switch-icon":"_N4FNf","dropdown-content-academy":"_31Dr0","dropdown-academy-item":"_3bjcz","noGutters":"_31ZQk","custom-col-2":"_3yXyK","custom-col-3":"_1RsJQ","custom-col-5":"_L42CP","custom-col-10":"_2u6eL","custom-row":"_8x7OP","custom-col":"_1JmTh","custom-col-4":"_3HO1e","custom-col-8":"_Oy31M","custom-col-12":"_3aUKo","custom-container":"_39LRs","form-label":"__Ut-u","form-control":"_2k4dX","btn-outline-primary":"_2PWdX","sort-icons":"_mQvLF","active":"_3oAH-","form-select":"_3W3aw","truncate":"_3NJzN","headers":"_3xnI5","logo-container":"_3YG70","tabBox":"_1CQPn","routerBox":"_3hx2T","tabText":"_3UyhW","router-link-active":"_1TGKA","router-link":"_1AqMh","userImg":"_2RI6G","disabled-link":"_3aVHg","line-clamp":"_3fpky"};
|
177
173
|
|
178
174
|
// A type of promise-like that resolves synchronously and supports only one observer
|
179
|
-
const _Pact = /*#__PURE__*/(function() {
|
180
|
-
function _Pact() {}
|
181
|
-
_Pact.prototype.then = function(onFulfilled, onRejected) {
|
182
|
-
const result = new _Pact();
|
183
|
-
const state = this.s;
|
184
|
-
if (state) {
|
185
|
-
const callback = state & 1 ? onFulfilled : onRejected;
|
186
|
-
if (callback) {
|
187
|
-
try {
|
188
|
-
_settle(result, 1, callback(this.v));
|
189
|
-
} catch (e) {
|
190
|
-
_settle(result, 2, e);
|
191
|
-
}
|
192
|
-
return result;
|
193
|
-
} else {
|
194
|
-
return this;
|
195
|
-
}
|
196
|
-
}
|
197
|
-
this.o = function(_this) {
|
198
|
-
try {
|
199
|
-
const value = _this.v;
|
200
|
-
if (_this.s & 1) {
|
201
|
-
_settle(result, 1, onFulfilled ? onFulfilled(value) : value);
|
202
|
-
} else if (onRejected) {
|
203
|
-
_settle(result, 1, onRejected(value));
|
204
|
-
} else {
|
205
|
-
_settle(result, 2, value);
|
206
|
-
}
|
207
|
-
} catch (e) {
|
208
|
-
_settle(result, 2, e);
|
209
|
-
}
|
210
|
-
};
|
211
|
-
return result;
|
212
|
-
};
|
213
|
-
return _Pact;
|
214
|
-
})();
|
215
|
-
|
216
|
-
// Settles a pact synchronously
|
217
|
-
function _settle(pact, state, value) {
|
218
|
-
if (!pact.s) {
|
219
|
-
if (value instanceof _Pact) {
|
220
|
-
if (value.s) {
|
221
|
-
if (state & 1) {
|
222
|
-
state = value.s;
|
223
|
-
}
|
224
|
-
value = value.v;
|
225
|
-
} else {
|
226
|
-
value.o = _settle.bind(null, pact, state);
|
227
|
-
return;
|
228
|
-
}
|
229
|
-
}
|
230
|
-
if (value && value.then) {
|
231
|
-
value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
|
232
|
-
return;
|
233
|
-
}
|
234
|
-
pact.s = state;
|
235
|
-
pact.v = value;
|
236
|
-
const observer = pact.o;
|
237
|
-
if (observer) {
|
238
|
-
observer(pact);
|
239
|
-
}
|
240
|
-
}
|
241
|
-
}
|
242
|
-
|
243
|
-
function _isSettledPact(thenable) {
|
244
|
-
return thenable instanceof _Pact && thenable.s & 1;
|
245
|
-
}
|
246
|
-
|
247
|
-
// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)
|
248
|
-
function _forTo(array, body, check) {
|
249
|
-
var i = -1, pact, reject;
|
250
|
-
function _cycle(result) {
|
251
|
-
try {
|
252
|
-
while (++i < array.length && (!check || !check())) {
|
253
|
-
result = body(i);
|
254
|
-
if (result && result.then) {
|
255
|
-
if (_isSettledPact(result)) {
|
256
|
-
result = result.v;
|
257
|
-
} else {
|
258
|
-
result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
|
259
|
-
return;
|
260
|
-
}
|
261
|
-
}
|
262
|
-
}
|
263
|
-
if (pact) {
|
264
|
-
_settle(pact, 1, result);
|
265
|
-
} else {
|
266
|
-
pact = result;
|
267
|
-
}
|
268
|
-
} catch (e) {
|
269
|
-
_settle(pact || (pact = new _Pact()), 2, e);
|
270
|
-
}
|
271
|
-
}
|
272
|
-
_cycle();
|
273
|
-
return pact;
|
274
|
-
}
|
275
175
|
|
276
176
|
const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
|
277
177
|
|
278
178
|
const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
|
279
179
|
|
280
|
-
// Asynchronously implement a generic for loop
|
281
|
-
function _for(test, update, body) {
|
282
|
-
var stage;
|
283
|
-
for (;;) {
|
284
|
-
var shouldContinue = test();
|
285
|
-
if (_isSettledPact(shouldContinue)) {
|
286
|
-
shouldContinue = shouldContinue.v;
|
287
|
-
}
|
288
|
-
if (!shouldContinue) {
|
289
|
-
return result;
|
290
|
-
}
|
291
|
-
if (shouldContinue.then) {
|
292
|
-
stage = 0;
|
293
|
-
break;
|
294
|
-
}
|
295
|
-
var result = body();
|
296
|
-
if (result && result.then) {
|
297
|
-
if (_isSettledPact(result)) {
|
298
|
-
result = result.s;
|
299
|
-
} else {
|
300
|
-
stage = 1;
|
301
|
-
break;
|
302
|
-
}
|
303
|
-
}
|
304
|
-
if (update) {
|
305
|
-
var updateValue = update();
|
306
|
-
if (updateValue && updateValue.then && !_isSettledPact(updateValue)) {
|
307
|
-
stage = 2;
|
308
|
-
break;
|
309
|
-
}
|
310
|
-
}
|
311
|
-
}
|
312
|
-
var pact = new _Pact();
|
313
|
-
var reject = _settle.bind(null, pact, 2);
|
314
|
-
(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);
|
315
|
-
return pact;
|
316
|
-
function _resumeAfterBody(value) {
|
317
|
-
result = value;
|
318
|
-
do {
|
319
|
-
if (update) {
|
320
|
-
updateValue = update();
|
321
|
-
if (updateValue && updateValue.then && !_isSettledPact(updateValue)) {
|
322
|
-
updateValue.then(_resumeAfterUpdate).then(void 0, reject);
|
323
|
-
return;
|
324
|
-
}
|
325
|
-
}
|
326
|
-
shouldContinue = test();
|
327
|
-
if (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {
|
328
|
-
_settle(pact, 1, result);
|
329
|
-
return;
|
330
|
-
}
|
331
|
-
if (shouldContinue.then) {
|
332
|
-
shouldContinue.then(_resumeAfterTest).then(void 0, reject);
|
333
|
-
return;
|
334
|
-
}
|
335
|
-
result = body();
|
336
|
-
if (_isSettledPact(result)) {
|
337
|
-
result = result.v;
|
338
|
-
}
|
339
|
-
} while (!result || !result.then);
|
340
|
-
result.then(_resumeAfterBody).then(void 0, reject);
|
341
|
-
}
|
342
|
-
function _resumeAfterTest(shouldContinue) {
|
343
|
-
if (shouldContinue) {
|
344
|
-
result = body();
|
345
|
-
if (result && result.then) {
|
346
|
-
result.then(_resumeAfterBody).then(void 0, reject);
|
347
|
-
} else {
|
348
|
-
_resumeAfterBody(result);
|
349
|
-
}
|
350
|
-
} else {
|
351
|
-
_settle(pact, 1, result);
|
352
|
-
}
|
353
|
-
}
|
354
|
-
function _resumeAfterUpdate() {
|
355
|
-
if (shouldContinue = test()) {
|
356
|
-
if (shouldContinue.then) {
|
357
|
-
shouldContinue.then(_resumeAfterTest).then(void 0, reject);
|
358
|
-
} else {
|
359
|
-
_resumeAfterTest(shouldContinue);
|
360
|
-
}
|
361
|
-
} else {
|
362
|
-
_settle(pact, 1, result);
|
363
|
-
}
|
364
|
-
}
|
365
|
-
}
|
366
|
-
|
367
180
|
// Asynchronously call a function and send errors to recovery continuation
|
368
181
|
function _catch(body, recover) {
|
369
182
|
try {
|
@@ -649,9 +462,11 @@ var useLogin = function useLogin(history, homeAcademyUrl, homeUrl, registerUrl)
|
|
649
462
|
isLogout = true;
|
650
463
|
}
|
651
464
|
try {
|
652
|
-
var _temp6 = function _temp6() {
|
465
|
+
var _temp6 = function _temp6(_result) {
|
466
|
+
if (_exit) return _result;
|
653
467
|
dispatch(setLoading(false));
|
654
468
|
};
|
469
|
+
var _exit = false;
|
655
470
|
dispatch(setLoading(true));
|
656
471
|
var _temp5 = _catch(function () {
|
657
472
|
return Promise.resolve(apiLogin()).then(function (loginResponse) {
|
@@ -661,9 +476,10 @@ var useLogin = function useLogin(history, homeAcademyUrl, homeUrl, registerUrl)
|
|
661
476
|
var isAcademy = !!(user !== null && user !== void 0 && user.academyDomain);
|
662
477
|
var needToRegister = isStudent && isFirstLogin && isAcademy;
|
663
478
|
var redirectUrl = getRedirectUrl();
|
479
|
+
if (isStudent && !registerUrl) throw new Error("an_unexpected_error_has_occurred");
|
664
480
|
if (!redirectUrl) redirectUrl = needToRegister ? registerUrl : isAcademy ? homeAcademyUrl : homeUrl;
|
665
481
|
redirectLoginUser(_extends({}, user, {
|
666
|
-
|
482
|
+
isNotEnoughStatements: isFirstLogin
|
667
483
|
}), token, redirectUrl);
|
668
484
|
});
|
669
485
|
}, function (error) {
|
@@ -1498,8 +1314,11 @@ var switchSuperAdminAcademy = function switchSuperAdminAcademy(academyId, role)
|
|
1498
1314
|
return api.post(SUPER_ADMIN_ACADEMY_URL + "/" + academyId + "/switch-academy/" + role);
|
1499
1315
|
};
|
1500
1316
|
|
1501
|
-
var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls) {
|
1317
|
+
var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls, showLoadingAcademy) {
|
1502
1318
|
var _currentPusher$connec2;
|
1319
|
+
if (showLoadingAcademy === void 0) {
|
1320
|
+
showLoadingAcademy = true;
|
1321
|
+
}
|
1503
1322
|
var _useGoogleSignOut = useGoogleSignOut({}),
|
1504
1323
|
handleSignOut = _useGoogleSignOut.handleSignOut;
|
1505
1324
|
var _useTranslation = reactI18next.useTranslation(),
|
@@ -1528,10 +1347,10 @@ var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls) {
|
|
1528
1347
|
var handleGetAcademyDetail = function handleGetAcademyDetail() {
|
1529
1348
|
try {
|
1530
1349
|
var _temp2 = function _temp2() {
|
1531
|
-
dispatch(setLoading(false));
|
1350
|
+
showLoadingAcademy && dispatch(setLoading(false));
|
1532
1351
|
};
|
1533
1352
|
if (!academyDomain) return Promise.resolve();
|
1534
|
-
dispatch(setLoading(true));
|
1353
|
+
showLoadingAcademy && dispatch(setLoading(true));
|
1535
1354
|
var _temp = _catch(function () {
|
1536
1355
|
return Promise.resolve(getAcademyDetail()).then(function (info) {
|
1537
1356
|
if (info) {
|
@@ -1572,9 +1391,7 @@ var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls) {
|
|
1572
1391
|
dispatch(setLoading(true));
|
1573
1392
|
var _temp3 = _catch(function () {
|
1574
1393
|
return Promise.resolve(getAcademyDomain() ? getInfo() : getSuperAdminInfoFromWeb()).then(function (info) {
|
1575
|
-
if (!info)
|
1576
|
-
resetAuth();
|
1577
|
-
}
|
1394
|
+
if (!info.data) resetAuth();
|
1578
1395
|
dispatch(setUser(info.data));
|
1579
1396
|
});
|
1580
1397
|
}, function (err) {
|
@@ -1669,27 +1486,38 @@ var loadingStyle$1 = {
|
|
1669
1486
|
alignItems: "center"
|
1670
1487
|
};
|
1671
1488
|
var LoadingComponent = function LoadingComponent(_ref) {
|
1672
|
-
var isLoading = _ref.isLoading
|
1489
|
+
var isLoading = _ref.isLoading,
|
1490
|
+
children = _ref.children,
|
1491
|
+
_ref$spinClassName = _ref.spinClassName,
|
1492
|
+
spinClassName = _ref$spinClassName === void 0 ? "text-secondary" : _ref$spinClassName,
|
1493
|
+
_ref$className = _ref.className,
|
1494
|
+
className = _ref$className === void 0 ? "" : _ref$className;
|
1673
1495
|
return isLoading ? React__default.createElement("div", {
|
1674
1496
|
style: loadingStyle$1
|
1497
|
+
}, React__default.createElement(material.Stack, {
|
1498
|
+
direction: "column",
|
1499
|
+
justifyContent: "center",
|
1500
|
+
alignItems: "center",
|
1501
|
+
className: className
|
1675
1502
|
}, React__default.createElement("div", {
|
1676
|
-
className: "spinner-border
|
1503
|
+
className: "spinner-border " + spinClassName,
|
1677
1504
|
role: "status"
|
1678
1505
|
}, React__default.createElement("span", {
|
1679
1506
|
className: "sr-only"
|
1680
|
-
}))) : null;
|
1507
|
+
})), React__default.createElement("div", null, children))) : null;
|
1681
1508
|
};
|
1682
1509
|
|
1683
1510
|
var LayoutContext = function LayoutContext(_ref) {
|
1684
1511
|
var children = _ref.children,
|
1685
1512
|
role = _ref.role,
|
1686
1513
|
_ref$pusherRegisterUr = _ref.pusherRegisterUrls,
|
1687
|
-
pusherRegisterUrls = _ref$pusherRegisterUr === void 0 ? [] : _ref$pusherRegisterUr
|
1514
|
+
pusherRegisterUrls = _ref$pusherRegisterUr === void 0 ? [] : _ref$pusherRegisterUr,
|
1515
|
+
showLoadingAcademy = _ref.showLoadingAcademy;
|
1688
1516
|
var user = reactRedux.useSelector(function (state) {
|
1689
1517
|
var _state$common;
|
1690
1518
|
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
1691
1519
|
});
|
1692
|
-
useLayoutContext(role, pusherRegisterUrls);
|
1520
|
+
useLayoutContext(role, pusherRegisterUrls, showLoadingAcademy);
|
1693
1521
|
if (!(user !== null && user !== void 0 && user.email)) return React__default.createElement(LoadingComponent, {
|
1694
1522
|
isLoading: true
|
1695
1523
|
});else return React__default.createElement(React.Fragment, null, children);
|
@@ -1884,7 +1712,9 @@ var getSubjectListApi = function getSubjectListApi() {
|
|
1884
1712
|
}
|
1885
1713
|
};
|
1886
1714
|
|
1887
|
-
var useSubjectSelect = function useSubjectSelect() {
|
1715
|
+
var useSubjectSelect = function useSubjectSelect(_ref) {
|
1716
|
+
var onChangeExam = _ref.onChangeExam,
|
1717
|
+
exam = _ref.exam;
|
1888
1718
|
var firstLoad = true;
|
1889
1719
|
var dispatch = reactRedux.useDispatch();
|
1890
1720
|
var _useState = React.useState(),
|
@@ -1942,18 +1772,15 @@ var useSubjectSelect = function useSubjectSelect() {
|
|
1942
1772
|
var selectedSubject = subjectList === null || subjectList === void 0 ? void 0 : subjectList.find(function (subject) {
|
1943
1773
|
return subject.id === id;
|
1944
1774
|
});
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1948
|
-
if (!subject) return;
|
1949
|
-
setSelectedSubject(subject);
|
1775
|
+
onChangeExam(_extends({}, exam, {
|
1776
|
+
subjectId: (selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) || 0
|
1777
|
+
}));
|
1950
1778
|
};
|
1951
1779
|
return {
|
1952
1780
|
subjectOptions: subjectOptions,
|
1953
1781
|
selectedSubject: selectedSubject,
|
1954
1782
|
subjectList: subjectList,
|
1955
|
-
handleChangeSubject: handleChangeSubject
|
1956
|
-
handleChangeSelectedSubject: handleChangeSelectedSubject
|
1783
|
+
handleChangeSubject: handleChangeSubject
|
1957
1784
|
};
|
1958
1785
|
};
|
1959
1786
|
|
@@ -2602,7 +2429,7 @@ var exam = "시험";
|
|
2602
2429
|
var me = "나";
|
2603
2430
|
var teacher_name = "선생님 성함";
|
2604
2431
|
var class_schedule = "수업 시간표";
|
2605
|
-
var summary = "
|
2432
|
+
var summary = "전체 현황";
|
2606
2433
|
var load_exam = "시험 로드";
|
2607
2434
|
var exam_name = "시험 이름";
|
2608
2435
|
var student_phone_number_header = "학생 전화번호";
|
@@ -2628,6 +2455,13 @@ var total_users = "총 사용자";
|
|
2628
2455
|
var added_date = "추가된 날짜";
|
2629
2456
|
var sync_exam_results = "시험 결과 동기화";
|
2630
2457
|
var update_data_fail = "데이터 업데이트 실패";
|
2458
|
+
var add_students_to_class = "수업에 학생 추가";
|
2459
|
+
var click_to_choose_file = "파일을 선택하려면 클릭하세요.";
|
2460
|
+
var exam_data = "시험 데이터";
|
2461
|
+
var questions_correct_rate = "질문 정답률";
|
2462
|
+
var question_management = "질문 관리";
|
2463
|
+
var student_data = "학생 데이터";
|
2464
|
+
var problem_number_question_chart = "문제 {{number}}번";
|
2631
2465
|
var are_you_sure_to_sync_exam_results_to_academy = "시험 결과를 아카데미 {{ academyName }}에 동기화하시겠습니까(백그라운드에서 실행되며 시간이 다소 소요됨)";
|
2632
2466
|
var messages = {
|
2633
2467
|
exam_sessions_are_being_synchronized: "{{ total }} 개의 시험 세션이 동기화되고 있습니다"
|
@@ -2711,6 +2545,8 @@ var reset_passcode = "사용된 시간 비밀번호 재설정";
|
|
2711
2545
|
var at_academy = "학원에서";
|
2712
2546
|
var sent_at = "보낸 시간";
|
2713
2547
|
var create_data_successfully = "데이터를 성공적으로 생성했습니다";
|
2548
|
+
var reduce_time = "시간 단축";
|
2549
|
+
var reduce_duration = "기간 단축";
|
2714
2550
|
var lang_ko = {
|
2715
2551
|
problem_solving: problem_solving,
|
2716
2552
|
my_story: my_story,
|
@@ -3371,6 +3207,13 @@ var lang_ko = {
|
|
3371
3207
|
added_date: added_date,
|
3372
3208
|
sync_exam_results: sync_exam_results,
|
3373
3209
|
update_data_fail: update_data_fail,
|
3210
|
+
add_students_to_class: add_students_to_class,
|
3211
|
+
click_to_choose_file: click_to_choose_file,
|
3212
|
+
exam_data: exam_data,
|
3213
|
+
questions_correct_rate: questions_correct_rate,
|
3214
|
+
question_management: question_management,
|
3215
|
+
student_data: student_data,
|
3216
|
+
problem_number_question_chart: problem_number_question_chart,
|
3374
3217
|
are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy,
|
3375
3218
|
messages: messages,
|
3376
3219
|
submit: submit,
|
@@ -3451,7 +3294,9 @@ var lang_ko = {
|
|
3451
3294
|
reset_passcode: reset_passcode,
|
3452
3295
|
at_academy: at_academy,
|
3453
3296
|
sent_at: sent_at,
|
3454
|
-
create_data_successfully: create_data_successfully
|
3297
|
+
create_data_successfully: create_data_successfully,
|
3298
|
+
reduce_time: reduce_time,
|
3299
|
+
reduce_duration: reduce_duration
|
3455
3300
|
};
|
3456
3301
|
|
3457
3302
|
var problem_solving$1 = "Problem Solving";
|
@@ -3507,8 +3352,8 @@ var number_answer$1 = "No.{{number}}";
|
|
3507
3352
|
var answer_no$1 = "Ans.{{number}}";
|
3508
3353
|
var answer_rate$1 = "Answer rate";
|
3509
3354
|
var seconds$1 = "s";
|
3510
|
-
var search_placeholder$1 = "Search by
|
3511
|
-
var search_by_student$1 = "Search by
|
3355
|
+
var search_placeholder$1 = "Search by Exam Name";
|
3356
|
+
var search_by_student$1 = "Search by Student Name";
|
3512
3357
|
var study_touch$1 = "Study touch";
|
3513
3358
|
var exam_information$1 = "Exam information";
|
3514
3359
|
var issue_number$1 = "Issue number";
|
@@ -3584,8 +3429,8 @@ var update_exam$1 = "Update exam";
|
|
3584
3429
|
var create_exam$1 = "Create exam";
|
3585
3430
|
var back$1 = "Back";
|
3586
3431
|
var date_format_exam$1 = "MMMM YYYY";
|
3587
|
-
var date_format$1 = "MMM.D YYYY";
|
3588
|
-
var date_time_format$1 = "HH:mm MMM.D YYYY ";
|
3432
|
+
var date_format$1 = "MMM. D. YYYY";
|
3433
|
+
var date_time_format$1 = "HH:mm MMM. D YYYY ";
|
3589
3434
|
var date_time_format_12h$1 = "MM-DD-YYYY HH:mm A";
|
3590
3435
|
var full_date_time_format$1 = "MMM Do YYYY HH:mm:ss";
|
3591
3436
|
var total_questions$1 = "Total questions";
|
@@ -3658,8 +3503,9 @@ var problem_number_question$1 = "Question {{number}}";
|
|
3658
3503
|
var teacher_in_charge$1 = "Teacher In Charge";
|
3659
3504
|
var counselor$1 = "Counselor";
|
3660
3505
|
var new_question$1 = "New Question";
|
3661
|
-
var hour$1 = "
|
3662
|
-
var
|
3506
|
+
var hour$1 = "hr";
|
3507
|
+
var hours = "hrs";
|
3508
|
+
var minute$1 = "min";
|
3663
3509
|
var second$1 = "second";
|
3664
3510
|
var question_order$1 = "Number {{number}}";
|
3665
3511
|
var send_message$1 = "Send Message";
|
@@ -3688,7 +3534,7 @@ var check_attendance$1 = "Check attendance";
|
|
3688
3534
|
var attendance_check$1 = "Attendance check";
|
3689
3535
|
var class_date$1 = "Class date";
|
3690
3536
|
var class_time$1 = "Class time";
|
3691
|
-
var attendance$1 = "Attendance";
|
3537
|
+
var attendance$1 = "Attendance List";
|
3692
3538
|
var attendance_completed$1 = "Attendance completed";
|
3693
3539
|
var none_attendance$1 = "Non-attendance";
|
3694
3540
|
var academy_list$1 = "Academy list";
|
@@ -4118,6 +3964,13 @@ var total_users$1 = "Total users";
|
|
4118
3964
|
var added_date$1 = "Added date";
|
4119
3965
|
var sync_exam_results$1 = "Sync exam results";
|
4120
3966
|
var update_data_fail$1 = "Update data fail";
|
3967
|
+
var add_students_to_class$1 = "Add students to class";
|
3968
|
+
var click_to_choose_file$1 = "Click to choose file";
|
3969
|
+
var exam_data$1 = "Exam Data";
|
3970
|
+
var questions_correct_rate$1 = "Questions Correct Rate";
|
3971
|
+
var question_management$1 = "Question Management";
|
3972
|
+
var student_data$1 = "Student Data";
|
3973
|
+
var problem_number_question_chart$1 = "Q. {{number}}";
|
4121
3974
|
var are_you_sure_to_sync_exam_results_to_academy$1 = "Are you sure to sync exam results to academy \"{{ academyName }}\" (it will run in the background and take a while)";
|
4122
3975
|
var messages$1 = {
|
4123
3976
|
exam_sessions_are_being_synchronized: "{{ total }} exam sessions are being synchronized"
|
@@ -4200,6 +4053,9 @@ var expired_date$1 = "Expired Date";
|
|
4200
4053
|
var reset_passcode$1 = "Reset Used Times Pass Code";
|
4201
4054
|
var at_academy$1 = "At academy";
|
4202
4055
|
var sent_at$1 = "Sent at";
|
4056
|
+
var create_data_successfully$1 = "Data was created successfully";
|
4057
|
+
var reduce_time$1 = "Reduce time";
|
4058
|
+
var reduce_duration$1 = "Reduce duration";
|
4203
4059
|
var lang_en = {
|
4204
4060
|
problem_solving: problem_solving$1,
|
4205
4061
|
my_story: my_story$1,
|
@@ -4406,6 +4262,7 @@ var lang_en = {
|
|
4406
4262
|
counselor: counselor$1,
|
4407
4263
|
new_question: new_question$1,
|
4408
4264
|
hour: hour$1,
|
4265
|
+
hours: hours,
|
4409
4266
|
minute: minute$1,
|
4410
4267
|
second: second$1,
|
4411
4268
|
question_order: question_order$1,
|
@@ -4860,6 +4717,13 @@ var lang_en = {
|
|
4860
4717
|
added_date: added_date$1,
|
4861
4718
|
sync_exam_results: sync_exam_results$1,
|
4862
4719
|
update_data_fail: update_data_fail$1,
|
4720
|
+
add_students_to_class: add_students_to_class$1,
|
4721
|
+
click_to_choose_file: click_to_choose_file$1,
|
4722
|
+
exam_data: exam_data$1,
|
4723
|
+
questions_correct_rate: questions_correct_rate$1,
|
4724
|
+
question_management: question_management$1,
|
4725
|
+
student_data: student_data$1,
|
4726
|
+
problem_number_question_chart: problem_number_question_chart$1,
|
4863
4727
|
are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy$1,
|
4864
4728
|
messages: messages$1,
|
4865
4729
|
submit: submit$1,
|
@@ -4939,10 +4803,13 @@ var lang_en = {
|
|
4939
4803
|
expired_date: expired_date$1,
|
4940
4804
|
reset_passcode: reset_passcode$1,
|
4941
4805
|
at_academy: at_academy$1,
|
4942
|
-
sent_at: sent_at$1
|
4806
|
+
sent_at: sent_at$1,
|
4807
|
+
create_data_successfully: create_data_successfully$1,
|
4808
|
+
reduce_time: reduce_time$1,
|
4809
|
+
reduce_duration: reduce_duration$1
|
4943
4810
|
};
|
4944
4811
|
|
4945
|
-
|
4812
|
+
i18n__default.use(reactI18next.initReactI18next).init({
|
4946
4813
|
lng: "ko",
|
4947
4814
|
fallbackLng: "ko",
|
4948
4815
|
interpolation: {
|
@@ -5034,7 +4901,7 @@ var TheLanguageDropdown = function TheLanguageDropdown(_ref) {
|
|
5034
4901
|
})));
|
5035
4902
|
};
|
5036
4903
|
|
5037
|
-
var useSwitchAcademy = function useSwitchAcademy(role, history, homeAcademyUrl, homeUrl, canFetchAcademies) {
|
4904
|
+
var useSwitchAcademy = function useSwitchAcademy(role, history, homeAcademyUrl, homeUrl, registerUrl, canFetchAcademies) {
|
5038
4905
|
var _user$roles;
|
5039
4906
|
if (role === void 0) {
|
5040
4907
|
role = exports.Role.Student;
|
@@ -5043,7 +4910,7 @@ var useSwitchAcademy = function useSwitchAcademy(role, history, homeAcademyUrl,
|
|
5043
4910
|
canFetchAcademies = false;
|
5044
4911
|
}
|
5045
4912
|
var dispatch = reactRedux.useDispatch();
|
5046
|
-
var _useLogin = useLogin(history, homeAcademyUrl, homeUrl),
|
4913
|
+
var _useLogin = useLogin(history, homeAcademyUrl, homeUrl, registerUrl),
|
5047
4914
|
handleLoginAccessToken = _useLogin.handleLoginAccessToken;
|
5048
4915
|
var academyList = reactRedux.useSelector(function (state) {
|
5049
4916
|
var _state$academies;
|
@@ -5199,10 +5066,11 @@ var TheAcademyDropdown = function TheAcademyDropdown(_ref) {
|
|
5199
5066
|
homeAcademyUrl = _ref.homeAcademyUrl,
|
5200
5067
|
homeUrl = _ref.homeUrl,
|
5201
5068
|
hideAcademyName = _ref.hideAcademyName,
|
5069
|
+
registerUrl = _ref.registerUrl,
|
5202
5070
|
onSignOut = _ref.onSignOut;
|
5203
5071
|
var theme = material.useTheme();
|
5204
5072
|
var isLargerThanLg = material.useMediaQuery(theme.breakpoints.up("lg"));
|
5205
|
-
var _useSwitchAcademy = useSwitchAcademy(role, history, homeAcademyUrl, homeUrl, true),
|
5073
|
+
var _useSwitchAcademy = useSwitchAcademy(role, history, homeAcademyUrl, homeUrl, registerUrl, true),
|
5206
5074
|
academyList = _useSwitchAcademy.academyList,
|
5207
5075
|
handleSwitchAcademy = _useSwitchAcademy.handleSwitchAcademy,
|
5208
5076
|
selectedAcademy = _useSwitchAcademy.selectedAcademy,
|
@@ -5664,7 +5532,6 @@ var ContentTooltip = function ContentTooltip(_ref) {
|
|
5664
5532
|
var ChatRightItem = function ChatRightItem(_ref) {
|
5665
5533
|
var content = _ref.content,
|
5666
5534
|
createdAt = _ref.createdAt,
|
5667
|
-
sender = _ref.sender,
|
5668
5535
|
showTimestamp = _ref.showTimestamp,
|
5669
5536
|
isStudent = _ref.isStudent,
|
5670
5537
|
showName = _ref.showName,
|
@@ -5697,13 +5564,15 @@ var ChatRightItem = function ChatRightItem(_ref) {
|
|
5697
5564
|
alignItems: "center",
|
5698
5565
|
justifyContent: "end",
|
5699
5566
|
flexDirection: "row"
|
5700
|
-
}, React__default.createElement(iconPersonNoActive,
|
5567
|
+
}, React__default.createElement(iconPersonNoActive, {
|
5568
|
+
color: styles.gray_700
|
5569
|
+
}), React__default.createElement(material.Typography, {
|
5701
5570
|
fontWeight: 700,
|
5702
5571
|
fontSize: 14,
|
5703
5572
|
padding: "4px",
|
5704
5573
|
lineHeight: "16.71px",
|
5705
5574
|
color: styles.gray_700
|
5706
|
-
},
|
5575
|
+
}, t("me"))), React__default.createElement(material.Stack, {
|
5707
5576
|
display: "flex",
|
5708
5577
|
flexDirection: "row",
|
5709
5578
|
gap: "8px",
|
@@ -6591,7 +6460,7 @@ var ChatHeader = function ChatHeader(_ref) {
|
|
6591
6460
|
sx: {
|
6592
6461
|
color: styles.gray_500
|
6593
6462
|
}
|
6594
|
-
}, (!!filterDurationExam.hours() ? filterDurationExam.hours() + " " + t("hour") : "") + " " + (!!filterDurationExam.minutes() ? filterDurationExam.minutes() + " " + t("minute") : "") + " " + (!!filterDurationExam.seconds() ? filterDurationExam.seconds() + " " + t("second") : "")))), React__default.createElement(material.Box, {
|
6463
|
+
}, (!!filterDurationExam.hours() ? filterDurationExam.hours() + " " + (filterDurationExam.hours() > 1 ? t("hours") : t("hour")) : "") + " " + (!!filterDurationExam.minutes() ? filterDurationExam.minutes() + " " + t("minute") : "") + " " + (!!filterDurationExam.seconds() ? filterDurationExam.seconds() + " " + t("second") : "")))), React__default.createElement(material.Box, {
|
6595
6464
|
display: "flex",
|
6596
6465
|
alignItems: "end",
|
6597
6466
|
gap: "6px",
|
@@ -6612,16 +6481,12 @@ var ChatHeader = function ChatHeader(_ref) {
|
|
6612
6481
|
fontSize: "12px",
|
6613
6482
|
lineHeight: "14.32px",
|
6614
6483
|
color: styles.less_dark
|
6615
|
-
},
|
6616
|
-
number: score || 0
|
6617
|
-
})), React__default.createElement(material.Typography, {
|
6484
|
+
}, score || 0), React__default.createElement(material.Typography, {
|
6618
6485
|
fontWeight: 700,
|
6619
6486
|
fontSize: "12px",
|
6620
6487
|
lineHeight: "14.32px",
|
6621
6488
|
color: styles.gray_300
|
6622
|
-
}, "/",
|
6623
|
-
number: totalScore || 0
|
6624
|
-
}))), React__default.createElement(material.Typography, {
|
6489
|
+
}, "/", totalScore || 0)), React__default.createElement(material.Typography, {
|
6625
6490
|
fontWeight: 500,
|
6626
6491
|
fontSize: "12px",
|
6627
6492
|
lineHeight: "14.32px",
|
@@ -7572,45 +7437,11 @@ var QuestionView = function QuestionView(_ref2) {
|
|
7572
7437
|
}))));
|
7573
7438
|
};
|
7574
7439
|
|
7575
|
-
var ADMIN_CATEGORY_URL = SUPER_ADMIN_BASE_URL + "/api/category";
|
7576
|
-
var CATEGORY_URL = BASE_URL + "/api/examcategory";
|
7577
|
-
var getCategoryListAdminApi = function getCategoryListAdminApi(data) {
|
7578
|
-
try {
|
7579
|
-
return Promise.resolve(api.get("" + ADMIN_CATEGORY_URL, {
|
7580
|
-
params: data
|
7581
|
-
}));
|
7582
|
-
} catch (e) {
|
7583
|
-
return Promise.reject(e);
|
7584
|
-
}
|
7585
|
-
};
|
7586
|
-
var getCategoryListApi = function getCategoryListApi(data) {
|
7587
|
-
try {
|
7588
|
-
return Promise.resolve(api.get("" + CATEGORY_URL, {
|
7589
|
-
params: data
|
7590
|
-
}));
|
7591
|
-
} catch (e) {
|
7592
|
-
return Promise.reject(e);
|
7593
|
-
}
|
7594
|
-
};
|
7595
|
-
|
7596
7440
|
var useCategorySelect = function useCategorySelect(_ref) {
|
7597
|
-
var
|
7598
|
-
var firstLoad = true;
|
7599
|
-
var dispatch = reactRedux.useDispatch();
|
7441
|
+
var categoryList = _ref.categoryList;
|
7600
7442
|
var _useState = React.useState(),
|
7601
|
-
|
7602
|
-
|
7603
|
-
var _useState2 = React.useState(),
|
7604
|
-
selectedCategory = _useState2[0],
|
7605
|
-
setSelectedCategory = _useState2[1];
|
7606
|
-
var isDomain = reactRedux.useSelector(function (state) {
|
7607
|
-
var _state$common, _state$common$user;
|
7608
|
-
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.academyDomain;
|
7609
|
-
});
|
7610
|
-
var isSuperAdmin = reactRedux.useSelector(function (state) {
|
7611
|
-
var _state$common2, _state$common2$user;
|
7612
|
-
return (state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : (_state$common2$user = _state$common2.user) === null || _state$common2$user === void 0 ? void 0 : _state$common2$user.roles) || [];
|
7613
|
-
}).includes(exports.Role.Admin) && !isDomain;
|
7443
|
+
selectedCategory = _useState[0],
|
7444
|
+
setSelectedCategory = _useState[1];
|
7614
7445
|
var categoryOptions = React.useMemo(function () {
|
7615
7446
|
return categoryList === null || categoryList === void 0 ? void 0 : categoryList.map(function (category) {
|
7616
7447
|
var _category$path;
|
@@ -7620,39 +7451,6 @@ var useCategorySelect = function useCategorySelect(_ref) {
|
|
7620
7451
|
};
|
7621
7452
|
});
|
7622
7453
|
}, [JSON.stringify(categoryList)]);
|
7623
|
-
var getCategoryList = function getCategoryList(isLoading) {
|
7624
|
-
if (isLoading === void 0) {
|
7625
|
-
isLoading = true;
|
7626
|
-
}
|
7627
|
-
try {
|
7628
|
-
var _temp2 = function _temp2() {
|
7629
|
-
isLoading && dispatch(setLoading(false));
|
7630
|
-
};
|
7631
|
-
if (!subjectId) return Promise.resolve();
|
7632
|
-
if (firstLoad) firstLoad = false;
|
7633
|
-
isLoading && dispatch(setLoading(true));
|
7634
|
-
var _temp = _catch(function () {
|
7635
|
-
return Promise.resolve(isSuperAdmin ? getCategoryListAdminApi({
|
7636
|
-
subjectId: subjectId
|
7637
|
-
}) : getCategoryListApi({
|
7638
|
-
subjectId: subjectId
|
7639
|
-
})).then(function (res) {
|
7640
|
-
var data = res.data.items;
|
7641
|
-
setCategoryList(data || []);
|
7642
|
-
setSelectedCategory(data[0]);
|
7643
|
-
});
|
7644
|
-
}, function (error) {
|
7645
|
-
setCategoryList([]);
|
7646
|
-
console.log(error);
|
7647
|
-
});
|
7648
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
7649
|
-
} catch (e) {
|
7650
|
-
return Promise.reject(e);
|
7651
|
-
}
|
7652
|
-
};
|
7653
|
-
React.useEffect(function () {
|
7654
|
-
getCategoryList();
|
7655
|
-
}, [subjectId]);
|
7656
7454
|
var handleChangeCategory = function handleChangeCategory(value) {
|
7657
7455
|
var id = value.value;
|
7658
7456
|
var selectedCategory = categoryList === null || categoryList === void 0 ? void 0 : categoryList.find(function (category) {
|
@@ -7745,7 +7543,7 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
|
|
7745
7543
|
questions = _ref.questions,
|
7746
7544
|
answerCount = _ref.answerCount,
|
7747
7545
|
questionCount = _ref.questionCount,
|
7748
|
-
|
7546
|
+
categoryList = _ref.categoryList,
|
7749
7547
|
categoryId = _ref.categoryId,
|
7750
7548
|
isActive = _ref.isActive,
|
7751
7549
|
isDisabled = _ref.isDisabled,
|
@@ -7760,7 +7558,7 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
|
|
7760
7558
|
var _useTranslation = reactI18next.useTranslation(),
|
7761
7559
|
t = _useTranslation.t;
|
7762
7560
|
var _useCategorySelect = useCategorySelect({
|
7763
|
-
|
7561
|
+
categoryList: categoryList
|
7764
7562
|
}),
|
7765
7563
|
categoryOptions = _useCategorySelect.categoryOptions;
|
7766
7564
|
var theme = material.useTheme();
|
@@ -9625,12 +9423,45 @@ var DURATION_OPTIONS = Array.from({
|
|
9625
9423
|
});
|
9626
9424
|
var DEFAULT_ANSWER_COUNT$1 = 5;
|
9627
9425
|
|
9426
|
+
var ADMIN_CATEGORY_URL = SUPER_ADMIN_BASE_URL + "/api/category";
|
9427
|
+
var CATEGORY_URL = BASE_URL + "/api/examcategory";
|
9428
|
+
var getCategoryListAdminApi = function getCategoryListAdminApi(data) {
|
9429
|
+
try {
|
9430
|
+
return Promise.resolve(api.get("" + ADMIN_CATEGORY_URL, {
|
9431
|
+
params: data
|
9432
|
+
}));
|
9433
|
+
} catch (e) {
|
9434
|
+
return Promise.reject(e);
|
9435
|
+
}
|
9436
|
+
};
|
9437
|
+
var getCategoryListApi = function getCategoryListApi(data) {
|
9438
|
+
try {
|
9439
|
+
return Promise.resolve(api.get("" + CATEGORY_URL, {
|
9440
|
+
params: data
|
9441
|
+
}));
|
9442
|
+
} catch (e) {
|
9443
|
+
return Promise.reject(e);
|
9444
|
+
}
|
9445
|
+
};
|
9446
|
+
|
9628
9447
|
var useExamDetailView = function useExamDetailView(props) {
|
9629
9448
|
var exam = props.exam,
|
9630
|
-
selectedSubject = props.selectedSubject,
|
9631
9449
|
onChangeExam = props.onChangeExam;
|
9632
9450
|
var _useTranslation = reactI18next.useTranslation(),
|
9633
9451
|
t = _useTranslation.t;
|
9452
|
+
var firstLoad = true;
|
9453
|
+
var dispatch = reactRedux.useDispatch();
|
9454
|
+
var isDomain = reactRedux.useSelector(function (state) {
|
9455
|
+
var _state$common, _state$common$user;
|
9456
|
+
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.academyDomain;
|
9457
|
+
});
|
9458
|
+
var isSuperAdmin = reactRedux.useSelector(function (state) {
|
9459
|
+
var _state$common2, _state$common2$user;
|
9460
|
+
return (state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : (_state$common2$user = _state$common2.user) === null || _state$common2$user === void 0 ? void 0 : _state$common2$user.roles) || [];
|
9461
|
+
}).includes(exports.Role.Admin) && !isDomain;
|
9462
|
+
var _useState = React.useState([]),
|
9463
|
+
categoryList = _useState[0],
|
9464
|
+
setCategoryList = _useState[1];
|
9634
9465
|
var handleChangeQuestionCount = function handleChangeQuestionCount(article, questionCount, answerCount) {
|
9635
9466
|
if (!exam) return;
|
9636
9467
|
var examQuestions = exam.questions;
|
@@ -9808,6 +9639,39 @@ var useExamDetailView = function useExamDetailView(props) {
|
|
9808
9639
|
}])
|
9809
9640
|
}));
|
9810
9641
|
};
|
9642
|
+
var getCategoryList = function getCategoryList(isLoading) {
|
9643
|
+
if (isLoading === void 0) {
|
9644
|
+
isLoading = true;
|
9645
|
+
}
|
9646
|
+
try {
|
9647
|
+
var _temp2 = function _temp2() {
|
9648
|
+
isLoading && dispatch(setLoading(false));
|
9649
|
+
};
|
9650
|
+
if (!exam.subjectId) return Promise.resolve();
|
9651
|
+
if (firstLoad) firstLoad = false;
|
9652
|
+
isLoading && dispatch(setLoading(true));
|
9653
|
+
var _temp = _catch(function () {
|
9654
|
+
return Promise.resolve(isSuperAdmin ? getCategoryListAdminApi({
|
9655
|
+
subjectId: exam.subjectId
|
9656
|
+
}) : getCategoryListApi({
|
9657
|
+
subjectId: exam.subjectId
|
9658
|
+
})).then(function (res) {
|
9659
|
+
var data = res.data.items;
|
9660
|
+
setCategoryList(data || []);
|
9661
|
+
});
|
9662
|
+
}, function (error) {
|
9663
|
+
setCategoryList([]);
|
9664
|
+
console.log(error);
|
9665
|
+
});
|
9666
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
9667
|
+
} catch (e) {
|
9668
|
+
return Promise.reject(e);
|
9669
|
+
}
|
9670
|
+
};
|
9671
|
+
React.useEffect(function () {
|
9672
|
+
if (categoryList !== null && categoryList !== void 0 && categoryList.length) return;
|
9673
|
+
getCategoryList();
|
9674
|
+
}, [exam.subjectId, JSON.stringify(categoryList)]);
|
9811
9675
|
var examGroupByArticle = React.useMemo(function () {
|
9812
9676
|
if (!exam) return [];
|
9813
9677
|
var articles = [];
|
@@ -9832,27 +9696,23 @@ var useExamDetailView = function useExamDetailView(props) {
|
|
9832
9696
|
var durationOptions = React.useMemo(function () {
|
9833
9697
|
var options = DURATION_OPTIONS.map(function (i) {
|
9834
9698
|
return {
|
9835
|
-
label: t(
|
9699
|
+
label: t("mins_mins", {
|
9836
9700
|
mins: i
|
9837
9701
|
}),
|
9838
9702
|
value: i
|
9839
9703
|
};
|
9840
9704
|
});
|
9841
9705
|
if (!!exam.duration && exam.duration > DURATION_OPTIONS[DURATION_OPTIONS.length - 1]) return [].concat(options, [{
|
9842
|
-
label: t(
|
9706
|
+
label: t("mins_mins", {
|
9843
9707
|
mins: exam.duration
|
9844
9708
|
}),
|
9845
9709
|
value: exam.duration
|
9846
9710
|
}]);
|
9847
9711
|
return options;
|
9848
9712
|
}, [exam.duration]);
|
9849
|
-
React.useEffect(function () {
|
9850
|
-
if ((selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) !== exam.subjectId) onChangeExam(_extends({}, exam, {
|
9851
|
-
subjectId: (selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) || 0
|
9852
|
-
}));
|
9853
|
-
}, [selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id, exam.subjectId]);
|
9854
9713
|
return {
|
9855
9714
|
t: t,
|
9715
|
+
categoryList: categoryList,
|
9856
9716
|
durationOptions: durationOptions,
|
9857
9717
|
examGroupByArticle: examGroupByArticle,
|
9858
9718
|
handleAddArticle: handleAddArticle,
|
@@ -9874,16 +9734,19 @@ var ExamDetailView = function ExamDetailView(_ref) {
|
|
9874
9734
|
isDisabled = _ref.isDisabled,
|
9875
9735
|
isEdit = _ref.isEdit,
|
9876
9736
|
onChangeExam = _ref.onChangeExam;
|
9877
|
-
var _useSubjectSelect = useSubjectSelect(
|
9737
|
+
var _useSubjectSelect = useSubjectSelect({
|
9738
|
+
onChangeExam: onChangeExam,
|
9739
|
+
exam: exam
|
9740
|
+
}),
|
9878
9741
|
subjectOptions = _useSubjectSelect.subjectOptions,
|
9879
9742
|
selectedSubject = _useSubjectSelect.selectedSubject,
|
9880
9743
|
handleChangeSubject = _useSubjectSelect.handleChangeSubject;
|
9881
9744
|
var _useExamDetailView = useExamDetailView({
|
9882
9745
|
exam: exam,
|
9883
|
-
onChangeExam: onChangeExam
|
9884
|
-
selectedSubject: selectedSubject
|
9746
|
+
onChangeExam: onChangeExam
|
9885
9747
|
}),
|
9886
9748
|
t = _useExamDetailView.t,
|
9749
|
+
categoryList = _useExamDetailView.categoryList,
|
9887
9750
|
durationOptions = _useExamDetailView.durationOptions,
|
9888
9751
|
examGroupByArticle = _useExamDetailView.examGroupByArticle,
|
9889
9752
|
handleAddArticle = _useExamDetailView.handleAddArticle,
|
@@ -9932,10 +9795,10 @@ var ExamDetailView = function ExamDetailView(_ref) {
|
|
9932
9795
|
className: 'mb-2'
|
9933
9796
|
}, React__default.createElement("label", {
|
9934
9797
|
className: styles["form-label"] + " " + styles$2["question-label"],
|
9935
|
-
htmlFor: "
|
9936
|
-
}, t("subject")
|
9798
|
+
htmlFor: "subject"
|
9799
|
+
}, t("subject")), React__default.createElement(CustomSelect, {
|
9937
9800
|
inputId: "subject",
|
9938
|
-
value:
|
9801
|
+
value: exam === null || exam === void 0 ? void 0 : exam.subjectId,
|
9939
9802
|
options: subjectOptions,
|
9940
9803
|
onChange: handleChangeSubject,
|
9941
9804
|
isDisabled: isDisabled || isEdit
|
@@ -9946,6 +9809,7 @@ var ExamDetailView = function ExamDetailView(_ref) {
|
|
9946
9809
|
xs: 12,
|
9947
9810
|
className: index === examGroupByArticle.length - 1 ? "mb-2" : ''
|
9948
9811
|
}, React__default.createElement(ArticleGroupView, Object.assign({}, i, {
|
9812
|
+
categoryList: categoryList,
|
9949
9813
|
isActive: index === examGroupByArticle.length - 1,
|
9950
9814
|
onChangeQuestionCount: handleChangeQuestionCount,
|
9951
9815
|
onChangeCategory: handleChangeCategory,
|
@@ -10830,18 +10694,6 @@ var createConversationApi = function createConversationApi(data) {
|
|
10830
10694
|
return api.post(BASE_URL + "/api/conversation", data);
|
10831
10695
|
};
|
10832
10696
|
|
10833
|
-
var toNumberOrder = function toNumberOrder(value) {
|
10834
|
-
return "The " + value + (value % 10 === 1 ? 'st' : value % 10 === 2 ? 'nd' : value % 10 === 3 ? 'rd' : 'th');
|
10835
|
-
};
|
10836
|
-
var formatDuration = function formatDuration(t, duration) {
|
10837
|
-
if (!duration) return "0" + t("seconds");
|
10838
|
-
var totalTime = Math.round(duration);
|
10839
|
-
return totalTime > 60 ? t("mins_mins_seconds_seconds", {
|
10840
|
-
mins: Math.floor(totalTime / 60),
|
10841
|
-
seconds: totalTime % 60
|
10842
|
-
}) : "" + Math.round(duration) + t("seconds");
|
10843
|
-
};
|
10844
|
-
|
10845
10697
|
var ORDER_NUMBERS = {
|
10846
10698
|
1: "the_first",
|
10847
10699
|
2: "the_second",
|
@@ -10896,6 +10748,7 @@ var EXAM_RESULT = {
|
|
10896
10748
|
parentPhoneNumber: "",
|
10897
10749
|
schoolName: "Academy",
|
10898
10750
|
className: "1",
|
10751
|
+
fullName: "Abc",
|
10899
10752
|
major: "",
|
10900
10753
|
roles: []
|
10901
10754
|
},
|
@@ -11628,6 +11481,18 @@ var defaultSeries = function defaultSeries(t) {
|
|
11628
11481
|
}];
|
11629
11482
|
};
|
11630
11483
|
|
11484
|
+
var formatDuration = function formatDuration(t, duration) {
|
11485
|
+
if (!duration) return "0" + t("seconds");
|
11486
|
+
var totalTime = Math.round(duration);
|
11487
|
+
return totalTime > 60 ? t("mins_mins_seconds_seconds", {
|
11488
|
+
mins: Math.floor(totalTime / 60),
|
11489
|
+
seconds: totalTime % 60
|
11490
|
+
}) : "" + Math.round(duration) + t("seconds");
|
11491
|
+
};
|
11492
|
+
var formatQuestionOrder = function formatQuestionOrder(index, t, language) {
|
11493
|
+
return language === exports.Language.en ? "" + (index + 1) + getOrdinalSuffix(index + 1, language) : t(ORDER_NUMBERS[index + 1]);
|
11494
|
+
};
|
11495
|
+
|
11631
11496
|
var RECENT_USER_URL = BASE_URL + "/api/recentUsers";
|
11632
11497
|
var getRecentUserActionListApi = function getRecentUserActionListApi(query) {
|
11633
11498
|
return api.get("" + RECENT_USER_URL, {
|
@@ -11650,19 +11515,18 @@ var createRecentUserActionListApi = function createRecentUserActionListApi(_ref)
|
|
11650
11515
|
});
|
11651
11516
|
};
|
11652
11517
|
|
11653
|
-
var useExamResult = function useExamResult(
|
11518
|
+
var useExamResult = function useExamResult(props) {
|
11654
11519
|
var _allSeries$dataChartI;
|
11655
|
-
|
11656
|
-
|
11657
|
-
|
11658
|
-
|
11659
|
-
|
11660
|
-
|
11661
|
-
|
11662
|
-
|
11663
|
-
|
11664
|
-
var query = new URLSearchParams(
|
11665
|
-
var dispatch = reactRedux.useDispatch();
|
11520
|
+
var searchParams = props.searchParams,
|
11521
|
+
history = props.history,
|
11522
|
+
examSessionId = props.examSessionId,
|
11523
|
+
studentId = props.studentId,
|
11524
|
+
_props$code = props.code,
|
11525
|
+
code = _props$code === void 0 ? "" : _props$code,
|
11526
|
+
handleChangeTab = props.handleChangeTab,
|
11527
|
+
selectedTab = props.selectedTab,
|
11528
|
+
isPrint = props.isPrint;
|
11529
|
+
var query = new URLSearchParams(searchParams);
|
11666
11530
|
var user = reactRedux.useSelector(function (state) {
|
11667
11531
|
var _state$common;
|
11668
11532
|
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
@@ -11674,7 +11538,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11674
11538
|
var _state$common2;
|
11675
11539
|
return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : _state$common2.language;
|
11676
11540
|
});
|
11677
|
-
var _useState = React.useState(
|
11541
|
+
var _useState = React.useState(),
|
11678
11542
|
isLoading = _useState[0],
|
11679
11543
|
setIsLoading = _useState[1];
|
11680
11544
|
var _useState2 = React.useState(),
|
@@ -11695,9 +11559,12 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11695
11559
|
var _useState7 = React.useState(0),
|
11696
11560
|
dataChartIndex = _useState7[0],
|
11697
11561
|
setDataChartIndex = _useState7[1];
|
11698
|
-
var _useState8 = React.useState(
|
11562
|
+
var _useState8 = React.useState(),
|
11699
11563
|
openProblem = _useState8[0],
|
11700
11564
|
setOpenProblem = _useState8[1];
|
11565
|
+
var _useState9 = React.useState(),
|
11566
|
+
errorMessage = _useState9[0],
|
11567
|
+
setErrorMessage = _useState9[1];
|
11701
11568
|
var _useTranslation = reactI18next.useTranslation(),
|
11702
11569
|
t = _useTranslation.t;
|
11703
11570
|
var getStudentData = function getStudentData(examCode) {
|
@@ -11710,7 +11577,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11710
11577
|
var _temp = _catch(function () {
|
11711
11578
|
return Promise.resolve(Promise.all([getResults(examCode), getResultsLongTimeSpend(examCode), getResultsEffectSize(examCode), getResultsTimeOrderQuestion(examCode), getResultsCategories(examCode)])).then(function (result) {
|
11712
11579
|
var _result$0$data, _result$1$data, _result$2$data, _result$3$data, _result$4$data;
|
11713
|
-
handleChangeTab(0);
|
11580
|
+
handleChangeTab === null || handleChangeTab === void 0 ? void 0 : handleChangeTab(0);
|
11714
11581
|
setDataChartIndex(0);
|
11715
11582
|
setResultData((_result$0$data = result[0].data) === null || _result$0$data === void 0 ? void 0 : _result$0$data.data);
|
11716
11583
|
setLongTimeSpend((_result$1$data = result[1].data) === null || _result$1$data === void 0 ? void 0 : _result$1$data.data);
|
@@ -11719,19 +11586,21 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11719
11586
|
setCategoryResponses(((_result$4$data = result[4].data) === null || _result$4$data === void 0 ? void 0 : _result$4$data.data) || []);
|
11720
11587
|
});
|
11721
11588
|
}, function (error) {
|
11722
|
-
|
11589
|
+
var message = getErrorMessage(t, error);
|
11590
|
+
!isPrint && reactToastify.toast.error(message);
|
11591
|
+
setErrorMessage(message);
|
11723
11592
|
});
|
11724
11593
|
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
11725
11594
|
} catch (e) {
|
11726
11595
|
return Promise.reject(e);
|
11727
11596
|
}
|
11728
11597
|
};
|
11729
|
-
var getStudentDataByTeacher = function getStudentDataByTeacher(
|
11598
|
+
var getStudentDataByTeacher = function getStudentDataByTeacher(examSessionId, studentId) {
|
11730
11599
|
try {
|
11731
11600
|
var _temp5 = function _temp5() {
|
11732
11601
|
setIsLoading(false);
|
11733
11602
|
};
|
11734
|
-
if (!
|
11603
|
+
if (!examSessionId || !studentId) return Promise.resolve();
|
11735
11604
|
setIsLoading(true);
|
11736
11605
|
var _temp4 = _catch(function () {
|
11737
11606
|
return Promise.resolve(Promise.all([getResultsTeacher(examSessionId, studentId), getResultsLongTimeSpendTeacher(examSessionId, studentId), getResultsEffectSizeTeacher(examSessionId, studentId), getResultsTimeOrderQuestionTeacher(examSessionId, studentId), getResultsCategoriesTeacher(examSessionId, studentId)])).then(function (result) {
|
@@ -11739,7 +11608,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11739
11608
|
function _temp3(_createRecentUserActi) {
|
11740
11609
|
_createRecentUserActi;
|
11741
11610
|
}
|
11742
|
-
handleChangeTab(0);
|
11611
|
+
handleChangeTab === null || handleChangeTab === void 0 ? void 0 : handleChangeTab(0);
|
11743
11612
|
setDataChartIndex(0);
|
11744
11613
|
setResultData((_result$0$data2 = result[0].data) === null || _result$0$data2 === void 0 ? void 0 : _result$0$data2.data);
|
11745
11614
|
setLongTimeSpend((_result$1$data2 = result[1].data) === null || _result$1$data2 === void 0 ? void 0 : _result$1$data2.data);
|
@@ -11759,7 +11628,9 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11759
11628
|
})).then(_temp3);
|
11760
11629
|
});
|
11761
11630
|
}, function (error) {
|
11762
|
-
|
11631
|
+
var message = getErrorMessage(t, error);
|
11632
|
+
!isPrint && reactToastify.toast.error(message);
|
11633
|
+
setErrorMessage(message);
|
11763
11634
|
});
|
11764
11635
|
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
|
11765
11636
|
} catch (e) {
|
@@ -11774,7 +11645,9 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11774
11645
|
setCategoryResponses(CATEGORY_RESPONSES);
|
11775
11646
|
};
|
11776
11647
|
var resetData = function resetData() {
|
11648
|
+
setIsLoading(undefined);
|
11777
11649
|
setResultData(undefined);
|
11650
|
+
setErrorMessage(undefined);
|
11778
11651
|
setLongTimeSpend([]);
|
11779
11652
|
setEffectSize([]);
|
11780
11653
|
setTimelyOrderQuestions([]);
|
@@ -11785,7 +11658,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11785
11658
|
resetData();
|
11786
11659
|
if (!(user !== null && user !== void 0 && user.email)) return;
|
11787
11660
|
isStudent && getStudentData(examCode);
|
11788
|
-
!isStudent && getStudentDataByTeacher(
|
11661
|
+
!isStudent && getStudentDataByTeacher(examSessionId, studentId);
|
11789
11662
|
};
|
11790
11663
|
examCode === "example-code" ? setExampleData() : getData();
|
11791
11664
|
}, [examCode, isStudent, code, examSessionId, studentId, user === null || user === void 0 ? void 0 : user.email]);
|
@@ -11825,7 +11698,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11825
11698
|
var dataPointIndex = _ref.dataPointIndex;
|
11826
11699
|
if (dataPointIndex > 0) {
|
11827
11700
|
var _questions;
|
11828
|
-
return val != null ? t("
|
11701
|
+
return val != null ? t("problem_number_question_chart", {
|
11829
11702
|
number: questions !== null ? (((_questions = questions[questionLength - val]) === null || _questions === void 0 ? void 0 : _questions.questionOrder) || 0) + 1 : val
|
11830
11703
|
}) : t("no_data");
|
11831
11704
|
}
|
@@ -11834,11 +11707,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11834
11707
|
}
|
11835
11708
|
}),
|
11836
11709
|
xaxis: _extends({}, DEFAULT_LINE_CHART_OPTIONS.xaxis, {
|
11837
|
-
categories: [""].concat(Array.from({
|
11710
|
+
categories: ["s"].concat(Array.from({
|
11838
11711
|
length: questionLength
|
11839
11712
|
}, function (_, i) {
|
11840
|
-
return
|
11841
|
-
}), [""]),
|
11713
|
+
return formatQuestionOrder(i, t, language);
|
11714
|
+
}), ["e"]),
|
11842
11715
|
tooltip: {
|
11843
11716
|
formatter: function formatter(val) {
|
11844
11717
|
if (val > 1) return t(ORDER_NUMBERS[val - 1]);
|
@@ -11910,7 +11783,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11910
11783
|
var dataPointIndex = _ref2.dataPointIndex;
|
11911
11784
|
if (dataPointIndex > 0) {
|
11912
11785
|
var _questions3;
|
11913
|
-
return val != null ? t("
|
11786
|
+
return val != null ? t("problem_number_question_chart", {
|
11914
11787
|
number: questions !== null ? (((_questions3 = questions[questionLength - val]) === null || _questions3 === void 0 ? void 0 : _questions3.questionOrder) || 0) + 1 : val
|
11915
11788
|
}) : t("no_data");
|
11916
11789
|
}
|
@@ -11920,11 +11793,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11920
11793
|
}),
|
11921
11794
|
colors: ['#3DC674', '#C3099A'],
|
11922
11795
|
xaxis: _extends({}, DEFAULT_LINE_CHART_OPTIONS.xaxis, {
|
11923
|
-
categories: [""].concat(Array.from({
|
11796
|
+
categories: ["s"].concat(Array.from({
|
11924
11797
|
length: questionLength
|
11925
11798
|
}, function (_, i) {
|
11926
|
-
return
|
11927
|
-
}), [""]),
|
11799
|
+
return formatQuestionOrder(i, t, language);
|
11800
|
+
}), ["e"]),
|
11928
11801
|
tooltip: {
|
11929
11802
|
formatter: function formatter(val) {
|
11930
11803
|
if (val > 1) return t(ORDER_NUMBERS[val - 1]);
|
@@ -11938,7 +11811,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11938
11811
|
labels: _extends({}, DEFAULT_LINE_CHART_OPTIONS.yaxis.labels, {
|
11939
11812
|
formatter: function formatter(val) {
|
11940
11813
|
var _questions4;
|
11941
|
-
return val != null ? t("
|
11814
|
+
return val != null ? t("problem_number_question_chart", {
|
11942
11815
|
number: questions !== null ? (((_questions4 = questions[questionLength - val]) === null || _questions4 === void 0 ? void 0 : _questions4.questionOrder) || 0) + 1 : val
|
11943
11816
|
}) : t("no_data");
|
11944
11817
|
}
|
@@ -11947,224 +11820,6 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11947
11820
|
});
|
11948
11821
|
}, [JSON.stringify(allChartOptions), dataChartIndex, language]);
|
11949
11822
|
var series = (_allSeries$dataChartI = allSeries[dataChartIndex]) != null ? _allSeries$dataChartI : defaultSeries(t);
|
11950
|
-
var handleExportPdf = function handleExportPdf() {
|
11951
|
-
try {
|
11952
|
-
var _temp24 = function _temp24(_result) {
|
11953
|
-
if (_exit) return _result;
|
11954
|
-
dispatch(setLoading(false));
|
11955
|
-
};
|
11956
|
-
var _exit = false;
|
11957
|
-
dispatch(setLoading(true));
|
11958
|
-
var _temp23 = _catch(function () {
|
11959
|
-
var canvas = document.querySelector("#canvas");
|
11960
|
-
var headerCanvas = document.querySelector("#header-canvas");
|
11961
|
-
if (!canvas || !headerCanvas) {
|
11962
|
-
_exit = true;
|
11963
|
-
return;
|
11964
|
-
}
|
11965
|
-
var doc = new jspdf.jsPDF({
|
11966
|
-
orientation: "p",
|
11967
|
-
unit: "px",
|
11968
|
-
format: "a4"
|
11969
|
-
});
|
11970
|
-
var WIDTH_PAPER = doc.internal.pageSize.width;
|
11971
|
-
var HEIGHT_PAPER = doc.internal.pageSize.height;
|
11972
|
-
var line = 0;
|
11973
|
-
var breakPage = function breakPage() {
|
11974
|
-
doc.addPage();
|
11975
|
-
line = 20;
|
11976
|
-
};
|
11977
|
-
var imgWidth = WIDTH_PAPER;
|
11978
|
-
var chartWidth = WIDTH_PAPER - 20;
|
11979
|
-
return Promise.resolve(html2canvas(headerCanvas)).then(function (header) {
|
11980
|
-
function _temp22() {
|
11981
|
-
function _temp20(_createRecentUserActi2) {
|
11982
|
-
_createRecentUserActi2;
|
11983
|
-
}
|
11984
|
-
doc.save("download.pdf");
|
11985
|
-
return isStudent ? _temp20(!isStudent && createRecentUserActionListApi({
|
11986
|
-
userId: studentId,
|
11987
|
-
action: RecentUserAction$1.PrintedExamResult,
|
11988
|
-
data: "" + examSessionId,
|
11989
|
-
roles: [exports.Role.Teacher]
|
11990
|
-
})) : Promise.resolve(!isStudent && createRecentUserActionListApi({
|
11991
|
-
userId: studentId,
|
11992
|
-
action: RecentUserAction$1.PrintedExamResult,
|
11993
|
-
data: "" + examSessionId,
|
11994
|
-
roles: [exports.Role.Teacher]
|
11995
|
-
})).then(_temp20);
|
11996
|
-
}
|
11997
|
-
var imgHeaderHeight = header.height * imgWidth / header.width;
|
11998
|
-
var imgHeaderData = header.toDataURL('image/png');
|
11999
|
-
doc.addImage(imgHeaderData, 'PNG', 0, 0, imgWidth, imgHeaderHeight);
|
12000
|
-
line += imgHeaderHeight;
|
12001
|
-
if (line > HEIGHT_PAPER) breakPage();
|
12002
|
-
var _temp21 = function () {
|
12003
|
-
if (canvas && canvas.childElementCount > 0) {
|
12004
|
-
var _index = 0;
|
12005
|
-
var _temp19 = _for(function () {
|
12006
|
-
return _index < canvas.childElementCount;
|
12007
|
-
}, function () {
|
12008
|
-
return _index++;
|
12009
|
-
}, function () {
|
12010
|
-
function _temp18() {
|
12011
|
-
function _temp16() {
|
12012
|
-
line += 20;
|
12013
|
-
}
|
12014
|
-
var printChartTitle = function printChartTitle() {
|
12015
|
-
try {
|
12016
|
-
if (chartTitleData && chartTitleHeight) {
|
12017
|
-
if (line + chartTitleHeight + 10 > HEIGHT_PAPER) breakPage();else line + 10;
|
12018
|
-
doc.addImage(chartTitleData, 'PNG', 10, line, chartWidth, chartTitleHeight);
|
12019
|
-
line += chartTitleHeight;
|
12020
|
-
}
|
12021
|
-
return Promise.resolve();
|
12022
|
-
} catch (e) {
|
12023
|
-
return Promise.reject(e);
|
12024
|
-
}
|
12025
|
-
};
|
12026
|
-
var _temp15 = function () {
|
12027
|
-
if (printContainerEls.length) {
|
12028
|
-
var _temp14 = _forTo(printContainerEls, function (i) {
|
12029
|
-
function _temp13() {
|
12030
|
-
function _temp11() {
|
12031
|
-
var printTitle = function printTitle() {
|
12032
|
-
try {
|
12033
|
-
if (!printTitleHeight || !printTitleData) return Promise.resolve();
|
12034
|
-
doc.addImage(printTitleData, 'PNG', 0, line, chartWidth, printTitleHeight);
|
12035
|
-
line += printTitleHeight;
|
12036
|
-
return Promise.resolve();
|
12037
|
-
} catch (e) {
|
12038
|
-
return Promise.reject(e);
|
12039
|
-
}
|
12040
|
-
};
|
12041
|
-
var printHeader = function printHeader(top) {
|
12042
|
-
if (top === void 0) {
|
12043
|
-
top = 0;
|
12044
|
-
}
|
12045
|
-
try {
|
12046
|
-
if (!printHeaderData || !printHeaderHeight) return Promise.resolve();
|
12047
|
-
line += top;
|
12048
|
-
if (line + printHeaderHeight > HEIGHT_PAPER) breakPage();
|
12049
|
-
doc.addImage(printHeaderData, 'PNG', 10, line, chartWidth, printHeaderHeight);
|
12050
|
-
line += printHeaderHeight;
|
12051
|
-
return Promise.resolve();
|
12052
|
-
} catch (e) {
|
12053
|
-
return Promise.reject(e);
|
12054
|
-
}
|
12055
|
-
};
|
12056
|
-
var printContents = printContainerEl.querySelectorAll("." + PrintContentClassName);
|
12057
|
-
if (!printContents.length) return;
|
12058
|
-
printTitle();
|
12059
|
-
var _temp9 = _forTo(printContents, function (j) {
|
12060
|
-
var rowItem = printContents[j];
|
12061
|
-
return Promise.resolve(html2canvas(rowItem)).then(function (rowItemCanvas) {
|
12062
|
-
function _temp8() {
|
12063
|
-
doc.addImage(data, 'PNG', 10, line, chartWidth, height);
|
12064
|
-
line += height;
|
12065
|
-
}
|
12066
|
-
var height = rowItemCanvas.height * chartWidth / rowItemCanvas.width;
|
12067
|
-
var data = rowItemCanvas.toDataURL('image/png');
|
12068
|
-
if (i === 0 && j === 0 && line + height + (printHeaderHeight || 0) + ((chartTitleHeight || 0) + 10) + 20 > HEIGHT_PAPER) breakPage();
|
12069
|
-
i === 0 && j === 0 && printChartTitle();
|
12070
|
-
var _temp7 = function () {
|
12071
|
-
if (line + height + 20 > HEIGHT_PAPER) {
|
12072
|
-
breakPage();
|
12073
|
-
return Promise.resolve(printHeader()).then(function () {});
|
12074
|
-
} else {
|
12075
|
-
var _temp25 = function () {
|
12076
|
-
if (j === 0) {
|
12077
|
-
return Promise.resolve(printHeader(10)).then(function () {});
|
12078
|
-
}
|
12079
|
-
}();
|
12080
|
-
if (_temp25 && _temp25.then) return _temp25.then(function () {});
|
12081
|
-
}
|
12082
|
-
}();
|
12083
|
-
return _temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7);
|
12084
|
-
});
|
12085
|
-
});
|
12086
|
-
if (_temp9 && _temp9.then) return _temp9.then(function () {});
|
12087
|
-
}
|
12088
|
-
var _temp10 = function () {
|
12089
|
-
if (printHeaderEl) {
|
12090
|
-
return Promise.resolve(html2canvas(printHeaderEl)).then(function (_html2canvas3) {
|
12091
|
-
printHeaderCanvas = _html2canvas3;
|
12092
|
-
printHeaderHeight = printHeaderCanvas.height * chartWidth / printHeaderCanvas.width;
|
12093
|
-
printHeaderData = printHeaderCanvas.toDataURL('image/png');
|
12094
|
-
});
|
12095
|
-
}
|
12096
|
-
}();
|
12097
|
-
return _temp10 && _temp10.then ? _temp10.then(_temp11) : _temp11(_temp10);
|
12098
|
-
}
|
12099
|
-
var printContainerEl = printContainerEls[i];
|
12100
|
-
var printTitleEl = printContainerEl.querySelector("." + PrintTitleClassName);
|
12101
|
-
var printHeaderEl = printContainerEl.querySelector("." + PrintHeaderClassName);
|
12102
|
-
var printTitleCanvas = null;
|
12103
|
-
var printTitleHeight = null;
|
12104
|
-
var printTitleData = "";
|
12105
|
-
var printHeaderCanvas = null;
|
12106
|
-
var printHeaderHeight = null;
|
12107
|
-
var printHeaderData = "";
|
12108
|
-
var _temp12 = function () {
|
12109
|
-
if (printTitleEl) {
|
12110
|
-
return Promise.resolve(html2canvas(printTitleEl)).then(function (_html2canvas2) {
|
12111
|
-
printTitleCanvas = _html2canvas2;
|
12112
|
-
printTitleHeight = printTitleCanvas.height * chartWidth / printTitleCanvas.width;
|
12113
|
-
printTitleData = printTitleCanvas.toDataURL('image/png');
|
12114
|
-
});
|
12115
|
-
}
|
12116
|
-
}();
|
12117
|
-
return _temp12 && _temp12.then ? _temp12.then(_temp13) : _temp13(_temp12);
|
12118
|
-
});
|
12119
|
-
if (_temp14 && _temp14.then) return _temp14.then(function () {});
|
12120
|
-
} else {
|
12121
|
-
return Promise.resolve(html2canvas(chart)).then(function (chartCanvas) {
|
12122
|
-
var imgBodyHeight = chartCanvas.height * chartWidth / chartCanvas.width;
|
12123
|
-
var imgBodyData = chartCanvas.toDataURL('image/png');
|
12124
|
-
line += 10;
|
12125
|
-
if (line + imgBodyHeight + 20 + (chartTitleHeight || 0) > HEIGHT_PAPER) breakPage();
|
12126
|
-
printChartTitle();
|
12127
|
-
doc.addImage(imgBodyData, 'PNG', 10, line, chartWidth, imgBodyHeight);
|
12128
|
-
line += imgBodyHeight;
|
12129
|
-
});
|
12130
|
-
}
|
12131
|
-
}();
|
12132
|
-
return _temp15 && _temp15.then ? _temp15.then(_temp16) : _temp16(_temp15);
|
12133
|
-
}
|
12134
|
-
var chart = canvas.children.item(_index);
|
12135
|
-
if (chart.getAttribute("id") === "header-canvas") return;
|
12136
|
-
var chartTitle = chart.querySelector(".chart-title");
|
12137
|
-
var printContainerEls = chart.querySelectorAll("." + PrintContainerClassName);
|
12138
|
-
var printChartTitleCanvas = null;
|
12139
|
-
var chartTitleHeight = null;
|
12140
|
-
var chartTitleData = "";
|
12141
|
-
var _temp17 = function () {
|
12142
|
-
if (chartTitle && printContainerEls.length) {
|
12143
|
-
return Promise.resolve(html2canvas(chartTitle)).then(function (_html2canvas) {
|
12144
|
-
printChartTitleCanvas = _html2canvas;
|
12145
|
-
chartTitleHeight = printChartTitleCanvas.height * chartWidth / printChartTitleCanvas.width;
|
12146
|
-
chartTitleData = printChartTitleCanvas.toDataURL('image/png');
|
12147
|
-
});
|
12148
|
-
}
|
12149
|
-
}();
|
12150
|
-
return _temp17 && _temp17.then ? _temp17.then(_temp18) : _temp18(_temp17);
|
12151
|
-
});
|
12152
|
-
if (_temp19 && _temp19.then) return _temp19.then(function () {});
|
12153
|
-
}
|
12154
|
-
}();
|
12155
|
-
return _temp21 && _temp21.then ? _temp21.then(_temp22) : _temp22(_temp21);
|
12156
|
-
});
|
12157
|
-
}, function (error) {
|
12158
|
-
console.log({
|
12159
|
-
error: error
|
12160
|
-
});
|
12161
|
-
reactToastify.toast.error(getErrorMessage(t, error));
|
12162
|
-
});
|
12163
|
-
return Promise.resolve(_temp23 && _temp23.then ? _temp23.then(_temp24) : _temp24(_temp23));
|
12164
|
-
} catch (e) {
|
12165
|
-
return Promise.reject(e);
|
12166
|
-
}
|
12167
|
-
};
|
12168
11823
|
React.useEffect(function () {
|
12169
11824
|
setDataChartIndex(0);
|
12170
11825
|
}, [selectedTab]);
|
@@ -12187,11 +11842,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
12187
11842
|
timelyOrderQuestions: timelyOrderQuestions,
|
12188
11843
|
openProblem: openProblem,
|
12189
11844
|
categoryResponses: categoryResponses,
|
11845
|
+
errorMessage: errorMessage,
|
12190
11846
|
setOpenProblem: setOpenProblem,
|
12191
11847
|
handlePrevChart: handlePrevChart,
|
12192
11848
|
handleNextChart: handleNextChart,
|
12193
|
-
handleExit: handleExit
|
12194
|
-
handleExportPdf: handleExportPdf
|
11849
|
+
handleExit: handleExit
|
12195
11850
|
};
|
12196
11851
|
};
|
12197
11852
|
|
@@ -13308,7 +12963,7 @@ Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==t
|
|
13308
12963
|
|
13309
12964
|
var ReactApexChart = unwrapExports(reactApexcharts_min);
|
13310
12965
|
|
13311
|
-
var styles$4 = {"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","titleBox":"_1dveO","title":"_mxRxf","point":"_2fD-F","buttonGroup":"_2DGl3","btnFeedback":"_xGW1x","btnTerminate":"_3mLu2","myanswer":"_eDBpS","titleMyAnswer1":"_2fMq3","titleMyAnswer2":"_3gEYh","contentMyAnswer":"_2K_sx","myAnswerItem":"_2qiLh","time":"_6TCOK","timeCol":"_hmseC","answer-response":"_3GfJt","answer-response-0":"_3ut64","answer-response-1":"_2VtpD","answer-response-2":"_58lQU","answer-response-3":"_1ucMY","answer-response-4":"_1qkxy","answerCorrect":"_2jIeT","answerIncorrect":"_to2v0","answerNograss":"_1JSte","answerEasy":"_2_uTU","answerDiscrimination":"_1DBoA","answerTrap":"_1q3tD","answerNoTime":"_3iItu","questionOrder":"_1fNkS","myTimeLabel":"_1Z_F3","myPoolTime":"_4KwG0","topTimeLabel":"_245H-","topTime":"_3tZqw","meanTimeLabel":"_PlPLY","meanTime":"_12a7R","compareChart":"_3MW16","prevChart":"_1fNkb","chart":"_3K4oY","nextChart":"_3YKBp","titleChart":"_13BVP","titleCompareGrass":"_o1txm","tableCompareGrass":"_bT5nf","thcolumn1":"_3Umg0","tdcolumn1":"_3dRMF","tdcolumn3":"_2tcBP","classification":"_1AFeb","wrapperProblem":"_oTqG7","titleProblem":"_35eIx","titleProblemClose":"_3t4HO","titleTrickyProblem":"_1-oxK","wrongQuestions":"_2dpMR","question":"_1lSOX","assignedQuestions":"_1ONUt","wrapperContent":"_nPoR0","content":"_2zmZn","contentColumn1":"_334SY","span1":"_3Lf-U","span2":"_ZpMot","contentColumn2":"_16P3l","duration":"_1kT28","topDuration":"_1fVRi","overallCorrectRate":"_3jLGe","answer":"_VsZ0K","contentVulnerable":"_QxKMy","wrappContentProblem":"_nnqpW","contentProblem":"_3Z1nV","labelProblem":"_36Xpx","name":"_3ZJQW","percent":"_2J3MK","slider":"_1MPdO","track":"_3CV_y","noData":"__g-ff","loading":"_3j485","table-responsive":"_2O6RX","form-label":"_1RYOQ","form-control":"_3VRVT","form-label-dialog":"_3oCSh","btn-cancel":"_3USKq","btn-register":"_3y_iD","pdfBtnBox":"_3xZHo","pdfBtn":"_1DtWq","form-select":"_1a_vw"};
|
12966
|
+
var styles$4 = {"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","titleBox":"_1dveO","title":"_mxRxf","point":"_2fD-F","buttonGroup":"_2DGl3","btnFeedback":"_xGW1x","btnTerminate":"_3mLu2","myanswer":"_eDBpS","titleMyAnswer1":"_2fMq3","titleMyAnswer2":"_3gEYh","contentMyAnswer":"_2K_sx","myAnswerItem":"_2qiLh","time":"_6TCOK","timeCol":"_hmseC","answer-response":"_3GfJt","answer-response-0":"_3ut64","answer-response-1":"_2VtpD","answer-response-2":"_58lQU","answer-response-3":"_1ucMY","answer-response-4":"_1qkxy","answerCorrect":"_2jIeT","answerIncorrect":"_to2v0","answerNograss":"_1JSte","answerEasy":"_2_uTU","answerDiscrimination":"_1DBoA","answerTrap":"_1q3tD","answerNoTime":"_3iItu","questionOrder":"_1fNkS","myTimeLabel":"_1Z_F3","myPoolTime":"_4KwG0","topTimeLabel":"_245H-","topTime":"_3tZqw","meanTimeLabel":"_PlPLY","meanTime":"_12a7R","compareChart":"_3MW16","prevChart":"_1fNkb","chart":"_3K4oY","nextChart":"_3YKBp","titleChart":"_13BVP","titleCompareGrass":"_o1txm","tableCompareGrass":"_bT5nf","thcolumn1":"_3Umg0","tdcolumn1":"_3dRMF","tdcolumn3":"_2tcBP","classification":"_1AFeb","wrapperProblem":"_oTqG7","titleProblem":"_35eIx","titleProblemClose":"_3t4HO","titleTrickyProblem":"_1-oxK","wrongQuestions":"_2dpMR","question":"_1lSOX","assignedQuestions":"_1ONUt","wrapperContent":"_nPoR0","content":"_2zmZn","contentColumn1":"_334SY","span1":"_3Lf-U","span2":"_ZpMot","contentColumn2":"_16P3l","duration":"_1kT28","topDuration":"_1fVRi","overallCorrectRate":"_3jLGe","answer":"_VsZ0K","contentVulnerable":"_QxKMy","wrappContentProblem":"_nnqpW","contentProblem":"_3Z1nV","labelProblem":"_36Xpx","name":"_3ZJQW","percent":"_2J3MK","slider":"_1MPdO","track":"_3CV_y","noData":"__g-ff","loading":"_3j485","table-responsive":"_2O6RX","form-label":"_1RYOQ","form-control":"_3VRVT","form-label-dialog":"_3oCSh","btn-cancel":"_3USKq","btn-register":"_3y_iD","pdfBtnBox":"_3xZHo","pdfBtn":"_1DtWq","form-select":"_1a_vw","loader":"_2uC7T","dot":"_Xz-Mr","bounce":"_3THgz"};
|
13312
12967
|
|
13313
12968
|
var iconStarQuestion = function iconStarQuestion(_ref) {
|
13314
12969
|
var _ref$width = _ref.width,
|
@@ -13699,8 +13354,7 @@ function CreateNewQuestionDialog(_ref) {
|
|
13699
13354
|
function MyAnswer(_ref) {
|
13700
13355
|
var data = _ref.data,
|
13701
13356
|
categories = _ref.categories,
|
13702
|
-
isStudent = _ref.isStudent
|
13703
|
-
isPrint = _ref.isPrint;
|
13357
|
+
isStudent = _ref.isStudent;
|
13704
13358
|
var _useCreateQuestionDia = useCreateQuestionDialog({
|
13705
13359
|
questions: data.questions
|
13706
13360
|
}),
|
@@ -13828,24 +13482,12 @@ function MyAnswer(_ref) {
|
|
13828
13482
|
})))));
|
13829
13483
|
});
|
13830
13484
|
};
|
13831
|
-
var renderPrintQuestions = function renderPrintQuestions(questions) {
|
13832
|
-
var chunkedQuestions = _.chunk(questions, 10);
|
13833
|
-
return chunkedQuestions.map(function (i, index) {
|
13834
|
-
return React__default.createElement("div", {
|
13835
|
-
key: index,
|
13836
|
-
className: PrintContentClassName
|
13837
|
-
}, renderQuestions(i));
|
13838
|
-
});
|
13839
|
-
};
|
13840
13485
|
return React__default.createElement("div", {
|
13841
13486
|
className: styles$4["myanswer"]
|
13842
13487
|
}, formattedData && formattedData.length > 0 && formattedData.map(function (item) {
|
13843
13488
|
return React__default.createElement("div", {
|
13844
|
-
key: item.category.id
|
13845
|
-
|
13846
|
-
}, React__default.createElement("div", {
|
13847
|
-
className: isPrint ? PrintHeaderClassName : ""
|
13848
|
-
}, React__default.createElement(material.Stack, {
|
13489
|
+
key: item.category.id
|
13490
|
+
}, React__default.createElement("div", null, React__default.createElement(material.Stack, {
|
13849
13491
|
bgcolor: "#F9FAFB",
|
13850
13492
|
flexDirection: "row",
|
13851
13493
|
padding: "12px",
|
@@ -13857,6 +13499,7 @@ function MyAnswer(_ref) {
|
|
13857
13499
|
gap: "4px"
|
13858
13500
|
}
|
13859
13501
|
}, React__default.createElement(material.Typography, {
|
13502
|
+
paddingInline: "4px",
|
13860
13503
|
sx: {
|
13861
13504
|
fontSize: "13px",
|
13862
13505
|
fontWeight: 600,
|
@@ -13871,6 +13514,7 @@ function MyAnswer(_ref) {
|
|
13871
13514
|
gap: "4px"
|
13872
13515
|
}
|
13873
13516
|
}, React__default.createElement(material.Typography, {
|
13517
|
+
paddingInline: "4px",
|
13874
13518
|
sx: {
|
13875
13519
|
fontSize: "13px",
|
13876
13520
|
fontWeight: 600,
|
@@ -13885,6 +13529,7 @@ function MyAnswer(_ref) {
|
|
13885
13529
|
gap: "4px"
|
13886
13530
|
}
|
13887
13531
|
}, React__default.createElement(material.Typography, {
|
13532
|
+
paddingInline: "4px",
|
13888
13533
|
sx: {
|
13889
13534
|
fontSize: "13px",
|
13890
13535
|
fontWeight: 600,
|
@@ -13900,6 +13545,7 @@ function MyAnswer(_ref) {
|
|
13900
13545
|
gap: "4px"
|
13901
13546
|
}
|
13902
13547
|
}, React__default.createElement(material.Typography, {
|
13548
|
+
paddingInline: "4px",
|
13903
13549
|
sx: {
|
13904
13550
|
fontSize: "13px",
|
13905
13551
|
fontWeight: 600,
|
@@ -13915,6 +13561,7 @@ function MyAnswer(_ref) {
|
|
13915
13561
|
gap: "4px"
|
13916
13562
|
}
|
13917
13563
|
}, React__default.createElement(material.Typography, {
|
13564
|
+
paddingInline: "4px",
|
13918
13565
|
sx: {
|
13919
13566
|
fontSize: "13px",
|
13920
13567
|
fontWeight: 600,
|
@@ -13937,7 +13584,7 @@ function MyAnswer(_ref) {
|
|
13937
13584
|
}
|
13938
13585
|
}, item.category.name))), React__default.createElement("div", {
|
13939
13586
|
className: styles$4["contentMyAnswer"]
|
13940
|
-
},
|
13587
|
+
}, renderQuestions(item.questions)));
|
13941
13588
|
}), React__default.createElement(CreateNewQuestionDialog, {
|
13942
13589
|
questionOptions: questionOptions,
|
13943
13590
|
questionOrderSelected: questionOrderSelected,
|
@@ -13991,8 +13638,7 @@ var iconBtnNextChart = function iconBtnNextChart(_ref) {
|
|
13991
13638
|
};
|
13992
13639
|
|
13993
13640
|
var CompareGrass = function CompareGrass(_ref) {
|
13994
|
-
var effectSize = _ref.effectSize
|
13995
|
-
isPrint = _ref.isPrint;
|
13641
|
+
var effectSize = _ref.effectSize;
|
13996
13642
|
var _useTranslation = reactI18next.useTranslation(),
|
13997
13643
|
t = _useTranslation.t;
|
13998
13644
|
var renderTableBody = function renderTableBody(effectSize) {
|
@@ -14055,17 +13701,8 @@ var CompareGrass = function CompareGrass(_ref) {
|
|
14055
13701
|
}))));
|
14056
13702
|
});
|
14057
13703
|
};
|
14058
|
-
var renderPrintTableBody = function renderPrintTableBody(effectSize) {
|
14059
|
-
var chunkedEffectSizeQuestions = _.chunk(effectSize, 10);
|
14060
|
-
return chunkedEffectSizeQuestions.map(function (i, index) {
|
14061
|
-
return React__default.createElement("tbody", {
|
14062
|
-
key: index,
|
14063
|
-
className: PrintContentClassName
|
14064
|
-
}, renderTableBody(i));
|
14065
|
-
});
|
14066
|
-
};
|
14067
13704
|
return React__default.createElement("div", {
|
14068
|
-
className: styles$4["compareGrass"]
|
13705
|
+
className: "" + styles$4["compareGrass"]
|
14069
13706
|
}, React__default.createElement("div", {
|
14070
13707
|
className: styles$4["tableCompareGrass"]
|
14071
13708
|
}, React__default.createElement("div", {
|
@@ -14077,8 +13714,7 @@ var CompareGrass = function CompareGrass(_ref) {
|
|
14077
13714
|
}, React__default.createElement("thead", {
|
14078
13715
|
style: {
|
14079
13716
|
borderBottom: "1px solid #E4E7EC"
|
14080
|
-
}
|
14081
|
-
className: isPrint ? PrintHeaderClassName : ""
|
13717
|
+
}
|
14082
13718
|
}, React__default.createElement("tr", null, React__default.createElement("th", {
|
14083
13719
|
className: styles$4["thcolumn1"]
|
14084
13720
|
}, t("problem_number")), React__default.createElement("th", {
|
@@ -14097,7 +13733,7 @@ var CompareGrass = function CompareGrass(_ref) {
|
|
14097
13733
|
style: {
|
14098
13734
|
textAlign: "center"
|
14099
13735
|
}
|
14100
|
-
}, t("problem_classification")))),
|
13736
|
+
}, t("problem_classification")))), React__default.createElement("tbody", null, renderTableBody(effectSize))))));
|
14101
13737
|
};
|
14102
13738
|
|
14103
13739
|
var iconX = function iconX(_ref) {
|
@@ -14149,8 +13785,7 @@ var TrickyProblem = function TrickyProblem(_ref) {
|
|
14149
13785
|
var keyOpen = _ref.keyOpen,
|
14150
13786
|
data = _ref.data,
|
14151
13787
|
openProblem = _ref.openProblem,
|
14152
|
-
changeOpen = _ref.changeOpen
|
14153
|
-
isPrint = _ref.isPrint;
|
13788
|
+
changeOpen = _ref.changeOpen;
|
14154
13789
|
var _useTranslation = reactI18next.useTranslation(),
|
14155
13790
|
t = _useTranslation.t;
|
14156
13791
|
var isOpen = openProblem === keyOpen;
|
@@ -14189,45 +13824,12 @@ var TrickyProblem = function TrickyProblem(_ref) {
|
|
14189
13824
|
className: styles$4["noData"]
|
14190
13825
|
}, t("no_data"))));
|
14191
13826
|
};
|
14192
|
-
var renderPrintProblems = function renderPrintProblems() {
|
14193
|
-
return React__default.createElement(React.Fragment, null, React__default.createElement("div", {
|
14194
|
-
className: PrintContentClassName
|
14195
|
-
}, React__default.createElement("div", {
|
14196
|
-
className: styles$4["titleTrickyProblem"]
|
14197
|
-
}, React__default.createElement(iconX, null), React__default.createElement("span", null, t("incorrect_problem_among_the_starred_problems"))), React__default.createElement("div", {
|
14198
|
-
className: styles$4["wrongQuestions"]
|
14199
|
-
}, !!inCorrectQuestions.length && inCorrectQuestions.map(function (question) {
|
14200
|
-
return React__default.createElement("span", {
|
14201
|
-
key: question.id,
|
14202
|
-
className: styles$4["question"]
|
14203
|
-
}, t("number_question", {
|
14204
|
-
number: question.questionOrder + 1
|
14205
|
-
}));
|
14206
|
-
}), !data.questions.length && React__default.createElement("div", {
|
14207
|
-
className: styles$4["noData"]
|
14208
|
-
}, t("no_data")))), React__default.createElement("div", {
|
14209
|
-
className: PrintContentClassName
|
14210
|
-
}, React__default.createElement("div", {
|
14211
|
-
className: styles$4["titleTrickyProblem"]
|
14212
|
-
}, React__default.createElement(iconAssignedQuestions, null), React__default.createElement("span", null, t("correct_problem_among_the_starred_problems"))), React__default.createElement("div", {
|
14213
|
-
className: styles$4["assignedQuestions"]
|
14214
|
-
}, !!correctQuestions.length && correctQuestions.map(function (question) {
|
14215
|
-
return React__default.createElement("div", {
|
14216
|
-
key: question.id,
|
14217
|
-
className: styles$4["question"]
|
14218
|
-
}, t("number_question", {
|
14219
|
-
number: question.questionOrder + 1
|
14220
|
-
}));
|
14221
|
-
}), !data.questions.length && React__default.createElement("div", {
|
14222
|
-
className: styles$4["noData"]
|
14223
|
-
}, t("no_data")))));
|
14224
|
-
};
|
14225
13827
|
return React__default.createElement("div", {
|
14226
|
-
className: styles$4["wrapperProblem"]
|
13828
|
+
className: "" + styles$4["wrapperProblem"]
|
14227
13829
|
}, React__default.createElement("div", {
|
14228
|
-
className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"])
|
13830
|
+
className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
|
14229
13831
|
onClick: function onClick() {
|
14230
|
-
return changeOpen(isOpen ?
|
13832
|
+
return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
|
14231
13833
|
}
|
14232
13834
|
}, React__default.createElement(material.Typography, {
|
14233
13835
|
sx: {
|
@@ -14241,7 +13843,7 @@ var TrickyProblem = function TrickyProblem(_ref) {
|
|
14241
13843
|
}) : React__default.createElement(io5.IoChevronDown, {
|
14242
13844
|
size: 24,
|
14243
13845
|
color: styles$4.gray_300
|
14244
|
-
})), isOpen && React__default.createElement(React.Fragment, null,
|
13846
|
+
})), isOpen && React__default.createElement(React.Fragment, null, renderProblems()));
|
14245
13847
|
};
|
14246
13848
|
|
14247
13849
|
var ProtractedProblem = function ProtractedProblem(_ref) {
|
@@ -14249,7 +13851,6 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
|
|
14249
13851
|
data = _ref.data,
|
14250
13852
|
openProblem = _ref.openProblem,
|
14251
13853
|
changeOpen = _ref.changeOpen,
|
14252
|
-
isPrint = _ref.isPrint,
|
14253
13854
|
isMyStoryStudent = _ref.isMyStoryStudent;
|
14254
13855
|
var _useTranslation = reactI18next.useTranslation(),
|
14255
13856
|
t = _useTranslation.t;
|
@@ -14324,21 +13925,12 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
|
|
14324
13925
|
}, formatTimeSecond(item.topDuration, t)))));
|
14325
13926
|
});
|
14326
13927
|
};
|
14327
|
-
var renderPrintQuestions = function renderPrintQuestions() {
|
14328
|
-
var chunkedData = _.chunk(data, 5);
|
14329
|
-
return chunkedData.map(function (i, index) {
|
14330
|
-
return React__default.createElement("tbody", {
|
14331
|
-
key: index,
|
14332
|
-
className: PrintContentClassName
|
14333
|
-
}, isMyStoryStudent ? renderTableBody(i) : renderQuestions(i));
|
14334
|
-
});
|
14335
|
-
};
|
14336
13928
|
return React__default.createElement("div", {
|
14337
|
-
className: styles$4["wrapperProblem"]
|
13929
|
+
className: "" + styles$4["wrapperProblem"]
|
14338
13930
|
}, React__default.createElement("div", {
|
14339
|
-
className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"])
|
13931
|
+
className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
|
14340
13932
|
onClick: function onClick() {
|
14341
|
-
return changeOpen(isOpen ?
|
13933
|
+
return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
|
14342
13934
|
}
|
14343
13935
|
}, React__default.createElement(material.Stack, {
|
14344
13936
|
flexDirection: "row",
|
@@ -14374,8 +13966,7 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
|
|
14374
13966
|
}, isMyStoryStudent && React__default.createElement("thead", {
|
14375
13967
|
style: {
|
14376
13968
|
borderBottom: "1px solid #E4E7EC"
|
14377
|
-
}
|
14378
|
-
className: isPrint ? PrintHeaderClassName : ""
|
13969
|
+
}
|
14379
13970
|
}, React__default.createElement("tr", null, React__default.createElement("th", {
|
14380
13971
|
className: styles$4["thcolumn1"]
|
14381
13972
|
}, t("problem_number")), React__default.createElement("th", {
|
@@ -14390,26 +13981,29 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
|
|
14390
13981
|
style: {
|
14391
13982
|
textAlign: "center"
|
14392
13983
|
}
|
14393
|
-
}, t("time_comparison")))),
|
14394
|
-
className: styles$4["noData"]
|
13984
|
+
}, t("time_comparison")))), React__default.createElement("tbody", null, isMyStoryStudent ? renderTableBody(data) : renderQuestions(data))))) : React__default.createElement("div", {
|
13985
|
+
className: "" + styles$4["noData"]
|
14395
13986
|
}, t("no_data"))));
|
14396
13987
|
};
|
14397
13988
|
|
13989
|
+
var limitQuestions = 5;
|
13990
|
+
var correctRateThreshHold = 70;
|
14398
13991
|
var Vulnerable = function Vulnerable(_ref) {
|
14399
13992
|
var data = _ref.data,
|
14400
13993
|
keyOpen = _ref.keyOpen,
|
14401
13994
|
openProblem = _ref.openProblem,
|
14402
13995
|
changeOpen = _ref.changeOpen,
|
14403
|
-
isPrint = _ref.isPrint,
|
14404
13996
|
isMyStoryStudent = _ref.isMyStoryStudent;
|
14405
13997
|
var _useTranslation = reactI18next.useTranslation(),
|
14406
13998
|
t = _useTranslation.t;
|
14407
13999
|
var isOpen = openProblem === keyOpen;
|
14408
|
-
var incorrectQuestions =
|
14409
|
-
return
|
14410
|
-
|
14411
|
-
|
14412
|
-
|
14000
|
+
var incorrectQuestions = React.useMemo(function () {
|
14001
|
+
return data.questions.filter(function (i) {
|
14002
|
+
return i.selectedAnswers !== "" && i.isCorrect === false && i.isStar === false && i.overallCorrectRate >= correctRateThreshHold;
|
14003
|
+
}).sort(function (q1, q2) {
|
14004
|
+
return q2.overallCorrectRate === q1.overallCorrectRate ? q1.questionOrder - q2.questionOrder : q2.overallCorrectRate - q1.overallCorrectRate;
|
14005
|
+
}).slice(0, limitQuestions);
|
14006
|
+
}, [JSON.stringify(data.questions)]);
|
14413
14007
|
var renderTableBody = function renderTableBody(data) {
|
14414
14008
|
return data.map(function (item, index) {
|
14415
14009
|
return React__default.createElement("tr", {
|
@@ -14464,11 +14058,13 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
14464
14058
|
return questions.map(function (question) {
|
14465
14059
|
return React__default.createElement(material.Grid, {
|
14466
14060
|
container: true,
|
14061
|
+
flexWrap: "nowrap",
|
14467
14062
|
className: styles$4["content"],
|
14468
14063
|
key: question.id
|
14469
14064
|
}, React__default.createElement(material.Grid, {
|
14470
14065
|
item: true,
|
14471
14066
|
xs: 1.5,
|
14067
|
+
minWidth: "120px",
|
14472
14068
|
className: styles$4["contentColumn1"]
|
14473
14069
|
}, React__default.createElement("div", null, React__default.createElement("span", {
|
14474
14070
|
className: styles$4["span1"]
|
@@ -14495,22 +14091,14 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
14495
14091
|
}), ")"))));
|
14496
14092
|
});
|
14497
14093
|
};
|
14498
|
-
var
|
14499
|
-
|
14500
|
-
return chunkedQuestions.map(function (i, index) {
|
14501
|
-
return React__default.createElement("tbody", {
|
14502
|
-
key: index,
|
14503
|
-
className: PrintContentClassName
|
14504
|
-
}, isMyStoryStudent ? renderTableBody(i) : renderQuestions(i));
|
14505
|
-
});
|
14094
|
+
var handleToggle = function handleToggle() {
|
14095
|
+
changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
|
14506
14096
|
};
|
14507
14097
|
return React__default.createElement("div", {
|
14508
|
-
className: styles$4["wrapperProblem"]
|
14098
|
+
className: "" + styles$4["wrapperProblem"]
|
14509
14099
|
}, React__default.createElement("div", {
|
14510
|
-
className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"])
|
14511
|
-
onClick:
|
14512
|
-
return changeOpen(isOpen ? "" : keyOpen);
|
14513
|
-
}
|
14100
|
+
className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
|
14101
|
+
onClick: handleToggle
|
14514
14102
|
}, React__default.createElement(material.Stack, {
|
14515
14103
|
flexDirection: "row",
|
14516
14104
|
gap: "24px",
|
@@ -14537,16 +14125,15 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
14537
14125
|
className: styles$4["tableCompareGrass"]
|
14538
14126
|
}, React__default.createElement("div", {
|
14539
14127
|
className: styles$4["table-responsive"]
|
14540
|
-
}, React__default.createElement(material.Table, {
|
14128
|
+
}, isMyStoryStudent && React__default.createElement(material.Table, {
|
14541
14129
|
style: {
|
14542
14130
|
width: "100%",
|
14543
14131
|
marginBottom: isMyStoryStudent ? "120px" : 0
|
14544
14132
|
}
|
14545
|
-
},
|
14133
|
+
}, React__default.createElement("thead", {
|
14546
14134
|
style: {
|
14547
14135
|
borderBottom: "1px solid #E4E7EC"
|
14548
|
-
}
|
14549
|
-
className: isPrint ? PrintHeaderClassName : ""
|
14136
|
+
}
|
14550
14137
|
}, React__default.createElement("tr", null, React__default.createElement("th", {
|
14551
14138
|
className: styles$4["thcolumn1"]
|
14552
14139
|
}, t("problem_number")), React__default.createElement("th", {
|
@@ -14565,23 +14152,44 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
14565
14152
|
style: {
|
14566
14153
|
textAlign: "center"
|
14567
14154
|
}
|
14568
|
-
}, t("_category")))),
|
14569
|
-
className: styles$4["noData"]
|
14155
|
+
}, t("_category")))), React__default.createElement("tbody", null, renderTableBody(incorrectQuestions))), !isMyStoryStudent && renderQuestions(incorrectQuestions))) : React__default.createElement("div", {
|
14156
|
+
className: "" + styles$4["noData"]
|
14570
14157
|
}, t("no_data"))));
|
14571
14158
|
};
|
14572
14159
|
|
14160
|
+
var AnswerResponseSignal;
|
14161
|
+
(function (AnswerResponseSignal) {
|
14162
|
+
AnswerResponseSignal[AnswerResponseSignal["Purple"] = 0] = "Purple";
|
14163
|
+
AnswerResponseSignal[AnswerResponseSignal["Red"] = 1] = "Red";
|
14164
|
+
AnswerResponseSignal[AnswerResponseSignal["Yellow"] = 2] = "Yellow";
|
14165
|
+
AnswerResponseSignal[AnswerResponseSignal["Green"] = 3] = "Green";
|
14166
|
+
AnswerResponseSignal[AnswerResponseSignal["Black"] = 4] = "Black";
|
14167
|
+
})(AnswerResponseSignal || (AnswerResponseSignal = {}));
|
14168
|
+
var ProblemKey;
|
14169
|
+
(function (ProblemKey) {
|
14170
|
+
ProblemKey[ProblemKey["TrickyProblem"] = 0] = "TrickyProblem";
|
14171
|
+
ProblemKey[ProblemKey["ProtractedProblem"] = 1] = "ProtractedProblem";
|
14172
|
+
ProblemKey[ProblemKey["GradesByTerritory"] = 2] = "GradesByTerritory";
|
14173
|
+
ProblemKey[ProblemKey["Vulnerable"] = 3] = "Vulnerable";
|
14174
|
+
})(ProblemKey || (ProblemKey = {}));
|
14175
|
+
var PrintState;
|
14176
|
+
(function (PrintState) {
|
14177
|
+
PrintState[PrintState["Default"] = 0] = "Default";
|
14178
|
+
PrintState[PrintState["Printing"] = 1] = "Printing";
|
14179
|
+
PrintState[PrintState["Pending"] = 2] = "Pending";
|
14180
|
+
PrintState[PrintState["Printed"] = 3] = "Printed";
|
14181
|
+
})(PrintState || (PrintState = {}));
|
14182
|
+
|
14573
14183
|
var GradesByTerritory = function GradesByTerritory(_ref) {
|
14574
|
-
var
|
14575
|
-
data = _ref.data,
|
14184
|
+
var data = _ref.data,
|
14576
14185
|
openProblem = _ref.openProblem,
|
14577
14186
|
changeOpen = _ref.changeOpen,
|
14578
|
-
isPrint = _ref.isPrint,
|
14579
14187
|
resultData = _ref.resultData,
|
14580
14188
|
isMyStoryStudent = _ref.isMyStoryStudent;
|
14581
14189
|
var _useTranslation = reactI18next.useTranslation(),
|
14582
14190
|
t = _useTranslation.t;
|
14583
14191
|
var formattedData = totalSolveTimeCategories(resultData, data);
|
14584
|
-
var isOpen = openProblem ===
|
14192
|
+
var isOpen = openProblem === ProblemKey.GradesByTerritory;
|
14585
14193
|
var renderTableBody = function renderTableBody(data) {
|
14586
14194
|
return data.map(function (item, index) {
|
14587
14195
|
return React__default.createElement("tr", {
|
@@ -14655,21 +14263,12 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
|
|
14655
14263
|
}))));
|
14656
14264
|
});
|
14657
14265
|
};
|
14658
|
-
var renderPrintCategories = function renderPrintCategories() {
|
14659
|
-
var chunkedCategories = _.chunk(formattedData, 10);
|
14660
|
-
return chunkedCategories.map(function (i, index) {
|
14661
|
-
return React__default.createElement("tbody", {
|
14662
|
-
key: index,
|
14663
|
-
className: PrintContentClassName
|
14664
|
-
}, isMyStoryStudent ? renderTableBody(i) : renderCategories(i));
|
14665
|
-
});
|
14666
|
-
};
|
14667
14266
|
return React__default.createElement("div", {
|
14668
|
-
className: styles$4["wrapperProblem"]
|
14267
|
+
className: "" + styles$4["wrapperProblem"]
|
14669
14268
|
}, React__default.createElement("div", {
|
14670
|
-
className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"])
|
14269
|
+
className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
|
14671
14270
|
onClick: function onClick() {
|
14672
|
-
return changeOpen(isOpen ?
|
14271
|
+
return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : ProblemKey.GradesByTerritory);
|
14673
14272
|
}
|
14674
14273
|
}, React__default.createElement(material.Typography, {
|
14675
14274
|
sx: {
|
@@ -14687,16 +14286,15 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
|
|
14687
14286
|
className: styles$4["tableCompareGrass"]
|
14688
14287
|
}, React__default.createElement("div", {
|
14689
14288
|
className: styles$4["table-responsive"]
|
14690
|
-
}, React__default.createElement(material.Table, {
|
14289
|
+
}, isMyStoryStudent && React__default.createElement(material.Table, {
|
14691
14290
|
style: {
|
14692
14291
|
width: "100%",
|
14693
14292
|
marginBottom: isMyStoryStudent ? "120px" : 0
|
14694
14293
|
}
|
14695
|
-
},
|
14294
|
+
}, React__default.createElement("thead", {
|
14696
14295
|
style: {
|
14697
14296
|
borderBottom: "1px solid #E4E7EC"
|
14698
|
-
}
|
14699
|
-
className: isPrint ? PrintHeaderClassName : ""
|
14297
|
+
}
|
14700
14298
|
}, React__default.createElement("tr", null, React__default.createElement("th", {
|
14701
14299
|
className: styles$4["thcolumn1"]
|
14702
14300
|
}, t("categories")), React__default.createElement("th", {
|
@@ -14715,8 +14313,8 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
|
|
14715
14313
|
style: {
|
14716
14314
|
textAlign: "center"
|
14717
14315
|
}
|
14718
|
-
}, t("total_solve_time")))),
|
14719
|
-
className: styles$4["noData"]
|
14316
|
+
}, t("total_solve_time")))), React__default.createElement("tbody", null, renderTableBody(formattedData))), !isMyStoryStudent && renderCategories(formattedData))) : React__default.createElement("div", {
|
14317
|
+
className: "" + styles$4["noData"]
|
14720
14318
|
}, t("no_data"))));
|
14721
14319
|
};
|
14722
14320
|
|
@@ -14920,23 +14518,379 @@ var useTab = function useTab() {
|
|
14920
14518
|
};
|
14921
14519
|
};
|
14922
14520
|
|
14521
|
+
var usePrintExamResult = function usePrintExamResult(isDataFetching, fileName, totalChart, onSuccess, onError, autoPrint) {
|
14522
|
+
if (autoPrint === void 0) {
|
14523
|
+
autoPrint = false;
|
14524
|
+
}
|
14525
|
+
var contentRef = React.useRef(null);
|
14526
|
+
var _useState = React.useState([]),
|
14527
|
+
renderedCharts = _useState[0],
|
14528
|
+
setRenderedCharts = _useState[1];
|
14529
|
+
var _useTranslation = reactI18next.useTranslation(),
|
14530
|
+
t = _useTranslation.t;
|
14531
|
+
var _useState2 = React.useState(PrintState.Default),
|
14532
|
+
printState = _useState2[0],
|
14533
|
+
setPrintState = _useState2[1];
|
14534
|
+
var setRenderedChart = function setRenderedChart(chart) {
|
14535
|
+
setRenderedCharts(function (state) {
|
14536
|
+
return [].concat(state, [chart]);
|
14537
|
+
});
|
14538
|
+
};
|
14539
|
+
var reset = function reset() {
|
14540
|
+
setRenderedCharts([]);
|
14541
|
+
setPrintState(PrintState.Default);
|
14542
|
+
};
|
14543
|
+
var autoPrintPdf = function autoPrintPdf() {
|
14544
|
+
if (printState === PrintState.Printing) return;
|
14545
|
+
if (autoPrint && printState !== PrintState.Default) return;
|
14546
|
+
if (totalChart !== renderedCharts.length) {
|
14547
|
+
!autoPrint && setPrintState(PrintState.Pending);
|
14548
|
+
return;
|
14549
|
+
}
|
14550
|
+
var name = !fileName ? "Exam-Result_" + new Date().getTime() : fileName;
|
14551
|
+
if (contentRef.current && contentRef.current != null) {
|
14552
|
+
setPrintState(PrintState.Printing);
|
14553
|
+
setTimeout(function () {
|
14554
|
+
try {
|
14555
|
+
var _temp2 = function _temp2() {
|
14556
|
+
setPrintState(PrintState.Printed);
|
14557
|
+
};
|
14558
|
+
var _temp = _catch(function () {
|
14559
|
+
var element = contentRef.current;
|
14560
|
+
var options = {
|
14561
|
+
margin: 5,
|
14562
|
+
filename: name + ".pdf",
|
14563
|
+
html2canvas: {
|
14564
|
+
scale: 2
|
14565
|
+
},
|
14566
|
+
jsPDF: {
|
14567
|
+
format: 'a4',
|
14568
|
+
orientation: 'portrait'
|
14569
|
+
},
|
14570
|
+
pagebreak: {
|
14571
|
+
mode: ['avoid-all', 'css', 'legacy']
|
14572
|
+
}
|
14573
|
+
};
|
14574
|
+
return Promise.resolve(html2pdf().from(element).set(options).save()).then(function () {
|
14575
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
14576
|
+
});
|
14577
|
+
}, function (error) {
|
14578
|
+
!window.opener && reactToastify.toast.error(getErrorMessage(t, error));
|
14579
|
+
onError === null || onError === void 0 ? void 0 : onError(error === null || error === void 0 ? void 0 : error.message);
|
14580
|
+
});
|
14581
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
14582
|
+
} catch (e) {
|
14583
|
+
return Promise.reject(e);
|
14584
|
+
}
|
14585
|
+
}, 300);
|
14586
|
+
}
|
14587
|
+
};
|
14588
|
+
var handlePrintPdf = function handlePrintPdf() {
|
14589
|
+
autoPrintPdf();
|
14590
|
+
};
|
14591
|
+
React.useEffect(function () {
|
14592
|
+
(autoPrint || printState === PrintState.Pending) && isDataFetching === false && autoPrintPdf();
|
14593
|
+
}, [totalChart, renderedCharts.length, fileName, autoPrint, printState, isDataFetching]);
|
14594
|
+
React.useEffect(function () {
|
14595
|
+
isDataFetching && reset();
|
14596
|
+
}, [isDataFetching]);
|
14597
|
+
return {
|
14598
|
+
contentRef: contentRef,
|
14599
|
+
printState: printState,
|
14600
|
+
setRenderedChart: setRenderedChart,
|
14601
|
+
handlePrintPdf: handlePrintPdf,
|
14602
|
+
reset: reset
|
14603
|
+
};
|
14604
|
+
};
|
14605
|
+
|
14606
|
+
var printStyles = {"page-break":"_35kyG","print-exact-color":"_1PFgl","avoid-break-inside":"_3rPGh"};
|
14607
|
+
|
14608
|
+
var TimeOrderChart = function TimeOrderChart(_ref) {
|
14609
|
+
var timelyOrderQuestion = _ref.timelyOrderQuestion,
|
14610
|
+
options = _ref.options,
|
14611
|
+
series = _ref.series,
|
14612
|
+
setIsRendered = _ref.setIsRendered;
|
14613
|
+
var _useTranslation = reactI18next.useTranslation(),
|
14614
|
+
t = _useTranslation.t;
|
14615
|
+
var chartRef = React.useRef(null);
|
14616
|
+
var chartOptions = _extends({}, options, {
|
14617
|
+
chart: _extends({}, options.chart, {
|
14618
|
+
animations: {
|
14619
|
+
enabled: false
|
14620
|
+
}
|
14621
|
+
})
|
14622
|
+
});
|
14623
|
+
React.useEffect(function () {
|
14624
|
+
if (chartRef.current) {
|
14625
|
+
setIsRendered(timelyOrderQuestion.article);
|
14626
|
+
}
|
14627
|
+
}, [timelyOrderQuestion.article]);
|
14628
|
+
return React__default.createElement("div", {
|
14629
|
+
className: "" + printStyles["avoid-break-inside"]
|
14630
|
+
}, React__default.createElement(material.Typography, {
|
14631
|
+
className: "pb-2",
|
14632
|
+
sx: {
|
14633
|
+
fontSize: "14px",
|
14634
|
+
fontWeight: 700,
|
14635
|
+
color: "#414E62"
|
14636
|
+
}
|
14637
|
+
}, t("article_number"), " ", timelyOrderQuestion.article), React__default.createElement("div", {
|
14638
|
+
className: "" + styles$4["compareChart"]
|
14639
|
+
}, React__default.createElement("div", {
|
14640
|
+
className: "" + styles$4["prevChart"]
|
14641
|
+
}), React__default.createElement("div", {
|
14642
|
+
className: styles$4["chart"] + " sr-line-chart"
|
14643
|
+
}, React__default.createElement("div", null, React__default.createElement(ReactApexChart, {
|
14644
|
+
ref: chartRef,
|
14645
|
+
height: 389,
|
14646
|
+
options: chartOptions,
|
14647
|
+
series: series
|
14648
|
+
}))), React__default.createElement("div", {
|
14649
|
+
className: "" + styles$4["nextChart"]
|
14650
|
+
})));
|
14651
|
+
};
|
14652
|
+
|
14653
|
+
var textStyle = {
|
14654
|
+
fontSize: "18px",
|
14655
|
+
fontWeight: 700,
|
14656
|
+
color: styles.gray_500
|
14657
|
+
};
|
14658
|
+
var courseNameStyle = {
|
14659
|
+
fontSize: "14px",
|
14660
|
+
fontWeight: 600,
|
14661
|
+
color: styles.less_dark
|
14662
|
+
};
|
14663
|
+
var examTitleStyle = {
|
14664
|
+
fontSize: "20px",
|
14665
|
+
fontWeight: 600,
|
14666
|
+
color: styles.darker
|
14667
|
+
};
|
14668
|
+
var studentNameStyle = {
|
14669
|
+
fontSize: "24px",
|
14670
|
+
fontWeight: 600,
|
14671
|
+
color: styles.darker,
|
14672
|
+
lineHeight: 1
|
14673
|
+
};
|
14674
|
+
var PrintExamResult = function PrintExamResult(_ref) {
|
14675
|
+
var resultData = _ref.resultData,
|
14676
|
+
examTime = _ref.examTime,
|
14677
|
+
isStudent = _ref.isStudent,
|
14678
|
+
categoryResponses = _ref.categoryResponses,
|
14679
|
+
timelyOrderQuestions = _ref.timelyOrderQuestions,
|
14680
|
+
allChartOptions = _ref.allChartOptions,
|
14681
|
+
allSeries = _ref.allSeries,
|
14682
|
+
effectSize = _ref.effectSize,
|
14683
|
+
isMyStoryStudent = _ref.isMyStoryStudent,
|
14684
|
+
longTimeSpend = _ref.longTimeSpend,
|
14685
|
+
contentRef = _ref.contentRef,
|
14686
|
+
setRenderedChart = _ref.setRenderedChart;
|
14687
|
+
var academy = reactRedux.useSelector(function (state) {
|
14688
|
+
var _state$common;
|
14689
|
+
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.academy;
|
14690
|
+
});
|
14691
|
+
return React__default.createElement(material.Box, {
|
14692
|
+
sx: {
|
14693
|
+
minWidth: "768px",
|
14694
|
+
width: "768px",
|
14695
|
+
maxWidth: "768px!important",
|
14696
|
+
background: "#FFF",
|
14697
|
+
padding: "24px",
|
14698
|
+
overflow: "auto"
|
14699
|
+
},
|
14700
|
+
id: "canvas",
|
14701
|
+
className: printStyles["print-exact-color"] + " " + printStyles["container"],
|
14702
|
+
ref: contentRef
|
14703
|
+
}, React__default.createElement(material.Grid, {
|
14704
|
+
container: true,
|
14705
|
+
marginBottom: "24px"
|
14706
|
+
}, React__default.createElement(material.Grid, {
|
14707
|
+
item: true,
|
14708
|
+
xs: 12
|
14709
|
+
}, React__default.createElement(material.Stack, {
|
14710
|
+
direction: "row",
|
14711
|
+
justifyContent: "space-between",
|
14712
|
+
flexWrap: "nowrap",
|
14713
|
+
spacing: 1,
|
14714
|
+
marginBottom: "12px"
|
14715
|
+
}, React__default.createElement(material.Stack, {
|
14716
|
+
direction: "column"
|
14717
|
+
}, React__default.createElement(material.Typography, {
|
14718
|
+
sx: studentNameStyle
|
14719
|
+
}, resultData.student.fullName), React__default.createElement(material.Typography, {
|
14720
|
+
sx: {
|
14721
|
+
fontSize: "16px",
|
14722
|
+
fontWeight: 600,
|
14723
|
+
color: styles.gray_500
|
14724
|
+
}
|
14725
|
+
}, resultData.student.email)), academy && React__default.createElement(material.Typography, {
|
14726
|
+
sx: _extends({}, studentNameStyle, {
|
14727
|
+
textAlign: "end"
|
14728
|
+
})
|
14729
|
+
}, academy.name)), resultData.courseName && React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
14730
|
+
sx: courseNameStyle
|
14731
|
+
}, resultData.courseName)), React__default.createElement(material.Box, {
|
14732
|
+
display: "flex",
|
14733
|
+
gap: "16px",
|
14734
|
+
flexDirection: "column"
|
14735
|
+
}, React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
14736
|
+
sx: examTitleStyle
|
14737
|
+
}, resultData.title)), React__default.createElement(material.Stack, {
|
14738
|
+
flexDirection: "row",
|
14739
|
+
gap: "16px"
|
14740
|
+
}, React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
14741
|
+
sx: {
|
14742
|
+
fontSize: "13px",
|
14743
|
+
fontWeight: 600,
|
14744
|
+
color: styles.gray_500
|
14745
|
+
}
|
14746
|
+
}, i18n.t("my_score")), React__default.createElement(material.Typography, {
|
14747
|
+
sx: {
|
14748
|
+
fontSize: "14px",
|
14749
|
+
fontWeight: 600,
|
14750
|
+
color: styles.darker
|
14751
|
+
}
|
14752
|
+
}, i18n.t("score_format", {
|
14753
|
+
score: resultData === null || resultData === void 0 ? void 0 : resultData.score
|
14754
|
+
}))), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
14755
|
+
sx: {
|
14756
|
+
fontSize: "13px",
|
14757
|
+
fontWeight: 600,
|
14758
|
+
color: styles.gray_500
|
14759
|
+
}
|
14760
|
+
}, i18n.t("exam_date")), React__default.createElement(material.Typography, {
|
14761
|
+
sx: {
|
14762
|
+
fontSize: "14px",
|
14763
|
+
fontWeight: 600,
|
14764
|
+
color: styles.gray_700
|
14765
|
+
}
|
14766
|
+
}, utcToLocalTime(resultData === null || resultData === void 0 ? void 0 : resultData.startTime, i18n.t("date_format")))), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
14767
|
+
sx: {
|
14768
|
+
fontSize: "13px",
|
14769
|
+
fontWeight: 600,
|
14770
|
+
color: styles.gray_500
|
14771
|
+
}
|
14772
|
+
}, i18n.t("exam_time")), React__default.createElement(material.Typography, {
|
14773
|
+
sx: {
|
14774
|
+
fontSize: "14px",
|
14775
|
+
fontWeight: 600,
|
14776
|
+
color: styles.gray_700
|
14777
|
+
}
|
14778
|
+
}, examTime)), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
14779
|
+
sx: {
|
14780
|
+
fontSize: "13px",
|
14781
|
+
fontWeight: 600,
|
14782
|
+
color: styles.gray_500
|
14783
|
+
}
|
14784
|
+
}, i18n.t("total_students")), React__default.createElement(material.Typography, {
|
14785
|
+
sx: {
|
14786
|
+
fontSize: "14px",
|
14787
|
+
fontWeight: 600,
|
14788
|
+
color: styles.gray_700
|
14789
|
+
}
|
14790
|
+
}, i18n.t("number_people", {
|
14791
|
+
number: resultData === null || resultData === void 0 ? void 0 : resultData.totalStudent
|
14792
|
+
}))), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
14793
|
+
sx: {
|
14794
|
+
fontSize: "13px",
|
14795
|
+
fontWeight: 600,
|
14796
|
+
color: styles.gray_500
|
14797
|
+
}
|
14798
|
+
}, i18n.t("teacher_in_charge")), React__default.createElement(material.Typography, {
|
14799
|
+
sx: {
|
14800
|
+
fontSize: "14px",
|
14801
|
+
fontWeight: 600,
|
14802
|
+
color: styles.gray_700
|
14803
|
+
}
|
14804
|
+
}, resultData === null || resultData === void 0 ? void 0 : resultData.teacherName)))))), React__default.createElement(material.Stack, {
|
14805
|
+
display: "flex",
|
14806
|
+
flexDirection: "column",
|
14807
|
+
gap: "12px"
|
14808
|
+
}, React__default.createElement(material.Typography, {
|
14809
|
+
sx: textStyle
|
14810
|
+
}, i18n.t(TabList[0].label)), React__default.createElement(MyAnswer, {
|
14811
|
+
data: resultData,
|
14812
|
+
categories: categoryResponses,
|
14813
|
+
isStudent: isStudent
|
14814
|
+
})), React__default.createElement(material.Stack, {
|
14815
|
+
display: "flex",
|
14816
|
+
flexDirection: "column",
|
14817
|
+
gap: "12px",
|
14818
|
+
marginTop: "24px"
|
14819
|
+
}, React__default.createElement(material.Typography, {
|
14820
|
+
sx: textStyle
|
14821
|
+
}, i18n.t(TabList[1].label)), timelyOrderQuestions.map(function (timelyOrderQuestion, index) {
|
14822
|
+
return React__default.createElement(TimeOrderChart, {
|
14823
|
+
key: index,
|
14824
|
+
timelyOrderQuestion: timelyOrderQuestion,
|
14825
|
+
options: allChartOptions[index],
|
14826
|
+
series: allSeries[index],
|
14827
|
+
setIsRendered: setRenderedChart
|
14828
|
+
});
|
14829
|
+
})), React__default.createElement(material.Stack, {
|
14830
|
+
display: "flex",
|
14831
|
+
flexDirection: "column",
|
14832
|
+
gap: "12px",
|
14833
|
+
marginTop: "24px"
|
14834
|
+
}, React__default.createElement(material.Typography, {
|
14835
|
+
sx: textStyle
|
14836
|
+
}, i18n.t(TabList[2].label)), React__default.createElement(CompareGrass, {
|
14837
|
+
effectSize: effectSize
|
14838
|
+
})), React__default.createElement(material.Stack, {
|
14839
|
+
display: "flex",
|
14840
|
+
flexDirection: "column",
|
14841
|
+
gap: "12px",
|
14842
|
+
marginTop: "24px"
|
14843
|
+
}, React__default.createElement(material.Typography, {
|
14844
|
+
sx: textStyle
|
14845
|
+
}, i18n.t(TabList[3].label)), React__default.createElement(TrickyProblem, {
|
14846
|
+
keyOpen: ProblemKey.TrickyProblem,
|
14847
|
+
data: resultData,
|
14848
|
+
openProblem: ProblemKey.TrickyProblem
|
14849
|
+
}), React__default.createElement(Vulnerable, {
|
14850
|
+
keyOpen: ProblemKey.Vulnerable,
|
14851
|
+
data: resultData,
|
14852
|
+
openProblem: ProblemKey.Vulnerable,
|
14853
|
+
isMyStoryStudent: isMyStoryStudent
|
14854
|
+
}), React__default.createElement(ProtractedProblem, {
|
14855
|
+
keyOpen: ProblemKey.ProtractedProblem,
|
14856
|
+
data: longTimeSpend,
|
14857
|
+
openProblem: ProblemKey.ProtractedProblem,
|
14858
|
+
isMyStoryStudent: isMyStoryStudent
|
14859
|
+
}), React__default.createElement(GradesByTerritory, {
|
14860
|
+
data: categoryResponses,
|
14861
|
+
resultData: resultData,
|
14862
|
+
openProblem: ProblemKey.GradesByTerritory,
|
14863
|
+
isMyStoryStudent: isMyStoryStudent
|
14864
|
+
})));
|
14865
|
+
};
|
14866
|
+
|
14923
14867
|
var ExamResultV2 = function ExamResultV2(_ref) {
|
14924
14868
|
var searchParams = _ref.searchParams,
|
14925
14869
|
history = _ref.history,
|
14926
|
-
examSessionId = _ref.examSessionId,
|
14927
|
-
|
14870
|
+
_ref$examSessionId = _ref.examSessionId,
|
14871
|
+
examSessionId = _ref$examSessionId === void 0 ? 0 : _ref$examSessionId,
|
14872
|
+
_ref$studentId = _ref.studentId,
|
14873
|
+
studentId = _ref$studentId === void 0 ? 0 : _ref$studentId,
|
14928
14874
|
code = _ref.code,
|
14929
14875
|
isMyStoryStudent = _ref.isMyStoryStudent;
|
14930
14876
|
var _useTab = useTab(),
|
14931
14877
|
selected = _useTab.selected,
|
14932
14878
|
handleChangeTab = _useTab.handleChangeTab;
|
14933
|
-
var _useExamResult = useExamResult(
|
14879
|
+
var _useExamResult = useExamResult({
|
14880
|
+
searchParams: searchParams,
|
14881
|
+
history: history,
|
14882
|
+
examSessionId: examSessionId,
|
14883
|
+
studentId: studentId,
|
14884
|
+
code: code,
|
14885
|
+
handleChangeTab: handleChangeTab,
|
14886
|
+
selectedTab: selected
|
14887
|
+
}),
|
14934
14888
|
isLoading = _useExamResult.isLoading,
|
14935
14889
|
examTime = _useExamResult.examTime,
|
14936
14890
|
series = _useExamResult.series,
|
14937
14891
|
allSeries = _useExamResult.allSeries,
|
14938
|
-
chartOptions = _useExamResult.chartOptions,
|
14939
14892
|
allChartOptions = _useExamResult.allChartOptions,
|
14893
|
+
chartOptions = _useExamResult.chartOptions,
|
14940
14894
|
dataChartIndex = _useExamResult.dataChartIndex,
|
14941
14895
|
timelyOrderQuestions = _useExamResult.timelyOrderQuestions,
|
14942
14896
|
isStudent = _useExamResult.isStudent,
|
@@ -14945,7 +14899,6 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
14945
14899
|
longTimeSpend = _useExamResult.longTimeSpend,
|
14946
14900
|
effectSize = _useExamResult.effectSize,
|
14947
14901
|
categoryResponses = _useExamResult.categoryResponses,
|
14948
|
-
handleExportPdf = _useExamResult.handleExportPdf,
|
14949
14902
|
setOpenProblem = _useExamResult.setOpenProblem,
|
14950
14903
|
handlePrevChart = _useExamResult.handlePrevChart,
|
14951
14904
|
handleNextChart = _useExamResult.handleNextChart;
|
@@ -14955,9 +14908,15 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
14955
14908
|
handleCreateQuestion = _useCreateQuestionDia.handleCreateQuestion,
|
14956
14909
|
openCreateQuestionDialog = _useCreateQuestionDia.openCreateQuestionDialog,
|
14957
14910
|
toggleCreateQuestion = _useCreateQuestionDia.toggleCreateQuestion;
|
14911
|
+
var fileName = !resultData ? "" : "Exam-Result_" + resultData.student.fullName + "_" + resultData.title + "_(" + utcToLocalTime(resultData.startTime, "MM-DD-YYYY HH:mm") + ")";
|
14912
|
+
var _usePrintExamResult = usePrintExamResult(isLoading, fileName, timelyOrderQuestions.length),
|
14913
|
+
contentRef = _usePrintExamResult.contentRef,
|
14914
|
+
printState = _usePrintExamResult.printState,
|
14915
|
+
handlePrintPdf = _usePrintExamResult.handlePrintPdf,
|
14916
|
+
setRenderedChart = _usePrintExamResult.setRenderedChart;
|
14958
14917
|
var isTabletUp = material.useMediaQuery('(min-width:900px)');
|
14959
14918
|
return React__default.createElement(React.Fragment, null, React__default.createElement(LoadingComponent, {
|
14960
|
-
isLoading: isLoading
|
14919
|
+
isLoading: !!isLoading
|
14961
14920
|
}), timelyOrderQuestions[dataChartIndex] && longTimeSpend && resultData && effectSize ? React__default.createElement("div", {
|
14962
14921
|
style: {
|
14963
14922
|
width: "100%"
|
@@ -15073,7 +15032,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
15073
15032
|
className: styles$4["pdfBtnBox"]
|
15074
15033
|
}, React__default.createElement("button", {
|
15075
15034
|
className: styles$4["pdfBtn"] + " " + styles["truncate"],
|
15076
|
-
onClick:
|
15035
|
+
onClick: handlePrintPdf
|
15077
15036
|
}, React__default.createElement(iconPrintFill, null), React__default.createElement("p", null, t("print_all"))))))), React__default.createElement(material.Grid, {
|
15078
15037
|
item: true,
|
15079
15038
|
xs: 12
|
@@ -15119,7 +15078,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
15119
15078
|
className: styles$4["pdfBtnBox"]
|
15120
15079
|
}, React__default.createElement("button", {
|
15121
15080
|
className: styles$4["pdfBtn"] + " " + styles["truncate"],
|
15122
|
-
onClick:
|
15081
|
+
onClick: handlePrintPdf
|
15123
15082
|
}, React__default.createElement(iconPrintFill, null), React__default.createElement("p", null, t("print"))))))), React__default.createElement(material.Grid, {
|
15124
15083
|
item: true,
|
15125
15084
|
xs: 12
|
@@ -15156,240 +15115,54 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
15156
15115
|
value: selected,
|
15157
15116
|
index: 3
|
15158
15117
|
}, React__default.createElement(TrickyProblem, {
|
15159
|
-
keyOpen:
|
15118
|
+
keyOpen: ProblemKey.TrickyProblem,
|
15160
15119
|
data: resultData,
|
15161
15120
|
openProblem: openProblem,
|
15162
15121
|
changeOpen: setOpenProblem
|
15163
15122
|
}), React__default.createElement(Vulnerable, {
|
15164
|
-
keyOpen:
|
15123
|
+
keyOpen: ProblemKey.Vulnerable,
|
15165
15124
|
data: resultData,
|
15166
15125
|
openProblem: openProblem,
|
15167
15126
|
changeOpen: setOpenProblem,
|
15168
15127
|
isMyStoryStudent: isMyStoryStudent
|
15169
15128
|
}), React__default.createElement(ProtractedProblem, {
|
15170
|
-
keyOpen:
|
15129
|
+
keyOpen: ProblemKey.ProtractedProblem,
|
15171
15130
|
data: longTimeSpend,
|
15172
15131
|
openProblem: openProblem,
|
15173
15132
|
changeOpen: setOpenProblem,
|
15174
15133
|
isMyStoryStudent: isMyStoryStudent
|
15175
15134
|
}), React__default.createElement(GradesByTerritory, {
|
15176
|
-
keyOpen: "GradesByTerritory",
|
15177
15135
|
data: categoryResponses,
|
15178
15136
|
resultData: resultData,
|
15179
15137
|
openProblem: openProblem,
|
15180
15138
|
isMyStoryStudent: isMyStoryStudent,
|
15181
15139
|
changeOpen: setOpenProblem
|
15182
|
-
}))), React__default.createElement(material.Grid, {
|
15183
|
-
item: true,
|
15184
|
-
xs: 12,
|
15185
|
-
className: "position-absolute",
|
15186
|
-
sx: {
|
15187
|
-
zIndex: -1,
|
15188
|
-
width: "1024px"
|
15189
|
-
},
|
15190
|
-
id: "canvas"
|
15191
|
-
}, React__default.createElement(material.Grid, {
|
15192
|
-
container: true,
|
15193
|
-
padding: "24px",
|
15194
|
-
id: "header-canvas"
|
15195
|
-
}, React__default.createElement(material.Grid, {
|
15196
|
-
item: true
|
15197
|
-
}, resultData.courseName && React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
15198
|
-
sx: {
|
15199
|
-
fontSize: "14px",
|
15200
|
-
fontWeight: 600,
|
15201
|
-
color: styles.less_dark
|
15202
|
-
}
|
15203
|
-
}, resultData.courseName)), React__default.createElement(material.Box, {
|
15204
|
-
display: "flex",
|
15205
|
-
gap: "16px",
|
15206
|
-
flexDirection: "column"
|
15207
|
-
}, React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
15208
|
-
sx: {
|
15209
|
-
fontSize: "20px",
|
15210
|
-
fontWeight: 600,
|
15211
|
-
color: styles.darker
|
15212
|
-
}
|
15213
|
-
}, resultData.title)), React__default.createElement(material.Stack, {
|
15214
|
-
flexDirection: "row",
|
15215
|
-
gap: "16px"
|
15216
|
-
}, React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
15217
|
-
sx: {
|
15218
|
-
fontSize: "13px",
|
15219
|
-
fontWeight: 600,
|
15220
|
-
color: styles.gray_500
|
15221
|
-
}
|
15222
|
-
}, t("my_score")), React__default.createElement(material.Typography, {
|
15223
|
-
sx: {
|
15224
|
-
fontSize: "14px",
|
15225
|
-
fontWeight: 600,
|
15226
|
-
color: styles.darker
|
15227
|
-
}
|
15228
|
-
}, t("score_format", {
|
15229
|
-
score: resultData === null || resultData === void 0 ? void 0 : resultData.score
|
15230
|
-
}))), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
15231
|
-
sx: {
|
15232
|
-
fontSize: "13px",
|
15233
|
-
fontWeight: 600,
|
15234
|
-
color: styles.gray_500
|
15235
|
-
}
|
15236
|
-
}, t("exam_date")), React__default.createElement(material.Typography, {
|
15237
|
-
sx: {
|
15238
|
-
fontSize: "14px",
|
15239
|
-
fontWeight: 600,
|
15240
|
-
color: styles.gray_700
|
15241
|
-
}
|
15242
|
-
}, utcToLocalTime(resultData === null || resultData === void 0 ? void 0 : resultData.startTime, t("date_format")))), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
15243
|
-
sx: {
|
15244
|
-
fontSize: "13px",
|
15245
|
-
fontWeight: 600,
|
15246
|
-
color: styles.gray_500
|
15247
|
-
}
|
15248
|
-
}, t("exam_time")), React__default.createElement(material.Typography, {
|
15249
|
-
sx: {
|
15250
|
-
fontSize: "14px",
|
15251
|
-
fontWeight: 600,
|
15252
|
-
color: styles.gray_700
|
15253
|
-
}
|
15254
|
-
}, examTime)), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
15255
|
-
sx: {
|
15256
|
-
fontSize: "13px",
|
15257
|
-
fontWeight: 600,
|
15258
|
-
color: styles.gray_500
|
15259
|
-
}
|
15260
|
-
}, t("total_students")), React__default.createElement(material.Typography, {
|
15261
|
-
sx: {
|
15262
|
-
fontSize: "14px",
|
15263
|
-
fontWeight: 600,
|
15264
|
-
color: styles.gray_700
|
15265
|
-
}
|
15266
|
-
}, t("number_people", {
|
15267
|
-
number: resultData === null || resultData === void 0 ? void 0 : resultData.totalStudent
|
15268
|
-
}))), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
15269
|
-
sx: {
|
15270
|
-
fontSize: "13px",
|
15271
|
-
fontWeight: 600,
|
15272
|
-
color: styles.gray_500
|
15273
|
-
}
|
15274
|
-
}, t("teacher_in_charge")), React__default.createElement(material.Typography, {
|
15275
|
-
sx: {
|
15276
|
-
fontSize: "14px",
|
15277
|
-
fontWeight: 600,
|
15278
|
-
color: styles.gray_700
|
15279
|
-
}
|
15280
|
-
}, resultData === null || resultData === void 0 ? void 0 : resultData.teacherName)))))), React__default.createElement(material.Stack, {
|
15281
|
-
display: "flex",
|
15282
|
-
flexDirection: "column",
|
15283
|
-
gap: "12px"
|
15284
|
-
}, React__default.createElement(material.Typography, {
|
15285
|
-
className: "chart-title",
|
15286
|
-
sx: {
|
15287
|
-
fontSize: "18px",
|
15288
|
-
fontWeight: 700,
|
15289
|
-
color: styles.gray_500
|
15290
|
-
}
|
15291
|
-
}, t(TabList[0].label)), React__default.createElement(MyAnswer, {
|
15292
|
-
data: resultData,
|
15293
|
-
categories: categoryResponses,
|
15294
|
-
isStudent: isStudent,
|
15295
|
-
isPrint: true
|
15296
|
-
})), React__default.createElement(material.Stack, {
|
15297
|
-
display: "flex",
|
15298
|
-
flexDirection: "column",
|
15299
|
-
gap: "12px",
|
15300
|
-
marginTop: "24px"
|
15301
|
-
}, React__default.createElement(material.Typography, {
|
15302
|
-
className: "chart-title",
|
15303
|
-
sx: {
|
15304
|
-
fontSize: "18px",
|
15305
|
-
fontWeight: 700,
|
15306
|
-
color: styles.gray_500
|
15307
|
-
}
|
15308
|
-
}, t(TabList[1].label)), timelyOrderQuestions.map(function (timelyOrderQuestion, index) {
|
15309
|
-
return React__default.createElement("div", {
|
15310
|
-
key: index,
|
15311
|
-
className: PrintContainerClassName
|
15312
|
-
}, React__default.createElement(material.Typography, {
|
15313
|
-
className: "pb-2 " + PrintHeaderClassName,
|
15314
|
-
sx: {
|
15315
|
-
fontSize: "14px",
|
15316
|
-
fontWeight: 700,
|
15317
|
-
color: "#414E62"
|
15318
|
-
}
|
15319
|
-
}, t("article_number"), " ", timelyOrderQuestion.article), React__default.createElement("div", {
|
15320
|
-
className: styles$4["compareChart"] + " " + PrintContentClassName
|
15321
|
-
}, React__default.createElement("div", {
|
15322
|
-
className: "" + styles$4["prevChart"]
|
15323
|
-
}), React__default.createElement("div", {
|
15324
|
-
className: styles$4["chart"] + " sr-line-chart"
|
15325
|
-
}, React__default.createElement("div", null, React__default.createElement(ReactApexChart, {
|
15326
|
-
height: 389,
|
15327
|
-
options: allChartOptions[index],
|
15328
|
-
series: allSeries[index]
|
15329
|
-
}))), React__default.createElement("div", {
|
15330
|
-
className: "" + styles$4["nextChart"]
|
15331
|
-
})));
|
15332
|
-
})), React__default.createElement(material.Stack, {
|
15333
|
-
display: "flex",
|
15334
|
-
flexDirection: "column",
|
15335
|
-
gap: "12px",
|
15336
|
-
marginTop: "24px"
|
15337
|
-
}, React__default.createElement(material.Typography, {
|
15338
|
-
className: "chart-title",
|
15339
|
-
sx: {
|
15340
|
-
fontSize: "18px",
|
15341
|
-
fontWeight: 700,
|
15342
|
-
color: styles.gray_500
|
15343
|
-
}
|
15344
|
-
}, t(TabList[2].label)), React__default.createElement(CompareGrass, {
|
15345
|
-
effectSize: effectSize,
|
15346
|
-
isPrint: true
|
15347
|
-
})), React__default.createElement(material.Stack, {
|
15348
|
-
display: "flex",
|
15349
|
-
flexDirection: "column",
|
15350
|
-
gap: "12px",
|
15351
|
-
marginTop: "24px"
|
15352
|
-
}, React__default.createElement(material.Typography, {
|
15353
|
-
className: "chart-title",
|
15354
|
-
sx: {
|
15355
|
-
fontSize: "18px",
|
15356
|
-
fontWeight: 700,
|
15357
|
-
color: styles.gray_500
|
15358
|
-
}
|
15359
|
-
}, t(TabList[3].label)), React__default.createElement(TrickyProblem, {
|
15360
|
-
keyOpen: "TrickyProblem",
|
15361
|
-
data: resultData,
|
15362
|
-
openProblem: "TrickyProblem",
|
15363
|
-
changeOpen: setOpenProblem,
|
15364
|
-
isPrint: true
|
15365
|
-
}), React__default.createElement(Vulnerable, {
|
15366
|
-
keyOpen: "Vulnerable",
|
15367
|
-
data: resultData,
|
15368
|
-
openProblem: "Vulnerable",
|
15369
|
-
changeOpen: setOpenProblem,
|
15370
|
-
isMyStoryStudent: isMyStoryStudent,
|
15371
|
-
isPrint: true
|
15372
|
-
}), React__default.createElement(ProtractedProblem, {
|
15373
|
-
keyOpen: "ProtractedProblem",
|
15374
|
-
data: longTimeSpend,
|
15375
|
-
openProblem: "ProtractedProblem",
|
15376
|
-
changeOpen: setOpenProblem,
|
15377
|
-
isPrint: true,
|
15378
|
-
isMyStoryStudent: isMyStoryStudent
|
15379
|
-
}), React__default.createElement(GradesByTerritory, {
|
15380
|
-
keyOpen: "GradesByTerritory",
|
15381
|
-
data: categoryResponses,
|
15382
|
-
resultData: resultData,
|
15383
|
-
openProblem: "GradesByTerritory",
|
15384
|
-
changeOpen: setOpenProblem,
|
15385
|
-
isPrint: true,
|
15386
|
-
isMyStoryStudent: isMyStoryStudent
|
15387
15140
|
})))), React__default.createElement(CreateNewQuestionDialog$1, {
|
15388
15141
|
examSessionId: resultData === null || resultData === void 0 ? void 0 : resultData.examSessionId,
|
15389
15142
|
handleCreateQuestion: handleCreateQuestion,
|
15390
15143
|
openCreateQuestionDialog: openCreateQuestionDialog,
|
15391
15144
|
toggleCreateQuestion: toggleCreateQuestion
|
15392
|
-
})
|
15145
|
+
}), isLoading === false && React__default.createElement(material.Box, {
|
15146
|
+
width: 0,
|
15147
|
+
height: 0,
|
15148
|
+
overflow: "hidden"
|
15149
|
+
}, React__default.createElement(PrintExamResult, {
|
15150
|
+
contentRef: contentRef,
|
15151
|
+
allChartOptions: allChartOptions,
|
15152
|
+
allSeries: allSeries,
|
15153
|
+
categoryResponses: categoryResponses,
|
15154
|
+
effectSize: effectSize,
|
15155
|
+
examTime: examTime,
|
15156
|
+
isStudent: isStudent,
|
15157
|
+
longTimeSpend: longTimeSpend,
|
15158
|
+
resultData: resultData,
|
15159
|
+
timelyOrderQuestions: timelyOrderQuestions,
|
15160
|
+
isMyStoryStudent: isMyStoryStudent,
|
15161
|
+
fileName: fileName,
|
15162
|
+
setRenderedChart: setRenderedChart
|
15163
|
+
}))) : React__default.createElement(React.Fragment, null), React__default.createElement(LoadingComponent, {
|
15164
|
+
isLoading: printState === PrintState.Pending || printState === PrintState.Printing
|
15165
|
+
}));
|
15393
15166
|
};
|
15394
15167
|
|
15395
15168
|
var RecentUserActionSortBy;
|
@@ -16009,6 +15782,7 @@ var Header = function Header(_ref) {
|
|
16009
15782
|
var _user$roles;
|
16010
15783
|
var academyListRoute = _ref.academyListRoute,
|
16011
15784
|
homeRoute = _ref.homeRoute,
|
15785
|
+
registerRoute = _ref.registerRoute,
|
16012
15786
|
headerTabs = _ref.headerTabs,
|
16013
15787
|
role = _ref.role,
|
16014
15788
|
history = _ref.history,
|
@@ -16057,6 +15831,7 @@ var Header = function Header(_ref) {
|
|
16057
15831
|
}, React__default.createElement(TheAcademyDropdown, {
|
16058
15832
|
homeAcademyUrl: academyListRoute.path,
|
16059
15833
|
homeUrl: homeRoute.path,
|
15834
|
+
registerUrl: registerRoute === null || registerRoute === void 0 ? void 0 : registerRoute.path,
|
16060
15835
|
role: role,
|
16061
15836
|
history: history,
|
16062
15837
|
onSignOut: onSignOut,
|
@@ -16668,6 +16443,136 @@ var useVirtualizeList = function useVirtualizeList(totalItems, rowHeight, offset
|
|
16668
16443
|
};
|
16669
16444
|
};
|
16670
16445
|
|
16446
|
+
var usePrintView = function usePrintView(examSessionId, studentId, setNotFound, resultData, isLoading, errorMessage) {
|
16447
|
+
var _useState = React.useState(false),
|
16448
|
+
isDone = _useState[0],
|
16449
|
+
setDone = _useState[1];
|
16450
|
+
var handelPrintSuccess = function handelPrintSuccess() {
|
16451
|
+
var _window$opener$postMe, _window$opener;
|
16452
|
+
var data = {
|
16453
|
+
examSessionId: examSessionId,
|
16454
|
+
studentId: studentId,
|
16455
|
+
succeed: true
|
16456
|
+
};
|
16457
|
+
if (window.opener && !window.opener.closed) (_window$opener$postMe = (_window$opener = window.opener).postMessage) === null || _window$opener$postMe === void 0 ? void 0 : _window$opener$postMe.call(_window$opener, data, window.location.origin);
|
16458
|
+
setDone(true);
|
16459
|
+
};
|
16460
|
+
var handelPrintError = function handelPrintError(errorMessage) {
|
16461
|
+
var _window$opener$postMe2, _window$opener2;
|
16462
|
+
var data = {
|
16463
|
+
examSessionId: examSessionId,
|
16464
|
+
studentId: studentId,
|
16465
|
+
succeed: false,
|
16466
|
+
errorMessage: errorMessage
|
16467
|
+
};
|
16468
|
+
if (window.opener && !window.opener.closed) (_window$opener$postMe2 = (_window$opener2 = window.opener).postMessage) === null || _window$opener$postMe2 === void 0 ? void 0 : _window$opener$postMe2.call(_window$opener2, data, window.location.origin);
|
16469
|
+
setDone(true);
|
16470
|
+
};
|
16471
|
+
var fileName = !resultData ? "" : "Exam-Result_" + resultData.student.fullName + "_" + resultData.title + "_(" + utcToLocalTime(resultData.startTime, "MM-DD-YYYY HH:mm") + ")";
|
16472
|
+
React.useEffect(function () {
|
16473
|
+
setNotFound === null || setNotFound === void 0 ? void 0 : setNotFound(isLoading === false && !!errorMessage);
|
16474
|
+
if (isLoading === false && !!errorMessage) handelPrintError(errorMessage);
|
16475
|
+
}, [isLoading, errorMessage]);
|
16476
|
+
return {
|
16477
|
+
fileName: fileName,
|
16478
|
+
isDone: isDone,
|
16479
|
+
handelPrintSuccess: handelPrintSuccess,
|
16480
|
+
handelPrintError: handelPrintError
|
16481
|
+
};
|
16482
|
+
};
|
16483
|
+
|
16484
|
+
var LoadingDots = function LoadingDots(_ref) {
|
16485
|
+
var text = _ref.text;
|
16486
|
+
return React__default.createElement(material.Stack, {
|
16487
|
+
className: "mt-3",
|
16488
|
+
direction: "row",
|
16489
|
+
spacing: 0.5
|
16490
|
+
}, React__default.createElement(material.Typography, {
|
16491
|
+
color: "#FFF",
|
16492
|
+
fontSize: 20
|
16493
|
+
}, text), React__default.createElement("div", {
|
16494
|
+
className: styles$4["loader"]
|
16495
|
+
}, React__default.createElement("div", {
|
16496
|
+
className: styles$4["dot"]
|
16497
|
+
}), React__default.createElement("div", {
|
16498
|
+
className: styles$4["dot"]
|
16499
|
+
}), React__default.createElement("div", {
|
16500
|
+
className: styles$4["dot"]
|
16501
|
+
})));
|
16502
|
+
};
|
16503
|
+
|
16504
|
+
var PrintExamResultView = function PrintExamResultView(_ref) {
|
16505
|
+
var isMyStoryStudent = _ref.isMyStoryStudent,
|
16506
|
+
_ref$searchParams = _ref.searchParams,
|
16507
|
+
searchParams = _ref$searchParams === void 0 ? "" : _ref$searchParams,
|
16508
|
+
history = _ref.history,
|
16509
|
+
_ref$examSessionId = _ref.examSessionId,
|
16510
|
+
examSessionId = _ref$examSessionId === void 0 ? 0 : _ref$examSessionId,
|
16511
|
+
_ref$studentId = _ref.studentId,
|
16512
|
+
studentId = _ref$studentId === void 0 ? 0 : _ref$studentId,
|
16513
|
+
code = _ref.code,
|
16514
|
+
setNotFound = _ref.setNotFound;
|
16515
|
+
var _useExamResult = useExamResult({
|
16516
|
+
searchParams: searchParams,
|
16517
|
+
history: history,
|
16518
|
+
examSessionId: examSessionId,
|
16519
|
+
studentId: studentId,
|
16520
|
+
code: code,
|
16521
|
+
isPrint: true
|
16522
|
+
}),
|
16523
|
+
isLoading = _useExamResult.isLoading,
|
16524
|
+
examTime = _useExamResult.examTime,
|
16525
|
+
allSeries = _useExamResult.allSeries,
|
16526
|
+
allChartOptions = _useExamResult.allChartOptions,
|
16527
|
+
timelyOrderQuestions = _useExamResult.timelyOrderQuestions,
|
16528
|
+
isStudent = _useExamResult.isStudent,
|
16529
|
+
resultData = _useExamResult.resultData,
|
16530
|
+
longTimeSpend = _useExamResult.longTimeSpend,
|
16531
|
+
effectSize = _useExamResult.effectSize,
|
16532
|
+
categoryResponses = _useExamResult.categoryResponses,
|
16533
|
+
errorMessage = _useExamResult.errorMessage;
|
16534
|
+
var _usePrintView = usePrintView(examSessionId, studentId, setNotFound, resultData, isLoading, errorMessage),
|
16535
|
+
fileName = _usePrintView.fileName,
|
16536
|
+
isDone = _usePrintView.isDone,
|
16537
|
+
handelPrintSuccess = _usePrintView.handelPrintSuccess,
|
16538
|
+
handelPrintError = _usePrintView.handelPrintError;
|
16539
|
+
var _usePrintExamResult = usePrintExamResult(isLoading, fileName, timelyOrderQuestions.length, handelPrintSuccess, handelPrintError, true),
|
16540
|
+
contentRef = _usePrintExamResult.contentRef,
|
16541
|
+
setRenderedChart = _usePrintExamResult.setRenderedChart;
|
16542
|
+
var isTabletUp = material.useMediaQuery("(min-width:900px)");
|
16543
|
+
return React__default.createElement(material.Box, {
|
16544
|
+
sx: {
|
16545
|
+
display: "flex",
|
16546
|
+
justifyContent: "center"
|
16547
|
+
},
|
16548
|
+
displayPrint: "block"
|
16549
|
+
}, isLoading === false && resultData && effectSize ? React__default.createElement(PrintExamResult, {
|
16550
|
+
contentRef: contentRef,
|
16551
|
+
allChartOptions: allChartOptions,
|
16552
|
+
allSeries: allSeries,
|
16553
|
+
categoryResponses: categoryResponses,
|
16554
|
+
effectSize: effectSize,
|
16555
|
+
examTime: examTime,
|
16556
|
+
isStudent: isStudent,
|
16557
|
+
longTimeSpend: longTimeSpend,
|
16558
|
+
resultData: resultData,
|
16559
|
+
timelyOrderQuestions: timelyOrderQuestions,
|
16560
|
+
isMyStoryStudent: isMyStoryStudent,
|
16561
|
+
fileName: fileName,
|
16562
|
+
setRenderedChart: setRenderedChart
|
16563
|
+
}) : isLoading === undefined || isLoading === true ? React__default.createElement(LoadingComponent, {
|
16564
|
+
isLoading: !!isLoading,
|
16565
|
+
spinClassName: "text-white"
|
16566
|
+
}, isTabletUp && React__default.createElement(LoadingDots, {
|
16567
|
+
text: "Loading data"
|
16568
|
+
})) : React__default.createElement(NotFound, null), React__default.createElement(LoadingComponent, {
|
16569
|
+
isLoading: isDone !== true && isLoading === false && !!resultData,
|
16570
|
+
spinClassName: "text-white"
|
16571
|
+
}, isTabletUp && React__default.createElement(LoadingDots, {
|
16572
|
+
text: "Please wait for a while! Printing"
|
16573
|
+
})));
|
16574
|
+
};
|
16575
|
+
|
16671
16576
|
exports.moment = moment;
|
16672
16577
|
Object.defineProperty(exports, 'I18nextProvider', {
|
16673
16578
|
enumerable: true,
|
@@ -16731,6 +16636,7 @@ exports.LoginWithPassword = SignIn;
|
|
16731
16636
|
exports.NotFound = NotFound;
|
16732
16637
|
exports.PUSHER_CONFIG = PUSHER_CONFIG;
|
16733
16638
|
exports.PassCodeCheck = PassCodeCheck;
|
16639
|
+
exports.PrintExamResultView = PrintExamResultView;
|
16734
16640
|
exports.QuestionCountSelector = QuestionCountSelector;
|
16735
16641
|
exports.RecentUserAction = RecentUserAction;
|
16736
16642
|
exports.SUPER_ADMIN_BASE_URL = SUPER_ADMIN_BASE_URL;
|
@@ -16754,7 +16660,7 @@ exports.getAccessToken = getAccessToken;
|
|
16754
16660
|
exports.getErrorMessage = getErrorMessage;
|
16755
16661
|
exports.getOrdinalSuffix = getOrdinalSuffix;
|
16756
16662
|
exports.getRecentUserActionListApi = getRecentUserActionListApi;
|
16757
|
-
exports.i18n =
|
16663
|
+
exports.i18n = i18n__default;
|
16758
16664
|
exports.minutesToTimeSpan = minutesToTimeSpan;
|
16759
16665
|
exports.setAlert = setAlert;
|
16760
16666
|
exports.setLanguage = setLanguage;
|