-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabgrid.py
23 lines (21 loc) · 1.04 KB
/
abgrid.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import argparse
from abgrid.ABGridDocuments import ABGridDocuments
from abgrid.ABGridData import ABGridData
from abgrid.ABGridYAML import ABGridYAML
parser = argparse.ArgumentParser(prog="ABGrid")
parser.add_argument("-a", "--action", required=True, choices=["init", "sheets", "reports"])
parser.add_argument("-p", "--project_name", required=True,)
parser.add_argument("-g", "--n_groups", type=int, choices=range(1, 21))
parser.add_argument("-m", "--n_members_per_group", type=int, choices=range(3, 16))
args = parser.parse_args()
if args.action == "init":
if not args.n_groups or not args.n_members_per_group:
print("Please specify the following parameters: project_name (-p), n_groups (-g), n_members_per_group (-m)")
else:
ABGridDocuments.init_files(
args.project_name, args.n_groups, args.n_members_per_group)
else:
abgrid_data = ABGridData(args.project_name, ABGridYAML())
abgrid_documents = ABGridDocuments(abgrid_data)
abgrid_documents.generate_answer_sheets(
) if args.action == "sheets" else abgrid_documents.generate_reports()