mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Subjinfo fix
This commit is contained in:
parent
3ed66f43b4
commit
a0029d1998
1 changed files with 6 additions and 6 deletions
|
@ -824,9 +824,9 @@ function GetApp() {
|
|||
|
||||
function getSimplreRes() {
|
||||
return {
|
||||
subjects: data.length,
|
||||
questions: data.reduce((acc, subj) => {
|
||||
return acc + subj.length
|
||||
subjects: data.Subjects.length,
|
||||
questions: data.Subjects.reduce((acc, subj) => {
|
||||
return acc + subj.Questions.length
|
||||
}, 0),
|
||||
}
|
||||
}
|
||||
|
@ -834,7 +834,7 @@ function GetApp() {
|
|||
return data.map((subj) => {
|
||||
return {
|
||||
name: subj.Name,
|
||||
count: subj.length,
|
||||
count: subj.Questions.length,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -887,8 +887,8 @@ function GetApp() {
|
|||
utils.AppendToFile(
|
||||
JSON.stringify({
|
||||
date: utils.GetDateString(),
|
||||
subjectCount: data.length,
|
||||
questionCOunt: data.reduce((acc, subj) => {
|
||||
subjectCount: data.Subjects.length,
|
||||
questionCount: data.Subjects.reduce((acc, subj) => {
|
||||
return acc + subj.Questions.length
|
||||
}, 0),
|
||||
userCount: dbtools.TableInfo(userDB, 'users').dataCount,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue