Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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,4 +6,9 @@ quiz:
anotherone:
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa
trinitiejackson:
- $2y$10$rAjBDhSg9FX0aHDGy4cSlO76bdyy9p5P6ibEOO.AHbxPhUJ9xCcu.
- $2y$10$0nfjyM6HZyKq6To4sQ/Uvuv37qt0l6sI1hrS7EW3orVhzTwTZLLuq
- $2y$10$vtxCd52gGV0lAjsP0Ox3DexP2nNKZfaClM66aRU9f1FosxjZUMkUW
- $2y$10$5aphEGmaoeTKA0ojlYYYCuw8Wx9UTDAG3pVHNHYPMSwNqONcFKh/W

4 changes: 3 additions & 1 deletion lesson_03/quiz/src/quizzes/quizzes.module.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Module } from '@nestjs/common';
import { AnotherQuiz } from './another_quiz.js';
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
import { TrinitieJacksonQuiz } from './trinitie_jackson_quiz.js';
export const Quizzes = Symbol.for('Quizzes');

// Add your quiz provider here.

const QUIZ_PROVIDERS = [
AnthonyMaysQuiz,
AnthonyMaysQuiz,
TrinitieJacksonQuiz,
AnotherQuiz,

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

export class TrinitieJacksonQuiz implements QuizQuestionProvider {
getProviderName(): string {
return 'trinitiejackson';
}

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

private static makeQuestion0(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
0,
'Where was the term "fork" coined from?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'GitHub'],
[AnswerChoice.B, 'Eclipse'],
[AnswerChoice.C, 'XCode'],
[AnswerChoice.D, 'NetBeans'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}

private static makeQuestion1(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
1,
'In the desk analogy, what is the CPU?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'motherboard'],
[AnswerChoice.B, 'power supply'],
[AnswerChoice.C, 'software'],
[AnswerChoice.D, 'calculator'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}

private static makeQuestion2(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
2,
'What does the "cat" command do in a terminal?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'copy a file or directory'],
[AnswerChoice.B, 'dumps contents of a file'],
[AnswerChoice.C, 'run any command'],
[AnswerChoice.D, 'view the last several lines of a file'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}

private static makeQuestion3(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
3,
'Which is NOT a void element in HTML?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'img'],
[AnswerChoice.B, 'input'],
[AnswerChoice.C, 'br'],
[AnswerChoice.D, 'p'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}
}