Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions src/messages.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -10945,7 +10945,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts</context>
<context context-type="linenumber">125</context>
<context context-type="linenumber">126</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/multipleChoice/multiple-choice-authoring/multiple-choice-authoring.component.html</context>
Expand Down Expand Up @@ -19584,7 +19584,7 @@ Warning: This will delete all existing choices and buckets in this component.</s
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts</context>
<context context-type="linenumber">470</context>
<context context-type="linenumber">471</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/multipleChoice/multiple-choice-show-work/multiple-choice-show-work.component.html</context>
Expand Down Expand Up @@ -19615,7 +19615,7 @@ Warning: This will delete all existing choices and buckets in this component.</s
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts</context>
<context context-type="linenumber">470</context>
<context context-type="linenumber">471</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/multipleChoice/multiple-choice-show-work/multiple-choice-show-work.component.html</context>
Expand Down Expand Up @@ -19680,7 +19680,7 @@ Warning: This will delete all existing choices and buckets in this component.</s
<source>Correct bucket but wrong position</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/match/match-student/match-student-default/match-student-default.component.ts</context>
<context context-type="linenumber">463</context>
<context context-type="linenumber">464</context>
</context-group>
</trans-unit>
<trans-unit id="3309404570196522710" datatype="html">
Expand Down