-
Notifications
You must be signed in to change notification settings - Fork 2
/
gradescope_report.ts
893 lines (750 loc) · 25.6 KB
/
gradescope_report.ts
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
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
/********************\
***** Data Types *****
\********************/
// Input data types
type PathName = string;
interface Test {
loc: string;
passed: boolean;
}
interface TestBlock {
name: string;
loc: string;
error: boolean;
tests: Test[];
}
enum Err {
Unknown = "Unknown",
Compilation = "Compilation",
OutOfMemory = "OutOfMemory",
Timeout = "Timeout",
Runtime = "Runtime",
}
interface Result {
Ok?: TestBlock[];
Err?: Err;
}
interface Evaluation {
code: PathName;
tests: string;
result: Result;
}
interface ExamplarConfig {
useWheats: boolean;
chaffs: string[] | null;
}
interface PointData {
functionality: Map<string, number>;
testing: Map<string, number>;
}
// Gradescope types
enum Visibility {
Visible = "visible",
AfterPublished = "after_published",
Hidden = "hidden",
}
enum ReportSection {
Functionality = "Functionality",
Wheat = "Wheat",
Chaff = "Chaff",
}
enum ReportType {
Examplar = "Examplar",
Detailed = "Detailed",
Score = "Score",
}
interface GradescopeReport {
visibility: string;
stdout_visibility: string;
tests: GradescopeTestReport[];
score: number;
max_score: number;
}
interface GradescopeTestReport {
name: string;
output: string;
score?: number;
max_score?: number;
visibility: string;
extra_data: {
section: ReportSection;
type: ReportType;
}
}
/************************\
***** Implementation *****
\************************/
/********************\
*** Handling input ***
\********************/
/*
Parse command line arguments
Outputs: The file locations of `[infile, outfile, scorefile]`
*/
function parse_command_line(): [string, string, string, string | null] {
let args: string[] = process.argv.slice(2);
if (args.length === 3) {
return [args[0], args[1], args[2], null];
} else if (args.length === 4) {
return [args[0], args[1], args[2], args[3]];
} else {
throw("Usage: <infile> <outfile> <configfile> <scorefile>");
}
}
/*
Read raw evaluation data from JSON file
Inputs: The `path` to the evaluation file
Outputs: List of evaluations present in file
*/
function read_evaluation_from_file(path: PathName): Evaluation[] {
let fs = require('fs');
let contents: string = fs.readFileSync(path);
let evaluations: Evaluation[] = JSON.parse(contents);
return evaluations;
}
/*
Splits the evaluations into functionality, wheats, and chaffs
Inputs: The list of `results` to be split
Outputs: The `[test_results, wheat_results, chaff_results]`
*/
function partition_results(results: Evaluation[]): [Evaluation[], Evaluation[], Evaluation[]] {
let test_results: Evaluation[] = [];
let wheat_results: Evaluation[] = [];
let chaff_results: Evaluation[] = [];
let result: Evaluation;
for (result of results) {
let code_name: string = get_code_dir_name(result);
if (code_name.includes("wheat")) {
wheat_results.push(result);
} else if (code_name.includes("chaff")) {
chaff_results.push(result);
} else {
test_results.push(result);
}
};
return [test_results, wheat_results, chaff_results];
}
/*
Normalize locations to ignore directory source (in place)
Inputs: An evaluation to fix
*/
function normalize_code_names(evaluation: Evaluation) {
if (evaluation.result.Ok) {
evaluation.result.Ok.forEach(block => {
block.loc = get_loc_name(block.loc);
block.tests.forEach(test => {
test.loc = get_loc_name(test.loc);
});
});
}
}
/*
Extracts the examplar config data from the config file
Inputs: The `path` to the config file
Outputs: The config data
*/
function parse_examplar_config_file(path: PathName): ExamplarConfig {
let fs = require('fs');
let contents: string = fs.readFileSync(path);
return JSON.parse(contents);
}
/*
Read scoring data from JSON file
Inputs: The `path` to the score file
Outputs: Object containing the scoring data
*/
function read_score_data_from_file(path: PathName): PointData {
let fs = require('fs');
let contents: string = fs.readFileSync(path);
let raw_score_data = JSON.parse(contents);
function json_to_map(obj): Map<string, number> {
let map: Map<string, number> = new Map();
let name: string;
for (name in obj) {
map.set(name, obj[name]);
}
return map;
}
let functionality_map: Map<string, number> = json_to_map(raw_score_data.functionality);
let testing_map: Map<string, number> = json_to_map(raw_score_data.testing);
return {
functionality: functionality_map,
testing: testing_map
};
}
/*********************\
*** Handling output ***
\*********************/
/*
Writes a Gradescope report to a file
Inputs: The `path` to the output file;
The `report` to be written
*/
function write_report_to_file(path: PathName, report: GradescopeReport) {
let fs = require('fs');
let data: string = JSON.stringify(report);
fs.writeFileSync(path, data);
console.log("Wrote output to " + path);
}
/************************\
*** Generating reports ***
\************************/
//// Helpers
/*
Gets the name a file from path name
Inputs: The `path_name` of the file
Outputs: The name of the file
*/
function get_code_file_name(evaluation: Evaluation): string {
let path = require('path');
return path.basename(evaluation.code);
}
function get_code_dir_name(evaluation: Evaluation): string {
let path = require('path');
return path.basename(path.dirname(evaluation.code));
}
function get_test_file_name(evaluation: Evaluation): string {
let path = require('path');
return path.dirname(evaluation.tests.split(";")[1]);
}
function get_line_number(test_loc: string): string {
return test_loc.split(".arr:")[1];
}
/*
Gets the pure location of a test or test block from a full location name
E.g.: "file:///autograder/results/docdiff-wheat-2017.arr;docdiff-tests.arr/tests.arr:8:0-19:3"
--> "tests.arr:8:0-19:3"
Used to uniquely identify tests/test blocks between evaluations
Inputs: The full location name
Outputs: The pure location name
*/
function get_loc_name(loc: string): string {
let parts = loc.split("/");
let ret = parts[parts.length - 1];
return ret;
}
// Generate student reports
interface TestAndBlock {
test: Test,
block: TestBlock
}
enum TestFailure {
Pass,
Fail,
Err
}
interface TestFailureReport {
success: TestFailure
failures?: {
tests: TestAndBlock[],
blocks: TestBlock[]
}
}
/*
Takes a wheat evaluation, and finds all of the invalid tests and blocks;
If the wheat passes, returns null;
Otherwise, returns the pure locations of all invalid tests/blocks and
the name of the block it contains/itself
Inputs: The `wheat` evaluation
Outputs: null if valid wheat, otherwise the invalid tests/blocks as:
[list of (test location, block name), list of (block location, block name)]
*/
function get_invalid_tests_and_blocks(wheat: Evaluation): TestFailureReport {
if (wheat.result.Err) {
return { success: TestFailure.Err };
}
let invalid_tests: TestAndBlock[] = [];
let invalid_blocks: TestBlock[] = [];
let block: TestBlock;
for (block of wheat.result.Ok) {
// If the block errors, add to invalid_blocks
if (block.error) {
invalid_blocks.push(block);
}
let test: Test;
for (test of block.tests) {
// If a test fails, add to invalid_tests
if (!test.passed) {
invalid_tests.push({ test: test, block: block });
}
}
}
if ((invalid_tests.length === 0) && (invalid_blocks.length === 0)) {
// This means the wheat is valid
return { success: TestFailure.Pass };
} else {
return {
success: TestFailure.Fail,
failures: {
tests: invalid_tests,
blocks: invalid_blocks
}
};
}
}
/*
Generates a wheat testing report;
If the wheat is invalid, generates report with reason;
Otherwise, generates report with positive message
Inputs: The `wheat_results` evaluations
Outputs: A report for the wheat
*/
function generate_examplar_wheat_report(wheat_results: Evaluation[]): GradescopeTestReport {
let full_wheat_report: WheatMessagesReport = {
valid: true,
messages: []
};
let wheat_result: Evaluation;
for (wheat_result of wheat_results) {
let wheat_report: WheatMessagesReport = generate_wheat_messages(wheat_result);
if (!wheat_report.valid) {
full_wheat_report.valid = false;
full_wheat_report.messages.push(...wheat_report.messages);
}
}
let name: string;
let output: string;
if (full_wheat_report.valid) {
name = "VALID";
output = "These tests are valid and consistent with the assignment handout.";
} else {
// Remove duplicates (from https://wsvincent.com/javascript-remove-duplicates-array/)
let messages = full_wheat_report.messages;
messages = messages.filter((v, i) => messages.indexOf(v) === i);
name = "INVALID";
output = `Your test suite failed at least one of our wheats.\n${messages.join("\n")}`;
}
return {
name: name,
output: output,
visibility: Visibility.Visible,
extra_data: {
section: ReportSection.Wheat,
type: ReportType.Examplar,
},
};
}
interface WheatMessagesReport {
valid: boolean,
messages?: string[]
}
function generate_wheat_messages(wheat_result: Evaluation): WheatMessagesReport {
// Find the invalid tests/blocks
let test_report: TestFailureReport = get_invalid_tests_and_blocks(wheat_result);
if (test_report.success === TestFailure.Pass) {
// Valid wheat
return { valid: true };
} else if (test_report.success === TestFailure.Err) {
// Test file errored
return {
valid: false,
messages: [`Wheat errored; ${wheat_result.result.Err}`]
};
} else if (test_report.success === TestFailure.Fail) {
let messages: string[] = [];
let invalids = test_report.failures;
let block: TestBlock;
for (block of invalids.blocks) {
messages.push(`Block "${block.name}" at lines ${get_line_number(block.loc)} raised an error.`);
}
let test: TestAndBlock;
for (test of invalids.tests) {
messages.push(`Test failed in block "${test.block.name}" at lines ${get_line_number(test.block.loc)}; ` +
`Test location: ${get_line_number(test.test.loc)}`);
}
if (messages.length === 0) {
throw "Contact instructor; Wheat failed, but no reason given.";
}
return {
valid: true,
messages: messages
};
}
}
/*
Generates a chaff testing report; only run if all wheats passed;
If the chaff is invalid, generates report with reason;
Otherwise, generates report with negative message
Inputs: The `chaff_results` to report
Outputs: The report for the chaff
*/
function generate_examplar_chaff_report(chaff_result: Evaluation, chaff_number: number): GradescopeTestReport {
// Find the invalid tests/blocks
let test_report: TestFailureReport = get_invalid_tests_and_blocks(chaff_result);
let name: string;
let output: string;
if (test_report.success === TestFailure.Pass) {
// Valid wheat
name = `Chaff number ${chaff_number} not caught.`;
output = "";
} else if (test_report.success === TestFailure.Err) {
// Test file errored
name = `Chaff number ${chaff_number} caught!`;
output = `Chaff errored: ${chaff_result.result.Err}.\n` +
"Note that this means you are not testing defensively.";
} else if (test_report.success === TestFailure.Fail) {
let messages: string[] = [];
let invalids = test_report.failures;
let block: TestBlock;
for (block of invalids.blocks) {
messages.push(`Block "${block.name}" at lines ${get_line_number(block.loc)} raised an error.`);
}
let test: TestAndBlock;
for (test of invalids.tests) {
messages.push(`Test block: "${test.block.name}"; Test lines: ${get_line_number(test.test.loc)}`);
}
if (messages.length === 0) {
throw "Contact instructor; Chaff failed, but no reason given.";
}
name = `Chaff number ${chaff_number} caught!`;
output = `The following tests caught this chaff:\n${messages.join("\n")}`;
}
return {
name: name,
output: output,
visibility: Visibility.Visible,
extra_data: {
section: ReportSection.Chaff,
type: ReportType.Examplar,
}
};
}
// Generate TA reports
/*
Generates a functionality report(s);
If test file errors, returns a single report with 0/1 and error;
Otherwise, return report for each block, each out of 1
Inputs: The `test_result` of a single test suite
Outputs: A list of reports for each block
*/
function generate_functionality_report(test_result: Evaluation): GradescopeTestReport[] {
let result: Result = test_result.result;
// If errors, 0 functionality and provide error reason
if (result.Err) {
return [{
name: get_code_file_name(test_result),
output: `Error: ${result.Err}`,
score: 0,
max_score: 1,
visibility: Visibility.Visible,
extra_data: {
section: ReportSection.Functionality,
type: ReportType.Detailed,
}
}];
}
// If no error, report what blocks passed/failed
let reports: GradescopeTestReport[] = [];
let block: TestBlock;
for (block of result.Ok) {
let output: string;
let score: number;
if (block.error) {
// If the block errors, then failed block
output = "Block errored.";
score = 0;
} else {
// Otherwise, compare number of passed tests to total number of tests
let total_tests: number = block.tests.length;
let passed_tests: number = block.tests.filter(test => test.passed).length;
if (passed_tests === total_tests) {
output = `Passed all ${total_tests} tests in this block!`;
score = 1;
} else {
output = `Missing ${total_tests - passed_tests} tests in this block`;
score = 0;
}
}
// Add block to report
reports.push({
name: `Test: "${block.name}"`,
output: output,
score: score,
max_score: 1,
visibility: Visibility.AfterPublished,
extra_data: {
section: ReportSection.Functionality,
type: ReportType.Detailed,
}
});
}
return reports;
}
/*
Generates a wheat testing report;
If the wheat is invalid, generates report with reason;
Otherwise, generates report with positive message
Inputs: The `wheat_result` evaluation
Outputs: A report for the wheat
*/
function generate_detailed_wheat_report(wheat_result: Evaluation): GradescopeTestReport {
// Find the invalid tests/blocks
let test_report: TestFailureReport = get_invalid_tests_and_blocks(wheat_result);
let output: string;
let score: number;
if (test_report.success === TestFailure.Pass) {
// Valid wheat
output = "Passed wheat!";
score = 1;
} else if (test_report.success === TestFailure.Err) {
// Test file errored
output = `Wheat errored; ${wheat_result.result.Err}`;
score = 0;
} else if (test_report.success === TestFailure.Fail) {
let invalids = test_report.failures;
output = "";
score = 0;
let test: TestAndBlock;
for (test of invalids.tests) {
output += `Wheat failed test in block "${test.block.name}" at location ${test.test.loc}\n`;
}
let block: TestBlock
for (block of invalids.blocks) {
output = `Wheat caused error in block "${block.name}"\n`;
}
if (output === "") {
throw "Wheat failed but no reason given.";
}
}
return {
name: `Wheat: ${get_code_file_name(wheat_result)}`,
score: score,
max_score: 1,
output: output,
visibility: Visibility.AfterPublished,
extra_data: {
section: ReportSection.Wheat,
type: ReportType.Detailed,
}
};
}
/*
A curried function which generates a chaff testing report;
It first takes in the list of wheat evaluations, and finds all
invalid tests and test blocks between wheats;
It then takes in a chaff evaluation, and checks if it is caught
by the valid tests/blocks
Inputs: The `wheat_results` evaluations
Outputs: A function which generates a chaff report from an evaluation
*/
function generate_detailed_chaff_report(wheat_results: Evaluation[]) {
let all_invalid_tests: Test[] = [];
let all_invalid_blocks: TestBlock[] = [];
// Go through wheats and find invalid tests/blocks
let wheat_result: Evaluation;
for (wheat_result of wheat_results) {
let test_report: TestFailureReport = get_invalid_tests_and_blocks(wheat_result);
if (test_report.success !== TestFailure.Pass) {
let invalids = test_report.failures;
all_invalid_tests.push(...invalids.tests.map(test => test.test));
all_invalid_blocks.push(...invalids.blocks);
}
}
let all_invalid_locs = [...all_invalid_tests, ...all_invalid_blocks].map(inv => inv.loc);
/*
Generates a chaff testing report; ignores invalid tests/blocks;
If the chaff is invalid, generates report with reason;
Otherwise, generates report with negative message
Inputs: The `chaff_results` to report
Outputs: The report for the chaff
*/
return function (chaff_result: Evaluation): GradescopeTestReport {
let get_score_and_output = function (): {output: string, score: number} {
if (chaff_result.result.Err) {
// Test file errors
return {
output: `Chaff caught; error: ${chaff_result.result.Err}!`,
score: 1
};
} else {
// Loop through blocks to check if chaff is caught
let block: TestBlock;
for (block of chaff_result.result.Ok) {
if (block.error && !all_invalid_locs.includes(block.loc)) {
// Block errors
return {
output: `Chaff caught; error in block "${block.name}"!`,
score: 1
};
}
let test: Test;
for (test of block.tests) {
// Test fails
if (!test.passed && !all_invalid_locs.includes(test.loc)) {
return {
output: `Chaff caught; test failed in block "${block.name}"!`,
score: 1
};
}
}
}
// If this is reached, the chaff is not caught
return {
output: "Chaff not caught.",
score: 0
};
}
}
let result = get_score_and_output();
return {
name: `Chaff: ${get_code_file_name(chaff_result)}`,
output: result.output,
score: result.score,
max_score: 1,
visibility: Visibility.AfterPublished,
extra_data: {
section: ReportSection.Chaff,
type: ReportType.Detailed,
}
}
}
}
/*
Generates a score report for a given list of reports
Inputs: The `reports` to summarize;
The `point_values` to apply to the reports;
The `name` to use in the report
*/
function generate_score_report(
reports: GradescopeTestReport[],
point_values: Map<string, number>,
name: string,
section: ReportSection): GradescopeTestReport {
// Find the score summary from the reports
let total_score: number = 0;
let possible_score: number = 0;
let report: GradescopeTestReport;
for (report of reports) {
let points = point_values.has(report.name) ? point_values.get(report.name) : 1;
total_score += report.score === report.max_score ? points : 0;
possible_score += points;
}
// Return report
return {
name: `Score: ${name}`,
output: "",
score: total_score,
max_score: possible_score,
visibility: Visibility.Hidden,
extra_data: {
section: section,
type: ReportType.Score,
},
};
}
// Generate overall report
/*
Generates the overall report from all provided reports
Inputs: List of `all_reports` to include
Outputs: The overall Gradescope report
*/
function generate_overall_report(all_reports: GradescopeTestReport[]): GradescopeReport {
return {
visibility: Visibility.Visible,
stdout_visibility: Visibility.Visible,
tests: all_reports,
score: 0,
max_score: 0,
};
}
function main() {
/*
** Handling input
*/
// Get input and output file names from command line
let [infile, outfile, scorefile, configfile]: [string, string, string, string | null] = parse_command_line();
// Parse autograder json output
let results: Evaluation[] = read_evaluation_from_file(infile);
// Split up evaluations into test, wheat, and chaff results
let [test_results, wheat_results, chaff_results]: [Evaluation[], Evaluation[], Evaluation[]] =
partition_results(results);
// Fix code names to be uniform across all evaluations (unaffected by test name)
{
let results: Evaluation[];
for (results of [test_results, wheat_results, chaff_results]) {
results.forEach(normalize_code_names);
}
}
// Extract config data
let examplar_config: ExamplarConfig | null = configfile === null ? null : parse_examplar_config_file(configfile);
// Get point value data
let point_values: PointData = read_score_data_from_file(scorefile);
/*
** Generating reports
*/
let examplar_reports: GradescopeTestReport[] = [];
if (examplar_config !== null && examplar_config.useWheats) {
// Wheats
let wheat_report: GradescopeTestReport = generate_examplar_wheat_report(wheat_results);
examplar_reports.push(wheat_report);
// Chaffs
if (wheat_report.name === "VALID") {
// Filter out based on config
let examplar_chaff_results: Evaluation[];
if (examplar_config.chaffs === null) {
examplar_chaff_results = chaff_results;
} else {
examplar_chaff_results = chaff_results.filter(result => examplar_config.chaffs.includes(get_code_file_name(result)));
}
// Generate chaff reports
examplar_chaff_results.forEach((result, index) => {
let report = generate_examplar_chaff_report(result, index);
examplar_reports.push(report);
});
}
}
let detailed_reports: GradescopeTestReport[];
let score_reports: GradescopeTestReport[];
{
// Detailed reports
let detailed_test_reports: GradescopeTestReport[][] =
test_results.map(generate_functionality_report);
let detailed_wheat_reports: GradescopeTestReport[] =
wheat_results.map(generate_detailed_wheat_report);
let detailed_chaff_reports: GradescopeTestReport[] =
chaff_results.map(generate_detailed_chaff_report(wheat_results));
detailed_reports = [].concat(
...detailed_test_reports,
detailed_wheat_reports,
detailed_chaff_reports,
);
// Score reports
let functionality_scores: GradescopeTestReport[] =
detailed_test_reports.map(report =>
generate_score_report(
report,
point_values.functionality,
"functionality",
ReportSection.Functionality));
let wheat_score: GradescopeTestReport =
generate_score_report(
detailed_wheat_reports,
point_values.testing,
"wheats",
ReportSection.Wheat);
let chaff_score: GradescopeTestReport =
generate_score_report(
detailed_chaff_reports,
point_values.testing,
"chaffs",
ReportSection.Chaff);
score_reports = [].concat(
functionality_scores,
[wheat_score],
[chaff_score],
);
}
// All reports
let all_reports: GradescopeTestReport[] = [].concat(
examplar_reports,
detailed_reports,
score_reports,
);
// Generate overall report
let gradescope_report: GradescopeReport = generate_overall_report(all_reports);
/*
** Handling output
*/
write_report_to_file(outfile, gradescope_report);
}
main();