Shih-hungg commited on
Commit
8cd242f
·
1 Parent(s): f720420
src/components/question-output/QuestionEditModal.tsx CHANGED
@@ -87,7 +87,7 @@ export default function QuestionEditModal({
87
  if (!prev) return null;
88
 
89
  if (field === 'stem') {
90
- return { ...prev, stem: value };
91
  } else if (field.startsWith('content.Options.')) {
92
  const optionKey = field.replace('content.Options.', '');
93
  return {
@@ -96,7 +96,7 @@ export default function QuestionEditModal({
96
  ...prev.content,
97
  Options: {
98
  ...prev.content.Options,
99
- [optionKey]: value
100
  }
101
  }
102
  };
@@ -106,7 +106,7 @@ export default function QuestionEditModal({
106
  ...prev,
107
  content: {
108
  ...prev.content,
109
- [contentField]: value
110
  }
111
  };
112
  }
 
87
  if (!prev) return null;
88
 
89
  if (field === 'stem') {
90
+ return { ...prev, stem: String(value) };
91
  } else if (field.startsWith('content.Options.')) {
92
  const optionKey = field.replace('content.Options.', '');
93
  return {
 
96
  ...prev.content,
97
  Options: {
98
  ...prev.content.Options,
99
+ [optionKey]: String(value)
100
  }
101
  }
102
  };
 
106
  ...prev,
107
  content: {
108
  ...prev.content,
109
+ [contentField]: String(value)
110
  }
111
  };
112
  }