|
| 1 | +import { |
| 2 | + AnswerChoice, |
| 3 | + MultipleChoiceQuizQuestion, |
| 4 | + QuizQuestion, |
| 5 | + QuizQuestionProvider, |
| 6 | +} from 'codedifferently-instructional'; |
| 7 | + |
| 8 | +export class XavierCruzQuiz implements QuizQuestionProvider { |
| 9 | + getProviderName(): string { |
| 10 | + return 'xaviercruz'; |
| 11 | + } |
| 12 | + |
| 13 | + makeQuizQuestions(): QuizQuestion[] { |
| 14 | + return [ |
| 15 | + XavierCruzQuiz.makeQuestion0(), |
| 16 | + XavierCruzQuiz.makeQuestion1(), |
| 17 | + XavierCruzQuiz.makeQuestion2(), |
| 18 | + XavierCruzQuiz.makeQuestion3(), |
| 19 | + ]; |
| 20 | + } |
| 21 | + |
| 22 | + private static makeQuestion0(): QuizQuestion { |
| 23 | + return new MultipleChoiceQuizQuestion( |
| 24 | + 0, |
| 25 | + 'What programming language supports the "struct" data type?', |
| 26 | + new Map<AnswerChoice, string>([ |
| 27 | + [AnswerChoice.A, 'C'], |
| 28 | + [AnswerChoice.B, 'PHP'], |
| 29 | + [AnswerChoice.C, 'JSP'], |
| 30 | + [AnswerChoice.D, 'HTML'], |
| 31 | + ]), |
| 32 | + AnswerChoice.UNANSWERED, |
| 33 | + ); // Replace `UNANSWERED` with the correct answer. |
| 34 | + } |
| 35 | + |
| 36 | + private static makeQuestion1(): QuizQuestion { |
| 37 | + return new MultipleChoiceQuizQuestion( |
| 38 | + 1, |
| 39 | + 'What is another name for an app?', |
| 40 | + new Map<AnswerChoice, string>([ |
| 41 | + [AnswerChoice.A, 'Program'], |
| 42 | + [AnswerChoice.B, 'Field'], |
| 43 | + [AnswerChoice.C, 'Record'], |
| 44 | + [AnswerChoice.D, 'Library'], |
| 45 | + ]), |
| 46 | + AnswerChoice.UNANSWERED, |
| 47 | + ); // Provide an answer. |
| 48 | + } |
| 49 | + |
| 50 | + private static makeQuestion2(): QuizQuestion { |
| 51 | + return new MultipleChoiceQuizQuestion( |
| 52 | + 2, |
| 53 | + 'A virtual machine is an example of what?', |
| 54 | + new Map<AnswerChoice, string>([ |
| 55 | + [AnswerChoice.A, 'Presentation'], |
| 56 | + [AnswerChoice.B, 'Fabrication'], |
| 57 | + [AnswerChoice.C, 'Deprecation'], |
| 58 | + [AnswerChoice.D, 'Emulation'], |
| 59 | + ]), |
| 60 | + AnswerChoice.UNANSWERED, |
| 61 | + ); // Provide an answer. |
| 62 | + } |
| 63 | + private static makeQuestion3(): QuizQuestion { |
| 64 | + return new MultipleChoiceQuizQuestion( |
| 65 | + 3, |
| 66 | + 'What data type closely resembles a queue?', |
| 67 | + new Map<AnswerChoice, string>([ |
| 68 | + [AnswerChoice.A, 'String'], |
| 69 | + [AnswerChoice.B, 'Character'], |
| 70 | + [AnswerChoice.C, 'Integer'], |
| 71 | + [AnswerChoice.D, 'Array'], |
| 72 | + ]), |
| 73 | + AnswerChoice.UNANSWERED, |
| 74 | + ); // Provide an answer. |
| 75 | + } |
| 76 | +} |
0 commit comments