Skip to content

Commit

Permalink
feat: added Xavier's quiz questions (code-differently#99)
Browse files Browse the repository at this point in the history
* feat: added some quiz questions

* Update quizzes.module.ts

* Update quizzes.module.ts
  • Loading branch information
XavierCruz5106 authored Oct 1, 2024
1 parent de452f0 commit e1dc6b3
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lesson_03/quiz/quiz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ quiz:
anotherone:
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
xaviercruz:
- $2y$10$1WMmkMjazP78KVns1l85zOC5r8cwgTnxLLs/scOzIkgCQ8HP28Y.q
- $2y$10$9D.oRC8h/PD/10NMSR6MMOzjVAJKm.vfw4te8Rxgw1M1.0Q9x8pjK
- $2y$10$ypLhtfxJikRhLaQdW0Y8GOEqO/X1uoBD8w.kSSSUPggBa9wHLkw0i
- $2y$10$cYuji5D0xOEFAV2fyMaJAuaODeWEwIYu.X3089qnojdx3nQljil5G
dasiaenglish:
- $2y$10$ANtdDzA0GAqn/QeExPO/Du8LgHUwznRLxpv0W0ib2seYk23BZowOC
- $2y$10$6vAkOUmpPrUtWrh010f8e.A4M9kEzuzCrQ8ghWI9hQSEsZeGHpQ9W
Expand Down
5 changes: 3 additions & 2 deletions lesson_03/quiz/src/quizzes/quizzes.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Module } from '@nestjs/common';
import { AngelicaCQuiz } from './angelica_c_quiz.js';
import { AnotherQuiz } from './another_quiz.js';
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
import { XavierCruzQuiz } from './xavier_cruz_quiz.js';
import { DasiaEnglishQuiz } from './dasia_english_quiz.js';
import { ChigazoGrahamsQuiz } from './chigazo_graham_quiz.js';
import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js';
Expand All @@ -12,7 +13,6 @@ import { AmiyahJonesQuiz } from './amiyah_jones_quiz.js';
export const Quizzes = Symbol.for('Quizzes');

// Add your quiz provider here.

const QUIZ_PROVIDERS = [
AnthonyMaysQuiz,
YafiahAbdullahQuiz,
Expand All @@ -22,7 +22,8 @@ const QUIZ_PROVIDERS = [
OyeyemiJimohQuiz,
DasiaEnglishQuiz,
ChigazoGrahamsQuiz,
AmiyahJonesQuiz
AmiyahJonesQuiz,
XavierCruzQuiz
];

@Module({
Expand Down
76 changes: 76 additions & 0 deletions lesson_03/quiz/src/quizzes/xavier_cruz_quiz.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import {
AnswerChoice,
MultipleChoiceQuizQuestion,
QuizQuestion,
QuizQuestionProvider,
} from 'codedifferently-instructional';

export class XavierCruzQuiz implements QuizQuestionProvider {
getProviderName(): string {
return 'xaviercruz';
}

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

private static makeQuestion0(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
0,
'What programming language supports the "struct" data type?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'C'],
[AnswerChoice.B, 'PHP'],
[AnswerChoice.C, 'JSP'],
[AnswerChoice.D, 'HTML'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}

private static makeQuestion1(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
1,
'What is another name for an app?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'Program'],
[AnswerChoice.B, 'Field'],
[AnswerChoice.C, 'Record'],
[AnswerChoice.D, 'Library'],
]),
AnswerChoice.UNANSWERED,
); // Provide an answer.
}

private static makeQuestion2(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
2,
'A virtual machine is an example of what?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'Presentation'],
[AnswerChoice.B, 'Fabrication'],
[AnswerChoice.C, 'Deprecation'],
[AnswerChoice.D, 'Emulation'],
]),
AnswerChoice.UNANSWERED,
); // Provide an answer.
}
private static makeQuestion3(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
3,
'What data type closely resembles a queue?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'String'],
[AnswerChoice.B, 'Character'],
[AnswerChoice.C, 'Integer'],
[AnswerChoice.D, 'Array'],
]),
AnswerChoice.UNANSWERED,
); // Provide an answer.
}
}

0 comments on commit e1dc6b3

Please sign in to comment.