word/quiz: poc js asks random images with 4 translations
[sheet.git] / word.plp
index a7acea5ae10d9874e3324b8ffc4117ed27077531..b5a07bf60a9fe9b0f24f49a5df6048a1bfc2ce23 100644 (file)
--- a/word.plp
+++ b/word.plp
@@ -5,6 +5,20 @@ if ($Request and $Request =~ s{^edit/?}{}) {
        exit;
 }
 
+if ($Request and $Request =~ s{^quiz/?}{}) {
+       Html({
+               raw => <<'EOT',
+<script src="/wordquiz.js"></script>
+<style>
+.wrong {background: red}
+.good {background: green}
+</style>
+EOT
+       });
+       say '<h1>quiz</h1><p id="quiz">test</p>';
+       exit;
+}
+
 my $lang = $get{lang} || 'en';
 my $wordlist = "data/wordlist.$lang.inc.pl";
 my $limit = $get{v} // (exists $get{v} ? 4 : 3);