diff --git a/app/models/task_definition.rb b/app/models/task_definition.rb index 59c798505..7debed36f 100644 --- a/app/models/task_definition.rb +++ b/app/models/task_definition.rb @@ -301,9 +301,9 @@ def to_csv_row def self.csv_columns [:name, :abbreviation, :description, :weighting, :target_grade, :restrict_status_updates, :max_quality_pts, - :is_graded, :plagiarism_warn_pct, :group_set, :upload_requirements, :scorm_enabled, :scorm_allow_review, - :scorm_bypass_test, :scorm_time_delay_enabled, :scorm_attempt_limit, :start_week, :start_day, :target_week, - :target_day, :due_week, :due_day, :tutorial_stream] + :is_graded, :plagiarism_warn_pct, :scorm_enabled, :scorm_allow_review, :scorm_bypass_test, :scorm_time_delay_enabled, + :scorm_attempt_limit, :group_set, :upload_requirements, :start_week, :start_day, :target_week, :target_day, + :due_week, :due_day, :tutorial_stream] end def self.task_def_for_csv_row(unit, row) diff --git a/db/migrate/20240322021829_add_scorm_config_to_task_def.rb b/db/migrate/20240322021829_add_scorm_config_to_task_def.rb index 99c7dcffb..04847cb9b 100644 --- a/db/migrate/20240322021829_add_scorm_config_to_task_def.rb +++ b/db/migrate/20240322021829_add_scorm_config_to_task_def.rb @@ -5,7 +5,7 @@ def change t.boolean :scorm_allow_review, default: false t.boolean :scorm_bypass_test, default: false t.boolean :scorm_time_delay_enabled, default: false - t.integer :scorm_attempt_limit + t.integer :scorm_attempt_limit, default: 0 end end diff --git a/db/schema.rb b/db/schema.rb index df555a8ef..d240af3af 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -257,7 +257,7 @@ t.boolean "scorm_allow_review", default: false t.boolean "scorm_bypass_test", default: false t.boolean "scorm_time_delay_enabled", default: false - t.integer "scorm_attempt_limit" + t.integer "scorm_attempt_limit", default: 0 t.index ["group_set_id"], name: "index_task_definitions_on_group_set_id" t.index ["overseer_image_id"], name: "index_task_definitions_on_overseer_image_id" t.index ["tutorial_stream_id"], name: "index_task_definitions_on_tutorial_stream_id" diff --git a/test/models/task_definition_test.rb b/test/models/task_definition_test.rb index a292cd1cd..d20634d8c 100644 --- a/test/models/task_definition_test.rb +++ b/test/models/task_definition_test.rb @@ -145,7 +145,7 @@ def test_export_task_definitions_csv task_defs_csv = CSV.parse unit.task_definitions_csv, headers: true task_defs_csv.each do |task_def_csv| task_def = unit.task_definitions.find_by(abbreviation: task_def_csv['abbreviation']) - keys_to_ignore = ['tutorial_stream', 'start_week', 'start_day', 'target_week', 'target_day', 'due_week', 'due_day', 'scorm_enabled', 'scorm_allow_review', 'scorm_bypass_test', 'scorm_time_delay_enabled', 'scorm_attempt_limit'] + keys_to_ignore = ['tutorial_stream', 'start_week', 'start_day', 'target_week', 'target_day', 'due_week', 'due_day'] task_def_csv.each do |key, value| unless keys_to_ignore.include?(key) assert_equal(task_def[key].to_s, value)