sul-dlss / course_reserves

rails app used by patrons looking up course reserve info and lib staff entering course reserve info
1 stars 1 forks source link

Removing duplicate instructors across meetings for same section #482

Closed hudajkhan closed 1 year ago

hudajkhan commented 1 year ago

If the XML for an individual course has the following hierarchy (the example omits other attributes and elements not related to this pull request):

"<CourseClass ...> <class> <section>
<meeting number="1"><instructor> <person sunet="123"></person></instructor></meeting>
<meeting number="2"><instructor> <person sunet="123"></person></instructor></meeting>
</section></class></CourseClass>"

We want the information returned to not duplicate instructor names. The xpath pattern that was being used to match against instructor names for the section returned the full list, which in this case would mean duplicating the instructor with sunet id "123". This code update only keeps a unique set of sunet ids and related names for each section, and returns them in the information for the section.

hudajkhan commented 1 year ago

Relates to https://github.com/sul-dlss/course_reserves/issues/410