Skip to content

Commit

Permalink
fix: reorder columns for csv export
Browse files Browse the repository at this point in the history
  • Loading branch information
satikaj committed Jul 2, 2024
1 parent c5240d8 commit 5db5f35
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/models/task_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20240322021829_add_scorm_config_to_task_def.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion test/models/task_definition_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5db5f35

Please sign in to comment.