Skip to content

Commit

Permalink
add new multiple choice shortcuts
Browse files Browse the repository at this point in the history
- added new multiple choice shortcuts for quickly selecting answers A-D. (#253)
  • Loading branch information
SethClydesdale committed Mar 9, 2024
1 parent f05ce12 commit e45b831
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ Shortcuts that can only be used in exercises.
| <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>F</kbd> | Toggle Furigana on/off |
| <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>C</kbd> | Check answers (for written exercises) |

##### Multiple Choice
The following shortcuts can only be used in multiple choice exercises to quickly select an answer.

| Shortcut | Description |
| -------- | ----------- |
| <kbd>ALT</kbd>+<kbd>A</kbd> | Selects option A |
| <kbd>ALT</kbd>+<kbd>B</kbd> | Selects option B |
| <kbd>ALT</kbd>+<kbd>C</kbd> | Selects option C |
| <kbd>ALT</kbd>+<kbd>D</kbd> | Selects option D |


### Suggestions, Feedback, Bug Reports
If you have any suggestions, feedback, questions, or bugs to report, feel free to [open a new discussion](https://github.com/SethClydesdale/genki-study-resources/discussions) in this repository. For alternative contact methods and detailed reporting information, please see the [report page](https://sethclydesdale.github.io/genki-study-resources/report/) for Genki Study Resources.
Expand Down
12 changes: 12 additions & 0 deletions resources/javascript/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,17 @@
button.click();
}
}


// shortcuts for multi-choice options
// ALT + A/B/C/D
if (Genki.active.type == 'multi' && e.altKey && /a|b|c|d/i.test(e.key)) {
var opt = document.querySelector('#quiz-q' + Genki.stats.solved + ' div[data-option="' + e.key.toUpperCase() + '"]');

if (opt) {
opt.click();
e.preventDefault();
}
}
});
}(window, document));
2 changes: 1 addition & 1 deletion resources/javascript/all.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e45b831

Please sign in to comment.