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