Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Olivier
Peer-graded student exercises
Commits
1dfce1c2
Commit
1dfce1c2
authored
Apr 23, 2019
by
Olivier
Browse files
M4: simpler file names, better email title
parent
033fe089
Changes
1
Hide whitespace changes
Inline
Side-by-side
M4_send_assignments/email_assignments.py
View file @
1dfce1c2
...
...
@@ -60,11 +60,11 @@ with open(input_csv_path, newline='') as f:
custom_ID_G
.
append
(
row
[
4
])
for
ID
in
custom_ID_A
:
attachment_name
=
"assignment
_a01_ID
_"
+
ID
+
".pdf"
attachment_name
=
"assignment
1
_"
+
ID
+
".pdf"
attachments
.
append
(
attachment_name
)
# Make sure that all the attachments are in the script_input folder by looking
# for a file with the
name "assignment_a01_ID_XXXXXXXXX.pdf"
# for a file with the
correct file name
for
i
in
range
(
0
,
len
(
custom_ID_A
)):
file_to_search
=
pathlib
.
Path
(
assignments_pdfs_path
+
attachments
[
i
])
if
file_to_search
.
exists
()
!=
True
:
...
...
@@ -113,7 +113,7 @@ for i in range(0, len(names)):
receiver_email
=
emails
[
i
]
# Email subject
subject
=
"Custom Assignment #1 "
+
custom_ID_A
[
i
]
subject
=
"Custom Assignment #1
ID_
"
+
custom_ID_A
[
i
]
# Email body
body
=
email_bodies
[
i
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment