Add average to grade statistics

This commit is contained in:
Mikołaj Pich 2020-10-31 13:14:52 +01:00
parent 4164cd37f1
commit 422eba3441

View file

@ -658,17 +658,19 @@ router.all("/Sprawdziany.mvc/Get", (req, res) => {
});
router.all("/Statystyki.mvc/GetOcenyCzastkowe", (req, res) => {
let average = 2.0;
res.json({
"data": _.chain(require("../../data/opiekun/oceny-statystyki-czastkowe"))
.groupBy("subject")
.map((series, subject) => ({subject, series}))
.value()
.map(item => {
average += 0.1;
return {
"Subject": item.subject,
"IsAverage": false,
"IsAverage": true,
"ClassSeries": {
"Average": null,
"Average": average,
"IsEmpty": false,
"Items": item.series.map(item => {
return {