Skip to content

Fix the reported Exam value by using the calculated value fixes #8776#8974

Merged
IllianiBird merged 3 commits into
MegaMek:mainfrom
AlexOldenburger:feature/fixExamPercentReporting
May 16, 2026
Merged

Fix the reported Exam value by using the calculated value fixes #8776#8974
IllianiBird merged 3 commits into
MegaMek:mainfrom
AlexOldenburger:feature/fixExamPercentReporting

Conversation

@AlexOldenburger

@AlexOldenburger AlexOldenburger commented May 15, 2026

Copy link
Copy Markdown
Collaborator

The Personel market shows an 'Exam %' column in the table with all personnel, while the detail pane of an individual person shows an 'Performance Exam' item. These two items refer to the same thing, but the values (almost) never match. The reason is that calculating the value involves a small random up-or-down modifier.

This PR fixes this by using the stored value of the calculation (which is used in the column) to feed to the detail pane, instead of calculating the value a second time.

fixes #8776

NOTE: PR #8909 fixes the seperate issue of the tooltip showing the wrong state that is also mentioned in #8776

@AlexOldenburger AlexOldenburger requested a review from a team as a code owner May 15, 2026 16:00
@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 13.95%. Comparing base (fc5f5e5) to head (3295264).
⚠️ Report is 82 commits behind head on main.

Files with missing lines Patch % Lines
...domEvents/personalities/PersonalityController.java 0.00% 1 Missing ⚠️
...gn/randomEvents/personalities/enums/Reasoning.java 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8974      +/-   ##
============================================
+ Coverage     13.81%   13.95%   +0.14%     
- Complexity     8186     8274      +88     
============================================
  Files          1284     1285       +1     
  Lines        167640   167941     +301     
  Branches      25323    25414      +91     
============================================
+ Hits          23157    23434     +277     
+ Misses       142153   142064      -89     
- Partials       2330     2443     +113     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a UI inconsistency in the personnel market personality/exam display by ensuring the “Performance Exam” detail text is generated from the already-stored exam score (used by the table’s “Exam %” column) instead of recalculating with a new random modifier.

Changes:

  • Update interview notes generation to format exam results using Person.getPerformanceExamScore() (stored value) rather than re-rolling.
  • Add a new Reasoning.getExamResults(int) overload to format text from a supplied score, and deprecate the randomized no-arg variant.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
MekHQ/src/mekhq/campaign/randomEvents/personalities/PersonalityController.java Uses the stored performance exam score when generating interview notes so UI values match.
MekHQ/src/mekhq/campaign/randomEvents/personalities/enums/Reasoning.java Adds a deterministic formatting overload for exam results and deprecates the randomized method.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread MekHQ/src/mekhq/campaign/randomEvents/personalities/enums/Reasoning.java Outdated
Comment thread MekHQ/src/mekhq/campaign/randomEvents/personalities/enums/Reasoning.java Outdated
AlexOldenburger and others added 2 commits May 15, 2026 18:25
Good catch

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@IllianiBird IllianiBird left a comment

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.

What a dumb bug, thanks for fixing this

@IllianiBird IllianiBird merged commit 1505d00 into MegaMek:main May 16, 2026
8 checks passed
@AlexOldenburger AlexOldenburger deleted the feature/fixExamPercentReporting branch May 16, 2026 18:42
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.

[Issue] Text mismatch on Personnel Market Settings

3 participants