Add student averages to Statystyki.mvc/GetOcenyCzastkowe (#42)

This commit is contained in:
Dawid K 2022-01-23 19:12:53 +01:00 committed by GitHub
parent afa13521c2
commit 05b032074e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -687,6 +687,7 @@ router.all("/Sprawdziany.mvc/Get", (req, res) => {
router.all("/Statystyki.mvc/GetOcenyCzastkowe", (req, res) => {
let average = 2.0;
let studentAverage = 3.0;
res.json({
"data": _.chain(require("../../data/opiekun/oceny-statystyki-czastkowe"))
.groupBy("subject")
@ -694,6 +695,7 @@ router.all("/Statystyki.mvc/GetOcenyCzastkowe", (req, res) => {
.value()
.map(item => {
average += 0.1;
studentAverage += 0.25;
return {
"Subject": item.subject,
"IsAverage": true,
@ -708,7 +710,7 @@ router.all("/Statystyki.mvc/GetOcenyCzastkowe", (req, res) => {
})
},
"StudentSeries": {
"Average": null,
"Average": studentAverage,
"IsEmpty": false,
"Items": item.series.map(item => {
return {