Add average to grade statistics
This commit is contained in:
parent
4164cd37f1
commit
422eba3441
1 changed files with 4 additions and 2 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue