Skip to content

Commit

Permalink
fix (maybe)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrimReaper2654 committed Dec 24, 2024
1 parent c3c07d3 commit 4856759
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,16 @@ const data = {
keyboard: {}
};

let path = window.location.pathname;
path = path.replace(/\/+$/, '');
if (path.endsWith("dev.html")) {
// Load keybinds
window.onkeydown = function(e) {
const keyBinds = ['q', 'w', 'e']; // munti choice, short answer, extended
console.log(e.key);
if (data.activeQuestion && keyBinds.includes(e.key)) {
const tag = e.key == keyBinds[0]? 'Multiple-choice': e.key == keyBinds[1]? 'Short Answer' : 'Extended Response';
updateTags(tag);
window.onkeydown = function(e) {
const keyBinds = ['q', 'w', 'e']; // munti choice, short answer, extended
console.log(e.key);
if (data.activeQuestion && keyBinds.includes(e.key)) {
const tag = e.key == keyBinds[0]? 'Multiple-choice': e.key == keyBinds[1]? 'Short Answer' : 'Extended Response';
if (document.getElementById(`${tag}Modify`)) {
document.getElementById(`${tag}Modify`).checked = !document.getElementById(`${tag}Modify`).checked;
updateTags(tag, document.getElementById(`${tag}Modify`).checked);
}

}
}
window.addEventListener('resize', packTags);
Expand Down

0 comments on commit 4856759

Please sign in to comment.