Skip to content

Feature lesson03 #116

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 8 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
dennislipscomb:
- $2y$10$Y9gmPBd6JGgk06f/uv1MNOGf7sqxqfxYmF5GW48aZ95Homie8FdCC
- $2y$10$vSETgB7wDGzpe5IQwGaZee2N7n1FafP.UelRv3QfpnZ4e.wvUmN8e
- $2y$10$UJGI.LGQ6IwNRUoyl35PmOMoaz3a1pAD8G4Rmn5L9scYDepSz4ypO
62 changes: 62 additions & 0 deletions lesson_03/quiz/src/quizzes/dennis_quiz.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import {
AnswerChoice,
MultipleChoiceQuizQuestion,
QuizQuestion,
QuizQuestionProvider,
} from 'codedifferently-instructional';

export class DennisQuiz implements QuizQuestionProvider {
getProviderName(): string {
return 'dennislipscomb';
}

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

private static makeQuestion0(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
0,
'What is RAM?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'Random Access Motherboard'],
[AnswerChoice.B, 'Run Access Memory'],
[AnswerChoice.C, 'Random Access Memory'],
[AnswerChoice.D, 'Random Audit Memory'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}

private static makeQuestion1(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
0,
'what does "git branch -m" do?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'change name of branch'],
[AnswerChoice.B, 'push fork'],
[AnswerChoice.C, 'delete branch'],
[AnswerChoice.D, 'save branch'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}

private static makeQuestion2(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
0,
'Which is not an IDE?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'VS Code'],
[AnswerChoice.B, 'Ah Git Push It'],
[AnswerChoice.C, 'JetBrains'],
[AnswerChoice.D, 'Netbeans'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}
}
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 { DennisQuiz } from './dennis_quiz.js';

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

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

@Module({
providers: [
Expand Down