File tree 1 file changed +8
-3
lines changed
app/routines/exercises/import
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:)
55
55
detailed_solution_index ||= headers . index { |header | header &.end_with? ( 'solution' ) }
56
56
raise ArgumentError , 'Could not find "Detailed Solution" column' if detailed_solution_index . nil?
57
57
58
- exercise = Exercise . new
58
+ row_number = row_index + 1
59
59
60
60
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
+
61
68
exercise . tags = [
62
69
"assessment:#{ row [ pre_or_post_index ] . downcase == 'pre' ? 'preparedness' : 'practice'
63
70
} :https://openstax.org/orn/book:page/#{ book_uuid } :#{ page_uuid } ",
@@ -93,8 +100,6 @@ def exec(filename:, book_uuid:)
93
100
question . collaborator_solutions << solution
94
101
end
95
102
96
- row_number = row_index + 1
97
-
98
103
begin
99
104
exercise . save!
100
105
exercise . publication . publish . save!
You can’t perform that action at this time.
0 commit comments