File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
app/routines/exercises/import Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -55,9 +55,16 @@ def exec(filename:, book_uuid:)
5555 detailed_solution_index ||= headers . index { |header | header &.end_with? ( 'solution' ) }
5656 raise ArgumentError , 'Could not find "Detailed Solution" column' if detailed_solution_index . nil?
5757
58- exercise = Exercise . new
58+ row_number = row_index + 1
5959
6060 page_uuid = row [ uuid_index ]
61+ if page_uuid . blank?
62+ Rails . logger . info { "Skipped row ##{ row_number } with blank page UUID" }
63+ next
64+ end
65+
66+ exercise = Exercise . new
67+
6168 exercise . tags = [
6269 "assessment:#{ row [ pre_or_post_index ] . downcase == 'pre' ? 'preparedness' : 'practice'
6370 } :https://openstax.org/orn/book:page/#{ book_uuid } :#{ page_uuid } ",
@@ -93,8 +100,6 @@ def exec(filename:, book_uuid:)
93100 question . collaborator_solutions << solution
94101 end
95102
96- row_number = row_index + 1
97-
98103 begin
99104 exercise . save!
100105 exercise . publication . publish . save!
You can’t perform that action at this time.
0 commit comments