-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
70 lines (65 loc) · 1.67 KB
/
test.py
File metadata and controls
70 lines (65 loc) · 1.67 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
from data_structure import *
from functions import *
# test={
# "gradingId" : "",
# "configuration" : [
# {
# "filename" : "xxx",
# "testCases" : [
# {
# "input" : "111",
# "output" : "222",
# "marks" : 1
# },
# {
# "input" : "333",
# "output" : "444",
# "marks" : 2
# }
# ]
# },
# {
# "filename" : "yyy",
# "testCases" : [
# {
# "input" : "qqq",# get this
# "output" : "QQQ",
# "marks" : 1
# },
# {
# "input" : "WWW",
# "output" : "www",
# "marks" : 2
# }
# ]
# }
# ]
# }
# import os
# import shutil
# cwd = os.getcwd()
# folder = os.path.join(cwd,'EXTRACTED')
# for the_file in os.listdir(folder):
# file_path = os.path.join(folder, the_file)
# try:
# if os.path.isfile(file_path):
# os.unlink(file_path)
# elif os.path.isdir(file_path):
# shutil.rmtree(file_path)
# except Exception as e:
# print(e)
# if cwd.endswith("EXTRACTED"):
# folder = cwd
# else:
# folder = os.path.join(cwd,'EXTRACTED')
# print(folder)
# try:
# os.rmdir(folder)
# except OSError as e:
# print("Error: %s : %s" % (folder, e.strerror))
send = dict(responseBody)
send["gradingId"] = "2020-6-haoquan-dropbox-z229" # here should be replaced by environmental variable in the future
# send["gradingId"] = getGradingID()
r = receiveData(send["gradingId"],"oursecret").json()
data=json.loads(r)
print(data)