diff --git a/src/assets/wise5/components/common/feedbackRule/TermEvaluator/test-utils.ts b/src/assets/wise5/components/common/feedbackRule/TermEvaluator/test-utils.ts index 980983898bf..127ccc0669e 100644 --- a/src/assets/wise5/components/common/feedbackRule/TermEvaluator/test-utils.ts +++ b/src/assets/wise5/components/common/feedbackRule/TermEvaluator/test-utils.ts @@ -5,7 +5,7 @@ import { AbstractIdeaCountTermEvaluator } from './AbstractIdeaCountTermEvaluator const idea1 = new CRaterIdea('1', true); const idea2 = new CRaterIdea('2', true); const idea3 = new CRaterIdea('3', true); -const response_with_idea_1 = new CRaterResponse({ ideas: [idea1], ba: 1 }); +const response_with_idea_1 = new CRaterResponse({ ideas: [idea1] }); const response_with_idea_2 = new CRaterResponse({ ideas: [idea2] }); const response_with_ideas_1_2 = new CRaterResponse({ ideas: [idea1, idea2] }); const response_with_ideas_1_2_3 = new CRaterResponse({ ideas: [idea1, idea2, idea3] }); diff --git a/src/assets/wise5/components/peerChat/peer-chat-question-bank/peer-chat-question-bank.component.ts b/src/assets/wise5/components/peerChat/peer-chat-question-bank/peer-chat-question-bank.component.ts index 5873a7f3f90..a816d8d082c 100644 --- a/src/assets/wise5/components/peerChat/peer-chat-question-bank/peer-chat-question-bank.component.ts +++ b/src/assets/wise5/components/peerChat/peer-chat-question-bank/peer-chat-question-bank.component.ts @@ -39,7 +39,7 @@ export class PeerChatQuestionBankComponent implements OnInit { ); if ( this.content.questionBank.isPeerGroupingTagSpecified() && - ['OpenResponse', 'MultipleChoice'].includes(referenceComponent.content.type) + ['MultipleChoice', 'OpenResponse'].includes(referenceComponent.content.type) ) { this.evaluatePeerGroup(referenceComponent); } @@ -68,7 +68,7 @@ export class PeerChatQuestionBankComponent implements OnInit { referenceComponent: WISEComponent, peerGroupStudentData: PeerGroupStudentData[] ): QuestionBankRule[] { - const cRaterResponses = peerGroupStudentData.map((peerMemberData: PeerGroupStudentData) => { + const responses = peerGroupStudentData.map((peerMemberData: PeerGroupStudentData) => { return new CRaterResponse({ ideas: peerMemberData.annotation?.data.ideas, scores: peerMemberData.annotation?.data.scores, @@ -85,7 +85,7 @@ export class PeerChatQuestionBankComponent implements OnInit { ); feedbackRuleEvaluator.setReferenceComponent(referenceComponent); return this.filterQuestions( - feedbackRuleEvaluator.getFeedbackRules(cRaterResponses) as QuestionBankRule[], + feedbackRuleEvaluator.getFeedbackRules(responses) as QuestionBankRule[], this.content.questionBank.maxQuestionsToShow ); } diff --git a/src/assets/wise5/directives/dynamic-prompt/DynamicPromptEvaluator.ts b/src/assets/wise5/directives/dynamic-prompt/DynamicPromptEvaluator.ts index bb7aa1df0c7..444dc03c550 100644 --- a/src/assets/wise5/directives/dynamic-prompt/DynamicPromptEvaluator.ts +++ b/src/assets/wise5/directives/dynamic-prompt/DynamicPromptEvaluator.ts @@ -23,23 +23,17 @@ export abstract class DynamicPromptEvaluator { protected getFeedbackRuleEvaluator( referenceComponent: Component ): FeedbackRuleEvaluator { + const feedbackRuleComponent = new FeedbackRuleComponent( + this.component.dynamicPrompt.getRules(), + referenceComponent.content.maxSubmitCount, + false + ); const evaluator = this.component.dynamicPrompt.isPeerGroupingTagSpecified() ? new FeedbackRuleEvaluatorMultipleStudents( - new FeedbackRuleComponent( - this.component.dynamicPrompt.getRules(), - referenceComponent.content.maxSubmitCount, - false - ), + feedbackRuleComponent, this.component.constraintService ) - : new FeedbackRuleEvaluator( - new FeedbackRuleComponent( - this.component.dynamicPrompt.getRules(), - referenceComponent.content.maxSubmitCount, - false - ), - this.component.constraintService - ); + : new FeedbackRuleEvaluator(feedbackRuleComponent, this.component.constraintService); evaluator.setReferenceComponent(referenceComponent); return evaluator; }