Skip to content

Commit

Permalink
Readd quiz to markdown parser (#217)
Browse files Browse the repository at this point in the history
Co-authored-by: PhilipAB <[email protected]>
  • Loading branch information
PhilipAB and PhilipAB authored Feb 12, 2025
1 parent 239def8 commit 9770ec7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/hf-markdown/hf-markdown.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ ${token}`;
return `<app-mermaid-md [code]="'${escape(code)}'"></app-mermaid-md>`;
},

quiz(code: string, quizTitle: string, allowedAttempts?: string) {
const tempAtts = Number(allowedAttempts);
const allowedAtts = isNaN(tempAtts) || tempAtts < 1 ? 1 : tempAtts;
return `
<quiz
quizTitle="${quizTitle}"
questionsRaw="${code}"
[allowedAtts]="${allowedAtts}"
>
</quiz>
`;
},

verifyTask(code: string, target: string, taskName: string) {
return `<app-single-task-verification-markdown
target="${target}"
Expand Down

0 comments on commit 9770ec7

Please sign in to comment.