33 */
44package org .example ;
55
6+ import java .util .ArrayList ;
67import java .util .HashMap ;
8+ import java .util .List ;
79import java .util .Map ;
810
911import com .codedifferently .instructional .quiz .AnswerChoice ;
@@ -13,150 +15,157 @@ public class Lesson {
1315
1416 public static void main (String [] args ) {
1517 MultipleChoiceQuizQuestion [] questions = makeQuestions ();
16- for (MultipleChoiceQuizQuestion q : questions ) {
18+ for (MultipleChoiceQuizQuestion q : questions ) {
1719 System .out .println (q );
1820 }
1921 }
2022
21- public static MultipleChoiceQuizQuestion [] makeQuestions () {
22- MultipleChoiceQuizQuestion [] questions = new MultipleChoiceQuizQuestion [11 ];
23- questions [0 ] = makeQuestion0 ();
24- questions [1 ] = makeQuestion1 ();
25- questions [2 ] = makeQuestion2 ();
26- questions [3 ] = makeQuestion3 ();
27- questions [4 ] = makeQuestion4 ();
28- questions [5 ] = makeQuestion5 ();
29- questions [6 ] = makeQuestion6 ();
30- questions [7 ] = makeQuestion7 ();
31- questions [8 ] = makeQuestion8 ();
32- questions [9 ] = makeQuestion9 ();
33- questions [10 ] = makeQuestion10 ();
23+ public static List <MultipleChoiceQuizQuestion > makeQuestions () {
24+
25+ List <MultipleChoiceQuizQuestion > questions = new ArrayList <>();
26+
27+ questions .add (makeQuestion0 ());
28+ questions .add (makeQuestion1 ());
29+ questions .add (makeQuestion2 ());
30+ questions .add (makeQuestion3 ());
31+ questions .add (makeQuestion4 ());
32+ questions .add (makeQuestion5 ());
33+ questions .add (makeQuestion6 ());
34+ questions .add (makeQuestion7 ());
35+ questions .add (makeQuestion8 ());
36+ questions .add (makeQuestion9 ());
37+ questions .add (makeQuestion10 ());
3438
3539 return questions ;
40+
3641 }
42+
3743
44+
3845 public static MultipleChoiceQuizQuestion makeQuestion0 () {
46+
3947 Map <AnswerChoice , String > answerChoices = new HashMap <>();
4048 answerChoices .put (AnswerChoice .A , "To make backups of files" );
4149 answerChoices .put (AnswerChoice .B , "To keep a record of changes over time" );
4250 answerChoices .put (AnswerChoice .C , " To delete unnecessary files" );
4351 answerChoices .put (AnswerChoice .D , "To run code more efficiently" );
4452
4553 return new MultipleChoiceQuizQuestion (
46- 0 , "What is the main purpose of version control?" , answerChoices , AnswerChoice .B );
54+ 0 ,"What is the main purpose of version control?" ,answerChoices ,AnswerChoice .B );
4755 }
4856
4957 public static MultipleChoiceQuizQuestion makeQuestion1 () {
50- Map <AnswerChoice , String > answerChoices = new HashMap <>();
58+
59+ Map <AnswerChoice , String > answerChoices = new HashMap <>();
5160 answerChoices .put (AnswerChoice .A , "A duplicate copy of a repository that you own and modify" );
5261 answerChoices .put (AnswerChoice .B , "A temporary backup of the code" );
5362 answerChoices .put (AnswerChoice .C , "A tool for merging branches" );
5463 answerChoices .put (AnswerChoice .D , "What is a fork in Git?" );
5564
5665 return new MultipleChoiceQuizQuestion (
57- 1 , "What is a fork in Git ?" , answerChoices , AnswerChoice .A );
58- }
66+ 1 ,"What is the main purpose of version control ?" ,answerChoices ,AnswerChoice .B );
67+ }
5968
6069 public static MultipleChoiceQuizQuestion makeQuestion2 () {
70+
6171 Map <AnswerChoice , String > answerChoices = new HashMap <>();
6272 answerChoices .put (AnswerChoice .A , "Pull the latest changes" );
6373 answerChoices .put (AnswerChoice .B , "Commit changes locally" );
6474 answerChoices .put (AnswerChoice .C , "Push changes to the server" );
6575 answerChoices .put (AnswerChoice .D , "Write code directly in GitHub" );
6676
6777 return new MultipleChoiceQuizQuestion (
68- 2 , "Which of the following is NOT part of the basic Git workflow?" , answerChoices , AnswerChoice .D );
78+ 2 ,"Which of the following is NOT part of the basic Git workflow?" ,answerChoices ,AnswerChoice .D );
6979 }
70-
7180 public static MultipleChoiceQuizQuestion makeQuestion3 () {
81+
7282 Map <AnswerChoice , String > answerChoices = new HashMap <>();
7383 answerChoices .put (AnswerChoice .A , "git commit" );
7484 answerChoices .put (AnswerChoice .B , "git merge" );
7585 answerChoices .put (AnswerChoice .C , "git branch" );
7686 answerChoices .put (AnswerChoice .D , "git pull" );
7787
7888 return new MultipleChoiceQuizQuestion (
79- 3 , "What command is used to combine changes from different branches?" , answerChoices , AnswerChoice .B );
89+ 3 ,"What command is used to combine changes from different branches?" ,answerChoices ,AnswerChoice .B );
8090 }
8191
8292 public static MultipleChoiceQuizQuestion makeQuestion4 () {
93+
8394 Map <AnswerChoice , String > answerChoices = new HashMap <>();
8495 answerChoices .put (AnswerChoice .A , "Eclipse" );
8596 answerChoices .put (AnswerChoice .B , "IntelliJ IDEA" );
8697 answerChoices .put (AnswerChoice .C , "NetBeans" );
8798 answerChoices .put (AnswerChoice .D , "VS Code" );
8899
89100 return new MultipleChoiceQuizQuestion (
90- 4 , "Which IDE is being used in the class?" , answerChoices , AnswerChoice .D );
101+ 4 ,"Which IDE is being used in the class?" ,answerChoices ,AnswerChoice .D );
91102 }
92103
93104 public static MultipleChoiceQuizQuestion makeQuestion5 () {
105+
94106 Map <AnswerChoice , String > answerChoices = new HashMap <>();
95107 answerChoices .put (AnswerChoice .A , "Extensions" );
96108 answerChoices .put (AnswerChoice .B , "Debugger" );
97109 answerChoices .put (AnswerChoice .C , "Dev Containers" );
98110 answerChoices .put (AnswerChoice .D , "Source Control" );
99111
100112 return new MultipleChoiceQuizQuestion (
101- 5 , "What feature allows developers to work from the same pre-configured environment in VS Code?" , answerChoices , AnswerChoice .C );
113+ 5 ,"What feature allows developers to work from the same pre-configured environment in VS Code?" ,answerChoices ,AnswerChoice .C );
102114 }
103-
104- public static MultipleChoiceQuizQuestion makeQuestion6 () {
115+ public static MultipleChoiceQuizQuestion makeQuestion6 () {
105116 Map <AnswerChoice , String > answerChoices = new HashMap <>();
106- answerChoices .put (AnswerChoice .A , "Editing and refactoring code" );
107- answerChoices .put (AnswerChoice .B , "Browsing code" );
108- answerChoices .put (AnswerChoice .C , "Playing music" );
109- answerChoices .put (AnswerChoice .D , "Managing source control" );
117+ answerChoices .put (AnswerChoice .A , "Editing and refactoring code" );
118+ answerChoices .put (AnswerChoice .B , "Browsing code" );
119+ answerChoices .put (AnswerChoice .C , "Playing music" );
120+ answerChoices .put (AnswerChoice .D , "Managing source control" );
121+
110122
111123 return new MultipleChoiceQuizQuestion (
112- 6 , "What is NOT a reason for using an IDE?" , answerChoices , AnswerChoice .C );
124+ 6 ,"What is NOT a reason for using an IDE?" ,answerChoices ,AnswerChoice .C );
113125 }
114-
115126 public static MultipleChoiceQuizQuestion makeQuestion7 () {
116127 Map <AnswerChoice , String > answerChoices = new HashMap <>();
117- answerChoices .put (AnswerChoice .A , "pwd" );
118- answerChoices .put (AnswerChoice .B , "ls" );
119- answerChoices .put (AnswerChoice .C , "cd" );
120- answerChoices .put (AnswerChoice .D , "mkdir" );
128+ answerChoices .put (AnswerChoice .A , "pwd" );
129+ answerChoices .put (AnswerChoice .B , "ls" );
130+ answerChoices .put (AnswerChoice .C , "cd" );
131+ answerChoices .put (AnswerChoice .D , "mkdir" );
121132
122133 return new MultipleChoiceQuizQuestion (
123- 7 , "Which command is used to print the current working directory in the terminal?" , answerChoices , AnswerChoice .A );
134+ 7 ,"Which command is used to print the current working directory in the terminal?" ,answerChoices ,AnswerChoice .A );
124135 }
125-
126- public static MultipleChoiceQuizQuestion makeQuestion8 () {
136+ public static MultipleChoiceQuizQuestion makeQuestion8 () {
127137 Map <AnswerChoice , String > answerChoices = new HashMap <>();
128- answerChoices .put (AnswerChoice .A , "pwd" );
129- answerChoices .put (AnswerChoice .B , "ls" );
130- answerChoices .put (AnswerChoice .C , "cd" );
131- answerChoices .put (AnswerChoice .D , "mkdir" );
138+ answerChoices .put (AnswerChoice .A , "pwd" );
139+ answerChoices .put (AnswerChoice .B , "ls" );
140+ answerChoices .put (AnswerChoice .C , "cd" );
141+ answerChoices .put (AnswerChoice .D , "mkdir" );
132142
133143 return new MultipleChoiceQuizQuestion (
134- 8 , "Which command is used to change directories in the terminal?" , answerChoices , AnswerChoice .C );
144+ 8 ,"Which command is used to change directories in the terminal?" ,answerChoices ,AnswerChoice .C );
135145 }
136-
137- public static MultipleChoiceQuizQuestion makeQuestion9 () {
146+ public static MultipleChoiceQuizQuestion makeQuestion9 () {
138147
139148 Map <AnswerChoice , String > answerChoices = new HashMap <>();
140- answerChoices .put (AnswerChoice .A , "Change file or directory permissions" );
141- answerChoices .put (AnswerChoice .B , "List files in a directory" );
142- answerChoices .put (AnswerChoice .C , "Remove a file or directory" );
143- answerChoices .put (AnswerChoice .D , "Copy a file or directory" );
149+ answerChoices .put (AnswerChoice .A , "Change file or directory permissions" );
150+ answerChoices .put (AnswerChoice .B , "List files in a directory" );
151+ answerChoices .put (AnswerChoice .C , "Remove a file or directory" );
152+ answerChoices .put (AnswerChoice .D , "Copy a file or directory" );
144153
145- return new MultipleChoiceQuizQuestion (
146- 9 , "What does the command `chmod` do?" , answerChoices , AnswerChoice .A );
154+ return new MultipleChoiceQuizQuestion (
155+ 9 ,"What does the command `chmod` do?" ,answerChoices ,AnswerChoice .A );
147156
148157 }
149-
150- public static MultipleChoiceQuizQuestion makeQuestion10 () {
158+ public static MultipleChoiceQuizQuestion makeQuestion10 () {
151159 Map <AnswerChoice , String > answerChoices = new HashMap <>();
152- answerChoices .put (AnswerChoice .A , "⌘ + Shift + T" );
153- answerChoices .put (AnswerChoice .B , "⌘ + Spacebar, then type terminal" );
154- answerChoices .put (AnswerChoice .C , "⌘ + Q" );
155- answerChoices .put (AnswerChoice .D , "⌘ + S, then type terminal" );
160+ answerChoices .put (AnswerChoice .A , "⌘ + Shift + T" );
161+ answerChoices .put (AnswerChoice .B , "⌘ + Spacebar, then type terminal" );
162+ answerChoices .put (AnswerChoice .C , "⌘ + Q" );
163+ answerChoices .put (AnswerChoice .D , "⌘ + S, then type terminal" );
156164
157- return new MultipleChoiceQuizQuestion (
158- 10 , "What is the shortcut for getting to the Mac terminal?" , answerChoices , AnswerChoice .B );
165+
166+ return new MultipleChoiceQuizQuestion (
167+ 10 ,"What is the shortcut for getting to the Mac terminal?" ,answerChoices ,AnswerChoice .B );
159168
160169 }
161170
162- }
171+ }
0 commit comments