Skip to content

feat: add display average to students toggle - #8243

Open
AngelsandDevsLOL wants to merge 4 commits into
MarkUsProject:masterfrom
AngelsandDevsLOL:feat/add-display-average-to-students-toggle
Open

AngelsandDevsLOL wants to merge 4 commits into
MarkUsProject:masterfrom
AngelsandDevsLOL:feat/add-display-average-to-students-toggle

Conversation

@AngelsandDevsLOL

@AngelsandDevsLOL AngelsandDevsLOL commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Proposed Changes

Introduces a new Display average to students toggle, similar to the current Display median to students toggle when an instructors edits an assignment in the settings. This PR creates a migration and creates a new column within the AssignmentProperties table, called DisplayAverageToStudents. This is similar to the current DisplayMedianToStudents column, where averages and medians are not displayed by default.

When a student views their grade summary, they will see the average only if the toggle is on (and the grades are released).

Screenshots of your changes (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) X
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 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)
📖 Documentation update (change that updates documentation)
🔧 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.
  • [N/A] 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

@AngelsandDevsLOL
AngelsandDevsLOL marked this pull request as ready for review October 29, 2026 02:39
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 40810246972

Coverage increased (+0.001%) to 91.064%

Details

  • Coverage increased (+0.001%) from the base build.
  • Patch coverage: 12 of 12 lines across 5 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 54148
Covered Lines: 50357
Line Coverage: 93.0%
Relevant Branches: 2569
Covered Branches: 1292
Branch Coverage: 50.29%
Branches in Coverage %: Yes
Coverage Strength: 127.42 hits per line

💛 - Coveralls

@@ -0,0 +1,5 @@
class AddDisplayAverageToStudentsToAssignmentProperties < ActiveRecord::Migration[8.1]
def change
add_column :assignment_properties, :display_average_to_students, :boolean, default: false, null: false

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.

I realized that it's better to make the default true here to preserve backwards compatibility (as the assignment average is currently shown by default). Please rollback this migration, edit the file, then redo the migration.

end

def display_average_to_students
false

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.

Similar to my comment below, please make this true (as it affects grade entry forms, which show the average by default)

Comment thread app/models/assignment.rb
:enable_student_tests, :allow_remarks,
:display_grader_names_to_students,
:display_median_to_students, :group_name_autogenerated,
:display_average_to_students, :display_median_to_students, :group_name_autogenerated,

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.

I'd like to avoid backwards compatibility issues with CSV upload prior to this change, so please add this new field to the end of the list (affects Course#upload_assignment_list)

@david-yz-liu

Copy link
Copy Markdown
Collaborator

Oh and @AngelsandDevsLOL please also add a screenshot showing the UI changes for the instructor (assignment form) and students (with the different boolean options for this setting)

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.

3 participants