Skip to content

Commit 421ad4a

Browse files
committed
feat: Ran test and got 3/4 then 4/4 using my
provider name/sidenote the test would only allow for two questions on my end/
1 parent 50b22d2 commit 421ad4a

File tree

4 files changed

+52
-1
lines changed

4 files changed

+52
-1
lines changed

lesson_03/package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lesson_03/quiz/quiz.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ quiz:
66
anotherone:
77
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
88
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
9+
josephcaballero:
10+
- $2y$10$FmVJ1V9hSIUbi8DGx4cq5.wPOMq5en312H4zb5H2AJUDtDeWJg74e
11+
- $2y$10$vI6tL8o2P23w/bh5tYvyf.iiH42BQHl5Rh1teG8mMaMfj1XNhO/..
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class JosephCaballeroQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'josephcaballero';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
JosephCaballeroQuiz.makeQuestion0(),
16+
JosephCaballeroQuiz.makeQuestion1(),
17+
];
18+
}
19+
20+
private static makeQuestion0(): QuizQuestion {
21+
return new MultipleChoiceQuizQuestion(
22+
0,
23+
'What is HTML?',
24+
new Map<AnswerChoice, string>([
25+
[AnswerChoice.A, 'A food branch'],
26+
[
27+
AnswerChoice.B,
28+
'A hypertext markup language for frontend development',
29+
],
30+
[AnswerChoice.C, 'An animal'],
31+
[AnswerChoice.D, 'Whatever you want it to be!'],
32+
]),
33+
AnswerChoice.UNANSWERED,
34+
); // Replace `UNANSWERED` with the correct answer | B.
35+
}
36+
37+
private static makeQuestion1(): QuizQuestion {
38+
return new QuizQuestion(1, 'What is the styling language for HTML?', '');
39+
// Provide an answer.
40+
}
41+
}

lesson_03/quiz/src/quizzes/quizzes.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { Module } from '@nestjs/common';
22
import { AnotherQuiz } from './another_quiz.js';
33
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
4+
import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js';
45

56
export const Quizzes = Symbol.for('Quizzes');
67

78
// Add your quiz provider here.
8-
const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz];
9+
const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz, JosephCaballeroQuiz];
910

1011
@Module({
1112
providers: [

0 commit comments

Comments
 (0)