@@ -15,6 +15,7 @@ const {
1515
1616const { isAuditedSuperBlock } = require ( '../shared/utils/is-audited' ) ;
1717const { createPoly } = require ( '../shared/utils/polyvinyl' ) ;
18+ const { chapterBasedSuperBlocks } = require ( '../shared/config/curriculum' ) ;
1819const {
1920 getSuperOrder,
2021 getSuperBlockFromDir,
@@ -287,16 +288,12 @@ async function buildChallenges({ path: filePath }, curriculum, lang) {
287288 challengeBlock . challenges = [ ...challengeBlock . challenges , challenge ] ;
288289}
289290
290- function isSuperBlockWithChapters ( superBlock ) {
291- return superBlock === 'full-stack-developer' ;
292- }
293-
294291// This is a slightly weird abstraction, but it lets us define helper functions
295292// without passing around a ton of arguments.
296293function generateChallengeCreator ( lang , englishPath , i18nPath ) {
297294 function addMetaToChallenge ( challenge , meta ) {
298295 function addChapterAndModuleToChallenge ( challenge ) {
299- if ( isSuperBlockWithChapters ( challenge . superBlock ) ) {
296+ if ( chapterBasedSuperBlocks . includes ( challenge . superBlock ) ) {
300297 challenge . chapter = getChapterFromBlock (
301298 challenge . block ,
302299 fullStackSuperBlockStructure
@@ -329,7 +326,7 @@ function generateChallengeCreator(lang, englishPath, i18nPath) {
329326 challenge . blockType = meta . blockType ;
330327 challenge . blockLayout = meta . blockLayout ;
331328 challenge . hasEditableBoundaries = ! ! meta . hasEditableBoundaries ;
332- challenge . order = isSuperBlockWithChapters ( meta . superBlock )
329+ challenge . order = chapterBasedSuperBlocks . includes ( meta . superBlock )
333330 ? getBlockOrder ( meta . dashedName , fullStackSuperBlockStructure )
334331 : meta . order ;
335332
0 commit comments