summaryrefslogtreecommitdiff
path: root/leningrade.py
diff options
context:
space:
mode:
Diffstat (limited to 'leningrade.py')
-rw-r--r--leningrade.py32
1 files changed, 17 insertions, 15 deletions
diff --git a/leningrade.py b/leningrade.py
index fe7ee9a..d37a846 100644
--- a/leningrade.py
+++ b/leningrade.py
@@ -15,8 +15,11 @@ parser.add_argument(
parser.add_argument(
"-i",
"--homework-id",
- required=True,
- help="A hexadecimal string obtained from the JOJ URL of the homework.",
+ required=False,
+ help=(
+ "A hexadecimal string obtained from the JOJ URL of the homework. "
+ "Can be omitted if -J is set."
+ ),
)
parser.add_argument(
"-I",
@@ -60,19 +63,6 @@ gitWorker = GitWorker(args, HGROUP, None, LANGUAGE, MANDATORY_FILES, OPTIONAL_FI
giteaWorker = GiteaWorker(args, GITEA_API_BASE, GITEA_ORG, GITEA_TOKEN, HGROUP)
jojWorker = JOJWorker(args, JOJ_COURSE_ID, JOJ_SESSION_ID, HGROUP)
-JOJ_INFO = {
- "homeworkID": cli_args.homework_id,
- "lang": LANGUAGE,
- # "problemInfo": [
- # # filenames, problem ID, # of test cases
- # (["ex2.m"], "61553cffb3c06a0006f45da3", 10),
- # (["ex4.m"], "61553e5fb3c06a0006f45da9", 10),
- # (["ex5.m"], "61553f8cb3c06a0006f45db2", 10),
- # (["ex6.m"], "6155414cb3c06a0006f45dc7", 10),
- # ],
- "problemInfo": problem_info(cli_args.homework_id),
-}
-
indvScores = {}
groupScores = {}
jojScores = {}
@@ -90,6 +80,18 @@ if not cli_args.no_group:
groupScores[key] = {**groupScores.get(key, {}), **tmpScores.get(key, {})}
# JOJ (This will consume a lot of time when the code is in MATLAB)
if not cli_args.no_joj:
+ JOJ_INFO = {
+ "homeworkID": cli_args.homework_id,
+ "lang": LANGUAGE,
+ # "problemInfo": [
+ # # filenames, problem ID, # of test cases
+ # (["ex2.m"], "61553cffb3c06a0006f45da3", 10),
+ # (["ex4.m"], "61553e5fb3c06a0006f45da9", 10),
+ # (["ex5.m"], "61553f8cb3c06a0006f45db2", 10),
+ # (["ex6.m"], "6155414cb3c06a0006f45dc7", 10),
+ # ],
+ "problemInfo": problem_info(cli_args.homework_id),
+ }
print("JOJ is now running (this may take a while)...")
jojScores = jojWorker.checkGroupJOJ(JOJ_INFO)