ProFormA: Hide 'delayed' files by default
This commit is contained in:
@ -86,7 +86,7 @@ module ProformaService
|
|||||||
codeocean_file = CodeOcean::File.new(
|
codeocean_file = CodeOcean::File.new(
|
||||||
context: @exercise,
|
context: @exercise,
|
||||||
file_type: file_type(extension),
|
file_type: file_type(extension),
|
||||||
hidden: file.visible == 'no',
|
hidden: file.visible != 'yes', # hides 'delayed' and 'no'
|
||||||
name: File.basename(file.filename, '.*'),
|
name: File.basename(file.filename, '.*'),
|
||||||
read_only: file.usage_by_lms != 'edit',
|
read_only: file.usage_by_lms != 'edit',
|
||||||
role: @task.meta_data[:CodeOcean]&.dig(:files)&.dig("CO-#{file.id}".to_sym)&.dig(:role),
|
role: @task.meta_data[:CodeOcean]&.dig(:files)&.dig("CO-#{file.id}".to_sym)&.dig(:role),
|
||||||
|
@ -472,7 +472,7 @@ describe ProformaService::ConvertTaskToExercise do
|
|||||||
content: 'ms-content',
|
content: 'ms-content',
|
||||||
filename: 'filename.txt',
|
filename: 'filename.txt',
|
||||||
used_by_grader: 'used_by_grader',
|
used_by_grader: 'used_by_grader',
|
||||||
visible: 'yes',
|
visible: 'delayed',
|
||||||
usage_by_lms: 'display',
|
usage_by_lms: 'display',
|
||||||
binary: false,
|
binary: false,
|
||||||
internal_description: 'reference_implementation'
|
internal_description: 'reference_implementation'
|
||||||
@ -483,9 +483,9 @@ describe ProformaService::ConvertTaskToExercise do
|
|||||||
expect(convert_to_exercise_service).to have_attributes(
|
expect(convert_to_exercise_service).to have_attributes(
|
||||||
id: exercise.id,
|
id: exercise.id,
|
||||||
files: have(3).items
|
files: have(3).items
|
||||||
.and(include(have_attributes(content: 'ms-content', role: 'reference_implementation')))
|
.and(include(have_attributes(content: 'ms-content', role: 'reference_implementation', hidden: true)))
|
||||||
.and(include(have_attributes(content: 'content', role: 'regular_file')))
|
.and(include(have_attributes(content: 'content', role: 'regular_file', hidden: false)))
|
||||||
.and(include(have_attributes(content: 'testfile-content', role: 'teacher_defined_test')))
|
.and(include(have_attributes(content: 'testfile-content', role: 'teacher_defined_test', hidden: true)))
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user