For anyone inspired to hack their own shortcut keys… I made a little Self-Study shortcut key hack a while ago, and it’s pretty easy to do. rfindley’s code is well organized & pretty easy to understand.
I only use self-study quiz for a quick audio quiz after each study session, so I made shortcuts specifically for this purpose. WARNING - I did away with modifier keys (ctrl,…), so my shortcuts make it impossible to move the cursor around while typing (because I don’t type, I just think, then check my results). Thus, this isn’t a great solution for everyone.
For what it’s worth, here’s my shortcut hack…
back tick - replay audio
left arrow - prev item
right arrow - next item
up arrow - show help
down arrow - mark as incorrect, and show answer
That’s it. Super easy for my purposes (but again, not a general purpose solution, sorry)… here’s what I changed… (parts with jeff8v7)
var keycode_xlat = {
'8':'Backspace', '13':'Enter', '27':'Escape', '37':'ArrowLeft', '39':'ArrowRight', '65':'KeyA',
'69':'KeyE', '72':'KeyH', '76':'KeyL', '80':'KeyP', '82':'KeyR', '83':'KeyS', '112':'F1',
'38':'ArrowUp', '40':'ArrowDown', '192': 'BackTick' // jeff8v7 additions for faster quizzing
};
function quiz_key_handler(e) {
if (quiz_settings_state === 'open') return true;
var input = quiz.dialog.find('.answer input');
var input_readonly = input.prop('readonly');
var code;
if (e.type === 'keydown') {
if (e.originalEvent.keyCode) {
code = keycode_xlat[e.originalEvent.keyCode] || 'Unknown';
} else {
code = e.originalEvent.code;
}
} else {
code = String.fromCharCode(e.charCode);
}
// jeff8v7 additions for faster quizzing
if ( code === 'BackTick' ) { play_audio(true); }
else if ( code === 'ArrowLeft' ) { quiz.prev(); }
else if ( code === 'ArrowRight' ) { toggle_help('off'); quiz.next(); }
else if ( code === 'ArrowUp' ) { toggle_help('on'); play_audio(true); }
else if ( code === 'ArrowDown' ) { // fail & show answer
input.val('x'); submit_answer(); toggle_help('on');
} else
// jeff8v7 end








