Skip to content

I253 add counts to team status pane#1092

Open
clevengr wants to merge 3 commits intopc2ccs:developfrom
clevengr:i253_add_counts_to_team_status_pane
Open

I253 add counts to team status pane#1092
clevengr wants to merge 3 commits intopc2ccs:developfrom
clevengr:i253_add_counts_to_team_status_pane

Conversation

@clevengr
Copy link
Contributor

@clevengr clevengr commented May 8, 2025

Description of what the PR does

Adds "counts" to the Team Status screen labels. Includes a button group that allows toggling between two representations of count values: either the raw number of teams currently in each status category (essentially, a count of the number of teams of each "status color"), or a cummulative total of teams that are or have been in that state.

For example, if two teams have logged in, and one of them has subsequently submitted a run, then the "raw" count display would show one team in the "Has Logged In" state and one team in the "Has Submitted Runs" state, while the "cummulative" count display would show two teams in the "Has Logged In" state and one in the "Has Submitted Runs" state.

The majority of the development (code) in this PR was done by Doug Lane (R.I.P.) and was ported from a branch in his fork (see for reference PR #264, which was closed by Doug without being merged.) The main contribution of the author of this PR (other than porting Doug's work into the current codebase) was to add GUI radio buttons which allow toggling between the two "count modes" (Doug's work already had support for a mouse CTRL-CLICK doing the same thing.)

Issue which the PR addresses

Fixes #253

Environment in which the PR was developed (OS,IDE, Java version, etc.)

Windows 11, Eclipse 2020-12, Java version "11.0.16.1" 2022-08-18 LTS

Precise steps for testing the PR

  • Start a contest.
  • Start a PC2 Admin, select the "Team Status" screen.
    • Verify that the "By Status" radio button is selected (this is the default).
    • Verify that the five labels across the top show counts (in parentheses) as follows:
      • No Contact: the total number of teams in your contest.
      • All others: "(0)".
    • Click the "Cummulative" button at the bottom.
    • Verify that the five labels still show the same counts.
  • Login as a team.
  • On the Admin Team Status screen, select the "By State" button, then verify that the counts in the Status labels are as follows:
    • No Contact: one less than the number of teams in your contest
    • Has Logged in: (1)
    • All others: (0)
  • Select the "Cummulative" button; verify that the counts in the Status labels do not change.
  • Login as a different team.
  • On the Admin Team Status screen, select the "By State" button, then verify that the counts in the Status labels are as follows:
    • No Contact: two less than the number of teams in your contest
    • Has Logged in: (2)
    • All others: (0)
  • Select the "Cummulative" button; verify that the counts in the Status labels do not change.
  • Submit a Run from one of the teams.
  • On the Admin Team Status screen, select the "By State" button, then verify that the counts in the Status labels are as follows:
    • No Contact: two less than the number of teams in your contest
    • Has Logged in: (1) (this is because the team that submitted a run has moved on from the "logged in" state)
    • Submitted Runs: (1)
    • All others: (0)
  • Select the "Cummulative" button, then verify that the counts in the Status labels are as follows:
    • No Contact: two less than the number of teams in your contest
    • Has Logged in: (2) ("Cummulative" shows "how many teams have logged in", not just "who's still only 'just logged in'")
    • Submitted Runs: (1)
    • All others: (0)
  • Submit a Clarification from the team that did NOT submit the run.
  • On the Admin Team Status screen, select the "By State" button, then verify that the counts in the Status labels are as follows:
    • No Contact: two less than the number of teams in your contest
    • Has Logged in: (0) (this is because all teams that have logged in have moved to a new state)
    • Submitted Runs: (1)
    • Submitted Clars: (1)
    • Ready: (0)
  • Select the "Cummulative" button, then verify that the counts in the Status labels are as follows:
    • No Contact: two less than the number of teams in your contest
    • Has Logged in: (2)
    • Submitted Runs: (1)
    • Submitted Clars: (1)
    • Ready: (0)
  • Submit a Clarification from the team that previously submitted a run.
  • On the Admin Team Status screen, select the "By State" button, then verify that the counts in the Status labels are as follows:
    • No Contact: two less than the number of teams in your contest
    • Has Logged in: (0) (again, this is because all teams that have logged in have moved to a new state)
    • Submitted Runs: (0) (this is because the [only] team that has submitted a run has moved to a new state, "Ready")
    • Submitted Clars: (1)
    • Ready: (1)
  • Select the "Cummulative" button, then verify that the counts in the Status labels are as follows:
    • No Contact: two less than the number of teams in your contest
    • Has Logged in: (2)
    • Submitted Runs: (1)
    • Submitted Clars: (2)
    • Ready: (1)

The above sequence should be sufficient to demonstrate that "By State" shows counts of teams IN EACH STATE (i.e., the counts of teams rendered in the corresponding color), while "Cummulative" shows counts of how many teams are or ever were in that state.

@clevengr clevengr added enhancement New feature or request Usability Issue This is an enhancement for which there is currently no usable workaround low priority An issue that can be deferred labels May 8, 2025
@kkarakas
Copy link
Collaborator

I did all the test cases, they all work. I have couple of points I would like to make.
Just to confirm "By Status" button which you mentioned doesn't exist right? Did you meant to say "By State" button. I just want to make sure I am not having UI issues.
When there are no logged in teams and the status count is changed from By State to Cumulative all the team listing disappear. However when there is a team that submitted a run this does not happen.
When Cumulative radio button is selected and then it is switched to By State button team names do not come back unless reloaded, is that expected?
So 'READY' means a team that has submitted a run and submitted a clarification?

Copy link
Collaborator

@kkarakas kkarakas left a comment

Choose a reason for hiding this comment

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

code looks good.

@@ -0,0 +1,33 @@
package edu.csus.ecs.pc2.core;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should files that only contain enums have copyright?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree. This needs a copyright notice.

Copy link
Collaborator

@johnbrvc johnbrvc left a comment

Choose a reason for hiding this comment

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

I've tested this and it seems to work.
I made some minor comments. I think the spelling errors in the help message should be fixed before approval.

@@ -0,0 +1,33 @@
package edu.csus.ecs.pc2.core;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree. This needs a copyright notice.

if (showTeamsCheckBox == null) {
showTeamsCheckBox = new JCheckBox();
showTeamsCheckBox.setText("Show enabled teams");
showTeamsCheckBox.setText("Show only scoreboard teams");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I might argue that "Show non-hidden teams" is a better description?

private String statusCountWhatsThisMessage = //
"\nThe count values (in parentheses) in the STATUS header can be configured in two modes." //
+ "\nIf 'By State' is selected, each count represents the total number of teams in precisely that state." //
+ "\nIf 'Cummulative' is selected, each count represents the total number of teams who are OR WERE AT SOME POINT in that state." //
Copy link
Collaborator

Choose a reason for hiding this comment

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

One "m" in cumulative.

+ "\nIf 'Cummulative' is selected, each count represents the total number of teams who are OR WERE AT SOME POINT in that state." //
+ "\n\nFor example, if two teams login in, and then one of those teams submits a run," //
+ "\n'By State' will show one team in the 'Has Logged In' state and one team in the 'Submitted Run(s)' state," //
+ "\nwhereas 'Cummulative' will show that TWO teams have logged in (and one is currently in the 'Submitted Run(s)' state)." //
Copy link
Collaborator

Choose a reason for hiding this comment

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

One "m" in cumulative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request low priority An issue that can be deferred Usability Issue This is an enhancement for which there is currently no usable workaround

Projects

None yet

Development

Successfully merging this pull request may close these issues.

For Team Status, add counts after each status, ex. Submitted Clars(25)

3 participants