diff --git a/Blazor/Blazor.sln b/Blazor/Blazor.sln index 812049d..2c17fbd 100644 --- a/Blazor/Blazor.sln +++ b/Blazor/Blazor.sln @@ -1,25 +1,25 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.8.34330.188 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor", "Blazor\Blazor.csproj", "{F9B19564-ED8F-49F7-97D7-2132F92DE3C2}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F9B19564-ED8F-49F7-97D7-2132F92DE3C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F9B19564-ED8F-49F7-97D7-2132F92DE3C2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F9B19564-ED8F-49F7-97D7-2132F92DE3C2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F9B19564-ED8F-49F7-97D7-2132F92DE3C2}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {75BB0A32-C002-4B33-88B3-421A9369D9CB} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34330.188 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor", "Blazor\Blazor.csproj", "{F9B19564-ED8F-49F7-97D7-2132F92DE3C2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F9B19564-ED8F-49F7-97D7-2132F92DE3C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9B19564-ED8F-49F7-97D7-2132F92DE3C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9B19564-ED8F-49F7-97D7-2132F92DE3C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9B19564-ED8F-49F7-97D7-2132F92DE3C2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {75BB0A32-C002-4B33-88B3-421A9369D9CB} + EndGlobalSection +EndGlobal diff --git a/Blazor/Blazor/Blazor.csproj b/Blazor/Blazor/Blazor.csproj index 8584edf..a975a06 100644 --- a/Blazor/Blazor/Blazor.csproj +++ b/Blazor/Blazor/Blazor.csproj @@ -1,11 +1,11 @@ - - - - net7.0 - enable - enable - - + + + + net7.0 + enable + enable + + @@ -14,6 +14,6 @@ - - - + + + diff --git a/Blazor/Blazor/Models/ChapterModel.cs b/Blazor/Blazor/Models/ChapterModel.cs new file mode 100644 index 0000000..44915a5 --- /dev/null +++ b/Blazor/Blazor/Models/ChapterModel.cs @@ -0,0 +1,13 @@ +using System.ComponentModel.DataAnnotations; + +namespace Blazor.Models +{ + public class ChapterModel + { + public int Id { get; set; } + + [Required(ErrorMessage = "Name is required")] + [StringLength(50, ErrorMessage = "Name is too long.")] + public string Name { get; set; } + } +} diff --git a/Blazor/Blazor/Models/ChaptersModel.cs b/Blazor/Blazor/Models/ChaptersModel.cs deleted file mode 100644 index 24862f0..0000000 --- a/Blazor/Blazor/Models/ChaptersModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Blazor.Models; - -public class ChaptersModel -{ - public int Id { get; private set; } - public string Name { get; set; } - - public ChaptersModel(int id, string name) - { - Id = id; - Name = name; - } -} diff --git a/Blazor/Blazor/Pages/AddChapter.razor b/Blazor/Blazor/Pages/AddChapter.razor new file mode 100644 index 0000000..3be1097 --- /dev/null +++ b/Blazor/Blazor/Pages/AddChapter.razor @@ -0,0 +1,20 @@ +@page "/addChapter" +@using Blazor.Models + +

Add Chapter

+ + + + + + +

+ +

+ + + +
\ No newline at end of file diff --git a/Blazor/Blazor/Pages/AddChapter.razor.cs b/Blazor/Blazor/Pages/AddChapter.razor.cs new file mode 100644 index 0000000..20e75cf --- /dev/null +++ b/Blazor/Blazor/Pages/AddChapter.razor.cs @@ -0,0 +1,28 @@ +using Blazored.LocalStorage; +using Microsoft.AspNetCore.Components.Forms; +using Microsoft.AspNetCore.Components; +using Blazor.Models; +using Blazor.Services; + +namespace Blazor.Pages +{ + public partial class AddChapter + { + private ChapterModel chapterModel = new(); + + [Inject] + public IDataService DataService { get; set; } + + [Inject] + public NavigationManager NavigationManager { get; set; } + + + private async void HandleValidSubmit() + { + await DataService.Add(chapterModel); + + NavigationManager.NavigateTo("chapters"); + } + + } +} diff --git a/Blazor/Blazor/Pages/Administrators.razor b/Blazor/Blazor/Pages/Administrators.razor new file mode 100644 index 0000000..fdb0252 --- /dev/null +++ b/Blazor/Blazor/Pages/Administrators.razor @@ -0,0 +1,16 @@ +@page "/administrators" +@using Blazorise.DataGrid +@using Blazor.ViewClasses +

Administrators

+ + + + + + diff --git a/Blazor/Blazor/Pages/Administrators.razor.cs b/Blazor/Blazor/Pages/Administrators.razor.cs new file mode 100644 index 0000000..82fb218 --- /dev/null +++ b/Blazor/Blazor/Pages/Administrators.razor.cs @@ -0,0 +1,37 @@ +using Microsoft.AspNetCore.Components; +using Blazorise.DataGrid; +using Blazor.ViewClasses; + +namespace Blazor.Pages +{ + public partial class Administrators + { + public List administrators; + + private int totalItem; + + [Inject] + public HttpClient Http { get; set; } + + [Inject] + public NavigationManager NavigationManager { get; set; } + + private async Task OnReadData(DataGridReadDataEventArgs e) + { + if (e.CancellationToken.IsCancellationRequested) + { + return; + } + + // When you use a real API, we use this follow code + //var response = await Http.GetJsonAsync( $"http://my-api/api/data?page={e.Page}&pageSize={e.PageSize}" ); + var response = (await Http.GetFromJsonAsync($"{NavigationManager.BaseUri}fake-administrator.json")).Skip((e.Page - 1) * e.PageSize).Take(e.PageSize).ToList(); + + if (!e.CancellationToken.IsCancellationRequested) + { + totalItem = (await Http.GetFromJsonAsync>($"{NavigationManager.BaseUri}fake-administrator.json")).Count; + administrators = new List(response); // an actual data for the current page + } + } + } +} diff --git a/Blazor/Blazor/Pages/Chapters.razor b/Blazor/Blazor/Pages/Chapters.razor index d9df7c8..f705ba1 100644 --- a/Blazor/Blazor/Pages/Chapters.razor +++ b/Blazor/Blazor/Pages/Chapters.razor @@ -1,16 +1,30 @@ @page "/chapters" -@using Blazor.Models -

Liste

- -Chapters + +
+ + Ajouter + + + Exporter + +
+ + - - - - + + + + + Editer + + +
\ No newline at end of file diff --git a/Blazor/Blazor/Pages/Chapters.razor.cs b/Blazor/Blazor/Pages/Chapters.razor.cs index cc65a84..be82912 100644 --- a/Blazor/Blazor/Pages/Chapters.razor.cs +++ b/Blazor/Blazor/Pages/Chapters.razor.cs @@ -1,22 +1,25 @@ -using Blazor.Models; -using Blazored.LocalStorage; +using Blazored.LocalStorage; +using Blazorise; +using Blazor.Services; using Blazorise.DataGrid; using ChoETL; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using System.Text; +using Blazor.ViewClasses; namespace Blazor.Pages; public partial class Chapters -{ - private List chapters; + { + public List chapters; private int totalChapter; - [Inject] + [Inject] + public IDataService DataService { get; set; } public IWebHostEnvironment WebHostEnvironment { get; set; } - [Inject] + [Inject] public HttpClient Http { get; set; } [Inject] @@ -36,32 +39,32 @@ public partial class Chapters return; } - var currentData = await LocalStorage.GetItemAsync("data"); + var currentData = await LocalStorage.GetItemAsync("data"); // Check if data exist in the local storage if (currentData == null) { // this code add in the local storage the fake data (we load the data sync for initialize the data before load the OnReadData method) - var originalData = Http.GetFromJsonAsync($"https://trusting-panini.87-106-126-109.plesk.page/api/chapters").Result; + var originalData = Http.GetFromJsonAsync($"https://trusting-panini.87-106-126-109.plesk.page/api/chapters").Result; await LocalStorage.SetItemAsync("data", originalData); } } - private async Task OnReadData(DataGridReadDataEventArgs e) - { - if (e.CancellationToken.IsCancellationRequested) + private async Task OnReadData(DataGridReadDataEventArgs e) { - return; - } + if (e.CancellationToken.IsCancellationRequested) + { + return; + } // When you use a real API, we use this follow code //var response = await Http.GetFromJsonAsync( $"https://trusting-panini.87-106-126-109.plesk.page/api/chapters?page={e.Page}&pageSize={e.PageSize}" ); - var response = Http.GetFromJsonAsync($"https://trusting-panini.87-106-126-109.plesk.page/api/chapters").Result; + var response = Http.GetFromJsonAsync($"https://trusting-panini.87-106-126-109.plesk.page/api/chapters").Result; - if (!e.CancellationToken.IsCancellationRequested) - { - totalChapter = (await LocalStorage.GetItemAsync>("data")).Count; - chapters = new List(response); // an actual data for the current page + if (!e.CancellationToken.IsCancellationRequested) + { + totalChapter = (await LocalStorage.GetItemAsync>("data")).Count; + chapters = new List(response); // an actual data for the current page } } @@ -76,7 +79,7 @@ public partial class Chapters { csvFile.Write(jsonFile); } - } + } var sentFile = new MemoryStream(Encoding.UTF32.GetBytes(sb.ToString())); @@ -85,4 +88,4 @@ public partial class Chapters await IJSRuntime.InvokeVoidAsync("downloadFileFromStream", "data.csv", streamRef); } } -} \ No newline at end of file +} diff --git a/Blazor/Blazor/Pages/EditChapter.razor b/Blazor/Blazor/Pages/EditChapter.razor new file mode 100644 index 0000000..c1f51ba --- /dev/null +++ b/Blazor/Blazor/Pages/EditChapter.razor @@ -0,0 +1,18 @@ +@page "/editChapter/{Id:int}" + +

Edit Chapter

+ + + + + + +

+ +

+ + +
\ No newline at end of file diff --git a/Blazor/Blazor/Pages/EditChapter.razor.cs b/Blazor/Blazor/Pages/EditChapter.razor.cs new file mode 100644 index 0000000..52af970 --- /dev/null +++ b/Blazor/Blazor/Pages/EditChapter.razor.cs @@ -0,0 +1,42 @@ +using Blazor.Models; +using Blazor.Services; +using Microsoft.AspNetCore.Components; + +namespace Blazor.Pages +{ + public partial class EditChapter + { + [Parameter] + public int Id { get; set; } + + private ChapterModel chapterModel = new(); + + [Inject] + public IDataService DataService { get; set; } + + [Inject] + public NavigationManager NavigationManager { get; set; } + + [Inject] + public IWebHostEnvironment WebHostEnvironment { get; set; } + + protected override async Task OnInitializedAsync() + { + var chapter = await DataService.GetById(Id); + + // Set the model with the chapter + chapterModel = new ChapterModel + { + Id = chapter.Id, + Name = chapter.Name + }; + } + + private async void HandleValidSubmit() + { + await DataService.Update(Id, chapterModel); + + NavigationManager.NavigateTo("chapters"); + } + } +} diff --git a/Blazor/Blazor/Program.cs b/Blazor/Blazor/Program.cs index be52cc7..5c73e4b 100644 --- a/Blazor/Blazor/Program.cs +++ b/Blazor/Blazor/Program.cs @@ -1,4 +1,5 @@ using Blazor.Data; +using Blazor.Services; using Blazored.LocalStorage; using Blazorise; using Blazorise.Bootstrap; @@ -20,6 +21,17 @@ builder.Services .AddFontAwesomeIcons(); builder.Services.AddBlazoredLocalStorage(); +builder.Services.AddHttpClient(); + +builder.Services + .AddBlazorise() + .AddBootstrapProviders() + .AddFontAwesomeIcons(); + +builder.Services.AddBlazoredLocalStorage(); + +builder.Services.AddScoped(); + var app = builder.Build(); // Configure the HTTP request pipeline. diff --git a/Blazor/Blazor/Services/DataLocalService.cs b/Blazor/Blazor/Services/DataLocalService.cs new file mode 100644 index 0000000..6a4c64a --- /dev/null +++ b/Blazor/Blazor/Services/DataLocalService.cs @@ -0,0 +1,119 @@ +using Blazor.Models; +using Blazor.ViewClasses; +using Blazored.LocalStorage; +using Microsoft.AspNetCore.Components; + +namespace Blazor.Services +{ + public class DataLocalService : IDataService + { + private readonly HttpClient _http; + private readonly ILocalStorageService _localStorage; + private readonly NavigationManager _navigationManager; + private readonly IWebHostEnvironment _webHostEnvironment; + + public DataLocalService( + ILocalStorageService localStorage, + HttpClient http, + IWebHostEnvironment webHostEnvironment, + NavigationManager navigationManager) + { + _localStorage = localStorage; + _http = http; + _webHostEnvironment = webHostEnvironment; + _navigationManager = navigationManager; + } + + public async Task GetById(int id) + { + // Get the current data + var currentData = await _localStorage.GetItemAsync>("data"); + + // Get the chapter int the list + var chapter = currentData.FirstOrDefault(w => w.Id == id); + + // Check if chapter exist + if (chapter == null) + { + throw new Exception($"Unable to found the item with ID: {id}"); + } + + return chapter; + } + + public async Task Update(int id, ChapterModel model) + { + // Get the current data + var currentData = await _localStorage.GetItemAsync>("data"); + + // Get the chapter int the list + var chapter = currentData.FirstOrDefault(w => w.Id == id); + + // Check if chapter exist + if (chapter == null) + { + throw new Exception($"Unable to found the item with ID: {id}"); + } + + // Modify the content of the chapter + chapter.Name = model.Name; + + // Save the data + await _localStorage.SetItemAsync("data", currentData); + } + + + public async Task Add(ChapterModel model) + { + // Get the current data + var currentData = await _localStorage.GetItemAsync>("data"); + + // Simulate the Id + model.Id = currentData.Max(s => s.Id) + 1; + + // Add the chapter to the current data + currentData.Add(new Chapter + { + Id = model.Id, + Name = model.Name + }); + + + // Save the data + await _localStorage.SetItemAsync("data", currentData); + } + + + public async Task Count() + { + // Load data from the local storage + var currentData = await _localStorage.GetItemAsync("data"); + + // Check if data exist in the local storage + if (currentData == null) + { + // this code add in the local storage the fake data + var originalData = await _http.GetFromJsonAsync($"{_navigationManager.BaseUri}fake-data.json"); + await _localStorage.SetItemAsync("data", originalData); + } + + return (await _localStorage.GetItemAsync("data")).Length; + } + + public async Task> List(int currentPage, int pageSize) + { + // Load data from the local storage + var currentData = await _localStorage.GetItemAsync("data"); + + // Check if data exist in the local storage + if (currentData == null) + { + // this code add in the local storage the fake data + var originalData = await _http.GetFromJsonAsync($"{_navigationManager.BaseUri}fake-data.json"); + await _localStorage.SetItemAsync("data", originalData); + } + + return (await _localStorage.GetItemAsync("data")).Skip((currentPage - 1) * pageSize).Take(pageSize).ToList(); + } + } +} diff --git a/Blazor/Blazor/Services/IDataService.cs b/Blazor/Blazor/Services/IDataService.cs new file mode 100644 index 0000000..580e304 --- /dev/null +++ b/Blazor/Blazor/Services/IDataService.cs @@ -0,0 +1,18 @@ +using Blazor.Models; +using Blazor.ViewClasses; + +namespace Blazor.Services +{ + public interface IDataService + { + Task Add(ChapterModel model); + + Task Count(); + + Task> List(int currentPage, int pageSize); + + Task GetById(int id); + + Task Update(int id, ChapterModel model); + } +} diff --git a/Blazor/Blazor/Shared/NavMenu.razor b/Blazor/Blazor/Shared/NavMenu.razor index 617155c..6c502bb 100644 --- a/Blazor/Blazor/Shared/NavMenu.razor +++ b/Blazor/Blazor/Shared/NavMenu.razor @@ -15,18 +15,18 @@ diff --git a/Blazor/Blazor/ViewClasses/Administrator.cs b/Blazor/Blazor/ViewClasses/Administrator.cs new file mode 100644 index 0000000..e0ec189 --- /dev/null +++ b/Blazor/Blazor/ViewClasses/Administrator.cs @@ -0,0 +1,15 @@ +namespace Blazor.ViewClasses; + +public class Administrator +{ + public int Id { get; private set; } + public string Username { get; private set; } + public string hashedPassword { get; set; } + + public Administrator(int id, string username, string hashedPassword) + { + Id = id; + Username = username; + this.hashedPassword = hashedPassword; + } +} diff --git a/Blazor/Blazor/ViewClasses/Answer.cs b/Blazor/Blazor/ViewClasses/Answer.cs new file mode 100644 index 0000000..d14ebff --- /dev/null +++ b/Blazor/Blazor/ViewClasses/Answer.cs @@ -0,0 +1,15 @@ +namespace Blazor.ViewClasses; + +public class Answer +{ + public int Id { get; private set; } + public string Content { get; set; } + public int IdQuestion { get; private set; } + + public Answer(int id, string content, int idQuestion) + { + Id = id; + Content = content; + IdQuestion = idQuestion; + } +} diff --git a/Blazor/Blazor/ViewClasses/Chapter.cs b/Blazor/Blazor/ViewClasses/Chapter.cs new file mode 100644 index 0000000..942eb72 --- /dev/null +++ b/Blazor/Blazor/ViewClasses/Chapter.cs @@ -0,0 +1,7 @@ +namespace Blazor.ViewClasses; + +public class Chapter +{ + public int Id { get; set; } + public string Name { get; set; } +} diff --git a/Blazor/Blazor/ViewClasses/Player.cs b/Blazor/Blazor/ViewClasses/Player.cs new file mode 100644 index 0000000..7fd1f4e --- /dev/null +++ b/Blazor/Blazor/ViewClasses/Player.cs @@ -0,0 +1,16 @@ +namespace Blazor.ViewClasses; + +public class Player +{ + public int Id { get; private set; } + public string Nickname { get; private set; } + public string HashedPassword { get; set; } + + public Player(int id, string nickname, string hashedPassword) + { + Id = id; + Nickname = nickname; + HashedPassword = hashedPassword; + } + +} diff --git a/Blazor/Blazor/ViewClasses/Question.cs b/Blazor/Blazor/ViewClasses/Question.cs new file mode 100644 index 0000000..db4e7bf --- /dev/null +++ b/Blazor/Blazor/ViewClasses/Question.cs @@ -0,0 +1,21 @@ +namespace Blazor.ViewClasses; + +public class Question +{ + public int Id { get; private set; } + public string Content { get; set; } + public int IdChapter { get; set; } + public int IdAnswerGood { get; set; } + public int Difficulty { get; set; } + public int nbFails { get; set; } + + public Question(int id, string content, int idChapter, int idAnswerGood, int difficulty, int nbFails = 0) + { + Id = id; + Content = content; + IdChapter = idChapter; + IdAnswerGood = idAnswerGood; + Difficulty = difficulty; + this.nbFails = nbFails; + } +} diff --git a/Blazor/Blazor/wwwroot/fake-administrator.json b/Blazor/Blazor/wwwroot/fake-administrator.json new file mode 100644 index 0000000..e0baf20 --- /dev/null +++ b/Blazor/Blazor/wwwroot/fake-administrator.json @@ -0,0 +1,27 @@ +[ + { + "id": 0, + "username": "Hanson", + "hashedPassword": "72c16674-9714-4732-b2f9-02246eac94b3" + }, + { + "id": 1, + "username": "Brooks", + "hashedPassword": "ac731db9-c84e-4718-9cd8-2f289af936fa" + }, + { + "id": 2, + "username": "Kent", + "hashedPassword": "8984e672-9ad1-471c-93bb-7cb411d00694" + }, + { + "id": 3, + "username": "Reese", + "hashedPassword": "5eaa711d-1569-451a-aba8-d6681012f210" + }, + { + "id": 4, + "username": "Lyons", + "hashedPassword": "80888287-eaa5-403a-bdd5-6a4e952b93ec" + } +] \ No newline at end of file diff --git a/Blazor/Blazor/wwwroot/fake-answer.json b/Blazor/Blazor/wwwroot/fake-answer.json new file mode 100644 index 0000000..dc4adee --- /dev/null +++ b/Blazor/Blazor/wwwroot/fake-answer.json @@ -0,0 +1,122 @@ +[ + { + "id": 0, + "content": "Irure irure nostrud consectetur eiusmod nostrud ipsum eu reprehenderit fugiat commodo ea.", + "idQuestion": 2 + }, + { + "id": 1, + "content": "Sint culpa dolor officia cillum nostrud ullamco pariatur ullamco nostrud magna dolor amet.", + "idQuestion": 3 + }, + { + "id": 2, + "content": "Aliquip in irure dolor sint magna consectetur minim pariatur consequat.", + "idQuestion": 4 + }, + { + "id": 3, + "content": "In in amet proident eu.", + "idQuestion": 5 + }, + { + "id": 4, + "content": "Nulla eiusmod laborum ipsum sint.", + "idQuestion": 6 + }, + { + "id": 5, + "content": "Anim quis tempor do cillum nisi.", + "idQuestion": 7 + }, + { + "id": 6, + "content": "Culpa ipsum velit excepteur quis incididunt do cupidatat ad consequat voluptate nulla.", + "idQuestion": 8 + }, + { + "id": 7, + "content": "Ut non culpa duis amet pariatur deserunt irure qui.", + "idQuestion": 9 + }, + { + "id": 8, + "content": "Proident irure ad voluptate in eiusmod nostrud deserunt veniam enim voluptate laboris commodo et.", + "idQuestion": 10 + }, + { + "id": 9, + "content": "Ea est deserunt amet deserunt pariatur veniam incididunt.", + "idQuestion": 11 + }, + { + "id": 10, + "content": "Anim velit eiusmod duis sunt.", + "idQuestion": 12 + }, + { + "id": 11, + "content": "Exercitation laboris nisi eu enim in ullamco.", + "idQuestion": 13 + }, + { + "id": 12, + "content": "Commodo incididunt nulla aliqua irure consequat eu quis labore reprehenderit pariatur.", + "idQuestion": 14 + }, + { + "id": 13, + "content": "Anim laborum Lorem irure nostrud.", + "idQuestion": 15 + }, + { + "id": 14, + "content": "Ullamco veniam commodo anim incididunt.", + "idQuestion": 16 + }, + { + "id": 15, + "content": "Exercitation reprehenderit sit aliqua cupidatat est ad exercitation eiusmod enim non.", + "idQuestion": 17 + }, + { + "id": 16, + "content": "Ex commodo cillum anim non nisi Lorem amet reprehenderit duis sunt enim dolor tempor dolore.", + "idQuestion": 18 + }, + { + "id": 17, + "content": "Sint nulla amet anim veniam Lorem labore sunt fugiat.", + "idQuestion": 19 + }, + { + "id": 18, + "content": "Labore dolore cillum esse culpa quis cillum nisi.", + "idQuestion": 20 + }, + { + "id": 19, + "content": "Do ullamco sit aute quis consequat sit adipisicing non.", + "idQuestion": 21 + }, + { + "id": 20, + "content": "Velit anim adipisicing ut in reprehenderit sint voluptate enim.", + "idQuestion": 22 + }, + { + "id": 21, + "content": "Cillum tempor cillum ad dolore enim dolor minim aliqua et mollit.", + "idQuestion": 23 + }, + { + "id": 22, + "content": "Cillum et eu velit ipsum veniam velit voluptate sint.", + "idQuestion": 24 + }, + { + "id": 23, + "content": "Adipisicing ullamco minim sunt minim eu tempor fugiat.", + "idQuestion": 25 + } +] \ No newline at end of file diff --git a/Blazor/Blazor/wwwroot/fake-data.json b/Blazor/Blazor/wwwroot/fake-data.json new file mode 100644 index 0000000..fa487ca --- /dev/null +++ b/Blazor/Blazor/wwwroot/fake-data.json @@ -0,0 +1,98 @@ +[ + { + "id": 1, + "name": "Zilla" + }, + { + "id": 2, + "name": "Silodyne" + }, + { + "id": 3, + "name": "Zolarity" + }, + { + "id": 4, + "name": "Straloy" + }, + { + "id": 5, + "name": "Extro" + }, + { + "id": 6, + "name": "Prosely" + }, + { + "id": 7, + "name": "Orbalix" + }, + { + "id": 8, + "name": "Hatology" + }, + { + "id": 9, + "name": "Exodoc" + }, + { + "id": 10, + "name": "Cinaster" + }, + { + "id": 11, + "name": "Toyletry" + }, + { + "id": 12, + "name": "Combogene" + }, + { + "id": 13, + "name": "Olympix" + }, + { + "id": 14, + "name": "Emoltra" + }, + { + "id": 15, + "name": "Macronaut" + }, + { + "id": 16, + "name": "Genekom" + }, + { + "id": 17, + "name": "Zaya" + }, + { + "id": 18, + "name": "Elentrix" + }, + { + "id": 19, + "name": "Comvex" + }, + { + "id": 20, + "name": "Exozent" + }, + { + "id": 21, + "name": "Fuelworks" + }, + { + "id": 22, + "name": "Splinx" + }, + { + "id": 23, + "name": "Greeker" + }, + { + "id": 24, + "name": "Martgo" + } +] \ No newline at end of file diff --git a/Blazor/Blazor/wwwroot/fake-player.json b/Blazor/Blazor/wwwroot/fake-player.json new file mode 100644 index 0000000..16e4112 --- /dev/null +++ b/Blazor/Blazor/wwwroot/fake-player.json @@ -0,0 +1,122 @@ +[ + { + "id": 0, + "nickname": "Hansen", + "hashedPassword": "c0596995-7e50-4834-a77e-9347ec026e85" + }, + { + "id": 1, + "nickname": "Lang", + "hashedPassword": "9122e1d3-3694-401a-9f63-cfe3dbd177bb" + }, + { + "id": 2, + "nickname": "Ryan", + "hashedPassword": "3510729e-320c-4f6e-b1ce-b10147546fd3" + }, + { + "id": 3, + "nickname": "Crane", + "hashedPassword": "f8a2ed56-2ded-4e64-9c28-b5e7a0b9fd78" + }, + { + "id": 4, + "nickname": "Chapman", + "hashedPassword": "15ac493a-082d-41d9-b51e-9c5bccf187fe" + }, + { + "id": 5, + "nickname": "Johnson", + "hashedPassword": "547212b8-d7a9-44b7-aca3-8fcc0f7e0e09" + }, + { + "id": 6, + "nickname": "Delacruz", + "hashedPassword": "0549757b-4e48-4d26-b7cf-0b4b98112bc4" + }, + { + "id": 7, + "nickname": "Morgan", + "hashedPassword": "3af38de1-d146-4543-b043-1f02047b007e" + }, + { + "id": 8, + "nickname": "Branch", + "hashedPassword": "11d4bdb3-09b5-4d2b-9919-6156a7a29964" + }, + { + "id": 9, + "nickname": "Burke", + "hashedPassword": "8ea58c7f-9f3f-4d90-96d8-4b510adbc101" + }, + { + "id": 10, + "nickname": "Austin", + "hashedPassword": "cc78f75a-9d0e-457d-8387-ad50c2ef6efb" + }, + { + "id": 11, + "nickname": "Tillman", + "hashedPassword": "914d5a73-ecf5-42f6-97b2-8dbaf33ea6fc" + }, + { + "id": 12, + "nickname": "Horn", + "hashedPassword": "eebda4ec-03b4-43f4-8d70-e43f07e57778" + }, + { + "id": 13, + "nickname": "Jimenez", + "hashedPassword": "bff63c4d-3abd-4a7f-9e9c-3faa9c6b78e6" + }, + { + "id": 14, + "nickname": "Mcgee", + "hashedPassword": "c9a07cd8-a6d5-41ac-ae33-cc6a7a03bb5e" + }, + { + "id": 15, + "nickname": "Myers", + "hashedPassword": "0f50e6ba-fdff-4ca2-b392-017c3c2f38c0" + }, + { + "id": 16, + "nickname": "Sheppard", + "hashedPassword": "4be1c0a0-e6e3-45b4-891b-5e38e8f59b90" + }, + { + "id": 17, + "nickname": "Fry", + "hashedPassword": "311fe759-a828-4897-a5e8-57e2b2a2facd" + }, + { + "id": 18, + "nickname": "Blake", + "hashedPassword": "5bb55837-3c16-4ffc-8040-a47d14ca20ea" + }, + { + "id": 19, + "nickname": "Cantrell", + "hashedPassword": "3e63dfba-d582-42ab-83ad-7f1e400402c7" + }, + { + "id": 20, + "nickname": "Hull", + "hashedPassword": "434ce85b-e771-43f9-b191-6aa4bf1ea558" + }, + { + "id": 21, + "nickname": "Zimmerman", + "hashedPassword": "d8a18696-427d-4dac-b755-549163213360" + }, + { + "id": 22, + "nickname": "Contreras", + "hashedPassword": "9cb65a26-0fe7-436f-bbfa-d7a198f7b308" + }, + { + "id": 23, + "nickname": "Erickson", + "hashedPassword": "4086ca22-96db-4a74-8228-539228e7563d" + } +] \ No newline at end of file diff --git a/Blazor/Blazor/wwwroot/fake-question.json b/Blazor/Blazor/wwwroot/fake-question.json new file mode 100644 index 0000000..6cf2e9d --- /dev/null +++ b/Blazor/Blazor/wwwroot/fake-question.json @@ -0,0 +1,194 @@ +[ + { + "id": 0, + "content": "Pariatur cupidatat et magna et duis labore.", + "idChapter": 1, + "idAnswerGood": 2, + "difficulty": 2, + "nbFails": 9 + }, + { + "id": 1, + "content": "Sit adipisicing sunt exercitation fugiat velit nisi ipsum aliqua.", + "idChapter": 2, + "idAnswerGood": 3, + "difficulty": 2, + "nbFails": 3 + }, + { + "id": 2, + "content": "Do ut fugiat excepteur sunt et elit do.", + "idChapter": 3, + "idAnswerGood": 4, + "difficulty": 1, + "nbFails": 8 + }, + { + "id": 3, + "content": "Enim ad incididunt consectetur nostrud culpa sint magna esse ad officia tempor aliquip elit.", + "idChapter": 4, + "idAnswerGood": 5, + "difficulty": 3, + "nbFails": 6 + }, + { + "id": 4, + "content": "Incididunt dolore in consequat laboris voluptate.", + "idChapter": 5, + "idAnswerGood": 6, + "difficulty": 1, + "nbFails": 5 + }, + { + "id": 5, + "content": "Est magna mollit do proident irure excepteur ex est sit tempor id.", + "idChapter": 6, + "idAnswerGood": 7, + "difficulty": 1, + "nbFails": 4 + }, + { + "id": 6, + "content": "Ex consectetur do anim pariatur magna in proident et minim nulla deserunt aliqua veniam.", + "idChapter": 7, + "idAnswerGood": 8, + "difficulty": 1, + "nbFails": 4 + }, + { + "id": 7, + "content": "Qui officia commodo sint cupidatat.", + "idChapter": 8, + "idAnswerGood": 9, + "difficulty": 3, + "nbFails": 7 + }, + { + "id": 8, + "content": "Esse minim reprehenderit eu laboris amet eu mollit.", + "idChapter": 9, + "idAnswerGood": 10, + "difficulty": 1, + "nbFails": 1 + }, + { + "id": 9, + "content": "Tempor sit proident cupidatat in qui dolor culpa do exercitation voluptate in laboris eu.", + "idChapter": 10, + "idAnswerGood": 11, + "difficulty": 2, + "nbFails": 9 + }, + { + "id": 10, + "content": "Incididunt Lorem quis qui excepteur.", + "idChapter": 11, + "idAnswerGood": 12, + "difficulty": 2, + "nbFails": 10 + }, + { + "id": 11, + "content": "Amet culpa ipsum officia esse minim esse.", + "idChapter": 12, + "idAnswerGood": 13, + "difficulty": 2, + "nbFails": 5 + }, + { + "id": 12, + "content": "Eiusmod enim occaecat id duis Lorem nostrud laborum minim veniam ipsum ipsum ipsum cupidatat duis.", + "idChapter": 13, + "idAnswerGood": 14, + "difficulty": 3, + "nbFails": 3 + }, + { + "id": 13, + "content": "Adipisicing consequat laborum tempor ad eu nulla nulla veniam.", + "idChapter": 14, + "idAnswerGood": 15, + "difficulty": 2, + "nbFails": 4 + }, + { + "id": 14, + "content": "Commodo qui fugiat quis ea ad excepteur dolor proident laboris fugiat.", + "idChapter": 15, + "idAnswerGood": 16, + "difficulty": 3, + "nbFails": 8 + }, + { + "id": 15, + "content": "Culpa cupidatat fugiat in ad esse excepteur esse dolor id occaecat tempor cupidatat exercitation magna.", + "idChapter": 16, + "idAnswerGood": 17, + "difficulty": 3, + "nbFails": 2 + }, + { + "id": 16, + "content": "Sunt ex non anim ut veniam nulla excepteur.", + "idChapter": 17, + "idAnswerGood": 18, + "difficulty": 3, + "nbFails": 7 + }, + { + "id": 17, + "content": "Mollit eiusmod enim sunt eiusmod ad et velit.", + "idChapter": 18, + "idAnswerGood": 19, + "difficulty": 2, + "nbFails": 3 + }, + { + "id": 18, + "content": "Aliqua deserunt nulla veniam reprehenderit pariatur ut incididunt laboris laborum est.", + "idChapter": 19, + "idAnswerGood": 20, + "difficulty": 3, + "nbFails": 7 + }, + { + "id": 19, + "content": "Velit commodo adipisicing sunt nisi sunt.", + "idChapter": 20, + "idAnswerGood": 21, + "difficulty": 1, + "nbFails": 8 + }, + { + "id": 20, + "content": "Ad culpa mollit consequat nostrud ut quis excepteur aliqua.", + "idChapter": 21, + "idAnswerGood": 22, + "difficulty": 2, + "nbFails": 8 + }, + { + "id": 21, + "content": "Aliqua nostrud amet pariatur consectetur.", + "idChapter": 22, + "idAnswerGood": 23, + "difficulty": 3, + "nbFails": 2 + }, + { + "id": 22, + "content": "Enim voluptate enim enim irure qui labore ea adipisicing ex.", + "idChapter": 23, + "idAnswerGood": 24, + "difficulty": 3, + "nbFails": 5 + }, + { + "id": 23, + "content": "Aute magna sint ut pariatur non.", + "idChapter": 24, + "idAnswerGood": 25, + "difficulty": 2, + "nbFails": 8 + } +] \ No newline at end of file