From 2f32bb42eebcebf049b3fb440289a0811e97081c Mon Sep 17 00:00:00 2001 From: Kevin MONDEJAR Date: Wed, 29 Jan 2025 11:57:09 +0100 Subject: [PATCH] Page gestion quiz + ajout quiz admin (ne pas aller sur les page elle font planter le site pour l'instant) --- WF-WebAdmin/WF-WebAdmin/Model/Quiz.cs | 27 ++++ WF-WebAdmin/WF-WebAdmin/Model/QuizModel.cs | 30 ++++ WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor | 58 +++++++ .../WF-WebAdmin/Pages/AddQuiz.razor.cs | 36 +++++ .../WF-WebAdmin/Pages/DeleteUser.razor | 2 +- .../WF-WebAdmin/Pages/DeleteUser.razor.cs | 13 +- WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor | 69 ++++++++ .../WF-WebAdmin/Pages/ModifQuiz.razor.cs | 83 ++++++++++ .../WF-WebAdmin/Pages/ModifQuote.razor | 14 +- .../WF-WebAdmin/Pages/ModifQuote.razor.cs | 34 +++- .../WF-WebAdmin/Service/QuizServiceStub.cs | 11 +- .../WF-WebAdmin/Service/QuoteServiceStub.cs | 6 +- WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor | 8 +- .../WF-WebAdmin/wwwroot/fake-dataQuote.json | 152 ++++++------------ .../WF-WebAdmin/wwwroot/fake_data_quiz.json | 16 +- .../WF-WebAdmin/wwwroot/fake_data_users.json | 43 +---- 16 files changed, 435 insertions(+), 167 deletions(-) create mode 100644 WF-WebAdmin/WF-WebAdmin/Model/QuizModel.cs create mode 100644 WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor create mode 100644 WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor.cs create mode 100644 WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor create mode 100644 WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor.cs diff --git a/WF-WebAdmin/WF-WebAdmin/Model/Quiz.cs b/WF-WebAdmin/WF-WebAdmin/Model/Quiz.cs index 0e08045..2357f7c 100644 --- a/WF-WebAdmin/WF-WebAdmin/Model/Quiz.cs +++ b/WF-WebAdmin/WF-WebAdmin/Model/Quiz.cs @@ -11,5 +11,32 @@ namespace WF_WebAdmin.Model public string CAnswer { get; set; } public bool IsValid { get; set; } public string UserProposition { get; set; } + + public Quiz(int id, string question, string answerA, string answerB, string answerC, string answerD, string cAnswer, bool isValid, string userProposition) + { + Id = id; + Question = question; + AnswerA = answerA; + AnswerB = answerB; + AnswerC = answerC; + AnswerD = answerD; + CAnswer = cAnswer; + IsValid = isValid; + UserProposition = userProposition; + } + + public Quiz(int id, string question, string answerA, string answerB, string answerC, string answerD, string cAnswer) + { + Id = id; + Question = question; + AnswerA = answerA; + AnswerB = answerB; + AnswerC = answerC; + AnswerD = answerD; + CAnswer = cAnswer; + IsValid = true; + UserProposition = "Admin"; + } + } } \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Model/QuizModel.cs b/WF-WebAdmin/WF-WebAdmin/Model/QuizModel.cs new file mode 100644 index 0000000..ce5c8fa --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Model/QuizModel.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; + +namespace WF_WebAdmin.Model +{ + public class QuizModel + { + [Required] + [StringLength(200, ErrorMessage = "La question ne peut pas depasser les 200 caractère.")] + public string Question { get; set; } + + [Required] + [StringLength(50, ErrorMessage = "La réponse ne peut pas depasser les 50 caractère.")] + public string AnswerA { get; set; } + + [Required] + [StringLength(50, ErrorMessage = "La réponse ne peut pas depasser les 50 caractère.")] + public string AnswerB { get; set; } + + [Required] + [StringLength(50, ErrorMessage = "La réponse ne peut pas depasser les 50 caractère.")] + public string AnswerC { get; set; } + + [Required] + [StringLength(50, ErrorMessage = "La réponse ne peut pas depasser les 50 caractère.")] + public string AnswerD { get; set; } + + [Required] + public string CAnswer { get; set; } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor b/WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor new file mode 100644 index 0000000..e3ba5e5 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor @@ -0,0 +1,58 @@ +@using WF_WebAdmin.Model; + +@page "/add" + +

Ajouter un quiz

+ + + + + + +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ +

+ + +
\ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor.cs new file mode 100644 index 0000000..65a727f --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/AddQuiz.razor.cs @@ -0,0 +1,36 @@ +using Microsoft.AspNetCore.Components; +using WF_WebAdmin.Service; +using WF_WebAdmin.Model; + + +namespace WF_WebAdmin.Pages +{ + public partial class AddQuiz + { + [Inject] + private IQuizService quizService { get; set; } + + private QuizModel QuizModel = new(); + + private async void HandleValidSubmit() + { + int id; + id = await quizService.getNbQuiz(); + id++; + await quizService.addQuiz(new Quiz( + id, + QuizModel.Question, + QuizModel.AnswerA, + QuizModel.AnswerB, + QuizModel.AnswerC, + QuizModel.AnswerD, + QuizModel.CAnswer + )); + } + + private void OnCAwnserChange(string item, object checkedValue) + { + QuizModel.CAnswer = item; + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor index c3d8913..12bd791 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor +++ b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor @@ -30,7 +30,7 @@ else

Utilisateurs présents:

@foreach (var user in users) { -
+
@if (user.IsAdmin) { diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor.cs index 0ade62c..999a372 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor.cs +++ b/WF-WebAdmin/WF-WebAdmin/Pages/DeleteUser.razor.cs @@ -17,6 +17,7 @@ namespace WF_WebAdmin.Pages private User userToAdmin = null; private int MaxValue = 5; private int totalItem; + private int page = 1; [Inject] @@ -26,14 +27,15 @@ namespace WF_WebAdmin.Pages public NavigationManager NavigationManager { get; set; } private List users; - private UserServiceStub userService; + + [Inject] + private IUserService userService { get; set; } protected override async Task OnInitializedAsync() { - userService = new UserServiceStub(); - users = await userService.getAllUser(); + users = await userService.getSomeUser(MaxValue, 1); } private async Task OnReadData(DataGridReadDataEventArgs e) @@ -50,6 +52,7 @@ namespace WF_WebAdmin.Pages { totalItem = await userService.getNbUser(); users = new List(response.ToArray()); + page = e.Page; } } @@ -71,15 +74,15 @@ namespace WF_WebAdmin.Pages { if (userToDelete != null) { - userService = new UserServiceStub(); await userService.removeUser(userToDelete); ClosePopup(); + var response = await userService.getSomeUser(MaxValue, page); + users = new List(response.ToArray()); } } private async Task ModifyUser() { - userService = new UserServiceStub(); await userService.updateUser(selectedUser); ClosePopup(); } diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor new file mode 100644 index 0000000..1a5e55b --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor @@ -0,0 +1,69 @@ +@using WF_WebAdmin.Model +@page "/modifquiz" + +Gestion des quiz + +

Gestion des quiz

+ +
+ + Ajouter + +
+ + + + + + + + + + + + + + + + + + +@if (showEditQuiz && selectedQuiz != null) +{ +
+
+

Modifier les informations de l'utilisateur :

+ + + + + + + + + + + + + + +
+
+} + +@if (showPopupDelete) +{ +
+
+

Êtes-vous sûr de vouloir supprimer ce quiz ?

+ + +
+
+} \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor.cs new file mode 100644 index 0000000..9da2e68 --- /dev/null +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuiz.razor.cs @@ -0,0 +1,83 @@ +using Blazorise.DataGrid; +using Microsoft.AspNetCore.Components; +using WF_WebAdmin.Model; +using WF_WebAdmin.Service; + +namespace WF_WebAdmin.Pages +{ + public partial class ModifQuiz + { + private Quiz[] quiz; + + private int MaxValue = 5; + + private int totalItem; + + private bool showEditQuiz = false; + + private Quiz? selectedQuiz; + + private bool showPopupDelete = false; + + private int page = 1; + + [Inject] + public IQuizService QuizService { get; set; } + + private async Task OnReadData(DataGridReadDataEventArgs e) + { + if (e.CancellationToken.IsCancellationRequested) + { + return; + } + + var response = await QuizService.getSommeQuiz(e.PageSize, e.Page); + + if (!e.CancellationToken.IsCancellationRequested) + { + totalItem = await QuizService.getNbQuiz(); + quiz = response.ToArray(); + page = e.Page; + } + } + + private void OnEditButtonClicked(Quiz quiz) + { + if (quiz == null) return; + selectedQuiz = quiz; + showEditQuiz = true; + } + + private void ClosePopup() + { + showEditQuiz = false; + showPopupDelete = false; + selectedQuiz = null; + } + + private async Task EditQuiz() + { + await QuizService.updateQuiz(selectedQuiz); + selectedQuiz = null; + ClosePopup(); + } + + private void OnDelete(Quiz q) + { + selectedQuiz = q; + showPopupDelete = true; + } + + private async void RemoveQuote() + { + if (selectedQuiz != null) + { + await QuizService.removeQuiz(selectedQuiz.Id); + selectedQuiz = null; + var response = await QuizService.getSommeQuiz(MaxValue, page); + quiz = response.ToArray(); + } + showPopupDelete= false; + } + } +} diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor index ca75a01..25e14d8 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor @@ -27,12 +27,12 @@ Bouton Modifier *@ Editer - + -@if (showEditQuote && selectedQuote != null) +@* @if (showEditQuote && selectedQuote != null) {
@@ -46,5 +46,15 @@
+
*@ + +@if (showPopupDelete) +{ +
+
+

Êtes-vous sûr de vouloir supprimer cette citation ?

+ + +
} \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor.cs b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor.cs index 4c9bd10..d010106 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor.cs +++ b/WF-WebAdmin/WF-WebAdmin/Pages/ModifQuote.razor.cs @@ -13,10 +13,14 @@ namespace WF_WebAdmin.Pages private int totalItem; - private bool showEditQuote = false; + /*private bool showEditQuote = false;*/ private Quote? selectedQuote; + private bool showPopupDelete = false; + + private int page = 1; + [Inject] public IQuoteService QuoteService { get; set; } @@ -33,27 +37,47 @@ namespace WF_WebAdmin.Pages { totalItem = await QuoteService.getNbQuote(); quotes = response.ToArray(); + page = e.Page; } } - private void OnEditButtonClicked(Quote quote) + /*private void OnEditButtonClicked(Quote quote) { if (selectedQuote == null) return; selectedQuote = quote; showEditQuote = true; - } + }*/ private void ClosePopup() { - showEditQuote = false; + /*showEditQuote = false;*/ + showPopupDelete = false; selectedQuote = null; } - private async Task EditQuote() + /*private async Task EditQuote() { await QuoteService.updateQuote(selectedQuote); selectedQuote = null; ClosePopup(); + }*/ + + private void OnDelete(Quote q) + { + selectedQuote = q; + showPopupDelete = true; + } + + private async void RemoveQuote() + { + if (selectedQuote != null) + { + await QuoteService.removeQuote(selectedQuote); + selectedQuote= null; + var response = await QuoteService.getSomeQuote(MaxValue, page); + quotes = response.ToArray(); + } + showPopupDelete= false; } } } diff --git a/WF-WebAdmin/WF-WebAdmin/Service/QuizServiceStub.cs b/WF-WebAdmin/WF-WebAdmin/Service/QuizServiceStub.cs index d8a60df..7b6b662 100644 --- a/WF-WebAdmin/WF-WebAdmin/Service/QuizServiceStub.cs +++ b/WF-WebAdmin/WF-WebAdmin/Service/QuizServiceStub.cs @@ -13,9 +13,12 @@ public class QuizServiceStub: IQuizService await File.WriteAllTextAsync(_jsonFilePath, json); } - public Task addQuiz(Quiz quiz) + public async Task addQuiz(Quiz quiz) { - throw new NotImplementedException(); + var data = await getQuizzes(); + quiz.Id = data.Count > 0 ? data.Max(p => p.Id) + 1 : 1; + data.Add(quiz); + await saveQuizJson(data); } public async Task updateQuiz(Quiz quiz) @@ -86,6 +89,10 @@ public class QuizServiceStub: IQuizService var data = await getQuizzes(); if ((page - 1) * nb + nb > data.Count()) { + if(nb > data.Count()) + { + return data.GetRange(0, data.Count()-1); + } return data.GetRange(data.Count() - nb, nb); } return data.GetRange((page - 1) * nb, nb); diff --git a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs index 36a4d21..bc2dea4 100644 --- a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs +++ b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceStub.cs @@ -19,7 +19,7 @@ namespace WF_WebAdmin.Service; quote.Id = data.Count > 0 ? data.Max(p => p.Id) + 1 : 1; data.Add(quote); await saveQuoteJson(data); - } + } public async Task removeQuote(Quote quote) { @@ -70,6 +70,10 @@ namespace WF_WebAdmin.Service; var quotes = await getAllQuote(); if((page - 1) * nb + nb > quotes.Count()) { + if (nb > quotes.Count()) + { + return quotes.GetRange(0, quotes.Count()); + } return quotes.GetRange(quotes.Count()-nb, nb); } return quotes.GetRange((page - 1) * nb, nb); diff --git a/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor b/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor index 28062bd..5dfc260 100644 --- a/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor +++ b/WF-WebAdmin/WF-WebAdmin/Shared/NavMenu.razor @@ -39,7 +39,13 @@ + + diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuote.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuote.json index c10c1ca..6d48018 100644 --- a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuote.json +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake-dataQuote.json @@ -7,236 +7,188 @@ "Charac": "test", "ImgPath": "http://starwars.com", "TitleSrc": "Star Wars", - "DateSrc": "2025-01-21", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user1", - "isValide": true + "IsValid": false }, { "Id": 2, - "Content": "Il n’y a pas de place comme chez soi.", + "Content": "Il n\u2019y a pas de place comme chez soi.", "Like": 120, "Langue": "fr", "Charac": "test", "ImgPath": "http://wizardofoz.com", - "TitleSrc": "Le Magicien d'Oz", - "DateSrc": "2025-01-21", + "TitleSrc": "Le Magicien d\u0027Oz", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user2", - "isValide": true + "IsValid": false }, { "Id": 3, - "Content": "C'est le choix qui fait l'homme, non le destin.", + "Content": "C\u0027est le choix qui fait l\u0027homme, non le destin.", "Like": 90, "Langue": "fr", "Charac": "test", "ImgPath": "http://harrypotter.com", "TitleSrc": "Harry Potter et la Chambre des Secrets", - "DateSrc": "2025-01-21", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user3", - "isValide": true + "IsValid": false }, { "Id": 4, - "Content": "La magie, c’est de croire en soi, c’est ça la magie.", + "Content": "La magie, c\u2019est de croire en soi, c\u2019est \u00E7a la magie.", "Like": 75, "Langue": "fr", "Charac": "test", "ImgPath": "http://disney.com", - "TitleSrc": "La Belle et la Bête", - "DateSrc": "2025-01-21", + "TitleSrc": "La Belle et la B\u00EAte", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user4", - "isValide": true + "IsValid": false }, { "Id": 5, - "Content": "La vérité est plus étrange que la fiction.", + "Content": "La v\u00E9rit\u00E9 est plus \u00E9trange que la fiction.", "Like": 65, "Langue": "fr", "Charac": "test", "ImgPath": "http://theimaginarium.com", - "TitleSrc": "L'Imaginarium du Docteur Parnassus", - "DateSrc": "2025-01-21", + "TitleSrc": "L\u0027Imaginarium du Docteur Parnassus", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user5", - "isValide": true + "IsValid": false }, { "Id": 6, - "Content": "Un homme qui ne croit pas aux miracles n’est pas un homme.", + "Content": "Un homme qui ne croit pas aux miracles n\u2019est pas un homme.", "Like": 85, "Langue": "fr", "Charac": "test", "ImgPath": "http://theprinceofpersia.com", "TitleSrc": "Prince of Persia : Les Sables du Temps", - "DateSrc": "2025-01-21", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user6", - "isValide": true + "IsValid": false }, { "Id": 7, - "Content": "La seule limite à notre réalisation de demain sera nos doutes et hésitations d’aujourd’hui.", + "Content": "La seule limite \u00E0 notre r\u00E9alisation de demain sera nos doutes et h\u00E9sitations d\u2019aujourd\u2019hui.", "Like": 100, "Langue": "fr", "Charac": "test", "ImgPath": "http://backtothefuture.com", "TitleSrc": "Retour vers le futur", - "DateSrc": "2025-01-21", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user7", - "isValide": true + "IsValid": false }, { "Id": 8, - "Content": "L’imagination est plus importante que la connaissance.", + "Content": "L\u2019imagination est plus importante que la connaissance.", "Like": 200, "Langue": "fr", "Charac": "test", "ImgPath": "http://inceptionmovie.com", "TitleSrc": "Inception", - "DateSrc": "2025-01-21", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user8", - "isValide": true + "IsValid": false }, { "Id": 9, - "Content": "Ce n’est pas de la magie, c’est de la science, mais on ne comprend pas encore tout.", + "Content": "Ce n\u2019est pas de la magie, c\u2019est de la science, mais on ne comprend pas encore tout.", "Like": 110, "Langue": "fr", "Charac": "test", "ImgPath": "http://doctorstrange.com", "TitleSrc": "Doctor Strange", - "DateSrc": "2025-01-21", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user9", - "isValide": true + "IsValid": false }, { "Id": 10, - "Content": "L’important ce n’est pas d’être parfait, c’est d’être vrai.", + "Content": "L\u2019important ce n\u2019est pas d\u2019\u00EAtre parfait, c\u2019est d\u2019\u00EAtre vrai.", "Like": 130, "Langue": "fr", "Charac": "test", "ImgPath": "http://narnia.com", "TitleSrc": "Le Monde de Narnia", - "DateSrc": "2025-01-21", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user10", - "isValide": true + "IsValid": false }, { "Id": 11, - "Content": "Vous ne pouvez pas vivre sans causer de dommages à quelqu'un d'autre.", + "Content": "Vous ne pouvez pas vivre sans causer de dommages \u00E0 quelqu\u0027un d\u0027autre.", "Like": 110, "Langue": "fr", "Charac": "test", "ImgPath": "http://thematrix.com", "TitleSrc": "The Matrix", - "DateSrc": "2025-01-21", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user11", - "isValide": true + "IsValid": false }, { "Id": 12, - "Content": "Les rêves, ils ne peuvent pas vous mentir.", + "Content": "Les r\u00EAves, ils ne peuvent pas vous mentir.", "Like": 80, "Langue": "fr", "Charac": "test", "ImgPath": "http://peterpanmovie.com", "TitleSrc": "Peter Pan", - "DateSrc": "2025-01-21", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user12", - "isValide": true - }, - { - "Id": 13, - "Content": "Tous les hommes meurent, mais pas tous vivent.", - "Like": 95, - "Langue": "fr", - "Charac": "test", - "ImgPath": "http://braveheart.com", - "TitleSrc": "Braveheart", - "DateSrc": "2025-01-21", - "UserProposition": "user13", - "isValide": true + "IsValid": false }, { "Id": 14, - "Content": "La vie, c’est ce qui nous arrive quand on est occupé à faire d’autres projets.", + "Content": "La vie, c\u2019est ce qui nous arrive quand on est occup\u00E9 \u00E0 faire d\u2019autres projets.", "Like": 140, "Langue": "fr", "Charac": "test", "ImgPath": "http://forrestgump.com", "TitleSrc": "Forrest Gump", - "DateSrc": "2025-01-21", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user14", - "isValide": true + "IsValid": false }, { "Id": 15, - "Content": "Il faut toujours croire en l’impossible, sinon la magie disparaît.", + "Content": "Il faut toujours croire en l\u2019impossible, sinon la magie dispara\u00EEt.", "Like": 60, "Langue": "fr", "Charac": "test", "ImgPath": "http://harrypotter.com", - "TitleSrc": "Harry Potter à l'école des sorciers", - "DateSrc": "2025-01-21", + "TitleSrc": "Harry Potter \u00E0 l\u0027\u00E9cole des sorciers", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user15", - "isValide": true + "IsValid": false }, { "Id": 16, - "Content": "Le pouvoir de l’imaginaire est plus fort que tout.", + "Content": "Le pouvoir de l\u2019imaginaire est plus fort que tout.", "Like": 120, "Langue": "fr", "Charac": "test", "ImgPath": "http://theincrediblesmovie.com", "TitleSrc": "Les Indestructibles", - "DateSrc": "2025-01-21", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user16", - "isValide": true + "IsValid": false }, { "Id": 17, - "Content": "On peut conquérir l’univers en une journée si on travaille ensemble.", + "Content": "On peut conqu\u00E9rir l\u2019univers en une journ\u00E9e si on travaille ensemble.", "Like": 130, "Langue": "fr", "Charac": "test", "ImgPath": "http://guardiansofthegalaxy.com", "TitleSrc": "Les Gardiens de la Galaxie", - "DateSrc": "2025-01-21", + "DateSrc": "2025-01-21T00:00:00", "UserProposition": "user17", - "isValide": true - }, - { - "Id": 18, - "Content": "La véritable magie vient de l’intérieur.", - "Like": 75, - "Langue": "fr", - "Charac": "test", - "ImgPath": "http://maleficentmovie.com", - "TitleSrc": "Maléfique", - "DateSrc": "2025-01-21", - "UserProposition": "user18", - "isValide": true - }, - { - "Id": 19, - "Content": "On ne voit bien qu’avec le cœur.", - "Like": 200, - "Langue": "fr", - "Charac": "test", - "ImgPath": "http://lepetitprince.com", - "TitleSrc": "Le Petit Prince", - "DateSrc": "2025-01-21", - "UserProposition": "user19", - "isValide": true - }, - { - "Id": 20, - "Content": "Les étoiles sont des rêves en attente d’être vécus.", - "Like": 85, - "Langue": "fr", - "Charac": "test", - "ImgPath": "http://interstellar.com", - "TitleSrc": "Interstellar", - "DateSrc": "2025-01-21", - "UserProposition": "user20", - "isValide": true + "IsValid": false } -] +] \ No newline at end of file diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake_data_quiz.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake_data_quiz.json index 1f90e95..4569231 100644 --- a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake_data_quiz.json +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake_data_quiz.json @@ -1,12 +1,12 @@ [ { "Id": 9, - "Question": "Qui labore fugiat sint Lorem ut minim in ex dolor.", - "AnswerA": "et deserunt", - "AnswerB": "labore sit", - "AnswerC": "in eiusmod", - "AnswerD": "amet incididunt", - "CAnswer": "C", + "Question": "Question_quiz_1", + "AnswerA": "rep_1", + "AnswerB": "rep_2", + "AnswerC": "rep_3", + "AnswerD": "rep_3", + "CAnswer": "A", "IsValid": false, "UserProposition": "Earnestine Poole" }, @@ -23,8 +23,8 @@ }, { "Id": 11, - "Question": "In labore sunt est cupidatat cillum.", - "AnswerA": "ut ad", + "Question": "nv question", + "AnswerA": "repA", "AnswerB": "non deserunt", "AnswerC": "do officia", "AnswerD": "ut nostrud", diff --git a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake_data_users.json b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake_data_users.json index 5b402a6..49c9944 100644 --- a/WF-WebAdmin/WF-WebAdmin/wwwroot/fake_data_users.json +++ b/WF-WebAdmin/WF-WebAdmin/wwwroot/fake_data_users.json @@ -1,29 +1,11 @@ [ - { - "Id": 1, - "Image": "https://assets.audiomack.com/merlijnmuziek/80c977f3a319cf2826af53c9faa7a46f787ba806ca3f783d23bbb7123942b697.jpeg?width=1000\u0026height=1000\u0026max=true", - "Name": "admin", - "Email": "adminop@gmail.com", - "DateCreation": "2024-12-12T00:00:00", - "IsAdmin": true, - "Comments": [ - { - "Text": "Commentaire 1", - "DateCreation": "2024-12-12T00:00:00" - }, - { - "Text": "Commentaire 2", - "DateCreation": "2024-11-12T00:00:00" - } - ] - }, { "Id": 3, "Image": "https://tse4.mm.bing.net/th/id/OIP.XNQPKwc1OUfvnSO9MsxDYgHaE7?w=202\u0026h=180\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", "Name": "testeur", "Email": "testeur@gmail.com", "DateCreation": "2024-08-02T00:00:00", - "IsAdmin": false, + "IsAdmin": true, "Comments": [ { "Text": "Premier test effectu\u00E9, tout semble OK.", @@ -104,20 +86,6 @@ "IsAdmin": false, "Comments": null }, - { - "Id": 11, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", - "Name": "designer_steve", - "Email": "designer.steve@gmail.com", - "DateCreation": "2024-07-01T00:00:00", - "IsAdmin": false, - "Comments": [ - { - "Text": "Le design doit \u00EAtre retravaill\u00E9 pour plus de clart\u00E9.", - "DateCreation": "2024-07-01T00:00:00" - } - ] - }, { "Id": 12, "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", @@ -127,15 +95,6 @@ "IsAdmin": false, "Comments": null }, - { - "Id": 13, - "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7", - "Name": "manager_anna", - "Email": "manager.anna@gmail.com", - "DateCreation": "2024-05-01T00:00:00", - "IsAdmin": false, - "Comments": null - }, { "Id": 14, "Image": "https://tse2.mm.bing.net/th/id/OIP.MMpXBB5RDRYQm05FJmevGAHaKl?w=137\u0026h=195\u0026c=7\u0026r=0\u0026o=5\u0026pid=1.7",