touchstudy-core 0.1.6 → 0.1.7

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.
@@ -13,6 +13,7 @@ import i18n from 'i18next';
13
13
  import { initReactI18next, useTranslation } from 'react-i18next';
14
14
  export { I18nextProvider, useTranslation } from 'react-i18next';
15
15
  import { IoChevronDown } from 'react-icons/io5';
16
+ import Select from 'react-select';
16
17
 
17
18
  var setLoading = createAction("common/setLoading");
18
19
  var setAlert = createAction("common/setAlert");
@@ -32,7 +33,8 @@ var PUSHER_CONFIG = {
32
33
  cluster: "ap1",
33
34
  key: "9018c77328885a14150b"
34
35
  };
35
- var EXAM_CHANNEL = "EXAM-CHANNEL";
36
+ var EXAM_CHANNEL = "presence-exam-channel";
37
+ var EXAM_STUDENT_CHANNEL = "EXAM-CHANNEL-{examCode}-STUDENT-{studentId}";
36
38
  var getAccessToken = function getAccessToken() {
37
39
  try {
38
40
  return localStorage.getItem(ACCESS_TOKEN);
@@ -960,10 +962,8 @@ var ExamEvent;
960
962
  (function (ExamEvent) {
961
963
  ExamEvent["StartExam"] = "start-exam";
962
964
  ExamEvent["TerminateExam"] = "terminate-exam";
963
- ExamEvent["JoinExam"] = "join-exam";
964
965
  ExamEvent["AddExtraDuration"] = "add-extra-duration-exam";
965
- ExamEvent["TeacherDisconnectChannel"] = "teacher-disconnect-channel";
966
- ExamEvent["StudentDisconnectChannel"] = "student-disconnect-channel";
966
+ ExamEvent["TeacherKickOutStudent"] = "teacher-kick-out-student";
967
967
  })(ExamEvent || (ExamEvent = {}));
968
968
 
969
969
  var problem_solving = "문제풀기";
@@ -1022,6 +1022,7 @@ var internet_connection_was_lost = "인터넷 연결이 끊어졌습니다";
1022
1022
  var problem = "문제";
1023
1023
  var problem_solving_time = "문제풀이 시간";
1024
1024
  var minutes = "분";
1025
+ var correct_rate = "정확한 비율";
1025
1026
  var lang_ko = {
1026
1027
  problem_solving: problem_solving,
1027
1028
  my_story: my_story,
@@ -1078,7 +1079,8 @@ var lang_ko = {
1078
1079
  internet_connection_was_lost: internet_connection_was_lost,
1079
1080
  problem: problem,
1080
1081
  problem_solving_time: problem_solving_time,
1081
- minutes: minutes
1082
+ minutes: minutes,
1083
+ correct_rate: correct_rate
1082
1084
  };
1083
1085
 
1084
1086
  var problem_solving$1 = "Problem Solving";
@@ -1137,6 +1139,7 @@ var internet_connection_was_lost$1 = "Internet connection was lost";
1137
1139
  var problem$1 = "Problem ";
1138
1140
  var problem_solving_time$1 = "Problem solving time";
1139
1141
  var minutes$1 = "m";
1142
+ var correct_rate$1 = "Correct rate";
1140
1143
  var lang_en = {
1141
1144
  problem_solving: problem_solving$1,
1142
1145
  my_story: my_story$1,
@@ -1193,7 +1196,8 @@ var lang_en = {
1193
1196
  internet_connection_was_lost: internet_connection_was_lost$1,
1194
1197
  problem: problem$1,
1195
1198
  problem_solving_time: problem_solving_time$1,
1196
- minutes: minutes$1
1199
+ minutes: minutes$1,
1200
+ correct_rate: correct_rate$1
1197
1201
  };
1198
1202
 
1199
1203
  i18n.use(initReactI18next).init({
@@ -1338,7 +1342,44 @@ var canAccess = function canAccess(userRoles, componentRoles) {
1338
1342
  return true;
1339
1343
  };
1340
1344
 
1345
+ function _objectWithoutPropertiesLoose(source, excluded) {
1346
+ if (source == null) return {};
1347
+ var target = {};
1348
+ var sourceKeys = Object.keys(source);
1349
+ var key, i;
1350
+ for (i = 0; i < sourceKeys.length; i++) {
1351
+ key = sourceKeys[i];
1352
+ if (excluded.indexOf(key) >= 0) continue;
1353
+ target[key] = source[key];
1354
+ }
1355
+ return target;
1356
+ }
1357
+
1358
+ var _excluded = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
1359
+ var CustomSelect = function CustomSelect(_ref) {
1360
+ var options = _ref.options,
1361
+ isDisabled = _ref.isDisabled,
1362
+ scrollBottom = _ref.scrollBottom,
1363
+ value = _ref.value,
1364
+ isMulti = _ref.isMulti,
1365
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
1366
+ var initialValues = Array.isArray(value) ? options.filter(function (i) {
1367
+ return value.includes(i.value);
1368
+ }) : isMulti ? options.filter(function (i) {
1369
+ return i.value == value;
1370
+ }) : options.find(function (i) {
1371
+ return i.value == value;
1372
+ });
1373
+ return React.createElement(Select, Object.assign({
1374
+ isDisabled: isDisabled,
1375
+ options: options,
1376
+ value: initialValues,
1377
+ menuPlacement: scrollBottom ? "top" : "auto",
1378
+ isMulti: isMulti
1379
+ }, rest));
1380
+ };
1381
+
1341
1382
  var historyCore = createBrowserHistory();
1342
1383
 
1343
- export { ACCESS_TOKEN, BASE_URL, CommonAlert, CommonDialog, ConfirmDialog, CustomPagination, DATE_MIN_VALUE, EXAM_CHANNEL, ExamEvent, LayoutContext, Loading, Login, NotFound, PUSHER_CONFIG, TheLanguageDropdown, api$1 as api, canAccess as canAccessRoute, diffFromNow, formatTime, historyCore, i18n, minutesToTimeSpan, setAlert, setLanguage, setLoading, setUser, store, toISOString, useGoogleSignOut, utcToLocalTime };
1384
+ export { ACCESS_TOKEN, BASE_URL, CommonAlert, CommonDialog, ConfirmDialog, CustomPagination, CustomSelect, DATE_MIN_VALUE, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, ExamEvent, LayoutContext, Loading, Login, NotFound, PUSHER_CONFIG, TheLanguageDropdown, api$1 as api, canAccess as canAccessRoute, diffFromNow, formatTime, getAccessToken$1 as getAccessToken, historyCore, i18n, minutesToTimeSpan, setAlert, setLanguage, setLoading, setUser, store, toISOString, useGoogleSignOut, utcToLocalTime };
1344
1385
  //# sourceMappingURL=index.modern.js.map