Skip to content

Commit

Permalink
Add: hotkey for submit quiz
Browse files Browse the repository at this point in the history
  • Loading branch information
amasin76 committed Mar 12, 2024
1 parent d263aaf commit 2502ebe
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/pages/content/scrollToTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@ function scrollToTask(): void {
resourcesElement && resourcesElement.scrollIntoView();
}
}

if (event.ctrlKey && event.key === "k") {
const searchButton: HTMLElement = document.querySelector("#search-button");
const searchBtn: HTMLButtonElement = document.querySelector("#search-button");
event.preventDefault();
searchBtn && searchBtn.click();
}

if (event.key === "q") {
const quizSubmitBtn: HTMLButtonElement = document.querySelector(".quiz_questions_results button");
event.preventDefault();
searchButton && searchButton.click();
quizSubmitBtn && quizSubmitBtn.click();
}
});

Expand Down

0 comments on commit 2502ebe

Please sign in to comment.