MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / createQuizFile

Function createQuizFile

tools/challenge-helper-scripts/utils.ts:81–103  ·  view source on GitHub ↗
({
  challengeId,
  projectPath = getProjectPath(),
  title,
  dashedName,
  questionCount,
  challengeLang
}: QuizOptions)

Source from the content-addressed store, hash-verified

79};
80
81const createQuizFile = ({
82 challengeId,
83 projectPath = getProjectPath(),
84 title,
85 dashedName,
86 questionCount,
87 challengeLang
88}: QuizOptions): ObjectId => {
89 const challengeType = challengeTypes.quiz.toString();
90 const template = getTemplate(challengeType);
91
92 const quizText = template({
93 challengeId,
94 challengeType,
95 title,
96 dashedName,
97 questionCount,
98 challengeLang
99 });
100
101 fs.writeFileSync(`${projectPath}${challengeId.toString()}.md`, quizText);
102 return challengeId;
103};
104
105const createDialogueFile = ({
106 challengeId,

Callers 3

createQuizChallengeFunction · 0.85
createQuizChallengeFunction · 0.85
createQuizChallengeFunction · 0.85

Calls 2

getProjectPathFunction · 0.85
getTemplateFunction · 0.85

Tested by

no test coverage detected