Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
unitgrade_private
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
unitgrade_private
Commits
c8692015
Commit
c8692015
authored
1 year ago
by
tuhe
Browse files
Options
Downloads
Patches
Plain Diff
Changes to evaluation code
parent
678051eb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/unitgrade_private/pipelines/dtulearn.py
+2
-1
2 additions, 1 deletion
src/unitgrade_private/pipelines/dtulearn.py
src/unitgrade_private/plagiarism/mossit.py
+21
-3
21 additions, 3 deletions
src/unitgrade_private/plagiarism/mossit.py
with
23 additions
and
4 deletions
src/unitgrade_private/pipelines/dtulearn.py
+
2
−
1
View file @
c8692015
...
...
@@ -736,7 +736,8 @@ def docker_stagewise_evaluation(base_directory, Dockerfile=None, instructor_grad
if
plagiarism_check
and
True
:
from
unitgrade_private.plagiarism.mossit
import
moss_it2023
moss_it2023
(
submissions_base_dir
=
stage4_dir
,
submissions_pattern
=
"
*-token
"
,
instructor_grade_script
=
instructor_grade_script
)
moss_it2023
(
submissions_base_dir
=
stage4_dir
,
submissions_pattern
=
"
*-token
"
,
instructor_grade_script
=
instructor_grade_script
,
student_files_dir
=
student_handout_folder
)
if
plagiarism_check
and
False
:
# This check is based on detector and is deprecated. I don't like detector.
from
coursebox.core.info_paths
import
get_paths
...
...
This diff is collapsed.
Click to expand it.
src/unitgrade_private/plagiarism/mossit.py
+
21
−
3
View file @
c8692015
...
...
@@ -56,7 +56,9 @@ def get_id(moss_pl):
pl
=
[
line
for
line
in
f
.
read
().
splitlines
()
if
"
$userid=
"
in
line
].
pop
()
return
pl
.
split
(
"
=
"
)[
1
][:
-
1
]
def
moss_it2023
(
submissions_base_dir
=
None
,
submissions_pattern
=
"
*-token
"
,
whitelisted_tokens
=
""
,
instructor_grade_script
=
None
,
moss_id
=
None
):
def
moss_it2023
(
submissions_base_dir
=
None
,
submissions_pattern
=
"
*-token
"
,
whitelisted_tokens
=
""
,
instructor_grade_script
=
None
,
moss_id
=
None
,
student_files_dir
=
None
):
a
=
234
# submissions_base_dir = stage4_dir
...
...
@@ -66,12 +68,16 @@ def moss_it2023(submissions_base_dir=None, submissions_pattern="*-token", whitel
working_dir
=
os
.
path
.
dirname
(
submissions_base_dir
)
+
"
/moss
"
if
not
os
.
path
.
isdir
(
working_dir
):
os
.
makedirs
(
working_dir
)
handout_dir
=
working_dir
+
"
/handouts
"
if
not
os
.
path
.
isdir
(
working_dir
+
"
/handouts
"
):
#
handout_dir = working_dir + "/handouts"
if
not
os
.
path
.
isdir
(
handout_dir
:
=
working_dir
+
"
/handouts
"
):
os
.
makedirs
(
working_dir
+
"
/handouts
"
)
print
(
"
Put reference files (handouts) in the directory
"
,
handout_dir
)
from
unitgrade_private.token_loader
import
get_coverage_files
from
coursebox
import
get_paths
paths
=
get_paths
()
student_files_dir
=
paths
[
'
02450students
'
]
cov_files
=
None
for
f
in
glob
.
glob
(
submissions_base_dir
+
"
/
"
+
submissions_pattern
):
if
os
.
path
.
isdir
(
f
):
...
...
@@ -95,6 +101,18 @@ def moss_it2023(submissions_base_dir=None, submissions_pattern="*-token", whitel
for
g
in
i
:
if
os
.
path
.
isfile
(
student_file
:
=
f
"
{
tmpdirname
}
/
{
g
}
"
):
shutil
.
copy
(
student_file
,
f
"
{
sdir
}
/
{
os
.
path
.
basename
(
g
)
}
"
)
if
student_files_dir
is
not
None
:
for
q
in
cov_files
:
for
item
in
cov_files
[
q
]:
for
file
in
cov_files
[
q
][
item
]:
if
len
(
all_files
:
=
glob
.
glob
(
student_files_dir
+
"
/**/
"
+
file
,
recursive
=
True
))
>
0
:
ff
=
all_files
[
0
]
shutil
.
copy
(
ff
,
handout_dir
+
"
/
"
+
os
.
path
.
basename
(
ff
))
else
:
print
(
"
Moss warning> Student file not found. Probably you cahnged the file names of the handout. Skipping.
"
,
file
)
# Now submit it to moss.
import
mosspy
...
...
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