Skip to content

Commit b2937cc

Browse files
XavierCruz5106marleomac3
authored andcommitted
feat: added Xavier's quiz questions (code-differently#99)
* feat: added some quiz questions * Update quizzes.module.ts * Update quizzes.module.ts
1 parent 53fded3 commit b2937cc

File tree

3 files changed

+84
-1
lines changed

3 files changed

+84
-1
lines changed

lesson_03/quiz/quiz.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ quiz:
77
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
88
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
99
dasiaenglish:
10+
xaviercruz:
11+
- $2y$10$1WMmkMjazP78KVns1l85zOC5r8cwgTnxLLs/scOzIkgCQ8HP28Y.q
12+
- $2y$10$9D.oRC8h/PD/10NMSR6MMOzjVAJKm.vfw4te8Rxgw1M1.0Q9x8pjK
13+
- $2y$10$ypLhtfxJikRhLaQdW0Y8GOEqO/X1uoBD8w.kSSSUPggBa9wHLkw0i
14+
- $2y$10$cYuji5D0xOEFAV2fyMaJAuaODeWEwIYu.X3089qnojdx3nQljil5G
15+
dasiaenglish:
1016
- $2y$10$ANtdDzA0GAqn/QeExPO/Du8LgHUwznRLxpv0W0ib2seYk23BZowOC
1117
- $2y$10$6vAkOUmpPrUtWrh010f8e.A4M9kEzuzCrQ8ghWI9hQSEsZeGHpQ9W
1218
- $2y$10$YYTJf2QW.BJST9EUB7NZneVpNkOywIfhsWRpxIsPBg/oTmgqoYWse

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import { DasiaEnglishQuiz } from './dasia_english_quiz.js';
88
import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js';
99
import { LjMcwilliamsQuiz } from './lj_mcwilliams_quiz.js';
1010
import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js';
11+
import { XavierCruzQuiz } from './xavier_cruz_quiz.js';
1112
import { YafiahAbdullahQuiz } from './yafiah_abdullah_quiz.js';
1213

1314
export const Quizzes = Symbol.for('Quizzes');
1415

1516
// Add your quiz provider here.
16-
1717
const QUIZ_PROVIDERS = [
1818
AnthonyMaysQuiz,
1919
YafiahAbdullahQuiz,
@@ -24,6 +24,7 @@ const QUIZ_PROVIDERS = [
2424
DasiaEnglishQuiz,
2525
ChigazoGrahamsQuiz,
2626
AmiyahJonesQuiz,
27+
XavierCruzQuiz,
2728
LjMcwilliamsQuiz,
2829
];
2930

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)