Skip to content

Added term-based suffixes to course names created via LTI to ensure uniqueness across academic years#7881

Open
donny-wong wants to merge 2 commits intoMarkUsProject:masterfrom
donny-wong:canvas_course_name_with_term_suffix
Open

Added term-based suffixes to course names created via LTI to ensure uniqueness across academic years#7881
donny-wong wants to merge 2 commits intoMarkUsProject:masterfrom
donny-wong:canvas_course_name_with_term_suffix

Conversation

@donny-wong
Copy link
Copy Markdown
Contributor

@donny-wong donny-wong commented Mar 27, 2026

Proposed Changes

(Describe your changes here. Also describe the motivation for your changes: what problem do they solve, or how do they improve the application or codebase? If this pull request fixes an open issue, use a keyword to link this pull request to the issue.)

Currently, courses created via Canvas lack a term identifier, leading to potential duplicates in future years. This change integrates the Canvas.term.name parameter as a suffix to the MarkUs course name. This ensures each term’s deployment remains unique and correctly categorized within the database.

Potential Term patterns from Canvas:

  • 2026 Winter
  • 2026 Fall
  • 2026 Fall-Winter
  • 2026 Summer
  • SCS Fall - 2026
  • SCS Spring/Summer - 2026
  • SCS Winter - 2026
  • Default Term
  • SCS Winter - 18
Screenshots of your changes (if applicable)
Associated documentation repository pull request (if applicable)

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue) x
🎨 User interface change (change to user interface; provide screenshots)
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

Checklist

(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the [ ] into a [x] in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have updated the project Changelog (this is required for all changes).
  • I have verified that the pre-commit.ci checks have passed.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

Questions and Comments

(Include any questions or comments you have regarding your changes.)

@donny-wong donny-wong changed the title add term suffix when creating course name via Canvas Added term-based suffixes to course names created via LTI to ensure uniqueness across academic years Mar 27, 2026
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Mar 27, 2026

Coverage Report for CI Build 24087247980

Coverage increased (+0.005%) to 91.714%

Details

  • Coverage increased (+0.005%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (56 of 57 lines covered, 98.25%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
app/controllers/lti_deployments_controller.rb 20 19 95.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 48494
Covered Lines: 45217
Line Coverage: 93.24%
Relevant Branches: 1844
Covered Branches: 950
Branch Coverage: 51.52%
Branches in Coverage %: Yes
Coverage Strength: 130.63 hits per line

💛 - Coveralls

@donny-wong donny-wong requested a review from Naragod March 27, 2026 17:09
@donny-wong donny-wong added this to the v2.9.6 milestone Mar 27, 2026
Copy link
Copy Markdown
Contributor

@Naragod Naragod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Once the branch is updated to the latest version the PR will be golden.

@donny-wong donny-wong force-pushed the canvas_course_name_with_term_suffix branch from eb994e0 to 1262f73 Compare March 31, 2026 15:28
@donny-wong donny-wong requested a review from david-yz-liu March 31, 2026 15:59
Comment thread Changelog.md Outdated
render 'message', status: :forbidden
return
end

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this change

# Define default URL options to not include locale
def default_url_options(_options = {})
{}
def get_course_suffix(term_string)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic here looks good, but this is quite specific to how Canvas is being deployed at our institution.

Let's make this a more customizable approach by extracting this logic into a separate function in the same way we currently handle the course whitelisting. Specifically, we currently have a setting called course_filter_file, which defines a module LtiConfig. Let's rename the setting to something more general like adapter_file and then define a new method in there.

Simultaneously, I think it's too restrictive to only allow suffixes to be added. Rather, let's have this method take in an lti_deployment argument and return a string for the name. This will allow further customization of the course name.

Finally, after reviewing the course names on Quercus more carefully, I now believe that the most appropriate short identifier (for UofT) should follow the format "CSC108H1F 20259". In particular, the course code should show the full "H1F" part, and the term should be in the five-digit format 20259. This will make these identifiers consistent with what appears to students on Quercus and other systems.

@donny-wong donny-wong modified the milestones: v2.9.6, v2.9.7 Apr 6, 2026
@donny-wong donny-wong force-pushed the canvas_course_name_with_term_suffix branch from 1262f73 to 797da0c Compare April 7, 2026 14:38
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.

Potential Course name duplication on MarkUs - Quercus Integration issue

4 participants