· 6 years ago · Oct 31, 2019, 07:10 AM
1//Save Point Pseudo Code
2
3Initialize newQavailable as zero //flag that enables student to take the current quiz to prevent unwanted retakes
4Initialize mathScore, englScore, scieScore, flmathQnos, flenglQnos. flscieQnos as zero
5Initialize readHead as zero
6
7Show Choices1 "Save", "Teacher Panel", "Student Table", & "Cancel"
8If Choice1 is "Save" Then
9 Open Saving Screen
10If Choice1 is "Teacher Panel"
11 Show Choices2 "Create Quiz", "Imported Quiz Available", "View Score", & "Cancel"
12 If Choice2 is "Create Quiz"
13 Delete quizfile.txt if it exists
14 Set mathQctr as one //math question counter
15 Set englQctr as one //english question counter
16 Set scieQctr as one //science question counter
17 Print "How many Math Questions?"
18 Set mathQnos as 3 Digit User Input //Total number of math questions
19 Print "How many English Questions?"
20 Set englQnos as 3 Digit User Input //Total number of english questions
21 Print "How many Science Questions?"
22 Set scieQnos as 3 Digit User Input //Total number of science questions
23 Proces Math Questions:
24 If mathQnos is greater than zero
25 Print "How many Math Questions are Multiple Choices? Remainder will al be Identification Type."
26 Set mathMCnos as 3 Digit User Input
27 If mathMCnos is greater than mathQnos
28 Print "Calculation Error! Can't exceed total number of questions."
29 Call Process Math Questions
30 If mathMCnos is less than or equal to mathQnos
31 Set mathIDnos as mathQnos less mathMCnos
32 If mathMCnos is greater than zero
33 While mathMCnos is not equal to zero
34 Print "Input Math Multiple Choice Questions #" + mathQctr
35 Set qHolder as 55 Characters User Input
36 Print "The question is " + qHolder
37 Print "Type in the correct answer."
38 Set cAnswer as 32 Characters User Input
39 Print "Type in the wrong choices(3)."
40 Set iAnswer1 as 32 Characters User Input
41 Print "Type in the wrong choices(2)."
42 Set iAnswer2 as 32 Characters User Input
43 Print "Type in the wrong choices(1)."
44 Set iAnswer3 as 32 Characters User Input
45 Generate file quizfile.txt if not already existing
46 Append "MATH\nMC\n" + qHolder + "\n" + cAnswer + "\n" + iAnswer1 + "\n" + iAnswer2 + "\n" + iAnswer3 + "\n" to quizfile.txt
47 Set newQavailable as one //Flag enabling the quiz to be taken by student.
48 Increment mathQctr
49 Decrement mathMCnos
50 Set mathQctr as one
51 If mathIDnos is greater than zero
52 While mathIDnos is not equal to zero
53 Print "Input Math Identification Type Question #" + mathQctr
54 Set qHolder as 55 Characters User Input
55 Print "The questions is " + qHolder
56 Print "Input the correct answer."
57 Set cAnswer as lowercase 32 Characters User Input
58 Generate file quizfile.txt if not already existing
59 Append "MATH\nID\n" + qHolder + "\n" + cAnswer + "\n" to quizfile.txt
60 Set newQavailable as one //Flag enabling the quiz to be taken by student.
61 Increment mathQctr
62 Decrement mathIDnos
63 Proces English Questions:
64 If englQnos is greater than zero
65 Print "How many English Questions are Multiple Choices? Remainder will al be Identification Type."
66 Set englMCnos as 3 Digit User Input
67 If englMCnos is greater than englQnos
68 Print "Calculation Error! Can't exceed total number of questions."
69 Call Process English Questions
70 If englMCnos is less than or equal to englQnos
71 Set englIDnos as englQnos less englMCnos
72 If englMCnos is greater than zero
73 While englMCnos is not equal to zero
74 Print "Input English Multiple Choice Questions #" + englQctr
75 Set qHolder as 55 Characters User Input
76 Print "The question is " + qHolder
77 Print "Type in the correct answer."
78 Set cAnswer as 32 Characters User Input
79 Print "Type in the wrong choices(3)."
80 Set iAnswer1 as 32 Characters User Input
81 Print "Type in the wrong choices(2)."
82 Set iAnswer2 as 32 Characters User Input
83 Print "Type in the wrong choices(1)."
84 Set iAnswer3 as 32 Characters User Input
85 Generate file quizfile.txt if not already existing
86 Append "ENGL\nMC\n" + qHolder + "\n" + cAnswer + "\n" + iAnswer1 + "\n" + iAnswer2 + "\n" + iAnswer3 + "\n" to quizfile.txt
87 Set newQavailable as one //Flag enabling the quiz to be taken by student.
88 Increment englQctr
89 Decrement englMCnos
90 Set englQctr as one
91 If englIDnos is greater than zero
92 While englIDnos is not equal to zero
93 Print "Input English Identification Type Question #" + englQctr
94 Set qHolder as 55 Characters User Input
95 Print "The questions is " + qHolder
96 Print "Input the correct answer."
97 Set cAnswer as lowercase 32 Characters User Input
98 Generate file quizfile.txt if not already existing
99 Append "ENGL\nID\n" + qHolder + "\n" + cAnswer + "\n" to quizfile.txt
100 Set newQavailable as one //Flag enabling the quiz to be taken by student.
101 Increment englQctr
102 Decrement englIDnos
103 Proces Science Questions:
104 If scieQnos is greater than zero
105 Print "How many Science Questions are Multiple Choices? Remainder will al be Identification Type."
106 Set scieMCnos as 3 Digit User Input
107 If scieMCnos is greater than scieQnos
108 Print "Calculation Error! Can't exceed total number of questions."
109 Call Process Science Questions
110 If scieMCnos is less than or equal to scieQnos
111 Set scieIDnos as scieQnos less scieMCnos
112 If scieMCnos is greater than zero
113 While scieMCnos is not equal to zero
114 Print "Input Science Multiple Choice Questions #" + scieQctr
115 Set qHolder as 55 Characters User Input
116 Print "The question is " + qHolder
117 Print "Type in the correct answer."
118 Set cAnswer as 32 Characters User Input
119 Print "Type in the wrong choices(3)."
120 Set iAnswer1 as 32 Characters User Input
121 Print "Type in the wrong choices(2)."
122 Set iAnswer2 as 32 Characters User Input
123 Print "Type in the wrong choices(1)."
124 Set iAnswer3 as 32 Characters User Input
125 Generate file quizfile.txt if not already existing
126 Append "SCIE\nMC\n" + qHolder + "\n" + cAnswer + "\n" + iAnswer1 + "\n" + iAnswer2 + "\n" + iAnswer3 + "\n" to quizfile.txt
127 Set newQavailable as one //Flag enabling the quiz to be taken by student.
128 Increment scieQctr
129 Decrement scieMCnos
130 Set scieQctr as one
131 If scieIDnos is greater than zero
132 While scieIDnos is not equal to zero
133 Print "Input Science Identification Type Question #" + scieQctr
134 Set qHolder as 55 Characters User Input
135 Print "The questions is " + qHolder
136 Print "Input the correct answer."
137 Set cAnswer as lowercase 32 Characters User Input
138 Generate file quizfile.txt if not already existing
139 Append "SCIE\nID\n" + qHolder + "\n" + cAnswer + "\n" to quizfile.txt
140 Set newQavailable as one //Flag enabling the quiz to be taken by student.
141 Increment scieQctr
142 Decrement scieIDnos
143 If Choice2 is "Imported Quiz Available"
144 Set newQavailable as one //allows the student to retake the quiz or take the current saved quiz in quizfile.txt
145 If Choice2 is "View Score"
146 Print "SCORES:\nMATH:\t\t" + mathScore + " out of " + flmathQnos + "\nENGLISH:\t\t" + englScore + " out of " + flenglQnos + "\nSCIENCE:\t\t" +
147 scieScore + " out of " + flscieQnos
148 If Choice2 is "Cancel"
149 Return
150If Choice1 is "Student Table"
151 Show Choices3 "Answer Quiz", "View Score", & "Cancel"
152 If Choice3 is "Answer Quiz"
153 If newQavailable is zero
154 Print "There is no new quiz available."
155 Else
156 Set flmathQnos as zero
157 Set flenglQnos as zero
158 Set flscieQnos as zero
159 Set readHead as zero
160 Set mathScore as zero
161 Set englScore as zero
162 Set scieScore as zero
163 Set mathQctr as one
164 Set englQctr as one
165 Set scieQctre as one
166 Set totalLines as total number of lines in quizfile.txt less two //index starts with zero and the last line should always be empty so less two
167 Set quizLine as an array of every line in quizfile.txt
168 For Every quizLine
169 If quizLine is "MATH"
170 Increment flmathQnos
171
172 If quizLine is "ENGL"
173 Increment flenglQnos
174
175 If quizLine is "SCIE"
176 Increment flscieQnos
177 Print "Math: " + flmathQnos + " Questions\nEnglish: " + flenglQnos + " Questions\nScience: " + flscieQnos + " Questions"
178 While readHead is less than or equal to totalLines
179 Set subjType as quizLine[readHead]
180 Increment readHead
181 Set qType as quizLine[readHead]
182 If subjType is "MATH"
183 If qType is "MC"
184 Increment readHead
185 Set qHolder as quizLine[readHead]
186 Increment readHead
187 Set cAnswer as quizLine[readHead]
188 Initialize possibleAnswers as array
189 Add quizLine[readHead] to possibleAnswers
190 Increment readHead
191 Add quizLine[readHead] to possibleAnswers
192 Increment readHead
193 Add quizLine[readHead] to possibleAnswers
194 Increment readHead
195 Add quizLine[readHead] to possibleAnswers
196 Randomly rearrange elements in possibleAnswers
197 Print "MATH QUESTION #" + mathQctr + "\nMULTIPLE CHOICE"
198 Print qHolder
199 Show Choices4 possibleAnswers[0], possibleAnswers[1], possibleAnswers[2], possibleAnswers[3]
200 If Choice4 is possibleAnswers[0]
201 if possibleAnswers[0] is equal to cAnswer
202 Increment mathScore
203 If Choice4 is possibleAnswers[1]
204 if possibleAnswers[1] is equal to cAnswer
205 Increment mathScore
206 If Choice4 is possibleAnswers[2]
207 if possibleAnswers[2] is equal to cAnswer
208 Increment mathScore
209 If Choice4 is possibleAnswers[3]
210 if possibleAnswers[3] is equal to cAnswer
211 Increment mathScore
212 Increment mathQctr
213 Else
214 Increment readHead
215 Set qHolder as quizLine[readHead]
216 Increment readHead
217 Set cAnswer as quizLine[readHead]
218 Print "MATH QUESTION #" + mathQctr + "\nIDENTIFICATION TYPE"
219 Print qHolder
220 Set studentAnswer as lowercase 32 Characters User Input
221 If studentAnswer is equal to cAnswer
222 Increment mathScore
223 Increment mathQctr
224 Increment readHead
225 If subjType is "ENGL"
226 If qType is "MC"
227 Increment readHead
228 Set qHolder as quizLine[readHead]
229 Increment readHead
230 Set cAnswer as quizLine[readHead]
231 Initialize possibleAnswers as array
232 Add quizLine[readHead] to possibleAnswers
233 Increment readHead
234 Add quizLine[readHead] to possibleAnswers
235 Increment readHead
236 Add quizLine[readHead] to possibleAnswers
237 Increment readHead
238 Add quizLine[readHead] to possibleAnswers
239 Randomly rearrange elements in possibleAnswers
240 Print "ENGLISH QUESTION #" + englQctr + "\nMULTIPLE CHOICE"
241 Print qHolder
242 Show Choices4 possibleAnswers[0], possibleAnswers[1], possibleAnswers[2], possibleAnswers[3]
243 If Choice4 is possibleAnswers[0]
244 if possibleAnswers[0] is equal to cAnswer
245 Increment englScore
246 If Choice4 is possibleAnswers[1]
247 if possibleAnswers[1] is equal to cAnswer
248 Increment englScore
249 If Choice4 is possibleAnswers[2]
250 if possibleAnswers[2] is equal to cAnswer
251 Increment englScore
252 If Choice4 is possibleAnswers[3]
253 if possibleAnswers[3] is equal to cAnswer
254 Increment englScore
255 Increment englQctr
256 Else
257 Increment readHead
258 Set qHolder as quizLine[readHead]
259 Increment readHead
260 Set cAnswer as quizLine[readHead]
261 Print "ENGLISH QUESTION #" + englQctr + "\nIDENTIFICATION TYPE"
262 Print qHolder
263 Set studentAnswer as lowercase 32 Characters User Input
264 If studentAnswer is equal to cAnswer
265 Increment englScore
266 Increment englQctr
267 Increment readHead
268 If subjType is "SCIE"
269 If qType is "MC"
270 Increment readHead
271 Set qHolder as quizLine[readHead]
272 Increment readHead
273 Set cAnswer as quizLine[readHead]
274 Initialize possibleAnswers as array
275 Add quizLine[readHead] to possibleAnswers
276 Increment readHead
277 Add quizLine[readHead] to possibleAnswers
278 Increment readHead
279 Add quizLine[readHead] to possibleAnswers
280 Increment readHead
281 Add quizLine[readHead] to possibleAnswers
282 Randomly rearrange elements in possibleAnswers
283 Print "SCIENCE QUESTION #" + scieQctr + "\nMULTIPLE CHOICE"
284 Print qHolder
285 Show Choices4 possibleAnswers[0], possibleAnswers[1], possibleAnswers[2], possibleAnswers[3]
286 If Choice4 is possibleAnswers[0]
287 if possibleAnswers[0] is equal to cAnswer
288 Increment scieScore
289 If Choice4 is possibleAnswers[1]
290 if possibleAnswers[1] is equal to cAnswer
291 Increment scieScore
292 If Choice4 is possibleAnswers[2]
293 if possibleAnswers[2] is equal to cAnswer
294 Increment scieScore
295 If Choice4 is possibleAnswers[3]
296 if possibleAnswers[3] is equal to cAnswer
297 Increment scieScore
298 Increment scieQctr
299 Else
300 Increment readHead
301 Set qHolder as quizLine[readHead]
302 Increment readHead
303 Set cAnswer as quizLine[readHead]
304 Print "SCIENCE QUESTION #" + scieQctr + "\nIDENTIFICATION TYPE"
305 Print qHolder
306 Set studentAnswer as lowercase 32 Characters User Input
307 If studentAnswer is equal to cAnswer
308 Increment scieScore
309 Increment scieQctr
310 Increment readHead
311 Set newQavailable as zero
312 If Choice3 is "View Score"
313 Print "SCORES:\nMATH:\t\t" + mathScore + " out of " + flmathQnos +
314 "\nENGLISH:\t\t" + englScore + " out of " + flenglQnos + "\nSCIENCE:\t\t" + scieScore + " out of " + flscieQnos
315 If Choice3 is "Cancel"
316 Return
317If Choice1 is "Cancel"
318 Return