@@ -15,9 +15,6 @@ class Assessments
15
15
def exec ( filename :, book_uuid :)
16
16
Rails . logger . info { "Filename: #{ filename } " }
17
17
18
- book = OpenStax ::Content ::Abl . new . books . find { |book | book . uuid == book_uuid }
19
- all_cnxmod_tags = book . all_pages . map { |page | "context-cnxmod:#{ page . uuid } " }
20
-
21
18
uuid_index = nil
22
19
pre_indices = nil
23
20
post_indices = nil
@@ -67,18 +64,11 @@ def exec(filename:, book_uuid:)
67
64
post_section_tag = "assessment:practice:https://openstax.org/orn/book:page/#{ book_uuid } :#{ page_uuid } "
68
65
cnxmod_tag = "context-cnxmod:#{ page_uuid } "
69
66
70
- # Normally pre-section exercises don't get cnxmod tags,
71
- # unless they have no cnxmod tags for the entire book
72
- pre_section_ex_with_cnxmod , pre_section_ex_missing_cnxmod = pre_section_exercises . partition do |ex |
73
- ex . tags . any? { |tag | all_cnxmod_tags . include? tag . name }
74
- end
75
-
76
67
row_number = row_index + 1
77
68
78
69
begin
79
70
tag pre_and_post_section_exercises , [ pre_section_tag , post_section_tag , cnxmod_tag ]
80
- tag pre_section_ex_with_cnxmod , [ pre_section_tag ]
81
- tag pre_section_ex_missing_cnxmod , [ pre_section_tag , cnxmod_tag ]
71
+ tag pre_section_exercises , [ pre_section_tag ]
82
72
tag post_section_exercises , [ post_section_tag , cnxmod_tag ]
83
73
rescue StandardError => se
84
74
Rails . logger . error { "Failed to import row ##{ row_number } - #{ se . message } " }
0 commit comments