add hidden_feedback to custom CodeOcean test-attributes

This commit is contained in:
Karol
2023-11-16 23:12:13 +01:00
committed by Sebastian Serth
parent 122580b220
commit 1e08f2cc9c
4 changed files with 12 additions and 4 deletions

View File

@ -214,7 +214,7 @@ RSpec.describe ProformaService::ConvertExerciseToTask do
context 'when exercise has a test' do
let(:tests) { [test_file] }
let(:test_file) { build(:test_file) }
let(:test_file) { build(:test_file, hidden_feedback: true) }
# let(:file) { FactoryBot.build(:codeharbor_test_file) }
it 'creates a task with one test' do
@ -229,7 +229,8 @@ RSpec.describe ProformaService::ConvertExerciseToTask do
meta_data: a_hash_including(
'test-meta-data' => a_hash_including(
'CodeOcean:feedback-message' => {'$1' => 'feedback_message', '@@order' => ['$1']},
'CodeOcean:weight' => {'$1' => test_file.weight, '@@order' => ['$1']}
'CodeOcean:weight' => {'$1' => test_file.weight, '@@order' => ['$1']},
'CodeOcean:hidden-feedback' => {'$1' => test_file.hidden_feedback, '@@order' => ['$1']}
)
)
)

View File

@ -361,9 +361,10 @@ RSpec.describe ProformaService::ConvertTaskToExercise do
files: test_files,
meta_data: {
'test-meta-data' => {
'@@order' => %w[CodeOcean:feedback-message CodeOcean:weight],
'@@order' => %w[CodeOcean:feedback-message CodeOcean:weight CodeOcean:hidden-feedback],
'CodeOcean:feedback-message' => {'$1' => 'feedback-message', '@@order' => ['$1']},
'CodeOcean:weight' => {'$1' => '0.7', '@@order' => ['$1']},
'CodeOcean:hidden-feedback' => {'$1' => 'true', '@@order' => ['$1']},
},
}
)
@ -396,6 +397,7 @@ RSpec.describe ProformaService::ConvertTaskToExercise do
role: 'teacher_defined_test',
hidden: true,
read_only: true,
hidden_feedback: true,
file_type: be_a(FileType).and(have_attributes(file_extension: '.txt'))
)
end