Skip to content

Added quiz.ts, updated quizzes.module.ts, edited the quiz.yaml file for lesson_03 - James Capparell #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lesson_03/quiz/quiz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ quiz:
anotherone:
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
jamescapparell:
- $2y$10$iLvL/AaFPzcGZrcna7umMuHqkZe1f9at/ix77NUI6uakDGNuVKQCy
- $2y$10$FLxmGXJLm5EziyhA5D33ju0kUjXhiDbuUdImciLQz8lBRu5ou0hee
- $2y$10$hQTJ1d2giJ40AI8rSgBqWOij7j3WVqsvAMYOLFiixbYTcvETuF5cC
oyeyemijimoh:
- $2y$10$2LlSxAEM1HmR3Wl2fO6LQueu/77spr5SuWAh4b3MKesIWNy3CFjGe
- $2y$10$csA90DFxK7.uq6dSfS06Yukk5fQPrzLvU2Lp43ArTs2za28LVvRGO
Expand Down
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.
}
}
5 changes: 3 additions & 2 deletions lesson_03/quiz/src/quizzes/quizzes.module.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { Module } from '@nestjs/common';
import { AnotherQuiz } from './another_quiz.js';
import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js';
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
import { JamesCapparellQuiz } from './james_capparell_quiz.js';
import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js';
import { OyeyemiJimohQuiz } from './oyeyemi_jimoh_quiz.js';
import { YafiahAbdullahQuiz } from './yafiah_abdullah_quiz.js';

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

// Add your quiz provider here.

const QUIZ_PROVIDERS = [
AnthonyMaysQuiz,
YafiahAbdullahQuiz,
JamesCapparellQuiz,
AnotherQuiz,
JosephCaballeroQuiz,
OyeyemiJimohQuiz,
Expand Down