touchstudy-core 0.1.184 → 0.1.185

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -11952,6 +11952,13 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
11952
11952
  var handleChangeCategory = function handleChangeCategory(val) {
11953
11953
  setFieldValue(path + ".articles[0].categoryOptions", val !== null && val !== void 0 && val.value ? [val] : []);
11954
11954
  setFieldValue(path + ".articles[0].categories", val !== null && val !== void 0 && val.value ? [val.value] : []);
11955
+ var questions = data.questions;
11956
+ setFieldValue(path + ".questions", questions.map(function (q) {
11957
+ return _extends({}, q, {
11958
+ questionTypeId: null,
11959
+ questionType: null
11960
+ });
11961
+ }));
11955
11962
  };
11956
11963
  var handleChangeSubCategory = function handleChangeSubCategory(val) {
11957
11964
  if (!(val !== null && val !== void 0 && val.value)) {
@@ -11964,6 +11971,13 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
11964
11971
  setFieldValue(path + ".articles[0].categories[1]", val.value);
11965
11972
  setFieldValue(path + ".articles[0].categoryOptions[1]", val);
11966
11973
  }
11974
+ var questions = data.questions;
11975
+ setFieldValue(path + ".questions", questions.map(function (q) {
11976
+ return _extends({}, q, {
11977
+ questionTypeId: null,
11978
+ questionType: null
11979
+ });
11980
+ }));
11967
11981
  };
11968
11982
  var summary = open ? "" : [t("number_questions", {
11969
11983
  n: data.questionCount
@@ -12445,6 +12459,8 @@ var _reduceToMathArticles = function reduceToMathArticles(data, isMath) {
12445
12459
  if (key === "articles") {
12446
12460
  var _values$key;
12447
12461
  values[key] = (_values$key = values[key]) !== null && _values$key !== void 0 && _values$key.length ? [values[key][0]] : [DEFAULT_ARTICLE];
12462
+ } else if (key === "questionType" || key === "questionTypeId") {
12463
+ values[key] = null;
12448
12464
  } else if (typeof values[key] === "object" && values[key] !== null) {
12449
12465
  _reduceToMathArticles(values[key]);
12450
12466
  }