diff --git a/src/utils/actions.ts b/src/utils/actions.ts index 9a6704a..2c08e89 100755 --- a/src/utils/actions.ts +++ b/src/utils/actions.ts @@ -359,7 +359,7 @@ export function loadJSON( dataFiles: Array, dataDir: string ): Array { - return dataFiles.reduce((acc, dataFile, index) => { + const res: Array = dataFiles.reduce((acc, dataFile, index) => { const dataPath = dataDir + dataFile.path if (!utils.FileExists(dataPath)) { @@ -382,6 +382,21 @@ export function loadJSON( } return acc }, []) + + let subjCount = 0 + let questionCount = 0 + res.forEach((qdb) => { + subjCount += qdb.data.length + qdb.data.forEach((subj) => { + questionCount += subj.Questions.length + }) + }) + logger.Log( + `Loaded ${subjCount} subjects with ${questionCount} questions from ${res.length} question db-s`, + logger.GetColor('green') + ) + + return res } export function writeData(data: Array, path: string): void {