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.
@@ -11971,6 +11971,13 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
11971
11971
  var handleChangeCategory = function handleChangeCategory(val) {
11972
11972
  setFieldValue(path + ".articles[0].categoryOptions", val !== null && val !== void 0 && val.value ? [val] : []);
11973
11973
  setFieldValue(path + ".articles[0].categories", val !== null && val !== void 0 && val.value ? [val.value] : []);
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
+ }));
11974
11981
  };
11975
11982
  var handleChangeSubCategory = function handleChangeSubCategory(val) {
11976
11983
  if (!(val !== null && val !== void 0 && val.value)) {
@@ -11983,6 +11990,13 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
11983
11990
  setFieldValue(path + ".articles[0].categories[1]", val.value);
11984
11991
  setFieldValue(path + ".articles[0].categoryOptions[1]", val);
11985
11992
  }
11993
+ var questions = data.questions;
11994
+ setFieldValue(path + ".questions", questions.map(function (q) {
11995
+ return _extends({}, q, {
11996
+ questionTypeId: null,
11997
+ questionType: null
11998
+ });
11999
+ }));
11986
12000
  };
11987
12001
  var summary = open ? "" : [t("number_questions", {
11988
12002
  n: data.questionCount
@@ -12464,6 +12478,8 @@ var _reduceToMathArticles = function reduceToMathArticles(data, isMath) {
12464
12478
  if (key === "articles") {
12465
12479
  var _values$key;
12466
12480
  values[key] = (_values$key = values[key]) !== null && _values$key !== void 0 && _values$key.length ? [values[key][0]] : [DEFAULT_ARTICLE];
12481
+ } else if (key === "questionType" || key === "questionTypeId") {
12482
+ values[key] = null;
12467
12483
  } else if (typeof values[key] === "object" && values[key] !== null) {
12468
12484
  _reduceToMathArticles(values[key]);
12469
12485
  }