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
57cf8d45
Commit
57cf8d45
authored
9 months ago
by
tuhe
Browse files
Options
Downloads
Patches
Plain Diff
Minor updates for grading in 02465
parent
f0ea3c94
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
src/coursebox/core/info.py
+1
-0
1 addition, 0 deletions
src/coursebox/core/info.py
src/coursebox/core/projects.py
+42
-1
42 additions, 1 deletion
src/coursebox/core/projects.py
src/coursebox/core/projects_info.py
+5
-0
5 additions, 0 deletions
src/coursebox/core/projects_info.py
with
48 additions
and
1 deletion
src/coursebox/core/info.py
+
1
−
0
View file @
57cf8d45
...
...
@@ -60,6 +60,7 @@ def xlsx_to_dicts(xlsx_file,sheet=None, as_dict_list=False, columns=None):
return
dd
def
get_enrolled_students
():
# s224202
paths
=
get_paths
()
students
=
xlsx_to_dicts
(
paths
[
'
information.xlsx
'
],
sheet
=
'
students
'
)
students2
=
{}
...
...
This diff is collapsed.
Click to expand it.
src/coursebox/core/projects.py
+
42
−
1
View file @
57cf8d45
...
...
@@ -119,6 +119,10 @@ def handle_projects(verbose=False, gather_main_xlsx_file=True, plagiarism_check=
print
(
"
> Done gathering main .xlsx file from instructor .xlsx files
"
)
cache_update_dir
(
cache_base
,
cache_base
,
pattern
=
"
*.xlsx
"
)
info
=
class_information
()
id
=
'
s225785
'
pid
=
1
print
(
info
[
'
students
'
][
id
][
'
reports
'
][
pid
])
zip1
=
instructor_path
+
"
/zip1.zip
"
zip2
=
instructor_path
+
"
/zip2.zip
"
...
...
@@ -147,7 +151,7 @@ def handle_projects(verbose=False, gather_main_xlsx_file=True, plagiarism_check=
else
:
print
(
"
When available, please move downloaded copy of all reports from campusnet to destination:
"
)
print
(
zf
)
info
[
'
students
'
][
'
s225785
'
][
'
reports
'
][
1
]
mkboxplots
(
info
[
'
students
'
],
paths
)
if
cache_changed_xlsx_files
:
...
...
@@ -666,13 +670,50 @@ def gather_instructor_sheets(info):
ts
.
save
(
out
)
ts
.
close
()
print
(
"
Collected xlsx instructor files. Using xlwings to load main worksheet, evaluate and save it
"
)
# 024
import
xlwings
try
:
# def main() -> None:
# info = class_information()
# id = 's225785'
# pid = 1
# print(info['students'][id]['reports'][pid])
# shutil.run( )
# from ooodev.loader.lo import Lo
# from ooodev.office.calc import Calc
#
# # fnm = sys.argv[1:] # get file from first args
# fnm = out
#
# loader = Lo.load_office(Lo.ConnectSocket(headless=True))
# doc = Lo.open_doc(fnm=fnm, loader=loader)
#
# # use the Office API to manipulate doc...
# Lo.save_doc(doc, out) # save as a Word file
# Lo.close_doc(doc)
# Lo.close_office()
book
=
xw
.
Book
(
out
)
book
.
save
(
out
)
book
.
close
()
except
xlwings
.
XlwingsError
as
e
:
print
(
"
No xlsxwings installed. Sheets are not correctly evaluated.
"
)
# import shutil
import
subprocess
cmd
=
f
'
cd
{
os
.
path
.
basename
(
out
)
}
&& libreoffice --calc --headless --invisible --convert-to xlsx --outdir ../
{
os
.
path
.
basename
(
out
)
}
'
output
=
subprocess
.
run
(
cmd
,
capture_output
=
True
,
shell
=
True
)
time
.
sleep
(
3
)
od
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
out
))
+
"
/
"
+
os
.
path
.
basename
(
out
)
while
not
os
.
path
.
isfile
(
od
):
time
.
sleep
(
1
)
print
(
"
Waiting for file
"
,
od
)
shutil
.
move
(
od
,
out
)
print
(
e
)
...
...
This diff is collapsed.
Click to expand it.
src/coursebox/core/projects_info.py
+
5
−
0
View file @
57cf8d45
...
...
@@ -287,7 +287,12 @@ def populate_student_report_results(students, verbose=False):
# for i in range(2, wb.worksheets[repn].max_column + 1):
# print(i, wb.worksheets[repn].max_column)
# s = pd.read_excel(out, sheet_name=1)
cp
=
parse_column_numpy
(
sheet
[:,
i
],
report_number
=
repn
,
column
=
i
)
if
repn
==
1
and
1
>
2
:
# info['students']['s225785']['reports'][1]
pass
# cp = parse_column(wb.worksheets[repn], report_number=repn, column=i)
if
not
cp
[
'
student_ids
'
]:
break
...
...
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