diff --git a/src/assets/wise5/components/dialogGuidance/FeedbackRule.ts b/src/assets/wise5/components/dialogGuidance/FeedbackRule.ts index 9ea6793a5a2..98a54c4a7ab 100644 --- a/src/assets/wise5/components/dialogGuidance/FeedbackRule.ts +++ b/src/assets/wise5/components/dialogGuidance/FeedbackRule.ts @@ -4,6 +4,14 @@ export class FeedbackRule { feedback: string | string[]; static operatorPrecedences = { '!': 2, '&&': 1, '||': 1 }; + constructor(jsonObject: any = {}) { + for (const key of Object.keys(jsonObject)) { + if (jsonObject[key] != null) { + this[key] = jsonObject[key]; + } + } + } + static isSecondToLastSubmitRule(feedbackRule: FeedbackRule): boolean { return feedbackRule.expression === 'isSecondToLastSubmit'; } diff --git a/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.component.html b/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.component.html index 060aa5b6274..e3d72c6cce7 100644 --- a/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.component.html +++ b/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.component.html @@ -17,6 +17,8 @@ - + diff --git a/src/assets/wise5/components/dialogGuidance/dialogGuidanceService.ts b/src/assets/wise5/components/dialogGuidance/dialogGuidanceService.ts index 002e45673e3..f68dce40036 100644 --- a/src/assets/wise5/components/dialogGuidance/dialogGuidanceService.ts +++ b/src/assets/wise5/components/dialogGuidance/dialogGuidanceService.ts @@ -23,6 +23,7 @@ export class DialogGuidanceService extends ComponentService { component.feedbackRules = []; component.isComputerAvatarEnabled = false; component.computerAvatarSettings = this.getDefaultComputerAvatarSettings(); + component.version = 2; return component; } diff --git a/src/assets/wise5/components/dialogGuidance/edit-dialog-guidance-feedback-rules/edit-dialog-guidance-feedback-rules.component.html b/src/assets/wise5/components/dialogGuidance/edit-dialog-guidance-feedback-rules/edit-dialog-guidance-feedback-rules.component.html index 99986ec1559..17060f4729d 100644 --- a/src/assets/wise5/components/dialogGuidance/edit-dialog-guidance-feedback-rules/edit-dialog-guidance-feedback-rules.component.html +++ b/src/assets/wise5/components/dialogGuidance/edit-dialog-guidance-feedback-rules/edit-dialog-guidance-feedback-rules.component.html @@ -18,20 +18,60 @@
{{ruleIndex + 1}} drag_indicator -
+
Expression - - Feedback - - + + + +
+ + + + Feedback + + + +