Subjinfo fix round 2

This commit is contained in:
mrfry 2020-10-05 16:14:00 +02:00
parent a0029d1998
commit 32d99916ff

View file

@ -824,9 +824,9 @@ function GetApp() {
function getSimplreRes() {
return {
subjects: data.Subjects.length,
questions: data.Subjects.reduce((acc, subj) => {
return acc + subj.Questions.length
subjects: data.length,
questions: data.reduce((acc, subj) => {
return acc + subj.length
}, 0),
}
}
@ -887,8 +887,8 @@ function GetApp() {
utils.AppendToFile(
JSON.stringify({
date: utils.GetDateString(),
subjectCount: data.Subjects.length,
questionCount: data.Subjects.reduce((acc, subj) => {
subjectCount: data.length,
questionCount: data.reduce((acc, subj) => {
return acc + subj.Questions.length
}, 0),
userCount: dbtools.TableInfo(userDB, 'users').dataCount,