From 3d119a13d61df7e7cb82c06537225a7ae2add6b2 Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Fri, 8 Sep 2023 16:41:30 -0700 Subject: [PATCH] feat(Feedback Rule): New ChoseChoice token #1409 --- .../FeedbackRuleEvaluator.spec.ts | 13 +++++--- .../feedbackRule/FeedbackRuleEvaluator.ts | 10 ++++-- ...dbackRuleEvaluatorMultipleStudents.spec.ts | 11 +++++-- .../FeedbackRuleEvaluatorMultipleStudents.ts | 2 +- .../feedbackRule/FeedbackRuleExpression.ts | 2 +- .../ChoseChoiceTermEvaluator.spec.ts | 33 +++++++++++++++++++ .../TermEvaluator/ChoseChoiceTermEvaluator.ts | 27 +++++++++++++++ .../TermEvaluator/TermEvaluator.ts | 11 +++++++ .../TermEvaluatorFactory.spec.ts | 7 +++- .../TermEvaluator/TermEvaluatorFactory.ts | 7 ++++ .../dialog-guidance-student.component.ts | 5 ++- .../open-response-student.component.ts | 5 ++- .../peer-chat-question-bank.component.ts | 10 ++++-- .../dynamic-prompt.component.ts | 8 +++-- .../wise5/services/constraintService.ts | 2 +- src/messages.xlf | 20 +++++------ 16 files changed, 144 insertions(+), 29 deletions(-) create mode 100644 src/assets/wise5/components/common/feedbackRule/TermEvaluator/ChoseChoiceTermEvaluator.spec.ts create mode 100644 src/assets/wise5/components/common/feedbackRule/TermEvaluator/ChoseChoiceTermEvaluator.ts diff --git a/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluator.spec.ts b/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluator.spec.ts index e13a312ec05..f3b7a7cfcb4 100644 --- a/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluator.spec.ts +++ b/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluator.spec.ts @@ -18,7 +18,8 @@ let evaluator: FeedbackRuleEvaluator; describe('FeedbackRuleEvaluator', () => { beforeEach(() => { evaluator = new FeedbackRuleEvaluator( - new FeedbackRuleComponent(DEFAULT_FEEDBACK_RULES, 5, true) + new FeedbackRuleComponent(DEFAULT_FEEDBACK_RULES, 5, true), + null ); }); matchRule_OneIdea(); @@ -76,7 +77,8 @@ function matchRule_hasKIScore() { describe('hasKIScore()', () => { beforeEach(() => { evaluator = new FeedbackRuleEvaluator( - new FeedbackRuleComponent(HAS_KI_SCORE_FEEDBACK_RULES, 5, true) + new FeedbackRuleComponent(HAS_KI_SCORE_FEEDBACK_RULES, 5, true), + null ); }); matchRule_hasKIScoreScoreInRange_ShouldMatchRule(); @@ -119,7 +121,10 @@ function matchRule_ideaCount() { feedback: 'ideaCountLessThan(3)' }) ]; - evaluator = new FeedbackRuleEvaluator(new FeedbackRuleComponent(feedbackRules, 5, true)); + evaluator = new FeedbackRuleEvaluator( + new FeedbackRuleComponent(feedbackRules, 5, true), + null + ); }); matchRule_ideaCount_MatchRulesBasedOnNumIdeasFound(); }); @@ -142,7 +147,7 @@ function matchNoRule_ReturnDefault() { function matchNoRule_NoDefaultFeedbackAuthored_ReturnApplicationDefault() { it(`should return application default rule when no rule is matched and no default is authored`, () => { - evaluator = new FeedbackRuleEvaluator(new FeedbackRuleComponent([], 5, true)); + evaluator = new FeedbackRuleEvaluator(new FeedbackRuleComponent([], 5, true), null); expectFeedback(['idea10', 'idea11'], [KI_SCORE_1], 1, evaluator.defaultFeedback); }); } diff --git a/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluator.ts b/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluator.ts index a4aab4cd4fc..5018be9a8bd 100644 --- a/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluator.ts +++ b/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluator.ts @@ -1,3 +1,4 @@ +import { ConstraintService } from '../../../services/constraintService'; import { FeedbackRuleComponent } from '../../feedbackRule/FeedbackRuleComponent'; import { CRaterResponse } from '../cRater/CRaterResponse'; import { FeedbackRule } from './FeedbackRule'; @@ -7,9 +8,14 @@ import { TermEvaluatorFactory } from './TermEvaluator/TermEvaluatorFactory'; export class FeedbackRuleEvaluator { defaultFeedback = $localize`Thanks for submitting your response.`; - protected factory = new TermEvaluatorFactory(); + protected factory; - constructor(protected component: FeedbackRuleComponent) {} + constructor( + protected component: FeedbackRuleComponent, + protected constraintService: ConstraintService + ) { + this.factory = new TermEvaluatorFactory(constraintService); + } getFeedbackRule(responses: T): FeedbackRule { return ( diff --git a/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluatorMultipleStudents.spec.ts b/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluatorMultipleStudents.spec.ts index 68ee74645e0..3791399ffcd 100644 --- a/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluatorMultipleStudents.spec.ts +++ b/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluatorMultipleStudents.spec.ts @@ -15,7 +15,8 @@ let evaluator: FeedbackRuleEvaluatorMultipleStudents; describe('FeedbackRuleEvaluatorMultipleStudents', () => { beforeEach(() => { evaluator = new FeedbackRuleEvaluatorMultipleStudents( - new FeedbackRuleComponent(DEFAULT_FEEDBACK_RULES, 5, true) + new FeedbackRuleComponent(DEFAULT_FEEDBACK_RULES, 5, true), + null ); }); matchRules_OneIdea(); @@ -38,7 +39,8 @@ function matchRules_HasKIScore() { describe('hasKIScoreScore', () => { beforeEach(() => { evaluator = new FeedbackRuleEvaluatorMultipleStudents( - new FeedbackRuleComponent(HAS_KI_SCORE_FEEDBACK_RULES, 5, true) + new FeedbackRuleComponent(HAS_KI_SCORE_FEEDBACK_RULES, 5, true), + null ); }); matchRules_hasKIScoreScoreInRange_ShouldMatchRule(); @@ -69,7 +71,10 @@ function matchNoRule_ReturnDefault() { function matchNoRule_NoDefaultFeedbackAuthored_ReturnApplicationDefault() { it(`should return application default rule when no rule is matched and no default is authored`, () => { - evaluator = new FeedbackRuleEvaluatorMultipleStudents(new FeedbackRuleComponent([], 5, true)); + evaluator = new FeedbackRuleEvaluatorMultipleStudents( + new FeedbackRuleComponent([], 5, true), + null + ); expectRules([createCRaterResponse(['idea10', 'idea11'], [KI_SCORE_1], 1)], ['default']); }); } diff --git a/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluatorMultipleStudents.ts b/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluatorMultipleStudents.ts index d3a80b59cd4..f0e83a151f2 100644 --- a/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluatorMultipleStudents.ts +++ b/src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluatorMultipleStudents.ts @@ -50,7 +50,7 @@ export class FeedbackRuleEvaluatorMultipleStudents extends FeedbackRuleEvaluator } protected evaluateTerm(term: string, responses: CRaterResponse[]): boolean { - const evaluator: TermEvaluator = this.factory.getTermEvaluator(term); + const evaluator: TermEvaluator = this.factory.getTermEvaluator(term, this.constraintService); return responses.some((response: CRaterResponse) => { return evaluator.evaluate(response); }); diff --git a/src/assets/wise5/components/common/feedbackRule/FeedbackRuleExpression.ts b/src/assets/wise5/components/common/feedbackRule/FeedbackRuleExpression.ts index a01e0b5a206..0f3ae7acb57 100644 --- a/src/assets/wise5/components/common/feedbackRule/FeedbackRuleExpression.ts +++ b/src/assets/wise5/components/common/feedbackRule/FeedbackRuleExpression.ts @@ -28,7 +28,7 @@ export class FeedbackRuleExpression { return this.text .replace(/ /g, '') .split( - /(hasKIScore\(\d\)|accumulatedIdeaCountEquals\(\d\)|accumulatedIdeaCountLessThan\(\d\)|accumulatedIdeaCountMoreThan\(\d\)|ideaCountEquals\(\S+\)|ideaCountLessThan\(\S+\)|ideaCountMoreThan\(\S+\)|isSubmitNumber\(\d+\)|&&|\|\||!|\(|\))/g + /(hasKIScore\(\d\)|accumulatedIdeaCountEquals\(\d\)|accumulatedIdeaCountLessThan\(\d\)|accumulatedIdeaCountMoreThan\(\d\)|ideaCountEquals\(\S+\)|ideaCountLessThan\(\S+\)|ideaCountMoreThan\(\S+\)|choseChoice\(\S+\)|isSubmitNumber\(\d+\)|&&|\|\||!|\(|\))/g ) .filter((el) => el !== ''); } diff --git a/src/assets/wise5/components/common/feedbackRule/TermEvaluator/ChoseChoiceTermEvaluator.spec.ts b/src/assets/wise5/components/common/feedbackRule/TermEvaluator/ChoseChoiceTermEvaluator.spec.ts new file mode 100644 index 00000000000..9b2bebf465d --- /dev/null +++ b/src/assets/wise5/components/common/feedbackRule/TermEvaluator/ChoseChoiceTermEvaluator.spec.ts @@ -0,0 +1,33 @@ +import { ConstraintService } from '../../../../services/constraintService'; +import { CRaterResponse } from '../../cRater/CRaterResponse'; +import { ChoseChoiceTermEvaluator } from './ChoseChoiceTermEvaluator'; + +class ConstraintServiceStub { + evaluateCriteria(criteria: any): boolean { + return true; + } +} + +describe('ChoseChoiceTermEvaluator', () => { + let evaluator1, mockConstraintService; + beforeEach(() => { + evaluator1 = new ChoseChoiceTermEvaluator('choseChoice("node1", "componentA", "choice1")'); + mockConstraintService = new ConstraintServiceStub(); + evaluator1.setConstraintService(mockConstraintService as ConstraintService); + }); + describe('evaluate()', () => { + [ + { description: 'choice is chosen', choiceChosen: true, expected: true }, + { description: 'choice is not chosen', choiceChosen: false, expected: false } + ].forEach(({ description, choiceChosen, expected }) => { + describe(description, () => { + beforeEach(() => { + spyOn(mockConstraintService, 'evaluateCriteria').and.returnValue(choiceChosen); + }); + it(`returns ${expected}`, () => { + expect(evaluator1.evaluate(new CRaterResponse())).toEqual(expected); + }); + }); + }); + }); +}); diff --git a/src/assets/wise5/components/common/feedbackRule/TermEvaluator/ChoseChoiceTermEvaluator.ts b/src/assets/wise5/components/common/feedbackRule/TermEvaluator/ChoseChoiceTermEvaluator.ts new file mode 100644 index 00000000000..ed414888398 --- /dev/null +++ b/src/assets/wise5/components/common/feedbackRule/TermEvaluator/ChoseChoiceTermEvaluator.ts @@ -0,0 +1,27 @@ +import { CRaterResponse } from '../../cRater/CRaterResponse'; +import { TermEvaluator } from './TermEvaluator'; + +export class ChoseChoiceTermEvaluator extends TermEvaluator { + private nodeId: string; + private componentId: string; + private choiceId: string; + + constructor(term: string) { + super(term); + const matches = term.match(/choseChoice\("(\w+)",\s*"(\w+)",\s*"(\w+)"\)/); + this.nodeId = matches[1]; + this.componentId = matches[2]; + this.choiceId = matches[3]; + } + + evaluate(response: CRaterResponse | CRaterResponse[]): boolean { + return this.constraintService.evaluateCriteria({ + name: 'choiceChosen', + params: { + nodeId: this.nodeId, + componentId: this.componentId, + choiceIds: this.choiceId + } + }); + } +} diff --git a/src/assets/wise5/components/common/feedbackRule/TermEvaluator/TermEvaluator.ts b/src/assets/wise5/components/common/feedbackRule/TermEvaluator/TermEvaluator.ts index 6501200935b..e38296dc0fa 100644 --- a/src/assets/wise5/components/common/feedbackRule/TermEvaluator/TermEvaluator.ts +++ b/src/assets/wise5/components/common/feedbackRule/TermEvaluator/TermEvaluator.ts @@ -1,6 +1,9 @@ +import { ConstraintService } from '../../../../services/constraintService'; import { CRaterResponse } from '../../cRater/CRaterResponse'; export abstract class TermEvaluator { + protected constraintService: ConstraintService; + constructor(protected term: string) {} abstract evaluate(response: CRaterResponse | CRaterResponse[]): boolean; @@ -8,6 +11,10 @@ export abstract class TermEvaluator { return /accumulatedIdeaCount(MoreThan|Equals|LessThan)\([\d+]\)/.test(term); } + static isChoseChoiceTerm(term: string): boolean { + return /choseChoice\("\w+",\s*"\w+",\s*"\w+"\)/.test(term); + } + static isHasKIScoreTerm(term: string): boolean { return /hasKIScore\([1-5]\)/.test(term); } @@ -30,4 +37,8 @@ export abstract class TermEvaluator { TermEvaluator.isIdeaCountWithResponseIndexTerm(term) ); } + + setConstraintService(service: ConstraintService) { + this.constraintService = service; + } } diff --git a/src/assets/wise5/components/common/feedbackRule/TermEvaluator/TermEvaluatorFactory.spec.ts b/src/assets/wise5/components/common/feedbackRule/TermEvaluator/TermEvaluatorFactory.spec.ts index c874b3d56f4..3309bb41775 100644 --- a/src/assets/wise5/components/common/feedbackRule/TermEvaluator/TermEvaluatorFactory.spec.ts +++ b/src/assets/wise5/components/common/feedbackRule/TermEvaluator/TermEvaluatorFactory.spec.ts @@ -1,3 +1,4 @@ +import { ChoseChoiceTermEvaluator } from './ChoseChoiceTermEvaluator'; import { HasKIScoreTermEvaluator } from './HasKIScoreTermEvaluator'; import { IdeaCountTermEvaluator } from './IdeaCountTermEvaluator'; import { IdeaTermEvaluator } from './IdeaTermEvaluator'; @@ -5,10 +6,14 @@ import { IsSubmitNumberEvaluator } from './IsSubmitNumberEvaluator'; import { TermEvaluatorFactory } from './TermEvaluatorFactory'; describe('TermEvaluatorFactory', () => { - const factory = new TermEvaluatorFactory(); + const factory = new TermEvaluatorFactory(null); describe('getTermEvaluator()', () => { it('should return correct evaluator', () => { [ + { + term: 'choseChoice("node1", "componentA", "choice1")', + instanceType: ChoseChoiceTermEvaluator + }, { term: 'hasKIScore(3)', instanceType: HasKIScoreTermEvaluator }, { term: 'ideaCountMoreThan(1)', instanceType: IdeaCountTermEvaluator }, { term: 'ideaCountEquals(3)', instanceType: IdeaCountTermEvaluator }, diff --git a/src/assets/wise5/components/common/feedbackRule/TermEvaluator/TermEvaluatorFactory.ts b/src/assets/wise5/components/common/feedbackRule/TermEvaluator/TermEvaluatorFactory.ts index 8f6538f07d3..eb3d24bcc98 100644 --- a/src/assets/wise5/components/common/feedbackRule/TermEvaluator/TermEvaluatorFactory.ts +++ b/src/assets/wise5/components/common/feedbackRule/TermEvaluator/TermEvaluatorFactory.ts @@ -1,4 +1,6 @@ +import { ConstraintService } from '../../../../services/constraintService'; import { AccumulatedIdeaCountTermEvaluator } from './AccumulatedIdeaCountTermEvaluator'; +import { ChoseChoiceTermEvaluator } from './ChoseChoiceTermEvaluator'; import { HasKIScoreTermEvaluator } from './HasKIScoreTermEvaluator'; import { IdeaCountTermEvaluator } from './IdeaCountTermEvaluator'; import { IdeaCountWithResponseIndexTermEvaluator } from './IdeaCountWithResponseIndexTermEvaluator'; @@ -7,6 +9,8 @@ import { IsSubmitNumberEvaluator } from './IsSubmitNumberEvaluator'; import { TermEvaluator } from './TermEvaluator'; export class TermEvaluatorFactory { + constructor(private constraintService: ConstraintService) {} + getTermEvaluator(term: string): TermEvaluator { let evaluator: TermEvaluator; if (TermEvaluator.isHasKIScoreTerm(term)) { @@ -19,9 +23,12 @@ export class TermEvaluatorFactory { evaluator = new IsSubmitNumberEvaluator(term); } else if (TermEvaluator.isAccumulatedIdeaCountTerm(term)) { evaluator = new AccumulatedIdeaCountTermEvaluator(term); + } else if (TermEvaluator.isChoseChoiceTerm(term)) { + evaluator = new ChoseChoiceTermEvaluator(term); } else { evaluator = new IdeaTermEvaluator(term); } + evaluator.setConstraintService(this.constraintService); return evaluator; } } diff --git a/src/assets/wise5/components/dialogGuidance/dialog-guidance-student/dialog-guidance-student.component.ts b/src/assets/wise5/components/dialogGuidance/dialog-guidance-student/dialog-guidance-student.component.ts index a2e0cc1f0ac..d1d2253caae 100644 --- a/src/assets/wise5/components/dialogGuidance/dialog-guidance-student/dialog-guidance-student.component.ts +++ b/src/assets/wise5/components/dialogGuidance/dialog-guidance-student/dialog-guidance-student.component.ts @@ -26,6 +26,7 @@ import { ComponentStudent } from '../../component-student.component'; import { DialogGuidanceComponent } from '../DialogGuidanceComponent'; import { copy } from '../../../common/object/object'; import { RawCRaterResponse } from '../../common/cRater/RawCRaterResponse'; +import { ConstraintService } from '../../../services/constraintService'; @Component({ selector: 'dialog-guidance-student', @@ -50,6 +51,7 @@ export class DialogGuidanceStudentComponent extends ComponentStudent { protected componentService: ComponentService, protected computerAvatarService: ComputerAvatarService, protected configService: ConfigService, + private constraintService: ConstraintService, protected cRaterService: CRaterService, protected dialog: MatDialog, protected dialogGuidanceFeedbackService: DialogGuidanceFeedbackService, @@ -86,7 +88,8 @@ export class DialogGuidanceStudentComponent extends ComponentStudent { this.component.getFeedbackRules(), this.getMaxSubmitCount(), this.component.isMultipleFeedbackTextsForSameRuleAllowed() - ) + ), + this.constraintService ); if (this.component.isComputerAvatarEnabled()) { this.initializeComputerAvatar(); diff --git a/src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.ts b/src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.ts index f8fec484ec2..b458105b290 100644 --- a/src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.ts +++ b/src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.ts @@ -21,6 +21,7 @@ import { OpenResponseService } from '../openResponseService'; import { copy } from '../../../common/object/object'; import { RawCRaterResponse } from '../../common/cRater/RawCRaterResponse'; import { hasConnectedComponent } from '../../../common/ComponentContent'; +import { ConstraintService } from '../../../services/constraintService'; @Component({ selector: 'open-response-student', @@ -38,6 +39,7 @@ export class OpenResponseStudent extends ComponentStudent { protected AnnotationService: AnnotationService, private changeDetector: ChangeDetectorRef, protected ComponentService: ComponentService, + private constraintService: ConstraintService, protected ConfigService: ConfigService, private CRaterService: CRaterService, protected dialog: MatDialog, @@ -399,7 +401,8 @@ export class OpenResponseStudent extends ComponentStudent { this.getFeedbackRules(), this.getMaxSubmitCount(), this.isMultipleFeedbackTextsForSameRuleAllowed() - ) + ), + this.constraintService ); const rule: FeedbackRule = feedbackRuleEvaluator.getFeedbackRule([response]); autoComment = this.getFeedbackText(rule); 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 c5882108ede..21029c18d26 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 @@ -14,6 +14,7 @@ import { concatMap, map } from 'rxjs/operators'; import { PeerGroup } from '../PeerGroup'; import { QuestionBankContent } from './QuestionBankContent'; import { copy } from '../../../common/object/object'; +import { ConstraintService } from '../../../services/constraintService'; @Component({ selector: 'peer-chat-question-bank', @@ -26,7 +27,11 @@ export class PeerChatQuestionBankComponent implements OnInit { @Output() displayedQuestionBankRulesChange = new EventEmitter(); questions: string[]; - constructor(private peerGroupService: PeerGroupService, private projectService: ProjectService) {} + constructor( + private constraintService: ConstraintService, + private peerGroupService: PeerGroupService, + private projectService: ProjectService + ) {} ngOnInit(): void { if (this.displayedQuestionBankRules == null) { @@ -80,7 +85,8 @@ export class PeerChatQuestionBankComponent implements OnInit { this.content.questionBank.getRules(), (referenceComponent.content as OpenResponseContent).maxSubmitCount, false - ) + ), + this.constraintService ); return this.filterQuestions( feedbackRuleEvaluator.getFeedbackRules(cRaterResponses) as QuestionBankRule[], diff --git a/src/assets/wise5/directives/dynamic-prompt/dynamic-prompt.component.ts b/src/assets/wise5/directives/dynamic-prompt/dynamic-prompt.component.ts index a10d888cb1c..9712710a61e 100644 --- a/src/assets/wise5/directives/dynamic-prompt/dynamic-prompt.component.ts +++ b/src/assets/wise5/directives/dynamic-prompt/dynamic-prompt.component.ts @@ -16,6 +16,7 @@ import { ProjectService } from '../../services/projectService'; import { StudentDataService } from '../../services/studentDataService'; import { DynamicPrompt } from './DynamicPrompt'; import { FeedbackRuleEvaluatorMultipleStudents } from '../../components/common/feedbackRule/FeedbackRuleEvaluatorMultipleStudents'; +import { ConstraintService } from '../../services/constraintService'; @Component({ selector: 'dynamic-prompt', @@ -32,6 +33,7 @@ export class DynamicPromptComponent implements OnInit { constructor( private annotationService: AnnotationService, private configService: ConfigService, + private constraintService: ConstraintService, private peerGroupService: PeerGroupService, private projectService: ProjectService, private dataService: StudentDataService @@ -76,7 +78,8 @@ export class DynamicPromptComponent implements OnInit { this.dynamicPrompt.getRules(), referenceComponentContent.maxSubmitCount, false - ) + ), + this.constraintService ); const feedbackRule: FeedbackRule = feedbackRuleEvaluator.getFeedbackRule(cRaterResponses); this.prompt = feedbackRule.prompt; @@ -126,7 +129,8 @@ export class DynamicPromptComponent implements OnInit { this.dynamicPrompt.getRules(), referenceComponentContent.maxSubmitCount, false - ) + ), + this.constraintService ); const feedbackRule: FeedbackRule = feedbackRuleEvaluator.getFeedbackRule([cRaterResponse]); this.prompt = feedbackRule.prompt; diff --git a/src/assets/wise5/services/constraintService.ts b/src/assets/wise5/services/constraintService.ts index 69fc53d8e73..b7ebd4a3faf 100644 --- a/src/assets/wise5/services/constraintService.ts +++ b/src/assets/wise5/services/constraintService.ts @@ -144,7 +144,7 @@ export class ConstraintService { : multipleRemovalCriteria.every((criteria) => this.evaluateCriteria(criteria)); } - private evaluateCriteria(criteria: any): boolean { + evaluateCriteria(criteria: any): boolean { const strategy = this.criteriaFunctionNameToStrategy[criteria.name]; return strategy == null || this.evaluateStrategy(criteria, strategy); } diff --git a/src/messages.xlf b/src/messages.xlf index 0bd4267c218..353074b3d87 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -15515,11 +15515,11 @@ Are you sure you want to proceed? src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.ts - 158 + 160 src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.ts - 174 + 176 @@ -15815,7 +15815,7 @@ Are you ready to receive feedback on this answer? Thanks for submitting your response. src/assets/wise5/components/common/feedbackRule/FeedbackRuleEvaluator.ts - 9 + 10 @@ -16390,7 +16390,7 @@ Are you ready to receive feedback on this answer? src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.ts - 161 + 163 @@ -19335,7 +19335,7 @@ Current Score: Are you ready to receive feedback on this answer? src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.ts - 165 + 167 @@ -19344,7 +19344,7 @@ Are you ready to receive feedback on this answer? Are you ready to receive feedback on this answer? src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.ts - 177 + 179 @@ -19353,21 +19353,21 @@ Are you ready to receive feedback on this answer? Are you ready to submit this answer? src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.ts - 181 + 183 We are scoring your work... src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.ts - 295 + 297 Please Wait src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.ts - 296 + 298 @@ -19375,7 +19375,7 @@ Are you ready to submit this answer? If this problem continues, let your teacher know and move on to the next activity. Your work will still be saved. src/assets/wise5/components/openResponse/open-response-student/open-response-student.component.ts - 318 + 320