However, the option visible: false is invalid, since visible is a string (no boolean) with fixed values (according to the ProFormA standard). When saved in the database, the boolean false is saved as f.
When downloading such a task as ProFormA ZIP file, the following error is raised:
ProformaXML::PostGenerateValidationError at /tasks/59/download
[#<Nokogiri::XML::SyntaxError: 281:0: ERROR: Element '{urn:proforma:v2.1}file', attribute 'visible': [facet 'enumeration'] The value 'f' is not an element of the set {'yes', 'no', 'delayed'}.>]
We should:
fix the error in the unit test generation
add a validation to the filed
test the behavior
(maybe) write a migration to resolve invalid values in our production database
The
GptService::GenerateTests
currently creates test files as follows:https://github.com/openHPI/codeharbor/blob/992aeab7e085e286b48cf4d5710e467617af2fd3/app/services/gpt_service/generate_tests.rb#L16
However, the option
visible: false
is invalid, sincevisible
is a string (no boolean) with fixed values (according to the ProFormA standard). When saved in the database, the booleanfalse
is saved asf
.When downloading such a task as ProFormA ZIP file, the following error is raised:
We should: