Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
coursebox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tuhe
coursebox
Commits
e529d5b6
Commit
e529d5b6
authored
3 years ago
by
tuhe
Browse files
Options
Downloads
Patches
Plain Diff
Updates for 02465; confirmed to work with 02450 (CE material); uploading v. 0.1.6.
parent
e19bb48a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
setup.py
+1
-1
1 addition, 1 deletion
setup.py
src/coursebox.egg-info/PKG-INFO
+1
-1
1 addition, 1 deletion
src/coursebox.egg-info/PKG-INFO
src/coursebox/core/projects.py
+25
-4
25 additions, 4 deletions
src/coursebox/core/projects.py
with
27 additions
and
6 deletions
setup.py
+
1
−
1
View file @
e529d5b6
...
...
@@ -11,7 +11,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
# beamer-slider
setuptools
.
setup
(
name
=
"
coursebox
"
,
version
=
"
0.1.
4
"
,
version
=
"
0.1.
6
"
,
author
=
"
Tue Herlau
"
,
author_email
=
"
tuhe@dtu.dk
"
,
description
=
"
A course management system currently used at DTU
"
,
...
...
This diff is collapsed.
Click to expand it.
src/coursebox.egg-info/PKG-INFO
+
1
−
1
View file @
e529d5b6
Metadata-Version: 2.1
Name: coursebox
Version: 0.1.
4
Version: 0.1.
5
Summary: A course management system currently used at DTU
Home-page: https://lab.compute.dtu.dk/tuhe/coursebox
Author: Tue Herlau
...
...
This diff is collapsed.
Click to expand it.
src/coursebox/core/projects.py
+
25
−
4
View file @
e529d5b6
...
...
@@ -24,9 +24,8 @@ from jinjafy.plot.plot_helpers import get_colors
import
time
from
collections
import
defaultdict
import
zipfile
import
hashlib
import
pandas
as
pd
from
slider.slide
import
recursive_tex_collect
def
get_dirs
(
zf
):
zip
=
zipfile
.
ZipFile
(
zf
)
...
...
@@ -317,6 +316,11 @@ def get_groups_from_learn_xslx_file(paths, sheet_number):
all_groups
=
[{
'
group_id
'
:
id
,
'
student_ids
'
:
students
}
for
id
,
students
in
dg
.
items
()]
return
all_groups
def
group_id_from_file
(
file
):
id
=
int
(
os
.
path
.
dirname
(
file
).
split
(
"
-
"
)[
1
].
split
(
"
"
)[
1
])
return
id
def
search_projects
(
paths
,
sheet_number
,
patterns
):
zip_files
=
[
paths
[
'
instructor_project_evaluations
'
]
+
"
/zip%d.zip
"
%
sheet_number
]
# print(zip_files)
...
...
@@ -327,11 +331,28 @@ def search_projects(paths, sheet_number, patterns):
if
os
.
path
.
exists
(
zip_file
):
tmpdir
=
tempfile
.
TemporaryDirectory
()
zipfile
.
ZipFile
(
zip_file
).
extractall
(
path
=
tmpdir
.
name
)
# Read from PDF files:
pdfs
=
glob
.
glob
(
tmpdir
.
name
+
"
/**/*.pdf
"
,
recursive
=
True
)
for
pdf
in
pdfs
:
pdf_parsed
=
tika
.
parser
.
from_file
(
pdf
)
id
=
int
(
os
.
path
.
dirname
(
pdf
).
split
(
"
-
"
)[
1
].
split
(
"
"
)[
1
])
students
=
re
.
findall
(
'
s\d\d\d\d\d\d
'
,
pdf_parsed
[
'
content
'
],
flags
=
re
.
IGNORECASE
)
id
=
group_id_from_file
(
pdf
)
# int(os.path.dirname(pdf).split(" - ")[1].split(" ")[1])
if
pdf_parsed
[
'
content
'
]
is
None
:
students
=
[]
print
(
"
> Finding student ID. Warning: The pdf file
"
,
pdf
,
"
appers to have no text content.
"
)
else
:
students
=
re
.
findall
(
'
s\d\d\d\d\d\d
'
,
pdf_parsed
[
'
content
'
],
flags
=
re
.
IGNORECASE
)
gps
[
id
]
+=
students
# Collect from .tex files:
# recursive_tex_collect()
texs
=
glob
.
glob
(
tmpdir
.
name
+
"
/**/*.tex
"
,
recursive
=
True
)
for
tex
in
texs
:
id
=
group_id_from_file
(
tex
)
tex_parsed
=
recursive_tex_collect
(
tex
)
tex_parsed
=
"
\n
"
.
join
([(
l
[:
l
.
find
(
"
%
"
)]
if
"
%
"
in
l
else
l
)
for
l
in
tex_parsed
.
splitlines
()])
students
=
re
.
findall
(
'
s\d\d\d\d\d\d
'
,
tex_parsed
,
flags
=
re
.
IGNORECASE
)
gps
[
id
]
+=
students
for
id
,
students
in
gps
.
items
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment