|
| 1 | +import { |
| 2 | + AnswerChoice, |
| 3 | + MultipleChoiceQuizQuestion, |
| 4 | + QuizQuestion, |
| 5 | + QuizQuestionProvider, |
| 6 | +} from 'codedifferently-instructional'; |
| 7 | + |
| 8 | +export class BenjaminScottQuiz implements QuizQuestionProvider { |
| 9 | + getProviderName(): string { |
| 10 | + return 'benjaminscott'; |
| 11 | + } |
| 12 | + |
| 13 | + makeQuizQuestions(): QuizQuestion[] { |
| 14 | + return [ |
| 15 | + BenjaminScottQuiz.makeQuestion0(), |
| 16 | + BenjaminScottQuiz.makeQuestion1(), |
| 17 | + BenjaminScottQuiz.makeQuestion2(), |
| 18 | + ]; |
| 19 | + } |
| 20 | + |
| 21 | + private static makeQuestion0(): QuizQuestion { |
| 22 | + return new MultipleChoiceQuizQuestion( |
| 23 | + 0, |
| 24 | + 'What is the command for making a new file?', |
| 25 | + new Map<AnswerChoice, string>([ |
| 26 | + [AnswerChoice.A, 'feel'], |
| 27 | + [AnswerChoice.B, 'grab'], |
| 28 | + [AnswerChoice.C, 'touch'], |
| 29 | + [AnswerChoice.D, 'poke'], |
| 30 | + ]), |
| 31 | + AnswerChoice.UNANSWERED, |
| 32 | + ); // Replace `UNANSWERED` with the correct answer. |
| 33 | + } |
| 34 | + |
| 35 | + private static makeQuestion1(): QuizQuestion { |
| 36 | + return new QuizQuestion( |
| 37 | + 1, |
| 38 | + 'What does "CPU" stand for?', |
| 39 | + 'Central Processing Unit', |
| 40 | + ); // Provide an answer. |
| 41 | + } |
| 42 | + |
| 43 | + private static makeQuestion2(): QuizQuestion { |
| 44 | + return new MultipleChoiceQuizQuestion( |
| 45 | + 2, |
| 46 | + 'What special operator chains commands together?', |
| 47 | + new Map<AnswerChoice, string>([ |
| 48 | + [AnswerChoice.A, '&&'], |
| 49 | + [AnswerChoice.B, '--'], |
| 50 | + [AnswerChoice.C, '%$#'], |
| 51 | + [AnswerChoice.D, '**'], |
| 52 | + ]), |
| 53 | + AnswerChoice.UNANSWERED, |
| 54 | + ); // Replace `UNANSWERED` with the correct answer. |
| 55 | + } |
| 56 | +} |
0 commit comments