fix(challenge-helpers): add template for generic challenge (#61249)

This commit is contained in:
Tom
2025-07-08 16:27:11 -05:00
committed by GitHub
parent 76f7d08454
commit 0c6222cd70
2 changed files with 18 additions and 2 deletions

View File

@@ -330,6 +330,19 @@ Watch the video.
\`\`\`
`;
const getGenericChallengeTemplate = (
options: ChallengeOptions
): string => `${buildFrontMatter(options)}
# --description--
Generic challenge description.
# --assignment--
Do the assignment.
`;
type Template = (opts: ChallengeOptions) => string;
export const getTemplate = (challengeType: string): Template => {
@@ -375,5 +388,7 @@ const challengeTypeToTemplate: {
19: getMultipleChoiceChallengeTemplate,
20: null,
21: getDialogueChallengeTemplate,
22: getFillInTheBlankChallengeTemplate
22: getFillInTheBlankChallengeTemplate,
23: null,
24: getGenericChallengeTemplate
};

View File

@@ -3,7 +3,8 @@ import { challengeTypes } from '../../../shared/config/challenge-types';
const taskChallenges = [
challengeTypes.multipleChoice,
challengeTypes.fillInTheBlank
challengeTypes.fillInTheBlank,
challengeTypes.generic
];
export const newTaskPrompts = async (): Promise<{