Skip to content

Commit

Permalink
fix: resolved input guard for task switching
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoalee committed May 15, 2023
1 parent c36addd commit 9092390
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export class TaskSwitchingComponent extends AbstractBaseTaskComponent {

@HostListener('window:keydown', ['$event'])
handleRoundInteraction(event: KeyboardEvent) {
if (!this.responseAllowed || !this.taskData) return;
const thisTrial = this.taskData[this.taskData.length - 1];
thisTrial.submitted = this.timerService.getCurrentTimestamp();

Expand All @@ -221,7 +222,7 @@ export class TaskSwitchingComponent extends AbstractBaseTaskComponent {
thisTrial.score = 0;
super.handleRoundInteraction(null);
return;
} else if (this.responseAllowed && this.isValidKey(event.key)) {
} else if (this.isValidKey(event.key)) {
this.cancelAllTimers();
this.responseAllowed = false;

Expand Down

0 comments on commit 9092390

Please sign in to comment.