-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change token to MyChoiceChosen("choiceId"), which will only work with
DynamicPrompt and QuestionBank, which use ReferenceComponent to look up work for the component #1409
- Loading branch information
1 parent
3d119a1
commit 442336e
Showing
18 changed files
with
163 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 4 additions & 7 deletions
11
src/assets/wise5/components/common/cRater/CRaterResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/assets/wise5/components/common/feedbackRule/Response.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export class Response { | ||
submitCounter: number; | ||
constructor(jsonObject: any = {}) { | ||
this.populateFields(jsonObject); | ||
} | ||
|
||
protected populateFields(jsonObject: any = {}): void { | ||
for (const key of Object.keys(jsonObject)) { | ||
if (jsonObject[key] != null) { | ||
this[key] = jsonObject[key]; | ||
} | ||
} | ||
} | ||
} |
27 changes: 0 additions & 27 deletions
27
src/assets/wise5/components/common/feedbackRule/TermEvaluator/ChoseChoiceTermEvaluator.ts
This file was deleted.
Oops, something went wrong.
11 changes: 8 additions & 3 deletions
11
...valuator/ChoseChoiceTermEvaluator.spec.ts → ...uator/MyChoiceChosenTermEvaluator.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/assets/wise5/components/common/feedbackRule/TermEvaluator/MyChoiceChosenTermEvaluator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Response } from '../Response'; | ||
import { TermEvaluator } from './TermEvaluator'; | ||
|
||
export class MyChoiceChosenTermEvaluator extends TermEvaluator { | ||
private choiceId: string; | ||
|
||
constructor(term: string) { | ||
super(term); | ||
this.choiceId = term.match(/myChoiceChosen\("(\w+)"\)/)[1]; | ||
} | ||
|
||
evaluate(response: Response | Response[]): boolean { | ||
return this.constraintService.evaluateCriteria({ | ||
name: 'choiceChosen', | ||
params: { | ||
nodeId: this.referenceComponent.nodeId, | ||
componentId: this.referenceComponent.id, | ||
choiceIds: this.choiceId | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.