Skip to content

Homework 03 #98

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion lesson_03/quiz/quiz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ quiz:
- $2y$10$55EXRjF26JIgebtoH800ZOJecfefvMgHicuxf/rwTENuxiUaFQcNe
anotherone:
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
dylanlafferty:
- $2y$10$JpiqIw6Ip/DUgaOkggURk.wP1OtxxAlmYJvVPJQ/6GfG3SslHNrBu
- $2y$10$mPlPI9IsKf8cCKyQj3gtTOY8ffwgwTddHHjVAVd1PcAzfatOHED06
- $2y$10$Sr6Fu4QqmqX/oKYnypzQ9e4SxOiTuFAgnLVNd6rKz9AxZlcAjWwaK
61 changes: 61 additions & 0 deletions lesson_03/quiz/src/quizzes/Dylan_Lafferty_quiz.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import {
AnswerChoice,
MultipleChoiceQuizQuestion,
QuizQuestion,
QuizQuestionProvider,
} from 'codedifferently-instructional';

export class DylanLaffertyQuiz implements QuizQuestionProvider {
getProviderName(): string {
return 'dylanlafferty';
}

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

private static makeQuestion0(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
0,
'What is the Power supply unit most compared to when comparing it to a human body?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'Heart'],
[AnswerChoice.B, 'Arm'],
[AnswerChoice.C, 'Leg'],
[AnswerChoice.D, 'Brain'],
]),
AnswerChoice.A,
);
}
private static makeQuestion1(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
1,
'What is the full name of CPU?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'Central Place Unit'],
[AnswerChoice.B, 'Certified Processing Unit'],
[AnswerChoice.C, 'Central Processing Unit'],
[AnswerChoice.D, 'Configured Procerdale Unicode'],
]),
AnswerChoice.C,
);
}

private static makeQuestion2(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
2,
'What is used to keep Short term memory in a computer?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'Hard Drive'],
[AnswerChoice.B, 'SSD'],
[AnswerChoice.C, 'GPU'],
[AnswerChoice.D, 'RAM'],
]),
AnswerChoice.D,
);
}
}
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 { DylanLaffertyQuiz } from './Dylan_Lafferty_quiz.js';

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

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

@Module({
providers: [
Expand Down