-
Notifications
You must be signed in to change notification settings - Fork 0
/
RateMyClassSave.java~
598 lines (563 loc) · 19.1 KB
/
RateMyClassSave.java~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
package RateMyClass;
import java.util.ArrayList;
public class RateMyClassSave {
private static ArrayList<String> allCourses = new ArrayList<String>(); // holds all the courses in the application
public static ArrayList<String> sendBack = new ArrayList<String>(); // used for the purpose of adding to and then returning - so I can call from other classes.
private static ArrayList<Double> question1 = new ArrayList<Double>();
private static ArrayList<Double> question2 = new ArrayList<Double>();
private static ArrayList<Double> question3 = new ArrayList<Double>();
private static ArrayList<Double> question4 = new ArrayList<Double>();
private static int index = 0; // keeps track of index of user's course
private static ArrayList<Integer> numEntries1 = new ArrayList<Integer>();
private static ArrayList<Integer> numEntries2 = new ArrayList<Integer>();
private static ArrayList<Integer> numEntries3= new ArrayList<Integer>();
private static ArrayList<Integer> numEntries4 = new ArrayList<Integer>();
public static Boolean isCourse = false;
public RateMyClassSave() {
}
public static void defaulting () {
sendBack.add(RateMyClassDriver.courseQuestion);
// MATH: 0-13
allCourses.add(new String("MATH -------\n"));
allCourses.add(new String("algebra 1"));
allCourses.add(new String("geometry"));
allCourses.add(new String("geometry h."));
allCourses.add(new String("algebra 2"));
allCourses.add(new String("algebra 2 h."));
allCourses.add(new String("pre-calculus"));
allCourses.add(new String("advanced pre-calculus"));
allCourses.add(new String("advanced pre-calculus h."));
allCourses.add(new String("ap calculus ab"));
allCourses.add(new String("ap calculus bc"));
allCourses.add(new String("differential calculus"));
allCourses.add(new String("intro to computer science"));
allCourses.add(new String("ap computer science"));
//SCIENCE 14-24
allCourses.add(new String("SCIENCE\n------------------\n"));
allCourses.add(new String("biology"));
allCourses.add(new String("biology h."));
allCourses.add(new String("ap biology"));
allCourses.add(new String("chemistry"));
allCourses.add(new String("chemistry h."));
allCourses.add(new String("ap chemistry"));
allCourses.add(new String("physics"));
allCourses.add(new String("physics h."));
allCourses.add(new String("ap physics 1/2"));
allCourses.add(new String("ap physics c"));
//ENGLISH 25-44
allCourses.add(new String("ENGLISH\n------------------\n"));
allCourses.add(new String("English 1AB"));
allCourses.add(new String("English 2AB"));
allCourses.add(new String("American Lit: American Voices"));
allCourses.add(new String("American Lit: Jazz Age"));
allCourses.add(new String("American Lit: Nature"));
allCourses.add(new String("American Lit: Dreams and Disillusion"));
allCourses.add(new String("American Lit: Writing the Self"));
allCourses.add(new String("American Lit: American Studies"));
allCourses.add(new String("American Lit Honors"));
allCourses.add(new String("Arts and Letters"));
allCourses.add(new String("The Bible as Literature"));
allCourses.add(new String("British Literature"));
allCourses.add(new String("Buddhist Philosophy and the Game of Go"));
allCourses.add(new String("Composition"));
allCourses.add(new String("Creative Writing"));
allCourses.add(new String("Crime and Punishment"));
allCourses.add(new String("Fiction and Film"));
allCourses.add(new String("Journalsim"));
allCourses.add(new String("Science Fiction"));
//SOCIAL STUDIES 45-59
allCourses.add(new String("SOCIAL STUDIES\n------------------\n"));
allCourses.add(new String("ISS"));
allCourses.add(new String("Contemporary Issues"));
allCourses.add(new String("World Civilizations"));
allCourses.add(new String("Hawaiian Culture"));
allCourses.add(new String("Hawaiian Culture 2"));
allCourses.add(new String("Medieval History"));
allCourses.add(new String("Asian History"));
allCourses.add(new String("US History"));
allCourses.add(new String("AP US History"));
allCourses.add(new String("AP US Government and Politics"));
allCourses.add(new String("European History"));
allCourses.add(new String("European History Through the Arts"));
allCourses.add(new String("AP European History"));
allCourses.add(new String("CapSEEDS"));
//ART 60-76
allCourses.add(new String("ART\n------------------\n"));
allCourses.add(new String("Drawing 1"));
allCourses.add(new String("Drawing 2"));
allCourses.add(new String("Life Drawing"));
allCourses.add(new String("Painting 1"));
allCourses.add(new String("Painting 2"));
allCourses.add(new String("Printmaking"));
allCourses.add(new String("Color Digital Photography"));
allCourses.add(new String("Black and White Film"));
allCourses.add(new String("Photography 2"));
allCourses.add(new String("Digital Art"));
allCourses.add(new String("Digital Video"));
allCourses.add(new String("Ceramics: Handbuilding"));
allCourses.add(new String("Ceramics: Wheel Throwing 1"));
allCourses.add(new String("Ceramics: Wheel Throwing 2"));
allCourses.add(new String("Glass Blowing 1"));
allCourses.add(new String("Glass Blowing 2"));
//PE 77-88
allCourses.add(new String("PE\n------------------\n"));
allCourses.add(new String("Lifetime Fitness"));
allCourses.add(new String("ISPE: Basic Yoga Plus"));
allCourses.add(new String("ISPE: Field Sports"));
allCourses.add(new String("ISPE: Indoor Sports"));
allCourses.add(new String("ISPE: PEP"));
allCourses.add(new String("ISPE: Racquetball/Tennis"));
allCourses.add(new String("ISPE: Water Sports"));
allCourses.add(new String("ISPE: Yoga 1"));
allCourses.add(new String("ISPE: Yoga 2"));
allCourses.add(new String("ASPE"));
/*
//CHINESE 89-98
allCourses.add(new String("CHINESE\n------------------\n"));
allCourses.add(new String("Chinese 1"));
allCourses.add(new String("Chinese 2"));
allCourses.add(new String("Chinese 2H"));
allCourses.add(new String("Chinese 3"));
allCourses.add(new String("Chinese 3H"));
allCourses.add(new String("Chinese 4"));
allCourses.add(new String("Chinese 4H"));
allCourses.add(new String("Chinese 5"));
allCourses.add(new String("Chinese 5H"));
//JAPANESE 99-108
allCourses.add(new String("JAPANESE\n------------------\n"));
allCourses.add(new String("Japanese 1"));
allCourses.add(new String("Japanese 2"));
allCourses.add(new String("Japanese 2H"));
allCourses.add(new String("Japanese 3"));
allCourses.add(new String("Japanese 3H"));
allCourses.add(new String("Japanese 4"));
allCourses.add(new String("Japanese 4H"));
allCourses.add(new String("Japanese 5"));
allCourses.add(new String("Japanese 5H"));
//FRENCH 109-118
allCourses.add(new String("FRENCH\n------------------\n"));
allCourses.add(new String("French 1"));
allCourses.add(new String("French 2"));
allCourses.add(new String("French 2H"));
allCourses.add(new String("French 3"));
allCourses.add(new String("French 3H"));
allCourses.add(new String("French 4"));
allCourses.add(new String("French 4H"));
allCourses.add(new String("French 5"));
allCourses.add(new String("French 5 AP"));
//SPANISH 119-128
allCourses.add(new String("SPANISH\n------------------\n"));
allCourses.add(new String("Spanish 1"));
allCourses.add(new String("Spanish 2"));
allCourses.add(new String("Spanish 2H"));
allCourses.add(new String("Spanish 3"));
allCourses.add(new String("Spanish 3H"));
allCourses.add(new String("Spanish 4"));
allCourses.add(new String("Spanish 4H"));
allCourses.add(new String("Spanish 5"));
allCourses.add(new String("Spanish 5H"));
//HAWAIIAN 129-134
allCourses.add(new String("\n\n\n\n\n\n\n\n\n\n\n\nHAWAIIAN -------\n"));
allCourses.add(new String("Hawaiian 1"));
allCourses.add(new String("Hawaiian 2"));
allCourses.add(new String("Hawaiian 3"));
allCourses.add(new String("Hawaiian 4"));
//LANGUAGE 135-141
allCourses.add(new String("LANGUAGE -------\n"));
allCourses.add(new String("Chinese"));
allCourses.add(new String("Japanese"));
allCourses.add(new String("French"));
allCourses.add(new String("Spanish"));
allCourses.add(new String("Hawaiian"));
*/
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question1.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);
question2.add(0.0);;
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question3.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
question4.add(0.0);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries1.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries2.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries3.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
numEntries4.add(1);
RateMyClassSurvey.surveyQuestion1.add("\nSurvey Questions - \n\n\nOn a scale of 1-10, how hard was the course overall?\n");
RateMyClassSurvey.surveyQuestion2.add("On a scale of 1-10, how much homework did you have for this course?\n");
RateMyClassSurvey.surveyQuestion3.add("On a scale of 1-10, how engaged did you feel in this course?\n");
RateMyClassSurvey.surveyQuestion4.add("On a scale of 1-10, how much did you enjoy the class?");
RateMyClassSurvey.thanksFor.add("Thanks for taking the survey, here on the results for, \b" + RateMyClassSurvey.courseSelected+"\b:");
RateMyClassSurvey.questionFinal.add("");
}
public static ArrayList<String> getArray(int numberOne,int numberTwo) {
String tempString = "";
for (int i = numberOne; i < (numberTwo+1);i++) {
tempString = allCourses.get(i);
sendBack.add(tempString);
}
return sendBack;
}
public static void inputSurvey (int surveyvalue, String course, int questionnum) {
String bigArray = "";
int temp;
if (questionnum == 0) {
for (int i = 0; i < allCourses.size()-1; i++) {
if (allCourses.get(i).equals(course)) {
index = i;
}
}
}
else {
double temp2 = average(surveyvalue, questionnum);
question1.set(index,temp2);
temp = numEntries1.get(index) + 1;
numEntries1.set(index, temp);
}
}
public static ArrayList<String> outputSurvey (int surveyValue1,int surveyValue2,int surveyValue3,int surveyValue4) {
ArrayList<String> output = new ArrayList<String>();
output.add("AVERAGES FOR ALL SELECTED COURSE (1-10)\n\n");
output.add("QUESTION 1: On a scale of 1-10, how hard was/is the course overall?\n"+ question1.get(index));
output.add("\nQUESTION 2: On a scale of 1-10, how much homework did/do you have for this course?\n"+ question2.get(index));
output.add("\nQUESTION 3: On a scale of 1-10, how engaged did/do you feel in this course?\n"+ question3.get(index));
output.add("\nQUESTION 4: On a scale of 1-10, how much did you enjoy the class?\n"+ question4.get(index));
return output;
}
public static double average(int surveyValue, int questionnum) {
double tempNum = 1;
double tempNum2 = 1;
double tempNum3 = 1;
if (questionnum == 1) {
tempNum = question1.get(index);
tempNum2 = (tempNum)*(numEntries1.get(index));
tempNum3 = (tempNum2+ surveyValue)/numEntries1.get(index);
question1.set(index, tempNum3);
}
else if (questionnum == 2) {
tempNum = question2.get(index);
tempNum2 = tempNum*numEntries2.get(index);
tempNum3 = (tempNum2+ surveyValue)/numEntries2.get(index);
question2.set(index,tempNum3);
}
else if (questionnum == 3) {
tempNum = question3.get(index);
tempNum2 = tempNum*numEntries3.get(index);
tempNum3 = (tempNum2+ surveyValue)/numEntries3.get(index);
question3.set(index,tempNum3);
}
else if (questionnum == 4) {
tempNum = question4.get(index);
tempNum2 = tempNum*numEntries4.get(index);
tempNum3 = (tempNum2+ surveyValue)/numEntries4.get(index);
question4.set(index,tempNum3);
}
return tempNum3;
}
public static void isCourseTrue (String text) {
text = text.toLowerCase();
for (int p = 0; p < allCourses.size()-1; p++) {
if (allCourses.get(p).equals(text)) {
isCourse = true;
}
else {}
}
}
}