|
| 1 | +import { |
| 2 | + AnswerChoice, |
| 3 | + MultipleChoiceQuizQuestion, |
| 4 | + QuizQuestion, |
| 5 | + QuizQuestionProvider, |
| 6 | +} from 'codedifferently-instructional'; |
| 7 | + |
| 8 | +export class YafiahAbdullahQuiz implements QuizQuestionProvider { |
| 9 | + getProviderName(): string { |
| 10 | + return 'yafiahAbdullah'; |
| 11 | + } |
| 12 | + |
| 13 | + makeQuizQuestions(): QuizQuestion[] { |
| 14 | + return [YafiahAbdullahQuiz.makeQuestion0(), YafiahAbdullahQuiz.makeQuestion1(),YafiahAbdullahQuiz.makeQuestion2()]; |
| 15 | + } |
| 16 | + |
| 17 | + private static makeQuestion0(): QuizQuestion { |
| 18 | + return new MultipleChoiceQuizQuestion( |
| 19 | + 0, |
| 20 | + 'What is a CPU?', |
| 21 | + new Map<AnswerChoice, string>([ |
| 22 | + [AnswerChoice.A, 'Central Processing Unit'], |
| 23 | + [AnswerChoice.B, 'Computer Performance Unit'], |
| 24 | + [ |
| 25 | + AnswerChoice.C, |
| 26 | + 'Core Processing Unit', |
| 27 | + ], |
| 28 | + [AnswerChoice.D, 'Central Program Unit'], |
| 29 | + ]), |
| 30 | + AnswerChoice.UNANSWERED, |
| 31 | + ); // Replace `UNANSWERED` with the correct answer. |
| 32 | + } |
| 33 | + |
| 34 | + private static makeQuestion1(): QuizQuestion { |
| 35 | + return new MultipleChoiceQuizQuestion( |
| 36 | + 1, |
| 37 | + 'Which of the following best describes the main function of a CPU?', |
| 38 | + new Map<AnswerChoice, string>([ |
| 39 | + [AnswerChoice.A, 'To store data'], |
| 40 | + [AnswerChoice.B, 'To execute instructions and process data'], |
| 41 | + [ |
| 42 | + AnswerChoice.C, |
| 43 | + 'To manage peripheral devices', |
| 44 | + ], |
| 45 | + [AnswerChoice.D, 'To connect to the internet'], |
| 46 | + ]), |
| 47 | + AnswerChoice.UNANSWERED, |
| 48 | + ); // Replace `UNANSWERED` with the correct answer. |
| 49 | + } |
| 50 | + |
| 51 | + private static makeQuestion2(): QuizQuestion { |
| 52 | + return new MultipleChoiceQuizQuestion( |
| 53 | + 2, |
| 54 | + 'What is the unit of measurement commonly used to describe CPU speed?', |
| 55 | + new Map<AnswerChoice, string>([ |
| 56 | + [AnswerChoice.A, 'Megabytes (MB)'], |
| 57 | + [AnswerChoice.B, 'Gigahertz (GHz)'], |
| 58 | + [ |
| 59 | + AnswerChoice.C, |
| 60 | + 'Kilobytes (KB)', |
| 61 | + ], |
| 62 | + [AnswerChoice.D, 'Terabits (Tb)'], |
| 63 | + ]), |
| 64 | + AnswerChoice.UNANSWERED, |
| 65 | + ); // Replace `UNANSWERED` with the correct answer. |
| 66 | + } |
| 67 | +} |
0 commit comments