mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-26 16:00:56 -04:00
fix(challenge-helpers): add template for generic challenge (#61249)
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
@@ -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<{
|
||||
|
||||
Reference in New Issue
Block a user