diff --git a/src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts b/src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts index 02daaf0aac8..b4b072f3999 100644 --- a/src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts +++ b/src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts @@ -38,6 +38,7 @@ import { NotebookService } from '../../../../services/notebookService'; import { ProjectService } from '../../../../services/projectService'; import { StudentAssetService } from '../../../../services/studentAssetService'; import { StudentDataService } from '../../../../services/studentDataService'; +import { CRaterIdea } from '../../../common/cRater/CRaterIdea'; @Component({ imports: [ @@ -613,11 +614,17 @@ export class MatchStudentDefaultComponent extends ComponentStudent { } private addIdeasToSourceBucket(responses: any[], rubric: CRaterRubric): void { - getUniqueIdeas(responses, rubric).forEach((idea) => { - const choice = new Choice(idea.name, idea.text); - this.choices.push(choice); - this.getBucketById(this.sourceBucketId).items.push(choice); - }); + getUniqueIdeas(responses, rubric) + .filter((idea) => !this.isInSourceBucket(idea)) + .forEach((idea) => { + const choice = new Choice(idea.name, idea.text); + this.choices.push(choice); + this.getBucketById(this.sourceBucketId).items.push(choice); + }); + } + + private isInSourceBucket(idea: CRaterIdea): boolean { + return this.sourceBucket.items.some((item) => item.value === idea.text); } protected addChoice(): void { diff --git a/src/messages.xlf b/src/messages.xlf index 9a3af762e7a..25381e04756 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -10945,7 +10945,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts - 125 + 126 src/assets/wise5/components/multipleChoice/multiple-choice-authoring/multiple-choice-authoring.component.html @@ -19584,7 +19584,7 @@ Warning: This will delete all existing choices and buckets in this component. src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts - 470 + 471 src/assets/wise5/components/multipleChoice/multiple-choice-show-work/multiple-choice-show-work.component.html @@ -19615,7 +19615,7 @@ Warning: This will delete all existing choices and buckets in this component. src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts - 470 + 471 src/assets/wise5/components/multipleChoice/multiple-choice-show-work/multiple-choice-show-work.component.html @@ -19680,7 +19680,7 @@ Warning: This will delete all existing choices and buckets in this component.Correct bucket but wrong position src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts - 463 + 464