diff --git a/comquiz/App.xaml b/comquiz/App.xaml index 52e9c4e..9d23685 100644 --- a/comquiz/App.xaml +++ b/comquiz/App.xaml @@ -307,7 +307,11 @@ 12 14 + 15 18 + 20 + 30 + 50 20 diff --git a/comquiz/Models/QuizSheet.cs b/comquiz/Models/QuizSheet.cs index af7b72d..2da86c2 100644 --- a/comquiz/Models/QuizSheet.cs +++ b/comquiz/Models/QuizSheet.cs @@ -188,7 +188,7 @@ public static List SplitTheQuiz(List originalList, // Sixth equalPieces = 6; - if (quizPart == QUIZPARTIAL.Fifth) + if (quizPart == QUIZPARTIAL.Sixth) { wantTheLastPiece = true; } diff --git a/comquiz/Properties/strings.it.resx b/comquiz/Properties/strings.it.resx index da2318e..cb0e100 100644 --- a/comquiz/Properties/strings.it.resx +++ b/comquiz/Properties/strings.it.resx @@ -196,7 +196,7 @@ Errore durante la lettura del QUIZ - Hai selezionato meno risposte di quanto dovresti. Mettici una pezza. + Hai selezionato meno risposte del dovuto. Selezionane altre dalla lista QUIZ completato. Risultato diff --git a/comquiz/ViewModels/ControlsViewModel.cs b/comquiz/ViewModels/ControlsViewModel.cs new file mode 100644 index 0000000..41e50b9 --- /dev/null +++ b/comquiz/ViewModels/ControlsViewModel.cs @@ -0,0 +1,7 @@ +namespace comquiz.ViewModels +{ + class ControlsViewModel : ViewModelBase + { + + } +} diff --git a/comquiz/ViewModels/MainMenuViewModel.cs b/comquiz/ViewModels/MainMenuViewModel.cs index a7889fd..fbd2047 100644 --- a/comquiz/ViewModels/MainMenuViewModel.cs +++ b/comquiz/ViewModels/MainMenuViewModel.cs @@ -8,7 +8,7 @@ class MainMenuViewModel : ViewModelBase { readonly public MainWindowViewModel MainDatacontext; - public string _version = "v200410"; + public string _version = "v210110"; public string Version { get => _version; diff --git a/comquiz/ViewModels/MainWindowViewModel.cs b/comquiz/ViewModels/MainWindowViewModel.cs index 1003eb3..4286141 100644 --- a/comquiz/ViewModels/MainWindowViewModel.cs +++ b/comquiz/ViewModels/MainWindowViewModel.cs @@ -61,5 +61,10 @@ public void DisplayAboutScreen() MainWindowContent = new AboutScreenViewModel(); } + public void DisplayControlsScreen() + { + MainWindowContent = new ControlsViewModel(); + } + } } diff --git a/comquiz/ViewModels/QuizScreenViewModel.cs b/comquiz/ViewModels/QuizScreenViewModel.cs index c2d806f..5b42dd8 100644 --- a/comquiz/ViewModels/QuizScreenViewModel.cs +++ b/comquiz/ViewModels/QuizScreenViewModel.cs @@ -22,7 +22,13 @@ public QuizSheet CurrentQuiz public QuestionSheet CurrentQuestion { get => _currentQuestion; - set => this.RaiseAndSetIfChanged(ref _currentQuestion, value); + set + { + this.RaiseAndSetIfChanged(ref _currentQuestion, value); + + WarningForNotEnoughAnswer = false; + + } } short _currentQuestionNumber; @@ -53,9 +59,14 @@ public bool SpoilRightAnswer set => this.RaiseAndSetIfChanged(ref _spoilRightAnswer, value); } + bool _warningForNotEnoughAnswer = false; + public bool WarningForNotEnoughAnswer + { + get => _warningForNotEnoughAnswer; + set => this.RaiseAndSetIfChanged(ref _warningForNotEnoughAnswer, value); + } - - + bool QuizIsOver = false; public QuizScreenViewModel(MainWindowViewModel parentDataContext) { @@ -97,7 +108,11 @@ public void ShowAnswers() public void NextQuestion() { - MarkChoosedAnswers(); + + if (CurrentQuestion.NumberOfRightAnswers == SelectedAnswers?.Count) + { + MarkChoosedAnswers(); + } ANSWERED questionStatus = CurrentQuestion.GetQuestionStatus(); @@ -115,7 +130,9 @@ public void NextQuestion() { // QUIZ FINISHED! - DisplayQuizResult(); + if(!QuizIsOver) DisplayQuizResult(); + + QuizIsOver = true; } else @@ -175,15 +192,9 @@ public void DisplayQuizResult() AnsweringEnabled = false; } - public static void ShowNotEnoughAnswersAlert() + public void ShowNotEnoughAnswersAlert() { - var messageBoxStandardWindow = MessageBox.Avalonia.MessageBoxManager.GetMessageBoxStandardWindow( - "( ⚆ _ ⚆ )", - Properties.strings.quizScreen_notEnoughSelectedAnswers, - MessageBox.Avalonia.Enums.ButtonEnum.Ok, - MessageBox.Avalonia.Enums.Icon.Info); - - messageBoxStandardWindow.Show(); + WarningForNotEnoughAnswer = true; } diff --git a/comquiz/Views/AboutScreenView.xaml b/comquiz/Views/AboutScreenView.xaml index ddb7144..db596e5 100644 --- a/comquiz/Views/AboutScreenView.xaml +++ b/comquiz/Views/AboutScreenView.xaml @@ -10,7 +10,7 @@ @@ -37,11 +37,11 @@ - - + A huge thanks to the Avalonia UI community for the tremendous help and understanding they gave me during my learning diff --git a/comquiz/Views/ControlsView.xaml b/comquiz/Views/ControlsView.xaml new file mode 100644 index 0000000..aa7e00d --- /dev/null +++ b/comquiz/Views/ControlsView.xaml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mouse central button (Wheel button) - SHOW RIGHT ANSWERS + + + + + + 1-9 Number buttons, 1-9 Numpad Buttons - SELECT ANSWERS + + + + Right arrow, Enter, Enter (Numpad) - NEXT QUESTION + + + + Spacebar, 0 on Numpad - SHOW RIGHT ANSWERS + + + + Esc - END THE QUIZ + + + + + + + + diff --git a/comquiz/Views/ControlsView.xaml.cs b/comquiz/Views/ControlsView.xaml.cs new file mode 100644 index 0000000..92ad5a5 --- /dev/null +++ b/comquiz/Views/ControlsView.xaml.cs @@ -0,0 +1,20 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace comquiz.Views +{ + public class ControlsView : UserControl + { + public ControlsView() + { + this.InitializeComponent(); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + + } + + } +} diff --git a/comquiz/Views/MainMenuView.xaml b/comquiz/Views/MainMenuView.xaml index 084abe6..81a04f2 100644 --- a/comquiz/Views/MainMenuView.xaml +++ b/comquiz/Views/MainMenuView.xaml @@ -4,8 +4,8 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:localization="clr-namespace:comquiz.Properties" mc:Ignorable="d" - d:DesignWidth="800" - d:DesignHeight="600" + d:DesignWidth="1024" + d:DesignHeight="768" x:Class="comquiz.Views.MainMenuView" xmlns:local="clr-namespace:comquiz"> @@ -25,7 +25,7 @@ - +