From 6dc89afbe8709036e8a95d71fc1468ec0e2197a5 Mon Sep 17 00:00:00 2001 From: visoulier Date: Mon, 26 Feb 2024 14:01:47 +0100 Subject: [PATCH 01/13] Ajout script sql --- Documentation/script_bdd.sql | 188 +++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 Documentation/script_bdd.sql diff --git a/Documentation/script_bdd.sql b/Documentation/script_bdd.sql new file mode 100644 index 0000000..9fe77e5 --- /dev/null +++ b/Documentation/script_bdd.sql @@ -0,0 +1,188 @@ +-- Testé sous pgsql 15 + +DROP TABLE IF EXISTS Reponse; + +DROP TABLE IF EXISTS Question; + +DROP TABLE IF EXISTS Admin; + +DROP TABLE IF EXISTS Partie; + +DROP TABLE IF EXISTS Jeu; + +DROP TABLE IF EXISTS Decouvrir; + +DROP TABLE IF EXISTS Utilisateur; + +DROP TABLE IF EXISTS Invite; + +DROP TABLE IF EXISTS Joueur; + +DROP TABLE IF EXISTS Indice; + +DROP TABLE IF EXISTS Scientifique; + +DROP TABLE IF EXISTS Thematique; + +DROP TABLE IF EXISTS Difficulte; + + +-- THEMATIQUE + +CREATE TABLE Thematique( + id SERIAL PRIMARY KEY, + libelle varchar(128) NOT NULL UNIQUE +); + + +-- DIFFICULTE + +CREATE TABLE Difficulte( + id SERIAL PRIMARY KEY, + libelle varchar(128) NOT NULL UNIQUE +); + + +-- SCIENTIFIQUE + +CREATE TABLE Scientifique( + id SERIAL PRIMARY KEY, + nom varchar(128) NOT NULL, + prenom varchar(128) NOT NULL, + photo varchar(512) NOT NULL, + dateNaissance date NOT NULL, + descriptif text NOT NULL, + ratioTrouvee numeric(5,4), + sexe char(1) NOT NULL CHECK(sexe IN ('F', 'H')), + idThematique integer REFERENCES Thematique(id), + idDifficulte integer REFERENCES Difficulte(id), + idSexe integer REFERENCES Sexe(id) +); + + +-- INDICE + +CREATE TABLE Indice( + id SERIAL PRIMARY KEY, + libelle varchar(512) NOT NULL UNIQUE, + idScientifique integer REFERENCES Scientifique(id) +); + +-- QUESTION + +CREATE TABLE Question( + id SERIAL PRIMARY KEY, + question varchar(256) NOT NULL UNIQUE +); + + +-- REPONSE + +CREATE TABLE Reponse( + id SERIAL PRIMARY KEY, + reponse varchar(255) NOT NULL, + idQuestion integer REFERENCES Question(id), + idScientifique integer REFERENCES Scientifique(id) +); + + +-- ADMIN + +CREATE TABLE Admin( + id SERIAL PRIMARY KEY, + email varchar(255) NOT NULL UNIQUE, + password varchar(255) NOT NULL +); + + +-- JOUEUR + +CREATE TABLE Joueur( + id SERIAL PRIMARY KEY, + idPartie integer REFERENCES Partie(id), + pseudo varchar(255) NOT NULL UNIQUE +); + + +-- Invite + +CREATE TABLE Invite( + idJoueur integer PRIMARY KEY REFERENCES Joueur(id), + idSession varchar(255) NOT NULL UNIQUE +); + + +-- Utilisateur + +CREATE TABLE Utilisateur( + idJoueur integer PRIMARY KEY REFERENCES Joueur(id), + email varchar(255) NOT NULL UNIQUE, + password varchar(255) NOT NULL +); + + +-- Decouvrir + +CREATE TABLE Decouvrir( + idUtilisateur integer REFERENCES Utilisateur(idJoueur), + idScientifique integer REFERENCES Scientifique(id), + PRIMARY KEY (idUtilisateur, idScientifique) +); + + +-- Jeu + +CREATE TABLE Jeu( + id SERIAL PRIMARY KEY, + nom varchar(128) NOT NULL UNIQUE, + nbrParties integer NOT NULL DEFAULT 0 +); + + +-- Partie + +CREATE TABLE Partie( + id SERIAL PRIMARY KEY, + codeInvitation varchar(10) NOT NULL UNIQUE, + idJeu integer REFERENCES Jeu(id) +); + + +-- INSERTS + +-- Scientifiques +INSERT INTO Difficulte(libelle) VALUES ('Facile'),('Intermédiaire'),('Difficile'); +INSERT INTO Sexe(libelle) VALUES ('Homme'),('Femme'); +INSERT INTO Thematique(libelle) VALUES ('Nucléaire'),('Mathématiques'); +INSERT INTO Scientifique(nom, prenom, photo, dateNaissance, descriptif, ratioTrouvee, idThematique, idDifficulte, idSexe) +VALUES + ('Marie', 'Curie', '', CURRENT_DATE, 'desc', 0, 1, 1, 2), + ('Albert', 'Einstein', '', CURRENT_DATE, 'desc', 0, 2, 1, 1), + ('Sophie', 'Germain', '', CURRENT_DATE, 'desc', 0, 2, 2, 2); + +-- Jeu +INSERT INTO Jeu(nom) VALUES ('Qui-est-ce ?'),('Science Quizz'), ('Pendu'); + +-- Questions +INSERT INTO Question(question) +VALUES + ('Qui a reçu le prix Nobel de chimie en 1911, pour avoir réussi à isoler un gramme de radium ?'), + ('Quel mathématicien a dit : « Dieu existe, c’est les mathématiques » ?'), + ('Quel mathématicienne utilisa comme nom d"emprunt « Antoine Auguste Le Blanc » ?'); + +-- Réponses +INSERT INTO Reponse(reponse, idQuestion, idScientifique) +VALUES + ('Marie Curie', 1, 1), + ('Albert Einstein', 2, 2), + ('Sophie Germain', 3, 3); + +-- Utilisateurs +INSERT INTO Joueur(id,pseudo) VALUES (1337, 'moi, le meilleur joueur du monde'); +INSERT INTO Utilisateur(idJoueur,email,password) VALUES (1337, 'joueur','$2y$10$juGnlWC9cS19popEKLZsYeir0Jl39k6hDl0dpaCix00FDcdiEbtmS'); +-- mdp = test + +INSERT INTO decouvrir(idUtilisateur,idScientifique) VALUES (1337,1); + +INSERT INTO Admin(id,email,password) VALUES (1, 'admin','$2y$10$juGnlWC9cS19popEKLZsYeir0Jl39k6hDl0dpaCix00FDcdiEbtmS'); +-- mdp = test From ebab9d0ef615515648c834499706f368a5ea2dc1 Mon Sep 17 00:00:00 2001 From: visoulier Date: Mon, 26 Feb 2024 14:23:54 +0100 Subject: [PATCH 02/13] correction --- Documentation/script_bdd.sql | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Documentation/script_bdd.sql b/Documentation/script_bdd.sql index 9fe77e5..a2d14a5 100644 --- a/Documentation/script_bdd.sql +++ b/Documentation/script_bdd.sql @@ -56,7 +56,6 @@ CREATE TABLE Scientifique( sexe char(1) NOT NULL CHECK(sexe IN ('F', 'H')), idThematique integer REFERENCES Thematique(id), idDifficulte integer REFERENCES Difficulte(id), - idSexe integer REFERENCES Sexe(id) ); @@ -152,13 +151,12 @@ CREATE TABLE Partie( -- Scientifiques INSERT INTO Difficulte(libelle) VALUES ('Facile'),('Intermédiaire'),('Difficile'); -INSERT INTO Sexe(libelle) VALUES ('Homme'),('Femme'); INSERT INTO Thematique(libelle) VALUES ('Nucléaire'),('Mathématiques'); INSERT INTO Scientifique(nom, prenom, photo, dateNaissance, descriptif, ratioTrouvee, idThematique, idDifficulte, idSexe) VALUES - ('Marie', 'Curie', '', CURRENT_DATE, 'desc', 0, 1, 1, 2), - ('Albert', 'Einstein', '', CURRENT_DATE, 'desc', 0, 2, 1, 1), - ('Sophie', 'Germain', '', CURRENT_DATE, 'desc', 0, 2, 2, 2); + ('Marie', 'Curie', '', CURRENT_DATE, 'desc', 0, 1, 1, 'F'), + ('Albert', 'Einstein', '', CURRENT_DATE, 'desc', 0, 2, 1, 'H'), + ('Sophie', 'Germain', '', CURRENT_DATE, 'desc', 0, 2, 2, 'F'); -- Jeu INSERT INTO Jeu(nom) VALUES ('Qui-est-ce ?'),('Science Quizz'), ('Pendu'); From b1d9710bb25b7add544a5329619e47e1e0b62dd0 Mon Sep 17 00:00:00 2001 From: visoulier Date: Mon, 26 Feb 2024 15:33:17 +0100 Subject: [PATCH 03/13] correction association inexistante --- Documentation/mld/mld graphique.md | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/mld/mld graphique.md b/Documentation/mld/mld graphique.md index f24b765..5692989 100644 --- a/Documentation/mld/mld graphique.md +++ b/Documentation/mld/mld graphique.md @@ -88,7 +88,6 @@ partie --> jeu partie <-- joueur invite --> joueur utilisateur --> joueur -utilisateur --> scientifique scientifique --> thematique scientifique --> difficulte scientifique --> indice From f4ca4e0b01b27ee35cf704baa9030420a1848704 Mon Sep 17 00:00:00 2001 From: visoulier Date: Mon, 26 Feb 2024 15:33:33 +0100 Subject: [PATCH 04/13] =?UTF-8?q?mise=20=C3=A0=20jour=20mld=20selon=20mld?= =?UTF-8?q?=20graphique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation/mld/mld.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Documentation/mld/mld.md b/Documentation/mld/mld.md index 8bcc7f1..3b11006 100644 --- a/Documentation/mld/mld.md +++ b/Documentation/mld/mld.md @@ -1,11 +1,10 @@ **Jeu(id, nom, nbrParties)** - *id* : clef primaire de la table Jeu -**Scientifique(id, nom, prenom, photo, dateNaissance, descriptif, ratioTrouvee, #idThematique, #idDifficulte, #idSexe)** +**Scientifique(id, nom, prenom, photo, dateNaissance, descriptif, ratioTrouvee, sexe, #idThematique, #idDifficulte)** - *id* : clef primaire de la table Scientifique - *#idThematique* clef étrangère en référence à *id* de la table Thematique - *#idDifficulte* clef étrangère en référence à *id* de la table Difficulté -- *#idSexe* clef étrangère en référence à *id* de la table Sexe **Thematique(id, libelle)** - *id* : clef primaire de la table Thematique @@ -13,11 +12,9 @@ **Difficulté(id, libelle)** - *id* : clef primaire de la table Difficulté -**Sexe(id, libelle)** -- *id* : clef primaire de la table Sexe - -**Joueur(id, pseudo)** +**Joueur(id, pseudo, #idPartie)** - *id* : clef primaire de la table Joueur +- *#idPartie* : clef étrangère en référence à *id* de la table Partie **Utilisateur(#idJoueur, email, motDePasse, pseudo)** - *idJoueur* : clef primaire de la table Joueur @@ -27,9 +24,8 @@ - *idJoueur* : clef primaire de la table Joueur - *#idJoueur* : clef étrangère en référence à *id* de la table Joueur -**Partie(id, codeInvitation, #idJoueur, #idJeu)** +**Partie(id, codeInvitation, #idJeu)** - *id* : clef primaire de la table Partie -- *#idJoueur* : clef étrangère en référence à *id* de la table Joueur - *#idJeu* : clef étrangère en référence à *id* de la table Jeu **Admin(#id, email, motDePasse)** From 5388a2fd331b7ad05c3e48cde3428d6784e45819 Mon Sep 17 00:00:00 2001 From: visoulier Date: Mon, 26 Feb 2024 15:42:47 +0100 Subject: [PATCH 05/13] =?UTF-8?q?Suppression=20id=5Fsession=20:=20Invit?= =?UTF-8?q?=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation/mld/mld graphique.md | 1 - Documentation/mld/mld.md | 2 +- Documentation/script_bdd.sql | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Documentation/mld/mld graphique.md b/Documentation/mld/mld graphique.md index 5692989..e2fd9e9 100644 --- a/Documentation/mld/mld graphique.md +++ b/Documentation/mld/mld graphique.md @@ -46,7 +46,6 @@ entity "Utilisateur" as utilisateur { entity "Invite" as invite { #idJoueur : int - idSession : int } entity "Partie" as partie { diff --git a/Documentation/mld/mld.md b/Documentation/mld/mld.md index 3b11006..d2228f9 100644 --- a/Documentation/mld/mld.md +++ b/Documentation/mld/mld.md @@ -20,7 +20,7 @@ - *idJoueur* : clef primaire de la table Joueur - *#idJoueur* : clef étrangère en référence à *id* de la table Joueur -**Invite(#idJoueur, idSession)** +**Invite(#idJoueur)** - *idJoueur* : clef primaire de la table Joueur - *#idJoueur* : clef étrangère en référence à *id* de la table Joueur diff --git a/Documentation/script_bdd.sql b/Documentation/script_bdd.sql index a2d14a5..6d0ec91 100644 --- a/Documentation/script_bdd.sql +++ b/Documentation/script_bdd.sql @@ -107,7 +107,6 @@ CREATE TABLE Joueur( CREATE TABLE Invite( idJoueur integer PRIMARY KEY REFERENCES Joueur(id), - idSession varchar(255) NOT NULL UNIQUE ); From bad947201f48170bc2c2e17ab464d46109fa43c9 Mon Sep 17 00:00:00 2001 From: Alix JEUDI--LEMOINE Date: Mon, 26 Feb 2024 17:14:55 +0100 Subject: [PATCH 06/13] Corrections erreurs SQL --- Documentation/script_bdd.sql | 144 ++++++++++++++++------------------- 1 file changed, 65 insertions(+), 79 deletions(-) diff --git a/Documentation/script_bdd.sql b/Documentation/script_bdd.sql index 6d0ec91..6f75065 100644 --- a/Documentation/script_bdd.sql +++ b/Documentation/script_bdd.sql @@ -1,148 +1,134 @@ -- Testé sous pgsql 15 -DROP TABLE IF EXISTS Reponse; - -DROP TABLE IF EXISTS Question; - -DROP TABLE IF EXISTS Admin; - -DROP TABLE IF EXISTS Partie; - -DROP TABLE IF EXISTS Jeu; - -DROP TABLE IF EXISTS Decouvrir; - -DROP TABLE IF EXISTS Utilisateur; - -DROP TABLE IF EXISTS Invite; - -DROP TABLE IF EXISTS Joueur; - -DROP TABLE IF EXISTS Indice; - -DROP TABLE IF EXISTS Scientifique; - -DROP TABLE IF EXISTS Thematique; - +DROP TABLE IF EXISTS Reponse CASCADE; +DROP TABLE IF EXISTS Question CASCADE; +DROP TABLE IF EXISTS Admin CASCADE; +DROP TABLE IF EXISTS Partie CASCADE; +DROP TABLE IF EXISTS Jeu CASCADE; +DROP TABLE IF EXISTS Decouvrir CASCADE; +DROP TABLE IF EXISTS Utilisateur CASCADE; +DROP TABLE IF EXISTS Invite CASCADE; +DROP TABLE IF EXISTS Joueur CASCADE; +DROP TABLE IF EXISTS Indice CASCADE; +DROP TABLE IF EXISTS Scientifique CASCADE; +DROP TABLE IF EXISTS Thematique CASCADE; DROP TABLE IF EXISTS Difficulte; -- THEMATIQUE CREATE TABLE Thematique( - id SERIAL PRIMARY KEY, - libelle varchar(128) NOT NULL UNIQUE + id SERIAL PRIMARY KEY, + libelle varchar(128) NOT NULL UNIQUE ); -- DIFFICULTE CREATE TABLE Difficulte( - id SERIAL PRIMARY KEY, - libelle varchar(128) NOT NULL UNIQUE + id SERIAL PRIMARY KEY, + libelle varchar(128) NOT NULL UNIQUE ); -- SCIENTIFIQUE CREATE TABLE Scientifique( - id SERIAL PRIMARY KEY, - nom varchar(128) NOT NULL, - prenom varchar(128) NOT NULL, - photo varchar(512) NOT NULL, - dateNaissance date NOT NULL, - descriptif text NOT NULL, - ratioTrouvee numeric(5,4), - sexe char(1) NOT NULL CHECK(sexe IN ('F', 'H')), - idThematique integer REFERENCES Thematique(id), - idDifficulte integer REFERENCES Difficulte(id), + id SERIAL PRIMARY KEY, + nom varchar(128) NOT NULL, + prenom varchar(128) NOT NULL, + photo varchar(512) NOT NULL, + dateNaissance date NOT NULL, + descriptif text NOT NULL, + ratioTrouvee numeric(5,4), + sexe char(1) NOT NULL CHECK(sexe IN ('F', 'H')), + idThematique integer REFERENCES Thematique(id), + idDifficulte integer REFERENCES Difficulte(id) ); -- INDICE CREATE TABLE Indice( - id SERIAL PRIMARY KEY, - libelle varchar(512) NOT NULL UNIQUE, - idScientifique integer REFERENCES Scientifique(id) + id SERIAL PRIMARY KEY, + libelle varchar(512) NOT NULL UNIQUE, + idScientifique integer REFERENCES Scientifique(id) ); -- QUESTION CREATE TABLE Question( - id SERIAL PRIMARY KEY, - question varchar(256) NOT NULL UNIQUE + id SERIAL PRIMARY KEY, + question varchar(256) NOT NULL UNIQUE ); -- REPONSE CREATE TABLE Reponse( - id SERIAL PRIMARY KEY, - reponse varchar(255) NOT NULL, - idQuestion integer REFERENCES Question(id), - idScientifique integer REFERENCES Scientifique(id) + id SERIAL PRIMARY KEY, + reponse varchar(255) NOT NULL, + idQuestion integer REFERENCES Question(id), + idScientifique integer REFERENCES Scientifique(id) ); -- ADMIN CREATE TABLE Admin( - id SERIAL PRIMARY KEY, - email varchar(255) NOT NULL UNIQUE, - password varchar(255) NOT NULL + id SERIAL PRIMARY KEY, + email varchar(255) NOT NULL UNIQUE, + password varchar(255) NOT NULL +); + +-- Jeu + +CREATE TABLE Jeu( + id SERIAL PRIMARY KEY, + nom varchar(128) NOT NULL UNIQUE, + nbrParties integer NOT NULL DEFAULT 0 ); +-- Partie + +CREATE TABLE Partie( + id SERIAL PRIMARY KEY, + codeInvitation varchar(10) NOT NULL UNIQUE, + idJeu integer REFERENCES Jeu(id) +); + -- JOUEUR CREATE TABLE Joueur( - id SERIAL PRIMARY KEY, - idPartie integer REFERENCES Partie(id), - pseudo varchar(255) NOT NULL UNIQUE + id SERIAL PRIMARY KEY, + idPartie integer REFERENCES Partie(id), + pseudo varchar(255) NOT NULL UNIQUE ); -- Invite CREATE TABLE Invite( - idJoueur integer PRIMARY KEY REFERENCES Joueur(id), + idJoueur integer PRIMARY KEY REFERENCES Joueur(id) ); -- Utilisateur CREATE TABLE Utilisateur( - idJoueur integer PRIMARY KEY REFERENCES Joueur(id), - email varchar(255) NOT NULL UNIQUE, - password varchar(255) NOT NULL + idJoueur integer PRIMARY KEY REFERENCES Joueur(id), + email varchar(255) NOT NULL UNIQUE, + password varchar(255) NOT NULL ); -- Decouvrir CREATE TABLE Decouvrir( - idUtilisateur integer REFERENCES Utilisateur(idJoueur), - idScientifique integer REFERENCES Scientifique(id), - PRIMARY KEY (idUtilisateur, idScientifique) -); - - --- Jeu - -CREATE TABLE Jeu( - id SERIAL PRIMARY KEY, - nom varchar(128) NOT NULL UNIQUE, - nbrParties integer NOT NULL DEFAULT 0 -); - - --- Partie - -CREATE TABLE Partie( - id SERIAL PRIMARY KEY, - codeInvitation varchar(10) NOT NULL UNIQUE, - idJeu integer REFERENCES Jeu(id) + idUtilisateur integer REFERENCES Utilisateur(idJoueur), + idScientifique integer REFERENCES Scientifique(id), + PRIMARY KEY (idUtilisateur, idScientifique) ); @@ -151,7 +137,7 @@ CREATE TABLE Partie( -- Scientifiques INSERT INTO Difficulte(libelle) VALUES ('Facile'),('Intermédiaire'),('Difficile'); INSERT INTO Thematique(libelle) VALUES ('Nucléaire'),('Mathématiques'); -INSERT INTO Scientifique(nom, prenom, photo, dateNaissance, descriptif, ratioTrouvee, idThematique, idDifficulte, idSexe) +INSERT INTO Scientifique(nom, prenom, photo, dateNaissance, descriptif, ratioTrouvee, idThematique, idDifficulte, sexe) VALUES ('Marie', 'Curie', '', CURRENT_DATE, 'desc', 0, 1, 1, 'F'), ('Albert', 'Einstein', '', CURRENT_DATE, 'desc', 0, 2, 1, 'H'), From 75a30d14b3bf12fde903bcceda0bc20ec25e4245 Mon Sep 17 00:00:00 2001 From: Alix JEUDI--LEMOINE Date: Tue, 27 Feb 2024 12:05:27 +0100 Subject: [PATCH 07/13] Ajout inserts dans Indice --- Documentation/script_bdd.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/script_bdd.sql b/Documentation/script_bdd.sql index 6f75065..6f13849 100644 --- a/Documentation/script_bdd.sql +++ b/Documentation/script_bdd.sql @@ -153,6 +153,11 @@ VALUES ('Quel mathématicien a dit : « Dieu existe, c’est les mathématiques » ?'), ('Quel mathématicienne utilisa comme nom d"emprunt « Antoine Auguste Le Blanc » ?'); +-- Indices +INSERT INTO Indice (id, libelle, idscientifique) VALUES + (1, 'Indice pour aider', 1), + (2, 'S''appelle Marie', 1); + -- Réponses INSERT INTO Reponse(reponse, idQuestion, idScientifique) VALUES From 0a1dadac9fee2e603352bfe46106bb98dfa6bfb8 Mon Sep 17 00:00:00 2001 From: ShrayzzDev Date: Wed, 28 Feb 2024 11:38:57 +0100 Subject: [PATCH 08/13] [ADD] Actions dans mld pour les jeux --- Documentation/mld/mld graphique.md | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Documentation/mld/mld graphique.md b/Documentation/mld/mld graphique.md index e2fd9e9..75d5037 100644 --- a/Documentation/mld/mld graphique.md +++ b/Documentation/mld/mld graphique.md @@ -51,6 +51,7 @@ entity "Invite" as invite { entity "Partie" as partie { id : int codeInvitation : string + isStarted: bool #idJeu : int } @@ -83,6 +84,37 @@ entity "Question" as question { question : string } +entity "Action" as action { + id : int + dateAction : date +} + +entity "Jouer" as jouer { + #idAction + #idPartie +} + +entity "ActionPendu" as actionPendu { + lettre : char +} + +entity "ActionKahoot" as actionKahoot { + numReponse: int + tempsReponse: int + #idJoueur +} + +entity "ActionQuiEstCe" as actionQuiEstCe { + #idJoueur +} + +actionPendu --> action +actionQuiEstCe --> action +actionQuiEstCe --> joueur +actionKahoot --> action +actionKahoot --> joueur +jouer --> action +jouer --> partie partie --> jeu partie <-- joueur invite --> joueur From 13df6da74997d91f57cee32d2bbf883e0873d831 Mon Sep 17 00:00:00 2001 From: ShrayzzDev Date: Wed, 28 Feb 2024 12:24:28 +0100 Subject: [PATCH 09/13] [ADD] Attibuts action pendu mld --- Documentation/mld/mld graphique.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/mld/mld graphique.md b/Documentation/mld/mld graphique.md index 75d5037..d4f2348 100644 --- a/Documentation/mld/mld graphique.md +++ b/Documentation/mld/mld graphique.md @@ -95,16 +95,21 @@ entity "Jouer" as jouer { } entity "ActionPendu" as actionPendu { + #idAction lettre : char + wordToFind : string + lifeLeft : int } entity "ActionKahoot" as actionKahoot { + #idAction numReponse: int tempsReponse: int #idJoueur } entity "ActionQuiEstCe" as actionQuiEstCe { + #idAction #idJoueur } From 56a04c44b863aaaaa4ecea30ee17e9cbc6b7ba6e Mon Sep 17 00:00:00 2001 From: ShrayzzDev Date: Wed, 28 Feb 2024 12:25:15 +0100 Subject: [PATCH 10/13] [MOD] bd en accord avec mld --- Documentation/script_bdd.sql | 37 +++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/Documentation/script_bdd.sql b/Documentation/script_bdd.sql index 6f13849..71ce3d4 100644 --- a/Documentation/script_bdd.sql +++ b/Documentation/script_bdd.sql @@ -13,7 +13,10 @@ DROP TABLE IF EXISTS Indice CASCADE; DROP TABLE IF EXISTS Scientifique CASCADE; DROP TABLE IF EXISTS Thematique CASCADE; DROP TABLE IF EXISTS Difficulte; - +DROP TABLE IF EXISTS ActionPendu CASCADE; +DROP TABLE IF EXISTS ActionKahoot CASCADE; +DROP TABLE IF EXISTS ActionQuiEstCe CASCADE; +DROP TABLE IF EXISTS Action CASCADE; -- THEMATIQUE @@ -131,6 +134,38 @@ CREATE TABLE Decouvrir( PRIMARY KEY (idUtilisateur, idScientifique) ); +-- Actions + +CREATE TABLE Action ( + id integer PRIMARY KEY, + dateAction date NOT NULL +); + +-- Action Pendu + +CREATE TABLE ActionPendu( + idAction integer PRIMARY KEY REFERENCES Action(id), + lettre char(1) NOT NULL, + wordToFind varchar(255) NOT NULL, + lifeLeft integer NOT NULL +); + +-- Action Kahoot + +CREATE TABLE ActionKahoot( + idAction integer PRIMARY KEY REFERENCES Action(id), + idJoueur integer REFERENCES Joueur(id), + numReponse integer NOT NULL, + -- NOTE : temps en ms + tempsReponse integer NOT NULL +); + +-- Action Qui-Est-Ce + +CREATE TABLE ActionQuiEstCe( + idAction integer PRIMARY KEY REFERENCES Action(id), + idJoueur integer REFERENCES Joueur(id) +); -- INSERTS From 68dca83548a70ae360de5f06ec6a2f9c6ade0f98 Mon Sep 17 00:00:00 2001 From: visoulier Date: Mon, 11 Mar 2024 15:21:17 +0100 Subject: [PATCH 11/13] sync script sql --- Documentation/script_bdd.sql | 64 ++++++++++-------------------------- 1 file changed, 17 insertions(+), 47 deletions(-) diff --git a/Documentation/script_bdd.sql b/Documentation/script_bdd.sql index 71ce3d4..815185d 100644 --- a/Documentation/script_bdd.sql +++ b/Documentation/script_bdd.sql @@ -13,10 +13,7 @@ DROP TABLE IF EXISTS Indice CASCADE; DROP TABLE IF EXISTS Scientifique CASCADE; DROP TABLE IF EXISTS Thematique CASCADE; DROP TABLE IF EXISTS Difficulte; -DROP TABLE IF EXISTS ActionPendu CASCADE; -DROP TABLE IF EXISTS ActionKahoot CASCADE; -DROP TABLE IF EXISTS ActionQuiEstCe CASCADE; -DROP TABLE IF EXISTS Action CASCADE; + -- THEMATIQUE @@ -54,7 +51,7 @@ CREATE TABLE Scientifique( CREATE TABLE Indice( id SERIAL PRIMARY KEY, - libelle varchar(512) NOT NULL UNIQUE, + libelle varchar(512) NOT NULL, idScientifique integer REFERENCES Scientifique(id) ); @@ -97,7 +94,7 @@ CREATE TABLE Jeu( CREATE TABLE Partie( id SERIAL PRIMARY KEY, - codeInvitation varchar(10) NOT NULL UNIQUE, + codeInvitation varchar(5) NOT NULL UNIQUE, idJeu integer REFERENCES Jeu(id) ); @@ -134,38 +131,6 @@ CREATE TABLE Decouvrir( PRIMARY KEY (idUtilisateur, idScientifique) ); --- Actions - -CREATE TABLE Action ( - id integer PRIMARY KEY, - dateAction date NOT NULL -); - --- Action Pendu - -CREATE TABLE ActionPendu( - idAction integer PRIMARY KEY REFERENCES Action(id), - lettre char(1) NOT NULL, - wordToFind varchar(255) NOT NULL, - lifeLeft integer NOT NULL -); - --- Action Kahoot - -CREATE TABLE ActionKahoot( - idAction integer PRIMARY KEY REFERENCES Action(id), - idJoueur integer REFERENCES Joueur(id), - numReponse integer NOT NULL, - -- NOTE : temps en ms - tempsReponse integer NOT NULL -); - --- Action Qui-Est-Ce - -CREATE TABLE ActionQuiEstCe( - idAction integer PRIMARY KEY REFERENCES Action(id), - idJoueur integer REFERENCES Joueur(id) -); -- INSERTS @@ -174,9 +139,9 @@ INSERT INTO Difficulte(libelle) VALUES ('Facile'),('Intermédiaire'),('Difficile INSERT INTO Thematique(libelle) VALUES ('Nucléaire'),('Mathématiques'); INSERT INTO Scientifique(nom, prenom, photo, dateNaissance, descriptif, ratioTrouvee, idThematique, idDifficulte, sexe) VALUES - ('Marie', 'Curie', '', CURRENT_DATE, 'desc', 0, 1, 1, 'F'), - ('Albert', 'Einstein', '', CURRENT_DATE, 'desc', 0, 2, 1, 'H'), - ('Sophie', 'Germain', '', CURRENT_DATE, 'desc', 0, 2, 2, 'F'); + ('Marie', 'Curie', '', CURRENT_DATE, 'desc', 0.50, 1, 1, 'F'), + ('Albert', 'Einstein', '', CURRENT_DATE, 'desc', 0.7540, 2, 1, 'H'), + ('Sophie', 'Germain', '', CURRENT_DATE, 'desc', 0.1432, 2, 2, 'F'); -- Jeu INSERT INTO Jeu(nom) VALUES ('Qui-est-ce ?'),('Science Quizz'), ('Pendu'); @@ -189,9 +154,9 @@ VALUES ('Quel mathématicienne utilisa comme nom d"emprunt « Antoine Auguste Le Blanc » ?'); -- Indices -INSERT INTO Indice (id, libelle, idscientifique) VALUES - (1, 'Indice pour aider', 1), - (2, 'S''appelle Marie', 1); +INSERT INTO Indice (libelle, idscientifique) VALUES + ('Indice pour aider', 1), + ('S''appelle Marie', 1); -- Réponses INSERT INTO Reponse(reponse, idQuestion, idScientifique) @@ -201,11 +166,16 @@ VALUES ('Sophie Germain', 3, 3); -- Utilisateurs -INSERT INTO Joueur(id,pseudo) VALUES (1337, 'moi, le meilleur joueur du monde'); -INSERT INTO Utilisateur(idJoueur,email,password) VALUES (1337, 'joueur','$2y$10$juGnlWC9cS19popEKLZsYeir0Jl39k6hDl0dpaCix00FDcdiEbtmS'); +INSERT INTO Joueur(pseudo) VALUES ('moi, le meilleur joueur du monde'); --id = 1 +INSERT INTO Utilisateur(idJoueur,email,password) VALUES (1, 'joueur','$2y$10$juGnlWC9cS19popEKLZsYeir0Jl39k6hDl0dpaCix00FDcdiEbtmS'); -- mdp = test -INSERT INTO decouvrir(idUtilisateur,idScientifique) VALUES (1337,1); +-- Découvrir +INSERT INTO decouvrir(idUtilisateur,idScientifique) VALUES (1,1); +-- Admin INSERT INTO Admin(id,email,password) VALUES (1, 'admin','$2y$10$juGnlWC9cS19popEKLZsYeir0Jl39k6hDl0dpaCix00FDcdiEbtmS'); -- mdp = test + +-- Partie +INSERT INTO Partie(codeInvitation, idJeu) VALUES ('abcde', 1); \ No newline at end of file From 27b12978dda912a30da87d56caa284e2c9d16e97 Mon Sep 17 00:00:00 2001 From: visoulier Date: Wed, 3 Apr 2024 11:39:55 +0200 Subject: [PATCH 12/13] update README.md --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7fdf448..40d457c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,24 @@ # Science Quest -Mise en situation d'une entreprise fictive établissant un lien avec un Product Owner (PO) ayant pour but de réaliser son projet durant 100 heures dédiées tout au long de l'année. \ No newline at end of file +Dans le cadre de l’apprentissage au sein du BUT Informatique de Clermont-Ferrand, un projet est établi tout au long de l’année afin de mettre en place une simulation d’entreprise gérée par les étudiants. Il répond à un besoin établi par un client, un professeur de l’IUT, ici **Mme Anaïs Durand** dans le rôle du Product Owner, tout cela encadré par notre tutrice de projet **Mme Audrey Pouclet**. + +Le projet repose sur la création d’un **site internet ayant pour but premier de faire découvrir des personnalités scientifiques féminines peu connues à travers des activités vidéoludiques** sous forme de mini-jeux, seul où à plusieurs, destinées aux enfants. + +Les mini-jeux retenus sont les suivants: + +- **Quizz (style Kahoot)** Des questions sont posées aux participants et ceux-ci doivent choisir une des 4 réponses proposées dans le temps imparti. Si la réponse est bonne le joueur gagne des points, le joueur ayant le plus de points gagne la partie ! + +- **Pendu (jeu solo)** +Le système tire un scientifique au hasard selon les paramètres de la partie. +Le joueur voit alors une photo du scientifique en plus de plusieurs indices (tel que sa nationalité ou encore sa date de naissance). +A partir de ces informations le joueur devra retrouver le nom du scientifique sous la forme d’un pendu + +## Accés rapide + +- ### [Android](https://codefirst.iut.uca.fr/git/tom.biard/ScienceQuest/src/branch/Android/android) + +- ### [API](https://codefirst.iut.uca.fr/git/tom.biard/ScienceQuest/src/branch/Springboot/SpringBootProject/) + +- ### [Site Internet](https://codefirst.iut.uca.fr/git/tom.biard/ScienceQuest/src/branch/front/science-quest) + +- ### [Documents](https://codefirst.iut.uca.fr/git/tom.biard/ScienceQuest/src/branch/master/Documentation) From 2b5ccbf22ce7ef0b508f067ba781dd92375fe42d Mon Sep 17 00:00:00 2001 From: visoulier Date: Wed, 3 Apr 2024 11:42:00 +0200 Subject: [PATCH 13/13] ajustement readme --- README.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 40d457c..8b6dc4d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,17 @@ # Science Quest +## Accés rapide + +- ### [Android](https://codefirst.iut.uca.fr/git/tom.biard/ScienceQuest/src/branch/Android/android) + +- ### [API](https://codefirst.iut.uca.fr/git/tom.biard/ScienceQuest/src/branch/Springboot/SpringBootProject/) + +- ### [Site Internet](https://codefirst.iut.uca.fr/git/tom.biard/ScienceQuest/src/branch/front/science-quest) + +- ### [Documents](https://codefirst.iut.uca.fr/git/tom.biard/ScienceQuest/src/branch/master/Documentation) + +## Description + Dans le cadre de l’apprentissage au sein du BUT Informatique de Clermont-Ferrand, un projet est établi tout au long de l’année afin de mettre en place une simulation d’entreprise gérée par les étudiants. Il répond à un besoin établi par un client, un professeur de l’IUT, ici **Mme Anaïs Durand** dans le rôle du Product Owner, tout cela encadré par notre tutrice de projet **Mme Audrey Pouclet**. Le projet repose sur la création d’un **site internet ayant pour but premier de faire découvrir des personnalités scientifiques féminines peu connues à travers des activités vidéoludiques** sous forme de mini-jeux, seul où à plusieurs, destinées aux enfants. @@ -12,13 +24,3 @@ Les mini-jeux retenus sont les suivants: Le système tire un scientifique au hasard selon les paramètres de la partie. Le joueur voit alors une photo du scientifique en plus de plusieurs indices (tel que sa nationalité ou encore sa date de naissance). A partir de ces informations le joueur devra retrouver le nom du scientifique sous la forme d’un pendu - -## Accés rapide - -- ### [Android](https://codefirst.iut.uca.fr/git/tom.biard/ScienceQuest/src/branch/Android/android) - -- ### [API](https://codefirst.iut.uca.fr/git/tom.biard/ScienceQuest/src/branch/Springboot/SpringBootProject/) - -- ### [Site Internet](https://codefirst.iut.uca.fr/git/tom.biard/ScienceQuest/src/branch/front/science-quest) - -- ### [Documents](https://codefirst.iut.uca.fr/git/tom.biard/ScienceQuest/src/branch/master/Documentation)