Need help editing Self-Study script

Hello and thanks to all who heard my calls in this time of need.

I want to use the Self Study Script to learn my WK Vocabulary in reverse (English->Japanese), but the script does not quite do what I’d like it to.

The script only shows Kanji in the Summary which is too late for my taste, so I’d like it to show the Kanji and meaning in the Help-Window directly after I submit an answer. Also I’d like the help window to show even when i got the right answer (to reinforce my visual Kanji memory).
sss

So i know where the magic happens in the script, i just can’t figure out where it hides the kanji itself (the “image” of the kanji).

err_list.append(
  '<li><span class="que" lang="'+qlang+'" title="'+qtitle+'">'+qtext+'</span>'+
  '</br>'+
  '<span class="ans" lang="'+alang+'" title="'+atitle+'">'+atitle+'</span></li>'
);

This is line 1630 where it appends the phonetic part of the kanji to the error window.
I get lost pretty early in the backtracking, since I can’t figure out where item.data gets it’s values from and what .slug is.

Any help is appreciated.

P.S. I didn’t find a custimization like this in the existing settings. If it already exists let me know.

Alright. I had a quick look and found a way to implement what you wanted.

First, add white-space: pre; to the #ss_quiz .help CSS rule, around line 565. You obviously don’t need the KUMI parts, that was just how I kept track of my edits.

Then to add the kanji to the help element add +'\n'+qinfo.item.object.data.characters to the line populating the help element around line 1170.

Lastly to get it to open for correct answers as well you add if (quiz.settings.autoshow_correct && !quiz.showing_help) { toggle_help('on'); } to the handler for correct answers, around line 1464.

1 Like

Instead of changing the CSS white-space, you can use <br> instead of \n.

1 Like

Thank you so much!
This helps me learn significantly faster.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.