From 209008c2be745057f941289e7559bff526672df6 Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Fri, 16 Aug 2024 20:04:15 +0100 Subject: [PATCH 1/2] Adding timeout if you get the exercise wrong so you do not skip too fast without reading your error. --- lib/JapaChar/View/HiraganaKatakanaTestExercise.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/JapaChar/View/HiraganaKatakanaTestExercise.pm b/lib/JapaChar/View/HiraganaKatakanaTestExercise.pm index 34165f7..f5e477d 100644 --- a/lib/JapaChar/View/HiraganaKatakanaTestExercise.pm +++ b/lib/JapaChar/View/HiraganaKatakanaTestExercise.pm @@ -17,6 +17,7 @@ use Pango; use JapaChar::Random; use JapaChar::Score; +use Glib; use Glib::IO; use constant PANGO_SCALE => 1024; @@ -131,7 +132,7 @@ sub _new_challenge_generic_code( $self, $show, $guess, $can_be_typed = 0 ) { ); $self->_continue_button($continue_button); $self->_on_resize_continue_button->(); - my $on_answer = sub { + my $on_answer = sub ($correct) { $continue_button->set_sensitive(1); }; my $correct_answer_button = @@ -140,7 +141,7 @@ sub _new_challenge_generic_code( $self, $show, $guess, $can_be_typed = 0 ) { 'clicked', sub { $self->_final_answer( $char->get($guess) ); - $on_answer->(); + $on_answer->(1); } ); push @buttons, $correct_answer_button; @@ -153,7 +154,7 @@ sub _new_challenge_generic_code( $self, $show, $guess, $can_be_typed = 0 ) { 'clicked', sub { $self->_final_answer( $char->get($guess) ); - $on_answer->(); + $on_answer->(0); } ); push @buttons, $incorrect_button; @@ -336,6 +337,11 @@ sub _on_click_continue_button( $self, $grid, $char, $guess ) { 'Meck!! The correct answer is ' . $char->get($guess) ); $label_feedback->add_css_class('error'); $char->fail if !$is_repeating; + $continue_button->set_sensitive(0); + Glib::Timeout->add_seconds(1, sub { + $continue_button->set_sensitive(1); + return 0; + }); } if ( $is_repeating && $self->_app->characters->last_repeated ) { From c04a3f111f5a2e6d7e41a938d4bdfdf928c7a3ba Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Fri, 16 Aug 2024 20:06:08 +0100 Subject: [PATCH 2/2] v0.26 --- me.sergiotarxz.JapaChar.metainfo.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/me.sergiotarxz.JapaChar.metainfo.xml b/me.sergiotarxz.JapaChar.metainfo.xml index 4f637cb..20acd67 100644 --- a/me.sergiotarxz.JapaChar.metainfo.xml +++ b/me.sergiotarxz.JapaChar.metainfo.xml @@ -30,6 +30,11 @@ sergiotarxz + + +

Avoiding skip without reading the correct answer with a timeout.

+
+

Improving select buttons in dyslexia mode and general contrast.