Skip to content

Assignment summary v2#7559

Merged
david-yz-liu merged 34 commits intoMarkUsProject:masterfrom
chickenwaddle77:assignment-summary-v2
Jun 18, 2025
Merged

Assignment summary v2#7559
david-yz-liu merged 34 commits intoMarkUsProject:masterfrom
chickenwaddle77:assignment-summary-v2

Conversation

@chickenwaddle77
Copy link
Copy Markdown
Contributor

@chickenwaddle77 chickenwaddle77 commented Jun 6, 2025

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.)

Added the average annotations section in the bottom of Assignment Summary -> Summary Statistics.
This was done by creating a new JSX expression that used the function assignment.average_annotations.
AssignmentController is modified to call assignment.average_annotations and return that when fetched to the front-end.

Screenshots of your changes (if applicable) Screenshot 2025-06-11 at 13 51 47
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)
🎨 User interface change (change to user interface; provide screenshots) X
♻️ 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.)

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Jun 6, 2025

Pull Request Test Coverage Report for Build 15721616170

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 91.993%

Totals Coverage Status
Change from base Build 15711048853: 0.03%
Covered Lines: 41973
Relevant Lines: 44944

💛 - Coveralls

Copy link
Copy Markdown
Collaborator

@david-yz-liu david-yz-liu left a comment

Choose a reason for hiding this comment

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

@chickenwaddle77 you're definitely on the right track. I left one comment; but also, please add an additional sentence (in a new paragraph) in the section saying "For detailed information, see Annotations", where "Annotations" is a link to the assignment annotations tab.

let annotation_summary = (
<div className="distribution-graph">
<h3>{I18n.t("assignments.annotation_summary")}</h3>
<p>{I18n.t("assignments.average_annotations", {average_annotations: 2.75})}</p>
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.

This number should not be hard-coded

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry David, was debugging and forgot to make it dynamic 😂

@chickenwaddle77
Copy link
Copy Markdown
Contributor Author

@chickenwaddle77 you're definitely on the right track. I left one comment; but also, please add an additional sentence (in a new paragraph) in the section saying "For detailed information, see Annotations", where "Annotations" is a link to the assignment annotations tab.

@david-yz-liu Hi David, do you want me to put that as a key in en.yml and reference it or "hard code" it? Thank you!

<h3>{I18n.t("assignments.annotation_summary")}</h3>
<p>
{I18n.t("assignments.average_annotations", {
average_annotations: this.state.summary.average_annotations,
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.

This isn't quite going to work if the state is null; you can use || to set a default value of 0

---
en:
assignments:
annotation: Annotation
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.

You don't need to define a new key for this. Instead, you can use the existing key found in models/annotations/en.yml, which is also what the menu label uses. Use the plural form.

@david-yz-liu
Copy link
Copy Markdown
Collaborator

Hi @chickenwaddle77, one other comment. Because I've now merged in #7560, you'll need to do a merge from upstream/master, and then also add back in the localized string for displaying the average number of annotations (see the "Files Changed" tab of that PR to see what was removed).

this.props.assessment_id
)}
>
{I18n.t("activerecord.models.annotation.one")}
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.

Use the plural form

Copy link
Copy Markdown
Collaborator

@david-yz-liu david-yz-liu left a comment

Choose a reason for hiding this comment

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

@chickenwaddle77 nice work 🎉

@david-yz-liu david-yz-liu merged commit f552595 into MarkUsProject:master Jun 18, 2025
6 checks passed
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