Skip to content

Feat : Lesson-03 added yafiah_abdullah_quiz.ts #97

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 1 commit into from
Sep 30, 2024
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
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
yafiahAbdullah:
- $2y$10$XcsVuO66KZiUiN75NtssdOkKvHKhuBo91JgE/TJEnSrrzbhjxuql.
- $2y$10$9fZs867NHxoPQ/VWMeLyj.us5Kg3SLPcbt9O5ki/FdJ37TbhgFMFC
- $2y$10$GfjcKvtzr6n8553Mdr1RJOOYDfzOudlW.3i8otsH0HiW52CU7tUAW
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,11 +1,13 @@
import { Module } from '@nestjs/common';
import { AnotherQuiz } from './another_quiz.js';
import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
import { YafiahAbdullahQuiz } from './yafiah_abdullah_quiz.js';


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

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

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

export class YafiahAbdullahQuiz implements QuizQuestionProvider {
getProviderName(): string {
return 'yafiahAbdullah';
}

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

private static makeQuestion0(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
0,
'What is a CPU?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'Central Processing Unit'],
[AnswerChoice.B, 'Computer Performance Unit'],
[
AnswerChoice.C,
'Core Processing Unit',
],
[AnswerChoice.D, 'Central Program Unit'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}

private static makeQuestion1(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
1,
'Which of the following best describes the main function of a CPU?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'To store data'],
[AnswerChoice.B, 'To execute instructions and process data'],
[
AnswerChoice.C,
'To manage peripheral devices',
],
[AnswerChoice.D, 'To connect to the internet'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}

private static makeQuestion2(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
2,
'What is the unit of measurement commonly used to describe CPU speed?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'Megabytes (MB)'],
[AnswerChoice.B, 'Gigahertz (GHz)'],
[
AnswerChoice.C,
'Kilobytes (KB)',
],
[AnswerChoice.D, 'Terabits (Tb)'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}
}