Skip to content

Commit

Permalink
event day hotfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
96-LB committed Dec 20, 2020
1 parent 1ba3234 commit d026f3a
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 31 deletions.
15 changes: 13 additions & 2 deletions cogs/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,18 @@ async def ask(self, ctx, *, msg=None):
else:
team_name = team['NAME']
team_id = team['ID']
await self.channel.send(f'💬 **Message from {ctx.author.mention} of team `{team_name}` (Team ID: `{team_id}`)**\n**' + '\~' * 31 + f'**\n{msg}', allowed_mentions=AllowedMentions(everyone=False, users=[ctx.author], roles=False))
await self.channel.send(
f'💬 **Message from {ctx.author.mention} of team `{team_name}` (Team ID: `{team_id}`):**\n' +
'**' + '\~' * 31 + f'**\n' +
msg,
allowed_mentions=AllowedMentions(everyone=False, users=[ctx.author], roles=False)
)
await self.broadcast(team,
f'💬 **Message from {ctx.author.mention} to organizers:**\n' +
'**' + '\~' * 31 + f'**\n' +
msg,
ctx.author.id
)
await ctx.send(f'Message successfully delivered! The organizers will get back to you soon.')

@organizer_channel()
Expand All @@ -47,7 +58,7 @@ async def message(self, ctx, team_id=None, *, msg=None):
else:
await self.broadcast(team,
'💬 **Message from organizers:**\n' +
'**' + '\~' * 31 + '**\n'+
'**' + '\~' * 31 + '**\n' +
msg
)
await ctx.send(f'Message successfully delivered!')
Expand Down
4 changes: 3 additions & 1 deletion cogs/novice.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ async def submit(self, ctx, problem=None):
elif not ctx.message.attachments:
await ctx.send(f'You must upload a code file as an attachment!')
else:
return await ctx.send(f'The submission deadline has passed!')

team_name = team['NAME']
team_id = team['ID']
submission_id = new_id()
Expand All @@ -68,7 +70,7 @@ async def submit(self, ctx, problem=None):
'TEAM': team_id,
'USER': str(ctx.author.id),
'MESSAGE': str((await self.channel.send(
f'📝 **Submission for problem `{problem}` (Submission ID: `{submission_id}`)**\n' +
f'📝 **Submission for problem `{problem}` (Submission ID: `{submission_id}`):**\n' +
'**' + '\~' * 31 + '**\n' +
f'Team: `{team_name}`\n' +
f'Team ID: `{team_id}`\n' +
Expand Down
1 change: 1 addition & 0 deletions cogs/teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ async def leave(self, ctx):
if not team:
await ctx.send('You are not yet on a team!')
else:
return await ctx.send('You cannot leave your team now!')
users = team['USERS'].split('|')
users.remove(str(ctx.author.id))
if len(users) > 0:
Expand Down
4 changes: 2 additions & 2 deletions cogs/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async def test(self, ctx, problem=None, test=None):
except:
await ctx.send('You must choose a problem number to receive a test case for!')
else:
problems = os.listdir('test')
problems = sorted(os.listdir('test'))
if not 0 < problem <= len(problems):
await ctx.send(f'Invalid problem number! Valid problem numbers range from 1 to {len(problems)}.')
else:
Expand All @@ -23,7 +23,7 @@ async def test(self, ctx, problem=None, test=None):
except:
await ctx.send('You must choose a test case number to receive!')
else:
tests = os.listdir(f'test/{problems[problem - 1]}')
tests = sorted(os.listdir(f'test/{problems[problem - 1]}'))
if not 0 <= test < len(tests):
await ctx.send(f'Invalid test case number! Valid test case numbers range from 0 to {len(tests) - 1}.')
else:
Expand Down
2 changes: 1 addition & 1 deletion test/05/4.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
5
2
4 3
2 1
2 changes: 1 addition & 1 deletion test/05/6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Sophia 26
Olivia 12
Riley 48
Emma 19
Ava 25
Ava 25
Isabella 85
Aria 44
Aaliyah 72
Expand Down
12 changes: 3 additions & 9 deletions test/10/3.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
8
10
76
1
695
0
43
24
103
1
10
1 2 3 4 5 6 7 8 9 10
11 changes: 7 additions & 4 deletions test/15/1.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
3
1 1
-10 0
5 -4
February 22
5
February 28
February 21
March 7
March 7
March 8
13 changes: 5 additions & 8 deletions test/15/3.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
-10 -10
6
-20 -20
-10 -10
0 0
10 10
20 20
30 30
March 1
3
February 28
March 31
April 1
1 change: 1 addition & 0 deletions test/22/2.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
4 6
000000
000000
000000
000000
2 changes: 1 addition & 1 deletion test/23/1.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
3 2
2 3
4
5
2 changes: 1 addition & 1 deletion test/24/4.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
12
10
0 8
4 2
5 2
Expand Down
2 changes: 1 addition & 1 deletion test/26/2.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
100 3
3 100
1
100
10000

0 comments on commit d026f3a

Please sign in to comment.