Skip to content
Snippets Groups Projects
Commit 814fce2c authored by Yoan VALLET's avatar Yoan VALLET
Browse files

update challenge custom question section

parent 34516731
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment