Skip to content

Commit

Permalink
completed project
Browse files Browse the repository at this point in the history
  • Loading branch information
marienams committed Jul 17, 2023
1 parent a95d34d commit 1d7c409
Show file tree
Hide file tree
Showing 3,393 changed files with 132,700 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
21 changes: 21 additions & 0 deletions M_MyWordPop2 - Copy - Copy/M_MyWordPop2/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:M_MyWordPop2"
x:Class="M_MyWordPop2.App">
<Application.Resources>
<ResourceDictionary>
<Style x:Key="Styl_Btn" TargetType="Button">
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontAttributes" Value="Bold"/>
<Setter Property="WidthRequest" Value="125"/>
<Setter Property="HeightRequest" Value="50"/>
<Setter Property="Padding" Value="2"/>
</Style>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
69 changes: 69 additions & 0 deletions M_MyWordPop2 - Copy - Copy/M_MyWordPop2/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using System.Collections.ObjectModel;
using System.Text.Json;

namespace M_MyWordPop2;

public partial class App : Application
{

public static ObservableCollection<ScienceTerm> _scienceTerms;
public static ObservableCollection<ScienceTerm> temp;
public static string _dataPath = FileSystem.AppDataDirectory;
public App()
{
InitializeComponent();

MainPage = new AppShell();
}

protected override async void OnStart()
{
base.OnStart();
_scienceTerms = await MyStorage.GetEmbeddedXML<ObservableCollection<ScienceTerm>>("ScienceTerms.xml");
if (_scienceTerms == null)
_scienceTerms = new ObservableCollection<ScienceTerm>();

var file = Path.Combine(App._dataPath, "ScienceTerm.jsn");
string dataString = "";

try
{
dataString = File.ReadAllText(file);
temp = JsonSerializer.Deserialize<ObservableCollection<ScienceTerm>>(dataString);
}
catch (Exception)
{

}

if (temp == null)
temp = new ObservableCollection<ScienceTerm>();

foreach (var item in temp)
{
App._scienceTerms.Add(item);
}


//await Shell.Current.DisplayAlert("hint", $"the data is... ", "OK");
}

//protected override void OnSleep()
//{
// var file = Path.Combine(App._dataPath, "temp_ScienceTerm.jsn");
// string datastring;
// List<string> n_term = new List<string>();
// List<string> n_definition = new List<string>();
// base.OnSleep();

// foreach (var item in App._scienceTerms)
// if (item.isEditable)
// {
// n_term.Add(item.term);
// n_definition.Add(item.definition);
// }
// datastring = JsonSerializer.Serialize(n_term);
// File.WriteAllText(file, dataString);

//}
}
38 changes: 38 additions & 0 deletions M_MyWordPop2 - Copy - Copy/M_MyWordPop2/AppShell.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="M_MyWordPop2.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:M_MyWordPop2"
Shell.FlyoutBehavior="Flyout">


<ShellContent
Title="Home"
Icon="{AppThemeBinding Dark=home_light.png, Light=home_dark.png}"
ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" />

<ShellContent
Title="Terms-Definitions"
Icon="{AppThemeBinding Dark=td_icon_light.png, Light=td_icon_dark.png}"

ContentTemplate="{DataTemplate local:P_TermDefinition}"
Route="Terms-Definitions" />


<ShellContent
Title="Quiz"
Icon="{AppThemeBinding Dark=quiz_icon_light.png, Light=quiz_icon_dark.png}"

ContentTemplate="{DataTemplate local:P_Quiz}"
Route="Quiz" />

<ShellContent
Title="Play"
Icon="{AppThemeBinding Dark=play_icon_light.png, Light=play_icon_dark.png}"
ContentTemplate="{DataTemplate local:P_Play}"
Route="Play" />


</Shell>
9 changes: 9 additions & 0 deletions M_MyWordPop2 - Copy - Copy/M_MyWordPop2/AppShell.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace M_MyWordPop2;

