Skip to content

Commit e1dc6b3

Browse files
feat: added Xavier's quiz questions (#99)
* feat: added some quiz questions * Update quizzes.module.ts * Update quizzes.module.ts
1 parent de452f0 commit e1dc6b3

File tree

3 files changed

+84
-2
lines changed

3 files changed

+84
-2
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ quiz:
66
anotherone:
77
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
88
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
9+
xaviercruz:
10+
- $2y$10$1WMmkMjazP78KVns1l85zOC5r8cwgTnxLLs/scOzIkgCQ8HP28Y.q
11+
- $2y$10$9D.oRC8h/PD/10NMSR6MMOzjVAJKm.vfw4te8Rxgw1M1.0Q9x8pjK
12+
- $2y$10$ypLhtfxJikRhLaQdW0Y8GOEqO/X1uoBD8w.kSSSUPggBa9wHLkw0i
13+
- $2y$10$cYuji5D0xOEFAV2fyMaJAuaODeWEwIYu.X3089qnojdx3nQljil5G
914
dasiaenglish:
1015
- $2y$10$ANtdDzA0GAqn/QeExPO/Du8LgHUwznRLxpv0W0ib2seYk23BZowOC
1116
- $2y$10$6vAkOUmpPrUtWrh010f8e.A4M9kEzuzCrQ8ghWI9hQSEsZeGHpQ9W

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Module } from '@nestjs/common';
22
import { AngelicaCQuiz } from './angelica_c_quiz.js';
33
import { AnotherQuiz } from './another_quiz.js';
44
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
5+
import { XavierCruzQuiz } from './xavier_cruz_quiz.js';
56
import { DasiaEnglishQuiz } from './dasia_english_quiz.js';
67
import { ChigazoGrahamsQuiz } from './chigazo_graham_quiz.js';
78
import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js';
@@ -12,7 +13,6 @@ import { AmiyahJonesQuiz } from './amiyah_jones_quiz.js';
1213
export const Quizzes = Symbol.for('Quizzes');
1314

1415
// Add your quiz provider here.
15-
1616
const QUIZ_PROVIDERS = [
1717
AnthonyMaysQuiz,
1818
YafiahAbdullahQuiz,
@@ -22,7 +22,8 @@ const QUIZ_PROVIDERS = [
2222
OyeyemiJimohQuiz,
2323
DasiaEnglishQuiz,
2424
ChigazoGrahamsQuiz,
25-
AmiyahJonesQuiz
25+
AmiyahJonesQuiz,
26+
XavierCruzQuiz
2627
];
2728

2829
@Module({
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class XavierCruzQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'xaviercruz';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
XavierCruzQuiz.makeQuestion0(),
16+
XavierCruzQuiz.makeQuestion1(),
17+
XavierCruzQuiz.makeQuestion2(),
18+
XavierCruzQuiz.makeQuestion3(),
19+
];
20+
}
21+
22+
private static makeQuestion0(): QuizQuestion {
23+
return new MultipleChoiceQuizQuestion(
24+
0,
25+
'What programming language supports the "struct" data type?',
26+
new Map<AnswerChoice, string>([
27+
[AnswerChoice.A, 'C'],
28+
[AnswerChoice.B, 'PHP'],
29+
[AnswerChoice.C, 'JSP'],
30+
[AnswerChoice.D, 'HTML'],
31+
]),
32+
AnswerChoice.UNANSWERED,
33+
); // Replace `UNANSWERED` with the correct answer.
34+
}
35+
36+
private static makeQuestion1(): QuizQuestion {
37+
return new MultipleChoiceQuizQuestion(
38+
1,
39+
'What is another name for an app?',
40+
new Map<AnswerChoice, string>([
41+
[AnswerChoice.A, 'Program'],
42+
[AnswerChoice.B, 'Field'],
43+
[AnswerChoice.C, 'Record'],
44+
[AnswerChoice.D, 'Library'],
45+
]),
46+
AnswerChoice.UNANSWERED,
47+
); // Provide an answer.
48+
}
49+
50+
private static makeQuestion2(): QuizQuestion {
51+
return new MultipleChoiceQuizQuestion(
52+
2,
53+
'A virtual machine is an example of what?',
54+
new Map<AnswerChoice, string>([
55+
[AnswerChoice.A, 'Presentation'],
56+
[AnswerChoice.B, 'Fabrication'],
57+
[AnswerChoice.C, 'Deprecation'],
58+
[AnswerChoice.D, 'Emulation'],
59+
]),
60+
AnswerChoice.UNANSWERED,
61+
); // Provide an answer.
62+
}
63+
private static makeQuestion3(): QuizQuestion {
64+
return new MultipleChoiceQuizQuestion(
65+
3,
66+
'What data type closely resembles a queue?',
67+
new Map<AnswerChoice, string>([
68+
[AnswerChoice.A, 'String'],
69+
[AnswerChoice.B, 'Character'],
70+
[AnswerChoice.C, 'Integer'],
71+
[AnswerChoice.D, 'Array'],
72+
]),
73+
AnswerChoice.UNANSWERED,
74+
); // Provide an answer.
75+
}
76+
}

0 commit comments

Comments
 (0)