Skip to content

Chigazo Lesson 03 #92

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 7 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
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
chigazograham:
- $2y$10$OTnSih9kHykUnsuM/YKufu3MXTpOZrif.dL13XwXt8rquJL4mV.m.
- $2y$10$je60MntrKRBd/1tz7hNUY.D/cyKOEM.hp6/1fVVVGJRIIitmUGI5e
- $2y$10$pPTmEp0acs8.NIAamLpmmuF7B72bXFZsikHywQI/JvfXuySkhHH5S
60 changes: 60 additions & 0 deletions lesson_03/quiz/src/quizzes/chigazo_graham_quiz.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import {
AnswerChoice,
MultipleChoiceQuizQuestion,
QuizQuestion,
QuizQuestionProvider,
} from 'codedifferently-instructional';

export class ChigazoGrahamsQuiz implements QuizQuestionProvider {
getProviderName(): string {
return 'chigazograham';
}

makeQuizQuestions(): QuizQuestion[] {
return [ChigazoGrahamsQuiz.makeQuestion1(), ChigazoGrahamsQuiz.makeQuestion2, ChigazoGrahamsQuiz.makeQuestion3()];
}

private static makeQuestion1(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
1,
'What is the sign for Modulo?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, '^'],
[AnswerChoice.B, '*'],
[AnswerChoice.C,'%',],
[AnswerChoice.D, '//'],
]),
AnswerChoice.UNANSWERED,
); // Provide an answer. | AnswerChoice.C, '%'
}

private static makeQuestion2(): QuizQuestion {
return new QuizQuestion(
2,
'Who is are big three in hip hop?',
'A machine that automatically transforms input into output.',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'Kendrick Lamar, J. Cole, and Drake'],
[AnswerChoice.B, 'Tupac, Biggie, and Nas'],
[AnswerChoice.C, 'Kanye West, Eminem, and Lil Wayne',],
[AnswerChoice.D, 'K. Dot'],
]),
AnswerChoice.UNANSWERED,
); // Provide an answer. | AnswerChoice.D, 'K. Dot'
}

private static makeQuestion3(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
3,
'what is the answer to life, the universe, and everything else?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, '42'],
[AnswerChoice.B, 'Jesus'],
[AnswerChoice.C,'N/A'],
[AnswerChoice.D, 'Whatever you want it to be!'],
]),
AnswerChoice.UNANSWERED,
); // Provide an answer. | AnswerChoice.A, '42'
}

}
4 changes: 2 additions & 2 deletions lesson_03/quiz/src/quizzes/quizzes.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Module } from '@nestjs/common';
import { ChigazoGrahamsQuiz } from './chigazo_graham_quiz.js';
import { AnotherQuiz } from './another_quiz.js';
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';

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

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

@Module({
providers: [
Expand Down
Loading