|
| 1 | +import { |
| 2 | + AnswerChoice, |
| 3 | + MultipleChoiceQuizQuestion, |
| 4 | + QuizQuestion, |
| 5 | + QuizQuestionProvider, |
| 6 | +} from 'codedifferently-instructional'; |
| 7 | + |
| 8 | +export class AnthonyMaysQuiz implements QuizQuestionProvider { |
| 9 | + getProviderName(): string { |
| 10 | + return 'anthonymays'; |
| 11 | + } |
| 12 | + |
| 13 | + makeQuizQuestions(): QuizQuestion[] { |
| 14 | + return [AnthonyMaysQuiz.makeQuestion0(), AnthonyMaysQuiz.makeQuestion1()]; |
| 15 | + } |
| 16 | + |
| 17 | + private static makeQuestion0(): QuizQuestion { |
| 18 | + return new MultipleChoiceQuizQuestion( |
| 19 | + 0, |
| 20 | + 'What is a multiple choice question?', |
| 21 | + new Map<AnswerChoice, string>([ |
| 22 | + [AnswerChoice.A, 'A question about agency'], |
| 23 | + [AnswerChoice.B, 'The hardest kind of quiz question there is'], |
| 24 | + [ |
| 25 | + AnswerChoice.C, |
| 26 | + 'A question that can be answered using one or more provided choices', |
| 27 | + ], |
| 28 | + [AnswerChoice.D, 'Whatever you want it to be!'], |
| 29 | + ]), |
| 30 | + AnswerChoice.UNANSWERED, |
| 31 | + ); // Replace `UNANSWERED` with the correct answer. |
| 32 | + } |
| 33 | + |
| 34 | + private static makeQuestion1(): QuizQuestion { |
| 35 | + return new QuizQuestion( |
| 36 | + 1, |
| 37 | + 'What is a computer?', |
| 38 | + 'A machine that automatically transforms input into output.', |
| 39 | + ); // Provide an answer. |
| 40 | + } |
| 41 | +} |
0 commit comments