File tree Expand file tree Collapse file tree
packages/multiple-choice/configure/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,7 +137,10 @@ export default class MultipleChoice extends HTMLElement {
137137 }
138138
139139 onModelChanged ( m , reset ) {
140- this . _model = m ;
140+ this . _model = {
141+ ...this . _model ,
142+ ...m ,
143+ } ;
141144 this . _render ( ) ;
142145
143146 this . dispatchModelUpdated ( reset ) ;
Original file line number Diff line number Diff line change @@ -381,7 +381,9 @@ export class Main extends React.Component {
381381 }
382382
383383 model . choices . splice ( index , 1 ) ;
384- onModelChanged ( model ) ;
384+ onModelChanged ( {
385+ choices : model . choices ,
386+ } ) ;
385387 } ;
386388
387389 onAddChoice = ( ) => {
@@ -407,7 +409,9 @@ export class Main extends React.Component {
407409 feedback : { type : 'none' } ,
408410 } ) ;
409411
410- onModelChanged ( model ) ;
412+ onModelChanged ( {
413+ choices : model . choices ,
414+ } ) ;
411415 } ;
412416
413417 onChoiceChanged = ( index , choice ) => {
@@ -418,19 +422,19 @@ export class Main extends React.Component {
418422 }
419423
420424 model . choices . splice ( index , 1 , choice ) ;
421- onModelChanged ( model ) ;
425+ onModelChanged ( {
426+ choices : model . choices ,
427+ } ) ;
422428 } ;
423429
424430 onPromptChanged = ( prompt ) => {
425431 this . props . onModelChanged ( {
426- ...this . props . model ,
427432 prompt,
428433 } ) ;
429434 } ;
430435
431436 onTeacherInstructionsChanged = ( teacherInstructions ) => {
432437 this . props . onModelChanged ( {
433- ...this . props . model ,
434438 teacherInstructions,
435439 } ) ;
436440 } ;
@@ -460,7 +464,9 @@ export class Main extends React.Component {
460464 } ) ;
461465 }
462466
463- onModelChanged ( model , true ) ;
467+ onModelChanged ( {
468+ choices : model . choices ,
469+ } , true ) ;
464470 break ;
465471 }
466472
You can’t perform that action at this time.
0 commit comments