Skip to content

Commit

Permalink
fix(Events): Node exited event now saves when changing steps (#1872)
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreykwan authored Jul 30, 2024
1 parent a708481 commit d59eaca
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/assets/wise5/vle/node/node.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ export class NodeComponent implements OnInit {
);

this.studentDataService.currentNodeChanged$.subscribe(() => {
this.nodeUnloaded(this.node.id);
if (this.node.isEvaluateTransitionLogicOn('exitNode')) {
this.nodeService.evaluateTransitionLogic();
}
this.initializeNode();
});
this.studentDataService.nodeStatusesChanged$.subscribe(() => {
Expand All @@ -155,9 +159,8 @@ export class NodeComponent implements OnInit {
this.nodeService.evaluateTransitionLogic();
}

const latestComponentState = this.studentDataService.getLatestComponentStateByNodeIdAndComponentId(
this.node.id
);
const latestComponentState =
this.studentDataService.getLatestComponentStateByNodeIdAndComponentId(this.node.id);
if (latestComponentState) {
this.latestComponentState = latestComponentState;
}
Expand Down Expand Up @@ -200,10 +203,6 @@ export class NodeComponent implements OnInit {

ngOnDestroy() {
this.stopAutoSaveInterval();
this.nodeUnloaded(this.node.id);
if (this.node.isEvaluateTransitionLogicOn('exitNode')) {
this.nodeService.evaluateTransitionLogic();
}
this.subscriptions.unsubscribe();
}

Expand Down

0 comments on commit d59eaca

Please sign in to comment.