Skip to content

Append LMS Name to duplicate assignment names in dropdown - #602

Merged
cycomachead merged 1 commit into
mainfrom
cycomachead/276-append-lms-name-duplicate-assignments/1
Sep 28, 2026
Merged

cycomachead merged 1 commit into
mainfrom
cycomachead/276-append-lms-name-duplicate-assignments/1

Conversation

@cycomachead

Copy link
Copy Markdown
Contributor

General Info

Changes

When an assignment name exists more than once in a course (e.g. the same "Homework 1" synced from both Canvas and Gradescope), the assignment dropdown now appends the LMS name in brackets so students and instructors can tell them apart (Homework 1 [Canvas] / Homework 1 [Gradescope]). Unique assignment names are unchanged.

Key changes:

  • Course#duplicate_assignment_names returns the set of names shared by more than one enabled assignment in the course. Duplicates are detected across all enabled assignments, not just the options currently shown in a given dropdown, so hiding one duplicate (e.g. because it has a pending request) doesn't cause the remaining one to lose its suffix.
  • RequestsHelper#assignment_option_label builds the option label, appending [LMS Name] only when needed.
  • RequestsHelper#assignment_select_options builds the full option list (including the due-date data attributes used by the Stimulus extension-form controller), replacing duplicated inline logic that existed in two views.
  • Updated the student form (new.html.erb), the instructor on-behalf-of form (new_for_student.html.erb), and the edit form (edit.html.erb) to use the new helpers. The edit form retains its existing date format and only swaps in the new label logic.

Note: the LMS suffix uses the lms_name column on the Lms record (set to "Canvas" by the boot initializer), whereas an existing assignment link helper elsewhere hardcodes "bCourses" for the same LMS. Flagging in case reviewers want consistent naming — it's a one-line change if so.

Testing

  • Added specs covering:
    • Course#duplicate_assignment_names (model spec)
    • RequestsHelper#assignment_option_label and #assignment_select_options (new helper spec)
    • Rendered student and instructor dropdowns with duplicated assignment names (controller spec)
  • All affected spec files pass (125 examples, no failures). RuboCop reports no offenses on changed files.
  • Manually verified via Cucumber's features/requests.feature: all 6 non-JavaScript scenarios pass (these select assignments by name through the affected forms). The 2 @javascript scenarios could not be exercised due to an unrelated chromedriver/libnspr4.so environment issue in the sandbox, unrelated to this change.

Documentation

No documentation updates required — this is a UI/display-only change.

Checklist

  • Name of branch corresponds to story

Superconductor Ticket Implementation | App Preview | Guided Review

Add course and helper logic to detect assignments with duplicate names across enabled sources (e.g., Canvas and Gradescope) and append the LMS name in brackets to disambiguate them in student and instructor selection dropdowns.

https://www.superconductor.com/tickets/zMjTDWpbTP6r/implementations/rqcg9Nt9dpDz?message_id=DDBrHnmJ8b7j#message_DDBrHnmJ8b7j

Co-authored-by: Claude Code <noreply@anthropic.com>
@cycomachead
cycomachead merged commit 98f8ac7 into main Sep 28, 2026
15 checks passed
@cycomachead
cycomachead deleted the cycomachead/276-append-lms-name-duplicate-assignments/1 branch September 28, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant