diff --git a/WEB/Model/Partie.php b/WEB/Model/Partie.php index 860f4cf5..f0899047 100644 --- a/WEB/Model/Partie.php +++ b/WEB/Model/Partie.php @@ -5,7 +5,7 @@ include_once "Enigme.php"; class Partie { private string $idPartie; - private $datePartie; + private DateTime $datePartie; private array $listeEnigme; /** @@ -15,7 +15,7 @@ class Partie public function __construct(string $idPartie, array $listeEnigme) { $this->idPartie = $idPartie; - $this->datePartie = getdate(); + $this->datePartie = new DateTime(); $this->$listeEnigme = $listeEnigme; } @@ -38,7 +38,7 @@ class Partie /** * @return array */ - public function getDatePartie(): array + public function getDatePartie(): dateTime { return $this->datePartie; } @@ -46,7 +46,7 @@ class Partie /** * @param array $datePartie */ - public function setDatePartie(array $datePartie): void + public function setDatePartie(dateTime $datePartie): void { $this->datePartie = $datePartie; } diff --git a/WEB/Model/bd.sql b/WEB/Model/bd.sql index 004c967b..dbe9aa4e 100644 --- a/WEB/Model/bd.sql +++ b/WEB/Model/bd.sql @@ -1,6 +1,6 @@ -- ALTER USER 'root'@'localhost' IDENTIFIED BY 'p'; --- CREATE scripted; +-- CREATE DATABASE scripted; -- USE scripted; DROP TABLE Contenir; @@ -49,11 +49,12 @@ indexEnigme numeric UNIQUE, PRIMARY KEY(joueur, enigme) ); -CREATE TABLE ResoudreEnMulti( +CREATE TABLE PasserEnMulti( joueur varchar(50) REFERENCES Joueur(email), enigme char(5) REFERENCES Enigme(id), partie char(5) REFERENCES Partie(id), -indexEnigme numeric UNIQUE, +passer bool NOT NULL, +points numeric NOT NULL, temps time, PRIMARY KEY(joueur, enigme, partie) ); @@ -73,5 +74,5 @@ CREATE TABLE Participer( CREATE TABLE Gerer( admin varchar(50) REFERENCES Admin(id), - enigme int REFERENCES Enigme(id), -) + enigme int REFERENCES Enigme(id) +); diff --git a/WEB/View/src/JS/Presentation.js b/WEB/View/src/JS/Presentation.js index c5cb9b1b..84d5664a 100644 --- a/WEB/View/src/JS/Presentation.js +++ b/WEB/View/src/JS/Presentation.js @@ -17,7 +17,7 @@ hiddenElements.forEach((element) => observer.observe(element)); const fox = document.querySelector(".moving-fox"); window.addEventListener("scroll", () => { - const scrollValue = window.scrollY - 500; + const scrollValue = window.scrollY - 600; fox.style.top = `${scrollValue / 1.2}px`; fox.style.opacity = `${window.scrollY / 500}`; }); diff --git a/WEB/View/src/JS/dashboard.js b/WEB/View/src/JS/dashboard.js index 81e00737..15dc3f35 100644 --- a/WEB/View/src/JS/dashboard.js +++ b/WEB/View/src/JS/dashboard.js @@ -1,4 +1,72 @@ window.onload = function () { + /*data = [{ + type: "line", + xValueFormatString: "Pierre", + dataPoints: [ + { x: 0, y: 0 }, + { x: 1, y: 50 }, + { x: 2, y: 100 }, + { x: 3, y: 150 }, + { x: 4, y: 150 }, + { x: 5, y: 200 }, + ] + }, + { + type: "line", + xValueFormatString: "Noe", + dataPoints: [ + { x: 0, y: 0 }, + { x: 1, y: 100 }, + { x: 2, y: 100 }, + { x: 3, y: 200 }, + { x: 4, y: 250 }, + { x: 5, y: 300 }, + ] + }, + { + type: "line", + xValueFormatString: "Nathan", + dataPoints: [ + { x: 0, y: 0 }, + { x: 1, y: 75 }, + { x: 2, y: 100 }, + { x: 3, y: 150 }, + { x: 4, y: 200 }, + { x: 5, y: 250 }, + ] + }]*/ + + v1 = { + type: "line", + xValueFormatString: "Pierre", + dataPoints: [ + { x: 0, y: 0 }, + { x: 1, y: 50 }, + { x: 2, y: 100 }, + { x: 3, y: 150 }, + { x: 4, y: 150 }, + { x: 5, y: 200 }, + ] + } + + v2 = { + type: "line", + xValueFormatString: "Noe", + dataPoints: [ + { x: 0, y: 0 }, + { x: 1, y: 100 }, + { x: 2, y: 100 }, + { x: 3, y: 200 }, + { x: 4, y: 250 }, + { x: 5, y: 300 }, + ] + } + + data = [] + data.push(v1); + data.push(v2); + console.log(data); + var chart = new CanvasJS.Chart("chartContainer", { animationEnabled: true, zoomEnabled: true, @@ -7,7 +75,7 @@ window.onload = function () { text: "Score" }, axisX: { - title: "Enigme", + title: "Temps", valueFormatString: "####", interval: 1 }, @@ -22,43 +90,7 @@ window.onload = function () { verticalAlign: "top", fontSize: 16, }, - data: [{ - type: "line", - xValueFormatString: "Pierre", - dataPoints: [ - { x: 0, y: 0 }, - { x: 1, y: 50 }, - { x: 2, y: 100 }, - { x: 3, y: 150 }, - { x: 4, y: 150 }, - { x: 5, y: 200 }, - ] - }, - { - type: "line", - xValueFormatString: "Noe", - dataPoints: [ - { x: 0, y: 0 }, - { x: 1, y: 100 }, - { x: 2, y: 100 }, - { x: 3, y: 200 }, - { x: 4, y: 250 }, - { x: 5, y: 300 }, - ] - }, - { - type: "line", - xValueFormatString: "Nathan", - dataPoints: [ - { x: 0, y: 0 }, - { x: 1, y: 75 }, - { x: 2, y: 100 }, - { x: 3, y: 150 }, - { x: 4, y: 200 }, - { x: 5, y: 250 }, - ] - } - ] + data }); chart.render(); } \ No newline at end of file diff --git a/WEB/View/src/pages/Presentation.html b/WEB/View/src/pages/Presentation.html index ec9970dd..c5b47830 100644 --- a/WEB/View/src/pages/Presentation.html +++ b/WEB/View/src/pages/Presentation.html @@ -27,7 +27,7 @@ - - + +
@@ -81,7 +81,7 @@