-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_structure.py
More file actions
135 lines (122 loc) · 2.77 KB
/
data_structure.py
File metadata and controls
135 lines (122 loc) · 2.77 KB
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
import requests,json
test={
"gradingId": "whatever",
"links": [
{
"EntityId": 123456789,
"filename" : "youx8420_a02.zip",
"link": "https://github.com/fleiray/Fangjian/files/4967411/youx8420_a02.zip"
},
{
"EntityId": 123456790,
"filename" : "leix5490_a02.zip",
"link": "https://github.com/fleiray/Fangjian/files/4967409/leix5490_a02.zip"
}
],
"configuration": [
{
"filename": "a2q1.c",
"testCases": [
{
"input": "",
"output": "need more than two integer arguments: 2 1 2 3 4",
"marks": 1
},
{
"input": "1 2 3 4",
"output": "2*1^2 + 3*1^1 + 4*1^0 = 9",
"marks": 1
},
{
"input": "10 9 8 7 6 5 4",
"output": "9*10^5 + 8*10^4 + 7*10^3 + 6*10^2 + 5*10^1 + 4*10^0 = 987654",
"marks": 1
}
]
},
{
"filename": "a2q2.c",
"testCases": [
{
"input": "",
"output": "need more than two integer arguments: 2 1 2 3 4",
"marks": 1
},
{
"input": "1 2 3 4",
"output": "2*1^2 + 3*1^1 + 4*1^0 = 9",
"marks": 1
},
{
"input": "10 9 8 7 6 5 4",
"output": "9*10^5 + 8*10^4 + 7*10^3 + 6*10^2 + 5*10^1 + 4*10^0 = 987654",
"marks": 1
},
{
"input": "5 6 7",
"output": "6*5^1 + 7*5^0 = 37",
"marks": 1
},
{
"input": "4",
"output": "need more than two integer arguments: 2 1 2 3 4",
"marks": 1
}
]
}
]
}
#send
testResult = {
"output" : "",
"expectOutput" : "",
"match" : False,
"marks" : 0
}
markings = {
"filename" : "",
"marked" : False,
"testResult" : [ ]
}
results = {
"EntityId" : "",
"markings": [ ]
}
responseBody = {
"gradingId": "",
"numOfSubmissions": 0,
"results" : [ ]
}
#receive
testCases = {
"input" : "",
"output" : "",
"marks" : 0
}
configuration = {
"filename" : "",
"testCases" : [ ]
}
links = {
"EntityId" : "",
"filename" : "", #zip
"link" : ""
}
receiveBody={
"gradingId" : "",
"links" : [ ],
"configuration" : [ ]
}
runC = {
"EntityId" : "",
"results" : []
}
def add_testResult(testResult,markings):
markings["testResult"].append(testResult)
return
def add_markings(markings,results):
results["markings"].append(markings)
return
def add_results(results,responseBody):
responseBody["results"].append(results)
return