Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
RWTHmoodle
exam-scan
Commits
491880ae
Commit
491880ae
authored
Apr 27, 2021
by
Deb
Browse files
iss8 folder struc reform + improvements
parent
dfcb68bf
Pipeline
#455412
failed with stage
in 44 seconds
Changes
26
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
fonts/.gitkeep
→
assets/
fonts/.gitkeep
View file @
491880ae
File moved
fonts/arial.ttf
→
assets/
fonts/arial.ttf
View file @
491880ae
File moved
images/linux1.png
→
assets/
images/linux1.png
View file @
491880ae
File moved
images/macpip.png
→
assets/
images/macpip.png
View file @
491880ae
File moved
images/macpython.png
→
assets/
images/macpython.png
View file @
491880ae
File moved
images/pip.png
→
assets/
images/pip.png
View file @
491880ae
File moved
images/policyissue.png
→
assets/
images/policyissue.png
View file @
491880ae
File moved
images/python installation.png
→
assets/
images/python installation.png
View file @
491880ae
File moved
images/python installation4.png
→
assets/
images/python installation4.png
View file @
491880ae
File moved
Dependancies.md
→
docs/
Dependancies.md
View file @
491880ae
File moved
FAQs.md
→
docs/
FAQs.md
View file @
491880ae
File moved
swdependencies_linux.md
→
docs/
swdependencies_linux.md
View file @
491880ae
File moved
swdependencies_mac.md
→
docs/
swdependencies_mac.md
View file @
491880ae
File moved
swdependencies_win.md
→
docs/
swdependencies_win.md
View file @
491880ae
File moved
encrypt.py
View file @
491880ae
...
...
@@ -47,12 +47,9 @@ def main(args):
PDFs in input folder are encrypted and stored in output folder.
Alongside with a CSV file mapping passwords to each PDF.
'''
)
parser
.
add_argument
(
"-i"
,
"--infolder"
,
default
=
"./pdfs_watermarked"
,
help
=
"Input PDF folder. Default: ./pdfs_watermarked"
)
parser
.
add_argument
(
"infolder"
,
help
=
"Input PDF folder."
)
parser
.
add_argument
(
"-o"
,
"--outfolder"
,
default
=
"./pdfs_encrypted"
,
help
=
"Output folder storing encrypted PDFs. "
+
"Default: ./pdfs_encrypted"
)
parser
.
add_argument
(
"outfolder"
,
help
=
"Output folder storing encrypted PDFs. "
)
parser
.
add_argument
(
"-p"
,
"--password"
,
default
=
""
,
help
=
"Common password for all encrypted PDFs. "
+
...
...
@@ -78,13 +75,18 @@ def main(args):
pdf_folder
=
os
.
listdir
(
infolder
)
pdf_files
=
[
_
for
_
in
pdf_folder
if
_
.
lower
().
endswith
(
".pdf"
)]
print
(
"""
if
len
(
pdf_files
)
>
0
:
print
(
"""
Available PDFs to be encrypted:
- {}
Files in output folder {} will be overwritten during this process.
"""
.
format
(
"
\n
- "
.
join
(
pdf_files
),
outfolder
))
else
:
print
(
"""
There are no PDFs in the given directory.
Exiting now."""
)
return
# Encrypt all PDFs in input folder
csv_lines
=
[]
enc_files
=
[]
...
...
@@ -100,7 +102,9 @@ Files in output folder {} will be overwritten during this process.
password
=
pwgen
.
pwgen
(
8
)
else
:
password
=
args
.
password
if
not
os
.
path
.
exists
(
outfolder
):
os
.
makedirs
(
outfolder
)
# Encrypt
in_file
=
os
.
path
.
join
(
infolder
,
pdf_file
)
enc_file
=
os
.
path
.
splitext
(
pdf_file
)[
0
]
+
'_aes.pdf'
...
...
preparemoodle.py
View file @
491880ae
...
...
@@ -52,12 +52,8 @@ def main(args):
Attention: zip-archive 'out' will be overwritten in the following!
'''
)
parser
.
add_argument
(
"-i"
,
"--infolder"
,
default
=
"./pdfs_encrypted"
,
help
=
"Input folder with PDFs. Default: ./pdfs_encrypted"
)
parser
.
add_argument
(
"-c"
,
"--csv"
,
default
=
"./Bewertungen.csv"
,
help
=
"Moodle grading sheet. Default: ./Bewertungen.csv"
)
parser
.
add_argument
(
"infolder"
,
help
=
"Input folder with PDFs."
)
parser
.
add_argument
(
"csv"
,
help
=
"Moodle grading sheet."
)
parser
.
add_argument
(
"--csvdelim"
,
default
=
","
,
help
=
"CSV delimiter. Default: ','"
)
parser
.
add_argument
(
...
...
@@ -66,9 +62,7 @@ def main(args):
"--csvenc"
,
default
=
"utf-8"
,
help
=
"CSV encoding scheme. "
+
"Typical encodings:'utf-8', 'utf-8-sig', or 'cp1252' (Windows). "
+
"Default: 'utf-8'"
)
parser
.
add_argument
(
"-o"
,
"--outzip"
,
default
=
"./moodle_feedbacks.zip"
,
help
=
"Zip archive. Default: ./moodle_feedbacks.zip"
)
parser
.
add_argument
(
"outzip"
,
help
=
"Zip archive."
)
parser
.
add_argument
(
"-d"
,
"--dry"
,
action
=
'store_true'
,
help
=
"Flag for dry run."
)
parser
.
add_argument
(
...
...
@@ -115,6 +109,9 @@ Processing {} students'''.format(num_students))
allfiles
=
os
.
listdir
(
infolder
)
allfiles
.
sort
()
allpdfs
=
[]
if
(
len
(
allfiles
)
==
0
):
print
(
""" There are no PDFs in the given directory. Exiting now."""
)
return
for
f
in
allfiles
:
if
f
.
lower
().
endswith
(
'.pdf'
)
and
matnum_utils
.
starts_with_matnum
(
f
):
allpdfs
.
append
(
f
)
...
...
Bewertungen.csv
→
tests/assets/
Bewertungen.csv
View file @
491880ae
File moved
moodle_feedbacks.zip
→
tests/assets/
moodle_feedbacks.zip
View file @
491880ae
File moved
pdf
s/.gitkeep
→
tests/assets/scan
s/.gitkeep
View file @
491880ae
File moved
pdf
s/123456_Nachname.pdf
→
tests/assets/scan
s/123456_Nachname.pdf
100755 → 100644
View file @
491880ae
File moved
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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