| 253 | } |
| 254 | |
| 255 | async function getModules(superBlock: string, chapterName: string) { |
| 256 | const blockMetaFile = await fs.readFile( |
| 257 | '../../curriculum/structure/superblocks/' + superBlock + '.json', |
| 258 | { encoding: 'utf8' } |
| 259 | ); |
| 260 | const blockMetaData = JSON.parse( |
| 261 | blockMetaFile |
| 262 | ) as ChapterModuleSuperblockStructure; |
| 263 | const modifiedChapter = blockMetaData.chapters.find( |
| 264 | x => x.dashedName === chapterName |
| 265 | ); |
| 266 | return modifiedChapter?.modules; |
| 267 | } |
| 268 | |
| 269 | void getAllBlocks() |
| 270 | .then(async existingBlocks => { |