Skip to content

Commit

Permalink
Improve file filtering for submission execution
Browse files Browse the repository at this point in the history
Previously, many different executions got all files despite not necessary needed. We now extend the file filtering to apply for submit actions, remote evaluations and test executions, too.
  • Loading branch information
MrSerth committed Oct 15, 2024
1 parent 679ab3e commit 57a8058
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/models/submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,16 @@ def prepared_runner
files = collect_files

case cause
when 'run'
files.reject!(&:reference_implementation?)
files.reject!(&:teacher_defined_assessment?)
when 'assess'
when 'run', 'test'
files.reject! do |file|
next true if file.reference_implementation?
# Only remove teacher-defined assessments if they are hidden.
# Otherwise, 'test' might fail if a teacher-defined assessment is executed.
next true if file.teacher_defined_assessment? && file.hidden?

next false
end
when 'assess', 'submit', 'remoteAssess', 'remoteSubmit'
regular_filepaths = files.reject(&:reference_implementation?).map(&:filepath)
files.reject! {|file| file.reference_implementation? && regular_filepaths.include?(file.filepath) }
end
Expand Down

0 comments on commit 57a8058

Please sign in to comment.