Commit eec92cbd authored by GROSS-AMBLARD David's avatar GROSS-AMBLARD David
Browse files

Merge branch 'M2-2022' into '161-enhance-json-answers'

# Conflicts:
#   pages/showTasks/showTasks.php
parents 211c683e 40c88cb5
......@@ -2,7 +2,7 @@
session_start();
require_once "HWlib.php";
require_once "lib/HWlib.php";
require "ChatModel.php";
$chat = new ChatController();
......
<head>
<link
rel="stylesheet"
href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
crossorigin=""
/>
<script
src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=""
></script>
<script
type="text/javascript"
src="https://code.jquery.com/jquery-3.3.1.min.js"
></script>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.4.2/leaflet.draw.css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/0.4.2/leaflet.draw.js"></script>
<style type="text/css">
#map {
height: 600px;
width: 600px;
}
</style>
</head>
<body>
<h3>
Entourez le campus de Beaulieu en cliquant sur le premier bouton en haut à
droite.
</h3>
<div id="imap">
<div id="map">
<!-- Ici s'affichera la carte -->
</div>
</div>
</body>
<script type="text/javascript">
// Coordonnées du campus de Beaulieu
var lat = 48.11517;
var lon = -1.637434;
// Création de la carte
var macarte = L.map("map").setView([lat, lon], 13);
// Le theme de la carte
var theme = "https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png";
// Construction de la tuile
L.tileLayer(theme, {
minZoom: 1,
maxZoom: 20,
}).addTo(macarte);
// Inialisation de la variable pour stocker les polygones modifiables
var editableLayers = new L.FeatureGroup();
macarte.addLayer(editableLayers);
var drawPluginOptions = {
position: "topright",
draw: {
polygon: {
allowIntersection: true,
},
polyline: true,
circle: false,
rectangle: false,
marker: false,
},
};
var drawControl = new L.Control.Draw(drawPluginOptions);
macarte.addControl(drawControl);
var editableLayers = new L.FeatureGroup();
macarte.addLayer(editableLayers);
macarte.on("draw:created", function (e) {
var type = e.layerType,
layer = e.layer;
editableLayers.addLayer(layer);
});
</script>
......@@ -38,7 +38,7 @@ require_once("pages/drawArtifact/drawArtifact.php");
require_once("pages/maintenance/maintenance.php");
require_once("pages/feedback/feedback.php");
require_once("pages/forum/forum.php");
require_once("pages/taskViewer/TaskViewer.php");
require_once("pages/taskViewer/taskViewer.php");
// TODO faire une classe avec action($conn,$context), qui va appeler la fonction précise avec les $_GET (tout est sur ce format)
......
......@@ -8,7 +8,7 @@ class LoginForm extends Action {
*
* @param $conn : A valid database PDO connection
*
* @return the mode to activate, showPages by default
* @return string the mode to activate, showPages by default
**/
function login($conn)
{
......@@ -125,9 +125,9 @@ class LoginForm extends Action {
{
$stmt = $conn->prepare("insert into users values('',:name,:pwd)");
$stmt->bindParam(':name', $_POST["username"], PDO::PARAM_STR);
$stmt->bindParam(':pwd', $pwd, PDO::PARAM_STR);
$stmt->bindParam(':pwd', $_POST["password"], PDO::PARAM_STR);
$pwd=password_hash($_POST["password"], PASSWORD_DEFAULT);
$stmt->execute() or die(mysql_error());
$stmt->execute() or die( PDO::errorInfo());
$id=(string)@$this->checkLogin($_POST['username'], $_POST["password"], $conn);
$stmt = $conn->prepare("select id from skilltree");
$stmt->execute();
......
......@@ -246,7 +246,7 @@ function answer($conn, $id, $error = false)
break;
default:
debug(' type default </br>');
//echo ' type default </br>';
$placeholder = ($line['arg1'] !== null ? $line['arg1'] : "");
$str .= HTMLp(HTMLtextarea("answer", "60", "3", "", $placeholder));
break;
......
<head>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin="" />
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js" integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" crossorigin=""></script>
<script type='text/javascript' src='https://code.jquery.com/jquery-3.3.1.min.js'></script>
<style type="text/css">
#map{
height:600px;
width: 600px;
}
</style>
</head>
<script type="text/javascript">
// Le theme de la carte
var theme = 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png';
// On rentre les coordonnées de Rennes (ici j'ai pris l'ISTIC)
var lat = 48.115170;
var lon = -1.637434;
function initMap(){
// Création de la carte avec les coordonnées et le niveau de zoom, de 1 à 20
macarte = L.map('map').setView([lat, lon], 13);
L.tileLayer(theme, {
minZoom: 1,
maxZoom: 20
}).addTo(macarte);
macarte.on('click', onMapClick);
}
// Fonction pour ajouter des marqueurs
var marker =null ;
function onMapClick(e) {
if (marker !== null) {
marker.remove();
}
marker = L.marker(e.latlng).addTo(macarte)
var geojson = marker.toGeoJSON();
console.log(geojson);
json = JSON.stringify(geojson);
}
$(document).ready(function(){
initMap();
});
</script>
<body>
<h3> Veuillez indiquer sur la carte où se situe l'ISTIC</h3>
<div id="imap">
<div id="map">
<!-- Ici s'affichera la carte -->
</div>
</div>
</body>
\ No newline at end of file
background: no-repeat bottom right/20% url('projects/headwork/background.jpg'); background-color: rgb(197,205,66);
\ No newline at end of file
background: no-repeat bottom right/20% url('projects/Headwork/bulb_textUnder_bubbles.png');
{
"author" : "M2-2122 Group 3",
"doc" : "",
"1": {
"nodetip": "Introduction page",
"2": {
"guard": "none",
"actiontip": "Explanation of activity...",
"actions": [
"prepare task 1 as message",
"use 'Cool-in-todo-step1' as template",
"use 'Avant de commencer' as title",
"use 'Présentation' as description",
"forget profile for current artifact",
"offer task to anyone",
"skill 3001 is relevant for the task",
"install task"
]
}
},
"2": {
"nodetip": "Writing of todos",
"3": {
"guard": "select true from Answered where artifact=CURRENT_ARTIFACT and id=1",
"actiontip": "Instantiation of first step",
"actions": [
"delete from Task where artifact=CURRENT_ARTIFACT",
"prepare task 2 as basic",
"use 'Cool-in-todo-step2' as template",
"use 'Todos list' as title",
"use 'REGEXP ''^(.)+$''' as checker",
"use 'Please enter something' as checker message",
"use 'Saisie de tâches' as description",
"forget profile for current artifact",
"offer task to anyone",
"skill 3001 is relevant for the task",
"install task"
]
}
},
"3": {
"nodetip": "Categorization of todos",
"4":{
"guard": "select true from Answered where artifact=CURRENT_ARTIFACT and id=2",
"actions": [
"delete from Task where artifact=CURRENT_ARTIFACT",
"use 'Cool-in-todo-step3' as template",
"select @TEMPLATE:=replace(@TEMPLATE,'TAG',value) from Answer where artifact=CURRENT_ARTIFACT and idtask=2 and user=SESSION_USER",
"select @TITLE:='Catégorisation des tâches'",
"select @LIST:='select idtask as id,value as text from Answer where user=SESSION_USER and idtask=2 and artifact=CURRENT_ARTIFACT'",
"select @ANS:='select id as value, text,class,false as request_feedback from CoolInAnswerButton where id between 1 and 3'",
"select @CHECKER:=NULL",
"select @CHECKERMSG:=NULL",
"select @LIST:='select id as value,text as text from CoolInAnswerButton where id between 1 and 3'",
"select @TYPE:=1",
"insert into Task(id,artifact,title,description,body,checker,checkermsg,type,arg1) values(3,CURRENT_ARTIFACT,'Your inputs',@TITLE,@TEMPLATE,@CHECKER,@CHECKERMSG,@TYPE,@LIST)",
"delete from Profile where idartifact=CURRENT_ARTIFACT",
"insert into Profile values (3,CURRENT_ARTIFACT,1)"
]
}
},
"4": {
"nodetip": "Stress level",
"5": {
"guard": "select true from Answered where artifact=CURRENT_ARTIFACT and id=3",
"actions": [
"delete from Task where artifact=CURRENT_ARTIFACT",
"use 'Cool-in-todo-step4' as template",
"select @TEMPLATE:=replace(@TEMPLATE,'TAG',value) from Answer where artifact=CURRENT_ARTIFACT and idtask=2 and user=SESSION_USER",
"select @DESC:='Niveau de stress des tâches'",
"select @TITLE:='Niveau de stress des tâches'",
"select @LIST:='select text as value, text from CoolInAnswerButton where id between 4 and 8'",
"select @CHECKER:=NULL",
"select @CHECKERMSG:=NULL",
"select @TYPE:=1",
"insert into Task(id,artifact,title,description,body,checker,checkermsg,type,arg1) values(4,CURRENT_ARTIFACT,'Your inputs',@TITLE,@TEMPLATE,@CHECKER,@CHECKERMSG,@TYPE,@LIST)",
"delete from Profile where idartifact=CURRENT_ARTIFACT",
"insert into Profile values (4,CURRENT_ARTIFACT,1)"
]
}
},
"5": {
"nodetip": "Duration",
"6": {
"guard": "select true from Answered where artifact=CURRENT_ARTIFACT and id=4",
"actions": [
"delete from Task where artifact=CURRENT_ARTIFACT",
"use 'Cool-in-todo-step5' as template",
"select @TEMPLATE:=replace(@TEMPLATE,'TAG',value) from Answer where artifact=CURRENT_ARTIFACT and idtask=2 and user=SESSION_USER",
"select @DESC:='Durée des tâches'",
"select @TITLE:='Durée des tâches'",
"select @LIST:='select id as value, text from CoolInAnswerButton where id between 9 and 17'",
"select @CHECKER:=NULL",
"select @CHECKERMSG:=NULL",
"select @TYPE:=1",
"insert into Task(id,artifact,title,description,body,checker,checkermsg,type,arg1) values(5,CURRENT_ARTIFACT,'Your inputs',@TITLE,@TEMPLATE,@CHECKER,@CHECKERMSG,@TYPE,@LIST)",
"delete from Profile where idartifact=CURRENT_ARTIFACT",
"insert into Profile values (5,CURRENT_ARTIFACT,1)"
]
}
},
"6": {
"nodetip": "Conclusion page",
"7": {
"guard": "select true from Answered where artifact=CURRENT_ARTIFACT and id=5",
"actiontip": "Termination",
"actions": [
"prepare task 6 as message",
"use 'M2-2122-todo-step5' as template",
"use 'Merci!' as title",
"use 'Merci!' as description",
"forget profile for current artifact",
"offer task to anyone",
"skill 3001 is relevant for the task",
"install task"
]
}
},
"7": {
"nodetip": "Conclusion page",
"8": {
"guard": "select true from Answered where artifact=CURRENT_ARTIFACT and id=6",
"actiontip": "Termination",
"actions": [
"delete from Task where artifact=CURRENT_ARTIFACT",
"delete from Profile where idartifact=CURRENT_ARTIFACT"
]
}
},
"8": {}
}
\ No newline at end of file
-- skillTree schema
-- (id, parent_skill, skill)
--insert into SkillTree values
--(3000, 1, 'M2-2122'),
--(3001, 3000, 'Todo List');
-- (3005, 1003, 'Headwork Principles'),
-- (3006, 1003, 'Uncertain Answers');
DELETE from Artifact where classid in (select id from ArtifactClass where project = 'Cool-in');
DELETE from ArtifactClass where project = 'Cool-in';
-- To do task automaton
insert into ArtifactClass(id,description, definition, tablename, project, autostart)
values(9000, 'Base de données de tâches personnelles', 'Cool-in/coolin.sca', 'Artifact', 'Cool-in', true);
DROP TABLE IF EXISTS CoolInAnswerButton;
CREATE TABLE CoolInAnswerButton(id int,text varchar(100),class varchar(100));
INSERT INTO CoolInAnswerButton values (1,'Personnelle','danger');
INSERT INTO CoolInAnswerButton values (2,'Profesionnelle','warning');
INSERT INTO CoolInAnswerButton values (3,'Familiale','success');
INSERT INTO CoolInAnswerButton values (4,'1','');
INSERT INTO CoolInAnswerButton values (5,'2','');
INSERT INTO CoolInAnswerButton values (6,'3','');
INSERT INTO CoolInAnswerButton values (7,'4','');
INSERT INTO CoolInAnswerButton values (8,'5','');
INSERT INTO CoolInAnswerButton values (9,'30mn ou moins','');
INSERT INTO CoolInAnswerButton values (10,'1h','');
INSERT INTO CoolInAnswerButton values (11,'2h','');
INSERT INTO CoolInAnswerButton values (12,'Demi-journée','');
INSERT INTO CoolInAnswerButton values (13,'1 jour','');
INSERT INTO CoolInAnswerButton values (14,'2 jours','');
INSERT INTO CoolInAnswerButton values (15,'3 jours','');
INSERT INTO CoolInAnswerButton values (16,'1 semaine','');
INSERT INTO CoolInAnswerButton values (17,'plus de 1 semaine','');
<h2>Introduction</h2>
<p class="card-text">
En participant à ce projet, vous contribuez à la constitution d'une base de tâches (TODO lists), annotées avec une estimation
de leur durée et de leur niveau de stress. Cette base servira à mieux comprendre les questions d'organisation personnelle, de charge mentale, et à améliorer les assistants personnels.
</p>
<h2>Données personnelles</h2>
<p class="card-text">
Données personnelles : Avant de commencer, petite mise au point sur vos données personnelles. Nous tenons à vous informer qu'aucune de vos données personnelles n'est enregistrée.
La base de tâche ainsi obtenue sera publique à des fins de recherche.
</p>
<br/>
<p>
Etape <strong>1/6</strong>
</p>
\ No newline at end of file
<h2></h2>
<p class="card-text">
Entrez sur une ligne une tâche qui pourraient se trouver sur vos listes personnelles (TODO list).
Par exemple :
<ul>
<li>acheter du pain</li>
<li>organiser le voyage à New York</li>
<li>faire le projet de bases de données</li>
<li>faire du sport</li>
<li>nourrir le chat</li>
</ul>
</p>
<br/>
<p>Etape <strong>2/6</strong></p>
<h2></h2>
<p class="card-text">
Catégorisez votre tâche selon les trois sphères suivantes : Personnelle (juste pour soi), Professionnelle
(pour le travail), Familiale (pour la famille ou les amis).
</p>
<p class="card-text">
Par exemple :
<center>
<table>
<tr><td>acheter du pain</td><td>Personnelle</td></tr>
<td>organiser le voyage à New York</td><td>Famille</td></tr>
<td>faire le projet de bases de données</td><td>Professionnelle</td></tr>
<td>faire du sport</td><td>Personnelle</td></tr>
<td>nourrir le chat</td><td>Famille</td></tr>
</table>
<center>
</p>
<br/>
<p>Etape <strong>3/6</strong></p>
<br/>
Catégorie de <strong>TAG</strong> :
\ No newline at end of file
<h2></h2>
<p class="card-text">
</p>
Pour votre tâche, indiquez son niveau de stress (1 - aucun stress, 5 très stressant).
<br/>
<p>Etape <strong>4/6</strong></p>
<br/>
Stress de <strong>TAG</strong> :
<h2></h2>
<p class="card-text">
</p>
Pour votre tâche, indiquez sa durée estimée.
<br/>
<p>Etape <strong>5/6</strong></p>
<br/>
Durée de <strong>TAG</strong> :
\ No newline at end of file
<h2></h2>
<p class="card-text">
Merci beaucoup pour votre participation. Et si vous recommenciez pour nous donner 5 réponses ? </p>
<p>Remerciement de la part de toute l'équipe.</p>
<br/>
<p>Etape <strong>6/6</strong></p>
<p class="card-text">
The todos that you are wrote:
WTODO
</p>
<br/>
<p> Vous êtes à l'étape <strong>3/5</strong> <p>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment