1+ import {
2+ AnswerChoice ,
3+ MultipleChoiceQuizQuestion ,
4+ QuizQuestion ,
5+ QuizQuestionProvider ,
6+ } from 'codedifferently-instructional' ;
7+
8+
9+ export class JoyBrownQuiz implements QuizQuestionProvider {
10+ getProviderName ( ) : string {
11+ return 'joybrown' ;
12+ }
13+
14+ makeQuizQuestions ( ) : QuizQuestion [ ] {
15+ return [
16+ JoyBrownQuiz . makeQuestion0 ( ) ,
17+ JoyBrownQuiz . makeQuestion1 ( ) ,
18+ JoyBrownQuiz . makeQuestion2 ( ) ,
19+ ] ;
20+ }
21+
22+ private static makeQuestion0 ( ) : QuizQuestion {
23+ return new MultipleChoiceQuizQuestion (
24+ 0 ,
25+ 'What is a pull?' ,
26+ new Map < AnswerChoice , string > ( [
27+ [ AnswerChoice . A , 'A download.' ] ,
28+ [ AnswerChoice . B , 'A upload.' ] ,
29+ [
30+ AnswerChoice . C ,
31+ 'Saving a file.' ,
32+ ] ,
33+ [ AnswerChoice . D , 'A request to merge your changes into another branch.' ] ,
34+ ] ) ,
35+ AnswerChoice . UNANSWERED ,
36+ ) ; // Replace `UNANSWERED` with the correct answer.
37+ }
38+
39+ private static makeQuestion1 ( ) : QuizQuestion {
40+ return new QuizQuestion (
41+ 1 ,
42+ 'Git is an online cloud for coding, Yes or No' ,
43+ 'No' ,
44+ ) ; // Provide an answer.
45+ }
46+
47+ private static makeQuestion2 ( ) : QuizQuestion {
48+ return new MultipleChoiceQuizQuestion (
49+ 2 ,
50+ 'Which command makes a new directory' ,
51+ new Map < AnswerChoice , string > ( [
52+ [ AnswerChoice . A , 'mkdir' ] ,
53+ [ AnswerChoice . B , 'cp' ] ,
54+ [
55+ AnswerChoice . C ,
56+ 'rm' ,
57+ ] ,
58+ [ AnswerChoice . D , 'mv' ] ,
59+ ] ) ,
60+ AnswerChoice . UNANSWERED ,
61+ ) ; // Replace `UNANSWERED` with the correct answer.
62+ }
63+ }
0 commit comments