Skip to content

Commit 4790057

Browse files
committed
Add TobaisEvansQuiz with 3 new questions
1 parent 43c83c0 commit 4790057

File tree

2 files changed

+70
-3
lines changed

2 files changed

+70
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ import { Module } from '@nestjs/common';
22
import { AnotherQuiz } from './another_quiz.js';
33
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
44
import { BrooklynHardenQuiz } from './brooklyn_harden_quiz.js';
5-
export const Quizzes = Symbol.for('Quizzes');
5+
import { TobaisEvansQuiz } from './tobais_evans_quiz.js';
66

7-
// Add your quiz provider here.
7+
export const Quizzes = Symbol.for('Quizzes');
88

9-
const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz, BrooklynHardenQuiz];
9+
const QUIZ_PROVIDERS = [
10+
AnthonyMaysQuiz,
11+
AnotherQuiz,
12+
BrooklynHardenQuiz,
13+
TobaisEvansQuiz,
14+
];
1015

1116
@Module({
1217
providers: [
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import {
2+
AnswerChoice,
3+
MultipleChoiceQuizQuestion,
4+
QuizQuestion,
5+
QuizQuestionProvider,
6+
} from 'codedifferently-instructional';
7+
8+
export class TobaisEvansQuiz implements QuizQuestionProvider {
9+
getProviderName(): string {
10+
return 'tobaisevans';
11+
}
12+
13+
makeQuizQuestions(): QuizQuestion[] {
14+
return [
15+
TobaisEvansQuiz.makeQuestion0(),
16+
TobaisEvansQuiz.makeQuestion1(),
17+
TobaisEvansQuiz.makeQuestion2(),
18+
];
19+
}
20+
21+
private static makeQuestion0(): QuizQuestion {
22+
return new MultipleChoiceQuizQuestion(
23+
0,
24+
'Which programming language is known for running in the browser?',
25+
new Map<AnswerChoice, string>([
26+
[AnswerChoice.A, 'Python'],
27+
[AnswerChoice.B, 'JavaScript'],
28+
[AnswerChoice.C, 'C++'],
29+
[AnswerChoice.D, 'Java'],
30+
]),
31+
AnswerChoice.UNANSWERED, // Replace with correct answer later
32+
);
33+
}
34+
35+
private static makeQuestion1(): QuizQuestion {
36+
return new MultipleChoiceQuizQuestion(
37+
1,
38+
'In Git, what does "commit" mean?',
39+
new Map<AnswerChoice, string>([
40+
[AnswerChoice.A, 'Delete changes permanently'],
41+
[AnswerChoice.B, 'Save a snapshot of your project history'],
42+
[AnswerChoice.C, 'Create a new branch'],
43+
[AnswerChoice.D, 'Send changes to the internet'],
44+
]),
45+
AnswerChoice.UNANSWERED, // Replace with correct answer later
46+
);
47+
}
48+
49+
private static makeQuestion2(): QuizQuestion {
50+
return new MultipleChoiceQuizQuestion(
51+
2,
52+
'Which HTML tag is used for the largest heading?',
53+
new Map<AnswerChoice, string>([
54+
[AnswerChoice.A, '<h6>'],
55+
[AnswerChoice.B, '<head>'],
56+
[AnswerChoice.C, '<h1>'],
57+
[AnswerChoice.D, '<title>'],
58+
]),
59+
AnswerChoice.UNANSWERED, // Replace with correct answer later
60+
);
61+
}
62+
}

0 commit comments

Comments
 (0)