Skip to content

Commit 57a8058

Browse files
committed
Improve file filtering for submission execution
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.
1 parent 679ab3e commit 57a8058

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

app/models/submission.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,16 @@ def prepared_runner
218218
files = collect_files
219219

220220
case cause
221-
when 'run'
222-
files.reject!(&:reference_implementation?)
223-
files.reject!(&:teacher_defined_assessment?)
224-
when 'assess'
221+
when 'run', 'test'
222+
files.reject! do |file|
223+
next true if file.reference_implementation?
224+
# Only remove teacher-defined assessments if they are hidden.
225+
# Otherwise, 'test' might fail if a teacher-defined assessment is executed.
226+
next true if file.teacher_defined_assessment? && file.hidden?
227+
228+
next false
229+
end
230+
when 'assess', 'submit', 'remoteAssess', 'remoteSubmit'
225231
regular_filepaths = files.reject(&:reference_implementation?).map(&:filepath)
226232
files.reject! {|file| file.reference_implementation? && regular_filepaths.include?(file.filepath) }
227233
end

0 commit comments

Comments
 (0)