Skip to content

Conversation

@MImran2002
Copy link
Contributor

@MImran2002 MImran2002 commented Apr 3, 2025

Bonner requirements checkmarks on the profile page

Fixes #1370

  • The checkmarks for Bonner requirements on the profile page should respect the frequency of the requirement. Something that is required once, would have (1/1) or (0/1). Something that is required twice should have (0/2) or (1/2) or (2/2), every term should show the numbers of time they have done the certification against the total expected certification based on their class level. For example if they are Junior they will likely have (0-5/5) or (0-6/6).

Changes

  • Add options for both term and twice in Bonner Management under Brian as admin.
  • Reproduce the certification requirement with counts (1/1) if they have done and (0/1) if they have not (This may vary based on frequency.

Edge-cases to consider before testing:

  • These edge case are because the numbers populated are based on two things: the current term and the student's rawClassLevel.
  • If any of the cases disrupt these two things it will display no data or wrong data.
  • Cases to avoid:
    1. If you create a new event on top of an existing event that has the same term and the same frequency, only one of those events will appear.

    2. Another scenario occurs when the current term is Fall 2023, but an event is created in Spring 2024, and a student is marked as attended for that Spring 2024 event. In this case, the student is being assigned attendance for a future term, so it will not appear in the count.

    3. This logic also applies to the past. For example, if a student is a sophomore and the current term is Spring 2023, the list only populates terms from Spring 2023 back to their Freshman year (Spring 2023, Fall 2022, Spring 2022, Fall 2021).
      Any events created before or after these term ranges will not appear in the counts.

    4. Another case is where if the event is created during summer terms it will not count, as certification events do not happen during summer and if the current term is summer and you hover over the view it will show the admin the Fall term instead of Summer term as the idea is to inform the admin of certification being needed for Fall term as there's no certification for the Summer term.

Testing

Navigating to the branch

  • Use git checkout bonnerCheckmarkProfile
  • Pull the code with git pull
  • Reset the database with to test and run tests/run_tests.sh
  • Run the application with flask run
  • Make your way to the navigate bar and click on admin drop down feature
  • Click Bonner_Management and go to Requirements and click on the "Add Requirement" button then name it and choose every term as the Frequency
  • Note: Make sure that the term that you picked for the event when creating it is a term at which the cohort you picked will be attending school (not graduated at that time ) and not earlier than the current term. Otherwise, it won't show up.

Creating and checking the certification

All of the testing must make sure that the term the event is created in because the event must be created between the current term and the term they came to Berea College (you can see the current term in the setting > term management or when you create an event the term that is auto selected is the current term)

  • Go to Create Event and Select Bonner Scholars to create certification events
  • Create an Event and make sure you choose the Bonner Requirement that you added a while ago.
  • Select the invite cohorts that has Zach Neill.
  • And click Create Event
  • Go to manage volunteers where the RSVP and Waitlist checked Zach Neill as attended and saved
  • Then go to the side bar and navigate to Zach Neill as a user
  • Go to My Profile and click the Bonner Program dropdown
  • You will see the tick if you have finished and a number of cross on the terms you have not
  • Hover over the requirement that you created and will see the tooltips

Copy link
Contributor

@WackyWeaver WackyWeaver left a comment

Choose a reason for hiding this comment

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

There is a html logic issue on the tool tip when there have been no attended terms. Also, the tooltip never shifts when there are fewer terms available for underclassmen.

WackyWeaver
WackyWeaver previously approved these changes May 1, 2025
Copy link
Contributor

@WackyWeaver WackyWeaver left a comment

Choose a reason for hiding this comment

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

LTGM! Please add a comment for the formula in missedTerms and rename certs

WackyWeaver
WackyWeaver previously approved these changes May 2, 2025
Copy link
Contributor

@WackyWeaver WackyWeaver left a comment

Choose a reason for hiding this comment

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

I appreciate the comments added to the calculating logic section. A little long compared to a lot in the rest of the code base, but everything else LGTM!

@Karina-Agliullova Karina-Agliullova self-requested a review May 7, 2025 17:39
@ojmakinde ojmakinde self-requested a review November 20, 2025 20:34
Copy link
Contributor

@ojmakinde ojmakinde left a comment

Choose a reason for hiding this comment

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

I pulled from prod-backup and searched up Syakira's profile. Syakira is a bonner that has a rawClassLevel of null. Here's the SQL query:

select user.username, user.rawClassLevel from user inner join bonnercohort on user.username=bonnercohort.user_id where rawClassLevel is NULL and user.username LIKE '%wij%';
+----------+---------------+
| username | rawClassLevel |
+----------+---------------+
| wijayas  | NULL          |
+----------+---------------+
1 row in set (0.001 sec)

Here's her bonner profile page:

Image

Also, here's Chase Ackerman's profile:
image

@RueHaile
Copy link
Contributor

I pulled from prod-backup and searched up Syakira's profile. Syakira is a bonner that has a rawClassLevel of null. Here's the SQL query:

select user.username, user.rawClassLevel from user inner join bonnercohort on user.username=bonnercohort.user_id where rawClassLevel is NULL and user.username LIKE '%wij%';
+----------+---------------+
| username | rawClassLevel |
+----------+---------------+
| wijayas  | NULL          |
+----------+---------------+
1 row in set (0.001 sec)

Here's her bonner profile page:

Image Also, here's Chase Ackerman's profile: image

That is a great point. We handle the rawClassLevel as an SQL NULL, rather than the string we had to catch that edge case. Now it is also working for syakira and other rawClassLevel = NULL people. It populates the number of terms as 8, as they have attended 8 terms to graduate.

Demonstration:
image

@ojmakinde
Copy link
Contributor

ojmakinde commented Nov 21, 2025

@RueHaile, your image says "Bonner Orientation mine 0/8". There's only 1 Bonner Orientation event, if I remember correctly, and the "mine" is probably a typo. Additionally, I'm certain that Syakira did her Bonner Orientation and all the other required events, so there's a problem of a data mismatch happening somewhere in our data.

It's likely that the events were not tagged as requirement matches, and in that case, we may need to scan through all the events attended, and find the matches. An alternative could also be writing a script that does that traversal for every student and populates the database. @BrianRamsay

@RueHaile
Copy link
Contributor

@RueHaile, your image says "Bonner Orientation mine 0/8". There's only 1 Bonner Orientation event, if I remember correctly, and the "mine" is probably a typo. Additionally, I'm certain that Syakira did her Bonner Orientation and all the other required events, so there's a problem of a data mismatch happening somewhere in our data.

It's likely that the events were not tagged as requirement matches, and in that case, we may need to scan through all the events attended and find the matches. An alternative could also be writing a script that does that traversal for every student and populates the database. @BrianRamsay

@ojmakinde, the picture that you see above with the "mine" is mine, as the name implies, I created it, and so that is why she didn't attend any of it. If you reset the data to prod-backup, you can see that there is a bonner orientation of frequency of one, and not eight. I added the picture to demonstrate that the field is getting populated. The Bonner orientation has not been attended by her and almost all others. I will look into the data mismatch, as it is a possibility.
image

@RueHaile
Copy link
Contributor

RueHaile commented Nov 24, 2025

@ojmakinde: It seems like a lack of data, rather than a bug/data mismatch/ as we went in while the database was set to development.
PROOF:
image
and we got:-
image

WHICH means that no data is saved for the event of booner orientation other than for event_id= 476 & 708 (Doesn't have any participants), where event_id = 476 is found to have data in terms of rsvp but not as eventattendees despite the addition of "utsa: a volunteer, she would be not get populated mark as bonner oriantation happens once for every stident on their freshman year.

@JohnCox2211
Copy link
Contributor

JohnCox2211 commented Dec 1, 2025

It appears that the credit for new requirements is not being added to user profiles when a new requirement is created.

image image image

The mark was not initially showing up for the test, so I edited the event to be an orientation, which then appeared. When I switched it back to the test requirement, the orientation mark stayed, and there was still no mark for the test requirement.

When I tried this again, there was no longer a mark by the orientation when I changed the requirement to test, and there was still no check next to the test requirement. I then added an additional Bonner event for All Bonner Meeting, and added Zach; the check for the requirement did not appear next to All Bonner Meeting on their profile either, so neither the test requirement nor the All Bonner Meeting requirement appears.

image

@MImran2002
Copy link
Contributor Author

MImran2002 commented Dec 2, 2025

It appears that the credit for new requirements is not being added to user profiles when a new requirement is created.

image image image
The mark was not initially showing up for the test, so I edited the event to be an orientation, which then appeared. When I switched it back to the test requirement, the orientation mark stayed, and there was still no mark for the test requirement.

When I tried this again, there was no longer a mark by the orientation when I changed the requirement to test, and there was still no check next to the test requirement. I then added an additional Bonner event for All Bonner Meeting, and added Zach; the check for the requirement did not appear next to All Bonner Meeting on their profile either, so neither the test requirement nor the All Bonner Meeting requirement appears.

image

Hi John, I have throughly looked through what you said definitely it is something to think about, I looked at and found the bug but the bug depends what the current term is in test the current term is flexible and we can assigned because of this line of code which it does is find all terms where the student have attended while the total term populate it base on the current term. Lets say the event is created at Spring 2025 while the current term is Spring 2021 because of the line: attendedTerms = set(term for term in attendedTerms if term in totalTerms) it will only accept terms that are with the four year range below Spring 2021. That is why the bug exist. We can definitely talk about this at work and hopefully the bug recreation i did is like yours and this is the issue. If this is the case then we should look into if it is an actual bug or more of a administrative edge case they wouldn't happen in real life. We should definitely talk to @ojmakinde !

@JohnCox2211
Copy link
Contributor

It appears that the credit for new requirements is not being added to user profiles when a new requirement is created.
image image image
The mark was not initially showing up for the test, so I edited the event to be an orientation, which then appeared. When I switched it back to the test requirement, the orientation mark stayed, and there was still no mark for the test requirement.
When I tried this again, there was no longer a mark by the orientation when I changed the requirement to test, and there was still no check next to the test requirement. I then added an additional Bonner event for All Bonner Meeting, and added Zach; the check for the requirement did not appear next to All Bonner Meeting on their profile either, so neither the test requirement nor the All Bonner Meeting requirement appears.
image

Hi John, I have throughly looked through what you said definitely it is something to think about, I looked at and found the bug but the bug depends what the current term is in test the current term is flexible and we can assigned because of this line of code which it does is find all terms where the student have attended while the total term populate it base on the current term. Lets say the event is created at Spring 2025 while the current term is Spring 2021 because of the line: attendedTerms = set(term for term in attendedTerms if term in totalTerms) it will only accept terms that are with the four year range below Spring 2021. That is why the bug exist. We can definitely talk about this at work and hopefully the bug recreation i did is like yours and this is the issue. If this is the case then we should look into if it is an actual bug or more of a administrative edge case they wouldn't happen in real life. We should definitely talk to @ojmakinde !

When looking into this further, I noticed the same issue with the mark for an event not appearing next to the requirement on the student's page, even when the event was set to have happened and was attended before the current term. The current term is summer 2021, and I created the event for November 2020. I followed the rest of the steps previously done and still ended up with 0/3 on the created requirement and on All Bonner Meeting.

@RueHaile
Copy link
Contributor

RueHaile commented Dec 2, 2025

It appears that the credit for new requirements is not being added to user profiles when a new requirement is created.
image image image
The mark was not initially showing up for the test, so I edited the event to be an orientation, which then appeared. When I switched it back to the test requirement, the orientation mark stayed, and there was still no mark for the test requirement.
When I tried this again, there was no longer a mark by the orientation when I changed the requirement to test, and there was still no check next to the test requirement. I then added an additional Bonner event for All Bonner Meeting, and added Zach; the check for the requirement did not appear next to All Bonner Meeting on their profile either, so neither the test requirement nor the All Bonner Meeting requirement appears.
image

Hi John, I have throughly looked through what you said definitely it is something to think about, I looked at and found the bug but the bug depends what the current term is in test the current term is flexible and we can assigned because of this line of code which it does is find all terms where the student have attended while the total term populate it base on the current term. Lets say the event is created at Spring 2025 while the current term is Spring 2021 because of the line: attendedTerms = set(term for term in attendedTerms if term in totalTerms) it will only accept terms that are with the four year range below Spring 2021. That is why the bug exist. We can definitely talk about this at work and hopefully the bug recreation i did is like yours and this is the issue. If this is the case then we should look into if it is an actual bug or more of a administrative edge case they wouldn't happen in real life. We should definitely talk to @ojmakinde !

Note: There are edge cases that we need to account for when testing, such as the fact that certain students may not be present for specific semesters. As @MImran2002 said, we need to find a term that the student has attended while also making sure that, based on the current term that is set on the manage tab, it is a viable option as a term .

Copy link
Contributor

@Karina-Agliullova Karina-Agliullova left a comment

Choose a reason for hiding this comment

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

PR looks good! Tested it thoroughly and the code looks clean. Good job!

@github-actions
Copy link

View Code Coverage

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.

Bonner requirements checkmarks on the profile page