Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
CSCE 361
scripts
Commits
15adf237
Commit
15adf237
authored
4 years ago
by
Christopher Bohn
Browse files
Options
Downloads
Patches
Plain Diff
Fixed zero padding for cases when number of teams is divisible by 10
parent
558ce331
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
grade_team_contribution.py
+2
-1
2 additions, 1 deletion
grade_team_contribution.py
prep_assignment.py
+5
-5
5 additions, 5 deletions
prep_assignment.py
with
7 additions
and
6 deletions
grade_team_contribution.py
+
2
−
1
View file @
15adf237
...
...
@@ -171,7 +171,8 @@ if __name__ == '__main__':
if
option
is
options
[
1
]:
print
(
'
Which group?
'
)
student_groups
=
[
select_from_list
(
student_groups
,
'
student group
'
)]
zero_padding
:
int
=
ceil
(
log10
(
len
(
projects
)))
zero_padding
:
int
=
ceil
(
log10
(
len
(
projects
)))
# remove this after 24pair is graded
# zero_padding: int = floor(log10(len(projects))) + 1 # leaving this here until 24pair is graded
assignment_start_date
=
get_assignment_start
()
# TODO: only need this if grading git histories
for
student_group
in
student_groups
:
# TODO: Skip past graded groups
input
(
f
'
\n\n
Press Enter to grade
{
student_group
}
'
)
...
...
This diff is collapsed.
Click to expand it.
prep_assignment.py
+
5
−
5
View file @
15adf237
import
random
import
subprocess
from
math
import
ceil
,
log10
from
math
import
floor
,
log10
from
typing
import
Tuple
from
api.canvas_classes
import
*
from
api.gitlab_classes
import
*
from
api.composite_user
import
CompositeUser
from
api.gitlab_classes
import
*
from
common_functions
import
get_students
from
course
import
Course
...
...
@@ -210,7 +210,7 @@ def create_contact_list(groupset_name: str,
student_pairs
:
List
[
Tuple
[
int
,
CompositeUser
,
CompositeUser
,
Optional
[
CompositeUser
]]])
->
None
:
filename
=
f
'
{
groupset_name
}
-partners.md
'
print
(
f
'
Writing
{
filename
}
.
'
)
zero_padding
:
int
=
ceil
(
log10
(
len
(
student_pairs
)))
zero_padding
:
int
=
floor
(
log10
(
len
(
student_pairs
)))
+
1
with
open
(
filename
,
mode
=
'
w
'
)
as
pair_file
:
pair_file
.
write
(
f
'
# PARTNERS FOR ASSIGNMENT
{
groupset_name
}
\n\n
'
)
for
pair
in
student_pairs
:
...
...
@@ -225,7 +225,7 @@ def create_repositories(groupset_name: str,
student_pairs
:
List
[
Tuple
[
int
,
CompositeUser
,
CompositeUser
,
Optional
[
CompositeUser
]]])
->
None
:
filename
=
f
'
{
groupset_name
}
-clone.sh
'
print
(
f
'
Creating file for clone script:
{
filename
}
. Creating repositories on Gitlab.
'
)
zero_padding
:
int
=
ceil
(
log10
(
len
(
student_pairs
)))
zero_padding
:
int
=
floor
(
log10
(
len
(
student_pairs
)))
+
1
with
open
(
filename
,
mode
=
'
w
'
)
as
clone_file
:
clone_file
.
write
(
'
#!/bin/bash
\n\n
'
)
clone_file
.
write
(
'
# Auto-generated clone script.
\n
'
)
...
...
@@ -251,7 +251,7 @@ def create_groups(groupset_name: str,
print
(
f
'
Creating groupset
{
groupset_name
}
and student groups on Canvas.
'
)
course
=
CanvasCourse
(
Course
.
canvas_course_id
)
group_set
=
course
.
create_user_groupset
(
groupset_name
)
zero_padding
:
int
=
ceil
(
log10
(
len
(
student_pairs
)))
zero_padding
:
int
=
floor
(
log10
(
len
(
student_pairs
)))
+
1
for
pair
in
student_pairs
:
print
(
f
'
\t
Creating group for pair number
{
str
(
pair
[
0
]).
zfill
(
zero_padding
)
}
'
)
group
=
group_set
.
create_group
(
f
'
\t
{
groupset_name
}
{
str
(
pair
[
0
]).
zfill
(
zero_padding
)
}
'
)
...
...
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