Skip to content
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
37 changes: 36 additions & 1 deletion lesson_03/quiz/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lesson_03/quiz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"dependencies": {
"@nestjs/common": "^10.4.15",
"@nestjs/core": "^10.4.15",
"bcrypt": "^6.0.0",
"codedifferently-instructional": "file:../../lib/javascript/codedifferently-instructional",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1"
Expand Down
5 changes: 4 additions & 1 deletion lesson_03/quiz/quiz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ quiz:
anotherone:
- $2y$10$8eHSzy3aCu4Ry3LzO9nWCeGpofSxsNVbnF.wCfn3ZADwQ6MEtN/KK
- $2y$10$dGB0CGv7.XQC5OqfyY6iXOiJsdVyxU3ve5YE0gt4m2I8P8H13lNXa

jaizel_quiz:
- $2y$10$l0gz8cPuUAV/fPCz1eZPLuceO/ea4VzwVY2e4VkjWjkjMh785XOaa
- $2y$10$ESuiNYZk3LoPpwXWWI9HuOAW1UkMXvihaXb1FbOgMyUzmxD1EmcUe
- $2y$10$pwNF2IjXoEXS7VnuiQI23O3/i4AmT7e5KUYTrtm3ewJdb.vFpNxTy
62 changes: 62 additions & 0 deletions lesson_03/quiz/src/quizzes/jaizel_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 JaizelQuiz implements QuizQuestionProvider {
getProviderName(): string {
return 'jaizel_quiz';
}

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

private static makeQuestion0(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
0,
'What is TypeScript?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'A superset of JavaScript that adds static typing'],
[AnswerChoice.B, 'A completely different language from JavaScript'],
[AnswerChoice.C, 'A JavaScript runtime environment'],
[AnswerChoice.D, 'A JavaScript framework like React or Angular'],
]),
AnswerChoice.UNANSWERED,
);
}

private static makeQuestion1(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
1,
'Which of the following is NOT a valid way to declare a variable in JavaScript?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'var x = 10;'],
[AnswerChoice.B, 'let x = 10;'],
[AnswerChoice.C, 'const x = 10;'],
[AnswerChoice.D, 'static x = 10;'],
]),
AnswerChoice.UNANSWERED,
);
}

private static makeQuestion2(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
2,
'What is an Interface in TypeScript?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'A way to define a contract for object structure'],
[AnswerChoice.B, 'A tool for bundling TypeScript code'],
[AnswerChoice.C, 'A special type of JavaScript class'],
[AnswerChoice.D, 'A method for importing external modules'],
]),
AnswerChoice.UNANSWERED,
);
}
}
7 changes: 2 additions & 5 deletions lesson_03/quiz/src/quizzes/quizzes.module.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { Module } from '@nestjs/common';
import { AnotherQuiz } from './another_quiz.js';
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
import { JaizelQuiz } from './jaizel_quiz.js';
export const Quizzes = Symbol.for('Quizzes');

// Add your quiz provider here.

const QUIZ_PROVIDERS = [
AnthonyMaysQuiz,
AnotherQuiz,

];
const QUIZ_PROVIDERS = [AnthonyMaysQuiz, AnotherQuiz, JaizelQuiz];

@Module({
providers: [
Expand Down
46 changes: 46 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"bcrypt": "^6.0.0"
}
}