From e00928996510513186224b357cc230cc7118d319 Mon Sep 17 00:00:00 2001 From: doncr Date: Tue, 30 Oct 2018 20:37:45 +0000 Subject: [PATCH] Added permanent furigana on questions and better scoreboard. --- conjugation/drill.css | 15 +++++++++------ conjugation/drill.html | 5 +++++ conjugation/drill.js | 20 ++++++++++++++++++-- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/conjugation/drill.css b/conjugation/drill.css index 73f949d..20c2306 100644 --- a/conjugation/drill.css +++ b/conjugation/drill.css @@ -67,6 +67,7 @@ body, input { } #message { + margin-top: 10px; width: 100%; } @@ -155,7 +156,7 @@ div#history table { div#history table th, div#history table td { - padding: 8px; + padding: 10px 16px 10px 16px; border: 1px solid gray; }: @@ -169,7 +170,8 @@ div.options > * { margin: 20px; } -div#splash > * { +div#splash > *, +div#scoreSection > * { margin-left: auto; margin-right: auto; display: table; @@ -200,7 +202,8 @@ div.options ul { font-size: 12px; } -[tooltip]:hover:before { +[tooltip]:hover:before, +.furiganaAlways #question [tooltip]:before { /* needed - do not touch */ opacity: 1; @@ -226,9 +229,9 @@ div.options ul { #question .tooltip-w2[tooltip]:before { font-size: 12px; margin-left: 8px; } #question .tooltip-w3[tooltip]:before { font-size: 12px; margin-left: 2px; } -#question .tooltip-w1[tooltip]:hover:before, -#question .tooltip-w2[tooltip]:hover:before, -#question .tooltip-w3[tooltip]:hover:before { margin-top: -12px; } +#question .tooltip-w1[tooltip]:hover:before, .furiganaAlways #question .tooltip-w1[tooltip]:before, +#question .tooltip-w2[tooltip]:hover:before, .furiganaAlways #question .tooltip-w2[tooltip]:before, +#question .tooltip-w3[tooltip]:hover:before, .furiganaAlways #question .tooltip-w3[tooltip]:before { margin-top: -12px; } div#explanation p span { } diff --git a/conjugation/drill.html b/conjugation/drill.html index 703d673..9ed8930 100755 --- a/conjugation/drill.html +++ b/conjugation/drill.html @@ -74,12 +74,17 @@
+
+ +
+
+
diff --git a/conjugation/drill.js b/conjugation/drill.js index 05deae2..909a2ce 100755 --- a/conjugation/drill.js +++ b/conjugation/drill.js @@ -483,7 +483,15 @@ function updateHistoryView(log) { $('#history').empty().append(review); - $('#history').append("

" + correct + " of " + total + " correct.

"); + var resultString; + + if (correct == total) { + resultString = "All correct"; + } else { + resultString = correct + " of " + total + " correct"; + } + + $('#scoreSectionTitle').html("

Result: " + resultString + "

"); } function proceed() { @@ -507,6 +515,14 @@ function startQuiz() { $('#quizSection').show(); $('#scoreSection').hide(); + var options = getOptions(); + + if (options.furigana_always) { + $('body').addClass("furiganaAlways"); + } else { + $('body').removeClass("furiganaAlways"); + } + resetLog(); generateQuestion(); } @@ -696,7 +712,7 @@ function getOptions() { var options = ["plain", "polite", "negative", "past", "te-form", "progressive", "potential", "imperative", "passive", "causative", "godan", "ichidan", "iku", "kuru", "suru", "i-adjective", "na-adjective", - "ii", "desire", "volitional", "trick", "kana"]; + "ii", "desire", "volitional", "trick", "kana", "furigana_always"]; var result = {};