public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
}
}
14 changes: 14 additions & 0 deletions M_MyWordPop2 - Copy - Copy/M_MyWordPop2/Class/Game_Questions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace M_MyWordPop2
{
public class Game_Questions
{
public string questionText { get; set; }
public string answerText { get; set; }
}
}
41 changes: 41 additions & 0 deletions M_MyWordPop2 - Copy - Copy/M_MyWordPop2/Class/MyStorage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace M_MyWordPop2
{
public class MyStorage
{
public static async Task<T> GetEmbeddedXML<T>(string file)
{
try
{
using Stream stream = await FileSystem.OpenAppPackageFileAsync(file);
using (TextReader reader = new StreamReader(stream))
{
XmlSerializer serializer = new XmlSerializer(typeof(T));
return (T)serializer.Deserialize(reader);
}
}

catch (Exception)
{
return default(T);
}
}

public static async Task<string> ReadEmbeddedFile(string file)
{
using Stream stream = await FileSystem.Current.OpenAppPackageFileAsync(file);
if (stream == null)
return default(string);

var data = (new System.IO.StreamReader(stream)).ReadToEnd();
return (string)data;

}
}
}
21 changes: 21 additions & 0 deletions M_MyWordPop2 - Copy - Copy/M_MyWordPop2/Class/Question.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace M_MyWordPop2
{
internal class Question
{
public string questionText { get; set; }

public List<Answer> answers { get; set; }
}

public class Answer
{
public string text { get; set; }
public bool isCorrect { get; set; }
}
}
10 changes: 10 additions & 0 deletions M_MyWordPop2 - Copy - Copy/M_MyWordPop2/Class/ScienceTerm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace M_MyWordPop2
{
public class ScienceTerm
{
public string term { get; set; }
public string definition { get; set; }
public string subject { get; set; }
public bool isEditable { get; set; }
}
}
53 changes: 53 additions & 0 deletions M_MyWordPop2 - Copy - Copy/M_MyWordPop2/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="M_MyWordPop2.MainPage"
NavigationPage.HasBackButton="False"
Title="Welcome">

<ScrollView>
<VerticalStackLayout
Padding="30,0"
Spacing="25"
VerticalOptions="Center">

<Label
Text="Welcome to WordPOP!"
SemanticProperties.HeadingLevel="Level1"
FontSize="Title"
HorizontalOptions="Center"
VerticalOptions="Start"/>
<Image
Source="home.jpg"
SemanticProperties.Description="Source Credit: iStock by Gelly images"
HeightRequest="200"
HorizontalOptions="Center" />



<VerticalStackLayout HorizontalOptions="CenterAndExpand" >
<Label
Text="Learn different terms and their meaning. Create and add new terms and definitions to the Term-Definition directory. Embark on a journey by answering questions and playing a game.Test your knowledge by giving quiz."

FontSize="Micro"
/>
<Label Margin="0,25,0,0"
Text="You can select your option from menu."
FontAttributes="Bold"
FontSize="Small"
/>
<Label
Text=""
FontSize="Micro"
HorizontalOptions="Center"/>
<Label
Text=""
FontSize="Micro"
HorizontalOptions="Center"/>

</VerticalStackLayout>

</VerticalStackLayout>
</ScrollView>

</ContentPage>
15 changes: 15 additions & 0 deletions M_MyWordPop2 - Copy - Copy/M_MyWordPop2/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace M_MyWordPop2;

public partial class MainPage : ContentPage
{
int count = 0;

public MainPage()
{
InitializeComponent();
}



}

18 changes: 18 additions & 0 deletions M_MyWordPop2 - Copy - Copy/M_MyWordPop2/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace M_MyWordPop2;

public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});

return builder.Build();
}
}
32 changes: 32 additions & 0 deletions M_MyWordPop2 - Copy - Copy/M_MyWordPop2/Pages/P_Play.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="M_MyWordPop2.P_Play"
Title="Word POP">

<ContentPage.ToolbarItems>
<ToolbarItem Clicked="game_help_Clicked"/>
</ContentPage.ToolbarItems>
<VerticalStackLayout
Spacing="25"
Padding="30,0"
VerticalOptions="CenterAndExpand">

<Grid>
<Image x:Name="BackgroundImage" Source="gboard.png" Aspect="AspectFill"/>
<Grid x:Name="G_GameBoard" Margin="5" Grid.Row="0" RowDefinitions="*,*,*,*,*,*" ColumnDefinitions="*,*,*,*,*,*">

<Image x:Name="Player" Source="player.png" Grid.Row="5" Grid.Column="0"/>

</Grid>
</Grid>


<Label Text="Write the correct term which has the meaning:"/>
<Label x:Name="Game_question" Text="{Binding questionText}"/>
<Entry x:Name="Entry_answer"/>
<Button x:Name="Btn_CheckAnswer" Text ="Check Answer" Clicked="Btn_CheckAnswer_Clicked"/>


</VerticalStackLayout>
</ContentPage>
Loading

0 comments on commit 1d7c409

Please sign in to comment.