From 814fce2c0b0366b48c31abd24cd1ebb621c91c70 Mon Sep 17 00:00:00 2001
From: Yoan VALLET <ext.sopra.yvallet@grandlyon.com>
Date: Mon, 8 Mar 2021 17:49:23 +0100
Subject: [PATCH] update challenge custom question section

---
 docs/ecolyo/functionalities/challenge.md | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/docs/ecolyo/functionalities/challenge.md b/docs/ecolyo/functionalities/challenge.md
index 1c5fd1a..6dfc995 100644
--- a/docs/ecolyo/functionalities/challenge.md
+++ b/docs/ecolyo/functionalities/challenge.md
@@ -27,15 +27,16 @@ Here are the fields used to create a custom question
 
 | Field      | Type               | Description                                                      |
 | ---------- | ------------------ | ---------------------------------------------------------------- |
-| type       | CustomQuestionType | Type of custom qusetion: DATA or MAXLOAD or AVERAGE.                                              |
+| type       | CustomQuestionType | Type of custom qusetion: DATE or MAXLOAD or AVERAGE.                                              |
 | timeStep   | TimeStep           | Time step of the result value (DAY / WEEK / MONTH / YEAR). For MAXLOAD or AVERAGE type, it represents daily / weekly  / monthly / yearly average.                          |
 | interval   | TimeStep           | Interval in which the data will be searched (DAY / WEEK / MONTH / YEAR)                                               |
 | period     | CustomPeriod       | Case day / month / year:<br/>Use to define a specific period for the interval { day? / month? / year? }. <br/>Case weekday:<br/>Only usable with AVERAGE type and DAY timestep: Allow to specify a weekday on which average is made. If used with another type, period will not be taken into account.<br/>If not assigned the period will be the last interval (example: last week)                                                |
+| singleFluid | boolean           | Indicate if all connected fluid should be taken into account.<br/>If set to true only the first connected fluid will be taken into account in this order: electricity, gas, water. #unit and #fluid in the question label will be replace by the unit and the name of the fluid       |
 | result     | UserQuizState      | Indicate the state of the custom question (UNLOCKED, CORRECT, UNCORRECT)       |
 
 Calculation of custom question is done by conbinaison of all parameters:
 
-- Type DATA
+- Type DATE
 
   - If *period* is empty.
 
@@ -46,6 +47,16 @@ Calculation of custom question is done by conbinaison of all parameters:
   timeStep = TimeStep.DAY
   interval = TimeStep.WEEK
   period = {}
+  singleFluid = false
+  ```
+
+  ```
+  example: What day did I consumme the most #fluid in #unit on the last week ?
+  type = CustomQuestionType.DATA
+  timeStep = TimeStep.DAY
+  interval = TimeStep.WEEK
+  period = {}
+  singleFluid = true
   ```
 
   - If *period* is not empty
@@ -57,6 +68,7 @@ Calculation of custom question is done by conbinaison of all parameters:
   timeStep = TimeStep.MONTH
   interval = TimeStep.YEAR
   period = { year: 2020 }
+  singleFluid = false
   ```
 
 - Type MAXLOAD
@@ -70,6 +82,7 @@ Calculation of custom question is done by conbinaison of all parameters:
   timeStep = TimeStep.DAY
   interval = TimeStep.WEEK
   period = {}
+  singleFluid = false
   ```
 
   - If *period* is not empty
@@ -81,6 +94,7 @@ Calculation of custom question is done by conbinaison of all parameters:
   timeStep = TimeStep.DAY
   interval = TimeStep.MONTH
   period = { month: 1, year: 2020 }
+  singleFluid = false
   ```
 
 - Type AVERAGE
@@ -94,6 +108,7 @@ Calculation of custom question is done by conbinaison of all parameters:
   timeStep = TimeStep.DAY
   interval = TimeStep.WEEK
   period = {}
+  singleFluid = false
   ```
 
   - If *period* is not empty
@@ -105,6 +120,7 @@ Calculation of custom question is done by conbinaison of all parameters:
   timeStep = TimeStep.DAY
   interval = TimeStep.MONTH
   period = { month: 1, year: 2020 }
+  singleFluid = false
   ```
 
   - If *period* is weekday
@@ -116,6 +132,7 @@ Calculation of custom question is done by conbinaison of all parameters:
   timeStep = TimeStep.DAY
   interval = TimeStep.MONTH
   period = { weekday: 3 }
+  singleFluid = false
   ```
 
 Then, two randoms answers are generated after defining the right answer.
-- 
GitLab