Skip to content

feat: added some quiz questions #99

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
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
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.
}
}