Skip to content

Commit

Permalink
Added james_capparellquiz.ts, updated quizzes.module.ts, edited the q…
Browse files Browse the repository at this point in the history
…uiz.yaml files
  • Loading branch information
jjcapparell committed Oct 1, 2024
1 parent 7659ee8 commit 0b9b989
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lesson_03/quiz/quiz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ quiz:
anotherone:
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
jamescapparell:
- $2y$10$iLvL/AaFPzcGZrcna7umMuHqkZe1f9at/ix77NUI6uakDGNuVKQCy
- $2y$10$FLxmGXJLm5EziyhA5D33ju0kUjXhiDbuUdImciLQz8lBRu5ou0hee
- $2y$10$9bIwC0Or.LhwAZrNL5Dvn.vjyhDF79Iw5ukm3h/oKauRCYOGSIlSK
55 changes: 55 additions & 0 deletions lesson_03/quiz/src/quizzes/james_capparell_quiz.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import {
AnswerChoice,
MultipleChoiceQuizQuestion,
QuizQuestion,
QuizQuestionProvider,
} from 'codedifferently-instructional';

export class JamesCapparellQuiz implements QuizQuestionProvider {
getProviderName(): string {
return 'jamescapparell';
}

makeQuizQuestions(): QuizQuestion[] {
return [
JamesCapparellQuiz.makeQuestion0(),
JamesCapparellQuiz.makeQuestion1(),
JamesCapparellQuiz.makeQuestion2(),
];
}

private static makeQuestion0(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
0,
'What county in Delaware is Code differently offices in?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'Sussex County'],
[AnswerChoice.B, 'Kent County'],
[AnswerChoice.C, 'New Castle County'],
[AnswerChoice.D, 'Lancaster County'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}
private static makeQuestion1(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
1,
'Which video game charcter has the most games in their series?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'Mario'],
[AnswerChoice.B, 'Sonic'],
[AnswerChoice.C, 'Mega Man'],
[AnswerChoice.D, 'Pikachu'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}

private static makeQuestion2(): QuizQuestion {
return new QuizQuestion(
2,
'Type the full answer while filling in the blanks! A _____ that transforms ____ data into ____ data using automatically executed, pre-programmed ____.',
'A _____ that transforms ____ data into ____ data using automatically executed, pre-programmed ____.',
); // Provide an answer.
}
}
3 changes: 2 additions & 1 deletion lesson_03/quiz/src/quizzes/quizzes.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Module } from '@nestjs/common';
import { AnotherQuiz } from './another_quiz.js';
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
import { JamesCapparellQuiz } from './james_capparell_quiz.js';

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

// Add your quiz provider here.
const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz];
const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz, JamesCapparellQuiz];

@Module({
providers: [
Expand Down

0 comments on commit 0b9b989

Please sign in to comment.