diff --git a/Bases/LessonTypeBase.cs b/Bases/LessonTypeBase.cs
index 30309f4..125288f 100644
--- a/Bases/LessonTypeBase.cs
+++ b/Bases/LessonTypeBase.cs
@@ -9,6 +9,9 @@ public class LessonTypeBase : ComponentBase
[Inject]
public ProfileService Profile { get; set; } = default!;
+
+ [Inject]
+ public TextToSpeechService TTS { get; set; } = default!;
[Parameter, EditorRequired]
public LessonLogic Logic { get; set; } = default!;
@@ -32,5 +35,10 @@ public bool NotReady()
return false;
}
+
+ public void PlayOneShot()
+ {
+ _ = TTS.Speak(Logic.Included[0].RU);
+ }
}
}
diff --git a/Components/LessonButton.razor b/Components/LearnPage/LessonButton.razor
similarity index 100%
rename from Components/LessonButton.razor
rename to Components/LearnPage/LessonButton.razor
diff --git a/Components/LessonButton.razor.css b/Components/LearnPage/LessonButton.razor.css
similarity index 100%
rename from Components/LessonButton.razor.css
rename to Components/LearnPage/LessonButton.razor.css
diff --git a/Components/LessonRow1.razor b/Components/LearnPage/LessonRow1.razor
similarity index 100%
rename from Components/LessonRow1.razor
rename to Components/LearnPage/LessonRow1.razor
diff --git a/Components/LessonRow2.razor b/Components/LearnPage/LessonRow2.razor
similarity index 100%
rename from Components/LessonRow2.razor
rename to Components/LearnPage/LessonRow2.razor
diff --git a/Components/LessonRow3.razor b/Components/LearnPage/LessonRow3.razor
similarity index 100%
rename from Components/LessonRow3.razor
rename to Components/LearnPage/LessonRow3.razor
diff --git a/Components/SectionHeader.razor b/Components/LearnPage/SectionHeader.razor
similarity index 100%
rename from Components/SectionHeader.razor
rename to Components/LearnPage/SectionHeader.razor
diff --git a/Components/LessonType_Select.razor b/Components/LessonPage/LessonType_Select.razor
similarity index 91%
rename from Components/LessonType_Select.razor
rename to Components/LessonPage/LessonType_Select.razor
index 1f3ed0a..1163c37 100644
--- a/Components/LessonType_Select.razor
+++ b/Components/LessonPage/LessonType_Select.razor
@@ -8,8 +8,10 @@
@if (FindEnglish)
{
-
-
@{
VocabHeader Term = Logic.Included[0];
-
@Term.EN
-
}
@@ -28,6 +26,7 @@
protected override void OnInitialized()
{
+ PlayOneShot();
NormalIndex = Rand.Next(0, 4);
Generated.Add(Logic.Included[0].RU);
}
diff --git a/Components/OpenMojiWatermark.razor b/Components/LessonPage/OpenMojiWatermark.razor
similarity index 100%
rename from Components/OpenMojiWatermark.razor
rename to Components/LessonPage/OpenMojiWatermark.razor
diff --git a/Components/VocabIcon.razor b/Components/LessonPage/VocabIcon.razor
similarity index 100%
rename from Components/VocabIcon.razor
rename to Components/LessonPage/VocabIcon.razor
diff --git a/Components/LessonTypeMatch.txt b/Components/LessonTypeMatch.txt
deleted file mode 100644
index 6215a7c..0000000
--- a/Components/LessonTypeMatch.txt
+++ /dev/null
@@ -1,162 +0,0 @@
-@inject LessonService Lessons
-@inject ProfileService Profile
-
-
Select Matching Words
-
-@if (State == null)
-{
- return;
-}
-
-@if(State.Key != "")
-{
-
-
- @for (int i = 0; i < Lessons.LessonHeaders[State.Key].Vocab.Count; i++)
- {
- int Index = i;
- VocabHeader Item = Lessons.VocabHeaders[Lessons.LessonHeaders[State.Key].Vocab[Index]];
-
- }
-
-
- @for (int i = 0; i < Lessons.LessonHeaders[State.Key].Vocab.Count; i++)
- {
- int Index = i;
- VocabHeader Item = Lessons.VocabHeaders[Lessons.LessonHeaders[State.Key].Vocab[Index]];
-
- }
-
-
-} else
-{
-
-}
-
-
-
-@code
-{
- [Parameter, EditorRequired]
- public LessonStateData State {get; set;} = default!;
-
- [Parameter]
- public EventCallback
StateChanged { get; set; }
-
- [Parameter, EditorRequired]
- public Action? OnFinish { get; set; }
-
- string Active = "";
-
- void Select(string Chosen)
- {
- if (Active == "")
- {
- Active = Chosen;
- }
- else
- {
- if (Lessons.VocabHeaders.ContainsKey(Chosen)) //if Chosen is Russian
- {
- if (!Lessons.VocabHeaders.ContainsKey(Active)) //if Active is English
- {
-
- if (Lessons.VocabHeaders[Chosen].EN == Active)
- {
- State.Tested.Add(Chosen);
- State.Results.Add(true);
- StateChanged.InvokeAsync(State);
-
- Active = "";
- }
- else
- {
- //State.Tested.Add(Chosen);
- //State.Results.Add(false);
- //StateChanged.InvokeAsync(State);
-
- Active = "";
- }
- }
- else
- {
- Active = Chosen;
- }
- }
- else //if Chosen is English
- {
- if (Lessons.VocabHeaders.ContainsKey(Active)) //if Active is Russian
- {
- if (Lessons.VocabHeaders[Active].EN == Chosen)
- {
- State.Tested.Add(Active);
- State.Results.Add(true);
- StateChanged.InvokeAsync(State);
-
- Active = "";
- }
- else
- {
-
- //State.Tested.Add(Active);
- //State.Results.Add(false);
- //StateChanged.InvokeAsync(State);
-
- Active = "";
- }
- }
- else
- {
- Active = Chosen;
- }
- }
- }
-
- if (State.Tested.Count == Lessons.LessonHeaders[State.Key].Vocab.Count)
- OnFinish?.Invoke();
-
- /*
- if (RightSelected != -1)
- {
- if (Index == RightSelected)
- {
- State.Tested.Add(Lessons.LessonHeaders[State.Key].Vocab[Index]);
- State.Results.Add(true);
- StateChanged.InvokeAsync(State);
-
- LeftSelected = -1;
- RightSelected = -1;
-
- if (State.Tested.Count == Lessons.LessonHeaders[State.Key].Vocab.Count)
- OnFinish?.Invoke();
- }
- else
- {
- LeftSelected = Index;
- }
- }*/
- }
- }
\ No newline at end of file
diff --git a/Components/NoLearnedTerms.razor b/Components/NoLearnedTerms.razor
index 226f976..fc13c88 100644
--- a/Components/NoLearnedTerms.razor
+++ b/Components/NoLearnedTerms.razor
@@ -2,5 +2,5 @@
You haven't learned any terms.
-
+
\ No newline at end of file
diff --git a/Components/TermProgress.razor b/Components/ProgressPage/TermProgress.razor
similarity index 100%
rename from Components/TermProgress.razor
rename to Components/ProgressPage/TermProgress.razor
diff --git a/Pages/DeveloperPage.razor b/Pages/DeveloperPage.razor
index 68992d9..8ae6fa6 100644
--- a/Pages/DeveloperPage.razor
+++ b/Pages/DeveloperPage.razor
@@ -1,5 +1,6 @@
@page "/developer"
@using Vetra.Components
+@using Vetra.Components.ProgressPage
@using System.Text.Json
@using System.Text.Encodings.Web;
@using System.Linq;
@@ -120,7 +121,6 @@
string Status = "";
string AllKeys = "";
string EditTerm = "";
- string TermStatus = "";
protected override void OnInitialized()
{
diff --git a/Pages/LearnPage.razor b/Pages/LearnPage.razor
index fe67db0..5f523bc 100644
--- a/Pages/LearnPage.razor
+++ b/Pages/LearnPage.razor
@@ -1,5 +1,5 @@
@page "/"
-@using Vetra.Components
+@using Vetra.Components.LearnPage