The ‘didAnswerQuestion’ internal event seemed to have stop returning the event.
Anyone knows of a replacement method to figure out whether the user’s answer is correct?
Background:
I’m debugging [Userscript] WaniKani Pitch Info
The code was listening to didAnswerQuestion and then made use of the event (ev) returned in the callback.
Relevant code section:
window.addEventListener('didAnswerQuestion', (ev) => {
console.log("didAnswerQuestion");
// didAnswerQuestion will be triggered whenever the user answers a question
console.log(`ev: ${JSON.stringify(ev)}`);
if (wkof.settings.wanikani_pitch_info?.display_pitch_beside_question && ev.detail.questionType == 'reading' && ev.detail.results.action == 'pass') {
...
However, didAnswerQuestion seems to have stopped returning the event. ev is now empty.
Browser console:
didAnswerQuestion
ev: {}
I understand that didAnswerQuestion is internal to WaniKani and could change.
Anyone knows of a replacement method to figure out whether the user’s answer is correct?
ev.detail.results.action == 'pass' - The user’s answer was correct
Because ev is empty, the checks against ev.detail.XXX fails.