diff --git a/docker-compose.yml b/docker-compose.yml index 34fef87c08ccfeeaa9b04e617d2ca1efe6280b34..9ca10ec6b33a385caa07dd978d90fba568a86ced 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,3 +10,4 @@ services: LATE_PENALTY: 8 DEFAULT_LABELS: '["Names", "Steps", "Extra Credit"]' DEFAULT_POINTS: '[[10],[15,20],[0]]' + TEAM: 0 diff --git a/main.py b/main.py index b576e3eaa3702d72353206b9556a8541e3c2dd61..d443b628cc899a839a1cf560841c20e264155426 100644 --- a/main.py +++ b/main.py @@ -23,6 +23,7 @@ global latePenalty global pointsForRun global title global defaults +global team """ Environment Variable Imports @@ -45,6 +46,9 @@ defaults = generateDefaults() defaultLabels_env = os.getenv("DEFAULT_LABELS", default='["Name", "Steps", "Extra Credit"]') defaultLabels = json.loads(defaultLabels_env) + + +team = bool(os.getenv("TEAM", default="False").lower() in ("true", "1", "t")) """ * CHANGEABLE """ @@ -115,7 +119,11 @@ def operation(): # Change name elif choice == "2": global name - nameChange = input("New name: ") + if team: + plural = "(s)" + else: + plural = "" + nameChange = input("New name" + plural + ": ") name = nameChange return True # Change late penalty @@ -230,7 +238,11 @@ def printRuns(): minusPointStr = " -" + str(defaults[index][j] - pointsForRun[index][j]) else: minusPointStr = "" - print("Run " + str(count) + ": " + f'{Fore.yellow}' + str(point) + f'{Fore.deep_pink_3b}' + minusPointStr + f'{Style.reset}') + if pointsForRun[index][j] > defaults[index][j]: + addPointStr = " +" + str(defaults[index][j] + pointsForRun[index][j]) + else: + addPointStr = "" + print("Run " + str(count) + ": " + f'{Fore.yellow}' + str(point) + f'{Fore.deep_pink_3b}' + minusPointStr + f'{Fore.light_green}' + addPointStr + f'{Style.reset}') count = count + 1 j = j + 1 index = index + 1 @@ -262,8 +274,21 @@ def adjustScore(): return arrayPos = int(arrayPos) - 1 - + + print() + validRuns = "Run(s): " + count = 1 + for i in pointsForRun[arrayPos]: + if count == len(pointsForRun[arrayPos]): + validRun = str(count) + else: + validRun = str(count) + ", " + validRuns = validRuns + validRun + count = count + 1 + print(validRuns) + print() run = input("Adjust score for which run?: ") + if run == "": print("Please enter an actual number") sleep(1) @@ -307,7 +332,11 @@ def main(): titleText = Figlet(font='standard') print(titleText.renderText(title)) print() - name = input("Student name?: ") + if team: + plural = "(s)" + else: + plural = "" + name = input("Student name" + plural + "?: ") late = not validateInput(input("Did the student turn in the assignment within 5 days? [Y/n]: ")) if(late): score = score - latePenalty