summaryrefslogtreecommitdiff
path: root/leningrade.py
diff options
context:
space:
mode:
authorFrederick Yin <fred.yin@sjtu.edu.cn>2021-10-11 23:04:10 +0800
committerFrederick Yin <fred.yin@sjtu.edu.cn>2021-10-11 23:04:10 +0800
commit13030b6acdc41875a8868ec91362950a3dcd8fdf (patch)
tree5dc18e4a34de749bc4b6fd09a6b43fbef6878745 /leningrade.py
parent92792c927f407d4cbd5c9a19f4ef5cfb51c67fdb (diff)
Specify homework id through CLI argument
Remove HOMEWORK_ID from config. Instead, use CLI parameter -i/--homework-id <id>.
Diffstat (limited to 'leningrade.py')
-rw-r--r--leningrade.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/leningrade.py b/leningrade.py
index a54e6e5..fe7ee9a 100644
--- a/leningrade.py
+++ b/leningrade.py
@@ -13,6 +13,12 @@ parser.add_argument(
help="An integer. For h1, the value should be 1.",
)
parser.add_argument(
+ "-i",
+ "--homework-id",
+ required=True,
+ help="A hexadecimal string obtained from the JOJ URL of the homework.",
+)
+parser.add_argument(
"-I",
"--no-individual",
action="store_true",
@@ -55,7 +61,7 @@ giteaWorker = GiteaWorker(args, GITEA_API_BASE, GITEA_ORG, GITEA_TOKEN, HGROUP)
jojWorker = JOJWorker(args, JOJ_COURSE_ID, JOJ_SESSION_ID, HGROUP)
JOJ_INFO = {
- "homeworkID": JOJ_HOMEWORK_ID,
+ "homeworkID": cli_args.homework_id,
"lang": LANGUAGE,
# "problemInfo": [
# # filenames, problem ID, # of test cases
@@ -64,7 +70,7 @@ JOJ_INFO = {
# (["ex5.m"], "61553f8cb3c06a0006f45db2", 10),
# (["ex6.m"], "6155414cb3c06a0006f45dc7", 10),
# ],
- "problemInfo": problem_info(JOJ_HOMEWORK_ID),
+ "problemInfo": problem_info(cli_args.homework_id),
}
indvScores = {}