Skip to content

Commit 7d55306

Browse files
authored
feat: adds Joseph's quiz (#93)
* 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/ * feat: redid the quiz after bugfix * feat: extra to quiz.ts file after bugfix * feat: removed package-lock.json * feat: updated branch from main for pull
1 parent 0474f16 commit 7d55306

File tree

3 files changed

+69
-5
lines changed

3 files changed

+69
-5
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ 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/..
12+
- $2y$10$BSPejBBqvmV7iEilAy7kOOaBCtIVDWxfvH53b/v106qadbhQeQXEW
913
yafiahAbdullah:
10-
- $2y$10$XcsVuO66KZiUiN75NtssdOkKvHKhuBo91JgE/TJEnSrrzbhjxuql.
11-
- $2y$10$9fZs867NHxoPQ/VWMeLyj.us5Kg3SLPcbt9O5ki/FdJ37TbhgFMFC
12-
- $2y$10$GfjcKvtzr6n8553Mdr1RJOOYDfzOudlW.3i8otsH0HiW52CU7tUAW
14+
- $2y$10$XcsVuO66KZiUiN75NtssdOkKvHKhuBo91JgE/TJEnSrrzbhjxuql.
15+
- $2y$10$9fZs867NHxoPQ/VWMeLyj.us5Kg3SLPcbt9O5ki/FdJ37TbhgFMFC
16+
- $2y$10$GfjcKvtzr6n8553Mdr1RJOOYDfzOudlW.3i8otsH0HiW52CU7tUAW
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
JosephCaballeroQuiz.makeQuestion2(),
18+
];
19+
}
20+
21+
private static makeQuestion0(): QuizQuestion {
22+
return new MultipleChoiceQuizQuestion(
23+
0,
24+
'What is HTML?',
25+
new Map<AnswerChoice, string>([
26+
[AnswerChoice.A, 'A food branch'],
27+
[
28+
AnswerChoice.B,
29+
'A hypertext markup language for frontend development',
30+
],
31+
[AnswerChoice.C, 'An animal'],
32+
[AnswerChoice.D, 'Whatever you want it to be!'],
33+
]),
34+
AnswerChoice.UNANSWERED,
35+
); // Replace `UNANSWERED` with the correct answer .
36+
}
37+
38+
private static makeQuestion1(): QuizQuestion {
39+
return new QuizQuestion(1, 'What is the styling language for HTML?', '');
40+
// Provide an answer.
41+
}
42+
private static makeQuestion2(): QuizQuestion {
43+
return new MultipleChoiceQuizQuestion(
44+
2,
45+
'What does CSS stand for ?',
46+
new Map<AnswerChoice, string>([
47+
[AnswerChoice.A, 'Computing Style Software'],
48+
[AnswerChoice.B, 'Cascading Style Sheets'],
49+
[AnswerChoice.C, 'Circle Stuff and Stuff'],
50+
[AnswerChoice.D, 'Whatever you want it to be!'],
51+
]),
52+
AnswerChoice.UNANSWERED,
53+
); // Replace `UNANSWERED` with the correct answer.
54+
}
55+
}

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
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
import { YafiahAbdullahQuiz } from './yafiah_abdullah_quiz.js';
56

6-
77
export const Quizzes = Symbol.for('Quizzes');
88

99
// Add your quiz provider here.
10-
const QUIZ_PROVIDERS = [AnthonyMaysQuiz,YafiahAbdullahQuiz, AnotherQuiz];
10+
const QUIZ_PROVIDERS = [
11+
AnthonyMaysQuiz,
12+
YafiahAbdullahQuiz,
13+
AnotherQuiz,
14+
JosephCaballeroQuiz,
15+
];
1116

1217
@Module({
1318
providers: [

0 commit comments

Comments
 (0)